decocms 4.388.4 → 4.389.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 (373) hide show
  1. package/dist/client/assets/{AlertCircle-Cat-Fy2i.js → AlertCircle-CVkVxygv.js} +1 -1
  2. package/dist/client/assets/{AreaChart-CSNer7sZ.js → AreaChart-lVePxdbV.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-DuxVUo5_.js → ArrowLeft-CN6aZBvX.js} +1 -1
  4. package/dist/client/assets/{ArrowRight-CsoDgnUj.js → ArrowRight-FqJnNh3f.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-CbPBDOpZ.js → ArrowUp-bOLRJZuX.js} +1 -1
  6. package/dist/client/assets/{CartesianChart-DgQehil3.js → CartesianChart-C3Zko_Et.js} +1 -1
  7. package/dist/client/assets/{Check-BZXRTDaX.js → Check-DL_AGZMy.js} +1 -1
  8. package/dist/client/assets/{CheckCircle-Cj4PQGuv.js → CheckCircle-DtMp-qqq.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-DGt31MPD.js → ChevronUp-B6mY-MC1.js} +1 -1
  10. package/dist/client/assets/{Copy01-B6hr4CBg.js → Copy01-6lOOhJcp.js} +1 -1
  11. package/dist/client/assets/{CreditCard01-CiYLi_pR.js → CreditCard01-DdYfDHIS.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-BITRq5d-.js → DotsVertical-CAjUqtRp.js} +1 -1
  13. package/dist/client/assets/{Download01-CsYfHghd.js → Download01-Dq8Pn8XY.js} +1 -1
  14. package/dist/client/assets/{ErrorBarContext-zVAOL4kJ.js → ErrorBarContext-B26KvZ3G.js} +1 -1
  15. package/dist/client/assets/{Eye-rQUtSbk6.js → Eye-B5e-ilzV.js} +1 -1
  16. package/dist/client/assets/{Globe04-C_9DD9oO.js → Globe04-_nV993le.js} +1 -1
  17. package/dist/client/assets/{Image01-BLIf6uY9.js → Image01-CkJtDP-I.js} +1 -1
  18. package/dist/client/assets/{Key01-SGIR_QrT.js → Key01-BCuGindq.js} +1 -1
  19. package/dist/client/assets/{LayoutLeft-GBQ0rQxQ.js → LayoutLeft-U0F-Da_p.js} +1 -1
  20. package/dist/client/assets/{Line-y7nkMb-C.js → Line-BA6i0Sln.js} +1 -1
  21. package/dist/client/assets/{Link01-BnVQGp2l.js → Link01-BjTxU_bP.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-Dh0AABP8.js → LinkExternal01-DSUCZUJp.js} +1 -1
  23. package/dist/client/assets/{Monitor01-CxisI5ut.js → Monitor01-r707obGd.js} +1 -1
  24. package/dist/client/assets/{Package-DsU1cU6S.js → Package-D2jMN__x.js} +1 -1
  25. package/dist/client/assets/{Palette-CzoNEzRs.js → Palette-DebiHmrq.js} +1 -1
  26. package/dist/client/assets/{Plus-qASEo4cN.js → Plus-BbELO07z.js} +1 -1
  27. package/dist/client/assets/{SearchLg-qmi8uaeX.js → SearchLg-C9MObDBB.js} +1 -1
  28. package/dist/client/assets/{SearchMd-B6NDUgzQ.js → SearchMd-B1Foybfh.js} +1 -1
  29. package/dist/client/assets/{Sector-DK9KwpRN.js → Sector-OiAocllE.js} +1 -1
  30. package/dist/client/assets/{Share07-CMPYQYHk.js → Share07-B2WnpDWD.js} +1 -1
  31. package/dist/client/assets/{Stars01-cdnol_cb.js → Stars01-DUL2jKUJ.js} +1 -1
  32. package/dist/client/assets/{Sun-BSFyLDhg.js → Sun-BKxdX8hu.js} +1 -1
  33. package/dist/client/assets/{Tool01-H9OcfGdq.js → Tool01-BvNT4KDI.js} +1 -1
  34. package/dist/client/assets/{Trash01-mB4s-hrv.js → Trash01-BLoRPhD3.js} +1 -1
  35. package/dist/client/assets/{Upload01-Uv_jtHIk.js → Upload01-CNb1qfRO.js} +1 -1
  36. package/dist/client/assets/{User01-DHGCVvV3.js → User01-U5CIC-GP.js} +1 -1
  37. package/dist/client/assets/{UserSquare-BfT6tB5U.js → UserSquare-CZakdYWe.js} +1 -1
  38. package/dist/client/assets/{Users01-C_qUmfZB.js → Users01-C6BprSkC.js} +1 -1
  39. package/dist/client/assets/{X-vKTIsgL1.js → X-BNszojyh.js} +1 -1
  40. package/dist/client/assets/{XCircle-Cu2Sy8Aw.js → XCircle-BuDwhQqF.js} +1 -1
  41. package/dist/client/assets/{XClose-DFUqDOc8.js → XClose-D_JLFZFT.js} +1 -1
  42. package/dist/client/assets/{Zap-CSRFlEXK.js → Zap-BCwjglMw.js} +1 -1
  43. package/dist/client/assets/{ZoomOut-Burao8Eg.js → ZoomOut-q6Y0RhlM.js} +1 -1
  44. package/dist/client/assets/{access-gate-Bbnx_Qh-.js → access-gate-Clo8Jex8.js} +1 -1
  45. package/dist/client/assets/{add-connection-dialog-DzNaYAxM.js → add-connection-dialog-C5SXdxkT.js} +1 -1
  46. package/dist/client/assets/{agent-analytics-C0sV-7Xb.js → agent-analytics-es8O9CL0.js} +2 -2
  47. package/dist/client/assets/agent-app-CGYFJjq5.js +1 -0
  48. package/dist/client/assets/{agent-assets-OnbttXnX.js → agent-assets-Dy169ySy.js} +1 -1
  49. package/dist/client/assets/{agent-automation-BSmqRx9Q.js → agent-automation-D1R1huVt.js} +6 -6
  50. package/dist/client/assets/{agent-automations-D7yiwZb3.js → agent-automations-BVBbNAeW.js} +1 -1
  51. package/dist/client/assets/{agent-connect-sources-CTElBaoM.js → agent-connect-sources-BYoUrpVF.js} +1 -1
  52. package/dist/client/assets/agent-deck-sqReTFoM.js +1 -0
  53. package/dist/client/assets/{agent-e2e-36-yunOr.js → agent-e2e-DxRXY84q.js} +1 -1
  54. package/dist/client/assets/{agent-experiments-B5DGYFrd.js → agent-experiments-_dQ2BC_Q.js} +1 -1
  55. package/dist/client/assets/agent-file-CGmxIBgM.js +1 -0
  56. package/dist/client/assets/{agent-git-BYVAaPsW.js → agent-git-B2s_zuHj.js} +2 -2
  57. package/dist/client/assets/{agent-hosting-BbmS530x.js → agent-hosting-BGGSrQLd.js} +1 -1
  58. package/dist/client/assets/{agent-icon-CzsnrYjD.js → agent-icon-CSebdE0g.js} +1 -1
  59. package/dist/client/assets/agent-library-file-CK_Y2Pye.js +1 -0
  60. package/dist/client/assets/{agent-monitor-C27DYrEB.js → agent-monitor-Dd5ty7vm.js} +1 -1
  61. package/dist/client/assets/{agent-overview-DsQze4i5.js → agent-overview-Cm3ny-qk.js} +1 -1
  62. package/dist/client/assets/agent-settings-B-c4VHd9.js +1 -0
  63. package/dist/client/assets/{agent-site-editor-BNuBiz19.js → agent-site-editor-CDYe7KMp.js} +1 -1
  64. package/dist/client/assets/agent-site-editor-code-C2ptd6Is.js +2 -0
  65. package/dist/client/assets/agent-site-editor-content-B7A6sQQt.js +2 -0
  66. package/dist/client/assets/agent-site-editor-preview-sULLmso9.js +518 -0
  67. package/dist/client/assets/agent-view-C2yjGU43.js +1 -0
  68. package/dist/client/assets/{agent-view-guard-C4pdkmKc.js → agent-view-guard-a8AZfEO9.js} +1 -1
  69. package/dist/client/assets/{agents-list-B3F1REj8.js → agents-list-oZyF4Ii3.js} +1 -1
  70. package/dist/client/assets/{ai-providers-BYHAVCy5.js → ai-providers-BlScv4nl.js} +2 -2
  71. package/dist/client/assets/{alert-DsW1KUvt.js → alert-DsihHj7h.js} +1 -1
  72. package/dist/client/assets/{alert-dialog-Dg6YJ6PP.js → alert-dialog-DeRt3vSN.js} +1 -1
  73. package/dist/client/assets/{api-keys-DDd9VBHu.js → api-keys-C9NfUH35.js} +1 -1
  74. package/dist/client/assets/api-keys-D3tjigFv.js +1 -0
  75. package/dist/client/assets/app-editor-D_REDtDg.js +1 -0
  76. package/dist/client/assets/{asset-utils-DOWh4JzZ.js → asset-utils-BS06OXCA.js} +1 -1
  77. package/dist/client/assets/{auth-D3Q2r2cz.js → auth-B-OXMWGw.js} +1 -1
  78. package/dist/client/assets/{auth-catchall-M53zUwPP.js → auth-catchall-CLBv3q5z.js} +1 -1
  79. package/dist/client/assets/{auth-entry-CQhZUGUz.js → auth-entry-uRCGi0qy.js} +1 -1
  80. package/dist/client/assets/{auth-split-layout-Cp7zhn_p.js → auth-split-layout-C9jB6J1h.js} +1 -1
  81. package/dist/client/assets/{authenticate-and-persist-oauth-DG9xWGRs.js → authenticate-and-persist-oauth-B71_ZhsC.js} +1 -1
  82. package/dist/client/assets/{automation-list-row-DuetYP8A.js → automation-list-row-BX3OvbcZ.js} +1 -1
  83. package/dist/client/assets/{automation-runs-DrVjV_Uv.js → automation-runs-CUFGFLxs.js} +1 -1
  84. package/dist/client/assets/automations-DGcV2mJq.js +1 -0
  85. package/dist/client/assets/{autosend-C5knIVwo.js → autosend-pQ9pD2-2.js} +1 -1
  86. package/dist/client/assets/{avatar-CLf3yQhN.js → avatar-GIuLZx2C.js} +1 -1
  87. package/dist/client/assets/{badge-DuB4cqrw.js → badge-DS3KIYvS.js} +1 -1
  88. package/dist/client/assets/{block-document-DZ3zGn-U.js → block-document-WF9-dn_8.js} +3 -3
  89. package/dist/client/assets/blocks-preview-workspace-context-BlZqg5yu.js +1 -0
  90. package/dist/client/assets/{breadcrumb-SXbKtw7u.js → breadcrumb-D6xZIsj2.js} +1 -1
  91. package/dist/client/assets/{buckets-D7jxbA8X.js → buckets-CNixgGHU.js} +1 -1
  92. package/dist/client/assets/{build-improve-prompt-doc-DKo7W0US.js → build-improve-prompt-doc-DeGFReow.js} +1 -1
  93. package/dist/client/assets/{bulk-category-panel-CS9EslBN.js → bulk-category-panel-BS5_T4uL.js} +1 -1
  94. package/dist/client/assets/{calendar-D41RMBsP.js → calendar-D4hMMrVq.js} +1 -1
  95. package/dist/client/assets/{capability-load-error-CYpF4fm6.js → capability-load-error-BjI2iK0-.js} +1 -1
  96. package/dist/client/assets/category-editor-BFX9U9Yh.js +1 -0
  97. package/dist/client/assets/{chart-CdmZzz30.js → chart-CdPsiu6K.js} +1 -1
  98. package/dist/client/assets/{chat-context-D1GbDSrr.js → chat-context-HOmU0YHH.js} +6 -6
  99. package/dist/client/assets/{chat-draft-VYqGGS3B.js → chat-draft-BdxqYU8-.js} +1 -1
  100. package/dist/client/assets/{checkbox-BKGUJJNh.js → checkbox-DBYfq56y.js} +1 -1
  101. package/dist/client/assets/{choose-editor-Dkb9gjmg.js → choose-editor-DSxVv7hu.js} +1 -1
  102. package/dist/client/assets/{claim-phase-copy-0btUuJoC.js → claim-phase-copy-njXeDF0h.js} +1 -1
  103. package/dist/client/assets/{cli-auth-success-BFRzX7yY.js → cli-auth-success-uK8yk1Sb.js} +1 -1
  104. package/dist/client/assets/{client-icons-CIit2qYG.js → client-icons-CaoDPAaa.js} +1 -1
  105. package/dist/client/assets/{collapsible-eiDLfZY7.js → collapsible-BpIxv8-d.js} +1 -1
  106. package/dist/client/assets/{collection-detail-D6aw3A-V.js → collection-detail-vK2X038F.js} +1 -1
  107. package/dist/client/assets/{collection-display-button-D9O76Rnp.js → collection-display-button-ChjN1roR.js} +1 -1
  108. package/dist/client/assets/{collection-search-BQXOJg8a.js → collection-search-DyuqjLWs.js} +1 -1
  109. package/dist/client/assets/{collection-table-wrapper-zKpdBBAO.js → collection-table-wrapper-CNNpAz5Y.js} +1 -1
  110. package/dist/client/assets/{collection-tabs-BWQrYrdS.js → collection-tabs-3_QvnkN-.js} +1 -1
  111. package/dist/client/assets/combobox-OP-CbRFf.js +1 -0
  112. package/dist/client/assets/command-ByUEKQB9.js +1 -0
  113. package/dist/client/assets/{companion-mcps-section-8c0rXQex.js → companion-mcps-section-6HKE7JJ2.js} +1 -1
  114. package/dist/client/assets/{connect-B9ZzFP7o.js → connect-CsNBKbv0.js} +2 -2
  115. package/dist/client/assets/{connect-layout-CSTvrhGM.js → connect-layout-DVtCwqcX.js} +1 -1
  116. package/dist/client/assets/{connection-DzM2SOZ6.js → connection-DR9gf0au.js} +1 -1
  117. package/dist/client/assets/{connection-card-DF11WhqU.js → connection-card-BOo8yulu.js} +1 -1
  118. package/dist/client/assets/{connection-detail-Dimacfl3.js → connection-detail-BqzECTqG.js} +1 -1
  119. package/dist/client/assets/{connection-form-helpers-CyBATU5Y.js → connection-form-helpers-D5P5OxyV.js} +1 -1
  120. package/dist/client/assets/{connections-C_1m4t4b.js → connections-DH9JM6iR.js} +1 -1
  121. package/dist/client/assets/{create-organization-dialog-Cy1fVEro.js → create-organization-dialog-S8LtKHhd.js} +1 -1
  122. package/dist/client/assets/{decofile-api-DkM3ZQFM.js → decofile-api-CWaaGMA2.js} +1 -1
  123. package/dist/client/assets/{decopilot-YckYKTsg.js → decopilot-B7-O9fZC.js} +2 -2
  124. package/dist/client/assets/{dialog-C36x61_J.js → dialog-BG6kEGFR.js} +1 -1
  125. package/dist/client/assets/{discover-CqgNMlsp.js → discover-OS0btTyd.js} +1 -1
  126. package/dist/client/assets/{domain-settings-D6TBWbch.js → domain-settings-BrbTzYfK.js} +1 -1
  127. package/dist/client/assets/{download-app-dialog-7J000m-o.js → download-app-dialog-NqW4PLAx.js} +1 -1
  128. package/dist/client/assets/{drawer-CsJzOKcM.js → drawer-Bl-PPIzX.js} +1 -1
  129. package/dist/client/assets/{editor-BQuCFEpz.js → editor-BiwQpn1s.js} +1 -1
  130. package/dist/client/assets/{empty-state-ClBiZqLf.js → empty-state-BpI78UAU.js} +1 -1
  131. package/dist/client/assets/{empty-state-gVTYQvW1.js → empty-state-DzReaOau.js} +1 -1
  132. package/dist/client/assets/{extract-connection-data-BIqslos8.js → extract-connection-data-BimwPioU.js} +1 -1
  133. package/dist/client/assets/{feature-gate-DLeaUXYN.js → feature-gate-B63BZEdG.js} +1 -1
  134. package/dist/client/assets/{feature-paywall-lhh7GOr7.js → feature-paywall-DwNmZ-M9.js} +1 -1
  135. package/dist/client/assets/{file-explorer-BRRFAgbe.js → file-explorer-DLzYcbz9.js} +1 -1
  136. package/dist/client/assets/{file-preview-DobzjEc2.js → file-preview-DCBxvWAy.js} +1 -1
  137. package/dist/client/assets/{file-share-button-6XYGV6w8.js → file-share-button-Cz0mgdAm.js} +1 -1
  138. package/dist/client/assets/{file-type-icon-CFRsMAQ4.js → file-type-icon-Cbv1Det1.js} +1 -1
  139. package/dist/client/assets/{folder-icon-CxyYiSJb.js → folder-icon-DltflRpD.js} +1 -1
  140. package/dist/client/assets/{form-CXSt7_li.js → form-Bx8qGby0.js} +1 -1
  141. package/dist/client/assets/{gateway-client-BF14HPqj.js → gateway-client-DiyAsoDf.js} +1 -1
  142. package/dist/client/assets/{general-0kms2_Mb.js → general-DTp5FT8F.js} +1 -1
  143. package/dist/client/assets/{github-icon-CIx0jkrL.js → github-icon-Bx6tzbBb.js} +1 -1
  144. package/dist/client/assets/{home-CyQJcQvg.js → home-tpS1TH6x.js} +1 -1
  145. package/dist/client/assets/{hooks-enzgIMXj.js → hooks-ZOtfl4oi.js} +2 -2
  146. package/dist/client/assets/{hooks-C8t7cMQJ.js → hooks-lZSCdRwc.js} +1 -1
  147. package/dist/client/assets/{icon-button-Df-IeDHT.js → icon-button-BudvJWM8.js} +1 -1
  148. package/dist/client/assets/{index-Ci3v6d1n.js → index-B7pMCohP.js} +1 -1
  149. package/dist/client/assets/index-B88q0man.css +1 -0
  150. package/dist/client/assets/{index-B7z_63F4.js → index-B8ZawsDP.js} +1 -1
  151. package/dist/client/assets/{index-DC9_5qIh.js → index-B9lZAmmH.js} +1 -1
  152. package/dist/client/assets/{index-DowxFM-Z.js → index-Bzch_Lwn.js} +1 -1
  153. package/dist/client/assets/{index-ClQyNrgO.js → index-C-u7JO1Y.js} +1 -1
  154. package/dist/client/assets/{index-Doi07Y6T.js → index-C0e8Nw2i.js} +1 -1
  155. package/dist/client/assets/{index-Byz-UaqT.js → index-CR8U3UFH.js} +1 -1
  156. package/dist/client/assets/{index-doEaURqC.js → index-CyBVTyGa.js} +7 -7
  157. package/dist/client/assets/{index-DV9UJZA2.js → index-CzuzrcF3.js} +1 -1
  158. package/dist/client/assets/{index-BoSUEB27.js → index-DeVdNW-7.js} +1 -1
  159. package/dist/client/assets/{index-CDAG9yf3.js → index-DmF8NlWI.js} +1 -1
  160. package/dist/client/assets/{index-BODjkOG4.js → index-DmsjOEhK.js} +1 -1
  161. package/dist/client/assets/{index-C4LzZ3-O.js → index-DtBnPwzh.js} +1 -1
  162. package/dist/client/assets/{index-D9padtMD.js → index-nJTy1ykh.js} +1 -1
  163. package/dist/client/assets/{index-redirect-XY4L95T5.js → index-redirect-lSGpveHC.js} +1 -1
  164. package/dist/client/assets/{infiniteQueryObserver-CxJm0T6_.js → infiniteQueryObserver-COZ-9XSO.js} +1 -1
  165. package/dist/client/assets/{infra-billing-zdKJ_MUK.js → infra-billing-ZSvY9y-Y.js} +1 -1
  166. package/dist/client/assets/input-D5Zi_pUc.js +1 -0
  167. package/dist/client/assets/{input-BT236l5B.js → input-DMG-B3VZ.js} +2 -2
  168. package/dist/client/assets/{input-CLIoB1hh.js → input-DOIUaBAK.js} +1 -1
  169. package/dist/client/assets/{integration-icon-Crk6WRxP.js → integration-icon-mTqkOE6y.js} +1 -1
  170. package/dist/client/assets/{label-tAsQMZ2G.js → label-DVhvlWqs.js} +1 -1
  171. package/dist/client/assets/{last-preview-page-002026Ee.js → last-preview-page-Cc9l6ICr.js} +1 -1
  172. package/dist/client/assets/{layout-CCpqo3zm.js → layout-0DaHUY7Z.js} +1 -1
  173. package/dist/client/assets/{legacy-agents-deep-Cj78AYzA.js → legacy-agents-deep-O9zXW4qh.js} +1 -1
  174. package/dist/client/assets/{legacy-main-redirect-Dn96iLn4.js → legacy-main-redirect-MeePJHje.js} +1 -1
  175. package/dist/client/assets/{library-BuoDGyY9.js → library-DHdWNZX-.js} +1 -1
  176. package/dist/client/assets/{login-DqL9YZRz.js → login-CXyISdG5.js} +1 -1
  177. package/dist/client/assets/{markdown-D0jNOMCX.js → markdown-DCPDulUN.js} +1 -1
  178. package/dist/client/assets/{mcp-app-renderer-BvLPqeD1.js → mcp-app-renderer-DBdofBbE.js} +2 -2
  179. package/dist/client/assets/{mcp-oauth-61IHYJoj.js → mcp-oauth-DdNMjTqu.js} +1 -1
  180. package/dist/client/assets/{members-BcXF5gIl.js → members-YBQ4CS4C.js} +1 -1
  181. package/dist/client/assets/{message-templates-CUQwBtaa.js → message-templates-B-vmK4Xp.js} +1 -1
  182. package/dist/client/assets/{mini-report-page-DbALNxiX.js → mini-report-page-DekMuoTa.js} +1 -1
  183. package/dist/client/assets/{mock-board-D9-PmaL9.js → mock-board-D9NUZPwb.js} +9 -9
  184. package/dist/client/assets/{monaco-editor-xB6SdWXy.js → monaco-editor-tpWF7AL5.js} +1 -1
  185. package/dist/client/assets/{monitoring-stats-row-CTbrFT2U.js → monitoring-stats-row-D_bvL4CA.js} +1 -1
  186. package/dist/client/assets/{multi-select-BPlBOZll.js → multi-select-C3lQgqH3.js} +1 -1
  187. package/dist/client/assets/{mustache-Btjjkmrx.js → mustache-BU3hKYND.js} +1 -1
  188. package/dist/client/assets/{oauth-callback-D8-Vh_4C.js → oauth-callback-BiuyznT3.js} +1 -1
  189. package/dist/client/assets/{oauth-callback-ai-provider-Dpai0ql-.js → oauth-callback-ai-provider-DqtXAIB8.js} +1 -1
  190. package/dist/client/assets/{onboarding-uOVvp-Mg.js → onboarding-BS368ORS.js} +1 -1
  191. package/dist/client/assets/{optimistic-project-sidebar-views-BQt56FI4.js → optimistic-project-sidebar-views-BfkTIuSj.js} +1 -1
  192. package/dist/client/assets/org-file-open-context-Bh_zBQ2O.js +1 -0
  193. package/dist/client/assets/{organization-choice-9DpczJ4c.js → organization-choice-GuO7qGDl.js} +1 -1
  194. package/dist/client/assets/{orgs-B6tWlX0C.js → orgs-DhHpNlvn.js} +1 -1
  195. package/dist/client/assets/page-seo-form-BML1eDhR.js +1 -0
  196. package/dist/client/assets/{pair-BIUMok9W.js → pair-CIltybgP.js} +1 -1
  197. package/dist/client/assets/{plan-ladder-DjuDG4EH.js → plan-ladder-BEYdYGx8.js} +1 -1
  198. package/dist/client/assets/{popover-GUR8piky.js → popover-CUdTfYte.js} +1 -1
  199. package/dist/client/assets/post-calendar-BVrfveN8.js +1 -0
  200. package/dist/client/assets/post-editor-LBOMfHyI.js +1 -0
  201. package/dist/client/assets/{preview-content-CkHbAlf-.js → preview-content-D7H_AlKU.js} +1 -1
  202. package/dist/client/assets/{preview-dialog-DUI33rZ8.js → preview-dialog-CUz95NoQ.js} +1 -1
  203. package/dist/client/assets/{primitives-CHkTFFF-.js → primitives-CyfO2GN8.js} +1 -1
  204. package/dist/client/assets/{profile-BIFbXoSW.js → profile-BNPVU14n.js} +1 -1
  205. package/dist/client/assets/{project-app-view-ZkgOByQo.js → project-app-view-Dm6c4g3t.js} +1 -1
  206. package/dist/client/assets/{project-feed-DGoAUO34.js → project-feed-orYCz9U3.js} +1 -1
  207. package/dist/client/assets/{project-icon-mjklzNJs.js → project-icon-DWnsLAeJ.js} +1 -1
  208. package/dist/client/assets/project-reports-DhaLYRaZ.js +1 -0
  209. package/dist/client/assets/project-tasks-Dzzzm0ET.js +1 -0
  210. package/dist/client/assets/{prompts-BwsVrHFI.js → prompts-Dpv9Ex1_.js} +1 -1
  211. package/dist/client/assets/record-editor-BQ-gbw4b.js +1 -0
  212. package/dist/client/assets/redirect-editor-eLzPdMVZ.js +1 -0
  213. package/dist/client/assets/reports-8U4sSr1z.js +1 -0
  214. package/dist/client/assets/{reports-ChF6GDQz.js → reports-CUfYm0DC.js} +1 -1
  215. package/dist/client/assets/{reports-onboarding-ukyewr1e.js → reports-onboarding-V3a9FHx8.js} +1 -1
  216. package/dist/client/assets/{reports-tab-Cxq1-mux.js → reports-tab-Bx7-g2HC.js} +2 -2
  217. package/dist/client/assets/{repositories-D7d8VzOE.js → repositories-Bbw6GL37.js} +1 -1
  218. package/dist/client/assets/{repository-import-picker-B6ijLkOL.js → repository-import-picker-74Y3ta69.js} +1 -1
  219. package/dist/client/assets/{repository-picker-Ca5oB9j5.js → repository-picker-dKTE5PS5.js} +1 -1
  220. package/dist/client/assets/{require-capability-vhXMBpff.js → require-capability-QoYjHav_.js} +1 -1
  221. package/dist/client/assets/{required-auth-layout-DbGCmQgx.js → required-auth-layout-BgLvQHTP.js} +1 -1
  222. package/dist/client/assets/{reset-password-DrRaSkr-.js → reset-password-ateNgI6E.js} +1 -1
  223. package/dist/client/assets/{resizable-WgWAPECX.js → resizable-D6HLmII4.js} +1 -1
  224. package/dist/client/assets/{review-settings-BzcjRJO0.js → review-settings-jZZT0JG1.js} +1 -1
  225. package/dist/client/assets/{rich-text-link-control-i_tw_Jd2.js → rich-text-link-control-0ZhNexVb.js} +2 -2
  226. package/dist/client/assets/{roles-DTbcvvsD.js → roles-ERYsouVf.js} +1 -1
  227. package/dist/client/assets/{route-BRh6VH3Q.js → route-D5DT7lzH.js} +1 -1
  228. package/dist/client/assets/{route-B8hLxHmX.js → route-DW_oVxtq.js} +1 -1
  229. package/dist/client/assets/{route-DsWfLZyf.js → route-HgZwHfFA.js} +1 -1
  230. package/dist/client/assets/{route-page-header-tbVW9ntg.js → route-page-header-BHdnDvfR.js} +1 -1
  231. package/dist/client/assets/runnable-block-editor-DrtKYS1k.js +17 -0
  232. package/dist/client/assets/{sandbox-lifecycle-context-CvyFr09R.js → sandbox-lifecycle-context-LNZL2c0K.js} +2 -2
  233. package/dist/client/assets/{schema-BVqtjcyJ.js → schema-DSsDEA1v.js} +1 -1
  234. package/dist/client/assets/{scroll-area-Cve7MqyA.js → scroll-area-CmvmQLS1.js} +1 -1
  235. package/dist/client/assets/{search-input-CCUlZDzf.js → search-input-0hd-PWUF.js} +1 -1
  236. package/dist/client/assets/{search-toggle-BtmGTpxl.js → search-toggle-Bp6o4xvm.js} +1 -1
  237. package/dist/client/assets/{secret-picker-DVWtSCXk.js → secret-picker--QwK1qR-.js} +1 -1
  238. package/dist/client/assets/{secrets-dQAYGJYM.js → secrets-ODT01eOm.js} +1 -1
  239. package/dist/client/assets/sections-editor-DwSDIcRs.js +1 -0
  240. package/dist/client/assets/select-CDhEibGy.js +1 -0
  241. package/dist/client/assets/{select-model-Bnz73VTx.js → select-model-Dd7JcBMF.js} +1 -1
  242. package/dist/client/assets/seo-editor-BMnaZ5KR.js +1 -0
  243. package/dist/client/assets/{separator-JATiwE_2.js → separator-D-_LXjFg.js} +1 -1
  244. package/dist/client/assets/{settings-tab-CE0tP2vq.js → settings-tab-CKxa2O9d.js} +4 -4
  245. package/dist/client/assets/{sheet-ZoEgH6s-.js → sheet-DH_REC9j.js} +1 -1
  246. package/dist/client/assets/shell-layout-B3x_9fo1.js +1 -0
  247. package/dist/client/assets/{sidebar-Cz1S2PSM.js → sidebar-CxoDmdm4.js} +1 -1
  248. package/dist/client/assets/{skill-preview-BP5xxsO4.js → skill-preview-D4GrMJU0.js} +1 -1
  249. package/dist/client/assets/{skills-D52kTkau.js → skills-BYtnT-vq.js} +1 -1
  250. package/dist/client/assets/{sso-DAgB-pSG.js → sso-C8v2EdhJ.js} +1 -1
  251. package/dist/client/assets/{switch-BNLiV_oA.js → switch-C7dIR4UF.js} +1 -1
  252. package/dist/client/assets/{synced-repos-BzaJ7fNm.js → synced-repos-BNAaKJnR.js} +1 -1
  253. package/dist/client/assets/{table-D7l9brRh.js → table-B9OXzOjU.js} +1 -1
  254. package/dist/client/assets/{tabs-Gq0qvZI4.js → tabs-D6s_HA-y.js} +1 -1
  255. package/dist/client/assets/{task-board-BXLBBo-B.js → task-board-Qj-6Ctqf.js} +1 -1
  256. package/dist/client/assets/{task-route-BpYPpL3v.js → task-route-9wqWimw6.js} +1 -1
  257. package/dist/client/assets/{task-status-C7fhyr8_.js → task-status-D5cWLC8O.js} +1 -1
  258. package/dist/client/assets/{taskboard-analytics-Bhbjv4p8.js → taskboard-analytics-BtiQkIih.js} +1 -1
  259. package/dist/client/assets/{tasks-C2avg53f.js → tasks-BF0fu0p2.js} +2 -2
  260. package/dist/client/assets/tasks-D4PEOEIP.js +1 -0
  261. package/dist/client/assets/textarea-TE2JJa-B.js +1 -0
  262. package/dist/client/assets/{thread-button-CzoAkKWi.js → thread-button-DUOTtsFE.js} +1 -1
  263. package/dist/client/assets/{thread-intent-DuCE7MYG.js → thread-intent-jq9HKW3p.js} +1 -1
  264. package/dist/client/assets/{thread-route-C5QqTXOt.js → thread-route-C47YRRAe.js} +1 -1
  265. package/dist/client/assets/{thread-route-BBKn0p1b.js → thread-route-JcpQ-ikA.js} +1 -1
  266. package/dist/client/assets/{thread-sheet-body-C52UGBXx.js → thread-sheet-body-DvAYJwTc.js} +1 -1
  267. package/dist/client/assets/{toggle-group-DHrftnUg.js → toggle-group-Dv_lnjT7.js} +1 -1
  268. package/dist/client/assets/{toolbar-icon-button-iy_uLVVB.js → toolbar-icon-button-Cq75cloK.js} +1 -1
  269. package/dist/client/assets/{tooltip-C91IS2ON.js → tooltip-BjUMPvkB.js} +1 -1
  270. package/dist/client/assets/{track-CpCOxAsM.js → track-CNE2_M0H.js} +1 -1
  271. package/dist/client/assets/{types-BCbJ4Eml.js → types-Bxr6Ak0g.js} +3 -3
  272. package/dist/client/assets/{usage-stats-P7Ebxq4V.js → usage-stats-Bug-9_EL.js} +1 -1
  273. package/dist/client/assets/{use-ai-providers-CJ2ga4nx.js → use-ai-providers-ShRDl02e.js} +1 -1
  274. package/dist/client/assets/{use-automations-V0dkF89H.js → use-automations-qnBbEhgN.js} +1 -1
  275. package/dist/client/assets/{use-autosave-ClFMVO3A.js → use-autosave-exq2JPmQ.js} +1 -1
  276. package/dist/client/assets/{use-connect-companion-CXK99yF4.js → use-connect-companion-DQoSkSuB.js} +1 -1
  277. package/dist/client/assets/{use-connection-PgTQPnAp.js → use-connection-WQuJ5yl_.js} +1 -1
  278. package/dist/client/assets/{use-copy-CGJ-16i-.js → use-copy-CPOYPvBF.js} +1 -1
  279. package/dist/client/assets/{use-create-virtual-mcp-D4lB4pbk.js → use-create-virtual-mcp-Da7cL0aL.js} +1 -1
  280. package/dist/client/assets/{use-date-fns-locale-VjB0j61V.js → use-date-fns-locale-BcOQz_O6.js} +1 -1
  281. package/dist/client/assets/{use-debounced-autosave-Du2G3qf3.js → use-debounced-autosave-BnbZSVdn.js} +1 -1
  282. package/dist/client/assets/{use-debounced-value-CG2jgHBI.js → use-debounced-value-DHN-wkc6.js} +1 -1
  283. package/dist/client/assets/{use-deco-credits-DU8sJrax.js → use-deco-credits-Fltfd2iB.js} +1 -1
  284. package/dist/client/assets/{use-decopilot-events-x0K7Zb7m.js → use-decopilot-events-DF_mJ7FX.js} +1 -1
  285. package/dist/client/assets/{use-delete-connection-Pe3fW9Dc.js → use-delete-connection-Di7K1zHS.js} +1 -1
  286. package/dist/client/assets/{use-deployment-admin-CWwZo7oV.js → use-deployment-admin-Ney-Hrk_.js} +1 -1
  287. package/dist/client/assets/{use-entitlements-pN-YIa6T.js → use-entitlements-D6f3xZaU.js} +1 -1
  288. package/dist/client/assets/{use-fast-preview-draft-url-CCQm80wV.js → use-fast-preview-draft-url-B6rIt3gA.js} +1 -1
  289. package/dist/client/assets/{use-file-configs-CzJCjBKX.js → use-file-configs-Cd7oj9Fw.js} +1 -1
  290. package/dist/client/assets/{use-in-settings-DplznXN9.js → use-in-settings-8fsBM1xN.js} +1 -1
  291. package/dist/client/assets/{use-infinite-scroll-Bm905rys.js → use-infinite-scroll-BCiTqxTQ.js} +1 -1
  292. package/dist/client/assets/{use-join-requests-D4wrlTl5.js → use-join-requests-BFN9i-Es.js} +1 -1
  293. package/dist/client/assets/use-main-panel-tabs-Wh3mzXf2.js +1 -0
  294. package/dist/client/assets/{use-mcp-auth-status-BnAPI8Zf.js → use-mcp-auth-status-B1aTfNe_.js} +1 -1
  295. package/dist/client/assets/{use-mcp-client-D2DgMGL-.js → use-mcp-client-CqKNXJW7.js} +1 -1
  296. package/dist/client/assets/{use-mcp-prompts-UNzUvECH.js → use-mcp-prompts-DpED8Vrg.js} +1 -1
  297. package/dist/client/assets/{use-mcp-tools-CtMvHJK9.js → use-mcp-tools-BgkfMsvS.js} +1 -1
  298. package/dist/client/assets/{use-members-C_tB-qI-.js → use-members-CeW4sAKm.js} +1 -1
  299. package/dist/client/assets/{use-mobile-DYpKQ1eP.js → use-mobile-CUQu4L8c.js} +1 -1
  300. package/dist/client/assets/{use-navigate-to-agent-TwlhlbmB.js → use-navigate-to-agent-W6hb3mqs.js} +1 -1
  301. package/dist/client/assets/{use-open-billing-url-BrlDdS6U.js → use-open-billing-url-KLMgEPxW.js} +1 -1
  302. package/dist/client/assets/{use-org-auth-client-BkVvw_9f.js → use-org-auth-client-zTkj17z7.js} +1 -1
  303. package/dist/client/assets/{use-org-fs-Bbl2QQqg.js → use-org-fs-B1IHOZ9S.js} +1 -1
  304. package/dist/client/assets/{use-org-repo-syncs-Ds4sFbSY.js → use-org-repo-syncs-CksqUgv6.js} +1 -1
  305. package/dist/client/assets/{use-org-sso-BnqcEd47.js → use-org-sso-CI1_4UQM.js} +1 -1
  306. package/dist/client/assets/{use-organization-roles-3K_wbMHo.js → use-organization-roles-DeV7SnLa.js} +1 -1
  307. package/dist/client/assets/{use-organization-settings-Wh36EN0I.js → use-organization-settings-4gJ9Tp49.js} +1 -1
  308. package/dist/client/assets/{use-panel-navigate-xYH0iX8e.js → use-panel-navigate-Bg-MVKv6.js} +1 -1
  309. package/dist/client/assets/{use-project-native-view-presence-U59DT0hQ.js → use-project-native-view-presence-C3jxCCXQ.js} +1 -1
  310. package/dist/client/assets/{use-project-scope-CENQvfVc.js → use-project-scope-CRdwBUT7.js} +1 -1
  311. package/dist/client/assets/{use-releases-_xbQ8yPk.js → use-releases-nsAtxjuW.js} +1 -1
  312. package/dist/client/assets/{use-reports-diagnostic-Cz_g9Pum.js → use-reports-diagnostic-CtuJZ5jH.js} +1 -1
  313. package/dist/client/assets/{use-route-default-main-evb2BAGs.js → use-route-default-main-DA5X9xDG.js} +1 -1
  314. package/dist/client/assets/{use-secrets-44zj-3N9.js → use-secrets-BfDHS5Uq.js} +1 -1
  315. package/dist/client/assets/use-section-preview-base-DW4RpMx9.js +1 -0
  316. package/dist/client/assets/{use-session-runtime-COugfsOm.js → use-session-runtime-DiG_Qt8i.js} +1 -1
  317. package/dist/client/assets/{use-tags-BqebMAjW.js → use-tags-BloUFB1L.js} +1 -1
  318. package/dist/client/assets/{use-task-board-analytics-CElip-Jh.js → use-task-board-analytics-C7hgblhm.js} +1 -1
  319. package/dist/client/assets/{use-task-metadata-Dhub_XGT.js → use-task-metadata-ehugU85S.js} +1 -1
  320. package/dist/client/assets/{use-thread-outputs-DldRsY9l.js → use-thread-outputs-C9_GjCjS.js} +1 -1
  321. package/dist/client/assets/{use-virtual-mcp-B-mdsJbn.js → use-virtual-mcp-Vg_Ogz61.js} +1 -1
  322. package/dist/client/assets/useInfiniteQuery-DebjMHv1.js +1 -0
  323. package/dist/client/assets/{useQueries-CrUxqve0.js → useQueries-CDvJYO-m.js} +1 -1
  324. package/dist/client/assets/useSuspenseInfiniteQuery-CqRV1dKR.js +1 -0
  325. package/dist/client/assets/{users-XpLTDG6s.js → users-BC2i5HSG.js} +1 -1
  326. package/dist/client/assets/{utils-BcFrUaDf.js → utils-Bf0RpmgB.js} +1 -1
  327. package/dist/client/assets/variant-calendar-BWeWEpfR.js +1 -0
  328. package/dist/client/assets/{variant-matcher-override-DWffsqol.js → variant-matcher-override-fLxntWss.js} +1 -1
  329. package/dist/client/assets/{view-mode-toggle-Bsk0Q0dk.js → view-mode-toggle-DQkw8yuh.js} +1 -1
  330. package/dist/client/assets/{virtual-mcp-Bj7Y16hO.js → virtual-mcp-S8IoUqby.js} +1 -1
  331. package/dist/client/index.html +2 -2
  332. package/dist/server/cli.js +1 -1
  333. package/dist/server/server.js +1 -1
  334. package/package.json +1 -1
  335. package/dist/client/assets/agent-app-D8aCkILQ.js +0 -1
  336. package/dist/client/assets/agent-deck-JfSkYOo0.js +0 -1
  337. package/dist/client/assets/agent-file-BQkNRXR6.js +0 -1
  338. package/dist/client/assets/agent-library-file-B_9ZfsqS.js +0 -1
  339. package/dist/client/assets/agent-settings-Dlb-w-aW.js +0 -1
  340. package/dist/client/assets/agent-site-editor-code-Cg74frt9.js +0 -2
  341. package/dist/client/assets/agent-site-editor-content-BMF_TO-O.js +0 -2
  342. package/dist/client/assets/agent-site-editor-preview-DfUEy_mW.js +0 -518
  343. package/dist/client/assets/agent-view-9ku1NYkG.js +0 -1
  344. package/dist/client/assets/api-keys-CB0BbOJK.js +0 -1
  345. package/dist/client/assets/app-editor-6ntO4YLY.js +0 -1
  346. package/dist/client/assets/automations-CflFKE1S.js +0 -1
  347. package/dist/client/assets/blocks-preview-workspace-context-CGrONP0s.js +0 -1
  348. package/dist/client/assets/category-editor-CMewSARd.js +0 -1
  349. package/dist/client/assets/combobox-B1IXE26_.js +0 -1
  350. package/dist/client/assets/command-CDaLB2Ox.js +0 -1
  351. package/dist/client/assets/index-xA_kfo6T.css +0 -1
  352. package/dist/client/assets/input-BK5Sp8hZ.js +0 -1
  353. package/dist/client/assets/org-file-open-context-DodrnIMR.js +0 -1
  354. package/dist/client/assets/page-seo-form-Dbz3eu1p.js +0 -1
  355. package/dist/client/assets/post-calendar-FfQIYQQi.js +0 -1
  356. package/dist/client/assets/post-editor-YU4-WfQ7.js +0 -1
  357. package/dist/client/assets/project-reports-DVMPWWFi.js +0 -1
  358. package/dist/client/assets/project-tasks-Jy5UvQy6.js +0 -1
  359. package/dist/client/assets/record-editor-CXOCBCZ1.js +0 -1
  360. package/dist/client/assets/redirect-editor-MDe3fibH.js +0 -1
  361. package/dist/client/assets/reports-DwYY1RWm.js +0 -1
  362. package/dist/client/assets/runnable-block-editor-CdEmnBad.js +0 -16
  363. package/dist/client/assets/sections-editor-C6cdGUNk.js +0 -2
  364. package/dist/client/assets/select-oEHCSTZi.js +0 -1
  365. package/dist/client/assets/seo-editor-BD39YQzP.js +0 -1
  366. package/dist/client/assets/shell-layout-BNVBlKMe.js +0 -1
  367. package/dist/client/assets/tasks-aGbeVyrS.js +0 -1
  368. package/dist/client/assets/textarea-B9cyNs7j.js +0 -1
  369. package/dist/client/assets/use-main-panel-tabs-BcprnHpG.js +0 -1
  370. package/dist/client/assets/use-section-preview-base-BbxztEDH.js +0 -1
  371. package/dist/client/assets/useInfiniteQuery-DCZL7BN4.js +0 -1
  372. package/dist/client/assets/useSuspenseInfiniteQuery-C0KSbZH8.js +0 -1
  373. package/dist/client/assets/variant-calendar-BPWkuyHy.js +0 -1
@@ -1 +1 @@
1
- import{c as h}from"./index-doEaURqC.js";import{r as R,d as T,a as k,p as S}from"./thread-intent-DuCE7MYG.js";import{u as j}from"./chat-context-D1GbDSrr.js";import{a as w}from"./use-virtual-mcp-B-mdsJbn.js";function D(d){const t=h.c(14),u=w(d),p=j(),e=u?.metadata,o=p?.activeTask,m=o?.metadata?.runtime;let i;t[0]!==m?(i=S(m),t[0]=m,t[1]=i):i=t[1];const f=i,v=!!o&&!o.partial,l=o?.metadata;let a;t[2]!==e||t[3]!==l?(a=R(l,e),t[2]=e,t[3]=l,t[4]=a):a=t[4];const c=!!f||v&&!!u;let r;t[5]!==e?(r=T(e),t[5]=e,t[6]=r):r=t[6];let s;t[7]!==e?(s=k(e),t[7]=e,t[8]=s):s=t[8];let n;return t[9]!==a||t[10]!==c||t[11]!==r||t[12]!==s?(n={runtime:a,resolved:c,projectDefault:r,previewServerUrl:s},t[9]=a,t[10]=c,t[11]=r,t[12]=s,t[13]=n):n=t[13],n}export{D as u};
1
+ import{c as h}from"./index-CyBVTyGa.js";import{r as R,d as T,a as k,p as S}from"./thread-intent-jq9HKW3p.js";import{u as j}from"./chat-context-HOmU0YHH.js";import{a as w}from"./use-virtual-mcp-Vg_Ogz61.js";function D(d){const t=h.c(14),u=w(d),p=j(),e=u?.metadata,o=p?.activeTask,m=o?.metadata?.runtime;let i;t[0]!==m?(i=S(m),t[0]=m,t[1]=i):i=t[1];const f=i,v=!!o&&!o.partial,l=o?.metadata;let a;t[2]!==e||t[3]!==l?(a=R(l,e),t[2]=e,t[3]=l,t[4]=a):a=t[4];const c=!!f||v&&!!u;let r;t[5]!==e?(r=T(e),t[5]=e,t[6]=r):r=t[6];let s;t[7]!==e?(s=k(e),t[7]=e,t[8]=s):s=t[8];let n;return t[9]!==a||t[10]!==c||t[11]!==r||t[12]!==s?(n={runtime:a,resolved:c,projectDefault:r,previewServerUrl:s},t[9]=a,t[10]=c,t[11]=r,t[12]=s,t[13]=n):n=t[13],n}export{D as u};
@@ -1 +1 @@
1
- import{c as u,a0 as f,a6 as y,m,o as g,e as T,K as l,t as E}from"./index-doEaURqC.js";function K(){const e=u.c(7),{locator:t}=f(),o=y();let n;e[0]!==t?(n=l.tags(t),e[0]=t,e[1]=n):n=e[1];let s;e[2]!==o?(s=async()=>{const{tags:r}=await o.call("TAGS_LIST",{});return r},e[2]=o,e[3]=s):s=e[3];let a;return e[4]!==n||e[5]!==s?(a={queryKey:n,queryFn:s,staleTime:3e4},e[4]=n,e[5]=s,e[6]=a):a=e[6],m(a)}function p(){const e=u.c(8),t=g(),{locator:o}=f(),n=y();let s;e[0]!==n?(s=async c=>{const{tag:i}=await n.call("TAGS_CREATE",typeof c=="string"?{name:c}:c);return i},e[0]=n,e[1]=s):s=e[1];let a;e[2]!==o||e[3]!==t?(a=()=>{t.invalidateQueries({queryKey:l.tags(o)})},e[2]=o,e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r={mutationFn:s,onSuccess:a,onError:S},e[5]=s,e[6]=a,e[7]=r):r=e[7],T(r)}function S(e){E.error(e instanceof Error?e.message:"Failed to create tag")}function C(){const e=u.c(8),t=g(),{locator:o}=f(),n=y();let s;e[0]!==n?(s=async c=>{await n.call("TAGS_DELETE",{tagId:c})},e[0]=n,e[1]=s):s=e[1];let a;e[2]!==o||e[3]!==t?(a=()=>{t.invalidateQueries({queryKey:l.tags(o)}),t.invalidateQueries({queryKey:l.taskBoardItems(o)})},e[2]=o,e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r={mutationFn:s,onSuccess:a,onError:q},e[5]=s,e[6]=a,e[7]=r):r=e[7],T(r)}function q(e){E.error(e instanceof Error?e.message:"Failed to delete tag")}function M(e){const t=u.c(10),{locator:o}=f(),n=y();let s;t[0]!==o||t[1]!==e?(s=l.memberTags(o,e),t[0]=o,t[1]=e,t[2]=s):s=t[2];let a;t[3]!==e||t[4]!==n?(a=async()=>{const{tags:i}=await n.call("MEMBER_TAGS_GET",{memberId:e});return i},t[3]=e,t[4]=n,t[5]=a):a=t[5];const r=!!e;let c;return t[6]!==s||t[7]!==a||t[8]!==r?(c={queryKey:s,queryFn:a,staleTime:3e4,enabled:r},t[6]=s,t[7]=a,t[8]=r,t[9]=c):c=t[9],m(c)}function A(){const e=u.c(8),t=g(),{locator:o}=f(),n=y();let s;e[0]!==n?(s=async c=>{const{memberId:i,tagIds:d}=c;return await n.call("MEMBER_TAGS_SET",{memberId:i,tagIds:d})},e[0]=n,e[1]=s):s=e[1];let a;e[2]!==o||e[3]!==t?(a=(c,i)=>{t.invalidateQueries({queryKey:l.memberTags(o,i.memberId)})},e[2]=o,e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r={mutationFn:s,onSuccess:a,onError:_},e[5]=s,e[6]=a,e[7]=r):r=e[7],T(r)}function _(e){E.error(e instanceof Error?e.message:"Failed to update member tags")}export{p as a,C as b,M as c,A as d,K as u};
1
+ import{c as u,a0 as f,a6 as y,m,o as g,e as T,K as l,t as E}from"./index-CyBVTyGa.js";function K(){const e=u.c(7),{locator:t}=f(),o=y();let n;e[0]!==t?(n=l.tags(t),e[0]=t,e[1]=n):n=e[1];let s;e[2]!==o?(s=async()=>{const{tags:r}=await o.call("TAGS_LIST",{});return r},e[2]=o,e[3]=s):s=e[3];let a;return e[4]!==n||e[5]!==s?(a={queryKey:n,queryFn:s,staleTime:3e4},e[4]=n,e[5]=s,e[6]=a):a=e[6],m(a)}function p(){const e=u.c(8),t=g(),{locator:o}=f(),n=y();let s;e[0]!==n?(s=async c=>{const{tag:i}=await n.call("TAGS_CREATE",typeof c=="string"?{name:c}:c);return i},e[0]=n,e[1]=s):s=e[1];let a;e[2]!==o||e[3]!==t?(a=()=>{t.invalidateQueries({queryKey:l.tags(o)})},e[2]=o,e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r={mutationFn:s,onSuccess:a,onError:S},e[5]=s,e[6]=a,e[7]=r):r=e[7],T(r)}function S(e){E.error(e instanceof Error?e.message:"Failed to create tag")}function C(){const e=u.c(8),t=g(),{locator:o}=f(),n=y();let s;e[0]!==n?(s=async c=>{await n.call("TAGS_DELETE",{tagId:c})},e[0]=n,e[1]=s):s=e[1];let a;e[2]!==o||e[3]!==t?(a=()=>{t.invalidateQueries({queryKey:l.tags(o)}),t.invalidateQueries({queryKey:l.taskBoardItems(o)})},e[2]=o,e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r={mutationFn:s,onSuccess:a,onError:q},e[5]=s,e[6]=a,e[7]=r):r=e[7],T(r)}function q(e){E.error(e instanceof Error?e.message:"Failed to delete tag")}function M(e){const t=u.c(10),{locator:o}=f(),n=y();let s;t[0]!==o||t[1]!==e?(s=l.memberTags(o,e),t[0]=o,t[1]=e,t[2]=s):s=t[2];let a;t[3]!==e||t[4]!==n?(a=async()=>{const{tags:i}=await n.call("MEMBER_TAGS_GET",{memberId:e});return i},t[3]=e,t[4]=n,t[5]=a):a=t[5];const r=!!e;let c;return t[6]!==s||t[7]!==a||t[8]!==r?(c={queryKey:s,queryFn:a,staleTime:3e4,enabled:r},t[6]=s,t[7]=a,t[8]=r,t[9]=c):c=t[9],m(c)}function A(){const e=u.c(8),t=g(),{locator:o}=f(),n=y();let s;e[0]!==n?(s=async c=>{const{memberId:i,tagIds:d}=c;return await n.call("MEMBER_TAGS_SET",{memberId:i,tagIds:d})},e[0]=n,e[1]=s):s=e[1];let a;e[2]!==o||e[3]!==t?(a=(c,i)=>{t.invalidateQueries({queryKey:l.memberTags(o,i.memberId)})},e[2]=o,e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r={mutationFn:s,onSuccess:a,onError:_},e[5]=s,e[6]=a,e[7]=r):r=e[7],T(r)}function _(e){E.error(e instanceof Error?e.message:"Failed to update member tags")}export{p as a,C as b,M as c,A as d,K as u};
@@ -1 +1 @@
1
- import{c as i,f as T,m as l,a0 as S,a6 as _,K as u,aD as O}from"./index-doEaURqC.js";const R=["TASK_BOARD_DELIVERY","TASK_BOARD_STUCK","TASK_BOARD_COST","TASK_BOARD_QUALITY","TASK_BOARD_ERRORS","TASK_BOARD_TENANTS"];function K(){const t=i.c(8),s=T({strict:!1}).org??"";let e;t[0]!==s?(e=u.taskBoardAdminOrgs(s),t[0]=s,t[1]=e):e=t[1];const n=!!s;let A;t[2]!==s?(A=()=>O(s,"TASK_BOARD_ADMIN_ORG_LIST",{}),t[2]=s,t[3]=A):A=t[3];let o;return t[4]!==e||t[5]!==n||t[6]!==A?(o={queryKey:e,enabled:n,queryFn:A,staleTime:3e5},t[4]=e,t[5]=n,t[6]=A,t[7]=o):o=t[7],l(o)}function a(t,s){const e=i.c(13),{locator:n}=S(),A=_();let o;e[0]!==n||e[1]!==s.from||e[2]!==s.org||e[3]!==s.to||e[4]!==t?(o=u.taskBoardAnalytics(n,t,s.org,s.from,s.to),e[0]=n,e[1]=s.from,e[2]=s.org,e[3]=s.to,e[4]=t,e[5]=o):o=e[5];let r;e[6]!==s||e[7]!==A||e[8]!==t?(r=()=>A.call(t,s),e[6]=s,e[7]=A,e[8]=t,e[9]=r):r=e[9];let c;return e[10]!==o||e[11]!==r?(c={queryKey:o,queryFn:r},e[10]=o,e[11]=r,e[12]=c):c=e[12],l(c)}export{R as A,a,K as u};
1
+ import{c as i,f as T,m as l,a0 as S,a6 as _,K as u,aD as O}from"./index-CyBVTyGa.js";const R=["TASK_BOARD_DELIVERY","TASK_BOARD_STUCK","TASK_BOARD_COST","TASK_BOARD_QUALITY","TASK_BOARD_ERRORS","TASK_BOARD_TENANTS"];function K(){const t=i.c(8),s=T({strict:!1}).org??"";let e;t[0]!==s?(e=u.taskBoardAdminOrgs(s),t[0]=s,t[1]=e):e=t[1];const n=!!s;let A;t[2]!==s?(A=()=>O(s,"TASK_BOARD_ADMIN_ORG_LIST",{}),t[2]=s,t[3]=A):A=t[3];let o;return t[4]!==e||t[5]!==n||t[6]!==A?(o={queryKey:e,enabled:n,queryFn:A,staleTime:3e5},t[4]=e,t[5]=n,t[6]=A,t[7]=o):o=t[7],l(o)}function a(t,s){const e=i.c(13),{locator:n}=S(),A=_();let o;e[0]!==n||e[1]!==s.from||e[2]!==s.org||e[3]!==s.to||e[4]!==t?(o=u.taskBoardAnalytics(n,t,s.org,s.from,s.to),e[0]=n,e[1]=s.from,e[2]=s.org,e[3]=s.to,e[4]=t,e[5]=o):o=e[5];let r;e[6]!==s||e[7]!==A||e[8]!==t?(r=()=>A.call(t,s),e[6]=s,e[7]=A,e[8]=t,e[9]=r):r=e[9];let c;return e[10]!==o||e[11]!==r?(c={queryKey:o,queryFn:r},e[10]=o,e[11]=r,e[12]=c):c=e[12],l(c)}export{R as A,a,K as u};
@@ -1 +1 @@
1
- import{a0 as o,a6 as c,r as i,D as d,K as m}from"./index-doEaURqC.js";import{a as T}from"./hooks-C8t7cMQJ.js";function h(e){const{org:n}=o(),r=c(),a=T(),s=i.useSyncExternalStore(a.threads.subscribe,a.threads.get),u=e===null?null:s.find(t=>t.id===e)??null,{data:l}=d({queryKey:m.ensureTask(n.id,e),queryFn:async()=>{if(e===null)return null;try{const{item:t}=await r.call("COLLECTION_THREADS_GET",{id:e});return t??null}catch{return null}},select:t=>t?.metadata??null,staleTime:3e4});return u?.metadata??l??null}export{h as u};
1
+ import{a0 as o,a6 as c,r as i,D as d,K as m}from"./index-CyBVTyGa.js";import{a as T}from"./hooks-lZSCdRwc.js";function h(e){const{org:n}=o(),r=c(),a=T(),s=i.useSyncExternalStore(a.threads.subscribe,a.threads.get),u=e===null?null:s.find(t=>t.id===e)??null,{data:l}=d({queryKey:m.ensureTask(n.id,e),queryFn:async()=>{if(e===null)return null;try{const{item:t}=await r.call("COLLECTION_THREADS_GET",{id:e});return t??null}catch{return null}},select:t=>t?.metadata??null,staleTime:3e4});return u?.metadata??l??null}export{h as u};
@@ -1 +1 @@
1
- import{c,a0 as i,m as l,K as p}from"./index-doEaURqC.js";import{f}from"./chat-context-D1GbDSrr.js";async function m(e,s){const t=await fetch(`/api/${s}/threads/${encodeURIComponent(e)}/outputs`,{credentials:"include"});if(!t.ok)throw new Error(`Failed to fetch thread outputs: ${t.status}`);return(await t.json()).objects??[]}function $(){const e=c.c(2),s=f()?.messages??[];let t;return e[0]!==s?(t=s.some(y),e[0]=s,e[1]=t):t=e[1],t}function y(e){return e.parts?.some(b)}function b(e){const s=e;return(s.type==="tool-bash"||s.type==="tool-write")&&s.state==="output-available"}function g(e,s){const t=c.c(9),{org:u}=i();let o;t[0]!==e?(o=p.threadOutputs(e??""),t[0]=e,t[1]=o):o=t[1];let n;t[2]!==u||t[3]!==e?(n=()=>m(e??"",u.slug),t[2]=u,t[3]=e,t[4]=n):n=t[4];const r=!!e&&(s?.enabled??!0);let a;return t[5]!==o||t[6]!==n||t[7]!==r?(a={queryKey:o,queryFn:n,enabled:r,staleTime:0},t[5]=o,t[6]=n,t[7]=r,t[8]=a):a=t[8],l(a)}export{g as a,$ as u};
1
+ import{c,a0 as i,m as l,K as p}from"./index-CyBVTyGa.js";import{f}from"./chat-context-HOmU0YHH.js";async function m(e,s){const t=await fetch(`/api/${s}/threads/${encodeURIComponent(e)}/outputs`,{credentials:"include"});if(!t.ok)throw new Error(`Failed to fetch thread outputs: ${t.status}`);return(await t.json()).objects??[]}function $(){const e=c.c(2),s=f()?.messages??[];let t;return e[0]!==s?(t=s.some(y),e[0]=s,e[1]=t):t=e[1],t}function y(e){return e.parts?.some(b)}function b(e){const s=e;return(s.type==="tool-bash"||s.type==="tool-write")&&s.state==="output-available"}function g(e,s){const t=c.c(9),{org:u}=i();let o;t[0]!==e?(o=p.threadOutputs(e??""),t[0]=e,t[1]=o):o=t[1];let n;t[2]!==u||t[3]!==e?(n=()=>m(e??"",u.slug),t[2]=u,t[3]=e,t[4]=n):n=t[4];const r=!!e&&(s?.enabled??!0);let a;return t[5]!==o||t[6]!==n||t[7]!==r?(a={queryKey:o,queryFn:n,enabled:r,staleTime:0},t[5]=o,t[6]=n,t[7]=r,t[8]=a):a=t[8],l(a)}export{g as a,$ as u};
@@ -1 +1 @@
1
- import{c as C,a0 as I,z as g,d4 as S,m,d5 as _,d6 as A,K as y,d7 as T,d8 as L,d9 as U}from"./index-doEaURqC.js";import{a as p,u as V,m as R}from"./use-mcp-client-D2DgMGL-.js";function $(o){const t=C.c(5);let e;t[0]!==o?(e=o===void 0?{}:o,t[0]=o,t[1]=e):e=t[1];const n=e,{org:s}=I();let i;t[2]!==s.id||t[3]!==s.slug?(i={connectionId:g,orgId:s.id,orgSlug:s.slug},t[2]=s.id,t[3]=s.slug,t[4]=i):i=t[4];const l=V(i);return _(s.id,"VIRTUAL_MCP",l,n)}function h(o){const t=C.c(14);let e;t[0]!==o?(e={},t[0]=o,t[1]=e):e=t[1];const n=e,{org:s}=I();let i;t[2]!==s.id||t[3]!==s.slug?(i={connectionId:g,orgId:s.id,orgSlug:s.slug},t[2]=s.id,t[3]=s.slug,t[4]=i):i=t[4];const l=p(i);let c;t[5]!==l||t[6]!==n||t[7]!==s.id?(c=L(s.id,"VIRTUAL_MCP",l,n),t[5]=l,t[6]=n,t[7]=s.id,t[8]=c):c=t[8];const d=!!l;let u;t[9]!==c||t[10]!==d?(u={...c,enabled:d},t[9]=c,t[10]=d,t[11]=u):u=t[11];const{data:r}=m(u);let a;return t[12]!==r?(a=r??[],t[12]=r,t[13]=a):a=t[13],a}function O(o){const t=C.c(10),{org:e}=I();let n;t[0]!==e.id||t[1]!==e.slug?(n={connectionId:g,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=n):n=t[2];const s=p(n),i=o??void 0;let l;t[3]!==s||t[4]!==e.id||t[5]!==i?(l=S(e.id,"VIRTUAL_MCP",i,s),t[3]=s,t[4]=e.id,t[5]=i,t[6]=l):l=t[6];const c=!!s&&!!o;let d;t[7]!==l||t[8]!==c?(d={...l,enabled:c},t[7]=l,t[8]=c,t[9]=d):d=t[9];const{data:u}=m(d);return u?.item??null}async function w(o,t,e={}){const n=await o.fetchQuery(R({connectionId:g,orgId:t.id,orgSlug:t.slug})),s=L(t.id,"VIRTUAL_MCP",n,e);return s.select(await o.fetchQuery(s))}function E(o){const t=C.c(18);let e;t[0]!==o?(e={},t[0]=o,t[1]=e):e=t[1];const n=e,{org:s}=I();let i;t[2]!==s.id||t[3]!==s.slug?(i={connectionId:g,orgId:s.id,orgSlug:s.slug},t[2]=s.id,t[3]=s.slug,t[4]=i):i=t[4];const l=p(i);let c;t[5]!==l||t[6]!==n||t[7]!==s.id?(c=U(s.id,"VIRTUAL_MCP",l,n),t[5]=l,t[6]=n,t[7]=s.id,t[8]=c):c=t[8];const d=!!l;let u;t[9]!==c||t[10]!==d?(u={...c,enabled:d},t[9]=c,t[10]=d,t[11]=u):u=t[11];const{data:r}=m(u);let a;t[12]!==r?.items?(a=r?.items??[],t[12]=r?.items,t[13]=a):a=t[13];const P=r?.totalCount,M=r?.hasMore;let f;return t[14]!==a||t[15]!==P||t[16]!==M?(f={items:a,totalCount:P,hasMore:M},t[14]=a,t[15]=P,t[16]=M,t[17]=f):f=t[17],f}function k(o){const t=C.c(3),{org:e}=I();let n;t[0]!==e.id||t[1]!==e.slug?(n={connectionId:g,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=n):n=t[2];const s=V(n);return T(e.id,"VIRTUAL_MCP",o??void 0,s)}function v(o){const t=C.c(15),{org:e}=I();let n;t[0]!==e.id||t[1]!==e.slug?(n={connectionId:g,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=n):n=t[2];const s=V(n);let i,l,c;t[3]!==o||t[4]!==e.id?(i=[...o].sort(),c=m,l=y.virtualMcpLastUsed(e.id,i),t[3]=o,t[4]=e.id,t[5]=i,t[6]=l,t[7]=c):(i=t[5],l=t[6],c=t[7]);const d=i.length>0;let u;t[8]!==s||t[9]!==i?(u=async()=>{const P=(await s.callTool({name:"VIRTUAL_MCP_LAST_USED_LIST",arguments:{ids:i}})).structuredContent??{items:[]},M=new Map;for(const f of P.items)M.set(f.id,f);return M},t[8]=s,t[9]=i,t[10]=u):u=t[10];let r;return t[11]!==l||t[12]!==d||t[13]!==u?(r={queryKey:l,enabled:d,staleTime:3e4,queryFn:u},t[11]=l,t[12]=d,t[13]=u,t[14]=r):r=t[14],c(r)}function x(){const o=C.c(3),{org:t}=I();let e;o[0]!==t.id||o[1]!==t.slug?(e={connectionId:g,orgId:t.id,orgSlug:t.slug},o[0]=t.id,o[1]=t.slug,o[2]=e):e=o[2];const n=V(e);return A(t.id,"VIRTUAL_MCP",n)}export{k as a,$ as b,x as c,O as d,h as e,w as f,v as g,E as u};
1
+ import{c as C,a0 as I,z as g,d6 as S,m,d7 as _,d8 as A,K as y,d9 as T,da as L,db as U}from"./index-CyBVTyGa.js";import{a as p,u as V,m as R}from"./use-mcp-client-CqKNXJW7.js";function $(o){const t=C.c(5);let e;t[0]!==o?(e=o===void 0?{}:o,t[0]=o,t[1]=e):e=t[1];const n=e,{org:s}=I();let i;t[2]!==s.id||t[3]!==s.slug?(i={connectionId:g,orgId:s.id,orgSlug:s.slug},t[2]=s.id,t[3]=s.slug,t[4]=i):i=t[4];const l=V(i);return _(s.id,"VIRTUAL_MCP",l,n)}function h(o){const t=C.c(14);let e;t[0]!==o?(e={},t[0]=o,t[1]=e):e=t[1];const n=e,{org:s}=I();let i;t[2]!==s.id||t[3]!==s.slug?(i={connectionId:g,orgId:s.id,orgSlug:s.slug},t[2]=s.id,t[3]=s.slug,t[4]=i):i=t[4];const l=p(i);let c;t[5]!==l||t[6]!==n||t[7]!==s.id?(c=L(s.id,"VIRTUAL_MCP",l,n),t[5]=l,t[6]=n,t[7]=s.id,t[8]=c):c=t[8];const d=!!l;let u;t[9]!==c||t[10]!==d?(u={...c,enabled:d},t[9]=c,t[10]=d,t[11]=u):u=t[11];const{data:r}=m(u);let a;return t[12]!==r?(a=r??[],t[12]=r,t[13]=a):a=t[13],a}function O(o){const t=C.c(10),{org:e}=I();let n;t[0]!==e.id||t[1]!==e.slug?(n={connectionId:g,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=n):n=t[2];const s=p(n),i=o??void 0;let l;t[3]!==s||t[4]!==e.id||t[5]!==i?(l=S(e.id,"VIRTUAL_MCP",i,s),t[3]=s,t[4]=e.id,t[5]=i,t[6]=l):l=t[6];const c=!!s&&!!o;let d;t[7]!==l||t[8]!==c?(d={...l,enabled:c},t[7]=l,t[8]=c,t[9]=d):d=t[9];const{data:u}=m(d);return u?.item??null}async function w(o,t,e={}){const n=await o.fetchQuery(R({connectionId:g,orgId:t.id,orgSlug:t.slug})),s=L(t.id,"VIRTUAL_MCP",n,e);return s.select(await o.fetchQuery(s))}function E(o){const t=C.c(18);let e;t[0]!==o?(e={},t[0]=o,t[1]=e):e=t[1];const n=e,{org:s}=I();let i;t[2]!==s.id||t[3]!==s.slug?(i={connectionId:g,orgId:s.id,orgSlug:s.slug},t[2]=s.id,t[3]=s.slug,t[4]=i):i=t[4];const l=p(i);let c;t[5]!==l||t[6]!==n||t[7]!==s.id?(c=U(s.id,"VIRTUAL_MCP",l,n),t[5]=l,t[6]=n,t[7]=s.id,t[8]=c):c=t[8];const d=!!l;let u;t[9]!==c||t[10]!==d?(u={...c,enabled:d},t[9]=c,t[10]=d,t[11]=u):u=t[11];const{data:r}=m(u);let a;t[12]!==r?.items?(a=r?.items??[],t[12]=r?.items,t[13]=a):a=t[13];const P=r?.totalCount,M=r?.hasMore;let f;return t[14]!==a||t[15]!==P||t[16]!==M?(f={items:a,totalCount:P,hasMore:M},t[14]=a,t[15]=P,t[16]=M,t[17]=f):f=t[17],f}function k(o){const t=C.c(3),{org:e}=I();let n;t[0]!==e.id||t[1]!==e.slug?(n={connectionId:g,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=n):n=t[2];const s=V(n);return T(e.id,"VIRTUAL_MCP",o??void 0,s)}function v(o){const t=C.c(15),{org:e}=I();let n;t[0]!==e.id||t[1]!==e.slug?(n={connectionId:g,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=n):n=t[2];const s=V(n);let i,l,c;t[3]!==o||t[4]!==e.id?(i=[...o].sort(),c=m,l=y.virtualMcpLastUsed(e.id,i),t[3]=o,t[4]=e.id,t[5]=i,t[6]=l,t[7]=c):(i=t[5],l=t[6],c=t[7]);const d=i.length>0;let u;t[8]!==s||t[9]!==i?(u=async()=>{const P=(await s.callTool({name:"VIRTUAL_MCP_LAST_USED_LIST",arguments:{ids:i}})).structuredContent??{items:[]},M=new Map;for(const f of P.items)M.set(f.id,f);return M},t[8]=s,t[9]=i,t[10]=u):u=t[10];let r;return t[11]!==l||t[12]!==d||t[13]!==u?(r={queryKey:l,enabled:d,staleTime:3e4,queryFn:u},t[11]=l,t[12]=d,t[13]=u,t[14]=r):r=t[14],c(r)}function x(){const o=C.c(3),{org:t}=I();let e;o[0]!==t.id||o[1]!==t.slug?(e={connectionId:g,orgId:t.id,orgSlug:t.slug},o[0]=t.id,o[1]=t.slug,o[2]=e):e=o[2];const n=V(e);return A(t.id,"VIRTUAL_MCP",n)}export{k as a,$ as b,x as c,O as d,h as e,w as f,v as g,E as u};
@@ -0,0 +1 @@
1
+ import{I as u}from"./infiniteQueryObserver-COZ-9XSO.js";import{dH as i}from"./index-CyBVTyGa.js";function t(e,r){return i(e,u,r)}export{t as u};
@@ -1 +1 @@
1
- import{dl as Q,dm as y,dn as w,dp as S,dq as C,o as k,dr as x,ds as q,r as p,dt as M,du as H,dv as L,dw as P,dx as O,dy as B,dz as z}from"./index-doEaURqC.js";function R(r,s){const e=new Set(s);return r.filter(t=>!e.has(t))}function A(r,s,e){const t=r.slice(0);return t[s]=e,t}var T=class extends Q{#i;#s;#n;#r;#e;#t;#o;#u;#h;#a=[];constructor(r,s,e){super(),this.#i=r,this.#r=e,this.#n=[],this.#e=[],this.#s=[],this.setQueries(s)}onSubscribe(){this.listeners.size===1&&this.#e.forEach(r=>{r.subscribe(s=>{this.#f(r,s)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#e.forEach(r=>{r.destroy()})}setQueries(r,s){this.#n=r,this.#r=s,y.batch(()=>{const e=this.#e,t=this.#d(this.#n);t.forEach(o=>o.observer.setOptions(o.defaultedQueryOptions));const i=t.map(o=>o.observer),n=i.map(o=>o.getCurrentResult()),u=e.length!==i.length,c=i.some((o,f)=>o!==e[f]),d=u||c,b=d?!0:n.some((o,f)=>{const g=this.#s[f];return!g||!w(o,g)});!d&&!b||(d&&(this.#a=t,this.#e=i),this.#s=n,this.hasListeners()&&(d&&(R(e,i).forEach(o=>{o.destroy()}),R(i,e).forEach(o=>{o.subscribe(f=>{this.#f(o,f)})})),this.#p()))})}getCurrentResult(){return this.#s}getQueries(){return this.#e.map(r=>r.getCurrentQuery())}getObservers(){return this.#e}getOptimisticResult(r,s){const e=this.#d(r),t=e.map(n=>n.observer.getOptimisticResult(n.defaultedQueryOptions)),i=e.map(n=>n.defaultedQueryOptions.queryHash);return[t,n=>this.#l(n??t,s,i),()=>this.#c(t,e)]}#c(r,s){return s.map((e,t)=>{const i=r[t];return e.defaultedQueryOptions.notifyOnChangeProps?i:e.observer.trackResult(i,n=>{s.forEach(u=>{u.observer.trackProp(n)})})})}#l(r,s,e){if(s){const t=this.#h,i=e!==void 0&&t!==void 0&&(t.length!==e.length||e.some((n,u)=>n!==t[u]));return(!this.#t||this.#s!==this.#u||i||s!==this.#o)&&(this.#o=s,this.#u=this.#s,e!==void 0&&(this.#h=e),this.#t=S(this.#t,s(r))),this.#t}return r}#b(){return this.#r?.combine!==void 0&&this.#e.some((r,s)=>r.options.suspense&&this.#s[s]?.data===void 0)}#d(r){const s=new Map;this.#e.forEach(t=>{const i=t.options.queryHash;if(!i)return;const n=s.get(i);n?n.push(t):s.set(i,[t])});const e=[];return r.forEach(t=>{const i=this.#i.defaultQueryOptions(t),u=s.get(i.queryHash)?.shift()??new C(this.#i,i);e.push({defaultedQueryOptions:i,observer:u})}),e}#f(r,s){const e=this.#e.indexOf(r);e!==-1&&(this.#s=A(this.#s,e,s),this.#p())}#p(){if(this.hasListeners()){const r=this.#c(this.#s,this.#a),s=this.#b(),e=this.#t,t=s?e:this.#l(r,this.#r?.combine);(s||e!==t)&&y.batch(()=>{this.listeners.forEach(i=>{i(this.#s)})})}}};function U({queries:r,...s},e){const t=k(e),i=x(),n=q(),u=p.useMemo(()=>r.map(h=>{const a=t.defaultQueryOptions(h);return a._optimisticResults=i?"isRestoring":"optimistic",a}),[r,t,i]);u.forEach(h=>{M(h);const a=t.getQueryCache().get(h.queryHash);H(h,n,a)}),L(n);const[c]=p.useState(()=>new T(t,u,s)),[d,b,o]=c.getOptimisticResult(u,s.combine),f=!i&&s.subscribed!==!1;p.useSyncExternalStore(p.useCallback(h=>f?c.subscribe(y.batchCalls(h)):P,[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),p.useEffect(()=>{c.setQueries(u,s)},[u,s,c]);const m=d.some((h,a)=>O(u[a],h))?d.flatMap((h,a)=>{const l=u[a];if(l&&O(l,h)){const E=new C(t,l);return B(l,E,n)}return[]}):[];if(m.length>0)throw Promise.all(m);const v=d.find((h,a)=>{const l=u[a];return l&&z({result:h,errorResetBoundary:n,throwOnError:l.throwOnError,query:t.getQueryCache().get(l.queryHash),suspense:l.suspense})});if(v?.error)throw v.error;return b(o())}export{U as u};
1
+ import{dn as Q,dp as y,dq as w,dr as S,ds as C,o as k,dt as x,du as q,r as p,dv as M,dw as H,dx as B,dy as L,dz as O,dA as P,dB as A}from"./index-CyBVTyGa.js";function R(r,s){const e=new Set(s);return r.filter(t=>!e.has(t))}function z(r,s,e){const t=r.slice(0);return t[s]=e,t}var T=class extends Q{#i;#s;#n;#r;#e;#t;#o;#u;#h;#a=[];constructor(r,s,e){super(),this.#i=r,this.#r=e,this.#n=[],this.#e=[],this.#s=[],this.setQueries(s)}onSubscribe(){this.listeners.size===1&&this.#e.forEach(r=>{r.subscribe(s=>{this.#f(r,s)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#e.forEach(r=>{r.destroy()})}setQueries(r,s){this.#n=r,this.#r=s,y.batch(()=>{const e=this.#e,t=this.#d(this.#n);t.forEach(o=>o.observer.setOptions(o.defaultedQueryOptions));const i=t.map(o=>o.observer),n=i.map(o=>o.getCurrentResult()),u=e.length!==i.length,c=i.some((o,f)=>o!==e[f]),d=u||c,b=d?!0:n.some((o,f)=>{const g=this.#s[f];return!g||!w(o,g)});!d&&!b||(d&&(this.#a=t,this.#e=i),this.#s=n,this.hasListeners()&&(d&&(R(e,i).forEach(o=>{o.destroy()}),R(i,e).forEach(o=>{o.subscribe(f=>{this.#f(o,f)})})),this.#p()))})}getCurrentResult(){return this.#s}getQueries(){return this.#e.map(r=>r.getCurrentQuery())}getObservers(){return this.#e}getOptimisticResult(r,s){const e=this.#d(r),t=e.map(n=>n.observer.getOptimisticResult(n.defaultedQueryOptions)),i=e.map(n=>n.defaultedQueryOptions.queryHash);return[t,n=>this.#l(n??t,s,i),()=>this.#c(t,e)]}#c(r,s){return s.map((e,t)=>{const i=r[t];return e.defaultedQueryOptions.notifyOnChangeProps?i:e.observer.trackResult(i,n=>{s.forEach(u=>{u.observer.trackProp(n)})})})}#l(r,s,e){if(s){const t=this.#h,i=e!==void 0&&t!==void 0&&(t.length!==e.length||e.some((n,u)=>n!==t[u]));return(!this.#t||this.#s!==this.#u||i||s!==this.#o)&&(this.#o=s,this.#u=this.#s,e!==void 0&&(this.#h=e),this.#t=S(this.#t,s(r))),this.#t}return r}#b(){return this.#r?.combine!==void 0&&this.#e.some((r,s)=>r.options.suspense&&this.#s[s]?.data===void 0)}#d(r){const s=new Map;this.#e.forEach(t=>{const i=t.options.queryHash;if(!i)return;const n=s.get(i);n?n.push(t):s.set(i,[t])});const e=[];return r.forEach(t=>{const i=this.#i.defaultQueryOptions(t),u=s.get(i.queryHash)?.shift()??new C(this.#i,i);e.push({defaultedQueryOptions:i,observer:u})}),e}#f(r,s){const e=this.#e.indexOf(r);e!==-1&&(this.#s=z(this.#s,e,s),this.#p())}#p(){if(this.hasListeners()){const r=this.#c(this.#s,this.#a),s=this.#b(),e=this.#t,t=s?e:this.#l(r,this.#r?.combine);(s||e!==t)&&y.batch(()=>{this.listeners.forEach(i=>{i(this.#s)})})}}};function U({queries:r,...s},e){const t=k(e),i=x(),n=q(),u=p.useMemo(()=>r.map(h=>{const a=t.defaultQueryOptions(h);return a._optimisticResults=i?"isRestoring":"optimistic",a}),[r,t,i]);u.forEach(h=>{M(h);const a=t.getQueryCache().get(h.queryHash);H(h,n,a)}),B(n);const[c]=p.useState(()=>new T(t,u,s)),[d,b,o]=c.getOptimisticResult(u,s.combine),f=!i&&s.subscribed!==!1;p.useSyncExternalStore(p.useCallback(h=>f?c.subscribe(y.batchCalls(h)):L,[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),p.useEffect(()=>{c.setQueries(u,s)},[u,s,c]);const m=d.some((h,a)=>O(u[a],h))?d.flatMap((h,a)=>{const l=u[a];if(l&&O(l,h)){const E=new C(t,l);return P(l,E,n)}return[]}):[];if(m.length>0)throw Promise.all(m);const v=d.find((h,a)=>{const l=u[a];return l&&A({result:h,errorResetBoundary:n,throwOnError:l.throwOnError,query:t.getQueryCache().get(l.queryHash),suspense:l.suspense})});if(v?.error)throw v.error;return b(o())}export{U as u};
@@ -0,0 +1 @@
1
+ import{I as s}from"./infiniteQueryObserver-COZ-9XSO.js";import{dH as u,dk as n}from"./index-CyBVTyGa.js";function a(r,e){return u({...r,enabled:!0,suspense:!0,throwOnError:n},s,e)}export{a as u};
@@ -1 +1 @@
1
- import{c as V,b as q,r as z,a as O,m as Y,e as $,j as t,n as I,K as J,t as Q,B as W}from"./index-doEaURqC.js";import{C as G}from"./collection-table-wrapper-zKpdBBAO.js";import{E as L}from"./empty-state-ClBiZqLf.js";import{S as H}from"./search-input-CCUlZDzf.js";import{A as X}from"./avatar-CLf3yQhN.js";import{B as D}from"./badge-DuB4cqrw.js";import{u as Z}from"./use-debounced-value-CG2jgHBI.js";import{a as K}from"./admin-fetch-CCSvjTk1.js";import{f as ee}from"./format-time-BtXRrtv4.js";import{g as se}from"./get-initials-D-f_fDFw.js";import"./table-D7l9brRh.js";import"./ArrowUp-CbPBDOpZ.js";import"./SearchMd-B6NDUgzQ.js";import"./User01-DHGCVvV3.js";import"./differenceInSeconds-C3x8sHUj.js";function ve(){const e=V.c(58),s=q(),[r,M]=z.useState("");let N;e[0]!==r?(N=r.trim(),e[0]=r,e[1]=N):N=e[1];const a=Z(N,300),{data:R}=O.useSession(),k=R?.user?.id;let n;e[2]!==a?(n=J.deploymentAdminUsers(a),e[2]=a,e[3]=n):n=e[3];let l;e[4]!==a?(l=()=>{const i=new URLSearchParams({limit:"100"});return a&&i.set("searchValue",a),K(`/api/_admin/users?${i}`)},e[4]=a,e[5]=l):l=e[5];let C;e[6]!==n||e[7]!==l?(C={queryKey:n,queryFn:l},e[6]=n,e[7]=l,e[8]=C):C=e[8];const{data:P,isLoading:_,isError:A}=Y(C);let w;e[9]===Symbol.for("react.memo_cache_sentinel")?(w=ie,e[9]=w):w=e[9];let y;e[10]!==s?(y={mutationFn:ae,onSuccess:w,onError:i=>{Q.error(i instanceof Error?i.message:s("admin.users.failedToImpersonate"))}},e[10]=s,e[11]=y):y=e[11];const E=$(y);let b;e[12]!==P?.users?(b=P?.users??[],e[12]=P?.users,e[13]=b):b=e[13];const B=b;let o;e[14]!==s?(o=s("admin.users.columnUser"),e[14]=s,e[15]=o):o=e[15];let m;e[16]!==s?(m=i=>t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(X,{url:i.image??void 0,fallback:se(i.name),shape:"circle",size:"sm"}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground truncate",children:i.name||s("admin.users.unknown")}),t.jsx("div",{className:"text-sm text-muted-foreground truncate",children:i.email})]})]}),e[16]=s,e[17]=m):m=e[17];let d;e[18]!==o||e[19]!==m?(d={id:"user",header:o,render:m,cellClassName:"flex-1 min-w-0"},e[18]=o,e[19]=m,e[20]=d):d=e[20];let c;e[21]!==s?(c=s("admin.users.columnEmail"),e[21]=s,e[22]=c):c=e[22];let u;e[23]!==s?(u=i=>i.emailVerified?t.jsx(D,{variant:"outline",className:"text-success border-success/20",children:s("admin.users.verified")}):t.jsx(D,{variant:"outline",className:"text-muted-foreground",children:s("admin.users.unverified")}),e[23]=s,e[24]=u):u=e[24];let f;e[25]!==c||e[26]!==u?(f={id:"verified",header:c,render:u,cellClassName:"w-28 shrink-0"},e[25]=c,e[26]=u,e[27]=f):f=e[27];let p;e[28]!==s?(p=s("admin.users.columnCreated"),e[28]=s,e[29]=p):p=e[29];let h;e[30]!==p?(h={id:"created",header:p,render:te,cellClassName:"w-48 shrink-0"},e[30]=p,e[31]=h):h=e[31];let x;e[32]!==k||e[33]!==E||e[34]!==s?(x={id:"actions",header:"",render:i=>t.jsx(W,{variant:"outline",size:"sm",disabled:i.id===k||E.isPending,onClick:()=>E.mutate(i.id),children:s("admin.users.impersonate")}),cellClassName:"w-32 shrink-0"},e[32]=k,e[33]=E,e[34]=s,e[35]=x):x=e[35];let T;e[36]!==f||e[37]!==h||e[38]!==x||e[39]!==d?(T=[d,f,h,x],e[36]=f,e[37]=h,e[38]=x,e[39]=d,e[40]=T):T=e[40];const F=T;let j;e[41]!==s?(j=s("admin.users.searchPlaceholder"),e[41]=s,e[42]=j):j=e[42];let g;e[43]!==r||e[44]!==j?(g=t.jsx(H,{value:r,onChange:M,placeholder:j,className:"w-full md:w-[375px]"}),e[43]=r,e[44]=j,e[45]=g):g=e[45];let S;e[46]!==a||e[47]!==A||e[48]!==s?(S=A?t.jsx(L,{title:s("admin.users.failedToLoadTitle"),description:s("admin.users.failedToLoadDescription")}):t.jsx(L,{title:s("admin.users.noUsersFoundTitle"),description:a?s("admin.users.noUsersMatchSearch",{search:a}):s("admin.users.noUsersYet")}),e[46]=a,e[47]=A,e[48]=s,e[49]=S):S=e[49];let v;e[50]!==F||e[51]!==_||e[52]!==S||e[53]!==B?(v=t.jsx(G,{columns:F,data:B,isLoading:_,emptyState:S}),e[50]=F,e[51]=_,e[52]=S,e[53]=B,e[54]=v):v=e[54];let U;return e[55]!==g||e[56]!==v?(U=t.jsx(I,{children:t.jsx(I.Content,{children:t.jsx(I.Container,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[g,v]})})})}),e[55]=g,e[56]=v,e[57]=U):U=e[57],U}function te(e){return t.jsx("span",{className:"text-sm text-foreground",children:ee(e.createdAt)})}function ie(){window.location.href="/"}function ae(e){return K("/api/_admin/impersonate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e})})}export{ve as default};
1
+ import{c as V,b as q,r as z,a as O,m as Y,e as $,j as t,n as I,K as J,t as Q,B as W}from"./index-CyBVTyGa.js";import{C as G}from"./collection-table-wrapper-CNNpAz5Y.js";import{E as L}from"./empty-state-BpI78UAU.js";import{S as H}from"./search-input-0hd-PWUF.js";import{A as X}from"./avatar-GIuLZx2C.js";import{B as D}from"./badge-DS3KIYvS.js";import{u as Z}from"./use-debounced-value-DHN-wkc6.js";import{a as K}from"./admin-fetch-CCSvjTk1.js";import{f as ee}from"./format-time-BtXRrtv4.js";import{g as se}from"./get-initials-D-f_fDFw.js";import"./table-B9OXzOjU.js";import"./ArrowUp-bOLRJZuX.js";import"./SearchMd-B1Foybfh.js";import"./User01-U5CIC-GP.js";import"./differenceInSeconds-C3x8sHUj.js";function ve(){const e=V.c(58),s=q(),[r,M]=z.useState("");let N;e[0]!==r?(N=r.trim(),e[0]=r,e[1]=N):N=e[1];const a=Z(N,300),{data:R}=O.useSession(),k=R?.user?.id;let n;e[2]!==a?(n=J.deploymentAdminUsers(a),e[2]=a,e[3]=n):n=e[3];let l;e[4]!==a?(l=()=>{const i=new URLSearchParams({limit:"100"});return a&&i.set("searchValue",a),K(`/api/_admin/users?${i}`)},e[4]=a,e[5]=l):l=e[5];let C;e[6]!==n||e[7]!==l?(C={queryKey:n,queryFn:l},e[6]=n,e[7]=l,e[8]=C):C=e[8];const{data:P,isLoading:_,isError:A}=Y(C);let w;e[9]===Symbol.for("react.memo_cache_sentinel")?(w=ie,e[9]=w):w=e[9];let y;e[10]!==s?(y={mutationFn:ae,onSuccess:w,onError:i=>{Q.error(i instanceof Error?i.message:s("admin.users.failedToImpersonate"))}},e[10]=s,e[11]=y):y=e[11];const E=$(y);let b;e[12]!==P?.users?(b=P?.users??[],e[12]=P?.users,e[13]=b):b=e[13];const B=b;let o;e[14]!==s?(o=s("admin.users.columnUser"),e[14]=s,e[15]=o):o=e[15];let m;e[16]!==s?(m=i=>t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(X,{url:i.image??void 0,fallback:se(i.name),shape:"circle",size:"sm"}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground truncate",children:i.name||s("admin.users.unknown")}),t.jsx("div",{className:"text-sm text-muted-foreground truncate",children:i.email})]})]}),e[16]=s,e[17]=m):m=e[17];let d;e[18]!==o||e[19]!==m?(d={id:"user",header:o,render:m,cellClassName:"flex-1 min-w-0"},e[18]=o,e[19]=m,e[20]=d):d=e[20];let c;e[21]!==s?(c=s("admin.users.columnEmail"),e[21]=s,e[22]=c):c=e[22];let u;e[23]!==s?(u=i=>i.emailVerified?t.jsx(D,{variant:"outline",className:"text-success border-success/20",children:s("admin.users.verified")}):t.jsx(D,{variant:"outline",className:"text-muted-foreground",children:s("admin.users.unverified")}),e[23]=s,e[24]=u):u=e[24];let f;e[25]!==c||e[26]!==u?(f={id:"verified",header:c,render:u,cellClassName:"w-28 shrink-0"},e[25]=c,e[26]=u,e[27]=f):f=e[27];let p;e[28]!==s?(p=s("admin.users.columnCreated"),e[28]=s,e[29]=p):p=e[29];let h;e[30]!==p?(h={id:"created",header:p,render:te,cellClassName:"w-48 shrink-0"},e[30]=p,e[31]=h):h=e[31];let x;e[32]!==k||e[33]!==E||e[34]!==s?(x={id:"actions",header:"",render:i=>t.jsx(W,{variant:"outline",size:"sm",disabled:i.id===k||E.isPending,onClick:()=>E.mutate(i.id),children:s("admin.users.impersonate")}),cellClassName:"w-32 shrink-0"},e[32]=k,e[33]=E,e[34]=s,e[35]=x):x=e[35];let T;e[36]!==f||e[37]!==h||e[38]!==x||e[39]!==d?(T=[d,f,h,x],e[36]=f,e[37]=h,e[38]=x,e[39]=d,e[40]=T):T=e[40];const F=T;let j;e[41]!==s?(j=s("admin.users.searchPlaceholder"),e[41]=s,e[42]=j):j=e[42];let g;e[43]!==r||e[44]!==j?(g=t.jsx(H,{value:r,onChange:M,placeholder:j,className:"w-full md:w-[375px]"}),e[43]=r,e[44]=j,e[45]=g):g=e[45];let S;e[46]!==a||e[47]!==A||e[48]!==s?(S=A?t.jsx(L,{title:s("admin.users.failedToLoadTitle"),description:s("admin.users.failedToLoadDescription")}):t.jsx(L,{title:s("admin.users.noUsersFoundTitle"),description:a?s("admin.users.noUsersMatchSearch",{search:a}):s("admin.users.noUsersYet")}),e[46]=a,e[47]=A,e[48]=s,e[49]=S):S=e[49];let v;e[50]!==F||e[51]!==_||e[52]!==S||e[53]!==B?(v=t.jsx(G,{columns:F,data:B,isLoading:_,emptyState:S}),e[50]=F,e[51]=_,e[52]=S,e[53]=B,e[54]=v):v=e[54];let U;return e[55]!==g||e[56]!==v?(U=t.jsx(I,{children:t.jsx(I.Content,{children:t.jsx(I.Container,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[g,v]})})})}),e[55]=g,e[56]=v,e[57]=U):U=e[57],U}function te(e){return t.jsx("span",{className:"text-sm text-foreground",children:ee(e.createdAt)})}function ie(){window.location.href="/"}function ae(e){return K("/api/_admin/impersonate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e})})}export{ve as default};
@@ -1,4 +1,4 @@
1
- import{a as W,s as E,i as w}from"./ZoomOut-Burao8Eg.js";import{a as j}from"./Image01-BLIf6uY9.js";function I(e){if(!e||e.includes("\\")||e.includes("..")||e.includes("\0"))return!0;try{const t=decodeURIComponent(e);return!!(t.includes("\\")||t.includes("..")||t.includes("\0"))}catch{return!0}}function L(e){if(I(e))throw new Error(`Invalid block key: ${e||"(empty)"}`)}function C(e){try{return decodeURIComponent(e)}catch{return e}}function P(e){return L(e),encodeURIComponent(e)}function G(e){return`.deco/blocks/${P(e)}.json`}const v=1e4,F=3;function y(e){return e.trim()?(e.startsWith("/")?e:`/${e}`).replace(/\/+/g,"/"):"/"}function x(e){return e.startsWith("/")?e.slice(1):e}function z(e){const t=x(e);return!t||t.includes("..")||t.includes("\\")?!1:t.startsWith(".deco/blocks/")||!t.startsWith("/")&&!t.includes("://")}function h(e){return e.trim()?e.startsWith("/")?e:`/${e}`:"/"}function $(e){const t=h(e);if(t==="/")return"/";const n=t.split("/").filter(Boolean);return n.pop(),n.length===0?"/":`/${n.join("/")}`}function D(e,t){const n=t.replace(/^\/+|\/+$/g,"");return h(n?`${e==="/"?"":e}/${n}`:e)}function _(e,t){return t==="directory"?e:$(e)}function M(e){const t=e.trim();return t?t.includes("/")||t.includes("\\")||t.includes("..")||t.includes("\0")?"Name cannot contain /, \\, or ..":null:"Name is required"}function B(e){const t=x(e);return t?t.split("/").filter(Boolean).length:0}function S(e,t,n,r=!1){return{files:[...new Set([...e,...n.files])],directories:[...new Set([...t,...n.directories??[]])],truncated:r||!!n.truncated}}function H(e,t){return B(e)>=F&&!t.has(e)}function q(e,t,n=[]){const r=x(e);if(t.includes(r)||n.includes(r))return!0;if(!r)return!1;const s=`${r}/`;return t.some(o=>o.startsWith(s))||n.some(o=>o.startsWith(s))}function U(e){const t=x(e),n=".deco/blocks/";if(!t.startsWith(n)||!t.endsWith(".json"))return null;const r=t.slice(n.length,-5);return C(r)}function A(e){if(!e)return"plaintext";const t=e.toLowerCase();return t.endsWith(".tsx")||t.endsWith(".ts")?"typescript":t.endsWith(".jsx")||t.endsWith(".js")||t.endsWith(".mjs")||t.endsWith(".cjs")?"javascript":t.endsWith(".json")?"json":t.endsWith(".md")||t.endsWith(".mdx")?"markdown":t.endsWith(".css")?"css":t.endsWith(".scss")?"scss":t.endsWith(".html")?"html":t.endsWith(".yaml")||t.endsWith(".yml")?"yaml":t.endsWith(".xml")||t.endsWith(".svg")?"xml":t.endsWith(".py")?"python":t.endsWith(".sql")?"sql":t.endsWith(".sh")?"shell":"plaintext"}const T="#94a3b8";function X(e){const t=e.toLowerCase();return t.endsWith(".tsx")||t.endsWith(".ts")?{Icon:W,color:"#3b82f6"}:t.endsWith(".jsx")||t.endsWith(".js")||t.endsWith(".mjs")||t.endsWith(".cjs")?{Icon:W,color:"#d9a441"}:t.endsWith(".json")?{Icon:E,color:"#cb9b3f"}:t.endsWith(".css")||t.endsWith(".scss")?{Icon:W,color:"#06b6d4"}:t.endsWith(".html")||t.endsWith(".xml")?{Icon:W,color:"#f97316"}:/\.(png|jpe?g|gif|webp|avif|ico|svg)$/.test(t)?{Icon:j,color:"#a855f7"}:t.endsWith(".md")||t.endsWith(".mdx")?{Icon:w,color:"#64748b"}:{Icon:w,color:T}}function K(e){const t=y(e).split("/").filter(Boolean),n=["/"];let r="";for(const s of t.slice(0,-1))r+=`/${s}`,n.push(r);return n}function V(e,t=[]){const n={path:"/",children:[]},r=new Map,s=a=>{let i=r.get(a.path);return i||(i=new Map,r.set(a.path,i)),i},o=a=>{const c=y(a).split("/").filter(Boolean);let l=n,m="";for(const f of c){m+=`/${f}`;const g=s(l);let d=g.get(f);d?d.kind==="file"&&(d.kind="directory"):(d={name:f,path:m,kind:"directory",children:[]},l.children.push(d),g.set(f,d)),l=d}};for(const a of e){const c=y(a).split("/").filter(Boolean);let l=n,m="";c.forEach((f,g)=>{m+=`/${f}`;const d=g===c.length-1,k=s(l);let p=k.get(f);p||(p={name:f,path:m,kind:d?"file":"directory",children:[]},l.children.push(p),k.set(f,p)),l=p})}for(const a of t)o(h(a));const u=a=>{a.sort((i,c)=>i.kind!==c.kind?i.kind==="directory"?-1:1:i.name.localeCompare(c.name));for(const i of a)i.children.length>0&&u(i.children)};return u(n.children),n.children}function N(e,t,n=0){const r=[];for(const s of e)if(s.name!==".gitkeep"&&(r.push({node:s,depth:n}),s.kind==="directory"&&s.children.length>0&&t.has(s.path)))for(const o of N(s.children,t,n+1))r.push(o);return r}function J(e){const t=[];for(const n of e.split(`
1
+ import{a as W,s as E,i as w}from"./ZoomOut-q6Y0RhlM.js";import{a as j}from"./Image01-CkJtDP-I.js";function I(e){if(!e||e.includes("\\")||e.includes("..")||e.includes("\0"))return!0;try{const t=decodeURIComponent(e);return!!(t.includes("\\")||t.includes("..")||t.includes("\0"))}catch{return!0}}function L(e){if(I(e))throw new Error(`Invalid block key: ${e||"(empty)"}`)}function C(e){try{return decodeURIComponent(e)}catch{return e}}function P(e){return L(e),encodeURIComponent(e)}function G(e){return`.deco/blocks/${P(e)}.json`}const v=1e4,F=3;function y(e){return e.trim()?(e.startsWith("/")?e:`/${e}`).replace(/\/+/g,"/"):"/"}function x(e){return e.startsWith("/")?e.slice(1):e}function z(e){const t=x(e);return!t||t.includes("..")||t.includes("\\")?!1:t.startsWith(".deco/blocks/")||!t.startsWith("/")&&!t.includes("://")}function h(e){return e.trim()?e.startsWith("/")?e:`/${e}`:"/"}function $(e){const t=h(e);if(t==="/")return"/";const n=t.split("/").filter(Boolean);return n.pop(),n.length===0?"/":`/${n.join("/")}`}function D(e,t){const n=t.replace(/^\/+|\/+$/g,"");return h(n?`${e==="/"?"":e}/${n}`:e)}function _(e,t){return t==="directory"?e:$(e)}function M(e){const t=e.trim();return t?t.includes("/")||t.includes("\\")||t.includes("..")||t.includes("\0")?"Name cannot contain /, \\, or ..":null:"Name is required"}function B(e){const t=x(e);return t?t.split("/").filter(Boolean).length:0}function S(e,t,n,r=!1){return{files:[...new Set([...e,...n.files])],directories:[...new Set([...t,...n.directories??[]])],truncated:r||!!n.truncated}}function H(e,t){return B(e)>=F&&!t.has(e)}function q(e,t,n=[]){const r=x(e);if(t.includes(r)||n.includes(r))return!0;if(!r)return!1;const s=`${r}/`;return t.some(o=>o.startsWith(s))||n.some(o=>o.startsWith(s))}function U(e){const t=x(e),n=".deco/blocks/";if(!t.startsWith(n)||!t.endsWith(".json"))return null;const r=t.slice(n.length,-5);return C(r)}function A(e){if(!e)return"plaintext";const t=e.toLowerCase();return t.endsWith(".tsx")||t.endsWith(".ts")?"typescript":t.endsWith(".jsx")||t.endsWith(".js")||t.endsWith(".mjs")||t.endsWith(".cjs")?"javascript":t.endsWith(".json")?"json":t.endsWith(".md")||t.endsWith(".mdx")?"markdown":t.endsWith(".css")?"css":t.endsWith(".scss")?"scss":t.endsWith(".html")?"html":t.endsWith(".yaml")||t.endsWith(".yml")?"yaml":t.endsWith(".xml")||t.endsWith(".svg")?"xml":t.endsWith(".py")?"python":t.endsWith(".sql")?"sql":t.endsWith(".sh")?"shell":"plaintext"}const T="#94a3b8";function X(e){const t=e.toLowerCase();return t.endsWith(".tsx")||t.endsWith(".ts")?{Icon:W,color:"#3b82f6"}:t.endsWith(".jsx")||t.endsWith(".js")||t.endsWith(".mjs")||t.endsWith(".cjs")?{Icon:W,color:"#d9a441"}:t.endsWith(".json")?{Icon:E,color:"#cb9b3f"}:t.endsWith(".css")||t.endsWith(".scss")?{Icon:W,color:"#06b6d4"}:t.endsWith(".html")||t.endsWith(".xml")?{Icon:W,color:"#f97316"}:/\.(png|jpe?g|gif|webp|avif|ico|svg)$/.test(t)?{Icon:j,color:"#a855f7"}:t.endsWith(".md")||t.endsWith(".mdx")?{Icon:w,color:"#64748b"}:{Icon:w,color:T}}function K(e){const t=y(e).split("/").filter(Boolean),n=["/"];let r="";for(const s of t.slice(0,-1))r+=`/${s}`,n.push(r);return n}function V(e,t=[]){const n={path:"/",children:[]},r=new Map,s=a=>{let i=r.get(a.path);return i||(i=new Map,r.set(a.path,i)),i},o=a=>{const c=y(a).split("/").filter(Boolean);let l=n,m="";for(const f of c){m+=`/${f}`;const g=s(l);let d=g.get(f);d?d.kind==="file"&&(d.kind="directory"):(d={name:f,path:m,kind:"directory",children:[]},l.children.push(d),g.set(f,d)),l=d}};for(const a of e){const c=y(a).split("/").filter(Boolean);let l=n,m="";c.forEach((f,g)=>{m+=`/${f}`;const d=g===c.length-1,k=s(l);let p=k.get(f);p||(p={name:f,path:m,kind:d?"file":"directory",children:[]},l.children.push(p),k.set(f,p)),l=p})}for(const a of t)o(h(a));const u=a=>{a.sort((i,c)=>i.kind!==c.kind?i.kind==="directory"?-1:1:i.name.localeCompare(c.name));for(const i of a)i.children.length>0&&u(i.children)};return u(n.children),n.children}function N(e,t,n=0){const r=[];for(const s of e)if(s.name!==".gitkeep"&&(r.push({node:s,depth:n}),s.kind==="directory"&&s.children.length>0&&t.has(s.path)))for(const o of N(s.children,t,n+1))r.push(o);return r}function J(e){const t=[];for(const n of e.split(`
2
2
  `)){if(!n)continue;const r=n.indexOf(":");if(r<0)continue;const s=n.indexOf(":",r+1);if(s<0)continue;const o=Number.parseInt(n.slice(r+1,s),10);Number.isFinite(o)&&t.push({path:h(n.slice(0,r)),line:o,text:n.slice(s+1)})}return t}function Q(e,t,n){const r=t.trim().toLowerCase();if(!r)return[];const s=[];for(const o of e)if((o.split("/").pop()??o).toLowerCase().includes(r)&&(s.push(h(o)),s.length>=n))break;return s}const b=24;function Y(e,t){const n=e.replace(/^\s+/,""),r=t.trim().toLowerCase();if(!r)return{leadingEllipsis:!1,segments:[{text:n,match:!1}]};const s=n.toLowerCase().indexOf(r);if(s<0)return{leadingEllipsis:!1,segments:[{text:n,match:!1}]};const o=s>b,u=o?n.slice(s-b):n,a=u.toLowerCase(),i=[];let c=0;for(;;){const l=a.indexOf(r,c);if(l<0){c<u.length&&i.push({text:u.slice(c),match:!1});break}l>c&&i.push({text:u.slice(c,l),match:!1}),i.push({text:u.slice(l,l+r.length),match:!0}),c=l+r.length}return{leadingEllipsis:o,segments:i}}function Z(e){const t=[],n=new Map;for(const r of e){let s=n.get(r.path);s||(s={path:r.path,matches:[]},n.set(r.path,s),t.push(s)),s.matches.push(r)}return t}function tt(e){return e.split(`
3
3
  `).map(t=>t.replace(/^\d+\t/,"")).join(`
4
4
  `)}export{F as E,G as a,L as b,v as c,C as d,V as e,N as f,A as g,Z as h,z as i,_ as j,h as k,X as l,$ as m,K as n,Y as o,H as p,D as q,q as r,tt as s,x as t,Q as u,M as v,J as w,U as x,S as y};
@@ -0,0 +1 @@
1
+ import{c as K,b as X,r as Z,j as i,l as rt,B as tt,am as ut}from"./index-CyBVTyGa.js";import{m as ht,Q as at,q as xt}from"./agent-icon-CSebdE0g.js";import{L as gt}from"./label-DVhvlWqs.js";import{S as lt}from"./scroll-area-CmvmQLS1.js";import{S as bt}from"./switch-C7dIR4UF.js";import{T as vt,c as yt,a as jt}from"./tooltip-BjUMPvkB.js";import{V as Tt}from"./view-mode-toggle-DQkw8yuh.js";import{M as ct,q as mt,t as Nt,v as _t,w as kt,x as U,W as wt}from"./agent-site-editor-content-B7A6sQQt.js";import"./AlertCircle-CVkVxygv.js";import"./Tool01-BvNT4KDI.js";import"./ArrowUp-bOLRJZuX.js";import"./ArrowLeft-CN6aZBvX.js";import"./ArrowRight-FqJnNh3f.js";import"./XCircle-BuDwhQqF.js";import"./ZoomOut-q6Y0RhlM.js";import"./Globe04-_nV993le.js";import"./CheckCircle-DtMp-qqq.js";import"./Check-DL_AGZMy.js";import"./ChevronUp-B6mY-MC1.js";import"./UserSquare-CZakdYWe.js";import"./Copy01-6lOOhJcp.js";import"./CreditCard01-DdYfDHIS.js";import"./DotsVertical-CAjUqtRp.js";import"./Download01-Dq8Pn8XY.js";import"./Eye-B5e-ilzV.js";import"./Share07-B2WnpDWD.js";import"./XClose-D_JLFZFT.js";import"./Image01-CkJtDP-I.js";import"./Key01-BCuGindq.js";import"./LayoutLeft-U0F-Da_p.js";import"./Link01-BjTxU_bP.js";import"./LinkExternal01-DSUCZUJp.js";import"./Monitor01-r707obGd.js";import"./Sun-BKxdX8hu.js";import"./Package-D2jMN__x.js";import"./Palette-DebiHmrq.js";import"./Plus-BbELO07z.js";import"./SearchLg-C9MObDBB.js";import"./SearchMd-B1Foybfh.js";import"./Stars01-DUL2jKUJ.js";import"./Trash01-BLoRPhD3.js";import"./Upload01-CNb1qfRO.js";import"./User01-U5CIC-GP.js";import"./Users01-C6BprSkC.js";import"./X-BNszojyh.js";import"./Zap-BCwjglMw.js";import"./select-CDhEibGy.js";import"./index-DtBnPwzh.js";import"./agent-view-guard-a8AZfEO9.js";import"./use-main-panel-tabs-Wh3mzXf2.js";import"./use-route-default-main-DA5X9xDG.js";import"./use-connection-WQuJ5yl_.js";import"./use-mcp-client-CqKNXJW7.js";import"./auth-B-OXMWGw.js";import"./use-mcp-tools-BgkfMsvS.js";import"./use-virtual-mcp-Vg_Ogz61.js";import"./types-Bxr6Ak0g.js";import"./utils-CVEq3hMx.js";import"./use-project-scope-CRdwBUT7.js";import"./github-repo-BknN0SVI.js";import"./index-B9lZAmmH.js";import"./chat-context-HOmU0YHH.js";import"./use-panel-navigate-Bg-MVKv6.js";import"./thread-route-JcpQ-ikA.js";import"./autosend-pQ9pD2-2.js";import"./thread-intent-jq9HKW3p.js";import"./slugify-CEUa2lfQ.js";import"./hooks-lZSCdRwc.js";import"./backoff-8mStPHYB.js";import"./task-board-Qj-6Ctqf.js";import"./schema-DSsDEA1v.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-entitlements-D6f3xZaU.js";import"./use-ai-providers-ShRDl02e.js";import"./location-oTTXFrSF.js";import"./use-decopilot-events-DF_mJ7FX.js";import"./use-organization-settings-4gJ9Tp49.js";import"./gateway-client-DiyAsoDf.js";import"./dialog-BG6kEGFR.js";import"./drawer-Bl-PPIzX.js";import"./collection-search-DyuqjLWs.js";import"./use-mobile-CUQu4L8c.js";import"./use-mcp-prompts-DpED8Vrg.js";import"./index-DmF8NlWI.js";import"./form-Bx8qGby0.js";import"./input-D5Zi_pUc.js";import"./org-file-open-context-Bh_zBQ2O.js";import"./input-DMG-B3VZ.js";import"./shell-layout-B3x_9fo1.js";import"./avatar-GIuLZx2C.js";import"./download-app-dialog-NqW4PLAx.js";import"./command-ByUEKQB9.js";import"./index-CR8U3UFH.js";import"./integration-icon-mTqkOE6y.js";import"./project-icon-DWnsLAeJ.js";import"./required-auth-layout-BgLvQHTP.js";import"./use-org-sso-CI1_4UQM.js";import"./chat-draft-BdxqYU8-.js";import"./use-session-runtime-DiG_Qt8i.js";import"./usage-stats-Bug-9_EL.js";import"./use-copy-CPOYPvBF.js";import"./markdown-DCPDulUN.js";import"./format-time-BtXRrtv4.js";import"./differenceInSeconds-C3x8sHUj.js";import"./tabs-D6s_HA-y.js";import"./use-deco-credits-Fltfd2iB.js";import"./toggle-group-Dv_lnjT7.js";import"./tool-namespace-DmnQIdtF.js";import"./use-open-billing-url-KLMgEPxW.js";import"./decopilot-B7-O9fZC.js";import"./checkbox-DBYfq56y.js";import"./ai-providers-logos-DD3qZ33J.js";import"./popover-CUdTfYte.js";import"./index-B8ZawsDP.js";import"./input-DOIUaBAK.js";import"./hooks-ZOtfl4oi.js";import"./use-org-fs-B1IHOZ9S.js";import"./question-004-sINsf4GQ.js";import"./use-members-CeW4sAKm.js";import"./use-org-auth-client-zTkj17z7.js";import"./feature-paywall-DwNmZ-M9.js";import"./plan-ladder-BEYdYGx8.js";import"./add-connection-dialog-C5SXdxkT.js";import"./extract-connection-data-BimwPioU.js";import"./metadata-D72DunRR.js";import"./connection-DR9gf0au.js";import"./connection-card-BOo8yulu.js";import"./useInfiniteQuery-DebjMHv1.js";import"./infiniteQueryObserver-COZ-9XSO.js";import"./connection-slug-CITJ0kGN.js";import"./textarea-TE2JJa-B.js";import"./connection-form-helpers-D5P5OxyV.js";import"./authenticate-and-persist-oauth-B71_ZhsC.js";import"./mcp-oauth-DdNMjTqu.js";import"./collection-tabs-3_QvnkN-.js";import"./badge-DS3KIYvS.js";import"./use-infinite-scroll-BCiTqxTQ.js";import"./useSuspenseInfiniteQuery-CqRV1dKR.js";import"./pair-CIltybgP.js";import"./collapsible-BpIxv8-d.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-DBdofBbE.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./sheet-DH_REC9j.js";import"./use-navigate-to-agent-W6hb3mqs.js";import"./use-thread-outputs-C9_GjCjS.js";import"./file-type-icon-Cbv1Det1.js";import"./sandbox-lifecycle-context-LNZL2c0K.js";import"./sandbox-url-D3mC8qhT.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./use-task-metadata-ehugU85S.js";import"./use-project-native-view-presence-C3jxCCXQ.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./use-file-configs-Cd7oj9Fw.js";import"./site-slug-uya6Wp4-.js";import"./virtual-mcp-S8IoUqby.js";import"./feature-gate-B63BZEdG.js";import"./alert-dialog-DeRt3vSN.js";import"./runnable-block-editor-DrtKYS1k.js";import"./decofile-api-CWaaGMA2.js";import"./utils-Bf0RpmgB.js";import"./claim-phase-copy-njXeDF0h.js";import"./monaco-editor-tpWF7AL5.js";import"./editor-BiwQpn1s.js";import"./calendar-D4hMMrVq.js";import"./rich-text-link-control-0ZhNexVb.js";import"./combobox-OP-CbRFf.js";import"./search-input-0hd-PWUF.js";import"./use-debounced-value-DHN-wkc6.js";import"./asset-utils-BS06OXCA.js";import"./sandbox-git-api-B1R0585s.js";import"./mustache-BU3hKYND.js";import"./empty-state-BpI78UAU.js";import"./github-icon-Bx6tzbBb.js";import"./repository-import-picker-74Y3ta69.js";import"./repository-picker-dKTE5PS5.js";const Et=new Set(["website/matchers/date.ts","$live/matchers/MatchDate.ts"]),St=new Set(["website/matchers/multi.ts","$live/matchers/MatchMulti.ts"]),Mt=new Date(-864e13),Ct=new Date(864e13),At=/\/flags\/multivariate(?:\/[^/]+)?\.ts$/,$t=/\/flags\/multivariate\.ts$/;function Lt(e){let t=e;t.startsWith("pages-")&&(t=t.slice(6).replace(/-\d+$/,""));try{t=decodeURIComponent(t)}catch{}return t}function Rt(e){if(!e||typeof e!="object")return null;const{start:t,end:r}=e,o=typeof t=="string",s=typeof r=="string";if(!o&&!s)return null;const n=o?new Date(t):Mt,a=s?new Date(r):Ct;return Number.isNaN(n.getTime())||Number.isNaN(a.getTime())||o&&s&&a.getTime()<=n.getTime()?null:{start:n,end:a,openStart:!o,openEnd:!s}}function pt(e,t){if(!e||typeof e!="object")return;const r=e.__resolveType;if(typeof r=="string"){if(Et.has(r)){const o=Rt(e);o&&t.push(o);return}if(St.has(r)){const o=e.matchers;if(Array.isArray(o))for(const s of o)pt(s,t)}}}function Dt(e){if(!e||typeof e!="object")return!1;const t=e.__resolveType;if(typeof t!="string"||!At.test(t))return!1;const r=e.variants;return Array.isArray(r)}function Ot(e){if(typeof e=="string"){const c=e.trim();if(c.length===0)return null;try{const m=new URL(c).pathname.split("/").filter(Boolean),p=m[m.length-1];if(p)return decodeURIComponent(p)}catch{}return c.length>80?`${c.slice(0,77)}…`:c}if(!e||typeof e!="object")return null;const t=e,r=t.config,s=t.desktop?.media,n=[t.title,t.name,t.label,t.alt,r?.title,r?.name,r?.typeAlert?.message,s?.alt,Array.isArray(t.matcher)?t.matcher[0]:void 0];for(const c of n)if(typeof c=="string"&&c.trim().length>0)return c.trim();const a=t.__resolveType;if(typeof a=="string"){const l=(a.split("/").pop()??a).replace(/\.(tsx?|jsx?)$/i,"");if(l.length>0)return l}return null}function Pt(e){const t=[];for(let r=0;r<e.length;r++){const o=e[r];typeof o=="number"?t.length>0?t[t.length-1]+=`[${o}]`:t.push(`[${o}]`):t.push(o)}return t.join(" · ")}function J(e,t,r,o,s){if(Dt(e)){const n=e.variants,a=e.__resolveType,c=$t.test(a)?"":Pt(o);n.forEach((l,m)=>{if(!l||typeof l!="object")return;const p=l,h=[];if(pt(p.rule,h),h.length===0)return;const g=Ot(p.value)??(c||r);for(const u of h)s.push({blockKey:t,blockLabel:r,innerPath:c,variantIndex:m,start:u.start,end:u.end,openStart:u.openStart,openEnd:u.openEnd,label:g,flagResolveType:a})});for(let l=0;l<n.length;l++){const m=n[l];m&&typeof m=="object"&&J(m.value,t,r,[...o,"variants",l,"value"],s)}return}if(Array.isArray(e)){for(let n=0;n<e.length;n++)J(e[n],t,r,[...o,n],s);return}if(e&&typeof e=="object")for(const[n,a]of Object.entries(e))n!=="__resolveType"&&J(a,t,r,[...o,n],s)}function It(e){if(!e)return[];const t=[];for(const[r,o]of Object.entries(e))J(o,r,Lt(r),[],t);return t.sort((r,o)=>r.start.getTime()-o.start.getTime())}function Vt(e){const t=[...new Set(e)].sort(),r=new Map;return t.forEach((o,s)=>{const n=s*137.508%360;r.set(o,{bg:`oklch(0.62 0.14 ${n})`,text:"white",border:`oklch(0.50 0.14 ${n})`})}),r}const Ht={bg:"oklch(0.62 0.14 0)",text:"white",border:"oklch(0.50 0.14 0)"};function dt(e,t){return e.get(t)??Ht}const ot=new Intl.DateTimeFormat("en",{dateStyle:"medium",timeStyle:"short"});function Bt(e,t){const r=e.openStart?t("sandbox.variantCalendar.always"):ot.format(e.start),o=e.openEnd?t("sandbox.variantCalendar.ongoing"):ot.format(e.end);return`${r} → ${o}`}function Ft(e){const t=K.c(18),{variant:r}=e,o=X();let s;t[0]!==r.blockLabel?(s=i.jsx("div",{className:"font-semibold",children:r.blockLabel}),t[0]=r.blockLabel,t[1]=s):s=t[1];let n;t[2]!==r.innerPath?(n=r.innerPath&&i.jsx("div",{className:"text-muted-foreground",children:r.innerPath}),t[2]=r.innerPath,t[3]=n):n=t[3];let a;t[4]!==r.blockLabel||t[5]!==r.innerPath||t[6]!==r.label?(a=r.label!==r.blockLabel&&r.label!==r.innerPath&&i.jsx("div",{className:"text-muted-foreground",children:r.label}),t[4]=r.blockLabel,t[5]=r.innerPath,t[6]=r.label,t[7]=a):a=t[7];let c;t[8]!==o||t[9]!==r?(c=Bt(r,o),t[8]=o,t[9]=r,t[10]=c):c=t[10];let l;t[11]!==c?(l=i.jsx("div",{className:"mt-1",children:c}),t[11]=c,t[12]=l):l=t[12];let m;return t[13]!==s||t[14]!==n||t[15]!==a||t[16]!==l?(m=i.jsx(jt,{children:i.jsxs("div",{className:"text-xs",children:[s,n,a,l]})}),t[13]=s,t[14]=n,t[15]=a,t[16]=l,t[17]=m):m=t[17],m}const it=16;function zt(e,t){const r=e?"transparent":"#000 0",o=t?"transparent":"#000 100%";if(!(!e&&!t))return`linear-gradient(to right, ${r}, #000 ${it}px, #000 calc(100% - ${it}px), ${o})`}function ft(e){const t=K.c(26),{variant:r,color:o,style:s,children:n,fadeStart:a,fadeEnd:c}=e,l=a===void 0?!1:a,m=c===void 0?!1:c;let p;t[0]!==m||t[1]!==l?(p=zt(l,m),t[0]=m,t[1]=l,t[2]=p):p=t[2];const h=p;let f;t[3]!==l?(f=l&&{borderTopLeftRadius:0,borderBottomLeftRadius:0},t[3]=l,t[4]=f):f=t[4];let g;t[5]!==m?(g=m&&{borderTopRightRadius:0,borderBottomRightRadius:0},t[5]=m,t[6]=g):g=t[6];let u;t[7]!==h?(u=h&&{maskImage:h,WebkitMaskImage:h},t[7]=h,t[8]=u):u=t[8];let x;t[9]!==o.bg||t[10]!==o.text||t[11]!==s||t[12]!==f||t[13]!==g||t[14]!==u?(x={background:o.bg,color:o.text,borderRadius:4,...f,...g,...u,...s},t[9]=o.bg,t[10]=o.text,t[11]=s,t[12]=f,t[13]=g,t[14]=u,t[15]=x):x=t[15];let b;t[16]!==n?(b=i.jsx("span",{className:"truncate",children:n}),t[16]=n,t[17]=b):b=t[17];let E;t[18]!==x||t[19]!==b?(E=i.jsx(vt,{asChild:!0,children:i.jsx("div",{className:"absolute flex items-center px-2 text-[11px] font-medium truncate cursor-default",style:x,children:b})}),t[18]=x,t[19]=b,t[20]=E):E=t[20];let T;t[21]!==r?(T=i.jsx(Ft,{variant:r}),t[21]=r,t[22]=T):T=t[22];let d;return t[23]!==T||t[24]!==E?(d=i.jsxs(yt,{children:[E,T]}),t[23]=T,t[24]=E,t[25]=d):d=t[25],d}function vi(e){const t=K.c(72),{decofile:r}=e,o=X(),[s,n]=Z.useState("calendar"),[a,c]=Z.useState(Kt),[l,m]=Z.useState(!1);let p,h,f;if(t[0]!==r||t[1]!==l){const I=It(r);p=I.filter(Ut).length,f=l?I:I.filter(Gt),h=Vt(f.map(Wt)),t[0]=r,t[1]=l,t[2]=p,t[3]=h,t[4]=f}else p=t[2],h=t[3],f=t[4];const g=h;let u;t[5]===Symbol.for("react.memo_cache_sentinel")?(u=()=>c(mt(new Date)),t[5]=u):u=t[5];const x=u;let b;t[6]!==s?(b=()=>c(I=>s==="calendar"?U(I,-1):U(I,-3)),t[6]=s,t[7]=b):b=t[7];const E=b;let T;t[8]!==s?(T=()=>c(I=>s==="calendar"?U(I,1):U(I,3)),t[8]=s,t[9]=T):T=t[9];const d=T;let v;t[10]!==o?(v=o("sandbox.variantCalendar.today"),t[10]=o,t[11]=v):v=t[11];let y;t[12]!==v?(y=i.jsx(tt,{variant:"outline",size:"sm",onClick:x,children:v}),t[12]=v,t[13]=y):y=t[13];let N;t[14]!==o?(N=o("sandbox.variantCalendar.previous"),t[14]=o,t[15]=N):N=t[15];let A;t[16]===Symbol.for("react.memo_cache_sentinel")?(A=i.jsx(ht,{size:16}),t[16]=A):A=t[16];let _;t[17]!==E||t[18]!==N?(_=i.jsx(tt,{variant:"ghost",size:"icon",className:"size-8",onClick:E,"aria-label":N,children:A}),t[17]=E,t[18]=N,t[19]=_):_=t[19];let k;t[20]!==o?(k=o("sandbox.variantCalendar.next"),t[20]=o,t[21]=k):k=t[21];let M;t[22]===Symbol.for("react.memo_cache_sentinel")?(M=i.jsx(ut,{size:16}),t[22]=M):M=t[22];let $;t[23]!==d||t[24]!==k?($=i.jsx(tt,{variant:"ghost",size:"icon",className:"size-8",onClick:d,"aria-label":k,children:M}),t[23]=d,t[24]=k,t[25]=$):$=t[25];const L=ct[a.getMonth()];let C;t[26]!==a?(C=a.getFullYear(),t[26]=a,t[27]=C):C=t[27];let w;t[28]!==L||t[29]!==C?(w=i.jsxs("h2",{className:"ml-2 text-base font-semibold",children:[L," ",C]}),t[28]=L,t[29]=C,t[30]=w):w=t[30];let j;t[31]!==$||t[32]!==w||t[33]!==y||t[34]!==_?(j=i.jsxs("div",{className:"flex items-center gap-2",children:[y,_,$,w]}),t[31]=$,t[32]=w,t[33]=y,t[34]=_,t[35]=j):j=t[35];let R;t[36]!==p||t[37]!==l||t[38]!==o?(R=p>0&&i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(bt,{id:"show-ongoing",checked:l,onCheckedChange:m}),i.jsx(gt,{htmlFor:"show-ongoing",className:"text-xs text-muted-foreground cursor-pointer",children:o("sandbox.variantCalendar.showOngoing",{count:p})})]}),t[36]=p,t[37]=l,t[38]=o,t[39]=R):R=t[39];let B;t[40]===Symbol.for("react.memo_cache_sentinel")?(B=i.jsx(at,{}),t[40]=B):B=t[40];let V;t[41]!==o?(V=o("sandbox.variantCalendar.calendarMode"),t[41]=o,t[42]=V):V=t[42];let S;t[43]!==V?(S={value:"calendar",icon:B,label:V},t[43]=V,t[44]=S):S=t[44];let F;t[45]===Symbol.for("react.memo_cache_sentinel")?(F=i.jsx(xt,{}),t[45]=F):F=t[45];let D;t[46]!==o?(D=o("sandbox.variantCalendar.timelineMode"),t[46]=o,t[47]=D):D=t[47];let O;t[48]!==D?(O={value:"timeline",icon:F,label:D},t[48]=D,t[49]=O):O=t[49];let P;t[50]!==S||t[51]!==O?(P=[S,O],t[50]=S,t[51]=O,t[52]=P):P=t[52];let H;t[53]!==P||t[54]!==s?(H=i.jsx(Tt,{value:s,onValueChange:n,options:P}),t[53]=P,t[54]=s,t[55]=H):H=t[55];let z;t[56]!==R||t[57]!==H?(z=i.jsxs("div",{className:"flex items-center gap-4",children:[R,H]}),t[56]=R,t[57]=H,t[58]=z):z=t[58];let W;t[59]!==j||t[60]!==z?(W=i.jsxs("div",{className:"flex items-center justify-between px-4 h-12 border-b shrink-0",children:[j,z]}),t[59]=j,t[60]=z,t[61]=W):W=t[61];let G;t[62]!==g||t[63]!==a||t[64]!==p||t[65]!==l||t[66]!==f||t[67]!==s?(G=f.length===0?i.jsx(Yt,{hiddenOngoing:l?0:p}):s==="calendar"?i.jsx(Qt,{monthStart:a,variants:f,colorMap:g}):i.jsx(te,{monthStart:a,variants:f,colorMap:g}),t[62]=g,t[63]=a,t[64]=p,t[65]=l,t[66]=f,t[67]=s,t[68]=G):G=t[68];let q;return t[69]!==W||t[70]!==G?(q=i.jsxs("div",{className:"flex h-full w-full flex-col",children:[W,G]}),t[69]=W,t[70]=G,t[71]=q):q=t[71],q}function Wt(e){return e.blockKey}function Gt(e){return!e.openEnd}function Ut(e){return e.openEnd}function Kt(){return mt(new Date)}function Yt(e){const t=K.c(4),{hiddenOngoing:r}=e,o=r===void 0?0:r,s=X();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx(at,{size:24,className:"text-muted-foreground/60"}),t[0]=n):n=t[0];let a;return t[1]!==o||t[2]!==s?(a=i.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-2 text-center text-sm text-muted-foreground p-6",children:[n,o>0?i.jsxs(i.Fragment,{children:[i.jsx("div",{children:s("sandbox.variantCalendar.noDatedVariants")}),i.jsx("div",{className:"text-xs text-muted-foreground/80",children:s("sandbox.variantCalendar.hiddenOngoingVariants",{count:o})})]}):i.jsxs(i.Fragment,{children:[i.jsx("div",{children:s("sandbox.variantCalendar.noScheduledVariants")}),i.jsx("div",{className:"text-xs text-muted-foreground/80",children:s("sandbox.variantCalendar.dateMatcherInfo")})]})]}),t[1]=o,t[2]=s,t[3]=a):a=t[3],a}const et=20,nt=2,st=28,qt=6;function Qt(e){const t=K.c(17),{monthStart:r,variants:o,colorMap:s}=e;let n,a,c,l,m;if(t[0]!==s||t[1]!==r||t[2]!==o){const f=Nt(r),g=_t(new Date);n=lt,m="flex-1 min-h-0",a="min-w-[840px]",t[8]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx("div",{className:"grid grid-cols-7 border-b text-xs text-muted-foreground sticky top-0 bg-background z-10",children:wt.map(Xt)}),t[8]=c):c=t[8],l=f.map((u,x)=>{const b=kt(u,o),E=b.reduce(Jt,0),T=st+E*(et+nt)+8;return i.jsxs("div",{className:"grid grid-cols-7 relative border-b",style:{height:T},children:[u.map((d,v)=>{const y=d.getMonth()===r.getMonth(),N=d.getTime()===g.getTime();return i.jsx("div",{className:rt("border-r last:border-r-0 px-2 pt-1.5 text-xs",y?"bg-background":"bg-muted/30 text-muted-foreground"),children:i.jsx("span",{className:rt("inline-flex h-5 min-w-5 items-center justify-center rounded-full px-1",N&&"bg-primary text-primary-foreground font-semibold"),children:d.getDate()})},v)}),b.map((d,v)=>{const y=dt(s,d.variant.blockKey),N=st+d.lane*(et+nt),A=d.leftUnits/7*100,_=d.widthUnits/7*100,k=d.variant.openStart&&x===0,M=d.variant.openEnd&&x===f.length-1;return i.jsxs(ft,{variant:d.variant,color:y,fadeStart:k,fadeEnd:M,style:{top:N,left:`calc(${A}% + 2px)`,width:`calc(${_}% - 4px)`,minWidth:qt,height:et},children:[d.variant.blockLabel,d.variant.label!==d.variant.blockLabel&&i.jsxs("span",{className:"opacity-70",children:[" · ",d.variant.label]})]},`${x}-${v}`)})]},x)}),t[0]=s,t[1]=r,t[2]=o,t[3]=n,t[4]=a,t[5]=c,t[6]=l,t[7]=m}else n=t[3],a=t[4],c=t[5],l=t[6],m=t[7];let p;t[9]!==a||t[10]!==c||t[11]!==l?(p=i.jsxs("div",{className:a,children:[c,l]}),t[9]=a,t[10]=c,t[11]=l,t[12]=p):p=t[12];let h;return t[13]!==n||t[14]!==m||t[15]!==p?(h=i.jsx(n,{className:m,children:p}),t[13]=n,t[14]=m,t[15]=p,t[16]=h):h=t[16],h}function Jt(e,t){return Math.max(e,t.lane+1)}function Xt(e){return i.jsx("div",{className:"px-2 py-2 text-center uppercase tracking-wide",children:e},e)}const Q=4,Zt=32,Y=240;function te(e){const t=K.c(23),{monthStart:r,variants:o,colorMap:s}=e,n=r,a=U(r,Q),c=new Date,l=new Map;for(const w of o){const j=l.get(w.blockKey)??[];j.push(w),l.set(w.blockKey,j)}const m=Array.from(l.entries()).sort(oe),p=a.getTime()-n.getTime(),h=w=>(Math.max(n.getTime(),Math.min(a.getTime(),w.getTime()))-n.getTime())/p*100;let f;t[0]!==n?(f=(w,j)=>U(n,j),t[0]=n,t[1]=f):f=t[1];const g=Array.from({length:Q},f),u=c.getTime()>=n.getTime()&&c.getTime()<=a.getTime()?h(c):null,x=X(),b=lt,E="flex-1 min-h-0",T="min-w-[900px] relative";let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d={width:Y},t[2]=d):d=t[2];let v;t[3]!==x?(v=x("sandbox.variantCalendar.variantBlock"),t[3]=x,t[4]=v):v=t[4];let y;t[5]!==v?(y=i.jsx("div",{className:"shrink-0 px-3 py-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground border-r",style:d,children:v}),t[5]=v,t[6]=y):y=t[6];let N;t[7]===Symbol.for("react.memo_cache_sentinel")?(N={gridTemplateColumns:`repeat(${Q}, minmax(0, 1fr))`},t[7]=N):N=t[7];const A=g.map(re);let _;t[8]!==A?(_=i.jsx("div",{className:"flex-1 grid",style:N,children:A}),t[8]=A,t[9]=_):_=t[9];let k;t[10]!==y||t[11]!==_?(k=i.jsxs("div",{className:"flex border-b sticky top-0 bg-background z-10",children:[y,_]}),t[10]=y,t[11]=_,t[12]=k):k=t[12];let M;t[13]!==x||t[14]!==u?(M=u!==null&&i.jsx("div",{className:"pointer-events-none absolute top-0 bottom-0 w-px bg-primary/70 z-[5]",style:{left:`calc(${Y}px + (100% - ${Y}px) * ${u} / 100)`},children:i.jsx("span",{className:"absolute -top-0.5 -translate-x-1/2 rounded-sm bg-primary px-1.5 py-px text-[10px] font-medium text-primary-foreground",children:x("sandbox.variantCalendar.todayLabel")})}),t[13]=x,t[14]=u,t[15]=M):M=t[15];const $=m.map(w=>{const[j,R]=w,B=dt(s,j),V=R[0]?.blockLabel??j;return i.jsxs("div",{children:[i.jsx("div",{className:"flex items-center bg-muted/40 border-b text-xs font-semibold uppercase tracking-wide text-muted-foreground",style:{height:28},children:i.jsx("div",{className:"px-3 truncate",style:{width:Y},children:V})}),R.map((S,F)=>i.jsxs("div",{className:"flex border-b items-center",style:{height:Zt},children:[i.jsxs("div",{className:"flex items-center gap-2 px-3 text-sm border-r shrink-0",style:{width:Y},children:[i.jsx("span",{className:"inline-block h-2 w-2 rounded-full shrink-0",style:{background:B.bg}}),i.jsx("span",{className:"truncate text-foreground/80",children:S.label})]}),i.jsxs("div",{className:"relative flex-1 h-full",children:[i.jsx("div",{className:"absolute inset-0 grid",style:{gridTemplateColumns:`repeat(${Q}, minmax(0, 1fr))`},children:g.map(ee)}),(()=>{const D=Math.max(S.start.getTime(),n.getTime()),O=Math.min(S.end.getTime(),a.getTime());if(O<=D)return null;const P=h(new Date(D)),H=h(new Date(O))-P;return i.jsx(ft,{variant:S,color:B,fadeStart:S.openStart,fadeEnd:S.openEnd,style:{top:"50%",transform:"translateY(-50%)",left:`${P}%`,width:`calc(${H}% - 2px)`,height:22},children:S.label})})()]})]},F))]},j)});let L;t[16]!==k||t[17]!==M||t[18]!==$?(L=i.jsxs("div",{className:T,children:[k,M,$]}),t[16]=k,t[17]=M,t[18]=$,t[19]=L):L=t[19];let C;return t[20]!==b||t[21]!==L?(C=i.jsx(b,{className:E,children:L}),t[20]=b,t[21]=L,t[22]=C):C=t[22],C}function ee(e,t){return i.jsx("div",{className:"border-r last:border-r-0 border-border/40"},t)}function re(e,t){return i.jsxs("div",{className:"px-2 py-2 text-xs uppercase tracking-wide text-muted-foreground border-r last:border-r-0",children:[ct[e.getMonth()]?.slice(0,3)," ",e.getFullYear()]},t)}function oe(e,t){return e[0].localeCompare(t[0])}export{vi as VariantCalendar};
@@ -1 +1 @@
1
- import{G as f,H as $}from"./runnable-block-editor-CdEmnBad.js";const l="x-deco-matchers-override";function h({pageKey:a,prefix:r,variants:t,selectedIndex:n,decofile:i,meta:s}){if(!a||n<0||n>=t.length)return[];const o=[];for(let e=0;e<=n;e++){const u=t[e];if(!u)continue;const c=u.rule,v=e===n?"1":"0",d=(f(c,i,s)?$(c,i,s):null)??`${a}@${r}.${e}.rule`;o.push(`${d}=${v}`)}return o}function B(a,r,t,n){return!r.multivariate||r.variants.length<=1?[]:h({pageKey:a,prefix:"sections.variants",variants:r.variants,selectedIndex:r.index,decofile:t,meta:n})}function P({pageKey:a,page:r,sectionIndex:t,sectionLazy:n,mvObj:i,selectedVariantIndex:s,decofile:o,meta:e}){if(t<0)return[];const c=`${r.multivariate?`sections.variants.${r.index}.value`:"sections"}.${t}${n?".section":""}.variants`,v=Array.isArray(i.variants)?i.variants:[];return h({pageKey:a,prefix:c,variants:v,selectedIndex:s,decofile:o,meta:e})}function x(a,r){if(r.length===0)return a;try{const t=new URL(a,"http://local");t.searchParams.delete(l);for(const n of r)t.searchParams.append(l,n);return a.startsWith("http")?t.toString():`${t.pathname}${t.search}${t.hash}`}catch{return a}}export{P as a,B as b,x as w};
1
+ import{G as f,H as $}from"./runnable-block-editor-DrtKYS1k.js";const l="x-deco-matchers-override";function h({pageKey:a,prefix:r,variants:t,selectedIndex:n,decofile:i,meta:s}){if(!a||n<0||n>=t.length)return[];const o=[];for(let e=0;e<=n;e++){const u=t[e];if(!u)continue;const c=u.rule,v=e===n?"1":"0",d=(f(c,i,s)?$(c,i,s):null)??`${a}@${r}.${e}.rule`;o.push(`${d}=${v}`)}return o}function B(a,r,t,n){return!r.multivariate||r.variants.length<=1?[]:h({pageKey:a,prefix:"sections.variants",variants:r.variants,selectedIndex:r.index,decofile:t,meta:n})}function P({pageKey:a,page:r,sectionIndex:t,sectionLazy:n,mvObj:i,selectedVariantIndex:s,decofile:o,meta:e}){if(t<0)return[];const c=`${r.multivariate?`sections.variants.${r.index}.value`:"sections"}.${t}${n?".section":""}.variants`,v=Array.isArray(i.variants)?i.variants:[];return h({pageKey:a,prefix:c,variants:v,selectedIndex:s,decofile:o,meta:e})}function x(a,r){if(r.length===0)return a;try{const t=new URL(a,"http://local");t.searchParams.delete(l);for(const n of r)t.searchParams.append(l,n);return a.startsWith("http")?t.toString():`${t.pathname}${t.search}${t.hash}`}catch{return a}}export{P as a,B as b,x as w};
@@ -1 +1 @@
1
- import{c as $,r as T,l as d,j as i}from"./index-doEaURqC.js";import{c as k,T as I,a as P}from"./tooltip-C91IS2ON.js";const M={sm:{button:"size-7",buttonWithLabel:"h-7",icon:"size-4"},md:{button:"size-9",buttonWithLabel:"h-9",icon:"size-5"},lg:{button:"size-12",buttonWithLabel:"h-12",icon:"size-6"}};function B(E){const t=$.c(27),{value:s,onValueChange:y,options:o,size:C,fullWidth:L,className:z}=E,_=C===void 0?"sm":C,b=L===void 0?!1:L;let h;t[0]===Symbol.for("react.memo_cache_sentinel")?(h=[],t[0]=h):h=t[0];const R=T.useRef(h);let x;t[1]===Symbol.for("react.memo_cache_sentinel")?(x={left:0,width:0,opacity:0},t[1]=x):x=t[1];const[f,S]=T.useState(x);let g,p;t[2]!==o||t[3]!==s?(g=()=>{const e=o.findIndex(j=>j.value===s),m=R.current[e];m&&S({left:m.offsetLeft,width:m.offsetWidth,opacity:1})},p=[s,o],t[2]=o,t[3]=s,t[4]=g,t[5]=p):(g=t[4],p=t[5]),T.useEffect(g,p);const l=M[_];let n;t[6]!==z?(n=d("relative flex gap-0 bg-muted classic:rounded-lg compact:rounded-full",z),t[6]=z,t[7]=n):n=t[7];let a;t[8]!==l||t[9]!==b||t[10]!==y||t[11]!==o||t[12]!==s?(a=o.map((e,m)=>{const j=i.jsxs("button",{ref:V=>{R.current[m]=V},type:"button",onClick:()=>y(e.value),"aria-label":e.label,className:d("relative z-10 flex items-center justify-center gap-2 classic:rounded-lg compact:rounded-full transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",b?"flex-1 h-12 px-4":e.label?d(l.buttonWithLabel,"px-3"):l.button),children:[i.jsx("span",{className:d("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",l.icon,s===e.value?"text-foreground":"text-muted-foreground"),children:e.icon}),e.label&&i.jsx("span",{className:d("text-xs transition-colors ease-out duration-200 whitespace-nowrap",s===e.value?"text-foreground":"text-muted-foreground"),children:e.label})]},e.value);return e.tooltip?i.jsxs(k,{children:[i.jsx(I,{asChild:!0,children:j}),i.jsx(P,{side:"bottom",children:e.tooltip})]},e.value):j}),t[8]=l,t[9]=b,t[10]=y,t[11]=o,t[12]=s,t[13]=a):a=t[13];const w=b?"h-12":l.button;let c;t[14]!==w?(c=d("absolute z-0 bg-background classic:rounded-lg compact:rounded-full border-shadow transition-all [transition-timing-function:var(--ease-out-cubic)] duration-200",w),t[14]=w,t[15]=c):c=t[15];const W=`${f.left}px`,N=`${f.width}px`;let r;t[16]!==f.opacity||t[17]!==W||t[18]!==N?(r={left:W,width:N,opacity:f.opacity},t[16]=f.opacity,t[17]=W,t[18]=N,t[19]=r):r=t[19];let u;t[20]!==c||t[21]!==r?(u=i.jsx("div",{className:c,style:r}),t[20]=c,t[21]=r,t[22]=u):u=t[22];let v;return t[23]!==u||t[24]!==n||t[25]!==a?(v=i.jsxs("div",{className:n,children:[a,u]}),t[23]=u,t[24]=n,t[25]=a,t[26]=v):v=t[26],v}export{B as V};
1
+ import{c as $,r as T,l as d,j as i}from"./index-CyBVTyGa.js";import{c as k,T as I,a as P}from"./tooltip-BjUMPvkB.js";const M={sm:{button:"size-7",buttonWithLabel:"h-7",icon:"size-4"},md:{button:"size-9",buttonWithLabel:"h-9",icon:"size-5"},lg:{button:"size-12",buttonWithLabel:"h-12",icon:"size-6"}};function B(E){const t=$.c(27),{value:s,onValueChange:y,options:o,size:C,fullWidth:L,className:z}=E,_=C===void 0?"sm":C,b=L===void 0?!1:L;let h;t[0]===Symbol.for("react.memo_cache_sentinel")?(h=[],t[0]=h):h=t[0];const R=T.useRef(h);let x;t[1]===Symbol.for("react.memo_cache_sentinel")?(x={left:0,width:0,opacity:0},t[1]=x):x=t[1];const[f,S]=T.useState(x);let g,p;t[2]!==o||t[3]!==s?(g=()=>{const e=o.findIndex(j=>j.value===s),m=R.current[e];m&&S({left:m.offsetLeft,width:m.offsetWidth,opacity:1})},p=[s,o],t[2]=o,t[3]=s,t[4]=g,t[5]=p):(g=t[4],p=t[5]),T.useEffect(g,p);const l=M[_];let n;t[6]!==z?(n=d("relative flex gap-0 bg-muted classic:rounded-lg compact:rounded-full",z),t[6]=z,t[7]=n):n=t[7];let a;t[8]!==l||t[9]!==b||t[10]!==y||t[11]!==o||t[12]!==s?(a=o.map((e,m)=>{const j=i.jsxs("button",{ref:V=>{R.current[m]=V},type:"button",onClick:()=>y(e.value),"aria-label":e.label,className:d("relative z-10 flex items-center justify-center gap-2 classic:rounded-lg compact:rounded-full transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",b?"flex-1 h-12 px-4":e.label?d(l.buttonWithLabel,"px-3"):l.button),children:[i.jsx("span",{className:d("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",l.icon,s===e.value?"text-foreground":"text-muted-foreground"),children:e.icon}),e.label&&i.jsx("span",{className:d("text-xs transition-colors ease-out duration-200 whitespace-nowrap",s===e.value?"text-foreground":"text-muted-foreground"),children:e.label})]},e.value);return e.tooltip?i.jsxs(k,{children:[i.jsx(I,{asChild:!0,children:j}),i.jsx(P,{side:"bottom",children:e.tooltip})]},e.value):j}),t[8]=l,t[9]=b,t[10]=y,t[11]=o,t[12]=s,t[13]=a):a=t[13];const w=b?"h-12":l.button;let c;t[14]!==w?(c=d("absolute z-0 bg-background classic:rounded-lg compact:rounded-full border-shadow transition-all [transition-timing-function:var(--ease-out-cubic)] duration-200",w),t[14]=w,t[15]=c):c=t[15];const W=`${f.left}px`,N=`${f.width}px`;let r;t[16]!==f.opacity||t[17]!==W||t[18]!==N?(r={left:W,width:N,opacity:f.opacity},t[16]=f.opacity,t[17]=W,t[18]=N,t[19]=r):r=t[19];let u;t[20]!==c||t[21]!==r?(u=i.jsx("div",{className:c,style:r}),t[20]=c,t[21]=r,t[22]=u):u=t[22];let v;return t[23]!==u||t[24]!==n||t[25]!==a?(v=i.jsxs("div",{className:n,children:[a,u]}),t[23]=u,t[24]=n,t[25]=a,t[26]=v):v=t[26],v}export{B as V};
@@ -1 +1 @@
1
- import{an as t,ao as e,aH as l,bN as a,bL as s,bM as o,cV as c,bO as d,dS as I,cX as A,bP as g}from"./index-doEaURqC.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."}),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};
1
+ import{an as t,ao as e,aH as l,bP as a,bN as s,bO as o,cX as c,bQ as d,dT as I,cZ as A,bR as g}from"./index-CyBVTyGa.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,T=50,C=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."}),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(C).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.")},x=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]=x.parse(b)}catch{}return r}const W=d(e().describe("userId"),d(e().describe("branch"),I(K,x))),Z=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")}),Y=a(Z).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(T).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:Y,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")}),M=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(M).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(M).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,T 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-doEaURqC.js"></script>
54
- <link rel="stylesheet" crossorigin href="/assets/index-xA_kfo6T.css">
53
+ <script type="module" crossorigin src="/assets/index-CyBVTyGa.js"></script>
54
+ <link rel="stylesheet" crossorigin href="/assets/index-B88q0man.css">
55
55
  </head>
56
56
  <body>
57
57
  <div id="root"></div>
@@ -2104,7 +2104,7 @@ Usage: deco services <up|down|status>`),process.exit(1)}}var F8$=L(()=>{Vh()});f
2104
2104
  `.execute($);if(Number(W.rows[0]?.cnt)===0){console.warn(`Failed to migrate ${G}/${K}, keeping in old table`);continue}}await Zl`
2105
2105
  DELETE FROM kysely_migration WHERE name = ${Q}
2106
2106
  `.execute($)}}async function hZ$($){await k34($),await S34($);let Z=new yZ$({db:$,provider:{getMigrations:()=>Promise.resolve(h01)}}),{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 C34($){let{keepOpen:Z=!1,database:Q,skipBetterAuth:X=!1}=$??{},Y="skipped";if(!X&&!Q)Y=await so0();let J=Q??K8(),G=async()=>{if(!Z&&!Q)await xD(J).catch((K)=>{console.warn("Warning: Error closing database:",K)})};try{let K=await hZ$(J.db);return await G(),{betterAuth:Y,kysely:K}}catch(K){throw await G(),K}}async function _34(){let $=K8(),Z=new yZ$({db:$.db,provider:{getMigrations:()=>Promise.resolve(h01)}}),{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 lZ$=L(()=>{bZ$();eo0();NX()});async function nG0($){let Z={...process.env},Q=bZ0($,Z);console.log(NI1(Q.settings.encryptionKey));let X=Q.settings.betterAuthSecret||(Q.settings.localMode?c4$(Q.settings.dataDir):""),{ensureServices:Y}=await Promise.resolve().then(() => (tJ0(),nJ0)),{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(() => (eo0(),d4$));await W(J.databaseUrl);let{createDatabase:H}=await Promise.resolve().then(() => (NX(),G4$)),{migrateToLatest:F}=await Promise.resolve().then(() => (lZ$(),uZ$)),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 U8$(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 u01=L(()=>{Vh();m4$();H$()});var iZ$={};K0(iZ$,{updateService:()=>oP,subscribeCliState:()=>m01,setTuiConsoleIntercepted:()=>tG0,setServerUrl:()=>fr,setMigrationsDone:()=>xr,setDevMode:()=>x34,resetCliStateForTests:()=>v34,isTuiConsoleIntercepted:()=>oG0,getCliState:()=>c01,addLogEntry:()=>uD});function cZ$(){return[{name:"Postgres",status:"pending",port:0},{name:"NATS",status:"pending",port:0}]}function mZ$(){return{services:cZ$(),migrationsStatus:"pending",serverUrl:null,logs:[]}}function v34(){JJ=mZ$()}function vr(){for(let $ of l01)$()}function c01(){return JJ}function m01($){return l01.add($),()=>l01.delete($)}function oP($){JJ={...JJ,services:JJ.services.map((Z)=>Z.name===$.name?$:Z)},vr()}function xr(){JJ={...JJ,migrationsStatus:"done"},vr()}function fr($){JJ={...JJ,serverUrl:$},vr()}function uD($){let Z=[...JJ.logs,$];JJ={...JJ,logs:Z.length>500?Z.slice(-500):Z},vr()}function x34(){JJ={...JJ,services:[...cZ$(),{name:"API",status:"pending",port:0},{name:"Vite",status:"pending",port:0}]},vr()}function tG0($){dZ$=$}function oG0(){return dZ$}var JJ,l01,dZ$=!1;var rP=L(()=>{JJ=mZ$();l01=new Set});import{createServer as pZ$}from"net";function f34($){return new Promise((Z)=>{let Q=pZ$();Q.once("error",()=>Z(!1)),Q.listen($,"0.0.0.0",()=>{Q.close(()=>Z(!0))})})}async function br($){if(await f34($))return $;let Z=await new Promise((Q,X)=>{let Y=pZ$();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 d01=()=>{};var p01={};K0(p01,{startDevServer:()=>y34,pipeToLogStore:()=>i01});import{join as b34}from"path";function i01($){let Z=$.getReader(),Q=new TextDecoder,X="";function Y(){let J=X.split(`
2107
- `);X=J.pop()??"";for(let G of J){let K=Bun.stripANSI(G).replace(/^\[\d+\]\s*/,"").trim();if(!K)continue;uD({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)uD({method:"",path:"",status:0,duration:0,timestamp:new Date,rawLine:J})}})()}async function y34($){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 br(Number(Y)+1):await br(Number($.port)),{settings:K,services:W,managedServiceNames:H}=await nG0({port:String(G),home:$.home,baseUrl:$.baseUrl,localMode:$.localMode,skipMigrations:$.skipMigrations,noTui:$.noTui,vitePort:$.vitePort});for(let D of W)oP({name:D.name,status:"ready",port:D.port});xr();let F=b34(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)i01(N.stdout),i01(N.stderr);fr(J),oP({name:"Vite",status:"ready",port:Number(Y)}),oP({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(() => (tJ0(),nJ0));await w(K.dataDir)}};return process.on("SIGINT",()=>O("SIGINT")),process.on("SIGTERM",()=>O("SIGTERM")),{port:Number(Y),process:N}}var n01=L(()=>{u01();rP();d01()});var rG0;var t01=L(()=>{rG0={name:"decocms",version:"4.388.4",description:"Deco CMS \u2014 Self-hostable MCP Gateway for managing AI connections and tools",author:"Deco team",repository:{type:"git",url:"git+https://github.com/decocms/studio.git",directory:"apps/api"},bugs:{url:"https://github.com/decocms/studio/issues"},type:"module",bin:{deco:"./dist/server/cli.js"},files:["dist/**/*"],scripts:{dev:"bun run migrate && bun run dev:server","dev:server":"bun run --cwd=../../packages/sandbox build && NODE_ENV=development bun --env-file=.env --hot run src/index.ts",build:"bun run build:server","build:server":"bun run scripts/bundle-server-script.ts --dist ./dist/server","generate:tool-contracts":"bun run scripts/generate-tool-contracts.ts","db:migrate":"bun run ./dist/server/migrate.js","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 h34,Text as nZ$}from"ink";import{jsx as u34,jsxs as tZ$}from"react/jsx-runtime";function oZ$({version:$}){return tZ$(h34,{flexDirection:"column",marginTop:1,children:[wG0.map((Z,Q)=>u34(nZ$,{color:jG0[Q],children:Z},Q)),tZ$(nZ$,{dimColor:!0,children:[" v",$]})]})}var rZ$=L(()=>{jr()});import{Box as aP,Text as lD}from"ink";import{Spinner as l34}from"@inkjs/ui";import{jsx as RG,jsxs as Ql}from"react/jsx-runtime";function aZ$({status:$}){if($==="pending")return RG(l34,{label:""});return RG(lD,{color:"green",children:"\u2713"})}function c34($){return`${$.name}: ${$.port||"...."}`}function sZ$({services:$,migrationsStatus:Z,home:Q,serverUrl:X}){return Ql(aP,{flexDirection:"column",paddingBottom:1,children:[RG(oZ$,{version:rG0.version}),RG(aP,{marginBottom:1,children:RG(lD,{dimColor:!0,children:"\u2500".repeat(80)})}),RG(aP,{children:Ql(lD,{dimColor:!0,children:["Home: ",Q]})}),Ql(aP,{gap:2,children:[$.map((Y)=>Ql(aP,{gap:1,children:[RG(lD,{children:c34(Y)}),RG(aZ$,{status:Y.status})]},Y.name)),Ql(aP,{gap:1,children:[RG(lD,{children:"Migrations"}),RG(aZ$,{status:Z})]})]}),RG(aP,{children:X?Ql(lD,{children:["Open in browser: ",RG(lD,{color:"cyan",children:X})]}):RG(lD,{dimColor:!0,children:"Starting..."})})]})}var eZ$=L(()=>{t01();rZ$()});import{Box as m34,Text as yr}from"ink";import{jsx as o01,jsxs as r01}from"react/jsx-runtime";function d34($){if($>=500)return"red";if($>=400)return"yellow";if($>=300)return"cyan";return"green"}function $7$({logs:$}){return o01(m34,{flexDirection:"column",children:$.map((Z,Q)=>{if(Z.rawLine)return o01(yr,{dimColor:!0,children:Z.rawLine},Q);let X=Z.duration<1000?`${Z.duration}ms`:`${(Z.duration/1000).toFixed(1)}s`;return r01(yr,{children:[r01(yr,{dimColor:!0,children:[Z.method.padEnd(6)," ",Z.path.padEnd(30)," "]}),o01(yr,{color:d34(Z.status),children:Z.status}),r01(yr,{dimColor:!0,children:[" ",X.padStart(8)]})]},Q)})})}var Z7$=()=>{};var a01={};K0(a01,{App:()=>n34});import{Box as i34}from"ink";import{useSyncExternalStore as p34}from"react";import{jsx as Q7$,jsxs as t34}from"react/jsx-runtime";function n34({home:$}){let Z=p34(m01,c01);return t34(i34,{flexDirection:"column",children:[Q7$(sZ$,{services:Z.services,migrationsStatus:Z.migrationsStatus,home:$,serverUrl:Z.serverUrl}),Q7$($7$,{logs:Z.logs})]})}var s01=L(()=>{eZ$();Z7$();rP()});var $K="thread-gate",RB="decopilot-hosted-harness",qB="decopilot-hosted-harness-sandboxed",ZK="automations",cD="background-tools",sP="task-board-github-reads";var X7$="13";function Y7$($){return{name:"decocms",systemDatabaseUrl:$.systemDatabaseUrl,systemDatabaseSchemaName:"dbos",systemDatabasePoolSize:$.poolSize,runAdminServer:!1,executorID:$.executorID,applicationVersion:X7$,...$.listenQueues!==void 0?{listenQueues:$.listenQueues}:{}}}var J7$=()=>{};import o34 from"pg";async function K7$($,Z){let{databaseUrl:Q,lockTimeoutMs:X=r34}=$,Y=$.log??((W)=>console.log(W)),J=new o34.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",[G7$.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 k$(a34)}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)",[G7$.toString()])}catch{}await J.end().catch(()=>{})}}var G7$=8314027461559302n,r34=600000,a34=500;var W7$=L(()=>{w8()});function s34(){let $=(process.env.BUN_OPTIONS??"").split(/\s+/).filter(Boolean);return[...process.argv.slice(1),...$]}function e01($,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 H7$(){let $=s34();if($.includes("--cpu-prof")){console.log(JSON.stringify({msg:"cpu-profiling-active",dir:e01($,"--cpu-prof-dir")??process.cwd(),name:e01($,"--cpu-prof-name"),markdown:$.includes("--cpu-prof-md"),intervalUs:Number(e01($,"--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 F7$(){if(process.env.HEAP_WATCH!=="1")return()=>{};let $=Number(process.env.HEAP_WATCH_INTERVAL_MS??60000),Z=async()=>{let Q=iP();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(()=>{}),aG0=setInterval(()=>void Z().catch(()=>{}),$),aG0.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(aG0)clearInterval(aG0)}}var aG0;var U7$=()=>{};import*as e34 from"bun:jsc";function N7$(){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{$K4()}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=ZK4()?.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 $K4,ZK4;var B7$=L(()=>{({startSamplingProfiler:$K4,samplingProfilerStackTraces:ZK4}=e34)});function L7$(){H7$();let $=[F7$(),s8$(),N7$()];return()=>{for(let Z of $)Z()}}var O7$=L(()=>{do0();U7$();B7$()});var eP=b((D7$)=>{Object.defineProperty(D7$,"__esModule",{value:!0});D7$.RepublishHeaders=D7$.DirectMsgHeaders=D7$.JsHeaders=D7$.AdvisoryKind=void 0;D7$.isOrderedPushConsumerOptions=QK4;D7$.isPullConsumer=XK4;D7$.isPushConsumer=YK4;D7$.isBoundPushConsumerOptions=JK4;function QK4($){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 XK4($){return $.isPullConsumer()}function YK4($){return $.isPushConsumer()}function JK4($){if($&&typeof $==="object")return"deliver_subject"in $||"deliver_group"in $||"idle_heartbeat"in $;return!1}D7$.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"};D7$.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"};D7$.DirectMsgHeaders={Stream:"Nats-Stream",Sequence:"Nats-Sequence",TimeStamp:"Nats-Time-Stamp",Subject:"Nats-Subject",LastSequence:"Nats-Last-Sequence",NumPending:"Nats-Num-Pending"};D7$.RepublishHeaders={Stream:"Nats-Stream",Subject:"Nats-Subject",Sequence:"Nats-Sequence",LastSequence:"Nats-Last-Sequence",Size:"Nats-Msg-Size"}});var qG=b((j7$)=>{Object.defineProperty(j7$,"__esModule",{value:!0});j7$.TD=j7$.TE=j7$.Empty=void 0;j7$.encode=LK4;j7$.decode=OK4;j7$.Empty=new Uint8Array(0);j7$.TE=new TextEncoder;j7$.TD=new TextDecoder;function BK4(...$){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 LK4(...$){let Z=[];for(let Q=0;Q<$.length;Q++)Z.push(j7$.TE.encode($[Q]));if(Z.length===0)return j7$.Empty;if(Z.length===1)return Z[0];return BK4(...Z)}function OK4($){if(!$||$.length===0)return"";return j7$.TD.decode($)}});var MG=b((P7$)=>{Object.defineProperty(P7$,"__esModule",{value:!0});P7$.errors=P7$.PermissionViolationError=P7$.NoRespondersError=P7$.TimeoutError=P7$.RequestError=P7$.ProtocolError=P7$.ConnectionError=P7$.DrainingConnectionError=P7$.ClosedConnectionError=P7$.AuthorizationError=P7$.UserAuthenticationExpiredError=P7$.InvalidOperationError=P7$.InvalidArgumentError=P7$.InvalidSubjectError=void 0;class Z11 extends Error{constructor($,Z){super(`illegal subject: '${$}'`,Z);this.name="InvalidSubjectError"}}P7$.InvalidSubjectError=Z11;class sG0 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 sG0(`${$} ${Z}`,Q)}}P7$.InvalidArgumentError=sG0;class Q11 extends Error{constructor($,Z){super($,Z);this.name="InvalidOperationError"}}P7$.InvalidOperationError=Q11;class eG0 extends Error{constructor($,Z){super($,Z);this.name="UserAuthenticationExpiredError"}static parse($){if($.toLowerCase().indexOf("user authentication expired")!==-1)return new eG0($);return null}}P7$.UserAuthenticationExpiredError=eG0;class $30 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 $30($);return null}}P7$.AuthorizationError=$30;class X11 extends Error{constructor(){super("closed connection");this.name="ClosedConnectionError"}}P7$.ClosedConnectionError=X11;class Y11 extends Error{constructor(){super("connection draining");this.name="DrainingConnectionError"}}P7$.DrainingConnectionError=Y11;class J11 extends Error{constructor($,Z){super($,Z);this.name="ConnectionError"}}P7$.ConnectionError=J11;class G11 extends Error{constructor($,Z){super($,Z);this.name="ProtocolError"}}P7$.ProtocolError=G11;class K11 extends Error{constructor($="",Z){super($,Z);this.name="RequestError"}isNoResponders(){return this.cause instanceof Z30}}P7$.RequestError=K11;class W11 extends Error{constructor($){super("timeout",$);this.name="TimeoutError"}}P7$.TimeoutError=W11;class Z30 extends Error{subject;constructor($,Z){super(`no responders: '${$}'`,Z);this.subject=$,this.name="NoResponders"}}P7$.NoRespondersError=Z30;class Q30 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 Q30($,Q,X,Y)}}P7$.PermissionViolationError=Q30;P7$.errors={AuthorizationError:$30,ClosedConnectionError:X11,ConnectionError:J11,DrainingConnectionError:Y11,InvalidArgumentError:sG0,InvalidOperationError:Q11,InvalidSubjectError:Z11,NoRespondersError:Z30,PermissionViolationError:Q30,ProtocolError:G11,RequestError:K11,TimeoutError:W11,UserAuthenticationExpiredError:eG0}});var yW=b((M7$)=>{Object.defineProperty(M7$,"__esModule",{value:!0});M7$.SimpleMutex=M7$.Perf=void 0;M7$.extend=_K4;M7$.render=vK4;M7$.timeout=xK4;M7$.delay=fK4;M7$.deadline=bK4;M7$.deferred=F11;M7$.debugDeferred=yK4;M7$.shuffle=gK4;M7$.collect=hK4;M7$.jitter=q7$;M7$.backoff=uK4;M7$.nanos=lK4;M7$.millis=cK4;M7$.randomToken=iK4;var CK4=qG(),H11=MG();function _K4($,...Z){for(let Q=0;Q<Z.length;Q++){let X=Z[Q];Object.keys(X).forEach(function(Y){$[Y]=X[Y]})}return $}function vK4($){return CK4.TD.decode($).replace(/\n/g,"\u240A").replace(/\r/g,"\u240D")}function xK4($,Z=!0){let Q=Z?new H11.TimeoutError:null,X,Y,J=new Promise((G,K)=>{X={cancel:()=>{if(Y)clearTimeout(Y)}},Y=setTimeout(()=>{if(Q===null)K(new H11.TimeoutError);else K(Q)},$)});return Object.assign(J,X)}function fK4($=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 bK4($,Z=1000){let Q=F11(),X=setTimeout(()=>{Q.reject(new H11.TimeoutError)},Z);try{return await Promise.race([$,Q])}finally{clearTimeout(X)}}function F11(){let $={},Z=new Promise((Q,X)=>{$={resolve:Q,reject:X}});return Object.assign(Z,$)}function yK4(){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 gK4($){for(let Z=$.length-1;Z>0;Z--){let Q=Math.floor(Math.random()*(Z+1));[$[Z],$[Q]]=[$[Q],$[Z]]}return $}async function hK4($){let Z=[];for await(let Q of $)Z.push(Q);return Z}class A7${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})}),$}}M7$.Perf=A7$;class R7${max;current;waiting;constructor($=1){this.max=$,this.current=0,this.waiting=[]}lock(){if(this.current++,this.current<=this.max)return Promise.resolve();let $=F11();return this.waiting.push($),$}unlock(){this.current--,this.waiting.pop()?.resolve()}}M7$.SimpleMutex=R7$;function q7$($){if($===0)return 0;return Math.floor($/2+Math.random()*$)}function uK4($=[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 q7$(Q>Z?$[Z]:$[Q])}}}function lK4($){return $*1e6}function cK4($){return Math.floor($/1e6)}var mK4="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",MB=new Uint8Array(62);for(let $=0;$<62;$++)MB[$]=mK4.charCodeAt($);var dK4=218340105584896;function iK4(){let $=Math.floor(Math.random()*dK4),Z=$%62,Q=MB[Z];$=($-Z)/62,Z=$%62;let X=MB[Z];$=($-Z)/62,Z=$%62;let Y=MB[Z];$=($-Z)/62,Z=$%62;let J=MB[Z];$=($-Z)/62,Z=$%62;let G=MB[Z];$=($-Z)/62,Z=$%62;let K=MB[Z];$=($-Z)/62,Z=$%62;let W=MB[Z];$=($-Z)/62;let H=MB[$];return String.fromCharCode(Q,X,Y,J,G,K,W,H)}});var x7$=b((_7$)=>{Object.defineProperty(_7$,"__esModule",{value:!0});_7$.nuid=_7$.NuidImpl=void 0;var KW4="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",mD=62,Y30=12,S7$=10,V7$=33,WW4=333,k7$=Y30+S7$,N11=new Uint8Array(mD);for(let $=0;$<mD;$++)N11[$]=KW4.charCodeAt($);var X30=4294967296,C7$=BigInt(mD)**BigInt(S7$),gr=Number(C7$/(1n<<32n)),U11=Number(C7$%(1n<<32n));function HW4($){for(let Z=0;Z<$.length;Z++)$[Z]=Math.floor(Math.random()*256)}function FW4($){if(globalThis?.crypto?.getRandomValues)globalThis.crypto.getRandomValues($);else HW4($)}class B11{buf;cbuf;seqHi;seqLo;inc;inited;constructor(){this.buf=new Uint8Array(k7$),this.cbuf=new Uint8Array(Y30),this.inited=!1}init(){this.inited=!0,this.setPre(),this.initSeqAndInc(),this.fillSeq()}initSeqAndInc(){let $=0;do this.seqHi=Math.floor(Math.random()*(gr+1)),this.seqLo=Math.floor(Math.random()*X30);while($++<8&&this.seqHi===gr&&this.seqLo>=U11);if(this.seqHi===gr&&this.seqLo>=U11)this.seqLo=0;this.inc=Math.random()*(WW4-V7$)+V7$|0}setPre(){FW4(this.cbuf);for(let $=0;$<Y30;$++)this.buf[$]=N11[this.cbuf[$]%mD]}fillSeq(){let $=this.seqHi,Z=this.seqLo;for(let Q=k7$-1;Q>=Y30;Q--){let X=Math.floor($/mD),J=($-X*mD)*X30+Z,G=Math.floor(J/mD),K=J-G*mD;this.buf[Q]=N11[K],$=X,Z=G}}next(){if(!this.inited)this.init();if(this.seqLo+=this.inc,this.seqLo>=X30)this.seqLo-=X30,this.seqHi+=1;if(this.seqHi>gr||this.seqHi===gr&&this.seqLo>=U11)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()}}_7$.NuidImpl=B11;_7$.nuid=new B11});var g7$=b((b7$)=>{Object.defineProperty(b7$,"__esModule",{value:!0});b7$.nuid=b7$.Nuid=void 0;var f7$=x7$();b7$.Nuid=f7$.NuidImpl;b7$.nuid=f7$.nuid});var G30=b((J30)=>{Object.defineProperty(J30,"__esModule",{value:!0});J30.nuid=J30.Nuid=void 0;var h7$=g7$();Object.defineProperty(J30,"Nuid",{enumerable:!0,get:function(){return h7$.Nuid}});Object.defineProperty(J30,"nuid",{enumerable:!0,get:function(){return h7$.nuid}})});var dD=b((u7$)=>{Object.defineProperty(u7$,"__esModule",{value:!0});u7$.DEFAULT_HOST=u7$.DEFAULT_PORT=u7$.Match=void 0;u7$.syncIterator=DW4;u7$.createInbox=wW4;var LW4=G30(),OW4=MG();u7$.Match={Exact:"exact",CanonicalMIME:"canonical",IgnoreCase:"insensitive"};function DW4($){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 wW4($=""){if($=$||"_INBOX",typeof $!=="string")throw TypeError("prefix must be a string");return $.split(".").forEach((Z)=>{if(Z==="*"||Z===">")throw OW4.InvalidArgumentError.format("prefix",`cannot have wildcards ('${$}')`)}),`${$}.${LW4.nuid.next()}`}u7$.DEFAULT_PORT=4222;u7$.DEFAULT_HOST="127.0.0.1"});var hr=b((d7$)=>{Object.defineProperty(d7$,"__esModule",{value:!0});d7$.DataBuffer=void 0;var c7$=qG();class m7${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 c7$.TE.encode($)}static toAscii($){return c7$.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}}d7$.DataBuffer=m7$});var $T=b((n7$)=>{Object.defineProperty(n7$,"__esModule",{value:!0});n7$.LF=n7$.CR=n7$.CRLF=n7$.CR_LF_LEN=n7$.CR_LF=void 0;n7$.setTransportFactory=qW4;n7$.defaultPort=MW4;n7$.getUrlParseFn=IW4;n7$.newTransport=VW4;n7$.getResolveFn=kW4;n7$.protoLen=p7$;n7$.extractProtocolMessage=SW4;var TW4=qG(),AW4=dD(),RW4=hr(),IG;function qW4($){IG=$}function MW4(){return IG!==void 0&&IG.defaultPort!==void 0?IG.defaultPort:AW4.DEFAULT_PORT}function IW4(){return IG!==void 0&&IG.urlParseFn?IG.urlParseFn:void 0}function VW4(){if(!IG||typeof IG.factory!=="function")throw Error("transport fn is not set");return IG.factory()}function kW4(){return IG!==void 0&&IG.dnsResolveFn?IG.dnsResolveFn:void 0}n7$.CR_LF=`\r
2107
+ `);X=J.pop()??"";for(let G of J){let K=Bun.stripANSI(G).replace(/^\[\d+\]\s*/,"").trim();if(!K)continue;uD({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)uD({method:"",path:"",status:0,duration:0,timestamp:new Date,rawLine:J})}})()}async function y34($){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 br(Number(Y)+1):await br(Number($.port)),{settings:K,services:W,managedServiceNames:H}=await nG0({port:String(G),home:$.home,baseUrl:$.baseUrl,localMode:$.localMode,skipMigrations:$.skipMigrations,noTui:$.noTui,vitePort:$.vitePort});for(let D of W)oP({name:D.name,status:"ready",port:D.port});xr();let F=b34(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)i01(N.stdout),i01(N.stderr);fr(J),oP({name:"Vite",status:"ready",port:Number(Y)}),oP({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(() => (tJ0(),nJ0));await w(K.dataDir)}};return process.on("SIGINT",()=>O("SIGINT")),process.on("SIGTERM",()=>O("SIGTERM")),{port:Number(Y),process:N}}var n01=L(()=>{u01();rP();d01()});var rG0;var t01=L(()=>{rG0={name:"decocms",version:"4.389.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 h34,Text as nZ$}from"ink";import{jsx as u34,jsxs as tZ$}from"react/jsx-runtime";function oZ$({version:$}){return tZ$(h34,{flexDirection:"column",marginTop:1,children:[wG0.map((Z,Q)=>u34(nZ$,{color:jG0[Q],children:Z},Q)),tZ$(nZ$,{dimColor:!0,children:[" v",$]})]})}var rZ$=L(()=>{jr()});import{Box as aP,Text as lD}from"ink";import{Spinner as l34}from"@inkjs/ui";import{jsx as RG,jsxs as Ql}from"react/jsx-runtime";function aZ$({status:$}){if($==="pending")return RG(l34,{label:""});return RG(lD,{color:"green",children:"\u2713"})}function c34($){return`${$.name}: ${$.port||"...."}`}function sZ$({services:$,migrationsStatus:Z,home:Q,serverUrl:X}){return Ql(aP,{flexDirection:"column",paddingBottom:1,children:[RG(oZ$,{version:rG0.version}),RG(aP,{marginBottom:1,children:RG(lD,{dimColor:!0,children:"\u2500".repeat(80)})}),RG(aP,{children:Ql(lD,{dimColor:!0,children:["Home: ",Q]})}),Ql(aP,{gap:2,children:[$.map((Y)=>Ql(aP,{gap:1,children:[RG(lD,{children:c34(Y)}),RG(aZ$,{status:Y.status})]},Y.name)),Ql(aP,{gap:1,children:[RG(lD,{children:"Migrations"}),RG(aZ$,{status:Z})]})]}),RG(aP,{children:X?Ql(lD,{children:["Open in browser: ",RG(lD,{color:"cyan",children:X})]}):RG(lD,{dimColor:!0,children:"Starting..."})})]})}var eZ$=L(()=>{t01();rZ$()});import{Box as m34,Text as yr}from"ink";import{jsx as o01,jsxs as r01}from"react/jsx-runtime";function d34($){if($>=500)return"red";if($>=400)return"yellow";if($>=300)return"cyan";return"green"}function $7$({logs:$}){return o01(m34,{flexDirection:"column",children:$.map((Z,Q)=>{if(Z.rawLine)return o01(yr,{dimColor:!0,children:Z.rawLine},Q);let X=Z.duration<1000?`${Z.duration}ms`:`${(Z.duration/1000).toFixed(1)}s`;return r01(yr,{children:[r01(yr,{dimColor:!0,children:[Z.method.padEnd(6)," ",Z.path.padEnd(30)," "]}),o01(yr,{color:d34(Z.status),children:Z.status}),r01(yr,{dimColor:!0,children:[" ",X.padStart(8)]})]},Q)})})}var Z7$=()=>{};var a01={};K0(a01,{App:()=>n34});import{Box as i34}from"ink";import{useSyncExternalStore as p34}from"react";import{jsx as Q7$,jsxs as t34}from"react/jsx-runtime";function n34({home:$}){let Z=p34(m01,c01);return t34(i34,{flexDirection:"column",children:[Q7$(sZ$,{services:Z.services,migrationsStatus:Z.migrationsStatus,home:$,serverUrl:Z.serverUrl}),Q7$($7$,{logs:Z.logs})]})}var s01=L(()=>{eZ$();Z7$();rP()});var $K="thread-gate",RB="decopilot-hosted-harness",qB="decopilot-hosted-harness-sandboxed",ZK="automations",cD="background-tools",sP="task-board-github-reads";var X7$="13";function Y7$($){return{name:"decocms",systemDatabaseUrl:$.systemDatabaseUrl,systemDatabaseSchemaName:"dbos",systemDatabasePoolSize:$.poolSize,runAdminServer:!1,executorID:$.executorID,applicationVersion:X7$,...$.listenQueues!==void 0?{listenQueues:$.listenQueues}:{}}}var J7$=()=>{};import o34 from"pg";async function K7$($,Z){let{databaseUrl:Q,lockTimeoutMs:X=r34}=$,Y=$.log??((W)=>console.log(W)),J=new o34.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",[G7$.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 k$(a34)}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)",[G7$.toString()])}catch{}await J.end().catch(()=>{})}}var G7$=8314027461559302n,r34=600000,a34=500;var W7$=L(()=>{w8()});function s34(){let $=(process.env.BUN_OPTIONS??"").split(/\s+/).filter(Boolean);return[...process.argv.slice(1),...$]}function e01($,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 H7$(){let $=s34();if($.includes("--cpu-prof")){console.log(JSON.stringify({msg:"cpu-profiling-active",dir:e01($,"--cpu-prof-dir")??process.cwd(),name:e01($,"--cpu-prof-name"),markdown:$.includes("--cpu-prof-md"),intervalUs:Number(e01($,"--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 F7$(){if(process.env.HEAP_WATCH!=="1")return()=>{};let $=Number(process.env.HEAP_WATCH_INTERVAL_MS??60000),Z=async()=>{let Q=iP();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(()=>{}),aG0=setInterval(()=>void Z().catch(()=>{}),$),aG0.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(aG0)clearInterval(aG0)}}var aG0;var U7$=()=>{};import*as e34 from"bun:jsc";function N7$(){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{$K4()}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=ZK4()?.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 $K4,ZK4;var B7$=L(()=>{({startSamplingProfiler:$K4,samplingProfilerStackTraces:ZK4}=e34)});function L7$(){H7$();let $=[F7$(),s8$(),N7$()];return()=>{for(let Z of $)Z()}}var O7$=L(()=>{do0();U7$();B7$()});var eP=b((D7$)=>{Object.defineProperty(D7$,"__esModule",{value:!0});D7$.RepublishHeaders=D7$.DirectMsgHeaders=D7$.JsHeaders=D7$.AdvisoryKind=void 0;D7$.isOrderedPushConsumerOptions=QK4;D7$.isPullConsumer=XK4;D7$.isPushConsumer=YK4;D7$.isBoundPushConsumerOptions=JK4;function QK4($){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 XK4($){return $.isPullConsumer()}function YK4($){return $.isPushConsumer()}function JK4($){if($&&typeof $==="object")return"deliver_subject"in $||"deliver_group"in $||"idle_heartbeat"in $;return!1}D7$.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"};D7$.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"};D7$.DirectMsgHeaders={Stream:"Nats-Stream",Sequence:"Nats-Sequence",TimeStamp:"Nats-Time-Stamp",Subject:"Nats-Subject",LastSequence:"Nats-Last-Sequence",NumPending:"Nats-Num-Pending"};D7$.RepublishHeaders={Stream:"Nats-Stream",Subject:"Nats-Subject",Sequence:"Nats-Sequence",LastSequence:"Nats-Last-Sequence",Size:"Nats-Msg-Size"}});var qG=b((j7$)=>{Object.defineProperty(j7$,"__esModule",{value:!0});j7$.TD=j7$.TE=j7$.Empty=void 0;j7$.encode=LK4;j7$.decode=OK4;j7$.Empty=new Uint8Array(0);j7$.TE=new TextEncoder;j7$.TD=new TextDecoder;function BK4(...$){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 LK4(...$){let Z=[];for(let Q=0;Q<$.length;Q++)Z.push(j7$.TE.encode($[Q]));if(Z.length===0)return j7$.Empty;if(Z.length===1)return Z[0];return BK4(...Z)}function OK4($){if(!$||$.length===0)return"";return j7$.TD.decode($)}});var MG=b((P7$)=>{Object.defineProperty(P7$,"__esModule",{value:!0});P7$.errors=P7$.PermissionViolationError=P7$.NoRespondersError=P7$.TimeoutError=P7$.RequestError=P7$.ProtocolError=P7$.ConnectionError=P7$.DrainingConnectionError=P7$.ClosedConnectionError=P7$.AuthorizationError=P7$.UserAuthenticationExpiredError=P7$.InvalidOperationError=P7$.InvalidArgumentError=P7$.InvalidSubjectError=void 0;class Z11 extends Error{constructor($,Z){super(`illegal subject: '${$}'`,Z);this.name="InvalidSubjectError"}}P7$.InvalidSubjectError=Z11;class sG0 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 sG0(`${$} ${Z}`,Q)}}P7$.InvalidArgumentError=sG0;class Q11 extends Error{constructor($,Z){super($,Z);this.name="InvalidOperationError"}}P7$.InvalidOperationError=Q11;class eG0 extends Error{constructor($,Z){super($,Z);this.name="UserAuthenticationExpiredError"}static parse($){if($.toLowerCase().indexOf("user authentication expired")!==-1)return new eG0($);return null}}P7$.UserAuthenticationExpiredError=eG0;class $30 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 $30($);return null}}P7$.AuthorizationError=$30;class X11 extends Error{constructor(){super("closed connection");this.name="ClosedConnectionError"}}P7$.ClosedConnectionError=X11;class Y11 extends Error{constructor(){super("connection draining");this.name="DrainingConnectionError"}}P7$.DrainingConnectionError=Y11;class J11 extends Error{constructor($,Z){super($,Z);this.name="ConnectionError"}}P7$.ConnectionError=J11;class G11 extends Error{constructor($,Z){super($,Z);this.name="ProtocolError"}}P7$.ProtocolError=G11;class K11 extends Error{constructor($="",Z){super($,Z);this.name="RequestError"}isNoResponders(){return this.cause instanceof Z30}}P7$.RequestError=K11;class W11 extends Error{constructor($){super("timeout",$);this.name="TimeoutError"}}P7$.TimeoutError=W11;class Z30 extends Error{subject;constructor($,Z){super(`no responders: '${$}'`,Z);this.subject=$,this.name="NoResponders"}}P7$.NoRespondersError=Z30;class Q30 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 Q30($,Q,X,Y)}}P7$.PermissionViolationError=Q30;P7$.errors={AuthorizationError:$30,ClosedConnectionError:X11,ConnectionError:J11,DrainingConnectionError:Y11,InvalidArgumentError:sG0,InvalidOperationError:Q11,InvalidSubjectError:Z11,NoRespondersError:Z30,PermissionViolationError:Q30,ProtocolError:G11,RequestError:K11,TimeoutError:W11,UserAuthenticationExpiredError:eG0}});var yW=b((M7$)=>{Object.defineProperty(M7$,"__esModule",{value:!0});M7$.SimpleMutex=M7$.Perf=void 0;M7$.extend=_K4;M7$.render=vK4;M7$.timeout=xK4;M7$.delay=fK4;M7$.deadline=bK4;M7$.deferred=F11;M7$.debugDeferred=yK4;M7$.shuffle=gK4;M7$.collect=hK4;M7$.jitter=q7$;M7$.backoff=uK4;M7$.nanos=lK4;M7$.millis=cK4;M7$.randomToken=iK4;var CK4=qG(),H11=MG();function _K4($,...Z){for(let Q=0;Q<Z.length;Q++){let X=Z[Q];Object.keys(X).forEach(function(Y){$[Y]=X[Y]})}return $}function vK4($){return CK4.TD.decode($).replace(/\n/g,"\u240A").replace(/\r/g,"\u240D")}function xK4($,Z=!0){let Q=Z?new H11.TimeoutError:null,X,Y,J=new Promise((G,K)=>{X={cancel:()=>{if(Y)clearTimeout(Y)}},Y=setTimeout(()=>{if(Q===null)K(new H11.TimeoutError);else K(Q)},$)});return Object.assign(J,X)}function fK4($=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 bK4($,Z=1000){let Q=F11(),X=setTimeout(()=>{Q.reject(new H11.TimeoutError)},Z);try{return await Promise.race([$,Q])}finally{clearTimeout(X)}}function F11(){let $={},Z=new Promise((Q,X)=>{$={resolve:Q,reject:X}});return Object.assign(Z,$)}function yK4(){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 gK4($){for(let Z=$.length-1;Z>0;Z--){let Q=Math.floor(Math.random()*(Z+1));[$[Z],$[Q]]=[$[Q],$[Z]]}return $}async function hK4($){let Z=[];for await(let Q of $)Z.push(Q);return Z}class A7${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})}),$}}M7$.Perf=A7$;class R7${max;current;waiting;constructor($=1){this.max=$,this.current=0,this.waiting=[]}lock(){if(this.current++,this.current<=this.max)return Promise.resolve();let $=F11();return this.waiting.push($),$}unlock(){this.current--,this.waiting.pop()?.resolve()}}M7$.SimpleMutex=R7$;function q7$($){if($===0)return 0;return Math.floor($/2+Math.random()*$)}function uK4($=[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 q7$(Q>Z?$[Z]:$[Q])}}}function lK4($){return $*1e6}function cK4($){return Math.floor($/1e6)}var mK4="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",MB=new Uint8Array(62);for(let $=0;$<62;$++)MB[$]=mK4.charCodeAt($);var dK4=218340105584896;function iK4(){let $=Math.floor(Math.random()*dK4),Z=$%62,Q=MB[Z];$=($-Z)/62,Z=$%62;let X=MB[Z];$=($-Z)/62,Z=$%62;let Y=MB[Z];$=($-Z)/62,Z=$%62;let J=MB[Z];$=($-Z)/62,Z=$%62;let G=MB[Z];$=($-Z)/62,Z=$%62;let K=MB[Z];$=($-Z)/62,Z=$%62;let W=MB[Z];$=($-Z)/62;let H=MB[$];return String.fromCharCode(Q,X,Y,J,G,K,W,H)}});var x7$=b((_7$)=>{Object.defineProperty(_7$,"__esModule",{value:!0});_7$.nuid=_7$.NuidImpl=void 0;var KW4="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",mD=62,Y30=12,S7$=10,V7$=33,WW4=333,k7$=Y30+S7$,N11=new Uint8Array(mD);for(let $=0;$<mD;$++)N11[$]=KW4.charCodeAt($);var X30=4294967296,C7$=BigInt(mD)**BigInt(S7$),gr=Number(C7$/(1n<<32n)),U11=Number(C7$%(1n<<32n));function HW4($){for(let Z=0;Z<$.length;Z++)$[Z]=Math.floor(Math.random()*256)}function FW4($){if(globalThis?.crypto?.getRandomValues)globalThis.crypto.getRandomValues($);else HW4($)}class B11{buf;cbuf;seqHi;seqLo;inc;inited;constructor(){this.buf=new Uint8Array(k7$),this.cbuf=new Uint8Array(Y30),this.inited=!1}init(){this.inited=!0,this.setPre(),this.initSeqAndInc(),this.fillSeq()}initSeqAndInc(){let $=0;do this.seqHi=Math.floor(Math.random()*(gr+1)),this.seqLo=Math.floor(Math.random()*X30);while($++<8&&this.seqHi===gr&&this.seqLo>=U11);if(this.seqHi===gr&&this.seqLo>=U11)this.seqLo=0;this.inc=Math.random()*(WW4-V7$)+V7$|0}setPre(){FW4(this.cbuf);for(let $=0;$<Y30;$++)this.buf[$]=N11[this.cbuf[$]%mD]}fillSeq(){let $=this.seqHi,Z=this.seqLo;for(let Q=k7$-1;Q>=Y30;Q--){let X=Math.floor($/mD),J=($-X*mD)*X30+Z,G=Math.floor(J/mD),K=J-G*mD;this.buf[Q]=N11[K],$=X,Z=G}}next(){if(!this.inited)this.init();if(this.seqLo+=this.inc,this.seqLo>=X30)this.seqLo-=X30,this.seqHi+=1;if(this.seqHi>gr||this.seqHi===gr&&this.seqLo>=U11)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()}}_7$.NuidImpl=B11;_7$.nuid=new B11});var g7$=b((b7$)=>{Object.defineProperty(b7$,"__esModule",{value:!0});b7$.nuid=b7$.Nuid=void 0;var f7$=x7$();b7$.Nuid=f7$.NuidImpl;b7$.nuid=f7$.nuid});var G30=b((J30)=>{Object.defineProperty(J30,"__esModule",{value:!0});J30.nuid=J30.Nuid=void 0;var h7$=g7$();Object.defineProperty(J30,"Nuid",{enumerable:!0,get:function(){return h7$.Nuid}});Object.defineProperty(J30,"nuid",{enumerable:!0,get:function(){return h7$.nuid}})});var dD=b((u7$)=>{Object.defineProperty(u7$,"__esModule",{value:!0});u7$.DEFAULT_HOST=u7$.DEFAULT_PORT=u7$.Match=void 0;u7$.syncIterator=DW4;u7$.createInbox=wW4;var LW4=G30(),OW4=MG();u7$.Match={Exact:"exact",CanonicalMIME:"canonical",IgnoreCase:"insensitive"};function DW4($){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 wW4($=""){if($=$||"_INBOX",typeof $!=="string")throw TypeError("prefix must be a string");return $.split(".").forEach((Z)=>{if(Z==="*"||Z===">")throw OW4.InvalidArgumentError.format("prefix",`cannot have wildcards ('${$}')`)}),`${$}.${LW4.nuid.next()}`}u7$.DEFAULT_PORT=4222;u7$.DEFAULT_HOST="127.0.0.1"});var hr=b((d7$)=>{Object.defineProperty(d7$,"__esModule",{value:!0});d7$.DataBuffer=void 0;var c7$=qG();class m7${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 c7$.TE.encode($)}static toAscii($){return c7$.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}}d7$.DataBuffer=m7$});var $T=b((n7$)=>{Object.defineProperty(n7$,"__esModule",{value:!0});n7$.LF=n7$.CR=n7$.CRLF=n7$.CR_LF_LEN=n7$.CR_LF=void 0;n7$.setTransportFactory=qW4;n7$.defaultPort=MW4;n7$.getUrlParseFn=IW4;n7$.newTransport=VW4;n7$.getResolveFn=kW4;n7$.protoLen=p7$;n7$.extractProtocolMessage=SW4;var TW4=qG(),AW4=dD(),RW4=hr(),IG;function qW4($){IG=$}function MW4(){return IG!==void 0&&IG.defaultPort!==void 0?IG.defaultPort:AW4.DEFAULT_PORT}function IW4(){return IG!==void 0&&IG.urlParseFn?IG.urlParseFn:void 0}function VW4(){if(!IG||typeof IG.factory!=="function")throw Error("transport fn is not set");return IG.factory()}function kW4(){return IG!==void 0&&IG.dnsResolveFn?IG.dnsResolveFn:void 0}n7$.CR_LF=`\r
2108
2108
  `;n7$.CR_LF_LEN=n7$.CR_LF.length;n7$.CRLF=RW4.DataBuffer.fromAscii(n7$.CR_LF);n7$.CR=new Uint8Array(n7$.CRLF)[0];n7$.LF=new Uint8Array(n7$.CRLF)[1];function p7$($){for(let Z=0;Z<$.length;Z++){let Q=Z+1;if($.byteLength>Q&&$[Z]===n7$.CR&&$[Q]===n7$.LF)return Q+1}return 0}function SW4($){let Z=p7$($);if(Z>0){let X=new Uint8Array($).slice(0,Z);return TW4.TD.decode(X)}return""}});var j11=b((ZQ$)=>{Object.defineProperty(ZQ$,"__esModule",{value:!0});ZQ$.ipV4=s7$;ZQ$.isIP=lW4;ZQ$.parseIP=e7$;var ur=4,ZT=16,K30=48,a7$=57,o7$=65,hW4=70,r7$=97,uW4=102,w11=16777215;function s7$($,Z,Q,X){let Y=new Uint8Array(ZT);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 lW4($){return e7$($)!==void 0}function e7$($){for(let Z=0;Z<$.length;Z++)switch($[Z]){case".":return $Q$($);case":":return cW4($)}return}function $Q$($){let Z=new Uint8Array(ur);for(let Q=0;Q<ur;Q++){if($.length===0)return;if(Q>0){if($[0]!==".")return;$=$.substring(1)}let{n:X,c:Y,ok:J}=mW4($);if(!J||X>255)return;$=$.substring(Y),Z[Q]=X}return s7$(Z[0],Z[1],Z[2],Z[3])}function cW4($){let Z=new Uint8Array(ZT),Q=-1;if($.length>=2&&$[0]===":"&&$[1]===":"){if(Q=0,$=$.substring(2),$.length===0)return Z}let X=0;while(X<ZT){let{n:Y,c:J,ok:G}=dW4($);if(!G||Y>65535)return;if(J<$.length&&$[J]==="."){if(Q<0&&X!=ZT-ur)return;if(X+ur>ZT)return;let K=$Q$($);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+=ur;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<ZT){if(Q<0)return;let Y=ZT-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 mW4($){let Z=0,Q=0;for(Z=0;Z<$.length&&K30<=$.charCodeAt(Z)&&$.charCodeAt(Z)<=a7$;Z++)if(Q=Q*10+($.charCodeAt(Z)-K30),Q>=w11)return{n:w11,c:Z,ok:!1};if(Z===0)return{n:0,c:0,ok:!1};return{n:Q,c:Z,ok:!0}}function dW4($){let Z=0,Q=0;for(Q=0;Q<$.length;Q++){if(K30<=$.charCodeAt(Q)&&$.charCodeAt(Q)<=a7$)Z*=16,Z+=$.charCodeAt(Q)-K30;else if(r7$<=$.charCodeAt(Q)&&$.charCodeAt(Q)<=uW4)Z*=16,Z+=$.charCodeAt(Q)-r7$+10;else if(o7$<=$.charCodeAt(Q)&&$.charCodeAt(Q)<=hW4)Z*=16,Z+=$.charCodeAt(Q)-o7$+10;else break;if(Z>=w11)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 R11=b((XQ$)=>{Object.defineProperty(XQ$,"__esModule",{value:!0});XQ$.Servers=XQ$.ServerImpl=void 0;XQ$.isIPV4OrHostname=QQ$;XQ$.hostPort=A11;var E11=$T(),z11=yW(),P11=j11(),tW4=dD(),oW4=MG();function QQ$($){if($.indexOf("[")!==-1||$.indexOf("::")!==-1)return!1;if($.indexOf(".")!==-1)return!0;if($.split(":").length<=2)return!0;return!1}function T11($){return!QQ$($)}function rW4($){let Q=$.toUpperCase().indexOf("::FFFF:");if(Q!==-1&&$.indexOf(".")!==-1){let X=$.substring(Q+7);return X=X.replace("[",""),X.replace("]","")}return $}function A11($){if($=$.trim(),$.match(/^(.*:\/\/)(.*)/m))$=$.replace(/^(.*:\/\/)(.*)/gm,"$2");if($=rW4($),T11($)&&$.indexOf("[")===-1)$=`[${$}]`;let Z=T11($)?$.match(/(]:)(\d+)/):$.match(/(:)(\d+)/),Q=Z&&Z.length===3&&Z[1]&&Z[2]?parseInt(Z[2]):tW4.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 Xl{src;listen;hostname;port;didConnect;reconnects;lastConnect;gossiped;tlsName;resolves;constructor($,Z=!1){this.src=$,this.tlsName="";let Q=A11($);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,P11.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}://${T11(X)?"["+X+"]":X}`);J.port=`${this.port}`;let G=new Xl(J.host,!1);G.tlsName=this.hostname,Z.push(G)}}if($.randomize)(0,z11.shuffle)(Z);return this.resolves=Z,Z}}XQ$.ServerImpl=Xl;class W30{firstSelect;servers;currentServer;tlsName;randomize;constructor($={}){this.firstSelect=!0,this.servers=[],this.tlsName="",this.randomize=$.randomize||!1}setServers($){if(!Array.isArray($)||$.length===0)throw oW4.InvalidArgumentError.format("servers","cannot be empty");let Z=(0,E11.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}=A11(Y),G=Q.get(J);if(G)G.gossiped=!1,X.push(G);else X.push(new Xl(Y))}if(this.randomize)(0,z11.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,P11.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,E11.getUrlParseFn)();$=Q?Q($):$;let X=new Xl($,Z);if((0,P11.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 W30.freezeAll(this.servers)}snapshotForHandler(){let $=this.currentServer;if(!$)return this.snapshot();let Z=this.servers.indexOf($);if(Z<=0)return this.snapshot();return W30.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,E11.getUrlParseFn)(),J=new Map;if($.connect_urls&&$.connect_urls.length>0)$.connect_urls.forEach((K)=>{K=Y?Y(K,Z):K;let W=new Xl(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,z11.shuffle)(W),this.servers=K?[K,...W]:W}return{added:Q,deleted:X}}}XQ$.Servers=W30});var H30=b((KQ$)=>{Object.defineProperty(KQ$,"__esModule",{value:!0});KQ$.QueuedIteratorImpl=void 0;var q11=yW(),JQ$=MG();class GQ${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,q11.deferred)(),this.yields=[],this.iterClosed=(0,q11.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 JQ$.InvalidOperationError("iterator cannot be used when a callback is registered");if(this.yielding)throw new JQ$.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,q11.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}}KQ$.QueuedIteratorImpl=GQ$});var M11=b((UQ$)=>{Object.defineProperty(UQ$,"__esModule",{value:!0});UQ$.MuxSubscription=void 0;var $H4=dD(),HQ$=MG();class FQ${baseInbox;reqs;constructor(){this.reqs=new Map}size(){return this.reqs.size}init($){return this.baseInbox=`${(0,$H4.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 HQ$.NoRespondersError(X.requestSubject):null;X.resolver($,Z)}}}}close(){let $=new HQ$.RequestError("connection closed");this.reqs.forEach((Z)=>{Z.resolver($,{})})}}UQ$.MuxSubscription=FQ$});var I11=b((LQ$)=>{Object.defineProperty(LQ$,"__esModule",{value:!0});LQ$.Heartbeat=void 0;var ZH4=yW();class BQ${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,ZH4.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})}}LQ$.Heartbeat=BQ$});var S11=b((EQ$)=>{Object.defineProperty(EQ$,"__esModule",{value:!0});EQ$.DenoBuffer=EQ$.MAX_SIZE=EQ$.AssertionError=void 0;EQ$.assert=wQ$;EQ$.concat=jQ$;EQ$.append=XH4;EQ$.readAll=YH4;EQ$.writeAll=JH4;var QH4=qG();class V11 extends Error{constructor($){super($);this.name="AssertionError"}}EQ$.AssertionError=V11;function wQ$($,Z="Assertion failed."){if(!$)throw new V11(Z)}var DQ$=32768;EQ$.MAX_SIZE=4294967294;function F30($,Z,Q=0){let X=Z.byteLength-Q;if($.byteLength>X)$=$.subarray(0,X);return Z.set($,Q),$.byteLength}function jQ$($,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 XH4($,Z){return jQ$($,Uint8Array.of(Z))}class k11{_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($){wQ$($<=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=F30(this._buf.subarray(this._off),$);return this._off+=Z,Z}writeByte($){return this.write(Uint8Array.of($))}writeString($){return this.write(QH4.TE.encode($))}write($){let Z=this._grow($.byteLength);return F30($,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)F30(this._buf.subarray(this._off),this._buf);else if(X+$>EQ$.MAX_SIZE)throw Error("The buffer cannot be grown beyond the maximum size.");else{let Y=new Uint8Array(Math.min(2*X+$,EQ$.MAX_SIZE));F30(this._buf.subarray(this._off),Y),this._buf=Y}return this._off=0,this._reslice(Math.min(Z+$,EQ$.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(DQ$);while(!0){let X=this.capacity-this.length<DQ$,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}}}EQ$.DenoBuffer=k11;function YH4($){let Z=new k11;return Z.readFrom($),Z.bytes()}function JH4($,Z){let Q=0;while(Q<Z.length)Q+=$.write(Z.subarray(Q))}});var v11=b((RQ$)=>{Object.defineProperty(RQ$,"__esModule",{value:!0});RQ$.cc=RQ$.State=RQ$.Parser=RQ$.Kind=void 0;RQ$.describe=NH4;var C11=S11(),_11=qG();RQ$.Kind={OK:0,ERR:1,MSG:2,INFO:3,PING:4,PONG:5};function NH4($){let Z,Q="";switch($.kind){case RQ$.Kind.MSG:Z="MSG";break;case RQ$.Kind.OK:Z="OK";break;case RQ$.Kind.ERR:Z="ERR",Q=_11.TD.decode($.data);break;case RQ$.Kind.PING:Z="PING";break;case RQ$.Kind.PONG:Z="PONG";break;case RQ$.Kind.INFO:Z="INFO",Q=_11.TD.decode($.data)}return`${Z}: ${Q}`}function PQ$(){let $={};return $.sid=-1,$.hdr=-1,$.size=-1,$}var TQ$=48,BH4=57,Yl=67108864;class AQ${dispatcher;state;as;drop;hdr;ma;argBuf;msgBuf;constructor($){this.dispatcher=$,this.state=RQ$.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 RQ$.State.OP_START:switch(Q){case RQ$.cc.M:case RQ$.cc.m:this.state=RQ$.State.OP_M,this.hdr=-1,this.ma=PQ$();break;case RQ$.cc.H:case RQ$.cc.h:this.state=RQ$.State.OP_H,this.hdr=0,this.ma=PQ$();break;case RQ$.cc.P:case RQ$.cc.p:this.state=RQ$.State.OP_P;break;case RQ$.cc.PLUS:this.state=RQ$.State.OP_PLUS;break;case RQ$.cc.MINUS:this.state=RQ$.State.OP_MINUS;break;case RQ$.cc.I:case RQ$.cc.i:this.state=RQ$.State.OP_I;break;default:throw this.fail($.subarray(Z))}break;case RQ$.State.OP_H:switch(Q){case RQ$.cc.M:case RQ$.cc.m:this.state=RQ$.State.OP_M;break;default:throw this.fail($.subarray(Z))}break;case RQ$.State.OP_M:switch(Q){case RQ$.cc.S:case RQ$.cc.s:this.state=RQ$.State.OP_MS;break;default:throw this.fail($.subarray(Z))}break;case RQ$.State.OP_MS:switch(Q){case RQ$.cc.G:case RQ$.cc.g:this.state=RQ$.State.OP_MSG;break;default:throw this.fail($.subarray(Z))}break;case RQ$.State.OP_MSG:switch(Q){case RQ$.cc.SPACE:case RQ$.cc.TAB:this.state=RQ$.State.OP_MSG_SPC;break;default:throw this.fail($.subarray(Z))}break;case RQ$.State.OP_MSG_SPC:switch(Q){case RQ$.cc.SPACE:case RQ$.cc.TAB:continue;default:this.state=RQ$.State.MSG_ARG,this.as=Z}break;case RQ$.State.MSG_ARG:switch(Q){case RQ$.cc.CR:this.drop=1;break;case RQ$.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=RQ$.State.MSG_PAYLOAD,Z=this.as+this.ma.size-1;break}default:if(this.argBuf)this.argBuf.writeByte(Q)}break;case RQ$.State.MSG_PAYLOAD:if(this.msgBuf)if(this.msgBuf.length>=this.ma.size){let X=this.msgBuf.bytes({copy:!1});this.dispatcher.push({kind:RQ$.Kind.MSG,msg:this.ma,data:X}),this.argBuf=void 0,this.msgBuf=void 0,this.state=RQ$.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:RQ$.Kind.MSG,msg:this.ma,data:$.subarray(this.as,Z)}),this.argBuf=void 0,this.msgBuf=void 0,this.state=RQ$.State.MSG_END;break;case RQ$.State.MSG_END:switch(Q){case RQ$.cc.NL:this.drop=0,this.as=Z+1,this.state=RQ$.State.OP_START;break;default:continue}break;case RQ$.State.OP_PLUS:switch(Q){case RQ$.cc.O:case RQ$.cc.o:this.state=RQ$.State.OP_PLUS_O;break;default:throw this.fail($.subarray(Z))}break;case RQ$.State.OP_PLUS_O:switch(Q){case RQ$.cc.K:case RQ$.cc.k:this.state=RQ$.State.OP_PLUS_OK;break;default:throw this.fail($.subarray(Z))}break;case RQ$.State.OP_PLUS_OK:switch(Q){case RQ$.cc.NL:this.dispatcher.push({kind:RQ$.Kind.OK}),this.drop=0,this.state=RQ$.State.OP_START;break}break;case RQ$.State.OP_MINUS:switch(Q){case RQ$.cc.E:case RQ$.cc.e:this.state=RQ$.State.OP_MINUS_E;break;default:throw this.fail($.subarray(Z))}break;case RQ$.State.OP_MINUS_E:switch(Q){case RQ$.cc.R:case RQ$.cc.r:this.state=RQ$.State.OP_MINUS_ER;break;default:throw this.fail($.subarray(Z))}break;case RQ$.State.OP_MINUS_ER:switch(Q){case RQ$.cc.R:case RQ$.cc.r:this.state=RQ$.State.OP_MINUS_ERR;break;default:throw this.fail($.subarray(Z))}break;case RQ$.State.OP_MINUS_ERR:switch(Q){case RQ$.cc.SPACE:case RQ$.cc.TAB:this.state=RQ$.State.OP_MINUS_ERR_SPC;break;default:throw this.fail($.subarray(Z))}break;case RQ$.State.OP_MINUS_ERR_SPC:switch(Q){case RQ$.cc.SPACE:case RQ$.cc.TAB:continue;default:this.state=RQ$.State.MINUS_ERR_ARG,this.as=Z}break;case RQ$.State.MINUS_ERR_ARG:switch(Q){case RQ$.cc.CR:this.drop=1;break;case RQ$.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:RQ$.Kind.ERR,data:X}),this.drop=0,this.as=Z+1,this.state=RQ$.State.OP_START;break}default:if(this.argBuf)this.argBuf.write(Uint8Array.of(Q))}break;case RQ$.State.OP_P:switch(Q){case RQ$.cc.I:case RQ$.cc.i:this.state=RQ$.State.OP_PI;break;case RQ$.cc.O:case RQ$.cc.o:this.state=RQ$.State.OP_PO;break;default:throw this.fail($.subarray(Z))}break;case RQ$.State.OP_PO:switch(Q){case RQ$.cc.N:case RQ$.cc.n:this.state=RQ$.State.OP_PON;break;default:throw this.fail($.subarray(Z))}break;case RQ$.State.OP_PON:switch(Q){case RQ$.cc.G:case RQ$.cc.g:this.state=RQ$.State.OP_PONG;break;default:throw this.fail($.subarray(Z))}break;case RQ$.State.OP_PONG:switch(Q){case RQ$.cc.NL:this.dispatcher.push({kind:RQ$.Kind.PONG}),this.drop=0,this.state=RQ$.State.OP_START;break}break;case RQ$.State.OP_PI:switch(Q){case RQ$.cc.N:case RQ$.cc.n:this.state=RQ$.State.OP_PIN;break;default:throw this.fail($.subarray(Z))}break;case RQ$.State.OP_PIN:switch(Q){case RQ$.cc.G:case RQ$.cc.g:this.state=RQ$.State.OP_PING;break;default:throw this.fail($.subarray(Z))}break;case RQ$.State.OP_PING:switch(Q){case RQ$.cc.NL:this.dispatcher.push({kind:RQ$.Kind.PING}),this.drop=0,this.state=RQ$.State.OP_START;break}break;case RQ$.State.OP_I:switch(Q){case RQ$.cc.N:case RQ$.cc.n:this.state=RQ$.State.OP_IN;break;default:throw this.fail($.subarray(Z))}break;case RQ$.State.OP_IN:switch(Q){case RQ$.cc.F:case RQ$.cc.f:this.state=RQ$.State.OP_INF;break;default:throw this.fail($.subarray(Z))}break;case RQ$.State.OP_INF:switch(Q){case RQ$.cc.O:case RQ$.cc.o:this.state=RQ$.State.OP_INFO;break;default:throw this.fail($.subarray(Z))}break;case RQ$.State.OP_INFO:switch(Q){case RQ$.cc.SPACE:case RQ$.cc.TAB:this.state=RQ$.State.OP_INFO_SPC;break;default:throw this.fail($.subarray(Z))}break;case RQ$.State.OP_INFO_SPC:switch(Q){case RQ$.cc.SPACE:case RQ$.cc.TAB:continue;default:this.state=RQ$.State.INFO_ARG,this.as=Z}break;case RQ$.State.INFO_ARG:switch(Q){case RQ$.cc.CR:this.drop=1;break;case RQ$.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:RQ$.Kind.INFO,data:X}),this.drop=0,this.as=Z+1,this.state=RQ$.State.OP_START;break}default:if(this.argBuf)this.argBuf.writeByte(Q)}break;default:throw this.fail($.subarray(Z))}}if((this.state===RQ$.State.MSG_ARG||this.state===RQ$.State.MINUS_ERR_ARG||this.state===RQ$.State.INFO_ARG)&&!this.argBuf)this.argBuf=new C11.DenoBuffer($.subarray(this.as,Z-this.drop));if(this.state===RQ$.State.MSG_PAYLOAD&&!this.msgBuf){if(!this.argBuf)this.cloneMsgArg();this.msgBuf=new C11.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 C11.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 RQ$.cc.SPACE:case RQ$.cc.TAB:case RQ$.cc.CR:case RQ$.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],Yl);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],Yl);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}: ${_11.TD.decode($)}`)}processHeaderMsgArgs($){let Z=[],Q=-1;for(let X=0;X<$.length;X++)switch($[X]){case RQ$.cc.SPACE:case RQ$.cc.TAB:case RQ$.cc.CR:case RQ$.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],Yl),this.ma.size=this.protoParseInt(Z[3],Yl);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],Yl),this.ma.size=this.protoParseInt(Z[4],Yl);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]<TQ$||$[X]>BH4)return-1;Q=Q*10+($[X]-TQ$)}return Z!==void 0&&Q>Z?-1:Q}}RQ$.Parser=AQ$;RQ$.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};RQ$.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 B30=b((MQ$)=>{Object.defineProperty(MQ$,"__esModule",{value:!0});MQ$.MsgHdrsImpl=void 0;MQ$.canonicalMIMEHeaderKey=f11;MQ$.headers=DH4;var qQ$=qG(),gW=dD(),N30=MG();function f11($){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 N30.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 DH4($=0,Z=""){if($===0&&Z!=="")throw N30.InvalidArgumentError.format("code","is required");else if($>0&&Z==="")throw N30.InvalidArgumentError.format("description","is required");return new Jl($,Z)}var x11="NATS/1.0";class Jl{_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 Jl,X=qQ$.TD.decode($).split(`\r
2109
2109
  `),Y=X[0];if(Y!==x11){let J=Y.replace(x11,"").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 $=x11;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
2110
2110
  ${Z}: ${Q[X]}`;return`${$}\r