decocms 4.400.6 → 4.401.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (416) hide show
  1. package/dist/client/assets/{AlertCircle-CiIF9Yxb.js → AlertCircle-D1gV07Oe.js} +1 -1
  2. package/dist/client/assets/{AreaChart-CiScmeLa.js → AreaChart-lv4gftWl.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-Cw8zoASu.js → ArrowLeft-Bpb3sor7.js} +1 -1
  4. package/dist/client/assets/{ArrowRight-DXuJxv6z.js → ArrowRight-BFyYdKNd.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-i7W4PLl8.js → ArrowUp-COLR6KTW.js} +1 -1
  6. package/dist/client/assets/{CartesianChart-CAtvwpDL.js → CartesianChart-CJGGumCB.js} +1 -1
  7. package/dist/client/assets/{Check-Cxn5ODoZ.js → Check-C-Vn17o5.js} +1 -1
  8. package/dist/client/assets/{CheckCircle-Cb0ohXc_.js → CheckCircle-CyKBJceB.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-B3Rmv2Rm.js → ChevronUp-Dto8qCq2.js} +1 -1
  10. package/dist/client/assets/{Copy01-CDFMtB2-.js → Copy01-B2GuMU9Q.js} +1 -1
  11. package/dist/client/assets/{CreditCard01-Bpp7DUE2.js → CreditCard01-CoMSE38C.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-CsphgVVa.js → DotsVertical-R1tuLE9v.js} +1 -1
  13. package/dist/client/assets/{ErrorBarContext-Cmgr12jK.js → ErrorBarContext-viPSAyu4.js} +1 -1
  14. package/dist/client/assets/{Eye-BaKrr1k0.js → Eye-BhTmzCKr.js} +1 -1
  15. package/dist/client/assets/{Globe04-BjYimuB_.js → Globe04-BLoVxWaz.js} +1 -1
  16. package/dist/client/assets/{Image01-BokX_Ygh.js → Image01-D02_x5mu.js} +1 -1
  17. package/dist/client/assets/{Key01--iK_92aj.js → Key01-BuudAO_W.js} +1 -1
  18. package/dist/client/assets/{LayoutLeft-DbmxTpPW.js → LayoutLeft-CuG2yJZR.js} +1 -1
  19. package/dist/client/assets/{Line-CkGSu-B6.js → Line-CsKmpStn.js} +1 -1
  20. package/dist/client/assets/{Link01-CwRVjiFm.js → Link01-CVUd8ZSz.js} +1 -1
  21. package/dist/client/assets/{LinkExternal01-C1LIoQUC.js → LinkExternal01-Bo5cppL4.js} +1 -1
  22. package/dist/client/assets/{Monitor01-B-jx6SlO.js → Monitor01-Cj93oSbT.js} +1 -1
  23. package/dist/client/assets/{Palette-BZ8zPcQQ.js → Palette-CEa7GqA9.js} +1 -1
  24. package/dist/client/assets/{Plus-BeOCeSsu.js → Plus-Ch1uJBgh.js} +1 -1
  25. package/dist/client/assets/{SearchMd-CmoIwdFD.js → SearchMd-B_MXZ22A.js} +1 -1
  26. package/dist/client/assets/{Sector-L9R2CZ3j.js → Sector-CNfzRqjQ.js} +1 -1
  27. package/dist/client/assets/{Share07-BQpOEypi.js → Share07-D6XgmppM.js} +1 -1
  28. package/dist/client/assets/{Sun-BwQeSpzv.js → Sun-Dy_rDhHe.js} +1 -1
  29. package/dist/client/assets/{Tool01-CFPgtTUB.js → Tool01-BoO1X0ZH.js} +1 -1
  30. package/dist/client/assets/{Trash01-yjy5Djos.js → Trash01-D4CwdSy9.js} +1 -1
  31. package/dist/client/assets/{Upload01-C3YaZ92x.js → Upload01-hQyKBWZL.js} +1 -1
  32. package/dist/client/assets/{User01-CxY9-OxA.js → User01-gmEyKvLo.js} +1 -1
  33. package/dist/client/assets/{UserSquare-D1SexGLq.js → UserSquare-DXqYCX9F.js} +1 -1
  34. package/dist/client/assets/{Users01-C234jzz1.js → Users01-BBb4-Wbt.js} +1 -1
  35. package/dist/client/assets/{X-C49OUFcX.js → X-CEngH8b7.js} +1 -1
  36. package/dist/client/assets/{XClose-CKQjrGZS.js → XClose-Dvx_qcsQ.js} +1 -1
  37. package/dist/client/assets/{Zap-GTFewWZO.js → Zap-DkS3ccHw.js} +1 -1
  38. package/dist/client/assets/{ZoomOut-BCbY44Eu.js → ZoomOut-D3wne5dx.js} +1 -1
  39. package/dist/client/assets/{access-gate-BWJ5-fyg.js → access-gate-D2mi3EXZ.js} +1 -1
  40. package/dist/client/assets/{add-connection-dialog-BRSOSKaa.js → add-connection-dialog-mm-WrmAR.js} +1 -1
  41. package/dist/client/assets/agent-analytics-IX3kP91L.js +2 -0
  42. package/dist/client/assets/agent-app-CliE0mM3.js +1 -0
  43. package/dist/client/assets/agent-assets-BbU_YrcZ.js +1 -0
  44. package/dist/client/assets/agent-automation-v13d06rk.js +20 -0
  45. package/dist/client/assets/agent-automations-yzTI8Hoc.js +1 -0
  46. package/dist/client/assets/agent-connect-sources-CEF4jbih.js +1 -0
  47. package/dist/client/assets/agent-deck-rRdXFIQU.js +1 -0
  48. package/dist/client/assets/agent-e2e-SKpj9Qv7.js +1 -0
  49. package/dist/client/assets/agent-experiments-DPD7MHX9.js +1 -0
  50. package/dist/client/assets/agent-file-CBIwfV0H.js +1 -0
  51. package/dist/client/assets/{agent-git-CEsra0W5.js → agent-git-N-SzMySX.js} +2 -2
  52. package/dist/client/assets/agent-hosting-BnzsqBpZ.js +1 -0
  53. package/dist/client/assets/{agent-icon-B4H17A-3.js → agent-icon-CjNFk4Bw.js} +1 -1
  54. package/dist/client/assets/agent-library-file-DHUyHSwO.js +1 -0
  55. package/dist/client/assets/agent-monitor-BeURekaz.js +1 -0
  56. package/dist/client/assets/agent-overview-By923wES.js +1 -0
  57. package/dist/client/assets/agent-settings-DiYW6DT3.js +1 -0
  58. package/dist/client/assets/{agent-site-editor-DqHsR1Oa.js → agent-site-editor-B7WR4KwZ.js} +13 -13
  59. package/dist/client/assets/agent-site-editor-code-A3lMFnBk.js +2 -0
  60. package/dist/client/assets/agent-site-editor-content-CTyxs9-E.js +9 -0
  61. package/dist/client/assets/agent-site-editor-preview-Db1buU8G.js +518 -0
  62. package/dist/client/assets/agent-view-Ct7YMMW7.js +1 -0
  63. package/dist/client/assets/{agent-view-guard-AncI1H8B.js → agent-view-guard-BpwecHVM.js} +1 -1
  64. package/dist/client/assets/agents-list-XIrdiWMz.js +1 -0
  65. package/dist/client/assets/{ai-providers-C91I1RIi.js → ai-providers-CsYNRATt.js} +2 -2
  66. package/dist/client/assets/{alert-Vv8Gd72t.js → alert-BYraKSPm.js} +1 -1
  67. package/dist/client/assets/{alert-dialog-p_yxBHYu.js → alert-dialog-DpzgB-Ls.js} +1 -1
  68. package/dist/client/assets/{analytics-sections-CJlCPTTn.js → analytics-sections-C2rbPWDv.js} +1 -1
  69. package/dist/client/assets/api-keys-B9Lt-UrM.js +1 -0
  70. package/dist/client/assets/api-keys-CzlAuC7_.js +1 -0
  71. package/dist/client/assets/app-editor-tD7rn_1-.js +1 -0
  72. package/dist/client/assets/{asset-utils-brdDGay3.js → asset-utils-4p52RC3c.js} +1 -1
  73. package/dist/client/assets/{auth-DN1jUXQS.js → auth-Dafjkfpj.js} +1 -1
  74. package/dist/client/assets/{auth-catchall-B8jjuh3t.js → auth-catchall-DD401U-a.js} +1 -1
  75. package/dist/client/assets/auth-entry-CEr7Y2wf.js +1 -0
  76. package/dist/client/assets/{auth-split-layout-9lXDS5uC.js → auth-split-layout-DLRovWby.js} +1 -1
  77. package/dist/client/assets/{authenticate-and-persist-oauth-BS0KLtdr.js → authenticate-and-persist-oauth-DIl2N_8B.js} +1 -1
  78. package/dist/client/assets/{automation-list-row-Z-oEG96S.js → automation-list-row-ueTfZfDa.js} +1 -1
  79. package/dist/client/assets/{automation-runs-BfoVhm3K.js → automation-runs-iTxxsepZ.js} +1 -1
  80. package/dist/client/assets/{automations-BPxNxlY1.js → automations-Cad12Ows.js} +1 -1
  81. package/dist/client/assets/{autosend-C9lP7MMD.js → autosend-DeYn5nkP.js} +1 -1
  82. package/dist/client/assets/{avatar-CaSFUaWf.js → avatar-B6HmPhM4.js} +1 -1
  83. package/dist/client/assets/{badge-DO3CQ_LV.js → badge-4kURMy-V.js} +1 -1
  84. package/dist/client/assets/block-document-CgGOvOyl.js +3 -0
  85. package/dist/client/assets/{blocks-preview-workspace-context-Bsh7P3Oa.js → blocks-preview-workspace-context-Bm8P7H4k.js} +1 -1
  86. package/dist/client/assets/{buckets-DAqePqsj.js → buckets-CK1WY8Rz.js} +1 -1
  87. package/dist/client/assets/{build-improve-prompt-doc-DKmCIRM5.js → build-improve-prompt-doc-BYdufdhy.js} +1 -1
  88. package/dist/client/assets/{calendar-v3rFo_Cq.js → calendar-CZsGTekl.js} +1 -1
  89. package/dist/client/assets/{capability-load-error-nzBIi4Tr.js → capability-load-error-CaE4aliY.js} +1 -1
  90. package/dist/client/assets/{use-org-repo-syncs-BMiVfW6D.js → cards-DaNm0Rmg.js} +3 -3
  91. package/dist/client/assets/category-editor-CyFQk1RV.js +1 -0
  92. package/dist/client/assets/{chart-CXdIvQqa.js → chart-_YADtzsN.js} +1 -1
  93. package/dist/client/assets/{chat-context-CypzFnUJ.js → chat-context-v9O7Tar9.js} +5 -5
  94. package/dist/client/assets/{chat-draft-bJa35Dyv.js → chat-draft-BSL5UQWs.js} +1 -1
  95. package/dist/client/assets/{checkbox-RuVP2KAD.js → checkbox-BMxilLAm.js} +1 -1
  96. package/dist/client/assets/{choose-editor-B6bnAbTO.js → choose-editor-TgQWBIvA.js} +1 -1
  97. package/dist/client/assets/{claim-phase-copy-IBG3Spfs.js → claim-phase-copy-DHsomph6.js} +1 -1
  98. package/dist/client/assets/{cli-auth-success-Gnusnqeq.js → cli-auth-success-Bsu7TVxL.js} +1 -1
  99. package/dist/client/assets/{client-icons-DeH3wN29.js → client-icons-PiLBRjl7.js} +1 -1
  100. package/dist/client/assets/{collapsible-Bx8hZ5vv.js → collapsible-bc19817o.js} +1 -1
  101. package/dist/client/assets/collection-detail-DpwCwzTH.js +1 -0
  102. package/dist/client/assets/{collection-display-button-B4JQi_wC.js → collection-display-button-BBRywDRf.js} +1 -1
  103. package/dist/client/assets/{collection-search-CPwy4oTQ.js → collection-search-kj64tBFw.js} +1 -1
  104. package/dist/client/assets/{collection-table-wrapper-DzLC9Cad.js → collection-table-wrapper-D2tmoW8T.js} +1 -1
  105. package/dist/client/assets/collection-tabs-DCLfzEOA.js +1 -0
  106. package/dist/client/assets/{combobox-bXWHxi5l.js → combobox-DlQnH8_N.js} +1 -1
  107. package/dist/client/assets/command-vKgGCoFF.js +1 -0
  108. package/dist/client/assets/{companion-mcps-section-BiiIWMdJ.js → companion-mcps-section-Dpcawwvl.js} +1 -1
  109. package/dist/client/assets/connect-Dick3000.js +8 -0
  110. package/dist/client/assets/{connect-layout-C5m144rF.js → connect-layout-BfLs3zCI.js} +1 -1
  111. package/dist/client/assets/{connection-C1Cmv_sz.js → connection-CTAV5crm.js} +1 -1
  112. package/dist/client/assets/{connection-card-lUin0zXZ.js → connection-card-DXWUKoxP.js} +1 -1
  113. package/dist/client/assets/connection-detail-BsIDB4zB.js +1 -0
  114. package/dist/client/assets/{connection-form-helpers-DiXUvzY1.js → connection-form-helpers-BrejHCrx.js} +1 -1
  115. package/dist/client/assets/connections-dBKfZKZY.js +1 -0
  116. package/dist/client/assets/{context-lYPc9MR3.js → context-VbsY_yj4.js} +1 -1
  117. package/dist/client/assets/{create-organization-dialog-CVGvbMrB.js → create-organization-dialog-BCpMYw7e.js} +1 -1
  118. package/dist/client/assets/{decofile-api-D2rDGWIR.js → decofile-api-5Nr0-h_v.js} +1 -1
  119. package/dist/client/assets/{decopilot-DZa7cUdc.js → decopilot-DlmPNMn_.js} +2 -2
  120. package/dist/client/assets/dialog-CEiE0rPQ.js +1 -0
  121. package/dist/client/assets/discover-BvxkrONV.js +1 -0
  122. package/dist/client/assets/{domain-settings-BoCWiWyd.js → domain-settings-D1tynvCC.js} +1 -1
  123. package/dist/client/assets/{download-app-dialog-B8fu6N4W.js → download-app-dialog-fmWolHKD.js} +1 -1
  124. package/dist/client/assets/{drawer-Dj7i5SNu.js → drawer-mNZA6mOf.js} +1 -1
  125. package/dist/client/assets/{editor-CStKuO5E.js → editor-BGAJHie_.js} +1 -1
  126. package/dist/client/assets/{empty-state-DuOhKQcg.js → empty-state-BJxP56xq.js} +1 -1
  127. package/dist/client/assets/{empty-state-C8J78MMg.js → empty-state-BgjUu2bT.js} +1 -1
  128. package/dist/client/assets/{extract-connection-data-BN6Gn7S7.js → extract-connection-data-erEsLv_0.js} +1 -1
  129. package/dist/client/assets/{feature-gate-BYtexfTr.js → feature-gate-BdRUy7K_.js} +1 -1
  130. package/dist/client/assets/{feature-paywall-Do9-TIse.js → feature-paywall-Tj9HTPlX.js} +1 -1
  131. package/dist/client/assets/{file-explorer-sM87NUct.js → file-explorer-0KdYuesc.js} +2 -2
  132. package/dist/client/assets/{file-preview-Cctwbzua.js → file-preview-i5I4Vmk2.js} +1 -1
  133. package/dist/client/assets/file-share-button-FS8XJyOj.js +3 -0
  134. package/dist/client/assets/{file-type-icon-C--_TBMw.js → file-type-icon-Cv10yXI0.js} +1 -1
  135. package/dist/client/assets/{folder-icon-Be-ry1Lo.js → folder-icon-DJuQAXN-.js} +1 -1
  136. package/dist/client/assets/{form-msoIoPH9.js → form-CCT2OtgN.js} +1 -1
  137. package/dist/client/assets/{gateway-client-B7EtyAUZ.js → gateway-client-hbsOo-al.js} +1 -1
  138. package/dist/client/assets/{general-B5uAiOFe.js → general-B_HDEt1Q.js} +1 -1
  139. package/dist/client/assets/{github-icon-Czf3JIe0.js → github-icon-BpCOzzV8.js} +1 -1
  140. package/dist/client/assets/home-CMRSzFNz.js +1 -0
  141. package/dist/client/assets/{hooks-BunFzIMc.js → hooks-CcmbiBeQ.js} +4 -4
  142. package/dist/client/assets/{icon-button-TBoaqswf.js → icon-button-B8KzCtPE.js} +1 -1
  143. package/dist/client/assets/index-BeJdXzSv.css +1 -0
  144. package/dist/client/assets/{index-C4bcGTWO.js → index-BpvXUNGE.js} +27 -27
  145. package/dist/client/assets/index-BsLVRPrU.js +26 -0
  146. package/dist/client/assets/{index-Bv9cknRX.js → index-CDe2yrwT.js} +1 -1
  147. package/dist/client/assets/index-CGxhGPsv.js +5 -0
  148. package/dist/client/assets/{index-DU8D4REs.js → index-CKZ6XrRd.js} +1 -1
  149. package/dist/client/assets/{index-B4lO5kiB.js → index-CWksyNR9.js} +1 -1
  150. package/dist/client/assets/{index-BO3WDGm0.js → index-ClooW3Im.js} +1 -1
  151. package/dist/client/assets/{index-DNOKSPYL.js → index-DVgj8U7g.js} +1 -1
  152. package/dist/client/assets/index-D_lD_4br.js +1 -0
  153. package/dist/client/assets/{index-B-RfjkQs.js → index-De5sr9zh.js} +44 -44
  154. package/dist/client/assets/{index-bU1o14-j.js → index-Kwx27vNK.js} +1 -1
  155. package/dist/client/assets/index-bMw4G7-h.js +1 -0
  156. package/dist/client/assets/{index-CUoS9PHq.js → index-gldwodyc.js} +1 -1
  157. package/dist/client/assets/{index-haAT4fp-.js → index-ldS2WUeM.js} +1 -1
  158. package/dist/client/assets/index-redirect-CfY3ykU_.js +1 -0
  159. package/dist/client/assets/{infiniteQueryObserver-CFFZE0G7.js → infiniteQueryObserver-CwgE9ndj.js} +1 -1
  160. package/dist/client/assets/{infra-billing-CI3pPi6s.js → infra-billing-TzlPUT1_.js} +1 -1
  161. package/dist/client/assets/{input-DgwTyBrI.js → input-B-DIEGoS.js} +1 -1
  162. package/dist/client/assets/{input-CkBBlArz.js → input-CogQggtY.js} +1 -1
  163. package/dist/client/assets/input-DMbK8B2u.js +8 -0
  164. package/dist/client/assets/{integration-icon-DuRUAYQY.js → integration-icon-CsYMgjoT.js} +1 -1
  165. package/dist/client/assets/{label-COhaglCI.js → label-Baft7ecp.js} +1 -1
  166. package/dist/client/assets/{last-preview-page-C2BRWzsU.js → last-preview-page-DkIjQnDn.js} +1 -1
  167. package/dist/client/assets/{layout-ezpRdHMe.js → layout-CI3O4gkp.js} +1 -1
  168. package/dist/client/assets/{legacy-agents-deep-7Ua9_FGE.js → legacy-agents-deep-BvWpwcOc.js} +1 -1
  169. package/dist/client/assets/{legacy-main-redirect-CoKgMaf6.js → legacy-main-redirect-CQgWSIje.js} +1 -1
  170. package/dist/client/assets/library-CAwdTP4-.js +161 -0
  171. package/dist/client/assets/{login-zL3v_Zks.js → login-DJ5PeYOE.js} +1 -1
  172. package/dist/client/assets/{markdown-CL_7eJfo.js → markdown-UaZeehfy.js} +2 -2
  173. package/dist/client/assets/{mcp-app-renderer-BF1xjUD_.js → mcp-app-renderer-DVXFXjZU.js} +2 -2
  174. package/dist/client/assets/{mcp-oauth-CYUMx6Lt.js → mcp-oauth-DpJ1IX9I.js} +1 -1
  175. package/dist/client/assets/members-CXM5jx_X.js +1 -0
  176. package/dist/client/assets/message-templates-54foej4h.js +1 -0
  177. package/dist/client/assets/{mini-report-page-D2G_6nvn.js → mini-report-page-B1sFW1ww.js} +1 -1
  178. package/dist/client/assets/mock-board-BbS_eZEl.js +10 -0
  179. package/dist/client/assets/{monaco-editor-B-WPLOla.js → monaco-editor-B9FUV1NZ.js} +2 -2
  180. package/dist/client/assets/{monitoring-stats-row-IwXyXgpg.js → monitoring-stats-row-Cl5_OBZ5.js} +1 -1
  181. package/dist/client/assets/multi-select-VDMM47xB.js +1 -0
  182. package/dist/client/assets/{mustache-D5b2aALH.js → mustache-DZ4FV0Nc.js} +1 -1
  183. package/dist/client/assets/{oauth-callback-XaDe1ZVU.js → oauth-callback-OoZf3jL0.js} +1 -1
  184. package/dist/client/assets/{oauth-callback-ai-provider-CG6P6aWc.js → oauth-callback-ai-provider-foDaIFwI.js} +1 -1
  185. package/dist/client/assets/{onboarding-C0P9leUg.js → onboarding-Dq71FOpN.js} +1 -1
  186. package/dist/client/assets/{optimistic-project-sidebar-views-BULTvoQH.js → optimistic-project-sidebar-views-CgB8Gy1s.js} +1 -1
  187. package/dist/client/assets/org-file-open-context-Mx8jC4-P.js +1 -0
  188. package/dist/client/assets/{organization-choice-5mEr1aKE.js → organization-choice-ZqNf00EY.js} +1 -1
  189. package/dist/client/assets/{orgs-3MZWLo-q.js → orgs-B8y0HHqF.js} +1 -1
  190. package/dist/client/assets/page-seo-form-DPObRKD4.js +1 -0
  191. package/dist/client/assets/{pair-CSXFDEIQ.js → pair-D39JYx1G.js} +5 -5
  192. package/dist/client/assets/{plan-ladder-B7xKH1KD.js → plan-ladder-D85oNnSr.js} +1 -1
  193. package/dist/client/assets/{popover-DFY37Yvw.js → popover-DCaw39mN.js} +1 -1
  194. package/dist/client/assets/{post-calendar-Jvfo43V-.js → post-calendar-Dpixo2IP.js} +1 -1
  195. package/dist/client/assets/{post-editor-D0HMXnr-.js → post-editor-BivV74bZ.js} +1 -1
  196. package/dist/client/assets/{preview-content-DyylZdej.js → preview-content-ziDhpr9V.js} +1 -1
  197. package/dist/client/assets/{preview-dialog-GxP1iGgN.js → preview-dialog-DHJShsrA.js} +1 -1
  198. package/dist/client/assets/profile-C9xI3KvS.js +1 -0
  199. package/dist/client/assets/{project-app-view-C-S_SBUQ.js → project-app-view-CFWAaKq_.js} +1 -1
  200. package/dist/client/assets/project-feed-D6D6bSHY.js +1 -0
  201. package/dist/client/assets/{project-icon-CsZAOQy_.js → project-icon-CXM68zVZ.js} +1 -1
  202. package/dist/client/assets/project-reports-8SYQbI2J.js +1 -0
  203. package/dist/client/assets/project-tasks-DrEyprGU.js +1 -0
  204. package/dist/client/assets/{prompts-CvgNBkYO.js → prompts-CVNAEIJB.js} +1 -1
  205. package/dist/client/assets/record-editor-CKxwz78L.js +1 -0
  206. package/dist/client/assets/{redirect-editor-D2NLj98m.js → redirect-editor-Dy1UJRrv.js} +1 -1
  207. package/dist/client/assets/{reports-BCYtzeDa.js → reports-BvZHk8Hk.js} +2 -2
  208. package/dist/client/assets/reports-DyvsxSR9.js +1 -0
  209. package/dist/client/assets/{reports-onboarding-BG7_PC6g.js → reports-onboarding-D4Uaui5Y.js} +1 -1
  210. package/dist/client/assets/reports-tab-CwwTWlIS.js +2 -0
  211. package/dist/client/assets/{repositories-C5RyL_z1.js → repositories-CqbcdDdH.js} +1 -1
  212. package/dist/client/assets/{repository-import-picker-ByioO6uG.js → repository-import-picker-BXQhU82J.js} +1 -1
  213. package/dist/client/assets/{repository-picker-BPuZL7HO.js → repository-picker-D1hSYB_G.js} +1 -1
  214. package/dist/client/assets/require-capability-Cab5QyjH.js +1 -0
  215. package/dist/client/assets/{required-auth-layout-Duev8t_N.js → required-auth-layout-scRrBHKS.js} +1 -1
  216. package/dist/client/assets/{reset-password-JANPJ9Jd.js → reset-password-CDE1iX3h.js} +1 -1
  217. package/dist/client/assets/{resizable-yTD1tEOl.js → resizable-D2L182YF.js} +1 -1
  218. package/dist/client/assets/{review-settings-vW0-yRPH.js → review-settings-B98rLFs_.js} +1 -1
  219. package/dist/client/assets/{rich-text-link-control-BUscMTY0.js → rich-text-link-control-DwRx0-0K.js} +1 -1
  220. package/dist/client/assets/roles-CZvYgdUZ.js +1 -0
  221. package/dist/client/assets/route-B9TApoqS.js +1 -0
  222. package/dist/client/assets/route-N926-QRJ.js +1 -0
  223. package/dist/client/assets/route-OKy5_TxY.js +1 -0
  224. package/dist/client/assets/route-page-header-ErgCCo2N.js +1 -0
  225. package/dist/client/assets/runnable-block-editor-C2YphDcL.js +17 -0
  226. package/dist/client/assets/{sandbox-lifecycle-context-BZ0OGbvt.js → sandbox-lifecycle-context-o4KKoGrI.js} +2 -2
  227. package/dist/client/assets/{schema-kN4UiUD7.js → schema-DkZUkArz.js} +1 -1
  228. package/dist/client/assets/{scroll-area-DtmE_V3W.js → scroll-area-Ca9Mo_QH.js} +1 -1
  229. package/dist/client/assets/{search-input-5SNth6iW.js → search-input-DRWRYRPs.js} +1 -1
  230. package/dist/client/assets/{search-toggle-BQLp0m3w.js → search-toggle-B5FB44XX.js} +1 -1
  231. package/dist/client/assets/{secret-picker-CNRCwGgJ.js → secret-picker-DLap6vTC.js} +1 -1
  232. package/dist/client/assets/secrets-jZp-bTCf.js +1 -0
  233. package/dist/client/assets/sections-editor-BFbkxXEt.js +1 -0
  234. package/dist/client/assets/{select-lkzYgXdD.js → select-BZ6sktb7.js} +1 -1
  235. package/dist/client/assets/select-model-BIWsu5PV.js +1 -0
  236. package/dist/client/assets/{seo-editor-C5sUOmWC.js → seo-editor-PDlEaSFK.js} +1 -1
  237. package/dist/client/assets/{separator-DIB2NY6d.js → separator-D_UVaWw6.js} +1 -1
  238. package/dist/client/assets/settings-tab-BBHI-Kul.js +5 -0
  239. package/dist/client/assets/{sheet-B5VBlNbo.js → sheet-Kja83qKC.js} +1 -1
  240. package/dist/client/assets/shell-layout-ynqF32RZ.js +1 -0
  241. package/dist/client/assets/{skill-preview-_2hXoPIK.js → skill-preview-BjeMKh94.js} +1 -1
  242. package/dist/client/assets/skills-BVNUFN8s.js +1 -0
  243. package/dist/client/assets/{sso-kIq_TNP0.js → sso-CbvzPnGh.js} +1 -1
  244. package/dist/client/assets/{suggestion-Bm5WiIMl.js → suggestion-DMGPIg87.js} +1 -1
  245. package/dist/client/assets/{switch-C_Vj5_E0.js → switch-CSgTLkLq.js} +1 -1
  246. package/dist/client/assets/synced-repos-DkDa4E03.js +1 -0
  247. package/dist/client/assets/{table-EewUoElk.js → table-BNlBwUw8.js} +1 -1
  248. package/dist/client/assets/{tabs-Dn00_KeP.js → tabs-DWl7SNDG.js} +1 -1
  249. package/dist/client/assets/{task-board-B1qWBX1A.js → task-board-C6TTBmRS.js} +1 -1
  250. package/dist/client/assets/{task-route-D--4JOl_.js → task-route-Bz3woGSP.js} +1 -1
  251. package/dist/client/assets/{task-status-Nj47Imo6.js → task-status-CnFMIlt_.js} +1 -1
  252. package/dist/client/assets/taskboard-analytics-DoJw1Xfg.js +1 -0
  253. package/dist/client/assets/tasks-CIdMsSLJ.js +1 -0
  254. package/dist/client/assets/{tasks-BKvSOVwi.js → tasks-Cqz8mQiU.js} +2 -2
  255. package/dist/client/assets/{textarea-BJstaU_4.js → textarea-CufiKBr1.js} +1 -1
  256. package/dist/client/assets/thread-analytics-CC-_zVgm.js +1 -0
  257. package/dist/client/assets/thread-button-Ds-0KssI.js +1 -0
  258. package/dist/client/assets/{thread-intent-Dv_ln6w2.js → thread-intent-rbLXiRX-.js} +1 -1
  259. package/dist/client/assets/{thread-route-C2QO3TRR.js → thread-route-B3__WRb1.js} +1 -1
  260. package/dist/client/assets/thread-route-D_-4E_Qa.js +1 -0
  261. package/dist/client/assets/{thread-sheet-body-a-hPHT_-.js → thread-sheet-body-C6Nvo-gY.js} +1 -1
  262. package/dist/client/assets/toggle-group-CEb1zCbt.js +1 -0
  263. package/dist/client/assets/toolbar-icon-button-B7ENG3u2.js +1 -0
  264. package/dist/client/assets/{tooltip-1YZ9_LEc.js → tooltip-Bdu4_ay-.js} +1 -1
  265. package/dist/client/assets/{track-BdOLl-rI.js → track-DYcNrkYj.js} +1 -1
  266. package/dist/client/assets/{types-BcA15it5.js → types-C1lh-7rD.js} +3 -3
  267. package/dist/client/assets/{usage-stats-BXm3jzMp.js → usage-stats-C8kdutYl.js} +1 -1
  268. package/dist/client/assets/{use-ai-providers-OZaiJf_i.js → use-ai-providers-DdvmCGxF.js} +1 -1
  269. package/dist/client/assets/{use-automations-D-L8pJyH.js → use-automations-By-N-e6c.js} +1 -1
  270. package/dist/client/assets/{use-autosave-WOg9IhGs.js → use-autosave-tkO4DMDZ.js} +1 -1
  271. package/dist/client/assets/use-connect-companion-CRgCDVPT.js +1 -0
  272. package/dist/client/assets/{use-connection-B5_J2wP6.js → use-connection-CzhqmkxY.js} +1 -1
  273. package/dist/client/assets/{use-copy-B6plqh15.js → use-copy-D35bNj5j.js} +1 -1
  274. package/dist/client/assets/{use-create-virtual-mcp-BHGrzRmt.js → use-create-virtual-mcp-DSS6KW-Y.js} +1 -1
  275. package/dist/client/assets/{use-date-fns-locale-giBeaSOM.js → use-date-fns-locale-B65-a3KP.js} +1 -1
  276. package/dist/client/assets/{use-debounced-autosave-B9G4Lz7n.js → use-debounced-autosave-UCDN4Lw3.js} +1 -1
  277. package/dist/client/assets/{use-debounced-value-CUPne1nm.js → use-debounced-value-CWshbX7F.js} +1 -1
  278. package/dist/client/assets/{use-deco-credits-BhBg4qYv.js → use-deco-credits-DTu_Qf20.js} +1 -1
  279. package/dist/client/assets/{use-decopilot-events-CrYWYj1F.js → use-decopilot-events-BvKgG5Ws.js} +1 -1
  280. package/dist/client/assets/{use-delete-connection-XgJ1tVSe.js → use-delete-connection-1XhxmMPF.js} +1 -1
  281. package/dist/client/assets/{use-deployment-admin-DhLAmeuE.js → use-deployment-admin-DMXwbJU8.js} +1 -1
  282. package/dist/client/assets/{use-entitlements-Bk0dyRQ2.js → use-entitlements-Da1bmf67.js} +1 -1
  283. package/dist/client/assets/{use-fast-preview-draft-url-BfzrR4he.js → use-fast-preview-draft-url-C7L3VsQn.js} +1 -1
  284. package/dist/client/assets/{use-file-configs-Q9mf6jQo.js → use-file-configs-C7xVU8E2.js} +1 -1
  285. package/dist/client/assets/use-in-settings-icIKIpSR.js +1 -0
  286. package/dist/client/assets/{use-infinite-scroll-BAK1V_oQ.js → use-infinite-scroll-7-m4dXi3.js} +1 -1
  287. package/dist/client/assets/{use-join-requests-DbabBnEV.js → use-join-requests-D_x3dmzZ.js} +1 -1
  288. package/dist/client/assets/use-main-panel-tabs-B5g6e1MJ.js +1 -0
  289. package/dist/client/assets/{use-mcp-auth-status-DetA28-g.js → use-mcp-auth-status-nDkEwx2c.js} +1 -1
  290. package/dist/client/assets/{use-mcp-client-6HSoOGyN.js → use-mcp-client-CkjkRUta.js} +1 -1
  291. package/dist/client/assets/{use-mcp-prompts-1aH_UXpe.js → use-mcp-prompts-D2XJcis0.js} +1 -1
  292. package/dist/client/assets/{use-mcp-tools-yAkOUoVS.js → use-mcp-tools-DZlo67bQ.js} +1 -1
  293. package/dist/client/assets/{use-members-CNAxK8NG.js → use-members-CdPjttiy.js} +1 -1
  294. package/dist/client/assets/{use-mobile-BA2OXMES.js → use-mobile-DVMuGaln.js} +1 -1
  295. package/dist/client/assets/{use-navigate-to-agent-B7J0geak.js → use-navigate-to-agent-BCcYux8q.js} +1 -1
  296. package/dist/client/assets/{use-open-billing-url-CdE8qyDV.js → use-open-billing-url-CJn1G7pV.js} +1 -1
  297. package/dist/client/assets/{use-org-auth-client-DJC4lcTZ.js → use-org-auth-client-D8dxsLtj.js} +1 -1
  298. package/dist/client/assets/{use-org-fs-DxNvtETC.js → use-org-fs-3jzMRDSK.js} +1 -1
  299. package/dist/client/assets/{use-org-sso-D0y0H-Wd.js → use-org-sso-Bb_2_N0Z.js} +1 -1
  300. package/dist/client/assets/{use-organization-roles-CTjyx7IB.js → use-organization-roles-ixSaPxG5.js} +1 -1
  301. package/dist/client/assets/{use-organization-settings-fx1CniIO.js → use-organization-settings-B0mobgxG.js} +1 -1
  302. package/dist/client/assets/{use-panel-navigate-ZqAXzPy8.js → use-panel-navigate-CjSWJCy4.js} +1 -1
  303. package/dist/client/assets/{use-project-native-view-presence-DU2K0Eyd.js → use-project-native-view-presence-_PPun-xm.js} +1 -1
  304. package/dist/client/assets/{use-project-scope-Hp7aDrht.js → use-project-scope-CJnr8HCi.js} +1 -1
  305. package/dist/client/assets/{use-releases-BXIf7cF0.js → use-releases-CT-nVxtd.js} +1 -1
  306. package/dist/client/assets/{use-reports-diagnostic-D7jrD_HD.js → use-reports-diagnostic-AsJIEIvt.js} +1 -1
  307. package/dist/client/assets/{use-route-default-main-DGbZPJrO.js → use-route-default-main-CQGz2KW9.js} +1 -1
  308. package/dist/client/assets/{use-secrets-C-Xp8b4K.js → use-secrets-DgNcVRY9.js} +1 -1
  309. package/dist/client/assets/use-section-preview-base-mIL7vKdH.js +1 -0
  310. package/dist/client/assets/{use-session-runtime-BGl1FWUp.js → use-session-runtime-B9eFlXyW.js} +1 -1
  311. package/dist/client/assets/{use-tags-pwsJJDvy.js → use-tags-BM82Yu0K.js} +1 -1
  312. package/dist/client/assets/{use-task-board-analytics-Dh7V7MPv.js → use-task-board-analytics-D_ruF5p9.js} +1 -1
  313. package/dist/client/assets/{use-task-metadata-DKjAQSZf.js → use-task-metadata-qZ-qzNT-.js} +1 -1
  314. package/dist/client/assets/{use-thread-analytics-CusHOOmZ.js → use-thread-analytics-BcEpZDI1.js} +1 -1
  315. package/dist/client/assets/{use-thread-outputs-8akdlycY.js → use-thread-outputs-CIF4-tq_.js} +1 -1
  316. package/dist/client/assets/{use-virtual-mcp-CbHEuH0C.js → use-virtual-mcp-BKP1YfD8.js} +1 -1
  317. package/dist/client/assets/useInfiniteQuery-DhVx-Xnv.js +1 -0
  318. package/dist/client/assets/{useQueries-B5DxQ3Sp.js → useQueries-CbuhlNe5.js} +1 -1
  319. package/dist/client/assets/useSuspenseInfiniteQuery-CB90sByh.js +1 -0
  320. package/dist/client/assets/{users-p9MUZzW1.js → users-CDy-vhRi.js} +1 -1
  321. package/dist/client/assets/{utils-BkPwCtYS.js → utils-VRidfAJX.js} +1 -1
  322. package/dist/client/assets/{variant-calendar-CcJNDqFN.js → variant-calendar-C5Yhhu_f.js} +1 -1
  323. package/dist/client/assets/{variant-matcher-override-CexHfhU3.js → variant-matcher-override-NRDTBNQG.js} +1 -1
  324. package/dist/client/assets/view-mode-toggle-P-VmNhrj.js +1 -0
  325. package/dist/client/assets/{virtual-mcp-Dd5g9b73.js → virtual-mcp-DXr1jTLu.js} +1 -1
  326. package/dist/client/index.html +2 -2
  327. package/dist/server/cli.js +1 -1
  328. package/dist/server/server.js +1 -1
  329. package/package.json +1 -1
  330. package/dist/client/assets/agent-analytics-DvZELmro.js +0 -2
  331. package/dist/client/assets/agent-app-CR4dhbC3.js +0 -1
  332. package/dist/client/assets/agent-assets-CAIo2BGp.js +0 -1
  333. package/dist/client/assets/agent-automation-4_v-jQ62.js +0 -20
  334. package/dist/client/assets/agent-automations-DideyLR7.js +0 -1
  335. package/dist/client/assets/agent-connect-sources-C16mG4Vi.js +0 -1
  336. package/dist/client/assets/agent-deck-B2S-lir7.js +0 -1
  337. package/dist/client/assets/agent-e2e-CQ-lGjg-.js +0 -1
  338. package/dist/client/assets/agent-experiments-CXowDnMX.js +0 -1
  339. package/dist/client/assets/agent-file-DVtUKLrb.js +0 -1
  340. package/dist/client/assets/agent-hosting-B95vsATF.js +0 -1
  341. package/dist/client/assets/agent-library-file-c5FcaNLf.js +0 -1
  342. package/dist/client/assets/agent-monitor-DKyHOvd6.js +0 -1
  343. package/dist/client/assets/agent-overview-Dq7efx0u.js +0 -1
  344. package/dist/client/assets/agent-settings-tjDRwuVg.js +0 -1
  345. package/dist/client/assets/agent-site-editor-code-D1x0TO9d.js +0 -2
  346. package/dist/client/assets/agent-site-editor-content-C0C8gdKB.js +0 -9
  347. package/dist/client/assets/agent-site-editor-preview-BPAT7NTN.js +0 -518
  348. package/dist/client/assets/agent-view-DECRuUKv.js +0 -1
  349. package/dist/client/assets/agents-list-DdpIsQof.js +0 -1
  350. package/dist/client/assets/api-keys-CAMHVAF8.js +0 -1
  351. package/dist/client/assets/api-keys-Ct4yGdka.js +0 -1
  352. package/dist/client/assets/app-editor-BWuGvl0o.js +0 -1
  353. package/dist/client/assets/auth-entry-BZ-zlX-A.js +0 -1
  354. package/dist/client/assets/block-document-BQbcWy3F.js +0 -3
  355. package/dist/client/assets/breadcrumb-D3KLnh1b.js +0 -1
  356. package/dist/client/assets/category-editor-CLkY8j6x.js +0 -1
  357. package/dist/client/assets/collection-detail-Xqlt3OgU.js +0 -1
  358. package/dist/client/assets/collection-tabs-VZH79ort.js +0 -1
  359. package/dist/client/assets/command-C0IXiNme.js +0 -1
  360. package/dist/client/assets/connect-B9RtRyUW.js +0 -8
  361. package/dist/client/assets/connection-detail-Bgtg-egn.js +0 -1
  362. package/dist/client/assets/connections-CIFiKTz-.js +0 -1
  363. package/dist/client/assets/dialog-fTIcTyHb.js +0 -1
  364. package/dist/client/assets/discover-BZC8PmWN.js +0 -1
  365. package/dist/client/assets/file-share-button-Dcpl3tTi.js +0 -3
  366. package/dist/client/assets/home-nqrW03_D.js +0 -1
  367. package/dist/client/assets/index-B48I-F_s.js +0 -26
  368. package/dist/client/assets/index-CnM-XjMS.js +0 -1
  369. package/dist/client/assets/index-CnlnpiW9.js +0 -1
  370. package/dist/client/assets/index-Cnm8iPpl.js +0 -5
  371. package/dist/client/assets/index-DQQ8_5-n.css +0 -1
  372. package/dist/client/assets/index-redirect-lHlkLUpP.js +0 -1
  373. package/dist/client/assets/input-bCtnK_dS.js +0 -8
  374. package/dist/client/assets/library-nbbFy0YJ.js +0 -161
  375. package/dist/client/assets/members-Ci31aIzf.js +0 -1
  376. package/dist/client/assets/message-templates-Dievwyon.js +0 -1
  377. package/dist/client/assets/mock-board-MGFiZQqD.js +0 -10
  378. package/dist/client/assets/multi-select-B5cPO8Zc.js +0 -1
  379. package/dist/client/assets/org-file-open-context-C6mgZPAr.js +0 -1
  380. package/dist/client/assets/page-seo-form-BHc2C0F_.js +0 -1
  381. package/dist/client/assets/profile-Bl7SMbnv.js +0 -1
  382. package/dist/client/assets/project-feed-C9k9tVu9.js +0 -1
  383. package/dist/client/assets/project-reports-h9XKnGzZ.js +0 -1
  384. package/dist/client/assets/project-tasks-CvQsB5FR.js +0 -1
  385. package/dist/client/assets/record-editor-Dco1ladi.js +0 -1
  386. package/dist/client/assets/reports-KVVIwKGA.js +0 -1
  387. package/dist/client/assets/reports-tab-CZyY8SM6.js +0 -2
  388. package/dist/client/assets/require-capability-BlL45yDc.js +0 -1
  389. package/dist/client/assets/roles-B-T-wGt2.js +0 -1
  390. package/dist/client/assets/route-BoE0K809.js +0 -1
  391. package/dist/client/assets/route-Ciyyz2ig.js +0 -1
  392. package/dist/client/assets/route-X5r9RmD7.js +0 -1
  393. package/dist/client/assets/route-page-header-Ck32Z_z1.js +0 -1
  394. package/dist/client/assets/runnable-block-editor-DXtvF8jt.js +0 -17
  395. package/dist/client/assets/secrets-BUndq66A.js +0 -1
  396. package/dist/client/assets/sections-editor-BMGHgar4.js +0 -1
  397. package/dist/client/assets/select-model-L0RmAR5m.js +0 -1
  398. package/dist/client/assets/settings-tab-BQA673_Z.js +0 -5
  399. package/dist/client/assets/shell-layout-t1NP6lxk.js +0 -1
  400. package/dist/client/assets/sidebar-Bsj1oRm2.js +0 -1
  401. package/dist/client/assets/skills-D_mDF0TE.js +0 -1
  402. package/dist/client/assets/synced-repos-wPtrwk-M.js +0 -1
  403. package/dist/client/assets/taskboard-analytics-DlcZmFmP.js +0 -1
  404. package/dist/client/assets/tasks-DhBfoBLp.js +0 -1
  405. package/dist/client/assets/thread-analytics-CJvSEofm.js +0 -1
  406. package/dist/client/assets/thread-button-Dg0_8ATn.js +0 -1
  407. package/dist/client/assets/thread-route-BBwMAr4Q.js +0 -1
  408. package/dist/client/assets/toggle-group-n81OZ_Uu.js +0 -1
  409. package/dist/client/assets/toolbar-icon-button-G0ZB62BK.js +0 -1
  410. package/dist/client/assets/use-connect-companion-dh23z2e4.js +0 -1
  411. package/dist/client/assets/use-in-settings-_C3gW9Az.js +0 -1
  412. package/dist/client/assets/use-main-panel-tabs-rnsNQmUO.js +0 -1
  413. package/dist/client/assets/use-section-preview-base-BIeB_qzV.js +0 -1
  414. package/dist/client/assets/useInfiniteQuery-CEwPAAtp.js +0 -1
  415. package/dist/client/assets/useSuspenseInfiniteQuery-CC4BMd5I.js +0 -1
  416. package/dist/client/assets/view-mode-toggle-CJHrx4Q2.js +0 -1
@@ -1 +1 @@
1
- import{ao as t,ap as e,aG as l,bO as a,bM as s,bN as o,cW as c,bP as d,dS as I,cY as A,bQ as g}from"./index-B-RfjkQs.js";const v=t({connection_id:e().describe("Connection ID"),selected_tools:a(e()).nullable().describe("Selected tool names. null = all tools included, array = only these tools included"),selected_resources:a(e()).nullable().describe("Selected resource URIs or patterns. Supports * and ** wildcards for pattern matching. null = all resources included, array = only these resources included"),selected_prompts:a(e()).nullable().describe("Selected prompt names. null = all prompts included, array = only these prompts included")}),u=500,w=200,R=200,k=20,_=50,P=100,E=20,U=100,C=50,T=100,N=8192,y=v.extend({selected_tools:a(e()).max(u).nullable().optional().describe("Selected tool names. null = all tools included, array = only these tools included"),selected_resources:a(e()).max(u).nullable().optional().describe("Selected resource URIs or patterns. Supports * and ** wildcards for pattern matching. null = all resources included, array = only these resources included"),selected_prompts:a(e()).max(u).nullable().optional().describe("Selected prompt names. null = all prompts included, array = only these prompts included")}),V=t({connectionId:e(),toolName:e(),label:e(),icon:e().nullable().optional()}),O=t({id:e().describe("Stable id; used as React key and ?tab= value"),title:e().describe("Tab label"),icon:e().optional().describe("Optional lucide icon name"),view:t({type:c("ext-app"),appId:e(),args:d(e(),g()).optional()})}),S=o(["overview","reports","board","site-editor","assets","hosting","e2e","analytics","cdn","automations","experiments"]),oe=o(["on","off"]),D=new Map([["manual","on"],["auto","on"]]),L=o(["on","off","manual","auto"]);function X(n){if(!n)return null;const i=D.get(n);return i||(n==="on"||n==="off"?n:null)}const F=t({defaultMainView:t({type:e(),id:e().optional(),toolName:e().optional()}).nullable().optional(),chatDefaultOpen:s().nullable().optional(),cmsDefaultOpen:s().nullable().optional(),cms:L.nullable().optional().describe("How this agent offers content editing. Absent means on; the retired `manual` / `auto` read as on too."),sidebarViews:a(S).max(10).nullable().optional().describe("Deprecated layout-scoped sidebar selections. Read only as a fallback when metadata.sidebarViews is absent."),tabs:a(O).max(E).optional()});function se(n){return X(n?.cms)??"on"}function le(n,i){const r=i==="off"&&n?.defaultMainView?.type==="content";return{...n,cms:i,cmsDefaultOpen:null,...r?{defaultMainView:{type:"site-editor"}}:{}}}const h=t({tileId:e().optional(),connectionId:e().optional().describe("Connection that owns the resource — the host opens a direct MCP client to this connection so the iframe can call tools by their bare names."),resourceUri:e().describe("ui:// resource URI exposed by `connectionId`. Read on the home page and rendered via MCPAppRenderer."),toolName:e().optional().describe("Tool name — identifies which tool's inputSchema to display when editing tile props."),toolInput:d(e(),g()).optional().describe("User-configured input props passed to MCPAppRenderer when rendering the tile."),minHeight:l().int().positive().optional(),maxHeight:l().int().positive().optional()}),H=t({banner:e().nullable().optional(),bannerColor:e().nullable().optional(),icon:e().nullable().optional(),themeColor:e().nullable().optional(),pinnedViews:a(V).max(P).nullable().optional(),layout:F.nullable().optional(),homeTile:h.nullable().optional(),homeTiles:a(h).max(k).nullable().optional(),homePrompts:a(e()).max(_).nullable().optional()}),B=/^[A-Za-z_][A-Za-z0-9_]*$/,f=e().min(1).regex(B,{message:"Env var key must start with a letter or underscore and contain only letters, digits, and underscores."}),G=A("kind",[t({key:f,kind:c("literal"),value:e().max(N)}),t({key:f,kind:c("secret"),secretId:e().min(1)})]),j=t({selected:e().nullable().optional().describe("User-selected package manager (npm | pnpm | yarn | bun | deno). Null/absent means autodetect on next SANDBOX_START."),port:e().nullable().optional().describe("User-selected dev server port as a string (allows '' / null for unset). Null/absent means autodetect."),path:e().nullable().optional().describe("Optional path (relative to repo root) to the directory containing package.json. Null/absent means repo root. Forwarded as `application.packageManager.path` to the daemon config."),env:a(G).max(T).nullable().optional().describe("Env vars injected on every SANDBOX_START. Literal entries inline their value; secret entries store a secretId that Studio resolves via the credential vault before posting /_sandbox/config.")}),z=t({url:e().describe("GitHub repository URL"),owner:e().describe("Repository owner"),name:e().describe("Repository name"),installationId:l().optional().describe("GitHub App installation ID. Absent when the repo was linked without a GitHub connection (public-clone mode)."),connectionId:e().optional().describe("ID of the mcp-github connection used for authentication. Absent for public repos cloned without credentials."),repositoryId:e().optional().describe("First-class repository (REPOSITORY_LINK) backing this binding. When set, credentials come from the repository's git provider account rather than connectionId.")}),K=o(["agent-sandbox","local-api"]),q={sandboxHandle:e().describe("Provider-specific handle"),previewUrl:e().nullable().describe("URL where the sandbox's iframe-proxied UI is served, or null when the sandbox has no dev server (blank / tool sandboxes)."),sandboxApiUrl:e().nullable().optional().describe("Direct sandbox API URL for runtimes that expose one. Equal to previewUrl for local-api; null/absent for AgentSandbox, which routes control traffic through hosted Studio."),createdAt:l().optional().describe("Epoch ms the entry was first written by SANDBOX_START. Used by the booting overlay to show a stable elapsed timer that survives browser reloads. Optional for backward compatibility with entries written before this field existed."),startedWith:t({packageManager:e().nullable().optional().describe("metadata.runtime.selected at the time of SANDBOX_START"),port:e().nullable().optional().describe("metadata.runtime.port at the time of SANDBOX_START"),path:e().nullable().optional().describe("metadata.runtime.path at the time of SANDBOX_START")}).optional().describe("Snapshot of metadata.runtime fields (selected/port/path) used at SANDBOX_START. The Preview tab compares the live metadata.runtime against this to decide if a restart is required to apply changes.")},M=t(q);function re(n){if(!n||typeof n!="object"||Array.isArray(n))return{};const i=n,r={};for(const[p,b]of Object.entries(i))if(!(!b||typeof b!="object")&&!(p!=="agent-sandbox"&&p!=="local-api"))try{r[p]=M.parse(b)}catch{}return r}const W=d(e().describe("userId"),d(e().describe("branch"),I(K,M))),Y=t({id:e().describe("Stable identifier for this knowledge file"),name:e().describe("File name shown in the UI"),kind:o(["file","skill"]).optional().describe("'file' (a single document) or 'skill' (a Claude Code skill folder containing SKILL.md). Defaults to 'file'."),volume:e().describe("Org filesystem (Library) volume the file lives in"),path:e().describe("Path within the volume"),url:e().describe("Same-origin URL to read the file (display/download)"),contentType:e().nullable().optional().describe("MIME type, used to decide whether to inline the content"),size:l().nullable().optional().describe("File size in bytes"),addedAt:e().describe("ISO timestamp when the file was attached")}),Z=a(Y).max(U).nullable().optional().describe("Files attached to the agent as reference knowledge. Surfaced in the system prompt: small text documents are inlined, others are listed as retrievable references."),Q=o(["smart","code-review","open"]),$=Q.nullable().optional().describe("Controls when this code agent's changes may be published directly vs. requiring PR review. 'smart' (default) uses AI to judge per change; 'code-review' requires review for any code; 'open' allows direct publish always."),J=s().nullable().optional().describe("Enable Fast Preview (sandbox-less): render the draft instantly on the preview server's own page via a ?__draft pointer, with reads/writes served by the decofile API against GitHub. Requires previewServerUrl (or legacy productionUrl) to be set to take effect."),ee=s().nullable().optional().describe("EXPERIMENTAL: with Fast Preview on, refresh content edits via an in-place /live/previews render (no commit, no reload) instead of a commit + re-navigation. Deco-runtime preview targets only. Requires fastPreview."),te=e().nullable().optional().describe("Preview server URL — the deployment the CMS preview renders against (often the live site, e.g. https://acme.com). Painted in the preview iframe, and the render target for Fast Preview drafts. Supersedes the legacy productionUrl key."),ae=t({branch:e().describe("Git branch backing this release"),name:e().describe('User-facing name, e.g. "Black Friday 2026"'),color:e().describe("Dot color token shown in the version switcher"),createdBy:e().optional().describe("User ID who created the release"),createdAt:e().optional().describe("ISO 8601 creation timestamp")}),ne=a(ae).max(C).nullable().optional().describe("Curated list of named, branch-backed releases shown in the version switcher. The base branch ('No ar') is derived, not stored here."),m={instructions:e().nullable().optional().describe("Instructions also used as system prompt"),subAgents:a(e()).max(R).nullable().optional().describe("Allowlist of Virtual MCP (agent) or concrete MCP connection IDs this agent may delegate to via subtask. Concrete connections create ephemeral subagents. null/absent = all active org targets; empty array = itself only."),liveAgentId:e().nullable().optional().describe("ID of the live agent this (dev) agent develops. Set only on dev agents; powers the Develop/Live toggle. A dev agent is hidden from the sidebar (reached via the toggle on its live counterpart)."),ui:H.nullable().optional().describe("UI customization settings"),sidebarViews:a(S).max(10).nullable().optional().describe("Project views selected for the sidebar. Interpret as an exact list when sidebarViewsVersion is 1; unversioned values use legacy native-only semantics. Runtime presence gates still apply."),sidebarViewsVersion:c(1).optional().describe("Version 1 marks metadata.sidebarViews as an exact list that can disable legacy default rows."),githubRepo:z.nullable().optional().describe("Linked GitHub repository"),runtime:j.nullable().optional().describe("User-pinned runtime config (package manager, dev port). Empty fields = autodetect."),knowledge:Z,siteSlug:e().nullable().optional().describe("Linked asset site slug (managed storage tenancy)"),publishPolicy:$,previewServerUrl:te,productionUrl:e().nullable().optional().describe("Legacy key for previewServerUrl — still read as a fallback. New writes use previewServerUrl."),fieldDescriptionTooltips:s().nullable().optional().describe("Blocks form: opt in to showing a field's schema description as a hover tooltip on its title, instead of the default inline text below the title."),fastPreview:J,releases:ne,fastPreviewInPlace:ee},ce=t({id:e().describe("Unique identifier"),title:e().describe("Human-readable name"),description:e().nullable().describe("Description"),icon:e().nullable().describe("Icon URL"),created_at:e().describe("Creation timestamp"),updated_at:e().describe("Last update timestamp"),created_by:e().describe("User ID who created this item"),updated_by:e().optional().describe("User ID who last updated this item"),organization_id:e().describe("Organization ID this item belongs to"),status:o(["active","inactive"]).describe("Current status"),pinned:s().describe("Whether this space is pinned to the sidebar"),metadata:t(m).extend({instructions:e().nullable().describe("Instructions also used as system prompt"),sandboxMap:W.optional().describe("Per-user, per-branch sandbox mapping: sandboxMap[userId][branch] -> { sandboxHandle, previewUrl }")}).loose().describe("Metadata"),connections:a(v).describe("Connections with their selected tools, resources, and prompts")}),x=t({title:e().min(1).max(120).describe("Short label shown on the chip"),description:e().max(280).optional().describe("One-line subtitle shown under the title"),text:e().min(1).max(4e3).describe("The message sent to the agent when the prompt is clicked")});t({title:e().min(1).max(255).describe("Name for the virtual MCP"),description:e().max(500).nullable().optional().describe("Optional description"),icon:e().nullish().describe("Optional icon URL"),status:o(["active","inactive"]).optional().default("active").describe("Initial status"),pinned:s().optional().default(!1).describe("Pin to sidebar"),metadata:t(m).loose().superRefine((n,i)=>{"sandboxMap"in n&&i.addIssue({code:"custom",path:["sandboxMap"],message:"sandboxMap is managed by the sandbox lifecycle"})}).nullable().optional().describe("Additional metadata including MCP server instructions"),connections:a(y).max(w).describe("Connections to include/exclude (can be empty for exclusion mode)"),prompts:a(x).max(20).optional().describe("Optional kickstart prompts to seed on the agent. Each becomes a clickable conversation starter (icebreaker) on the agent. Author them from the agent's role and the tools it will have so they're coherent and immediately useful.")});t({title:e().min(1).max(255).optional().describe("New name"),description:e().max(500).nullable().optional().describe("New description (null to clear)"),icon:e().nullish().describe("New icon URL"),status:o(["active","inactive"]).optional().describe("New status"),pinned:s().optional().describe("Pin/unpin from sidebar"),metadata:t(m).loose().superRefine((n,i)=>{"sandboxMap"in n&&i.addIssue({code:"custom",path:["sandboxMap"],message:"sandboxMap is managed by the sandbox lifecycle"})}).nullable().optional().describe("Additional metadata including MCP server instructions"),connections:a(y).max(w).optional().describe("New connections (replaces existing)"),prompts:a(x).max(20).optional().describe("Replace the agent's kickstart prompts with this full set. Omit to leave them unchanged; pass an empty array to remove all. Each becomes a clickable conversation starter (icebreaker).")});export{oe as C,B as E,C as R,ce as V,re as p,se as r,le as w};
1
+ import{an as t,ao as e,aE as l,bN as a,bL as s,bM as o,cV as c,bO as d,dR as I,cX as A,bP as g}from"./index-De5sr9zh.js";const v=t({connection_id:e().describe("Connection ID"),selected_tools:a(e()).nullable().describe("Selected tool names. null = all tools included, array = only these tools included"),selected_resources:a(e()).nullable().describe("Selected resource URIs or patterns. Supports * and ** wildcards for pattern matching. null = all resources included, array = only these resources included"),selected_prompts:a(e()).nullable().describe("Selected prompt names. null = all prompts included, array = only these prompts included")}),u=500,w=200,R=200,k=20,_=50,E=100,P=20,U=100,C=50,T=100,N=8192,y=v.extend({selected_tools:a(e()).max(u).nullable().optional().describe("Selected tool names. null = all tools included, array = only these tools included"),selected_resources:a(e()).max(u).nullable().optional().describe("Selected resource URIs or patterns. Supports * and ** wildcards for pattern matching. null = all resources included, array = only these resources included"),selected_prompts:a(e()).max(u).nullable().optional().describe("Selected prompt names. null = all prompts included, array = only these prompts included")}),V=t({connectionId:e(),toolName:e(),label:e(),icon:e().nullable().optional()}),O=t({id:e().describe("Stable id; used as React key and ?tab= value"),title:e().describe("Tab label"),icon:e().optional().describe("Optional lucide icon name"),view:t({type:c("ext-app"),appId:e(),args:d(e(),g()).optional()})}),S=o(["overview","reports","board","site-editor","assets","hosting","e2e","analytics","cdn","automations","experiments"]),oe=o(["on","off"]),D=new Map([["manual","on"],["auto","on"]]),L=o(["on","off","manual","auto"]);function X(n){if(!n)return null;const i=D.get(n);return i||(n==="on"||n==="off"?n:null)}const F=t({defaultMainView:t({type:e(),id:e().optional(),toolName:e().optional()}).nullable().optional(),chatDefaultOpen:s().nullable().optional(),cmsDefaultOpen:s().nullable().optional(),cms:L.nullable().optional().describe("How this agent offers content editing. Absent means on; the retired `manual` / `auto` read as on too."),sidebarViews:a(S).max(10).nullable().optional().describe("Deprecated layout-scoped sidebar selections. Read only as a fallback when metadata.sidebarViews is absent."),tabs:a(O).max(P).optional()});function se(n){return X(n?.cms)??"on"}function le(n,i){const r=i==="off"&&n?.defaultMainView?.type==="content";return{...n,cms:i,cmsDefaultOpen:null,...r?{defaultMainView:{type:"site-editor"}}:{}}}const h=t({tileId:e().optional(),connectionId:e().optional().describe("Connection that owns the resource — the host opens a direct MCP client to this connection so the iframe can call tools by their bare names."),resourceUri:e().describe("ui:// resource URI exposed by `connectionId`. Read on the home page and rendered via MCPAppRenderer."),toolName:e().optional().describe("Tool name — identifies which tool's inputSchema to display when editing tile props."),toolInput:d(e(),g()).optional().describe("User-configured input props passed to MCPAppRenderer when rendering the tile."),minHeight:l().int().positive().optional(),maxHeight:l().int().positive().optional()}),H=t({banner:e().nullable().optional(),bannerColor:e().nullable().optional(),icon:e().nullable().optional(),themeColor:e().nullable().optional(),pinnedViews:a(V).max(E).nullable().optional(),layout:F.nullable().optional(),homeTile:h.nullable().optional(),homeTiles:a(h).max(k).nullable().optional(),homePrompts:a(e()).max(_).nullable().optional()}),B=/^[A-Za-z_][A-Za-z0-9_]*$/,f=e().min(1).regex(B,{message:"Env var key must start with a letter or underscore and contain only letters, digits, and underscores."}),j=A("kind",[t({key:f,kind:c("literal"),value:e().max(N)}),t({key:f,kind:c("secret"),secretId:e().min(1)})]),G=t({selected:e().nullable().optional().describe("User-selected package manager (npm | pnpm | yarn | bun | deno). Null/absent means autodetect on next SANDBOX_START."),port:e().nullable().optional().describe("User-selected dev server port as a string (allows '' / null for unset). Null/absent means autodetect."),path:e().nullable().optional().describe("Optional path (relative to repo root) to the directory containing package.json. Null/absent means repo root. Forwarded as `application.packageManager.path` to the daemon config."),env:a(j).max(T).nullable().optional().describe("Env vars injected on every SANDBOX_START. Literal entries inline their value; secret entries store a secretId that Studio resolves via the credential vault before posting /_sandbox/config.")}),z=t({url:e().describe("GitHub repository URL"),owner:e().describe("Repository owner"),name:e().describe("Repository name"),installationId:l().optional().describe("GitHub App installation ID. Absent when the repo was linked without a GitHub connection (public-clone mode)."),connectionId:e().optional().describe("ID of the mcp-github connection used for authentication. Absent for public repos cloned without credentials."),repositoryId:e().optional().describe("First-class repository (REPOSITORY_LINK) backing this binding. When set, credentials come from the repository's git provider account rather than connectionId.")}),K=o(["agent-sandbox","local-api"]),q={sandboxHandle:e().describe("Provider-specific handle"),previewUrl:e().nullable().describe("URL where the sandbox's iframe-proxied UI is served, or null when the sandbox has no dev server (blank / tool sandboxes)."),sandboxApiUrl:e().nullable().optional().describe("Direct sandbox API URL for runtimes that expose one. Equal to previewUrl for local-api; null/absent for AgentSandbox, which routes control traffic through hosted Studio."),createdAt:l().optional().describe("Epoch ms the entry was first written by SANDBOX_START. Used by the booting overlay to show a stable elapsed timer that survives browser reloads. Optional for backward compatibility with entries written before this field existed."),startedWith:t({packageManager:e().nullable().optional().describe("metadata.runtime.selected at the time of SANDBOX_START"),port:e().nullable().optional().describe("metadata.runtime.port at the time of SANDBOX_START"),path:e().nullable().optional().describe("metadata.runtime.path at the time of SANDBOX_START")}).optional().describe("Snapshot of metadata.runtime fields (selected/port/path) used at SANDBOX_START. The Preview tab compares the live metadata.runtime against this to decide if a restart is required to apply changes.")},M=t(q);function re(n){if(!n||typeof n!="object"||Array.isArray(n))return{};const i=n,r={};for(const[p,b]of Object.entries(i))if(!(!b||typeof b!="object")&&!(p!=="agent-sandbox"&&p!=="local-api"))try{r[p]=M.parse(b)}catch{}return r}const W=d(e().describe("userId"),d(e().describe("branch"),I(K,M))),Y=t({id:e().describe("Stable identifier for this knowledge file"),name:e().describe("File name shown in the UI"),kind:o(["file","skill"]).optional().describe("'file' (a single document) or 'skill' (a Claude Code skill folder containing SKILL.md). Defaults to 'file'."),volume:e().describe("Org filesystem (Library) volume the file lives in"),path:e().describe("Path within the volume"),url:e().describe("Same-origin URL to read the file (display/download)"),contentType:e().nullable().optional().describe("MIME type, used to decide whether to inline the content"),size:l().nullable().optional().describe("File size in bytes"),addedAt:e().describe("ISO timestamp when the file was attached")}),Z=a(Y).max(U).nullable().optional().describe("Files attached to the agent as reference knowledge. Surfaced in the system prompt: small text documents are inlined, others are listed as retrievable references."),$=o(["smart","code-review","open"]),J=$.nullable().optional().describe("Controls when this code agent's changes may be published directly vs. requiring PR review. 'smart' (default) uses AI to judge per change; 'code-review' requires review for any code; 'open' allows direct publish always."),Q=s().nullable().optional().describe("Enable Fast Preview (sandbox-less): render the draft instantly on the preview server's own page via a ?__draft pointer, with reads/writes served by the decofile API against GitHub. Requires previewServerUrl (or legacy productionUrl) to be set to take effect."),ee=s().nullable().optional().describe("EXPERIMENTAL: with Fast Preview on, refresh content edits via an in-place /live/previews render (no commit, no reload) instead of a commit + re-navigation. Deco-runtime preview targets only. Requires fastPreview."),te=e().nullable().optional().describe("Preview server URL — the deployment the CMS preview renders against (often the live site, e.g. https://acme.com). Painted in the preview iframe, and the render target for Fast Preview drafts. Supersedes the legacy productionUrl key."),ae=t({branch:e().describe("Git branch backing this release"),name:e().describe('User-facing name, e.g. "Black Friday 2026"'),color:e().describe("Dot color token shown in the version switcher"),createdBy:e().optional().describe("User ID who created the release"),createdAt:e().optional().describe("ISO 8601 creation timestamp")}),ne=a(ae).max(C).nullable().optional().describe("Curated list of named, branch-backed releases shown in the version switcher. The base branch ('No ar') is derived, not stored here."),m={instructions:e().nullable().optional().describe("Instructions also used as system prompt"),subAgents:a(e()).max(R).nullable().optional().describe("Allowlist of Virtual MCP (agent) or concrete MCP connection IDs this agent may delegate to via subtask. Concrete connections create ephemeral subagents. null/absent = all active org targets; empty array = itself only."),liveAgentId:e().nullable().optional().describe("ID of the live agent this (dev) agent develops. Set only on dev agents; powers the Develop/Live toggle. A dev agent is hidden from the sidebar (reached via the toggle on its live counterpart)."),ui:H.nullable().optional().describe("UI customization settings"),sidebarViews:a(S).max(10).nullable().optional().describe("Project views selected for the sidebar. Interpret as an exact list when sidebarViewsVersion is 1; unversioned values use legacy native-only semantics. Runtime presence gates still apply."),sidebarViewsVersion:c(1).optional().describe("Version 1 marks metadata.sidebarViews as an exact list that can disable legacy default rows."),githubRepo:z.nullable().optional().describe("Linked GitHub repository"),runtime:G.nullable().optional().describe("User-pinned runtime config (package manager, dev port). Empty fields = autodetect."),knowledge:Z,siteSlug:e().nullable().optional().describe("Linked asset site slug (managed storage tenancy)"),publishPolicy:J,previewServerUrl:te,productionUrl:e().nullable().optional().describe("Legacy key for previewServerUrl — still read as a fallback. New writes use previewServerUrl."),fieldDescriptionTooltips:s().nullable().optional().describe("Blocks form: opt in to showing a field's schema description as a hover tooltip on its title, instead of the default inline text below the title."),fastPreview:Q,releases:ne,fastPreviewInPlace:ee},ce=t({id:e().describe("Unique identifier"),title:e().describe("Human-readable name"),description:e().nullable().describe("Description"),icon:e().nullable().describe("Icon URL"),created_at:e().describe("Creation timestamp"),updated_at:e().describe("Last update timestamp"),created_by:e().describe("User ID who created this item"),updated_by:e().optional().describe("User ID who last updated this item"),organization_id:e().describe("Organization ID this item belongs to"),status:o(["active","inactive"]).describe("Current status"),pinned:s().describe("Whether this space is pinned to the sidebar"),metadata:t(m).extend({instructions:e().nullable().describe("Instructions also used as system prompt"),sandboxMap:W.optional().describe("Per-user, per-branch sandbox mapping: sandboxMap[userId][branch] -> { sandboxHandle, previewUrl }")}).loose().describe("Metadata"),connections:a(v).describe("Connections with their selected tools, resources, and prompts")}),x=t({title:e().min(1).max(120).describe("Short label shown on the chip"),description:e().max(280).optional().describe("One-line subtitle shown under the title"),text:e().min(1).max(4e3).describe("The message sent to the agent when the prompt is clicked")});t({title:e().min(1).max(255).describe("Name for the virtual MCP"),description:e().max(500).nullable().optional().describe("Optional description"),icon:e().nullish().describe("Optional icon URL"),status:o(["active","inactive"]).optional().default("active").describe("Initial status"),pinned:s().optional().default(!1).describe("Pin to sidebar"),metadata:t(m).loose().superRefine((n,i)=>{"sandboxMap"in n&&i.addIssue({code:"custom",path:["sandboxMap"],message:"sandboxMap is managed by the sandbox lifecycle"})}).nullable().optional().describe("Additional metadata including MCP server instructions"),connections:a(y).max(w).describe("Connections to include/exclude (can be empty for exclusion mode)"),prompts:a(x).max(20).optional().describe("Optional kickstart prompts to seed on the agent. Each becomes a clickable conversation starter (icebreaker) on the agent. Author them from the agent's role and the tools it will have so they're coherent and immediately useful.")});t({title:e().min(1).max(255).optional().describe("New name"),description:e().max(500).nullable().optional().describe("New description (null to clear)"),icon:e().nullish().describe("New icon URL"),status:o(["active","inactive"]).optional().describe("New status"),pinned:s().optional().describe("Pin/unpin from sidebar"),metadata:t(m).loose().superRefine((n,i)=>{"sandboxMap"in n&&i.addIssue({code:"custom",path:["sandboxMap"],message:"sandboxMap is managed by the sandbox lifecycle"})}).nullable().optional().describe("Additional metadata including MCP server instructions"),connections:a(y).max(w).optional().describe("New connections (replaces existing)"),prompts:a(x).max(20).optional().describe("Replace the agent's kickstart prompts with this full set. Omit to leave them unchanged; pass an empty array to remove all. Each becomes a clickable conversation starter (icebreaker).")});export{oe as C,B as E,C as R,ce as V,re as p,se as r,le as w};
@@ -50,8 +50,8 @@
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-B-RfjkQs.js"></script>
54
- <link rel="stylesheet" crossorigin href="/assets/index-DQQ8_5-n.css">
53
+ <script type="module" crossorigin src="/assets/index-De5sr9zh.js"></script>
54
+ <link rel="stylesheet" crossorigin href="/assets/index-BeJdXzSv.css">
55
55
  </head>
56
56
  <body>
57
57
  <div id="root"></div>
@@ -2105,7 +2105,7 @@ Usage: deco services <up|down|status>`),process.exit(1)}}var P4$=L(()=>{Zu()});f
2105
2105
  `.execute($);if(Number(W.rows[0]?.cnt)===0){console.warn(`Failed to migrate ${G}/${K}, keeping in old table`);continue}}await Vl`
2106
2106
  DELETE FROM kysely_migration WHERE name = ${Q}
2107
2107
  `.execute($)}}async function s7$($){await SW4($),await CW4($);let Z=new a7$({db:$,provider:{getMigrations:()=>Promise.resolve(q11)}}),{error:Q,results:X}=await Z.migrateToLatest(),Y=0;if(X?.forEach((J)=>{if(J.status==="Success")Y++;else if(J.status==="Error")console.error(`Failed to execute migration "${J.migrationName}"`)}),Q)throw console.error("Failed to migrate"),console.error(Q),Q;return Y}async function _W4($){let{keepOpen:Z=!1,database:Q,skipBetterAuth:X=!1}=$??{},Y="skipped";if(!X&&!Q)Y=await xa0();let J=Q??F8(),G=async()=>{if(!Z&&!Q)await eD(J).catch((K)=>{console.warn("Warning: Error closing database:",K)})};try{let K=await s7$(J.db);return await G(),{betterAuth:Y,kysely:K}}catch(K){throw await G(),K}}async function vW4(){let $=F8(),Z=new a7$({db:$.db,provider:{getMigrations:()=>Promise.resolve(q11)}}),{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 $Q$=L(()=>{o7$();fa0();jX()});async function z30($){let Z={...process.env},Q=H70($,Z);console.log(AV1(Q.settings.encryptionKey));let X=Q.settings.betterAuthSecret||(Q.settings.localMode?e6$(Q.settings.dataDir):""),{ensureServices:Y}=await Promise.resolve().then(() => (PG0(),zG0)),{outputs:J,services:G}=await Y({home:Q.settings.dataDir,externalDatabaseUrl:Q.externalDatabaseUrl,externalNatsUrl:Q.externalNatsUrl});if(!Q.skipMigrations){let{migrateBetterAuth:W}=await Promise.resolve().then(() => (fa0(),Z5$));await W(J.databaseUrl);let{createDatabase:H}=await Promise.resolve().then(() => (jX(),w6$)),{migrateToLatest:F}=await Promise.resolve().then(() => ($Q$(),e7$)),U=H(J.databaseUrl);await F({keepOpen:!0,database:U,skipBetterAuth:!0})}let K={...Q.settings,betterAuthSecret:X,databaseUrl:J.databaseUrl,natsUrls:J.natsUrls,...J.s3?{s3Endpoint:J.s3.endpoint,s3Bucket:J.s3.bucket,s3AccessKeyId:J.s3.accessKeyId,s3SecretAccessKey:J.s3.secretAccessKey,s3ForcePathStyle:J.s3.forcePathStyle}:{}};return T4$(K),{settings:K,services:G.map((W)=>({name:W.name==="PostgreSQL"?"Postgres":W.name,port:W.port})),managedServiceNames:G.filter((W)=>W.owner==="managed").map((W)=>W.name)}}var M11=L(()=>{Zu();$5$();W$()});var YQ$={};K0(YQ$,{updateService:()=>wT,subscribeCliState:()=>k11,setTuiConsoleIntercepted:()=>P30,setServerUrl:()=>Wr,setMigrationsDone:()=>Kr,setDevMode:()=>fW4,resetCliStateForTests:()=>xW4,isTuiConsoleIntercepted:()=>T30,getCliState:()=>V11,addLogEntry:()=>Jw});function ZQ$(){return[{name:"Postgres",status:"pending",port:0},{name:"NATS",status:"pending",port:0}]}function QQ$(){return{services:ZQ$(),migrationsStatus:"pending",serverUrl:null,logs:[]}}function xW4(){wJ=QQ$()}function Gr(){for(let $ of I11)$()}function V11(){return wJ}function k11($){return I11.add($),()=>I11.delete($)}function wT($){wJ={...wJ,services:wJ.services.map((Z)=>Z.name===$.name?$:Z)},Gr()}function Kr(){wJ={...wJ,migrationsStatus:"done"},Gr()}function Wr($){wJ={...wJ,serverUrl:$},Gr()}function Jw($){let Z=[...wJ.logs,$];wJ={...wJ,logs:Z.length>500?Z.slice(-500):Z},Gr()}function fW4(){wJ={...wJ,services:[...ZQ$(),{name:"API",status:"pending",port:0},{name:"Vite",status:"pending",port:0}]},Gr()}function P30($){XQ$=$}function T30(){return XQ$}var wJ,I11,XQ$=!1;var jT=L(()=>{wJ=QQ$();I11=new Set});import{createServer as JQ$}from"net";function bW4($){return new Promise((Z)=>{let Q=JQ$();Q.once("error",()=>Z(!1)),Q.listen($,"0.0.0.0",()=>{Q.close(()=>Z(!0))})})}async function Hr($){if(await bW4($))return $;let Z=await new Promise((Q,X)=>{let Y=JQ$();Y.once("error",X),Y.listen(0,"0.0.0.0",()=>{let J=Y.address(),G=typeof J==="object"&&J?J.port:0;Y.close(()=>Q(G))})});return console.warn(`Port ${$} is in use, using port ${Z} instead.`),Z}var S11=()=>{};var _11={};K0(_11,{startDevServer:()=>gW4,pipeToLogStore:()=>C11});import{join as yW4}from"path";function C11($){let Z=$.getReader(),Q=new TextDecoder,X="";function Y(){let J=X.split(`
2108
- `);X=J.pop()??"";for(let G of J){let K=Bun.stripANSI(G).replace(/^\[\d+\]\s*/,"").trim();if(!K)continue;Jw({method:"",path:"",status:0,duration:0,timestamp:new Date,rawLine:K})}}(async()=>{try{for(;;){let{done:J,value:G}=await Z.read();if(J)break;X+=Q.decode(G,{stream:!0}),Y()}}catch{}if(X.trim()){let J=Bun.stripANSI(X).replace(/^\[\d+\]\s*/,"").trim();if(J)Jw({method:"",path:"",status:0,duration:0,timestamp:new Date,rawLine:J})}})()}async function gW4($){let{baseUrl:Z,noTui:Q}=$,X=process.env.HOST==="0.0.0.0"&&Boolean(process.env.PORT),Y=X?process.env.PORT:$.vitePort,J=Z||`http://localhost:${Y}`,G=X?await Hr(Number(Y)+1):await Hr(Number($.port)),{settings:K,services:W,managedServiceNames:H}=await z30({port:String(G),home:$.home,baseUrl:$.baseUrl,localMode:$.localMode,skipMigrations:$.skipMigrations,noTui:$.noTui,vitePort:$.vitePort});for(let D of W)wT({name:D.name,status:"ready",port:D.port});Kr();let F=yW4(import.meta.dir,"..","..","..","..",".."),U=Q===!0,N=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:J,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",U?"inherit":"pipe",U?"inherit":"pipe"]});if(!U)C11(N.stdout),C11(N.stderr);Wr(J),wT({name:"Vite",status:"ready",port:Number(Y)}),wT({name:"API",status:"ready",port:Number(K.port)});let O=async(D)=>{if(N.kill(D),await N.exited,H.length>0){let{stopServices:w}=await Promise.resolve().then(() => (PG0(),zG0));await w(K.dataDir)}};return process.on("SIGINT",()=>O("SIGINT")),process.on("SIGTERM",()=>O("SIGTERM")),{port:Number(Y),process:N}}var v11=L(()=>{M11();jT();S11()});var A30;var x11=L(()=>{A30={name:"decocms",version:"4.400.6",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":"^4.0.58","@ai-sdk/google":"^4.0.76","@ai-sdk/openai":"^4.0.71","@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":"^3.1.0","@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":"^4.0.17","@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:"^7.0.107","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 uW4,Text as GQ$}from"ink";import{jsx as lW4,jsxs as KQ$}from"react/jsx-runtime";function WQ$({version:$}){return KQ$(uW4,{flexDirection:"column",marginTop:1,children:[dG0.map((Z,Q)=>lW4(GQ$,{color:iG0[Q],children:Z},Q)),KQ$(GQ$,{dimColor:!0,children:[" v",$]})]})}var HQ$=L(()=>{ia()});import{Box as ET,Text as Gw}from"ink";import{Spinner as cW4}from"@inkjs/ui";import{jsx as bG,jsxs as kl}from"react/jsx-runtime";function FQ$({status:$}){if($==="pending")return bG(cW4,{label:""});return bG(Gw,{color:"green",children:"\u2713"})}function mW4($){return`${$.name}: ${$.port||"...."}`}function UQ$({services:$,migrationsStatus:Z,home:Q,serverUrl:X}){return kl(ET,{flexDirection:"column",paddingBottom:1,children:[bG(WQ$,{version:A30.version}),bG(ET,{marginBottom:1,children:bG(Gw,{dimColor:!0,children:"\u2500".repeat(80)})}),bG(ET,{children:kl(Gw,{dimColor:!0,children:["Home: ",Q]})}),kl(ET,{gap:2,children:[$.map((Y)=>kl(ET,{gap:1,children:[bG(Gw,{children:mW4(Y)}),bG(FQ$,{status:Y.status})]},Y.name)),kl(ET,{gap:1,children:[bG(Gw,{children:"Migrations"}),bG(FQ$,{status:Z})]})]}),bG(ET,{children:X?kl(Gw,{children:["Open in browser: ",bG(Gw,{color:"cyan",children:X})]}):bG(Gw,{dimColor:!0,children:"Starting..."})})]})}var NQ$=L(()=>{x11();HQ$()});import{Box as dW4,Text as Fr}from"ink";import{jsx as f11,jsxs as b11}from"react/jsx-runtime";function iW4($){if($>=500)return"red";if($>=400)return"yellow";if($>=300)return"cyan";return"green"}function BQ$({logs:$}){return f11(dW4,{flexDirection:"column",children:$.map((Z,Q)=>{if(Z.rawLine)return f11(Fr,{dimColor:!0,children:Z.rawLine},Q);let X=Z.duration<1000?`${Z.duration}ms`:`${(Z.duration/1000).toFixed(1)}s`;return b11(Fr,{children:[b11(Fr,{dimColor:!0,children:[Z.method.padEnd(6)," ",Z.path.padEnd(30)," "]}),f11(Fr,{color:iW4(Z.status),children:Z.status}),b11(Fr,{dimColor:!0,children:[" ",X.padStart(8)]})]},Q)})})}var LQ$=()=>{};var y11={};K0(y11,{App:()=>tW4});import{Box as pW4}from"ink";import{useSyncExternalStore as nW4}from"react";import{jsx as OQ$,jsxs as oW4}from"react/jsx-runtime";function tW4({home:$}){let Z=nW4(k11,V11);return oW4(pW4,{flexDirection:"column",children:[OQ$(UQ$,{services:Z.services,migrationsStatus:Z.migrationsStatus,home:$,serverUrl:Z.serverUrl}),OQ$(BQ$,{logs:Z.logs})]})}var g11=L(()=>{NQ$();LQ$();jT()});var BK="thread-gate",uB="decopilot-hosted-harness",lB="decopilot-hosted-harness-sandboxed",LK="automations",Kw="background-tools",zT="task-board-github-reads";var DQ$="13";function wQ$($){return{name:"decocms",systemDatabaseUrl:$.systemDatabaseUrl,systemDatabaseSchemaName:"dbos",systemDatabasePoolSize:$.poolSize,runAdminServer:!1,executorID:$.executorID,applicationVersion:DQ$,...$.listenQueues!==void 0?{listenQueues:$.listenQueues}:{}}}var jQ$=()=>{};import aW4 from"pg";async function zQ$($,Z){let{databaseUrl:Q,lockTimeoutMs:X=rW4}=$,Y=$.log??((W)=>console.log(W)),J=new aW4.Client({connectionString:Q});await J.connect();let G=Date.now(),K=!1;try{while(!K){if(K=(await J.query("SELECT pg_try_advisory_lock($1) AS locked",[EQ$.toString()])).rows[0]?.locked===!0,K)break;if(Date.now()-G>=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 S$(sW4)}let W=Date.now()-G;if(W>1000)Y(`[dbos] waited ${W}ms for the migration lock; another process migrated first`);return await Z()}finally{if(K)try{await J.query("SELECT pg_advisory_unlock($1)",[EQ$.toString()])}catch{}await J.end().catch(()=>{})}}var EQ$=8314027461559302n,rW4=600000,sW4=500;var PQ$=L(()=>{w8()});function eW4(){let $=(process.env.BUN_OPTIONS??"").split(/\s+/).filter(Boolean);return[...process.argv.slice(1),...$]}function h11($,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 TQ$(){let $=eW4();if($.includes("--cpu-prof")){console.log(JSON.stringify({msg:"cpu-profiling-active",dir:h11($,"--cpu-prof-dir")??process.cwd(),name:h11($,"--cpu-prof-name"),markdown:$.includes("--cpu-prof-md"),intervalUs:Number(h11($,"--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 AQ$(){if(process.env.HEAP_WATCH!=="1")return()=>{};let $=Number(process.env.HEAP_WATCH_INTERVAL_MS??60000),Z=async()=>{let Q=BT();if(!Q)return;let X={};try{let{heapStats:Y}=await import("bun:jsc"),J=Y(),G=Object.entries(J.objectTypeCounts).sort((K,W)=>W[1]-K[1]).slice(0,20);X={objectCount:J.objectCount,heapSize:J.heapSize,top:Object.fromEntries(G)}}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(()=>{}),R30=setInterval(()=>void Z().catch(()=>{}),$),R30.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(R30)clearInterval(R30)}}var R30;var RQ$=()=>{};import*as $H4 from"bun:jsc";function qQ$(){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{ZH4()}catch(J){return console.error("[stall-watchdog] failed to start sampling profiler:",J),()=>{}}let Q,X=performance.now()+Z,Y=()=>{let J=performance.now(),G=J-X;X=J+Z;let K=[];try{K=QH4()?.traces??[]}catch{}if(G>$&&K.length>0){let W=new Map;for(let F of K){let U=F.frames.find((O)=>O.sourceURL&&!/Unknown Executable/.test(O.category??""))??F.frames[0];if(!U)continue;let N=(U.sourceURL??"?").replace(/^.*\/node_modules\//,"node_modules/"),B=`${U.name??"?"} @ ${N}:${U.line??"?"}`;W.set(B,(W.get(B)??0)+1)}let H=[...W.entries()].sort((F,U)=>U[1]-F[1]).slice(0,8).map(([F,U])=>({frame:F,count:U}));console.warn(JSON.stringify({msg:"stall-stack",ts:new Date().toISOString(),lagMs:Math.round(G),samplesInWindow:K.length,top:H}))}Q=setTimeout(Y,Z),Q.unref?.()};return Q=setTimeout(Y,Z),Q.unref?.(),()=>{if(Q)clearTimeout(Q)}}var ZH4,QH4;var MQ$=L(()=>{({startSamplingProfiler:ZH4,samplingProfilerStackTraces:QH4}=$H4)});function IQ$(){TQ$();let $=[AQ$(),H6$(),qQ$()];return()=>{for(let Z of $)Z()}}var VQ$=L(()=>{Ma0();RQ$();MQ$()});var PT=b((kQ$)=>{Object.defineProperty(kQ$,"__esModule",{value:!0});kQ$.RepublishHeaders=kQ$.DirectMsgHeaders=kQ$.JsHeaders=kQ$.AdvisoryKind=void 0;kQ$.isOrderedPushConsumerOptions=XH4;kQ$.isPullConsumer=YH4;kQ$.isPushConsumer=JH4;kQ$.isBoundPushConsumerOptions=GH4;function XH4($){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 YH4($){return $.isPullConsumer()}function JH4($){return $.isPushConsumer()}function GH4($){if($&&typeof $==="object")return"deliver_subject"in $||"deliver_group"in $||"idle_heartbeat"in $;return!1}kQ$.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"};kQ$.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"};kQ$.DirectMsgHeaders={Stream:"Nats-Stream",Sequence:"Nats-Sequence",TimeStamp:"Nats-Time-Stamp",Subject:"Nats-Subject",LastSequence:"Nats-Last-Sequence",NumPending:"Nats-Num-Pending"};kQ$.RepublishHeaders={Stream:"Nats-Stream",Subject:"Nats-Subject",Sequence:"Nats-Sequence",LastSequence:"Nats-Last-Sequence",Size:"Nats-Msg-Size"}});var yG=b((CQ$)=>{Object.defineProperty(CQ$,"__esModule",{value:!0});CQ$.TD=CQ$.TE=CQ$.Empty=void 0;CQ$.encode=OH4;CQ$.decode=DH4;CQ$.Empty=new Uint8Array(0);CQ$.TE=new TextEncoder;CQ$.TD=new TextDecoder;function LH4(...$){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 OH4(...$){let Z=[];for(let Q=0;Q<$.length;Q++)Z.push(CQ$.TE.encode($[Q]));if(Z.length===0)return CQ$.Empty;if(Z.length===1)return Z[0];return LH4(...Z)}function DH4($){if(!$||$.length===0)return"";return CQ$.TD.decode($)}});var gG=b((xQ$)=>{Object.defineProperty(xQ$,"__esModule",{value:!0});xQ$.errors=xQ$.PermissionViolationError=xQ$.NoRespondersError=xQ$.TimeoutError=xQ$.RequestError=xQ$.ProtocolError=xQ$.ConnectionError=xQ$.DrainingConnectionError=xQ$.ClosedConnectionError=xQ$.AuthorizationError=xQ$.UserAuthenticationExpiredError=xQ$.InvalidOperationError=xQ$.InvalidArgumentError=xQ$.InvalidSubjectError=void 0;class l11 extends Error{constructor($,Z){super(`illegal subject: '${$}'`,Z);this.name="InvalidSubjectError"}}xQ$.InvalidSubjectError=l11;class q30 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 q30(`${$} ${Z}`,Q)}}xQ$.InvalidArgumentError=q30;class c11 extends Error{constructor($,Z){super($,Z);this.name="InvalidOperationError"}}xQ$.InvalidOperationError=c11;class M30 extends Error{constructor($,Z){super($,Z);this.name="UserAuthenticationExpiredError"}static parse($){if($.toLowerCase().indexOf("user authentication expired")!==-1)return new M30($);return null}}xQ$.UserAuthenticationExpiredError=M30;class I30 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 I30($);return null}}xQ$.AuthorizationError=I30;class m11 extends Error{constructor(){super("closed connection");this.name="ClosedConnectionError"}}xQ$.ClosedConnectionError=m11;class d11 extends Error{constructor(){super("connection draining");this.name="DrainingConnectionError"}}xQ$.DrainingConnectionError=d11;class i11 extends Error{constructor($,Z){super($,Z);this.name="ConnectionError"}}xQ$.ConnectionError=i11;class p11 extends Error{constructor($,Z){super($,Z);this.name="ProtocolError"}}xQ$.ProtocolError=p11;class n11 extends Error{constructor($="",Z){super($,Z);this.name="RequestError"}isNoResponders(){return this.cause instanceof V30}}xQ$.RequestError=n11;class t11 extends Error{constructor($){super("timeout",$);this.name="TimeoutError"}}xQ$.TimeoutError=t11;class V30 extends Error{subject;constructor($,Z){super(`no responders: '${$}'`,Z);this.subject=$,this.name="NoResponders"}}xQ$.NoRespondersError=V30;class k30 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,J=$.match(/(Publish|Subscription) to "(\S+)"/);if(J){if(Q=J[1].toLowerCase(),X=J[2],Q==="subscription"){let G=$.match(/using queue "(\S+)"/);if(G)Y=G[1]}}return new k30($,Q,X,Y)}}xQ$.PermissionViolationError=k30;xQ$.errors={AuthorizationError:I30,ClosedConnectionError:m11,ConnectionError:i11,DrainingConnectionError:d11,InvalidArgumentError:q30,InvalidOperationError:c11,InvalidSubjectError:l11,NoRespondersError:V30,PermissionViolationError:k30,ProtocolError:p11,RequestError:n11,TimeoutError:t11,UserAuthenticationExpiredError:M30}});var oW=b((hQ$)=>{Object.defineProperty(hQ$,"__esModule",{value:!0});hQ$.SimpleMutex=hQ$.Perf=void 0;hQ$.extend=vH4;hQ$.render=xH4;hQ$.timeout=fH4;hQ$.delay=bH4;hQ$.deadline=yH4;hQ$.deferred=a11;hQ$.debugDeferred=gH4;hQ$.shuffle=hH4;hQ$.collect=uH4;hQ$.jitter=gQ$;hQ$.backoff=lH4;hQ$.nanos=cH4;hQ$.millis=mH4;hQ$.randomToken=pH4;var _H4=yG(),o11=gG();function vH4($,...Z){for(let Q=0;Q<Z.length;Q++){let X=Z[Q];Object.keys(X).forEach(function(Y){$[Y]=X[Y]})}return $}function xH4($){return _H4.TD.decode($).replace(/\n/g,"\u240A").replace(/\r/g,"\u240D")}function fH4($,Z=!0){let Q=Z?new o11.TimeoutError:null,X,Y,J=new Promise((G,K)=>{X={cancel:()=>{if(Y)clearTimeout(Y)}},Y=setTimeout(()=>{if(Q===null)K(new o11.TimeoutError);else K(Q)},$)});return Object.assign(J,X)}function bH4($=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 yH4($,Z=1000){let Q=a11(),X=setTimeout(()=>{Q.reject(new o11.TimeoutError)},Z);try{return await Promise.race([$,Q])}finally{clearTimeout(X)}}function a11(){let $={},Z=new Promise((Q,X)=>{$={resolve:Q,reject:X}});return Object.assign(Z,$)}function gH4(){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 hH4($){for(let Z=$.length-1;Z>0;Z--){let Q=Math.floor(Math.random()*(Z+1));[$[Z],$[Q]]=[$[Q],$[Z]]}return $}async function uH4($){let Z=[];for await(let Q of $)Z.push(Q);return Z}class bQ${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})}),$}}hQ$.Perf=bQ$;class yQ${max;current;waiting;constructor($=1){this.max=$,this.current=0,this.waiting=[]}lock(){if(this.current++,this.current<=this.max)return Promise.resolve();let $=a11();return this.waiting.push($),$}unlock(){this.current--,this.waiting.pop()?.resolve()}}hQ$.SimpleMutex=yQ$;function gQ$($){if($===0)return 0;return Math.floor($/2+Math.random()*$)}function lH4($=[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 gQ$(Q>Z?$[Z]:$[Q])}}}function cH4($){return $*1e6}function mH4($){return Math.floor($/1e6)}var dH4="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",cB=new Uint8Array(62);for(let $=0;$<62;$++)cB[$]=dH4.charCodeAt($);var iH4=218340105584896;function pH4(){let $=Math.floor(Math.random()*iH4),Z=$%62,Q=cB[Z];$=($-Z)/62,Z=$%62;let X=cB[Z];$=($-Z)/62,Z=$%62;let Y=cB[Z];$=($-Z)/62,Z=$%62;let J=cB[Z];$=($-Z)/62,Z=$%62;let G=cB[Z];$=($-Z)/62,Z=$%62;let K=cB[Z];$=($-Z)/62,Z=$%62;let W=cB[Z];$=($-Z)/62;let H=cB[$];return String.fromCharCode(Q,X,Y,J,G,K,W,H)}});var nQ$=b((iQ$)=>{Object.defineProperty(iQ$,"__esModule",{value:!0});iQ$.nuid=iQ$.NuidImpl=void 0;var WF4="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Ww=62,C30=12,mQ$=10,lQ$=33,HF4=333,cQ$=C30+mQ$,s11=new Uint8Array(Ww);for(let $=0;$<Ww;$++)s11[$]=WF4.charCodeAt($);var S30=4294967296,dQ$=BigInt(Ww)**BigInt(mQ$),Ur=Number(dQ$/(1n<<32n)),r11=Number(dQ$%(1n<<32n));function FF4($){for(let Z=0;Z<$.length;Z++)$[Z]=Math.floor(Math.random()*256)}function UF4($){if(globalThis?.crypto?.getRandomValues)globalThis.crypto.getRandomValues($);else FF4($)}class e11{buf;cbuf;seqHi;seqLo;inc;inited;constructor(){this.buf=new Uint8Array(cQ$),this.cbuf=new Uint8Array(C30),this.inited=!1}init(){this.inited=!0,this.setPre(),this.initSeqAndInc(),this.fillSeq()}initSeqAndInc(){let $=0;do this.seqHi=Math.floor(Math.random()*(Ur+1)),this.seqLo=Math.floor(Math.random()*S30);while($++<8&&this.seqHi===Ur&&this.seqLo>=r11);if(this.seqHi===Ur&&this.seqLo>=r11)this.seqLo=0;this.inc=Math.random()*(HF4-lQ$)+lQ$|0}setPre(){UF4(this.cbuf);for(let $=0;$<C30;$++)this.buf[$]=s11[this.cbuf[$]%Ww]}fillSeq(){let $=this.seqHi,Z=this.seqLo;for(let Q=cQ$-1;Q>=C30;Q--){let X=Math.floor($/Ww),J=($-X*Ww)*S30+Z,G=Math.floor(J/Ww),K=J-G*Ww;this.buf[Q]=s11[K],$=X,Z=G}}next(){if(!this.inited)this.init();if(this.seqLo+=this.inc,this.seqLo>=S30)this.seqLo-=S30,this.seqHi+=1;if(this.seqHi>Ur||this.seqHi===Ur&&this.seqLo>=r11)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()}}iQ$.NuidImpl=e11;iQ$.nuid=new e11});var rQ$=b((oQ$)=>{Object.defineProperty(oQ$,"__esModule",{value:!0});oQ$.nuid=oQ$.Nuid=void 0;var tQ$=nQ$();oQ$.Nuid=tQ$.NuidImpl;oQ$.nuid=tQ$.nuid});var v30=b((_30)=>{Object.defineProperty(_30,"__esModule",{value:!0});_30.nuid=_30.Nuid=void 0;var sQ$=rQ$();Object.defineProperty(_30,"Nuid",{enumerable:!0,get:function(){return sQ$.Nuid}});Object.defineProperty(_30,"nuid",{enumerable:!0,get:function(){return sQ$.nuid}})});var Hw=b((eQ$)=>{Object.defineProperty(eQ$,"__esModule",{value:!0});eQ$.DEFAULT_HOST=eQ$.DEFAULT_PORT=eQ$.Match=void 0;eQ$.syncIterator=wF4;eQ$.createInbox=jF4;var OF4=v30(),DF4=gG();eQ$.Match={Exact:"exact",CanonicalMIME:"canonical",IgnoreCase:"insensitive"};function wF4($){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 jF4($=""){if($=$||"_INBOX",typeof $!=="string")throw TypeError("prefix must be a string");return $.split(".").forEach((Z)=>{if(Z==="*"||Z===">")throw DF4.InvalidArgumentError.format("prefix",`cannot have wildcards ('${$}')`)}),`${$}.${OF4.nuid.next()}`}eQ$.DEFAULT_PORT=4222;eQ$.DEFAULT_HOST="127.0.0.1"});var Nr=b((XX$)=>{Object.defineProperty(XX$,"__esModule",{value:!0});XX$.DataBuffer=void 0;var ZX$=yG();class QX${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 ZX$.TE.encode($)}static toAscii($){return ZX$.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}}XX$.DataBuffer=QX$});var TT=b((GX$)=>{Object.defineProperty(GX$,"__esModule",{value:!0});GX$.LF=GX$.CR=GX$.CRLF=GX$.CR_LF_LEN=GX$.CR_LF=void 0;GX$.setTransportFactory=MF4;GX$.defaultPort=IF4;GX$.getUrlParseFn=VF4;GX$.newTransport=kF4;GX$.getResolveFn=SF4;GX$.protoLen=JX$;GX$.extractProtocolMessage=CF4;var AF4=yG(),RF4=Hw(),qF4=Nr(),hG;function MF4($){hG=$}function IF4(){return hG!==void 0&&hG.defaultPort!==void 0?hG.defaultPort:RF4.DEFAULT_PORT}function VF4(){return hG!==void 0&&hG.urlParseFn?hG.urlParseFn:void 0}function kF4(){if(!hG||typeof hG.factory!=="function")throw Error("transport fn is not set");return hG.factory()}function SF4(){return hG!==void 0&&hG.dnsResolveFn?hG.dnsResolveFn:void 0}GX$.CR_LF=`\r
2108
+ `);X=J.pop()??"";for(let G of J){let K=Bun.stripANSI(G).replace(/^\[\d+\]\s*/,"").trim();if(!K)continue;Jw({method:"",path:"",status:0,duration:0,timestamp:new Date,rawLine:K})}}(async()=>{try{for(;;){let{done:J,value:G}=await Z.read();if(J)break;X+=Q.decode(G,{stream:!0}),Y()}}catch{}if(X.trim()){let J=Bun.stripANSI(X).replace(/^\[\d+\]\s*/,"").trim();if(J)Jw({method:"",path:"",status:0,duration:0,timestamp:new Date,rawLine:J})}})()}async function gW4($){let{baseUrl:Z,noTui:Q}=$,X=process.env.HOST==="0.0.0.0"&&Boolean(process.env.PORT),Y=X?process.env.PORT:$.vitePort,J=Z||`http://localhost:${Y}`,G=X?await Hr(Number(Y)+1):await Hr(Number($.port)),{settings:K,services:W,managedServiceNames:H}=await z30({port:String(G),home:$.home,baseUrl:$.baseUrl,localMode:$.localMode,skipMigrations:$.skipMigrations,noTui:$.noTui,vitePort:$.vitePort});for(let D of W)wT({name:D.name,status:"ready",port:D.port});Kr();let F=yW4(import.meta.dir,"..","..","..","..",".."),U=Q===!0,N=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:J,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",U?"inherit":"pipe",U?"inherit":"pipe"]});if(!U)C11(N.stdout),C11(N.stderr);Wr(J),wT({name:"Vite",status:"ready",port:Number(Y)}),wT({name:"API",status:"ready",port:Number(K.port)});let O=async(D)=>{if(N.kill(D),await N.exited,H.length>0){let{stopServices:w}=await Promise.resolve().then(() => (PG0(),zG0));await w(K.dataDir)}};return process.on("SIGINT",()=>O("SIGINT")),process.on("SIGTERM",()=>O("SIGTERM")),{port:Number(Y),process:N}}var v11=L(()=>{M11();jT();S11()});var A30;var x11=L(()=>{A30={name:"decocms",version:"4.401.0",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":"^4.0.58","@ai-sdk/google":"^4.0.76","@ai-sdk/openai":"^4.0.71","@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":"^3.1.0","@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":"^4.0.17","@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:"^7.0.107","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 uW4,Text as GQ$}from"ink";import{jsx as lW4,jsxs as KQ$}from"react/jsx-runtime";function WQ$({version:$}){return KQ$(uW4,{flexDirection:"column",marginTop:1,children:[dG0.map((Z,Q)=>lW4(GQ$,{color:iG0[Q],children:Z},Q)),KQ$(GQ$,{dimColor:!0,children:[" v",$]})]})}var HQ$=L(()=>{ia()});import{Box as ET,Text as Gw}from"ink";import{Spinner as cW4}from"@inkjs/ui";import{jsx as bG,jsxs as kl}from"react/jsx-runtime";function FQ$({status:$}){if($==="pending")return bG(cW4,{label:""});return bG(Gw,{color:"green",children:"\u2713"})}function mW4($){return`${$.name}: ${$.port||"...."}`}function UQ$({services:$,migrationsStatus:Z,home:Q,serverUrl:X}){return kl(ET,{flexDirection:"column",paddingBottom:1,children:[bG(WQ$,{version:A30.version}),bG(ET,{marginBottom:1,children:bG(Gw,{dimColor:!0,children:"\u2500".repeat(80)})}),bG(ET,{children:kl(Gw,{dimColor:!0,children:["Home: ",Q]})}),kl(ET,{gap:2,children:[$.map((Y)=>kl(ET,{gap:1,children:[bG(Gw,{children:mW4(Y)}),bG(FQ$,{status:Y.status})]},Y.name)),kl(ET,{gap:1,children:[bG(Gw,{children:"Migrations"}),bG(FQ$,{status:Z})]})]}),bG(ET,{children:X?kl(Gw,{children:["Open in browser: ",bG(Gw,{color:"cyan",children:X})]}):bG(Gw,{dimColor:!0,children:"Starting..."})})]})}var NQ$=L(()=>{x11();HQ$()});import{Box as dW4,Text as Fr}from"ink";import{jsx as f11,jsxs as b11}from"react/jsx-runtime";function iW4($){if($>=500)return"red";if($>=400)return"yellow";if($>=300)return"cyan";return"green"}function BQ$({logs:$}){return f11(dW4,{flexDirection:"column",children:$.map((Z,Q)=>{if(Z.rawLine)return f11(Fr,{dimColor:!0,children:Z.rawLine},Q);let X=Z.duration<1000?`${Z.duration}ms`:`${(Z.duration/1000).toFixed(1)}s`;return b11(Fr,{children:[b11(Fr,{dimColor:!0,children:[Z.method.padEnd(6)," ",Z.path.padEnd(30)," "]}),f11(Fr,{color:iW4(Z.status),children:Z.status}),b11(Fr,{dimColor:!0,children:[" ",X.padStart(8)]})]},Q)})})}var LQ$=()=>{};var y11={};K0(y11,{App:()=>tW4});import{Box as pW4}from"ink";import{useSyncExternalStore as nW4}from"react";import{jsx as OQ$,jsxs as oW4}from"react/jsx-runtime";function tW4({home:$}){let Z=nW4(k11,V11);return oW4(pW4,{flexDirection:"column",children:[OQ$(UQ$,{services:Z.services,migrationsStatus:Z.migrationsStatus,home:$,serverUrl:Z.serverUrl}),OQ$(BQ$,{logs:Z.logs})]})}var g11=L(()=>{NQ$();LQ$();jT()});var BK="thread-gate",uB="decopilot-hosted-harness",lB="decopilot-hosted-harness-sandboxed",LK="automations",Kw="background-tools",zT="task-board-github-reads";var DQ$="13";function wQ$($){return{name:"decocms",systemDatabaseUrl:$.systemDatabaseUrl,systemDatabaseSchemaName:"dbos",systemDatabasePoolSize:$.poolSize,runAdminServer:!1,executorID:$.executorID,applicationVersion:DQ$,...$.listenQueues!==void 0?{listenQueues:$.listenQueues}:{}}}var jQ$=()=>{};import aW4 from"pg";async function zQ$($,Z){let{databaseUrl:Q,lockTimeoutMs:X=rW4}=$,Y=$.log??((W)=>console.log(W)),J=new aW4.Client({connectionString:Q});await J.connect();let G=Date.now(),K=!1;try{while(!K){if(K=(await J.query("SELECT pg_try_advisory_lock($1) AS locked",[EQ$.toString()])).rows[0]?.locked===!0,K)break;if(Date.now()-G>=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 S$(sW4)}let W=Date.now()-G;if(W>1000)Y(`[dbos] waited ${W}ms for the migration lock; another process migrated first`);return await Z()}finally{if(K)try{await J.query("SELECT pg_advisory_unlock($1)",[EQ$.toString()])}catch{}await J.end().catch(()=>{})}}var EQ$=8314027461559302n,rW4=600000,sW4=500;var PQ$=L(()=>{w8()});function eW4(){let $=(process.env.BUN_OPTIONS??"").split(/\s+/).filter(Boolean);return[...process.argv.slice(1),...$]}function h11($,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 TQ$(){let $=eW4();if($.includes("--cpu-prof")){console.log(JSON.stringify({msg:"cpu-profiling-active",dir:h11($,"--cpu-prof-dir")??process.cwd(),name:h11($,"--cpu-prof-name"),markdown:$.includes("--cpu-prof-md"),intervalUs:Number(h11($,"--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 AQ$(){if(process.env.HEAP_WATCH!=="1")return()=>{};let $=Number(process.env.HEAP_WATCH_INTERVAL_MS??60000),Z=async()=>{let Q=BT();if(!Q)return;let X={};try{let{heapStats:Y}=await import("bun:jsc"),J=Y(),G=Object.entries(J.objectTypeCounts).sort((K,W)=>W[1]-K[1]).slice(0,20);X={objectCount:J.objectCount,heapSize:J.heapSize,top:Object.fromEntries(G)}}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(()=>{}),R30=setInterval(()=>void Z().catch(()=>{}),$),R30.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(R30)clearInterval(R30)}}var R30;var RQ$=()=>{};import*as $H4 from"bun:jsc";function qQ$(){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{ZH4()}catch(J){return console.error("[stall-watchdog] failed to start sampling profiler:",J),()=>{}}let Q,X=performance.now()+Z,Y=()=>{let J=performance.now(),G=J-X;X=J+Z;let K=[];try{K=QH4()?.traces??[]}catch{}if(G>$&&K.length>0){let W=new Map;for(let F of K){let U=F.frames.find((O)=>O.sourceURL&&!/Unknown Executable/.test(O.category??""))??F.frames[0];if(!U)continue;let N=(U.sourceURL??"?").replace(/^.*\/node_modules\//,"node_modules/"),B=`${U.name??"?"} @ ${N}:${U.line??"?"}`;W.set(B,(W.get(B)??0)+1)}let H=[...W.entries()].sort((F,U)=>U[1]-F[1]).slice(0,8).map(([F,U])=>({frame:F,count:U}));console.warn(JSON.stringify({msg:"stall-stack",ts:new Date().toISOString(),lagMs:Math.round(G),samplesInWindow:K.length,top:H}))}Q=setTimeout(Y,Z),Q.unref?.()};return Q=setTimeout(Y,Z),Q.unref?.(),()=>{if(Q)clearTimeout(Q)}}var ZH4,QH4;var MQ$=L(()=>{({startSamplingProfiler:ZH4,samplingProfilerStackTraces:QH4}=$H4)});function IQ$(){TQ$();let $=[AQ$(),H6$(),qQ$()];return()=>{for(let Z of $)Z()}}var VQ$=L(()=>{Ma0();RQ$();MQ$()});var PT=b((kQ$)=>{Object.defineProperty(kQ$,"__esModule",{value:!0});kQ$.RepublishHeaders=kQ$.DirectMsgHeaders=kQ$.JsHeaders=kQ$.AdvisoryKind=void 0;kQ$.isOrderedPushConsumerOptions=XH4;kQ$.isPullConsumer=YH4;kQ$.isPushConsumer=JH4;kQ$.isBoundPushConsumerOptions=GH4;function XH4($){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 YH4($){return $.isPullConsumer()}function JH4($){return $.isPushConsumer()}function GH4($){if($&&typeof $==="object")return"deliver_subject"in $||"deliver_group"in $||"idle_heartbeat"in $;return!1}kQ$.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"};kQ$.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"};kQ$.DirectMsgHeaders={Stream:"Nats-Stream",Sequence:"Nats-Sequence",TimeStamp:"Nats-Time-Stamp",Subject:"Nats-Subject",LastSequence:"Nats-Last-Sequence",NumPending:"Nats-Num-Pending"};kQ$.RepublishHeaders={Stream:"Nats-Stream",Subject:"Nats-Subject",Sequence:"Nats-Sequence",LastSequence:"Nats-Last-Sequence",Size:"Nats-Msg-Size"}});var yG=b((CQ$)=>{Object.defineProperty(CQ$,"__esModule",{value:!0});CQ$.TD=CQ$.TE=CQ$.Empty=void 0;CQ$.encode=OH4;CQ$.decode=DH4;CQ$.Empty=new Uint8Array(0);CQ$.TE=new TextEncoder;CQ$.TD=new TextDecoder;function LH4(...$){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 OH4(...$){let Z=[];for(let Q=0;Q<$.length;Q++)Z.push(CQ$.TE.encode($[Q]));if(Z.length===0)return CQ$.Empty;if(Z.length===1)return Z[0];return LH4(...Z)}function DH4($){if(!$||$.length===0)return"";return CQ$.TD.decode($)}});var gG=b((xQ$)=>{Object.defineProperty(xQ$,"__esModule",{value:!0});xQ$.errors=xQ$.PermissionViolationError=xQ$.NoRespondersError=xQ$.TimeoutError=xQ$.RequestError=xQ$.ProtocolError=xQ$.ConnectionError=xQ$.DrainingConnectionError=xQ$.ClosedConnectionError=xQ$.AuthorizationError=xQ$.UserAuthenticationExpiredError=xQ$.InvalidOperationError=xQ$.InvalidArgumentError=xQ$.InvalidSubjectError=void 0;class l11 extends Error{constructor($,Z){super(`illegal subject: '${$}'`,Z);this.name="InvalidSubjectError"}}xQ$.InvalidSubjectError=l11;class q30 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 q30(`${$} ${Z}`,Q)}}xQ$.InvalidArgumentError=q30;class c11 extends Error{constructor($,Z){super($,Z);this.name="InvalidOperationError"}}xQ$.InvalidOperationError=c11;class M30 extends Error{constructor($,Z){super($,Z);this.name="UserAuthenticationExpiredError"}static parse($){if($.toLowerCase().indexOf("user authentication expired")!==-1)return new M30($);return null}}xQ$.UserAuthenticationExpiredError=M30;class I30 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 I30($);return null}}xQ$.AuthorizationError=I30;class m11 extends Error{constructor(){super("closed connection");this.name="ClosedConnectionError"}}xQ$.ClosedConnectionError=m11;class d11 extends Error{constructor(){super("connection draining");this.name="DrainingConnectionError"}}xQ$.DrainingConnectionError=d11;class i11 extends Error{constructor($,Z){super($,Z);this.name="ConnectionError"}}xQ$.ConnectionError=i11;class p11 extends Error{constructor($,Z){super($,Z);this.name="ProtocolError"}}xQ$.ProtocolError=p11;class n11 extends Error{constructor($="",Z){super($,Z);this.name="RequestError"}isNoResponders(){return this.cause instanceof V30}}xQ$.RequestError=n11;class t11 extends Error{constructor($){super("timeout",$);this.name="TimeoutError"}}xQ$.TimeoutError=t11;class V30 extends Error{subject;constructor($,Z){super(`no responders: '${$}'`,Z);this.subject=$,this.name="NoResponders"}}xQ$.NoRespondersError=V30;class k30 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,J=$.match(/(Publish|Subscription) to "(\S+)"/);if(J){if(Q=J[1].toLowerCase(),X=J[2],Q==="subscription"){let G=$.match(/using queue "(\S+)"/);if(G)Y=G[1]}}return new k30($,Q,X,Y)}}xQ$.PermissionViolationError=k30;xQ$.errors={AuthorizationError:I30,ClosedConnectionError:m11,ConnectionError:i11,DrainingConnectionError:d11,InvalidArgumentError:q30,InvalidOperationError:c11,InvalidSubjectError:l11,NoRespondersError:V30,PermissionViolationError:k30,ProtocolError:p11,RequestError:n11,TimeoutError:t11,UserAuthenticationExpiredError:M30}});var oW=b((hQ$)=>{Object.defineProperty(hQ$,"__esModule",{value:!0});hQ$.SimpleMutex=hQ$.Perf=void 0;hQ$.extend=vH4;hQ$.render=xH4;hQ$.timeout=fH4;hQ$.delay=bH4;hQ$.deadline=yH4;hQ$.deferred=a11;hQ$.debugDeferred=gH4;hQ$.shuffle=hH4;hQ$.collect=uH4;hQ$.jitter=gQ$;hQ$.backoff=lH4;hQ$.nanos=cH4;hQ$.millis=mH4;hQ$.randomToken=pH4;var _H4=yG(),o11=gG();function vH4($,...Z){for(let Q=0;Q<Z.length;Q++){let X=Z[Q];Object.keys(X).forEach(function(Y){$[Y]=X[Y]})}return $}function xH4($){return _H4.TD.decode($).replace(/\n/g,"\u240A").replace(/\r/g,"\u240D")}function fH4($,Z=!0){let Q=Z?new o11.TimeoutError:null,X,Y,J=new Promise((G,K)=>{X={cancel:()=>{if(Y)clearTimeout(Y)}},Y=setTimeout(()=>{if(Q===null)K(new o11.TimeoutError);else K(Q)},$)});return Object.assign(J,X)}function bH4($=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 yH4($,Z=1000){let Q=a11(),X=setTimeout(()=>{Q.reject(new o11.TimeoutError)},Z);try{return await Promise.race([$,Q])}finally{clearTimeout(X)}}function a11(){let $={},Z=new Promise((Q,X)=>{$={resolve:Q,reject:X}});return Object.assign(Z,$)}function gH4(){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 hH4($){for(let Z=$.length-1;Z>0;Z--){let Q=Math.floor(Math.random()*(Z+1));[$[Z],$[Q]]=[$[Q],$[Z]]}return $}async function uH4($){let Z=[];for await(let Q of $)Z.push(Q);return Z}class bQ${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})}),$}}hQ$.Perf=bQ$;class yQ${max;current;waiting;constructor($=1){this.max=$,this.current=0,this.waiting=[]}lock(){if(this.current++,this.current<=this.max)return Promise.resolve();let $=a11();return this.waiting.push($),$}unlock(){this.current--,this.waiting.pop()?.resolve()}}hQ$.SimpleMutex=yQ$;function gQ$($){if($===0)return 0;return Math.floor($/2+Math.random()*$)}function lH4($=[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 gQ$(Q>Z?$[Z]:$[Q])}}}function cH4($){return $*1e6}function mH4($){return Math.floor($/1e6)}var dH4="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",cB=new Uint8Array(62);for(let $=0;$<62;$++)cB[$]=dH4.charCodeAt($);var iH4=218340105584896;function pH4(){let $=Math.floor(Math.random()*iH4),Z=$%62,Q=cB[Z];$=($-Z)/62,Z=$%62;let X=cB[Z];$=($-Z)/62,Z=$%62;let Y=cB[Z];$=($-Z)/62,Z=$%62;let J=cB[Z];$=($-Z)/62,Z=$%62;let G=cB[Z];$=($-Z)/62,Z=$%62;let K=cB[Z];$=($-Z)/62,Z=$%62;let W=cB[Z];$=($-Z)/62;let H=cB[$];return String.fromCharCode(Q,X,Y,J,G,K,W,H)}});var nQ$=b((iQ$)=>{Object.defineProperty(iQ$,"__esModule",{value:!0});iQ$.nuid=iQ$.NuidImpl=void 0;var WF4="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Ww=62,C30=12,mQ$=10,lQ$=33,HF4=333,cQ$=C30+mQ$,s11=new Uint8Array(Ww);for(let $=0;$<Ww;$++)s11[$]=WF4.charCodeAt($);var S30=4294967296,dQ$=BigInt(Ww)**BigInt(mQ$),Ur=Number(dQ$/(1n<<32n)),r11=Number(dQ$%(1n<<32n));function FF4($){for(let Z=0;Z<$.length;Z++)$[Z]=Math.floor(Math.random()*256)}function UF4($){if(globalThis?.crypto?.getRandomValues)globalThis.crypto.getRandomValues($);else FF4($)}class e11{buf;cbuf;seqHi;seqLo;inc;inited;constructor(){this.buf=new Uint8Array(cQ$),this.cbuf=new Uint8Array(C30),this.inited=!1}init(){this.inited=!0,this.setPre(),this.initSeqAndInc(),this.fillSeq()}initSeqAndInc(){let $=0;do this.seqHi=Math.floor(Math.random()*(Ur+1)),this.seqLo=Math.floor(Math.random()*S30);while($++<8&&this.seqHi===Ur&&this.seqLo>=r11);if(this.seqHi===Ur&&this.seqLo>=r11)this.seqLo=0;this.inc=Math.random()*(HF4-lQ$)+lQ$|0}setPre(){UF4(this.cbuf);for(let $=0;$<C30;$++)this.buf[$]=s11[this.cbuf[$]%Ww]}fillSeq(){let $=this.seqHi,Z=this.seqLo;for(let Q=cQ$-1;Q>=C30;Q--){let X=Math.floor($/Ww),J=($-X*Ww)*S30+Z,G=Math.floor(J/Ww),K=J-G*Ww;this.buf[Q]=s11[K],$=X,Z=G}}next(){if(!this.inited)this.init();if(this.seqLo+=this.inc,this.seqLo>=S30)this.seqLo-=S30,this.seqHi+=1;if(this.seqHi>Ur||this.seqHi===Ur&&this.seqLo>=r11)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()}}iQ$.NuidImpl=e11;iQ$.nuid=new e11});var rQ$=b((oQ$)=>{Object.defineProperty(oQ$,"__esModule",{value:!0});oQ$.nuid=oQ$.Nuid=void 0;var tQ$=nQ$();oQ$.Nuid=tQ$.NuidImpl;oQ$.nuid=tQ$.nuid});var v30=b((_30)=>{Object.defineProperty(_30,"__esModule",{value:!0});_30.nuid=_30.Nuid=void 0;var sQ$=rQ$();Object.defineProperty(_30,"Nuid",{enumerable:!0,get:function(){return sQ$.Nuid}});Object.defineProperty(_30,"nuid",{enumerable:!0,get:function(){return sQ$.nuid}})});var Hw=b((eQ$)=>{Object.defineProperty(eQ$,"__esModule",{value:!0});eQ$.DEFAULT_HOST=eQ$.DEFAULT_PORT=eQ$.Match=void 0;eQ$.syncIterator=wF4;eQ$.createInbox=jF4;var OF4=v30(),DF4=gG();eQ$.Match={Exact:"exact",CanonicalMIME:"canonical",IgnoreCase:"insensitive"};function wF4($){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 jF4($=""){if($=$||"_INBOX",typeof $!=="string")throw TypeError("prefix must be a string");return $.split(".").forEach((Z)=>{if(Z==="*"||Z===">")throw DF4.InvalidArgumentError.format("prefix",`cannot have wildcards ('${$}')`)}),`${$}.${OF4.nuid.next()}`}eQ$.DEFAULT_PORT=4222;eQ$.DEFAULT_HOST="127.0.0.1"});var Nr=b((XX$)=>{Object.defineProperty(XX$,"__esModule",{value:!0});XX$.DataBuffer=void 0;var ZX$=yG();class QX${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 ZX$.TE.encode($)}static toAscii($){return ZX$.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}}XX$.DataBuffer=QX$});var TT=b((GX$)=>{Object.defineProperty(GX$,"__esModule",{value:!0});GX$.LF=GX$.CR=GX$.CRLF=GX$.CR_LF_LEN=GX$.CR_LF=void 0;GX$.setTransportFactory=MF4;GX$.defaultPort=IF4;GX$.getUrlParseFn=VF4;GX$.newTransport=kF4;GX$.getResolveFn=SF4;GX$.protoLen=JX$;GX$.extractProtocolMessage=CF4;var AF4=yG(),RF4=Hw(),qF4=Nr(),hG;function MF4($){hG=$}function IF4(){return hG!==void 0&&hG.defaultPort!==void 0?hG.defaultPort:RF4.DEFAULT_PORT}function VF4(){return hG!==void 0&&hG.urlParseFn?hG.urlParseFn:void 0}function kF4(){if(!hG||typeof hG.factory!=="function")throw Error("transport fn is not set");return hG.factory()}function SF4(){return hG!==void 0&&hG.dnsResolveFn?hG.dnsResolveFn:void 0}GX$.CR_LF=`\r
2109
2109
  `;GX$.CR_LF_LEN=GX$.CR_LF.length;GX$.CRLF=qF4.DataBuffer.fromAscii(GX$.CR_LF);GX$.CR=new Uint8Array(GX$.CRLF)[0];GX$.LF=new Uint8Array(GX$.CRLF)[1];function JX$($){for(let Z=0;Z<$.length;Z++){let Q=Z+1;if($.byteLength>Q&&$[Z]===GX$.CR&&$[Q]===GX$.LF)return Q+1}return 0}function CF4($){let Z=JX$($);if(Z>0){let X=new Uint8Array($).slice(0,Z);return AF4.TD.decode(X)}return""}});var Y$1=b((LX$)=>{Object.defineProperty(LX$,"__esModule",{value:!0});LX$.ipV4=UX$;LX$.isIP=cF4;LX$.parseIP=NX$;var Br=4,AT=16,x30=48,FX$=57,WX$=65,uF4=70,HX$=97,lF4=102,X$1=16777215;function UX$($,Z,Q,X){let Y=new Uint8Array(AT);return[0,0,0,0,0,0,0,0,0,0,255,255].forEach((G,K)=>{Y[K]=G}),Y[12]=$,Y[13]=Z,Y[14]=Q,Y[15]=X,Y}function cF4($){return NX$($)!==void 0}function NX$($){for(let Z=0;Z<$.length;Z++)switch($[Z]){case".":return BX$($);case":":return mF4($)}return}function BX$($){let Z=new Uint8Array(Br);for(let Q=0;Q<Br;Q++){if($.length===0)return;if(Q>0){if($[0]!==".")return;$=$.substring(1)}let{n:X,c:Y,ok:J}=dF4($);if(!J||X>255)return;$=$.substring(Y),Z[Q]=X}return UX$(Z[0],Z[1],Z[2],Z[3])}function mF4($){let Z=new Uint8Array(AT),Q=-1;if($.length>=2&&$[0]===":"&&$[1]===":"){if(Q=0,$=$.substring(2),$.length===0)return Z}let X=0;while(X<AT){let{n:Y,c:J,ok:G}=iF4($);if(!G||Y>65535)return;if(J<$.length&&$[J]==="."){if(Q<0&&X!=AT-Br)return;if(X+Br>AT)return;let K=BX$($);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+=Br;break}if(Z[X]=Y>>8,Z[X+1]=Y,X+=2,$=$.substring(J),$.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<AT){if(Q<0)return;let Y=AT-X;for(let J=X-1;J>=Q;J--)Z[J+Y]=Z[J];for(let J=Q+Y-1;J>=Q;J--)Z[J]=0}else if(Q>=0)return;return Z}function dF4($){let Z=0,Q=0;for(Z=0;Z<$.length&&x30<=$.charCodeAt(Z)&&$.charCodeAt(Z)<=FX$;Z++)if(Q=Q*10+($.charCodeAt(Z)-x30),Q>=X$1)return{n:X$1,c:Z,ok:!1};if(Z===0)return{n:0,c:0,ok:!1};return{n:Q,c:Z,ok:!0}}function iF4($){let Z=0,Q=0;for(Q=0;Q<$.length;Q++){if(x30<=$.charCodeAt(Q)&&$.charCodeAt(Q)<=FX$)Z*=16,Z+=$.charCodeAt(Q)-x30;else if(HX$<=$.charCodeAt(Q)&&$.charCodeAt(Q)<=lF4)Z*=16,Z+=$.charCodeAt(Q)-HX$+10;else if(WX$<=$.charCodeAt(Q)&&$.charCodeAt(Q)<=uF4)Z*=16,Z+=$.charCodeAt(Q)-WX$+10;else break;if(Z>=X$1)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 F$1=b((DX$)=>{Object.defineProperty(DX$,"__esModule",{value:!0});DX$.Servers=DX$.ServerImpl=void 0;DX$.isIPV4OrHostname=OX$;DX$.hostPort=H$1;var J$1=TT(),G$1=oW(),K$1=Y$1(),oF4=Hw(),aF4=gG();function OX$($){if($.indexOf("[")!==-1||$.indexOf("::")!==-1)return!1;if($.indexOf(".")!==-1)return!0;if($.split(":").length<=2)return!0;return!1}function W$1($){return!OX$($)}function rF4($){let Q=$.toUpperCase().indexOf("::FFFF:");if(Q!==-1&&$.indexOf(".")!==-1){let X=$.substring(Q+7);return X=X.replace("[",""),X.replace("]","")}return $}function H$1($){if($=$.trim(),$.match(/^(.*:\/\/)(.*)/m))$=$.replace(/^(.*:\/\/)(.*)/gm,"$2");if($=rF4($),W$1($)&&$.indexOf("[")===-1)$=`[${$}]`;let Z=W$1($)?$.match(/(]:)(\d+)/):$.match(/(:)(\d+)/),Q=Z&&Z.length===3&&Z[1]&&Z[2]?parseInt(Z[2]):oF4.DEFAULT_PORT,Y=new URL(`${Q===80?"https":"http"}://${$}`);Y.port=`${Q}`;let J=Y.hostname;if(J.charAt(0)==="[")J=J.substring(1,J.length-1);return{listen:Y.host,hostname:J,port:Q}}class Sl{src;listen;hostname;port;didConnect;reconnects;lastConnect;gossiped;tlsName;resolves;constructor($,Z=!1){this.src=$,this.tlsName="";let Q=H$1($);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,K$1.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",J=new URL(`${Y}://${W$1(X)?"["+X+"]":X}`);J.port=`${this.port}`;let G=new Sl(J.host,!1);G.tlsName=this.hostname,Z.push(G)}}if($.randomize)(0,G$1.shuffle)(Z);return this.resolves=Z,Z}}DX$.ServerImpl=Sl;class f30{firstSelect;servers;currentServer;tlsName;randomize;constructor($={}){this.firstSelect=!0,this.servers=[],this.tlsName="",this.randomize=$.randomize||!1}setServers($){if(!Array.isArray($)||$.length===0)throw aF4.InvalidArgumentError.format("servers","cannot be empty");let Z=(0,J$1.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:J}=H$1(Y),G=Q.get(J);if(G)G.gossiped=!1,X.push(G);else X.push(new Sl(Y))}if(this.randomize)(0,G$1.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,K$1.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,J$1.getUrlParseFn)();$=Q?Q($):$;let X=new Sl($,Z);if((0,K$1.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 f30.freezeAll(this.servers)}snapshotForHandler(){let $=this.currentServer;if(!$)return this.snapshot();let Z=this.servers.indexOf($);if(Z<=0)return this.snapshot();return f30.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,J$1.getUrlParseFn)(),J=new Map;if($.connect_urls&&$.connect_urls.length>0)$.connect_urls.forEach((K)=>{K=Y?Y(K,Z):K;let W=new Sl(K,!0);J.set(K,W)});let G=[];if(this.servers.forEach((K,W)=>{let H=K.listen;if(K.gossiped&&this.currentServer.listen!==H&&J.get(H)===void 0)G.push(W);J.delete(H)}),G.reverse(),G.forEach((K)=>{let W=this.servers.splice(K,1);X=X.concat(W[0].listen)}),J.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,G$1.shuffle)(W),this.servers=K?[K,...W]:W}return{added:Q,deleted:X}}}DX$.Servers=f30});var b30=b((zX$)=>{Object.defineProperty(zX$,"__esModule",{value:!0});zX$.QueuedIteratorImpl=void 0;var U$1=oW(),jX$=gG();class EX${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,U$1.deferred)(),this.yields=[],this.iterClosed=(0,U$1.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 jX$.InvalidOperationError("iterator cannot be used when a callback is registered");if(this.yielding)throw new jX$.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,U$1.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}}zX$.QueuedIteratorImpl=EX$});var N$1=b((RX$)=>{Object.defineProperty(RX$,"__esModule",{value:!0});RX$.MuxSubscription=void 0;var ZU4=Hw(),TX$=gG();class AX${baseInbox;reqs;constructor(){this.reqs=new Map}size(){return this.reqs.size}init($){return this.baseInbox=`${(0,ZU4.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 TX$.NoRespondersError(X.requestSubject):null;X.resolver($,Z)}}}}close(){let $=new TX$.RequestError("connection closed");this.reqs.forEach((Z)=>{Z.resolver($,{})})}}RX$.MuxSubscription=AX$});var B$1=b((IX$)=>{Object.defineProperty(IX$,"__esModule",{value:!0});IX$.Heartbeat=void 0;var QU4=oW();class MX${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,QU4.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})}}IX$.Heartbeat=MX$});var D$1=b((_X$)=>{Object.defineProperty(_X$,"__esModule",{value:!0});_X$.DenoBuffer=_X$.MAX_SIZE=_X$.AssertionError=void 0;_X$.assert=SX$;_X$.concat=CX$;_X$.append=YU4;_X$.readAll=JU4;_X$.writeAll=GU4;var XU4=yG();class L$1 extends Error{constructor($){super($);this.name="AssertionError"}}_X$.AssertionError=L$1;function SX$($,Z="Assertion failed."){if(!$)throw new L$1(Z)}var kX$=32768;_X$.MAX_SIZE=4294967294;function y30($,Z,Q=0){let X=Z.byteLength-Q;if($.byteLength>X)$=$.subarray(0,X);return Z.set($,Q),$.byteLength}function CX$($,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 YU4($,Z){return CX$($,Uint8Array.of(Z))}class O$1{_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($){SX$($<=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=y30(this._buf.subarray(this._off),$);return this._off+=Z,Z}writeByte($){return this.write(Uint8Array.of($))}writeString($){return this.write(XU4.TE.encode($))}write($){let Z=this._grow($.byteLength);return y30($,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)y30(this._buf.subarray(this._off),this._buf);else if(X+$>_X$.MAX_SIZE)throw Error("The buffer cannot be grown beyond the maximum size.");else{let Y=new Uint8Array(Math.min(2*X+$,_X$.MAX_SIZE));y30(this._buf.subarray(this._off),Y),this._buf=Y}return this._off=0,this._reslice(Math.min(Z+$,_X$.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(kX$);while(!0){let X=this.capacity-this.length<kX$,Y=X?Q:new Uint8Array(this._buf.buffer,this.length),J=$.read(Y);if(J===null)return Z;if(X)this.write(Y.subarray(0,J));else this._reslice(this.length+J);Z+=J}}}_X$.DenoBuffer=O$1;function JU4($){let Z=new O$1;return Z.readFrom($),Z.bytes()}function GU4($,Z){let Q=0;while(Q<Z.length)Q+=$.write(Z.subarray(Q))}});var E$1=b((yX$)=>{Object.defineProperty(yX$,"__esModule",{value:!0});yX$.cc=yX$.State=yX$.Parser=yX$.Kind=void 0;yX$.describe=BU4;var w$1=D$1(),j$1=yG();yX$.Kind={OK:0,ERR:1,MSG:2,INFO:3,PING:4,PONG:5};function BU4($){let Z,Q="";switch($.kind){case yX$.Kind.MSG:Z="MSG";break;case yX$.Kind.OK:Z="OK";break;case yX$.Kind.ERR:Z="ERR",Q=j$1.TD.decode($.data);break;case yX$.Kind.PING:Z="PING";break;case yX$.Kind.PONG:Z="PONG";break;case yX$.Kind.INFO:Z="INFO",Q=j$1.TD.decode($.data)}return`${Z}: ${Q}`}function xX$(){let $={};return $.sid=-1,$.hdr=-1,$.size=-1,$}var fX$=48,LU4=57,Cl=67108864;class bX${dispatcher;state;as;drop;hdr;ma;argBuf;msgBuf;constructor($){this.dispatcher=$,this.state=yX$.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 yX$.State.OP_START:switch(Q){case yX$.cc.M:case yX$.cc.m:this.state=yX$.State.OP_M,this.hdr=-1,this.ma=xX$();break;case yX$.cc.H:case yX$.cc.h:this.state=yX$.State.OP_H,this.hdr=0,this.ma=xX$();break;case yX$.cc.P:case yX$.cc.p:this.state=yX$.State.OP_P;break;case yX$.cc.PLUS:this.state=yX$.State.OP_PLUS;break;case yX$.cc.MINUS:this.state=yX$.State.OP_MINUS;break;case yX$.cc.I:case yX$.cc.i:this.state=yX$.State.OP_I;break;default:throw this.fail($.subarray(Z))}break;case yX$.State.OP_H:switch(Q){case yX$.cc.M:case yX$.cc.m:this.state=yX$.State.OP_M;break;default:throw this.fail($.subarray(Z))}break;case yX$.State.OP_M:switch(Q){case yX$.cc.S:case yX$.cc.s:this.state=yX$.State.OP_MS;break;default:throw this.fail($.subarray(Z))}break;case yX$.State.OP_MS:switch(Q){case yX$.cc.G:case yX$.cc.g:this.state=yX$.State.OP_MSG;break;default:throw this.fail($.subarray(Z))}break;case yX$.State.OP_MSG:switch(Q){case yX$.cc.SPACE:case yX$.cc.TAB:this.state=yX$.State.OP_MSG_SPC;break;default:throw this.fail($.subarray(Z))}break;case yX$.State.OP_MSG_SPC:switch(Q){case yX$.cc.SPACE:case yX$.cc.TAB:continue;default:this.state=yX$.State.MSG_ARG,this.as=Z}break;case yX$.State.MSG_ARG:switch(Q){case yX$.cc.CR:this.drop=1;break;case yX$.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=yX$.State.MSG_PAYLOAD,Z=this.as+this.ma.size-1;break}default:if(this.argBuf)this.argBuf.writeByte(Q)}break;case yX$.State.MSG_PAYLOAD:if(this.msgBuf)if(this.msgBuf.length>=this.ma.size){let X=this.msgBuf.bytes({copy:!1});this.dispatcher.push({kind:yX$.Kind.MSG,msg:this.ma,data:X}),this.argBuf=void 0,this.msgBuf=void 0,this.state=yX$.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:yX$.Kind.MSG,msg:this.ma,data:$.subarray(this.as,Z)}),this.argBuf=void 0,this.msgBuf=void 0,this.state=yX$.State.MSG_END;break;case yX$.State.MSG_END:switch(Q){case yX$.cc.NL:this.drop=0,this.as=Z+1,this.state=yX$.State.OP_START;break;default:continue}break;case yX$.State.OP_PLUS:switch(Q){case yX$.cc.O:case yX$.cc.o:this.state=yX$.State.OP_PLUS_O;break;default:throw this.fail($.subarray(Z))}break;case yX$.State.OP_PLUS_O:switch(Q){case yX$.cc.K:case yX$.cc.k:this.state=yX$.State.OP_PLUS_OK;break;default:throw this.fail($.subarray(Z))}break;case yX$.State.OP_PLUS_OK:switch(Q){case yX$.cc.NL:this.dispatcher.push({kind:yX$.Kind.OK}),this.drop=0,this.state=yX$.State.OP_START;break}break;case yX$.State.OP_MINUS:switch(Q){case yX$.cc.E:case yX$.cc.e:this.state=yX$.State.OP_MINUS_E;break;default:throw this.fail($.subarray(Z))}break;case yX$.State.OP_MINUS_E:switch(Q){case yX$.cc.R:case yX$.cc.r:this.state=yX$.State.OP_MINUS_ER;break;default:throw this.fail($.subarray(Z))}break;case yX$.State.OP_MINUS_ER:switch(Q){case yX$.cc.R:case yX$.cc.r:this.state=yX$.State.OP_MINUS_ERR;break;default:throw this.fail($.subarray(Z))}break;case yX$.State.OP_MINUS_ERR:switch(Q){case yX$.cc.SPACE:case yX$.cc.TAB:this.state=yX$.State.OP_MINUS_ERR_SPC;break;default:throw this.fail($.subarray(Z))}break;case yX$.State.OP_MINUS_ERR_SPC:switch(Q){case yX$.cc.SPACE:case yX$.cc.TAB:continue;default:this.state=yX$.State.MINUS_ERR_ARG,this.as=Z}break;case yX$.State.MINUS_ERR_ARG:switch(Q){case yX$.cc.CR:this.drop=1;break;case yX$.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:yX$.Kind.ERR,data:X}),this.drop=0,this.as=Z+1,this.state=yX$.State.OP_START;break}default:if(this.argBuf)this.argBuf.write(Uint8Array.of(Q))}break;case yX$.State.OP_P:switch(Q){case yX$.cc.I:case yX$.cc.i:this.state=yX$.State.OP_PI;break;case yX$.cc.O:case yX$.cc.o:this.state=yX$.State.OP_PO;break;default:throw this.fail($.subarray(Z))}break;case yX$.State.OP_PO:switch(Q){case yX$.cc.N:case yX$.cc.n:this.state=yX$.State.OP_PON;break;default:throw this.fail($.subarray(Z))}break;case yX$.State.OP_PON:switch(Q){case yX$.cc.G:case yX$.cc.g:this.state=yX$.State.OP_PONG;break;default:throw this.fail($.subarray(Z))}break;case yX$.State.OP_PONG:switch(Q){case yX$.cc.NL:this.dispatcher.push({kind:yX$.Kind.PONG}),this.drop=0,this.state=yX$.State.OP_START;break}break;case yX$.State.OP_PI:switch(Q){case yX$.cc.N:case yX$.cc.n:this.state=yX$.State.OP_PIN;break;default:throw this.fail($.subarray(Z))}break;case yX$.State.OP_PIN:switch(Q){case yX$.cc.G:case yX$.cc.g:this.state=yX$.State.OP_PING;break;default:throw this.fail($.subarray(Z))}break;case yX$.State.OP_PING:switch(Q){case yX$.cc.NL:this.dispatcher.push({kind:yX$.Kind.PING}),this.drop=0,this.state=yX$.State.OP_START;break}break;case yX$.State.OP_I:switch(Q){case yX$.cc.N:case yX$.cc.n:this.state=yX$.State.OP_IN;break;default:throw this.fail($.subarray(Z))}break;case yX$.State.OP_IN:switch(Q){case yX$.cc.F:case yX$.cc.f:this.state=yX$.State.OP_INF;break;default:throw this.fail($.subarray(Z))}break;case yX$.State.OP_INF:switch(Q){case yX$.cc.O:case yX$.cc.o:this.state=yX$.State.OP_INFO;break;default:throw this.fail($.subarray(Z))}break;case yX$.State.OP_INFO:switch(Q){case yX$.cc.SPACE:case yX$.cc.TAB:this.state=yX$.State.OP_INFO_SPC;break;default:throw this.fail($.subarray(Z))}break;case yX$.State.OP_INFO_SPC:switch(Q){case yX$.cc.SPACE:case yX$.cc.TAB:continue;default:this.state=yX$.State.INFO_ARG,this.as=Z}break;case yX$.State.INFO_ARG:switch(Q){case yX$.cc.CR:this.drop=1;break;case yX$.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:yX$.Kind.INFO,data:X}),this.drop=0,this.as=Z+1,this.state=yX$.State.OP_START;break}default:if(this.argBuf)this.argBuf.writeByte(Q)}break;default:throw this.fail($.subarray(Z))}}if((this.state===yX$.State.MSG_ARG||this.state===yX$.State.MINUS_ERR_ARG||this.state===yX$.State.INFO_ARG)&&!this.argBuf)this.argBuf=new w$1.DenoBuffer($.subarray(this.as,Z-this.drop));if(this.state===yX$.State.MSG_PAYLOAD&&!this.msgBuf){if(!this.argBuf)this.cloneMsgArg();this.msgBuf=new w$1.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 w$1.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 yX$.cc.SPACE:case yX$.cc.TAB:case yX$.cc.CR:case yX$.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],Cl);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],Cl);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}: ${j$1.TD.decode($)}`)}processHeaderMsgArgs($){let Z=[],Q=-1;for(let X=0;X<$.length;X++)switch($[X]){case yX$.cc.SPACE:case yX$.cc.TAB:case yX$.cc.CR:case yX$.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],Cl),this.ma.size=this.protoParseInt(Z[3],Cl);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],Cl),this.ma.size=this.protoParseInt(Z[4],Cl);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]<fX$||$[X]>LU4)return-1;Q=Q*10+($[X]-fX$)}return Z!==void 0&&Q>Z?-1:Q}}yX$.Parser=bX$;yX$.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};yX$.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 u30=b((hX$)=>{Object.defineProperty(hX$,"__esModule",{value:!0});hX$.MsgHdrsImpl=void 0;hX$.canonicalMIMEHeaderKey=P$1;hX$.headers=wU4;var gX$=yG(),aW=Hw(),h30=gG();function P$1($){let F=!0,U=Array($.length);for(let N=0;N<$.length;N++){let B=$.charCodeAt(N);if(B===58||B<33||B>126)throw h30.InvalidArgumentError.format("header",`'${$[N]}' 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;U[N]=B,F=B==45}return String.fromCharCode(...U)}function wU4($=0,Z=""){if($===0&&Z!=="")throw h30.InvalidArgumentError.format("code","is required");else if($>0&&Z==="")throw h30.InvalidArgumentError.format("description","is required");return new _l($,Z)}var z$1="NATS/1.0";class _l{_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(),J=[...X].sort();for(let G=0;G<Y.length;G++)if(Y[G]!==J[G])return!1}return!0}return!1}static decode($){let Z=new _l,X=gX$.TD.decode($).split(`\r
2110
2110
  `),Y=X[0];if(Y!==z$1){let J=Y.replace(z$1,"").trim();if(J.length>0){if(Z._code=parseInt(J,10),isNaN(Z._code))Z._code=0;let G=Z._code.toString();J=J.replace(G,""),Z._description=J.trim()}}if(X.length>=1)X.slice(1).map((J)=>{if(J){let G=J.indexOf(":");if(G>-1){let K=J.slice(0,G),W=J.slice(G+1).trim();Z.append(K,W)}}});return Z}toString(){if(this.headers.size===0&&this._code===0)return"";let $=z$1;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
2111
2111
  ${Z}: ${Q[X]}`;return`${$}\r