decocms 4.303.18 → 4.303.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (228) hide show
  1. package/dist/client/assets/{AlertCircle-CQHLdRGZ.js → AlertCircle-o5t7U15t.js} +1 -1
  2. package/dist/client/assets/{AreaChart-BKxFF8dx.js → AreaChart-BJKh0Xo9.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-CiGURYfW.js → ArrowLeft-BzPUvIx9.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-BYUc6rLi.js → ArrowUp-BNC0MSN-.js} +1 -1
  5. package/dist/client/assets/{Check-D2uR7VS6.js → Check-DfafgaAY.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-CAmi_hLt.js → CheckCircle-Cc1EAQjv.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-8xCHcxO5.js → ChevronDown-UHjPt6Qe.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-CGhhUMqZ.js → ChevronRight-Ch2rGsyq.js} +1 -1
  9. package/dist/client/assets/{ChevronSelectorVertical-cbyqr5lK.js → ChevronSelectorVertical-DG0Q3XC8.js} +1 -1
  10. package/dist/client/assets/{ChevronUp-DsbjTZEU.js → ChevronUp-DKdb4Eo4.js} +1 -1
  11. package/dist/client/assets/{Copy01-Ci-gY1Mf.js → Copy01-CEF6KRyx.js} +1 -1
  12. package/dist/client/assets/{CreditCard01-BNcyZEcR.js → CreditCard01-DW7cwpEq.js} +1 -1
  13. package/dist/client/assets/{DotsVertical-Dn5tfgWo.js → DotsVertical-CvIhN54Z.js} +1 -1
  14. package/dist/client/assets/{Download01-DvsX90Og.js → Download01-BpLrWUFQ.js} +1 -1
  15. package/dist/client/assets/{Eye-DlUCg5eK.js → Eye-IK9N_TfF.js} +1 -1
  16. package/dist/client/assets/{FilterLines-UPH8xWau.js → FilterLines-Bd3Ptc1T.js} +1 -1
  17. package/dist/client/assets/{Globe01-DmgQnFDH.js → Globe01-C8KRyGo7.js} +1 -1
  18. package/dist/client/assets/{Globe04-D0ajJFya.js → Globe04-BMuOnFJ3.js} +1 -1
  19. package/dist/client/assets/{HardDrive-BHuyK3fS.js → HardDrive-1pokgOWi.js} +1 -1
  20. package/dist/client/assets/{Key01-5YRgt-NM.js → Key01-edZRndMN.js} +1 -1
  21. package/dist/client/assets/{LinkExternal01-CCFX8C9r.js → LinkExternal01-C_PAGPOZ.js} +1 -1
  22. package/dist/client/assets/{LockUnlocked01-BPszj4SU.js → LockUnlocked01-BvU3hsT9.js} +1 -1
  23. package/dist/client/assets/{LogOut01--XDLMXg4.js → LogOut01-LRdOq5m-.js} +1 -1
  24. package/dist/client/assets/{Monitor01-lA6KBTMH.js → Monitor01-BeWnEnSY.js} +1 -1
  25. package/dist/client/assets/{Palette-C6GfWC5O.js → Palette-1ykwXBgq.js} +1 -1
  26. package/dist/client/assets/{Play-w0QeyPJg.js → Play-C-fxdXTO.js} +1 -1
  27. package/dist/client/assets/{Plus-DJ1u9cvh.js → Plus-D-eBf55E.js} +1 -1
  28. package/dist/client/assets/{SearchLg-ioZdvcNv.js → SearchLg-AgMTy3BF.js} +1 -1
  29. package/dist/client/assets/{SearchMd-CSkF3NuW.js → SearchMd-Bgqo_RaG.js} +1 -1
  30. package/dist/client/assets/{Settings02-C-VuMkOS.js → Settings02-D4Ram1T9.js} +1 -1
  31. package/dist/client/assets/{Share07-Bs7pdZjs.js → Share07-BFMljC78.js} +1 -1
  32. package/dist/client/assets/{Shield01-hMr_AjYy.js → Shield01-Bpvx1AOq.js} +1 -1
  33. package/dist/client/assets/{Stars01-C2yF4VK7.js → Stars01-C1v7BKtA.js} +1 -1
  34. package/dist/client/assets/{Stars02-BWM8HAhO.js → Stars02-Dd3xKr-z.js} +1 -1
  35. package/dist/client/assets/{Sun-38XX85KF.js → Sun-C2cW_PcA.js} +1 -1
  36. package/dist/client/assets/{SwitchHorizontal01-B3pukb_d.js → SwitchHorizontal01-DBDiv7sg.js} +1 -1
  37. package/dist/client/assets/{Tool01-CXcsQpcs.js → Tool01-CDqPr35h.js} +1 -1
  38. package/dist/client/assets/{Tool02-CHOuYkmG.js → Tool02-BjT1M9ir.js} +1 -1
  39. package/dist/client/assets/{Trash01-B8L_kHj2.js → Trash01-C6X-F7mu.js} +1 -1
  40. package/dist/client/assets/{TrendUp01-BXUsJCPa.js → TrendUp01-CFOguoVE.js} +1 -1
  41. package/dist/client/assets/{Upload01-D8nl8bCp.js → Upload01-Cb4JYHDC.js} +1 -1
  42. package/dist/client/assets/{User01-UY13B65C.js → User01-CyUZVodK.js} +1 -1
  43. package/dist/client/assets/{UserSquare-DTydatTQ.js → UserSquare-C9rYyfxZ.js} +1 -1
  44. package/dist/client/assets/{Users01-Cmd-sb0e.js → Users01-BNehX3Bh.js} +1 -1
  45. package/dist/client/assets/{Users03-B1L_e4Us.js → Users03-BgDUOxWA.js} +1 -1
  46. package/dist/client/assets/{XCircle-D0PGfwFN.js → XCircle-BTd3BEve.js} +1 -1
  47. package/dist/client/assets/{XClose-IrMEsBvE.js → XClose-CCVjmK8v.js} +1 -1
  48. package/dist/client/assets/{YAxis-DekTFQwn.js → YAxis-BCWcAOkQ.js} +1 -1
  49. package/dist/client/assets/{Zap-BG8w2q-h.js → Zap-DOHkfpLH.js} +1 -1
  50. package/dist/client/assets/{ZapSquare-BSDBm0-3.js → ZapSquare-DURaAlG-.js} +1 -1
  51. package/dist/client/assets/{access-gate-COnLvP6E.js → access-gate-CNVZwL63.js} +1 -1
  52. package/dist/client/assets/{agent-icon-1Uy4JHGE.js → agent-icon-Bjpha3cs.js} +1 -1
  53. package/dist/client/assets/{agents-list-DoEnXQ-2.js → agents-list-BcPHk0H_.js} +1 -1
  54. package/dist/client/assets/{ai-providers-rpyGrddI.js → ai-providers-Voif6q-d.js} +1 -1
  55. package/dist/client/assets/{alert-4xqkNw5N.js → alert-CBSTQf9B.js} +1 -1
  56. package/dist/client/assets/{alert-dialog-CKals38I.js → alert-dialog-BnDTGXEL.js} +1 -1
  57. package/dist/client/assets/{api-keys-CSVjq3Q5.js → api-keys-CL9-DzqZ.js} +1 -1
  58. package/dist/client/assets/{app-editor-Cof9ScuM.js → app-editor-D9B_ah-y.js} +1 -1
  59. package/dist/client/assets/{auth-CL7BB7R8.js → auth-DlQPhcEa.js} +1 -1
  60. package/dist/client/assets/{auth-catchall-DofjeWMb.js → auth-catchall-6D7ohkGr.js} +1 -1
  61. package/dist/client/assets/{auth-entry-Dd9HwvEb.js → auth-entry-BxcEFcv8.js} +1 -1
  62. package/dist/client/assets/{auth-split-layout-D0B_GAnv.js → auth-split-layout-oWwVJ_lX.js} +1 -1
  63. package/dist/client/assets/{authenticate-and-persist-oauth-DwF5HsDl.js → authenticate-and-persist-oauth-CNCEB1RG.js} +1 -1
  64. package/dist/client/assets/{automation-list-row-Bcc9lQX_.js → automation-list-row-DGZFkIIX.js} +1 -1
  65. package/dist/client/assets/{automation-runs-DZqc6zdF.js → automation-runs-9F2Kg7Ou.js} +1 -1
  66. package/dist/client/assets/{automations-BxWeq4WH.js → automations-ezypZBAn.js} +1 -1
  67. package/dist/client/assets/{avatar-VZD77tJt.js → avatar-DtRDldyk.js} +1 -1
  68. package/dist/client/assets/{badge-D2iqafj_.js → badge-BBhIil8X.js} +1 -1
  69. package/dist/client/assets/{block-document-Ckov2DVf.js → block-document-XI3Gx-Kv.js} +1 -1
  70. package/dist/client/assets/{breadcrumb-CIieoQwM.js → breadcrumb-DYsxL3nb.js} +1 -1
  71. package/dist/client/assets/{buckets-CicJa1ug.js → buckets-DBCwqDgP.js} +1 -1
  72. package/dist/client/assets/{bulk-category-panel-D_N1uk4U.js → bulk-category-panel-CMEGEsOe.js} +1 -1
  73. package/dist/client/assets/{capability-load-error-rdE1oxb8.js → capability-load-error-Ci_BEaiD.js} +1 -1
  74. package/dist/client/assets/{cards-BGOKqQ27.js → cards-BZiUCjkV.js} +1 -1
  75. package/dist/client/assets/{category-editor-C7AwyH3G.js → category-editor-BwuLIQz_.js} +1 -1
  76. package/dist/client/assets/{chart-CSNQ-UDK.js → chart-CXPbjuTK.js} +1 -1
  77. package/dist/client/assets/{chat-context-Dd07RQrC.js → chat-context-Dbw0_twF.js} +1 -1
  78. package/dist/client/assets/{checkbox-DgLrlAzs.js → checkbox-CxuFut4g.js} +1 -1
  79. package/dist/client/assets/{choose-editor-CmmVPvRf.js → choose-editor-Ch5SSLls.js} +1 -1
  80. package/dist/client/assets/{cli-auth-success-8ziDxHe9.js → cli-auth-success-sKk7OHET.js} +1 -1
  81. package/dist/client/assets/{collection-detail-jRNLtArL.js → collection-detail-CkVXPOlk.js} +1 -1
  82. package/dist/client/assets/{collection-display-button-DU2gf8zc.js → collection-display-button-BNBdsHBC.js} +1 -1
  83. package/dist/client/assets/{collection-search-DNi1PrKS.js → collection-search-DlN6SiVG.js} +1 -1
  84. package/dist/client/assets/{collection-table-wrapper-B2zLvcrd.js → collection-table-wrapper-CCk8gHXW.js} +1 -1
  85. package/dist/client/assets/{collection-tabs-Dk9BdEwW.js → collection-tabs-HNE4vRGw.js} +1 -1
  86. package/dist/client/assets/{command-DVD7kHdL.js → command-DW9HbR0N.js} +1 -1
  87. package/dist/client/assets/{commerce-onboarding-CqX91RcC.js → commerce-onboarding-8IMWcP1z.js} +1 -1
  88. package/dist/client/assets/{config-BrOhINT3.js → config-4vJn8hUX.js} +1 -1
  89. package/dist/client/assets/{connect-DoPq4Kbx.js → connect-BBM2Wrs3.js} +1 -1
  90. package/dist/client/assets/{connection-BYyfoihv.js → connection-CY6xTSZh.js} +1 -1
  91. package/dist/client/assets/{connection-card-DarWMyyd.js → connection-card-NoJ_awE8.js} +1 -1
  92. package/dist/client/assets/{connection-detail-B_ONdUoZ.js → connection-detail-ByrHemsJ.js} +1 -1
  93. package/dist/client/assets/{connection-form-helpers-CZpFHqZl.js → connection-form-helpers-wEHSYkED.js} +1 -1
  94. package/dist/client/assets/{connections-CH--XHxL.js → connections-Crqz4VQR.js} +1 -1
  95. package/dist/client/assets/{decopilot-sse-pool-BgJs9Iz4.js → decopilot-sse-pool-BV1Pl6oC.js} +1 -1
  96. package/dist/client/assets/{dialog-BsgKtXcv.js → dialog-BR-ndDjN.js} +1 -1
  97. package/dist/client/assets/{domain-settings-sv0tQbYA.js → domain-settings-CHP-yXMn.js} +1 -1
  98. package/dist/client/assets/{drawer-bVZuQnUm.js → drawer-Cub20IZd.js} +1 -1
  99. package/dist/client/assets/{dropdown-menu-DaPMfZJL.js → dropdown-menu-Kz_TrGoE.js} +1 -1
  100. package/dist/client/assets/{empty-state-3yTa4zv_.js → empty-state-CTj88i_y.js} +1 -1
  101. package/dist/client/assets/{extract-connection-data-s0CjKUai.js → extract-connection-data-CWEOpT1y.js} +1 -1
  102. package/dist/client/assets/{file-explorer-DH5J7Z_F.js → file-explorer-CtZXaAmC.js} +1 -1
  103. package/dist/client/assets/{file-type-icon-h-gu0AyD.js → file-type-icon-C2d3NqsJ.js} +1 -1
  104. package/dist/client/assets/{form-Dx0MB3fU.js → form-DOJVAylR.js} +1 -1
  105. package/dist/client/assets/{general-BZI01Scd.js → general-CUNraMrx.js} +1 -1
  106. package/dist/client/assets/{github-repo-picker-D0s7lCE_.js → github-repo-picker-D0CY7fOf.js} +1 -1
  107. package/dist/client/assets/{hooks-pRLjI1ki.js → hooks-DVvA4Xmp.js} +1 -1
  108. package/dist/client/assets/{index-dEWwUOGD.js → index-29AUcewG.js} +1 -1
  109. package/dist/client/assets/{index-BJorKB1L.js → index-BqI9N5wz.js} +1 -1
  110. package/dist/client/assets/{index-BoJxSoCi.js → index-CkXINtXQ.js} +1 -1
  111. package/dist/client/assets/{index-Dkh6BBaT.js → index-D70KoSOn.js} +1 -1
  112. package/dist/client/assets/{index-BjuOrk3P.js → index-D9vZRWWq.js} +1 -1
  113. package/dist/client/assets/{index-Dt4xzxRh.js → index-DFQ7B_Sf.js} +3 -3
  114. package/dist/client/assets/{index-C78XfdDO.js → index-DeksSukw.js} +1 -1
  115. package/dist/client/assets/{index-D1fIy1Q8.js → index-Df2MdOeK.js} +6 -6
  116. package/dist/client/assets/{index-KTd_KQqb.js → index-Dk2zEps_.js} +1 -1
  117. package/dist/client/assets/{index-redirect-C1PAzwne.js → index-redirect-CF3NiCVN.js} +1 -1
  118. package/dist/client/assets/{infra-billing-r37CcZoi.js → infra-billing-CGrzPCn-.js} +1 -1
  119. package/dist/client/assets/{input-C0NkEUr-.js → input-B5QtPTJ7.js} +1 -1
  120. package/dist/client/assets/{integration-icon-CAak33zg.js → integration-icon-DIrDcntg.js} +1 -1
  121. package/dist/client/assets/{invite-member-dialog-gbvc57jE.js → invite-member-dialog-BF5agRC7.js} +1 -1
  122. package/dist/client/assets/{label-4acATUDo.js → label-BnXVpW2e.js} +1 -1
  123. package/dist/client/assets/{layout--HaIvLG7.js → layout-Bt0A9bTs.js} +1 -1
  124. package/dist/client/assets/{login-D0lRZ_Hr.js → login-BQONG9GD.js} +1 -1
  125. package/dist/client/assets/{mcp-oauth-CudkBTAh.js → mcp-oauth-DH571Q1I.js} +1 -1
  126. package/dist/client/assets/{members-DnRCVydA.js → members-CjRIFRfu.js} +1 -1
  127. package/dist/client/assets/{monaco-editor-CadZW_y5.js → monaco-editor-ru5RXsgR.js} +1 -1
  128. package/dist/client/assets/{monitoring-stats-row-Bt4vwPU1.js → monitoring-stats-row-e3oziYol.js} +1 -1
  129. package/dist/client/assets/{multi-select-B_nePBaY.js → multi-select-DLHa1i4A.js} +1 -1
  130. package/dist/client/assets/{oauth-callback-DjJNm6Pn.js → oauth-callback-CN8k4dqG.js} +1 -1
  131. package/dist/client/assets/{oauth-callback-ai-provider-ljmYtEt-.js → oauth-callback-ai-provider-DOhjxLgS.js} +1 -1
  132. package/dist/client/assets/{onboarding-Bg7YxpYA.js → onboarding-v4Uu4Uxg.js} +1 -1
  133. package/dist/client/assets/{org-layout-BpIps4Lg.js → org-layout-ChFoajOX.js} +1 -1
  134. package/dist/client/assets/{organization-choice-D3n8YPEg.js → organization-choice-CQd80PMQ.js} +1 -1
  135. package/dist/client/assets/{orgs-wYbbkOyM.js → orgs-CgIkMYv3.js} +1 -1
  136. package/dist/client/assets/{page-seo-form-BpMssUHV.js → page-seo-form-RYNPNVaf.js} +1 -1
  137. package/dist/client/assets/{popover-B6-Ys0fY.js → popover-BtHmFZRF.js} +1 -1
  138. package/dist/client/assets/{post-calendar-a9KvcVDR.js → post-calendar-ClkBOchc.js} +1 -1
  139. package/dist/client/assets/{post-editor-BgHSrH2_.js → post-editor-BCkLaf2L.js} +1 -1
  140. package/dist/client/assets/{primitives-D9Vk7jJc.js → primitives-BvirFm0W.js} +1 -1
  141. package/dist/client/assets/{profile-HNCqBxDt.js → profile-u9Rub3jh.js} +1 -1
  142. package/dist/client/assets/{project-app-view-D2yTl_cB.js → project-app-view-BD_nJXiN.js} +1 -1
  143. package/dist/client/assets/{prompts-8e6dAjm8.js → prompts-D7xXodiz.js} +1 -1
  144. package/dist/client/assets/record-editor-99I61xnZ.js +1 -0
  145. package/dist/client/assets/{redirect-editor-B78_e_4F.js → redirect-editor-CVzl-J6N.js} +1 -1
  146. package/dist/client/assets/registry-BpEtgdzf.js +2 -0
  147. package/dist/client/assets/{registry-layout-qpWNJ_6s.js → registry-layout-CpDL9jeT.js} +1 -1
  148. package/dist/client/assets/{reports-C7o1BvM8.js → reports-Cqvnjxj-.js} +1 -1
  149. package/dist/client/assets/{require-capability-BH6rnA7M.js → require-capability-CD_WU_h3.js} +1 -1
  150. package/dist/client/assets/{required-auth-layout-DUIsRLzp.js → required-auth-layout-uuz0cSqY.js} +1 -1
  151. package/dist/client/assets/{reset-password-C3yPnnDs.js → reset-password-BtoHYOws.js} +1 -1
  152. package/dist/client/assets/{review-settings-B8wdqMgV.js → review-settings-D4YL5ofK.js} +1 -1
  153. package/dist/client/assets/{roles-C0LSaCSn.js → roles-DPVnU-ab.js} +1 -1
  154. package/dist/client/assets/{scroll-area-Bp3GVSr-.js → scroll-area-BgBhUly0.js} +1 -1
  155. package/dist/client/assets/{search-input-DbOHtzd0.js → search-input-Clumrfm-.js} +1 -1
  156. package/dist/client/assets/{secrets-DYZFlgh4.js → secrets-DeD9oD-D.js} +1 -1
  157. package/dist/client/assets/{sections-editor-Dv_66nGj.js → sections-editor-BkpM1CCc.js} +1 -1
  158. package/dist/client/assets/{select-4uUeWpPU.js → select-Cjk2AUj1.js} +1 -1
  159. package/dist/client/assets/{select-model-TFKAmtgQ.js → select-model-B-L3ys6R.js} +1 -1
  160. package/dist/client/assets/{self-tool-result-Dt4_R2Xj.js → self-tool-result-nB04jYuu.js} +1 -1
  161. package/dist/client/assets/{seo-editor-DJi8uBUn.js → seo-editor-CTr1enMw.js} +1 -1
  162. package/dist/client/assets/{settings-layout-BdD_0kXU.js → settings-layout-BksJonwg.js} +1 -1
  163. package/dist/client/assets/{shell-controls-Bl3Xz0EI.js → shell-controls-fm9MNz2m.js} +1 -1
  164. package/dist/client/assets/{shell-layout-97WWXRZC.js → shell-layout-D8H0owB6.js} +1 -1
  165. package/dist/client/assets/{spinner-D3iuVgRx.js → spinner-AK5_UOCr.js} +1 -1
  166. package/dist/client/assets/{sso-D6MCOhpk.js → sso-CmGwq8R3.js} +1 -1
  167. package/dist/client/assets/{store-B90A64xK.js → store-BeivhU5B.js} +1 -1
  168. package/dist/client/assets/store-registry-C6HBioH3.js +2 -0
  169. package/dist/client/assets/{super-agent-icon-CtnmJgjL.js → super-agent-icon-BPFuSMCj.js} +1 -1
  170. package/dist/client/assets/{switch-B9S-ReOo.js → switch-BMCQK8MD.js} +1 -1
  171. package/dist/client/assets/{synced-repos-CUU8d6HM.js → synced-repos-Ccb6Ueb5.js} +1 -1
  172. package/dist/client/assets/{table-lkBea1Xl.js → table-ZlgGNlS7.js} +1 -1
  173. package/dist/client/assets/{tabs-D3ItZX7-.js → tabs-CiCpcxs6.js} +1 -1
  174. package/dist/client/assets/{task-board-RnD3TOhC.js → task-board-wbmrgVVh.js} +1 -1
  175. package/dist/client/assets/{tasks-DLzC3Qg-.js → tasks-GGPJAdS2.js} +1 -1
  176. package/dist/client/assets/{textarea-CvTRHsZk.js → textarea-CwhPYTd9.js} +1 -1
  177. package/dist/client/assets/{toggle-group-BDLHVTfC.js → toggle-group-BiLDWWon.js} +1 -1
  178. package/dist/client/assets/{toolbar-C1nhAu84.js → toolbar-Cm9cLldv.js} +1 -1
  179. package/dist/client/assets/{track-fnUcFwb2.js → track-DNFE4hs8.js} +1 -1
  180. package/dist/client/assets/{types-CxWdrWNU.js → types-C1a5wA7-.js} +1 -1
  181. package/dist/client/assets/{use-ai-providers-CWrLm1AD.js → use-ai-providers-DhVzMXYe.js} +1 -1
  182. package/dist/client/assets/{use-api-keys-B3Q2krdM.js → use-api-keys-B6WNwifd.js} +1 -1
  183. package/dist/client/assets/{use-automations-BKaWtSiV.js → use-automations-_u9wybg_.js} +1 -1
  184. package/dist/client/assets/{use-autosave-Cr2hXHtO.js → use-autosave-CTv0raFv.js} +1 -1
  185. package/dist/client/assets/{use-connection-BgNmeJig.js → use-connection-B2I_GOM8.js} +1 -1
  186. package/dist/client/assets/{use-copy-D0SrfqIt.js → use-copy-B6X1cSHu.js} +1 -1
  187. package/dist/client/assets/{use-create-virtual-mcp-C1KaJD_5.js → use-create-virtual-mcp-DuVS9_ic.js} +1 -1
  188. package/dist/client/assets/{use-debounced-autosave-B5VYl10E.js → use-debounced-autosave-FpcaWjA4.js} +1 -1
  189. package/dist/client/assets/{use-debounced-value-V53g41E7.js → use-debounced-value-LgM3Xy5X.js} +1 -1
  190. package/dist/client/assets/{use-decopilot-events-C4VqK85Z.js → use-decopilot-events-ao16VX3T.js} +1 -1
  191. package/dist/client/assets/{use-delete-connection-fErbpR5s.js → use-delete-connection-084LbFQc.js} +1 -1
  192. package/dist/client/assets/{use-deployment-admin-BFQ8HqrQ.js → use-deployment-admin-DRvslbJR.js} +1 -1
  193. package/dist/client/assets/{use-destination-route-Bn3yIPW-.js → use-destination-route-tnL8wDrQ.js} +1 -1
  194. package/dist/client/assets/{use-file-configs-Dyw7-pny.js → use-file-configs-DtIcvEgh.js} +1 -1
  195. package/dist/client/assets/{use-infinite-scroll-CRoLBkCZ.js → use-infinite-scroll-C_3JSRjC.js} +1 -1
  196. package/dist/client/assets/{use-join-requests-BmAEO_Kv.js → use-join-requests-DO3-Ma5H.js} +1 -1
  197. package/dist/client/assets/{use-mcp-auth-status-r8CXlFWH.js → use-mcp-auth-status-bU7QiM0v.js} +1 -1
  198. package/dist/client/assets/{use-mcp-client-DkdpleIo.js → use-mcp-client-BJ_ALPey.js} +1 -1
  199. package/dist/client/assets/{use-mcp-tools-CDJH5neO.js → use-mcp-tools-CQfCwxkd.js} +1 -1
  200. package/dist/client/assets/{use-members-CyywM31O.js → use-members-BVllv9zE.js} +1 -1
  201. package/dist/client/assets/{use-navigate-to-agent-BNbXqzhZ.js → use-navigate-to-agent-TUCZuJc7.js} +1 -1
  202. package/dist/client/assets/{use-org-auth-client-DtWtVTSq.js → use-org-auth-client-_NaVbX55.js} +1 -1
  203. package/dist/client/assets/{use-org-repo-syncs-B1sbs130.js → use-org-repo-syncs-CnqFxL-J.js} +1 -1
  204. package/dist/client/assets/{use-org-sso-E6PP4tUf.js → use-org-sso-D3r9v7sg.js} +1 -1
  205. package/dist/client/assets/{use-organization-roles-CSeA_DI-.js → use-organization-roles-BuHWkNiq.js} +1 -1
  206. package/dist/client/assets/{use-organization-settings-Cru4OoJD.js → use-organization-settings--cHe2tye.js} +1 -1
  207. package/dist/client/assets/{use-panel-navigate-BPALkiCE.js → use-panel-navigate-EbUCimGS.js} +1 -1
  208. package/dist/client/assets/{use-registry-connections-D1CcUTZK.js → use-registry-connections-iJ2vJKj5.js} +1 -1
  209. package/dist/client/assets/{use-secrets-DomjJQTO.js → use-secrets-D4kTeYpw.js} +1 -1
  210. package/dist/client/assets/{use-section-preview-base-CQNqY3eL.js → use-section-preview-base-DlzLTv4U.js} +1 -1
  211. package/dist/client/assets/{use-status-sounds-Dgs4MBWr.js → use-status-sounds-DQ_p5sTG.js} +1 -1
  212. package/dist/client/assets/{use-tags-CdHLTGh0.js → use-tags-DiAPHRvm.js} +1 -1
  213. package/dist/client/assets/{use-view-mode-C6OwZrbQ.js → use-view-mode-D-6oHlya.js} +1 -1
  214. package/dist/client/assets/{use-virtual-mcp-Br7s7rsG.js → use-virtual-mcp-8xFvtkdT.js} +1 -1
  215. package/dist/client/assets/useInfiniteQuery-jV98OZc4.js +1 -0
  216. package/dist/client/assets/useSuspenseInfiniteQuery-CiWiHNLV.js +1 -0
  217. package/dist/client/assets/{users-DqK9_jem.js → users-DywD8QP6.js} +1 -1
  218. package/dist/client/assets/{variant-calendar-B-GEBLXu.js → variant-calendar-yZ2Cfm3I.js} +1 -1
  219. package/dist/client/assets/{view-mode-toggle-DB2JMUp5.js → view-mode-toggle-CX0JuVR6.js} +1 -1
  220. package/dist/client/index.html +1 -1
  221. package/dist/server/cli.js +4 -4
  222. package/dist/server/server.js +4 -4
  223. package/package.json +1 -1
  224. package/dist/client/assets/record-editor-DwcCSEx6.js +0 -1
  225. package/dist/client/assets/registry-Cg4b_PCo.js +0 -2
  226. package/dist/client/assets/store-registry-B0_hO73O.js +0 -2
  227. package/dist/client/assets/useInfiniteQuery-CZrRveyC.js +0 -1
  228. package/dist/client/assets/useSuspenseInfiniteQuery-DmtmbD4_.js +0 -1
@@ -1 +1 @@
1
- import{c as K,b as J,r as Z,j as o,n as rt,a8 as ut,ab as ht,B as tt,a9 as xt}from"./index-Dt4xzxRh.js";import{r as gt,X as at,aF as bt}from"./agent-icon-1Uy4JHGE.js";import{i as vt}from"./ChevronRight-CGhhUMqZ.js";import{L as yt}from"./label-4acATUDo.js";import{S as lt}from"./scroll-area-Bp3GVSr-.js";import{S as jt}from"./switch-B9S-ReOo.js";import{V as Tt}from"./view-mode-toggle-DB2JMUp5.js";import{bP as ct,bQ as mt,bR as Nt,bS as _t,bT as kt,bU as U,bV as wt}from"./index-D1fIy1Q8.js";import"./AlertCircle-CQHLdRGZ.js";import"./UserSquare-DTydatTQ.js";import"./Tool01-CXcsQpcs.js";import"./ArrowUp-BYUc6rLi.js";import"./ArrowLeft-CiGURYfW.js";import"./Tool02-CHOuYkmG.js";import"./XCircle-D0PGfwFN.js";import"./TrendUp01-BXUsJCPa.js";import"./ZapSquare-BSDBm0-3.js";import"./Users03-B1L_e4Us.js";import"./CheckCircle-CAmi_hLt.js";import"./Check-D2uR7VS6.js";import"./ChevronDown-8xCHcxO5.js";import"./ChevronSelectorVertical-cbyqr5lK.js";import"./ChevronUp-DsbjTZEU.js";import"./DotsVertical-Dn5tfgWo.js";import"./Stars02-BWM8HAhO.js";import"./Copy01-Ci-gY1Mf.js";import"./CreditCard01-BNcyZEcR.js";import"./Download01-DvsX90Og.js";import"./Settings02-C-VuMkOS.js";import"./Eye-DlUCg5eK.js";import"./FilterLines-UPH8xWau.js";import"./Share07-Bs7pdZjs.js";import"./Globe01-DmgQnFDH.js";import"./Globe04-D0ajJFya.js";import"./SwitchHorizontal01-B3pukb_d.js";import"./HardDrive-BHuyK3fS.js";import"./Key01-5YRgt-NM.js";import"./LinkExternal01-CCFX8C9r.js";import"./LockUnlocked01-BPszj4SU.js";import"./LogOut01--XDLMXg4.js";import"./Monitor01-lA6KBTMH.js";import"./Sun-38XX85KF.js";import"./Palette-C6GfWC5O.js";import"./Play-w0QeyPJg.js";import"./Plus-DJ1u9cvh.js";import"./SearchLg-ioZdvcNv.js";import"./SearchMd-CSkF3NuW.js";import"./Shield01-hMr_AjYy.js";import"./Stars01-C2yF4VK7.js";import"./Trash01-B8L_kHj2.js";import"./Upload01-D8nl8bCp.js";import"./User01-UY13B65C.js";import"./Users01-Cmd-sb0e.js";import"./XClose-IrMEsBvE.js";import"./Zap-BG8w2q-h.js";import"./select-4uUeWpPU.js";import"./chat-context-Dd07RQrC.js";import"./use-panel-navigate-BPALkiCE.js";import"./dialog-BsgKtXcv.js";import"./use-destination-route-Bn3yIPW-.js";import"./constants-dLUUoWH7.js";import"./session-runtime-C-KTDVeQ.js";import"./slugify-CEUa2lfQ.js";import"./hooks-pRLjI1ki.js";import"./use-mcp-client-DkdpleIo.js";import"./auth-CL7BB7R8.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-BgJs9Iz4.js";import"./task-board-RnD3TOhC.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-Br7s7rsG.js";import"./use-ai-providers-CWrLm1AD.js";import"./use-decopilot-events-C4VqK85Z.js";import"./use-organization-settings-Cru4OoJD.js";import"./automation-runs-DZqc6zdF.js";import"./useInfiniteQuery-CZrRveyC.js";import"./use-infinite-scroll-CRoLBkCZ.js";import"./use-connection-BgNmeJig.js";import"./table-lkBea1Xl.js";import"./empty-state-3yTa4zv_.js";import"./use-members-CyywM31O.js";import"./use-org-auth-client-DtWtVTSq.js";import"./use-automations-BKaWtSiV.js";import"./useSuspenseInfiniteQuery-DmtmbD4_.js";import"./avatar-VZD77tJt.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-D0SrfqIt.js";import"./monaco-editor-CadZW_y5.js";import"./spinner-D3iuVgRx.js";import"./types-CxWdrWNU.js";import"./shell-layout-97WWXRZC.js";import"./required-auth-layout-DUIsRLzp.js";import"./use-org-sso-E6PP4tUf.js";import"./integration-icon-CAak33zg.js";import"./use-navigate-to-agent-BNbXqzhZ.js";import"./chart-CSNQ-UDK.js";import"./index-BoJxSoCi.js";import"./form-Dx0MB3fU.js";import"./input-C0NkEUr-.js";import"./file-type-icon-h-gu0AyD.js";import"./drawer-bVZuQnUm.js";import"./collection-search-DNi1PrKS.js";import"./tabs-D3ItZX7-.js";import"./toggle-group-BDLHVTfC.js";import"./super-agent-icon-CtnmJgjL.js";import"./self-tool-result-Dt4_R2Xj.js";import"./alert-dialog-CKals38I.js";import"./extract-connection-data-s0CjKUai.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-CMPWtdMv.js";import"./use-debounced-value-V53g41E7.js";import"./authenticate-and-persist-oauth-DwF5HsDl.js";import"./mcp-oauth-CudkBTAh.js";import"./track-fnUcFwb2.js";import"./popover-B6-Ys0fY.js";import"./toolbar-C1nhAu84.js";import"./github-repo-picker-D0s7lCE_.js";import"./use-mcp-tools-CDJH5neO.js";import"./agent-capabilities-B52k7xCe.js";import"./connection-card-DarWMyyd.js";import"./use-registry-connections-D1CcUTZK.js";import"./retry-CErkP7V6.js";import"./connection-slug-CITJ0kGN.js";import"./textarea-CvTRHsZk.js";import"./connection-form-helpers-CZpFHqZl.js";import"./collection-tabs-Dk9BdEwW.js";import"./badge-D2iqafj_.js";import"./select-model-TFKAmtgQ.js";import"./checkbox-DgLrlAzs.js";import"./ai-providers-logos-DD3qZ33J.js";import"./cards-BGOKqQ27.js";import"./dropdown-menu-DaPMfZJL.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-Dgs4MBWr.js";import"./use-file-configs-Dyw7-pny.js";import"./pt-BR-CLy76QW2.js";import"./use-debounced-autosave-B5VYl10E.js";import"./search-input-DbOHtzd0.js";import"./use-mcp-auth-status-r8CXlFWH.js";import"./use-secrets-DomjJQTO.js";import"./AreaChart-BKxFF8dx.js";import"./config-BrOhINT3.js";import"./command-DVD7kHdL.js";import"./index-KTd_KQqb.js";import"./get-initials-D-f_fDFw.js";import"./breadcrumb-CIieoQwM.js";import"./use-tags-CdHLTGh0.js";import"./automation-list-row-Bcc9lQX_.js";import"./site-error--i37Vnuw.js";import"./use-org-repo-syncs-B1sbs130.js";const Et=new Set(["website/matchers/date.ts","$live/matchers/MatchDate.ts"]),St=new Set(["website/matchers/multi.ts","$live/matchers/MatchMulti.ts"]),Ct=new Date(-864e13),Mt=new Date(864e13),At=/\/flags\/multivariate(?:\/[^/]+)?\.ts$/,$t=/\/flags\/multivariate\.ts$/;function Rt(e){let t=e;t.startsWith("pages-")&&(t=t.slice(6).replace(/-\d+$/,""));try{t=decodeURIComponent(t)}catch{}return t}function Lt(e){if(!e||typeof e!="object")return null;const{start:t,end:r}=e,n=typeof t=="string",s=typeof r=="string";if(!n&&!s)return null;const i=n?new Date(t):Ct,a=s?new Date(r):Mt;return Number.isNaN(i.getTime())||Number.isNaN(a.getTime())||n&&s&&a.getTime()<=i.getTime()?null:{start:i,end:a,openStart:!n,openEnd:!s}}function pt(e,t){if(!e||typeof e!="object")return;const r=e.__resolveType;if(typeof r=="string"){if(Et.has(r)){const n=Lt(e);n&&t.push(n);return}if(St.has(r)){const n=e.matchers;if(Array.isArray(n))for(const s of n)pt(s,t)}}}function Dt(e){if(!e||typeof e!="object")return!1;const t=e.__resolveType;if(typeof t!="string"||!At.test(t))return!1;const r=e.variants;return Array.isArray(r)}function Pt(e){if(typeof e=="string"){const c=e.trim();if(c.length===0)return null;try{const m=new URL(c).pathname.split("/").filter(Boolean),p=m[m.length-1];if(p)return decodeURIComponent(p)}catch{}return c.length>80?`${c.slice(0,77)}…`:c}if(!e||typeof e!="object")return null;const t=e,r=t.config,s=t.desktop?.media,i=[t.title,t.name,t.label,t.alt,r?.title,r?.name,r?.typeAlert?.message,s?.alt,Array.isArray(t.matcher)?t.matcher[0]:void 0];for(const c of i)if(typeof c=="string"&&c.trim().length>0)return c.trim();const a=t.__resolveType;if(typeof a=="string"){const l=(a.split("/").pop()??a).replace(/\.(tsx?|jsx?)$/i,"");if(l.length>0)return l}return null}function Ot(e){const t=[];for(let r=0;r<e.length;r++){const n=e[r];typeof n=="number"?t.length>0?t[t.length-1]+=`[${n}]`:t.push(`[${n}]`):t.push(n)}return t.join(" · ")}function q(e,t,r,n,s){if(Dt(e)){const i=e.variants,a=e.__resolveType,c=$t.test(a)?"":Ot(n);i.forEach((l,m)=>{if(!l||typeof l!="object")return;const p=l,h=[];if(pt(p.rule,h),h.length===0)return;const g=Pt(p.value)??(c||r);for(const u of h)s.push({blockKey:t,blockLabel:r,innerPath:c,variantIndex:m,start:u.start,end:u.end,openStart:u.openStart,openEnd:u.openEnd,label:g,flagResolveType:a})});for(let l=0;l<i.length;l++){const m=i[l];m&&typeof m=="object"&&q(m.value,t,r,[...n,"variants",l,"value"],s)}return}if(Array.isArray(e)){for(let i=0;i<e.length;i++)q(e[i],t,r,[...n,i],s);return}if(e&&typeof e=="object")for(const[i,a]of Object.entries(e))i!=="__resolveType"&&q(a,t,r,[...n,i],s)}function Vt(e){if(!e)return[];const t=[];for(const[r,n]of Object.entries(e))q(n,r,Rt(r),[],t);return t.sort((r,n)=>r.start.getTime()-n.start.getTime())}function It(e){const t=[...new Set(e)].sort(),r=new Map;return t.forEach((n,s)=>{const i=s*137.508%360;r.set(n,{bg:`oklch(0.62 0.14 ${i})`,text:"white",border:`oklch(0.50 0.14 ${i})`})}),r}const Ht={bg:"oklch(0.62 0.14 0)",text:"white",border:"oklch(0.50 0.14 0)"};function dt(e,t){return e.get(t)??Ht}const nt=new Intl.DateTimeFormat("en",{dateStyle:"medium",timeStyle:"short"});function Bt(e,t){const r=e.openStart?t("sandbox.variantCalendar.always"):nt.format(e.start),n=e.openEnd?t("sandbox.variantCalendar.ongoing"):nt.format(e.end);return`${r} → ${n}`}function Ft(e){const t=K.c(18),{variant:r}=e,n=J();let s;t[0]!==r.blockLabel?(s=o.jsx("div",{className:"font-semibold",children:r.blockLabel}),t[0]=r.blockLabel,t[1]=s):s=t[1];let i;t[2]!==r.innerPath?(i=r.innerPath&&o.jsx("div",{className:"text-muted-foreground",children:r.innerPath}),t[2]=r.innerPath,t[3]=i):i=t[3];let a;t[4]!==r.blockLabel||t[5]!==r.innerPath||t[6]!==r.label?(a=r.label!==r.blockLabel&&r.label!==r.innerPath&&o.jsx("div",{className:"text-muted-foreground",children:r.label}),t[4]=r.blockLabel,t[5]=r.innerPath,t[6]=r.label,t[7]=a):a=t[7];let c;t[8]!==n||t[9]!==r?(c=Bt(r,n),t[8]=n,t[9]=r,t[10]=c):c=t[10];let l;t[11]!==c?(l=o.jsx("div",{className:"mt-1",children:c}),t[11]=c,t[12]=l):l=t[12];let m;return t[13]!==s||t[14]!==i||t[15]!==a||t[16]!==l?(m=o.jsx(xt,{children:o.jsxs("div",{className:"text-xs",children:[s,i,a,l]})}),t[13]=s,t[14]=i,t[15]=a,t[16]=l,t[17]=m):m=t[17],m}const ot=16;function zt(e,t){const r=e?"transparent":"#000 0",n=t?"transparent":"#000 100%";if(!(!e&&!t))return`linear-gradient(to right, ${r}, #000 ${ot}px, #000 calc(100% - ${ot}px), ${n})`}function ft(e){const t=K.c(26),{variant:r,color:n,style:s,children:i,fadeStart:a,fadeEnd:c}=e,l=a===void 0?!1:a,m=c===void 0?!1:c;let p;t[0]!==m||t[1]!==l?(p=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]!==n.bg||t[10]!==n.text||t[11]!==s||t[12]!==f||t[13]!==g||t[14]!==u?(x={background:n.bg,color:n.text,borderRadius:4,...f,...g,...u,...s},t[9]=n.bg,t[10]=n.text,t[11]=s,t[12]=f,t[13]=g,t[14]=u,t[15]=x):x=t[15];let b;t[16]!==i?(b=o.jsx("span",{className:"truncate",children:i}),t[16]=i,t[17]=b):b=t[17];let E;t[18]!==x||t[19]!==b?(E=o.jsx(ut,{asChild:!0,children:o.jsx("div",{className:"absolute flex items-center px-2 text-[11px] font-medium truncate cursor-default",style:x,children:b})}),t[18]=x,t[19]=b,t[20]=E):E=t[20];let T;t[21]!==r?(T=o.jsx(Ft,{variant:r}),t[21]=r,t[22]=T):T=t[22];let d;return t[23]!==T||t[24]!==E?(d=o.jsxs(ht,{children:[E,T]}),t[23]=T,t[24]=E,t[25]=d):d=t[25],d}function Qn(e){const t=K.c(72),{decofile:r}=e,n=J(),[s,i]=Z.useState("calendar"),[a,c]=Z.useState(Kt),[l,m]=Z.useState(!1);let p,h,f;if(t[0]!==r||t[1]!==l){const V=Vt(r);p=V.filter(Ut).length,f=l?V:V.filter(Gt),h=It(f.map(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(V=>s==="calendar"?U(V,-1):U(V,-3)),t[6]=s,t[7]=b):b=t[7];const E=b;let T;t[8]!==s?(T=()=>c(V=>s==="calendar"?U(V,1):U(V,3)),t[8]=s,t[9]=T):T=t[9];const d=T;let v;t[10]!==n?(v=n("sandbox.variantCalendar.today"),t[10]=n,t[11]=v):v=t[11];let y;t[12]!==v?(y=o.jsx(tt,{variant:"outline",size:"sm",onClick:x,children:v}),t[12]=v,t[13]=y):y=t[13];let N;t[14]!==n?(N=n("sandbox.variantCalendar.previous"),t[14]=n,t[15]=N):N=t[15];let A;t[16]===Symbol.for("react.memo_cache_sentinel")?(A=o.jsx(gt,{size:16}),t[16]=A):A=t[16];let _;t[17]!==E||t[18]!==N?(_=o.jsx(tt,{variant:"ghost",size:"icon",className:"size-8",onClick:E,"aria-label":N,children:A}),t[17]=E,t[18]=N,t[19]=_):_=t[19];let k;t[20]!==n?(k=n("sandbox.variantCalendar.next"),t[20]=n,t[21]=k):k=t[21];let C;t[22]===Symbol.for("react.memo_cache_sentinel")?(C=o.jsx(vt,{size:16}),t[22]=C):C=t[22];let $;t[23]!==d||t[24]!==k?($=o.jsx(tt,{variant:"ghost",size:"icon",className:"size-8",onClick:d,"aria-label":k,children:C}),t[23]=d,t[24]=k,t[25]=$):$=t[25];const R=ct[a.getMonth()];let M;t[26]!==a?(M=a.getFullYear(),t[26]=a,t[27]=M):M=t[27];let w;t[28]!==R||t[29]!==M?(w=o.jsxs("h2",{className:"ml-2 text-base font-semibold",children:[R," ",M]}),t[28]=R,t[29]=M,t[30]=w):w=t[30];let j;t[31]!==$||t[32]!==w||t[33]!==y||t[34]!==_?(j=o.jsxs("div",{className:"flex items-center gap-2",children:[y,_,$,w]}),t[31]=$,t[32]=w,t[33]=y,t[34]=_,t[35]=j):j=t[35];let L;t[36]!==p||t[37]!==l||t[38]!==n?(L=p>0&&o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(jt,{id:"show-ongoing",checked:l,onCheckedChange:m}),o.jsx(yt,{htmlFor:"show-ongoing",className:"text-xs text-muted-foreground cursor-pointer",children:n("sandbox.variantCalendar.showOngoing",{count:p})})]}),t[36]=p,t[37]=l,t[38]=n,t[39]=L):L=t[39];let B;t[40]===Symbol.for("react.memo_cache_sentinel")?(B=o.jsx(at,{}),t[40]=B):B=t[40];let I;t[41]!==n?(I=n("sandbox.variantCalendar.calendarMode"),t[41]=n,t[42]=I):I=t[42];let S;t[43]!==I?(S={value:"calendar",icon:B,label:I},t[43]=I,t[44]=S):S=t[44];let F;t[45]===Symbol.for("react.memo_cache_sentinel")?(F=o.jsx(bt,{}),t[45]=F):F=t[45];let D;t[46]!==n?(D=n("sandbox.variantCalendar.timelineMode"),t[46]=n,t[47]=D):D=t[47];let P;t[48]!==D?(P={value:"timeline",icon:F,label:D},t[48]=D,t[49]=P):P=t[49];let O;t[50]!==S||t[51]!==P?(O=[S,P],t[50]=S,t[51]=P,t[52]=O):O=t[52];let H;t[53]!==O||t[54]!==s?(H=o.jsx(Tt,{value:s,onValueChange:i,options:O}),t[53]=O,t[54]=s,t[55]=H):H=t[55];let z;t[56]!==L||t[57]!==H?(z=o.jsxs("div",{className:"flex items-center gap-4",children:[L,H]}),t[56]=L,t[57]=H,t[58]=z):z=t[58];let W;t[59]!==j||t[60]!==z?(W=o.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?o.jsx(Yt,{hiddenOngoing:l?0:p}):s==="calendar"?o.jsx(Xt,{monthStart:a,variants:f,colorMap:g}):o.jsx(te,{monthStart:a,variants:f,colorMap:g}),t[62]=g,t[63]=a,t[64]=p,t[65]=l,t[66]=f,t[67]=s,t[68]=G):G=t[68];let Q;return t[69]!==W||t[70]!==G?(Q=o.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,n=r===void 0?0:r,s=J();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(at,{size:24,className:"text-muted-foreground/60"}),t[0]=i):i=t[0];let a;return t[1]!==n||t[2]!==s?(a=o.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-2 text-center text-sm text-muted-foreground p-6",children:[i,n>0?o.jsxs(o.Fragment,{children:[o.jsx("div",{children:s("sandbox.variantCalendar.noDatedVariants")}),o.jsx("div",{className:"text-xs text-muted-foreground/80",children:s("sandbox.variantCalendar.hiddenOngoingVariants",{count:n})})]}):o.jsxs(o.Fragment,{children:[o.jsx("div",{children:s("sandbox.variantCalendar.noScheduledVariants")}),o.jsx("div",{className:"text-xs text-muted-foreground/80",children:s("sandbox.variantCalendar.dateMatcherInfo")})]})]}),t[1]=n,t[2]=s,t[3]=a):a=t[3],a}const et=20,it=2,st=28,Qt=6;function Xt(e){const t=K.c(17),{monthStart:r,variants:n,colorMap:s}=e;let i,a,c,l,m;if(t[0]!==s||t[1]!==r||t[2]!==n){const f=Nt(r),g=_t(new Date);i=lt,m="flex-1 min-h-0",a="min-w-[840px]",t[8]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx("div",{className:"grid grid-cols-7 border-b text-xs text-muted-foreground sticky top-0 bg-background z-10",children:wt.map(Jt)}),t[8]=c):c=t[8],l=f.map((u,x)=>{const b=kt(u,n),E=b.reduce(qt,0),T=st+E*(et+it)+8;return o.jsxs("div",{className:"grid grid-cols-7 relative border-b",style:{height:T},children:[u.map((d,v)=>{const y=d.getMonth()===r.getMonth(),N=d.getTime()===g.getTime();return o.jsx("div",{className:rt("border-r last:border-r-0 px-2 pt-1.5 text-xs",y?"bg-background":"bg-muted/30 text-muted-foreground"),children:o.jsx("span",{className:rt("inline-flex h-5 min-w-5 items-center justify-center rounded-full px-1",N&&"bg-primary text-primary-foreground font-semibold"),children:d.getDate()})},v)}),b.map((d,v)=>{const y=dt(s,d.variant.blockKey),N=st+d.lane*(et+it),A=d.leftUnits/7*100,_=d.widthUnits/7*100,k=d.variant.openStart&&x===0,C=d.variant.openEnd&&x===f.length-1;return o.jsxs(ft,{variant:d.variant,color:y,fadeStart:k,fadeEnd:C,style:{top:N,left:`calc(${A}% + 2px)`,width:`calc(${_}% - 4px)`,minWidth:Qt,height:et},children:[d.variant.blockLabel,d.variant.label!==d.variant.blockLabel&&o.jsxs("span",{className:"opacity-70",children:[" · ",d.variant.label]})]},`${x}-${v}`)})]},x)}),t[0]=s,t[1]=r,t[2]=n,t[3]=i,t[4]=a,t[5]=c,t[6]=l,t[7]=m}else i=t[3],a=t[4],c=t[5],l=t[6],m=t[7];let p;t[9]!==a||t[10]!==c||t[11]!==l?(p=o.jsxs("div",{className:a,children:[c,l]}),t[9]=a,t[10]=c,t[11]=l,t[12]=p):p=t[12];let h;return t[13]!==i||t[14]!==m||t[15]!==p?(h=o.jsx(i,{className:m,children:p}),t[13]=i,t[14]=m,t[15]=p,t[16]=h):h=t[16],h}function qt(e,t){return Math.max(e,t.lane+1)}function Jt(e){return o.jsx("div",{className:"px-2 py-2 text-center uppercase tracking-wide",children:e},e)}const X=4,Zt=32,Y=240;function te(e){const t=K.c(23),{monthStart:r,variants:n,colorMap:s}=e,i=r,a=U(r,X),c=new Date,l=new Map;for(const w of n){const j=l.get(w.blockKey)??[];j.push(w),l.set(w.blockKey,j)}const m=Array.from(l.entries()).sort(ne),p=a.getTime()-i.getTime(),h=w=>(Math.max(i.getTime(),Math.min(a.getTime(),w.getTime()))-i.getTime())/p*100;let f;t[0]!==i?(f=(w,j)=>U(i,j),t[0]=i,t[1]=f):f=t[1];const g=Array.from({length:X},f),u=c.getTime()>=i.getTime()&&c.getTime()<=a.getTime()?h(c):null,x=J(),b=lt,E="flex-1 min-h-0",T="min-w-[900px] relative";let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d={width:Y},t[2]=d):d=t[2];let v;t[3]!==x?(v=x("sandbox.variantCalendar.variantBlock"),t[3]=x,t[4]=v):v=t[4];let y;t[5]!==v?(y=o.jsx("div",{className:"shrink-0 px-3 py-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground border-r",style:d,children:v}),t[5]=v,t[6]=y):y=t[6];let N;t[7]===Symbol.for("react.memo_cache_sentinel")?(N={gridTemplateColumns:`repeat(${X}, minmax(0, 1fr))`},t[7]=N):N=t[7];const A=g.map(re);let _;t[8]!==A?(_=o.jsx("div",{className:"flex-1 grid",style:N,children:A}),t[8]=A,t[9]=_):_=t[9];let k;t[10]!==y||t[11]!==_?(k=o.jsxs("div",{className:"flex border-b sticky top-0 bg-background z-10",children:[y,_]}),t[10]=y,t[11]=_,t[12]=k):k=t[12];let C;t[13]!==x||t[14]!==u?(C=u!==null&&o.jsx("div",{className:"pointer-events-none absolute top-0 bottom-0 w-px bg-primary/70 z-[5]",style:{left:`calc(${Y}px + (100% - ${Y}px) * ${u} / 100)`},children:o.jsx("span",{className:"absolute -top-0.5 -translate-x-1/2 rounded-sm bg-primary px-1.5 py-px text-[10px] font-medium text-primary-foreground",children:x("sandbox.variantCalendar.todayLabel")})}),t[13]=x,t[14]=u,t[15]=C):C=t[15];const $=m.map(w=>{const[j,L]=w,B=dt(s,j),I=L[0]?.blockLabel??j;return o.jsxs("div",{children:[o.jsx("div",{className:"flex items-center bg-muted/40 border-b text-xs font-semibold uppercase tracking-wide text-muted-foreground",style:{height:28},children:o.jsx("div",{className:"px-3 truncate",style:{width:Y},children:I})}),L.map((S,F)=>o.jsxs("div",{className:"flex border-b items-center",style:{height:Zt},children:[o.jsxs("div",{className:"flex items-center gap-2 px-3 text-sm border-r shrink-0",style:{width:Y},children:[o.jsx("span",{className:"inline-block h-2 w-2 rounded-full shrink-0",style:{background:B.bg}}),o.jsx("span",{className:"truncate text-foreground/80",children:S.label})]}),o.jsxs("div",{className:"relative flex-1 h-full",children:[o.jsx("div",{className:"absolute inset-0 grid",style:{gridTemplateColumns:`repeat(${X}, minmax(0, 1fr))`},children:g.map(ee)}),(()=>{const D=Math.max(S.start.getTime(),i.getTime()),P=Math.min(S.end.getTime(),a.getTime());if(P<=D)return null;const O=h(new Date(D)),H=h(new Date(P))-O;return o.jsx(ft,{variant:S,color:B,fadeStart:S.openStart,fadeEnd:S.openEnd,style:{top:"50%",transform:"translateY(-50%)",left:`${O}%`,width:`calc(${H}% - 2px)`,height:22},children:S.label})})()]})]},F))]},j)});let R;t[16]!==k||t[17]!==C||t[18]!==$?(R=o.jsxs("div",{className:T,children:[k,C,$]}),t[16]=k,t[17]=C,t[18]=$,t[19]=R):R=t[19];let M;return t[20]!==b||t[21]!==R?(M=o.jsx(b,{className:E,children:R}),t[20]=b,t[21]=R,t[22]=M):M=t[22],M}function ee(e,t){return o.jsx("div",{className:"border-r last:border-r-0 border-border/40"},t)}function re(e,t){return o.jsxs("div",{className:"px-2 py-2 text-xs uppercase tracking-wide text-muted-foreground border-r last:border-r-0",children:[ct[e.getMonth()]?.slice(0,3)," ",e.getFullYear()]},t)}function ne(e,t){return e[0].localeCompare(t[0])}export{Qn as VariantCalendar};
1
+ import{c as K,b as J,r as Z,j as o,n as rt,a8 as ut,ab as ht,B as tt,a9 as xt}from"./index-DFQ7B_Sf.js";import{r as gt,X as at,aF as bt}from"./agent-icon-Bjpha3cs.js";import{i as vt}from"./ChevronRight-Ch2rGsyq.js";import{L as yt}from"./label-BnXVpW2e.js";import{S as lt}from"./scroll-area-BgBhUly0.js";import{S as jt}from"./switch-BMCQK8MD.js";import{V as Tt}from"./view-mode-toggle-CX0JuVR6.js";import{bP as ct,bQ as mt,bR as Nt,bS as _t,bT as kt,bU as U,bV as wt}from"./index-Df2MdOeK.js";import"./AlertCircle-o5t7U15t.js";import"./UserSquare-C9rYyfxZ.js";import"./Tool01-CDqPr35h.js";import"./ArrowUp-BNC0MSN-.js";import"./ArrowLeft-BzPUvIx9.js";import"./Tool02-BjT1M9ir.js";import"./XCircle-BTd3BEve.js";import"./TrendUp01-CFOguoVE.js";import"./ZapSquare-DURaAlG-.js";import"./Users03-BgDUOxWA.js";import"./CheckCircle-Cc1EAQjv.js";import"./Check-DfafgaAY.js";import"./ChevronDown-UHjPt6Qe.js";import"./ChevronSelectorVertical-DG0Q3XC8.js";import"./ChevronUp-DKdb4Eo4.js";import"./DotsVertical-CvIhN54Z.js";import"./Stars02-Dd3xKr-z.js";import"./Copy01-CEF6KRyx.js";import"./CreditCard01-DW7cwpEq.js";import"./Download01-BpLrWUFQ.js";import"./Settings02-D4Ram1T9.js";import"./Eye-IK9N_TfF.js";import"./FilterLines-Bd3Ptc1T.js";import"./Share07-BFMljC78.js";import"./Globe01-C8KRyGo7.js";import"./Globe04-BMuOnFJ3.js";import"./SwitchHorizontal01-DBDiv7sg.js";import"./HardDrive-1pokgOWi.js";import"./Key01-edZRndMN.js";import"./LinkExternal01-C_PAGPOZ.js";import"./LockUnlocked01-BvU3hsT9.js";import"./LogOut01-LRdOq5m-.js";import"./Monitor01-BeWnEnSY.js";import"./Sun-C2cW_PcA.js";import"./Palette-1ykwXBgq.js";import"./Play-C-fxdXTO.js";import"./Plus-D-eBf55E.js";import"./SearchLg-AgMTy3BF.js";import"./SearchMd-Bgqo_RaG.js";import"./Shield01-Bpvx1AOq.js";import"./Stars01-C1v7BKtA.js";import"./Trash01-C6X-F7mu.js";import"./Upload01-Cb4JYHDC.js";import"./User01-CyUZVodK.js";import"./Users01-BNehX3Bh.js";import"./XClose-CCVjmK8v.js";import"./Zap-DOHkfpLH.js";import"./select-Cjk2AUj1.js";import"./chat-context-Dbw0_twF.js";import"./use-panel-navigate-EbUCimGS.js";import"./dialog-BR-ndDjN.js";import"./use-destination-route-tnL8wDrQ.js";import"./constants-dLUUoWH7.js";import"./session-runtime-C-KTDVeQ.js";import"./slugify-CEUa2lfQ.js";import"./hooks-DVvA4Xmp.js";import"./use-mcp-client-BJ_ALPey.js";import"./auth-DlQPhcEa.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-BV1Pl6oC.js";import"./task-board-wbmrgVVh.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-8xFvtkdT.js";import"./use-ai-providers-DhVzMXYe.js";import"./use-decopilot-events-ao16VX3T.js";import"./use-organization-settings--cHe2tye.js";import"./automation-runs-9F2Kg7Ou.js";import"./useInfiniteQuery-jV98OZc4.js";import"./use-infinite-scroll-C_3JSRjC.js";import"./use-connection-B2I_GOM8.js";import"./table-ZlgGNlS7.js";import"./empty-state-CTj88i_y.js";import"./use-members-BVllv9zE.js";import"./use-org-auth-client-_NaVbX55.js";import"./use-automations-_u9wybg_.js";import"./useSuspenseInfiniteQuery-CiWiHNLV.js";import"./avatar-DtRDldyk.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-B6X1cSHu.js";import"./monaco-editor-ru5RXsgR.js";import"./spinner-AK5_UOCr.js";import"./types-C1a5wA7-.js";import"./shell-layout-D8H0owB6.js";import"./required-auth-layout-uuz0cSqY.js";import"./use-org-sso-D3r9v7sg.js";import"./integration-icon-DIrDcntg.js";import"./use-navigate-to-agent-TUCZuJc7.js";import"./chart-CXPbjuTK.js";import"./index-CkXINtXQ.js";import"./form-DOJVAylR.js";import"./input-B5QtPTJ7.js";import"./file-type-icon-C2d3NqsJ.js";import"./drawer-Cub20IZd.js";import"./collection-search-DlN6SiVG.js";import"./tabs-CiCpcxs6.js";import"./toggle-group-BiLDWWon.js";import"./super-agent-icon-BPFuSMCj.js";import"./self-tool-result-nB04jYuu.js";import"./alert-dialog-BnDTGXEL.js";import"./extract-connection-data-CWEOpT1y.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-CMPWtdMv.js";import"./use-debounced-value-LgM3Xy5X.js";import"./authenticate-and-persist-oauth-CNCEB1RG.js";import"./mcp-oauth-DH571Q1I.js";import"./track-DNFE4hs8.js";import"./popover-BtHmFZRF.js";import"./toolbar-Cm9cLldv.js";import"./github-repo-picker-D0CY7fOf.js";import"./use-mcp-tools-CQfCwxkd.js";import"./agent-capabilities-B52k7xCe.js";import"./connection-card-NoJ_awE8.js";import"./use-registry-connections-iJ2vJKj5.js";import"./retry-CErkP7V6.js";import"./connection-slug-CITJ0kGN.js";import"./textarea-CwhPYTd9.js";import"./connection-form-helpers-wEHSYkED.js";import"./collection-tabs-HNE4vRGw.js";import"./badge-BBhIil8X.js";import"./select-model-B-L3ys6R.js";import"./checkbox-CxuFut4g.js";import"./ai-providers-logos-DD3qZ33J.js";import"./cards-BZiUCjkV.js";import"./dropdown-menu-Kz_TrGoE.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-DQ_p5sTG.js";import"./use-file-configs-DtIcvEgh.js";import"./pt-BR-CLy76QW2.js";import"./use-debounced-autosave-FpcaWjA4.js";import"./search-input-Clumrfm-.js";import"./use-mcp-auth-status-bU7QiM0v.js";import"./use-secrets-D4kTeYpw.js";import"./AreaChart-BJKh0Xo9.js";import"./config-4vJn8hUX.js";import"./command-DW9HbR0N.js";import"./index-Dk2zEps_.js";import"./get-initials-D-f_fDFw.js";import"./breadcrumb-DYsxL3nb.js";import"./use-tags-DiAPHRvm.js";import"./automation-list-row-DGZFkIIX.js";import"./site-error--i37Vnuw.js";import"./use-org-repo-syncs-CnqFxL-J.js";const Et=new Set(["website/matchers/date.ts","$live/matchers/MatchDate.ts"]),St=new Set(["website/matchers/multi.ts","$live/matchers/MatchMulti.ts"]),Ct=new Date(-864e13),Mt=new Date(864e13),At=/\/flags\/multivariate(?:\/[^/]+)?\.ts$/,$t=/\/flags\/multivariate\.ts$/;function Rt(e){let t=e;t.startsWith("pages-")&&(t=t.slice(6).replace(/-\d+$/,""));try{t=decodeURIComponent(t)}catch{}return t}function Lt(e){if(!e||typeof e!="object")return null;const{start:t,end:r}=e,n=typeof t=="string",s=typeof r=="string";if(!n&&!s)return null;const i=n?new Date(t):Ct,a=s?new Date(r):Mt;return Number.isNaN(i.getTime())||Number.isNaN(a.getTime())||n&&s&&a.getTime()<=i.getTime()?null:{start:i,end:a,openStart:!n,openEnd:!s}}function pt(e,t){if(!e||typeof e!="object")return;const r=e.__resolveType;if(typeof r=="string"){if(Et.has(r)){const n=Lt(e);n&&t.push(n);return}if(St.has(r)){const n=e.matchers;if(Array.isArray(n))for(const s of n)pt(s,t)}}}function Dt(e){if(!e||typeof e!="object")return!1;const t=e.__resolveType;if(typeof t!="string"||!At.test(t))return!1;const r=e.variants;return Array.isArray(r)}function Pt(e){if(typeof e=="string"){const c=e.trim();if(c.length===0)return null;try{const m=new URL(c).pathname.split("/").filter(Boolean),p=m[m.length-1];if(p)return decodeURIComponent(p)}catch{}return c.length>80?`${c.slice(0,77)}…`:c}if(!e||typeof e!="object")return null;const t=e,r=t.config,s=t.desktop?.media,i=[t.title,t.name,t.label,t.alt,r?.title,r?.name,r?.typeAlert?.message,s?.alt,Array.isArray(t.matcher)?t.matcher[0]:void 0];for(const c of i)if(typeof c=="string"&&c.trim().length>0)return c.trim();const a=t.__resolveType;if(typeof a=="string"){const l=(a.split("/").pop()??a).replace(/\.(tsx?|jsx?)$/i,"");if(l.length>0)return l}return null}function Ot(e){const t=[];for(let r=0;r<e.length;r++){const n=e[r];typeof n=="number"?t.length>0?t[t.length-1]+=`[${n}]`:t.push(`[${n}]`):t.push(n)}return t.join(" · ")}function q(e,t,r,n,s){if(Dt(e)){const i=e.variants,a=e.__resolveType,c=$t.test(a)?"":Ot(n);i.forEach((l,m)=>{if(!l||typeof l!="object")return;const p=l,h=[];if(pt(p.rule,h),h.length===0)return;const g=Pt(p.value)??(c||r);for(const u of h)s.push({blockKey:t,blockLabel:r,innerPath:c,variantIndex:m,start:u.start,end:u.end,openStart:u.openStart,openEnd:u.openEnd,label:g,flagResolveType:a})});for(let l=0;l<i.length;l++){const m=i[l];m&&typeof m=="object"&&q(m.value,t,r,[...n,"variants",l,"value"],s)}return}if(Array.isArray(e)){for(let i=0;i<e.length;i++)q(e[i],t,r,[...n,i],s);return}if(e&&typeof e=="object")for(const[i,a]of Object.entries(e))i!=="__resolveType"&&q(a,t,r,[...n,i],s)}function Vt(e){if(!e)return[];const t=[];for(const[r,n]of Object.entries(e))q(n,r,Rt(r),[],t);return t.sort((r,n)=>r.start.getTime()-n.start.getTime())}function It(e){const t=[...new Set(e)].sort(),r=new Map;return t.forEach((n,s)=>{const i=s*137.508%360;r.set(n,{bg:`oklch(0.62 0.14 ${i})`,text:"white",border:`oklch(0.50 0.14 ${i})`})}),r}const Ht={bg:"oklch(0.62 0.14 0)",text:"white",border:"oklch(0.50 0.14 0)"};function dt(e,t){return e.get(t)??Ht}const nt=new Intl.DateTimeFormat("en",{dateStyle:"medium",timeStyle:"short"});function Bt(e,t){const r=e.openStart?t("sandbox.variantCalendar.always"):nt.format(e.start),n=e.openEnd?t("sandbox.variantCalendar.ongoing"):nt.format(e.end);return`${r} → ${n}`}function Ft(e){const t=K.c(18),{variant:r}=e,n=J();let s;t[0]!==r.blockLabel?(s=o.jsx("div",{className:"font-semibold",children:r.blockLabel}),t[0]=r.blockLabel,t[1]=s):s=t[1];let i;t[2]!==r.innerPath?(i=r.innerPath&&o.jsx("div",{className:"text-muted-foreground",children:r.innerPath}),t[2]=r.innerPath,t[3]=i):i=t[3];let a;t[4]!==r.blockLabel||t[5]!==r.innerPath||t[6]!==r.label?(a=r.label!==r.blockLabel&&r.label!==r.innerPath&&o.jsx("div",{className:"text-muted-foreground",children:r.label}),t[4]=r.blockLabel,t[5]=r.innerPath,t[6]=r.label,t[7]=a):a=t[7];let c;t[8]!==n||t[9]!==r?(c=Bt(r,n),t[8]=n,t[9]=r,t[10]=c):c=t[10];let l;t[11]!==c?(l=o.jsx("div",{className:"mt-1",children:c}),t[11]=c,t[12]=l):l=t[12];let m;return t[13]!==s||t[14]!==i||t[15]!==a||t[16]!==l?(m=o.jsx(xt,{children:o.jsxs("div",{className:"text-xs",children:[s,i,a,l]})}),t[13]=s,t[14]=i,t[15]=a,t[16]=l,t[17]=m):m=t[17],m}const ot=16;function zt(e,t){const r=e?"transparent":"#000 0",n=t?"transparent":"#000 100%";if(!(!e&&!t))return`linear-gradient(to right, ${r}, #000 ${ot}px, #000 calc(100% - ${ot}px), ${n})`}function ft(e){const t=K.c(26),{variant:r,color:n,style:s,children:i,fadeStart:a,fadeEnd:c}=e,l=a===void 0?!1:a,m=c===void 0?!1:c;let p;t[0]!==m||t[1]!==l?(p=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]!==n.bg||t[10]!==n.text||t[11]!==s||t[12]!==f||t[13]!==g||t[14]!==u?(x={background:n.bg,color:n.text,borderRadius:4,...f,...g,...u,...s},t[9]=n.bg,t[10]=n.text,t[11]=s,t[12]=f,t[13]=g,t[14]=u,t[15]=x):x=t[15];let b;t[16]!==i?(b=o.jsx("span",{className:"truncate",children:i}),t[16]=i,t[17]=b):b=t[17];let E;t[18]!==x||t[19]!==b?(E=o.jsx(ut,{asChild:!0,children:o.jsx("div",{className:"absolute flex items-center px-2 text-[11px] font-medium truncate cursor-default",style:x,children:b})}),t[18]=x,t[19]=b,t[20]=E):E=t[20];let T;t[21]!==r?(T=o.jsx(Ft,{variant:r}),t[21]=r,t[22]=T):T=t[22];let d;return t[23]!==T||t[24]!==E?(d=o.jsxs(ht,{children:[E,T]}),t[23]=T,t[24]=E,t[25]=d):d=t[25],d}function Qn(e){const t=K.c(72),{decofile:r}=e,n=J(),[s,i]=Z.useState("calendar"),[a,c]=Z.useState(Kt),[l,m]=Z.useState(!1);let p,h,f;if(t[0]!==r||t[1]!==l){const V=Vt(r);p=V.filter(Ut).length,f=l?V:V.filter(Gt),h=It(f.map(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(V=>s==="calendar"?U(V,-1):U(V,-3)),t[6]=s,t[7]=b):b=t[7];const E=b;let T;t[8]!==s?(T=()=>c(V=>s==="calendar"?U(V,1):U(V,3)),t[8]=s,t[9]=T):T=t[9];const d=T;let v;t[10]!==n?(v=n("sandbox.variantCalendar.today"),t[10]=n,t[11]=v):v=t[11];let y;t[12]!==v?(y=o.jsx(tt,{variant:"outline",size:"sm",onClick:x,children:v}),t[12]=v,t[13]=y):y=t[13];let N;t[14]!==n?(N=n("sandbox.variantCalendar.previous"),t[14]=n,t[15]=N):N=t[15];let A;t[16]===Symbol.for("react.memo_cache_sentinel")?(A=o.jsx(gt,{size:16}),t[16]=A):A=t[16];let _;t[17]!==E||t[18]!==N?(_=o.jsx(tt,{variant:"ghost",size:"icon",className:"size-8",onClick:E,"aria-label":N,children:A}),t[17]=E,t[18]=N,t[19]=_):_=t[19];let k;t[20]!==n?(k=n("sandbox.variantCalendar.next"),t[20]=n,t[21]=k):k=t[21];let C;t[22]===Symbol.for("react.memo_cache_sentinel")?(C=o.jsx(vt,{size:16}),t[22]=C):C=t[22];let $;t[23]!==d||t[24]!==k?($=o.jsx(tt,{variant:"ghost",size:"icon",className:"size-8",onClick:d,"aria-label":k,children:C}),t[23]=d,t[24]=k,t[25]=$):$=t[25];const R=ct[a.getMonth()];let M;t[26]!==a?(M=a.getFullYear(),t[26]=a,t[27]=M):M=t[27];let w;t[28]!==R||t[29]!==M?(w=o.jsxs("h2",{className:"ml-2 text-base font-semibold",children:[R," ",M]}),t[28]=R,t[29]=M,t[30]=w):w=t[30];let j;t[31]!==$||t[32]!==w||t[33]!==y||t[34]!==_?(j=o.jsxs("div",{className:"flex items-center gap-2",children:[y,_,$,w]}),t[31]=$,t[32]=w,t[33]=y,t[34]=_,t[35]=j):j=t[35];let L;t[36]!==p||t[37]!==l||t[38]!==n?(L=p>0&&o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(jt,{id:"show-ongoing",checked:l,onCheckedChange:m}),o.jsx(yt,{htmlFor:"show-ongoing",className:"text-xs text-muted-foreground cursor-pointer",children:n("sandbox.variantCalendar.showOngoing",{count:p})})]}),t[36]=p,t[37]=l,t[38]=n,t[39]=L):L=t[39];let B;t[40]===Symbol.for("react.memo_cache_sentinel")?(B=o.jsx(at,{}),t[40]=B):B=t[40];let I;t[41]!==n?(I=n("sandbox.variantCalendar.calendarMode"),t[41]=n,t[42]=I):I=t[42];let S;t[43]!==I?(S={value:"calendar",icon:B,label:I},t[43]=I,t[44]=S):S=t[44];let F;t[45]===Symbol.for("react.memo_cache_sentinel")?(F=o.jsx(bt,{}),t[45]=F):F=t[45];let D;t[46]!==n?(D=n("sandbox.variantCalendar.timelineMode"),t[46]=n,t[47]=D):D=t[47];let P;t[48]!==D?(P={value:"timeline",icon:F,label:D},t[48]=D,t[49]=P):P=t[49];let O;t[50]!==S||t[51]!==P?(O=[S,P],t[50]=S,t[51]=P,t[52]=O):O=t[52];let H;t[53]!==O||t[54]!==s?(H=o.jsx(Tt,{value:s,onValueChange:i,options:O}),t[53]=O,t[54]=s,t[55]=H):H=t[55];let z;t[56]!==L||t[57]!==H?(z=o.jsxs("div",{className:"flex items-center gap-4",children:[L,H]}),t[56]=L,t[57]=H,t[58]=z):z=t[58];let W;t[59]!==j||t[60]!==z?(W=o.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?o.jsx(Yt,{hiddenOngoing:l?0:p}):s==="calendar"?o.jsx(Xt,{monthStart:a,variants:f,colorMap:g}):o.jsx(te,{monthStart:a,variants:f,colorMap:g}),t[62]=g,t[63]=a,t[64]=p,t[65]=l,t[66]=f,t[67]=s,t[68]=G):G=t[68];let Q;return t[69]!==W||t[70]!==G?(Q=o.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,n=r===void 0?0:r,s=J();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(at,{size:24,className:"text-muted-foreground/60"}),t[0]=i):i=t[0];let a;return t[1]!==n||t[2]!==s?(a=o.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-2 text-center text-sm text-muted-foreground p-6",children:[i,n>0?o.jsxs(o.Fragment,{children:[o.jsx("div",{children:s("sandbox.variantCalendar.noDatedVariants")}),o.jsx("div",{className:"text-xs text-muted-foreground/80",children:s("sandbox.variantCalendar.hiddenOngoingVariants",{count:n})})]}):o.jsxs(o.Fragment,{children:[o.jsx("div",{children:s("sandbox.variantCalendar.noScheduledVariants")}),o.jsx("div",{className:"text-xs text-muted-foreground/80",children:s("sandbox.variantCalendar.dateMatcherInfo")})]})]}),t[1]=n,t[2]=s,t[3]=a):a=t[3],a}const et=20,it=2,st=28,Qt=6;function Xt(e){const t=K.c(17),{monthStart:r,variants:n,colorMap:s}=e;let i,a,c,l,m;if(t[0]!==s||t[1]!==r||t[2]!==n){const f=Nt(r),g=_t(new Date);i=lt,m="flex-1 min-h-0",a="min-w-[840px]",t[8]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx("div",{className:"grid grid-cols-7 border-b text-xs text-muted-foreground sticky top-0 bg-background z-10",children:wt.map(Jt)}),t[8]=c):c=t[8],l=f.map((u,x)=>{const b=kt(u,n),E=b.reduce(qt,0),T=st+E*(et+it)+8;return o.jsxs("div",{className:"grid grid-cols-7 relative border-b",style:{height:T},children:[u.map((d,v)=>{const y=d.getMonth()===r.getMonth(),N=d.getTime()===g.getTime();return o.jsx("div",{className:rt("border-r last:border-r-0 px-2 pt-1.5 text-xs",y?"bg-background":"bg-muted/30 text-muted-foreground"),children:o.jsx("span",{className:rt("inline-flex h-5 min-w-5 items-center justify-center rounded-full px-1",N&&"bg-primary text-primary-foreground font-semibold"),children:d.getDate()})},v)}),b.map((d,v)=>{const y=dt(s,d.variant.blockKey),N=st+d.lane*(et+it),A=d.leftUnits/7*100,_=d.widthUnits/7*100,k=d.variant.openStart&&x===0,C=d.variant.openEnd&&x===f.length-1;return o.jsxs(ft,{variant:d.variant,color:y,fadeStart:k,fadeEnd:C,style:{top:N,left:`calc(${A}% + 2px)`,width:`calc(${_}% - 4px)`,minWidth:Qt,height:et},children:[d.variant.blockLabel,d.variant.label!==d.variant.blockLabel&&o.jsxs("span",{className:"opacity-70",children:[" · ",d.variant.label]})]},`${x}-${v}`)})]},x)}),t[0]=s,t[1]=r,t[2]=n,t[3]=i,t[4]=a,t[5]=c,t[6]=l,t[7]=m}else i=t[3],a=t[4],c=t[5],l=t[6],m=t[7];let p;t[9]!==a||t[10]!==c||t[11]!==l?(p=o.jsxs("div",{className:a,children:[c,l]}),t[9]=a,t[10]=c,t[11]=l,t[12]=p):p=t[12];let h;return t[13]!==i||t[14]!==m||t[15]!==p?(h=o.jsx(i,{className:m,children:p}),t[13]=i,t[14]=m,t[15]=p,t[16]=h):h=t[16],h}function qt(e,t){return Math.max(e,t.lane+1)}function Jt(e){return o.jsx("div",{className:"px-2 py-2 text-center uppercase tracking-wide",children:e},e)}const X=4,Zt=32,Y=240;function te(e){const t=K.c(23),{monthStart:r,variants:n,colorMap:s}=e,i=r,a=U(r,X),c=new Date,l=new Map;for(const w of n){const j=l.get(w.blockKey)??[];j.push(w),l.set(w.blockKey,j)}const m=Array.from(l.entries()).sort(ne),p=a.getTime()-i.getTime(),h=w=>(Math.max(i.getTime(),Math.min(a.getTime(),w.getTime()))-i.getTime())/p*100;let f;t[0]!==i?(f=(w,j)=>U(i,j),t[0]=i,t[1]=f):f=t[1];const g=Array.from({length:X},f),u=c.getTime()>=i.getTime()&&c.getTime()<=a.getTime()?h(c):null,x=J(),b=lt,E="flex-1 min-h-0",T="min-w-[900px] relative";let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d={width:Y},t[2]=d):d=t[2];let v;t[3]!==x?(v=x("sandbox.variantCalendar.variantBlock"),t[3]=x,t[4]=v):v=t[4];let y;t[5]!==v?(y=o.jsx("div",{className:"shrink-0 px-3 py-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground border-r",style:d,children:v}),t[5]=v,t[6]=y):y=t[6];let N;t[7]===Symbol.for("react.memo_cache_sentinel")?(N={gridTemplateColumns:`repeat(${X}, minmax(0, 1fr))`},t[7]=N):N=t[7];const A=g.map(re);let _;t[8]!==A?(_=o.jsx("div",{className:"flex-1 grid",style:N,children:A}),t[8]=A,t[9]=_):_=t[9];let k;t[10]!==y||t[11]!==_?(k=o.jsxs("div",{className:"flex border-b sticky top-0 bg-background z-10",children:[y,_]}),t[10]=y,t[11]=_,t[12]=k):k=t[12];let C;t[13]!==x||t[14]!==u?(C=u!==null&&o.jsx("div",{className:"pointer-events-none absolute top-0 bottom-0 w-px bg-primary/70 z-[5]",style:{left:`calc(${Y}px + (100% - ${Y}px) * ${u} / 100)`},children:o.jsx("span",{className:"absolute -top-0.5 -translate-x-1/2 rounded-sm bg-primary px-1.5 py-px text-[10px] font-medium text-primary-foreground",children:x("sandbox.variantCalendar.todayLabel")})}),t[13]=x,t[14]=u,t[15]=C):C=t[15];const $=m.map(w=>{const[j,L]=w,B=dt(s,j),I=L[0]?.blockLabel??j;return o.jsxs("div",{children:[o.jsx("div",{className:"flex items-center bg-muted/40 border-b text-xs font-semibold uppercase tracking-wide text-muted-foreground",style:{height:28},children:o.jsx("div",{className:"px-3 truncate",style:{width:Y},children:I})}),L.map((S,F)=>o.jsxs("div",{className:"flex border-b items-center",style:{height:Zt},children:[o.jsxs("div",{className:"flex items-center gap-2 px-3 text-sm border-r shrink-0",style:{width:Y},children:[o.jsx("span",{className:"inline-block h-2 w-2 rounded-full shrink-0",style:{background:B.bg}}),o.jsx("span",{className:"truncate text-foreground/80",children:S.label})]}),o.jsxs("div",{className:"relative flex-1 h-full",children:[o.jsx("div",{className:"absolute inset-0 grid",style:{gridTemplateColumns:`repeat(${X}, minmax(0, 1fr))`},children:g.map(ee)}),(()=>{const D=Math.max(S.start.getTime(),i.getTime()),P=Math.min(S.end.getTime(),a.getTime());if(P<=D)return null;const O=h(new Date(D)),H=h(new Date(P))-O;return o.jsx(ft,{variant:S,color:B,fadeStart:S.openStart,fadeEnd:S.openEnd,style:{top:"50%",transform:"translateY(-50%)",left:`${O}%`,width:`calc(${H}% - 2px)`,height:22},children:S.label})})()]})]},F))]},j)});let R;t[16]!==k||t[17]!==C||t[18]!==$?(R=o.jsxs("div",{className:T,children:[k,C,$]}),t[16]=k,t[17]=C,t[18]=$,t[19]=R):R=t[19];let M;return t[20]!==b||t[21]!==R?(M=o.jsx(b,{className:E,children:R}),t[20]=b,t[21]=R,t[22]=M):M=t[22],M}function ee(e,t){return o.jsx("div",{className:"border-r last:border-r-0 border-border/40"},t)}function re(e,t){return o.jsxs("div",{className:"px-2 py-2 text-xs uppercase tracking-wide text-muted-foreground border-r last:border-r-0",children:[ct[e.getMonth()]?.slice(0,3)," ",e.getFullYear()]},t)}function ne(e,t){return e[0].localeCompare(t[0])}export{Qn as VariantCalendar};
@@ -1 +1 @@
1
- import{c as $,r as C,n as f,j as i,ab as k,a8 as I,a9 as P}from"./index-Dt4xzxRh.js";const M={sm:{button:"size-7",buttonWithLabel:"h-7",icon:"size-4"},md:{button:"size-9",buttonWithLabel:"h-9",icon:"size-5"},lg:{button:"size-12",buttonWithLabel:"h-12",icon:"size-6"}};function A(E){const t=$.c(27),{value:s,onValueChange:y,options:o,size:L,fullWidth:R,className:z}=E,_=L===void 0?"sm":L,m=R===void 0?!1:R;let h;t[0]===Symbol.for("react.memo_cache_sentinel")?(h=[],t[0]=h):h=t[0];const T=C.useRef(h);let x;t[1]===Symbol.for("react.memo_cache_sentinel")?(x={left:0,width:0,opacity:0},t[1]=x):x=t[1];const[d,S]=C.useState(x);let g,p;t[2]!==o||t[3]!==s?(g=()=>{const e=o.findIndex(j=>j.value===s),b=T.current[e];b&&S({left:b.offsetLeft,width:b.offsetWidth,opacity:1})},p=[s,o],t[2]=o,t[3]=s,t[4]=g,t[5]=p):(g=t[4],p=t[5]),C.useEffect(g,p);const n=M[_];let l;t[6]!==z?(l=f("relative flex gap-0 bg-muted rounded-lg",z),t[6]=z,t[7]=l):l=t[7];let a;t[8]!==n||t[9]!==m||t[10]!==y||t[11]!==o||t[12]!==s?(a=o.map((e,b)=>{const j=i.jsxs("button",{ref:V=>{T.current[b]=V},type:"button",onClick:()=>y(e.value),"aria-label":e.label,className:f("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",m?"flex-1 h-12 px-4":e.label?f(n.buttonWithLabel,"px-3"):n.button),children:[i.jsx("span",{className:f("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",n.icon,s===e.value?"text-foreground":"text-muted-foreground"),children:e.icon}),e.label&&i.jsx("span",{className:f("text-xs transition-colors ease-out duration-200 whitespace-nowrap",s===e.value?"text-foreground":"text-muted-foreground"),children:e.label})]},e.value);return e.tooltip?i.jsxs(k,{children:[i.jsx(I,{asChild:!0,children:j}),i.jsx(P,{side:"bottom",children:e.tooltip})]},e.value):j}),t[8]=n,t[9]=m,t[10]=y,t[11]=o,t[12]=s,t[13]=a):a=t[13];const w=m?"h-12":n.button;let r;t[14]!==w?(r=f("absolute z-0 bg-background rounded-lg border-shadow transition-all [transition-timing-function:var(--ease-out-cubic)] duration-200",w),t[14]=w,t[15]=r):r=t[15];const W=`${d.left}px`,N=`${d.width}px`;let c;t[16]!==d.opacity||t[17]!==W||t[18]!==N?(c={left:W,width:N,opacity:d.opacity},t[16]=d.opacity,t[17]=W,t[18]=N,t[19]=c):c=t[19];let u;t[20]!==r||t[21]!==c?(u=i.jsx("div",{className:r,style:c}),t[20]=r,t[21]=c,t[22]=u):u=t[22];let v;return t[23]!==u||t[24]!==l||t[25]!==a?(v=i.jsxs("div",{className:l,children:[a,u]}),t[23]=u,t[24]=l,t[25]=a,t[26]=v):v=t[26],v}export{A as V};
1
+ import{c as $,r as C,n as f,j as i,ab as k,a8 as I,a9 as P}from"./index-DFQ7B_Sf.js";const M={sm:{button:"size-7",buttonWithLabel:"h-7",icon:"size-4"},md:{button:"size-9",buttonWithLabel:"h-9",icon:"size-5"},lg:{button:"size-12",buttonWithLabel:"h-12",icon:"size-6"}};function A(E){const t=$.c(27),{value:s,onValueChange:y,options:o,size:L,fullWidth:R,className:z}=E,_=L===void 0?"sm":L,m=R===void 0?!1:R;let h;t[0]===Symbol.for("react.memo_cache_sentinel")?(h=[],t[0]=h):h=t[0];const T=C.useRef(h);let x;t[1]===Symbol.for("react.memo_cache_sentinel")?(x={left:0,width:0,opacity:0},t[1]=x):x=t[1];const[d,S]=C.useState(x);let g,p;t[2]!==o||t[3]!==s?(g=()=>{const e=o.findIndex(j=>j.value===s),b=T.current[e];b&&S({left:b.offsetLeft,width:b.offsetWidth,opacity:1})},p=[s,o],t[2]=o,t[3]=s,t[4]=g,t[5]=p):(g=t[4],p=t[5]),C.useEffect(g,p);const n=M[_];let l;t[6]!==z?(l=f("relative flex gap-0 bg-muted rounded-lg",z),t[6]=z,t[7]=l):l=t[7];let a;t[8]!==n||t[9]!==m||t[10]!==y||t[11]!==o||t[12]!==s?(a=o.map((e,b)=>{const j=i.jsxs("button",{ref:V=>{T.current[b]=V},type:"button",onClick:()=>y(e.value),"aria-label":e.label,className:f("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",m?"flex-1 h-12 px-4":e.label?f(n.buttonWithLabel,"px-3"):n.button),children:[i.jsx("span",{className:f("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",n.icon,s===e.value?"text-foreground":"text-muted-foreground"),children:e.icon}),e.label&&i.jsx("span",{className:f("text-xs transition-colors ease-out duration-200 whitespace-nowrap",s===e.value?"text-foreground":"text-muted-foreground"),children:e.label})]},e.value);return e.tooltip?i.jsxs(k,{children:[i.jsx(I,{asChild:!0,children:j}),i.jsx(P,{side:"bottom",children:e.tooltip})]},e.value):j}),t[8]=n,t[9]=m,t[10]=y,t[11]=o,t[12]=s,t[13]=a):a=t[13];const w=m?"h-12":n.button;let r;t[14]!==w?(r=f("absolute z-0 bg-background rounded-lg border-shadow transition-all [transition-timing-function:var(--ease-out-cubic)] duration-200",w),t[14]=w,t[15]=r):r=t[15];const W=`${d.left}px`,N=`${d.width}px`;let c;t[16]!==d.opacity||t[17]!==W||t[18]!==N?(c={left:W,width:N,opacity:d.opacity},t[16]=d.opacity,t[17]=W,t[18]=N,t[19]=c):c=t[19];let u;t[20]!==r||t[21]!==c?(u=i.jsx("div",{className:r,style:c}),t[20]=r,t[21]=c,t[22]=u):u=t[22];let v;return t[23]!==u||t[24]!==l||t[25]!==a?(v=i.jsxs("div",{className:l,children:[a,u]}),t[23]=u,t[24]=l,t[25]=a,t[26]=v):v=t[26],v}export{A as V};
@@ -50,7 +50,7 @@
50
50
  <meta name="twitter:description" content="Hire specialized agents, give them access to your tools, and let them deliver real projects — with planning, verification, and observability built in." />
51
51
  <meta name="twitter:image" content="/og-image.png" />
52
52
  <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
53
- <script type="module" crossorigin src="/assets/index-Dt4xzxRh.js"></script>
53
+ <script type="module" crossorigin src="/assets/index-DFQ7B_Sf.js"></script>
54
54
  <link rel="stylesheet" crossorigin href="/assets/index-DJSuP9VA.css">
55
55
  </head>
56
56
  <body>
@@ -1489,7 +1489,7 @@ Usage: deco services <up|down|status>`),process.exit(1)}}var dp1=L(()=>{tf()});f
1489
1489
  `.execute($);if(Number(W.rows[0]?.cnt)===0){console.warn(`Failed to migrate ${J}/${K}, keeping in old table`);continue}}await jy`
1490
1490
  DELETE FROM kysely_migration WHERE name = ${Q}
1491
1491
  `.execute($)}}async function ha1($){await Ms8($),await Vs8($);let Z=new ya1({db:$,provider:{getMigrations:()=>Promise.resolve(ip0)}}),{error:Q,results:X}=await Z.migrateToLatest(),Y=0;if(X?.forEach((G)=>{if(G.status==="Success")Y++;else if(G.status==="Error")console.error(`Failed to execute migration "${G.migrationName}"`)}),Q)throw console.error("Failed to migrate"),console.error(Q),Q;return Y}async function ks8($){let{keepOpen:Z=!1,database:Q,skipBetterAuth:X=!1}=$??{},Y="skipped";if(!X&&!Q)Y=await ul0();let G=Q??F8(),J=async()=>{if(!Z&&!Q)await ZO(G).catch((K)=>{console.warn("Warning: Error closing database:",K)})};try{let K=await ha1(G.db);return await J(),{betterAuth:Y,kysely:K}}catch(K){throw await J(),K}}async function Ss8(){let $=F8(),Z=new ya1({db:$.db,provider:{getMigrations:()=>Promise.resolve(ip0)}}),{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 ca1=L(()=>{ba1();cl0();YQ()});async function w70($){let Z={...process.env},Q=F80($,Z);console.log(pw1(Q.settings.encryptionKey));let X=Q.settings.betterAuthSecret||(Q.settings.localMode?Pt1(Q.settings.dataDir):""),{ensureServices:Y}=await Promise.resolve().then(() => (AZ0(),PZ0)),{outputs:G,services:J}=await Y({home:Q.settings.dataDir,externalDatabaseUrl:Q.externalDatabaseUrl,externalNatsUrl:Q.externalNatsUrl});if(!Q.skipMigrations){let{migrateBetterAuth:W}=await Promise.resolve().then(() => (cl0(),Tt1));await W(G.databaseUrl);let{createDatabase:H}=await Promise.resolve().then(() => (YQ(),hn1)),{migrateToLatest:F}=await Promise.resolve().then(() => (ca1(),ua1)),N=H(G.databaseUrl);await F({keepOpen:!0,database:N,skipBetterAuth:!0})}let K={...Q.settings,betterAuthSecret:X,databaseUrl:G.databaseUrl,natsUrls:G.natsUrls,...G.s3?{s3Endpoint:G.s3.endpoint,s3Bucket:G.s3.bucket,s3AccessKeyId:G.s3.accessKeyId,s3SecretAccessKey:G.s3.secretAccessKey,s3ForcePathStyle:G.s3.forcePathStyle}:{}};return ip1(K),{settings:K,services:J.map((W)=>({name:W.name==="PostgreSQL"?"Postgres":W.name,port:W.port})),managedServiceNames:J.filter((W)=>W.owner==="managed").map((W)=>W.name)}}var pp0=L(()=>{tf();At1();R$()});var ia1={};Z0(ia1,{updateService:()=>dE,subscribeCliState:()=>op0,setTuiConsoleIntercepted:()=>E70,setServerUrl:()=>Lp,setMigrationsDone:()=>Op,setDevMode:()=>_s8,resetCliStateForTests:()=>Cs8,isTuiConsoleIntercepted:()=>j70,getCliState:()=>tp0,addLogEntry:()=>WO});function la1(){return[{name:"Postgres",status:"pending",port:0},{name:"NATS",status:"pending",port:0}]}function ma1(){return{services:la1(),migrationsStatus:"pending",serverUrl:null,logs:[]}}function Cs8(){lX=ma1()}function Bp(){for(let $ of np0)$()}function tp0(){return lX}function op0($){return np0.add($),()=>np0.delete($)}function dE($){lX={...lX,services:lX.services.map((Z)=>Z.name===$.name?$:Z)},Bp()}function Op(){lX={...lX,migrationsStatus:"done"},Bp()}function Lp($){lX={...lX,serverUrl:$},Bp()}function WO($){let Z=[...lX.logs,$];lX={...lX,logs:Z.length>500?Z.slice(-500):Z},Bp()}function _s8(){lX={...lX,services:[...la1(),{name:"API",status:"pending",port:0},{name:"Vite",status:"pending",port:0}]},Bp()}function E70($){da1=$}function j70(){return da1}var lX,np0,da1=!1;var iE=L(()=>{lX=ma1();np0=new Set});import{createServer as pa1}from"net";function vs8($){return new Promise((Z)=>{let Q=pa1();Q.once("error",()=>Z(!1)),Q.listen($,"0.0.0.0",()=>{Q.close(()=>Z(!0))})})}async function Dp($){if(await vs8($))return $;let Z=await new Promise((Q,X)=>{let Y=pa1();Y.once("error",X),Y.listen(0,"0.0.0.0",()=>{let G=Y.address(),J=typeof G==="object"&&G?G.port:0;Y.close(()=>Q(J))})});return console.warn(`Port ${$} is in use, using port ${Z} instead.`),Z}var rp0=()=>{};var sp0={};Z0(sp0,{startDevServer:()=>fs8,pipeToLogStore:()=>ap0});import{join as xs8}from"path";function ap0($){let Z=$.getReader(),Q=new TextDecoder,X="";function Y(){let G=X.split(`
1492
- `);X=G.pop()??"";for(let J of G){let K=Bun.stripANSI(J).replace(/^\[\d+\]\s*/,"").trim();if(!K)continue;WO({method:"",path:"",status:0,duration:0,timestamp:new Date,rawLine:K})}}(async()=>{try{for(;;){let{done:G,value:J}=await Z.read();if(G)break;X+=Q.decode(J,{stream:!0}),Y()}}catch{}if(X.trim()){let G=Bun.stripANSI(X).replace(/^\[\d+\]\s*/,"").trim();if(G)WO({method:"",path:"",status:0,duration:0,timestamp:new Date,rawLine:G})}})()}async function fs8($){let{baseUrl:Z,noTui:Q}=$,X=process.env.HOST==="0.0.0.0"&&Boolean(process.env.PORT),Y=X?process.env.PORT:$.vitePort,G=Z||`http://localhost:${Y}`,J=X?await Dp(Number(Y)+1):await Dp(Number($.port)),{settings:K,services:W,managedServiceNames:H}=await w70({port:String(J),home:$.home,baseUrl:$.baseUrl,localMode:$.localMode,skipMigrations:$.skipMigrations,noTui:$.noTui,vitePort:$.vitePort});for(let D of W)dE({name:D.name,status:"ready",port:D.port});Op();let F=xs8(import.meta.dir,"..","..","..","..",".."),N=Q===!0,U=Bun.spawn(["bun","run","dev:servers"],{cwd:F,env:{...process.env,PORT:String(K.port),VITE_PORT:String(Y),DATABASE_URL:K.databaseUrl,NATS_URL:K.natsUrls.join(","),NODE_ENV:K.nodeEnv,BASE_URL:G,DECOCMS_LOCAL_MODE:String(K.localMode),DECOCMS_HOME:K.dataDir,DATA_DIR:K.dataDir,DECO_CLI:"1",...K.betterAuthSecret?{BETTER_AUTH_SECRET:K.betterAuthSecret}:{},...K.s3Endpoint?{S3_ENDPOINT:K.s3Endpoint,S3_BUCKET:K.s3Bucket??"",S3_ACCESS_KEY_ID:K.s3AccessKeyId??"",S3_SECRET_ACCESS_KEY:K.s3SecretAccessKey??"",S3_FORCE_PATH_STYLE:String(K.s3ForcePathStyle)}:{},...K.natsCredsPath?{NATS_CREDS:K.natsCredsPath}:{}},stdio:["inherit",N?"inherit":"pipe",N?"inherit":"pipe"]});if(!N)ap0(U.stdout),ap0(U.stderr);Lp(G),dE({name:"Vite",status:"ready",port:Number(Y)}),dE({name:"API",status:"ready",port:Number(K.port)});let O=async(D)=>{if(U.kill(D),await U.exited,H.length>0){let{stopServices:w}=await Promise.resolve().then(() => (AZ0(),PZ0));await w(K.dataDir)}};return process.on("SIGINT",()=>O("SIGINT")),process.on("SIGTERM",()=>O("SIGTERM")),{port:Number(Y),process:U}}var ep0=L(()=>{pp0();iE();rp0()});var z70;var $n0=L(()=>{z70={name:"decocms",version:"4.303.18",description:"Deco CMS \u2014 Self-hostable MCP Gateway for managing AI connections and tools",author:"Deco team",repository:{type:"git",url:"git+https://github.com/decocms/studio.git",directory:"apps/api"},bugs:{url:"https://github.com/decocms/studio/issues"},type:"module",bin:{deco:"./dist/server/cli.js"},files:["dist/**/*"],scripts:{dev:"bun run migrate && bun run dev:server","dev:server":"bun run --cwd=../../packages/sandbox build && NODE_ENV=development bun --env-file=.env --hot run src/index.ts",build:"bun run build:server","build:server":"bun run scripts/bundle-server-script.ts --dist ./dist/server","generate:tool-contracts":"bun run scripts/generate-tool-contracts.ts","db:migrate":"bun run ./dist/server/migrate.js","db:migrate:dbos":"bun run ./dist/server/migrate-dbos.js",check:"tsc --noEmit",start:"bun run ./dist/server/server.js",migrate:"bun run src/database/migrate.ts","migrate:dbos":"bun run src/database/migrate-dbos.ts",test:"bun test src","better-auth:migrate":"bunx --bun @better-auth/cli migrate -y --config src/auth/index.ts",prepublishOnly:"bun run --cwd=../.. build:studio"},optionalDependencies:{"@duckdb/node-api":"^1.5.0-r.1"},dependencies:{"@ai-sdk/anthropic":"^3.0.85","@ai-sdk/google":"^3.0.83","@ai-sdk/openai":"^3.0.73","@anthropic-ai/sdk":"^0.105.0","@aws-sdk/client-s3":"^3.1013.0","@aws-sdk/client-sts":"^3.1013.0","@aws-sdk/lib-storage":"^3.1013.0","@aws-sdk/s3-request-presigner":"^3.1013.0","@clickhouse/client":"^1.8.1","@dbos-inc/dbos-sdk":"^4.21.6","@inkjs/ui":"^2.0.0","@nats-io/jetstream":"3.4.0","@nats-io/kv":"3.4.0","@nats-io/nats-core":"3.4.0","@nats-io/transport-node":"3.4.0","@openrouter/ai-sdk-provider":"^2.9.1","@opentelemetry/core":"^2.6.0","embedded-postgres":"^18.3.0-beta.16",ink:"^6.8.0",kysely:"^0.28.12","posthog-node":"^5.0.0",react:"^19.2.6","react-dom":"^19.2.6"},devDependencies:{"@ai-sdk/provider":"^3.0.10","@better-auth/sso":"1.4.1","@decocms/better-auth":"1.5.17","@decocms/bindings":"workspace:*","@decocms/mcp-utils":"workspace:*","@decocms/runtime":"workspace:*","@decocms/sandbox":"workspace:*","@decocms/shared":"workspace:*","@jitl/quickjs-wasmfile-release-sync":"0.31.0","@modelcontextprotocol/sdk":"1.29.0","@opentelemetry/api":"^1.9.0","@opentelemetry/api-logs":"^0.211.0","@opentelemetry/exporter-logs-otlp-proto":"^0.211.0","@opentelemetry/exporter-prometheus":"^0.208.0","@opentelemetry/exporter-trace-otlp-proto":"^0.207.0","@opentelemetry/instrumentation-runtime-node":"^0.24.0","@opentelemetry/resources":"^2.6.0","@opentelemetry/sdk-logs":"^0.211.0","@opentelemetry/sdk-metrics":"^2.2.0","@opentelemetry/sdk-node":"^0.207.0","@opentelemetry/sdk-trace-base":"^2.5.0","@types/bun":"^1.3.1","@types/google.maps":"^3.65.2","@types/pg":"^8.15.6","@types/react-syntax-highlighter":"^15.5.13","@vercel/nft":"^1.1.1",ai:"^6.0.208","better-auth":"1.4.22",croner:"^9.1.0",degit:"^2.8.4",hono:"^4.10.7",jose:"^6.0.11",nanoid:"^5.1.6",pg:"^8.16.3",typescript:"^7.0.2",typescript5:"npm:typescript@^5.9.3",zod:"4.3.6"},homepage:"https://github.com/decocms/studio",keywords:["mcp","model-context-protocol","ai","gateway","self-hosted","tools"],license:"MIT",publishConfig:{access:"public"}}});import{Box as ys8,Text as na1}from"ink";import{jsx as gs8,jsxs as ta1}from"react/jsx-runtime";function oa1({version:$}){return ta1(ys8,{flexDirection:"column",marginTop:1,children:[iZ0.map((Z,Q)=>gs8(na1,{color:pZ0[Q],children:Z},Q)),ta1(na1,{dimColor:!0,children:[" v",$]})]})}var ra1=L(()=>{Zp()});import{Box as pE,Text as HO}from"ink";import{Spinner as hs8}from"@inkjs/ui";import{jsx as QG,jsxs as zy}from"react/jsx-runtime";function aa1({status:$}){if($==="pending")return QG(hs8,{label:""});return QG(HO,{color:"green",children:"\u2713"})}function us8($){return`${$.name}: ${$.port||"...."}`}function sa1({services:$,migrationsStatus:Z,home:Q,serverUrl:X}){return zy(pE,{flexDirection:"column",paddingBottom:1,children:[QG(oa1,{version:z70.version}),QG(pE,{marginBottom:1,children:QG(HO,{dimColor:!0,children:"\u2500".repeat(80)})}),QG(pE,{children:zy(HO,{dimColor:!0,children:["Home: ",Q]})}),zy(pE,{gap:2,children:[$.map((Y)=>zy(pE,{gap:1,children:[QG(HO,{children:us8(Y)}),QG(aa1,{status:Y.status})]},Y.name)),zy(pE,{gap:1,children:[QG(HO,{children:"Migrations"}),QG(aa1,{status:Z})]})]}),QG(pE,{children:X?zy(HO,{children:["Open in browser: ",QG(HO,{color:"cyan",children:X})]}):QG(HO,{dimColor:!0,children:"Starting..."})})]})}var ea1=L(()=>{$n0();ra1()});import{Box as cs8,Text as wp}from"ink";import{jsx as Zn0,jsxs as Qn0}from"react/jsx-runtime";function ls8($){if($>=500)return"red";if($>=400)return"yellow";if($>=300)return"cyan";return"green"}function $s1({logs:$}){return Zn0(cs8,{flexDirection:"column",children:$.map((Z,Q)=>{if(Z.rawLine)return Zn0(wp,{dimColor:!0,children:Z.rawLine},Q);let X=Z.duration<1000?`${Z.duration}ms`:`${(Z.duration/1000).toFixed(1)}s`;return Qn0(wp,{children:[Qn0(wp,{dimColor:!0,children:[Z.method.padEnd(6)," ",Z.path.padEnd(30)," "]}),Zn0(wp,{color:ls8(Z.status),children:Z.status}),Qn0(wp,{dimColor:!0,children:[" ",X.padStart(8)]})]},Q)})})}var Zs1=()=>{};var Xn0={};Z0(Xn0,{App:()=>is8});import{Box as ms8}from"ink";import{useSyncExternalStore as ds8}from"react";import{jsx as Qs1,jsxs as ps8}from"react/jsx-runtime";function is8({home:$}){let Z=ds8(op0,tp0);return ps8(ms8,{flexDirection:"column",children:[Qs1(sa1,{services:Z.services,migrationsStatus:Z.migrationsStatus,home:$,serverUrl:Z.serverUrl}),Qs1($s1,{logs:Z.logs})]})}var Yn0=L(()=>{ea1();Zs1();iE()});var m3="thread-gate",NN="decopilot-hosted-harness",UN="decopilot-hosted-harness-sandboxed",EJ="automations",FO="background-tools",nE="task-board-github-reads",tE="jira-push";var Xs1="9";function Ys1($){return{name:"decocms",systemDatabaseUrl:$.systemDatabaseUrl,systemDatabaseSchemaName:"dbos",systemDatabasePoolSize:$.poolSize,runAdminServer:!1,executorID:$.executorID,applicationVersion:Xs1,...$.listenQueues!==void 0?{listenQueues:$.listenQueues}:{}}}var Gs1=()=>{};import ns8 from"pg";async function Ks1($,Z){let{databaseUrl:Q,lockTimeoutMs:X=ts8}=$,Y=$.log??((W)=>console.log(W)),G=new ns8.Client({connectionString:Q});await G.connect();let J=Date.now(),K=!1;try{while(!K){if(K=(await G.query("SELECT pg_try_advisory_lock($1) AS locked",[Js1.toString()])).rows[0]?.locked===!0,K)break;if(Date.now()-J>=X)throw Error(`Timed out after ${X}ms waiting for the DBOS migration lock. Another process is still migrating the dbos schema; this pod will restart and retry.`);await H$(os8)}let W=Date.now()-J;if(W>1000)Y(`[dbos] waited ${W}ms for the migration lock; another process migrated first`);return await Z()}finally{if(K)try{await G.query("SELECT pg_advisory_unlock($1)",[Js1.toString()])}catch{}await G.end().catch(()=>{})}}var Js1=8314027461559302n,ts8=600000,os8=500;var Ws1=L(()=>{J4()});function rs8(){let $=(process.env.BUN_OPTIONS??"").split(/\s+/).filter(Boolean);return[...process.argv.slice(1),...$]}function Gn0($,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 Hs1(){let $=rs8();if($.includes("--cpu-prof")){console.log(JSON.stringify({msg:"cpu-profiling-active",dir:Gn0($,"--cpu-prof-dir")??process.cwd(),name:Gn0($,"--cpu-prof-name"),markdown:$.includes("--cpu-prof-md"),intervalUs:Number(Gn0($,"--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 Fs1(){if(process.env.HEAP_WATCH!=="1")return()=>{};let $=Number(process.env.HEAP_WATCH_INTERVAL_MS??60000),Z=async()=>{let Q=uE();if(!Q)return;let X={};try{let{heapStats:Y}=await import("bun:jsc"),G=Y(),J=Object.entries(G.objectTypeCounts).sort((K,W)=>W[1]-K[1]).slice(0,20);X={objectCount:G.objectCount,heapSize:G.heapSize,top:Object.fromEntries(J)}}catch{}console.log(JSON.stringify({msg:"heap-watch",ts:new Date().toISOString(),uptimeS:Math.round(process.uptime()),rss:Q.rss,heapUsed:Q.heapUsed,heapTotal:Q.heapTotal,external:Q.external,arrayBuffers:Q.arrayBuffers,...X}))};return Z().catch(()=>{}),P70=setInterval(()=>void Z().catch(()=>{}),$),P70.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(P70)clearInterval(P70)}}var P70;var Ns1=()=>{};import*as as8 from"bun:jsc";function Us1(){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{ss8()}catch(G){return console.error("[stall-watchdog] failed to start sampling profiler:",G),()=>{}}let Q,X=performance.now()+Z,Y=()=>{let G=performance.now(),J=G-X;X=G+Z;let K=[];try{K=es8()?.traces??[]}catch{}if(J>$&&K.length>0){let W=new Map;for(let F of K){let N=F.frames.find((O)=>O.sourceURL&&!/Unknown Executable/.test(O.category??""))??F.frames[0];if(!N)continue;let U=(N.sourceURL??"?").replace(/^.*\/node_modules\//,"node_modules/"),B=`${N.name??"?"} @ ${U}:${N.line??"?"}`;W.set(B,(W.get(B)??0)+1)}let H=[...W.entries()].sort((F,N)=>N[1]-F[1]).slice(0,8).map(([F,N])=>({frame:F,count:N}));console.warn(JSON.stringify({msg:"stall-stack",ts:new Date().toISOString(),lagMs:Math.round(J),samplesInWindow:K.length,top:H}))}Q=setTimeout(Y,Z),Q.unref?.()};return Q=setTimeout(Y,Z),Q.unref?.(),()=>{if(Q)clearTimeout(Q)}}var ss8,es8;var Bs1=L(()=>{({startSamplingProfiler:ss8,samplingProfilerStackTraces:es8}=as8)});function Os1(){Hs1();let $=[Fs1(),Cn1(),Us1()];return()=>{for(let Z of $)Z()}}var Ls1=L(()=>{Cl0();Ns1();Bs1()});var oE=v((Ds1)=>{Object.defineProperty(Ds1,"__esModule",{value:!0});Ds1.RepublishHeaders=Ds1.DirectMsgHeaders=Ds1.JsHeaders=Ds1.AdvisoryKind=void 0;Ds1.isOrderedPushConsumerOptions=$e8;Ds1.isPullConsumer=Ze8;Ds1.isPushConsumer=Qe8;Ds1.isBoundPushConsumerOptions=Xe8;function $e8($){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 Ze8($){return $.isPullConsumer()}function Qe8($){return $.isPushConsumer()}function Xe8($){if($&&typeof $==="object")return"deliver_subject"in $||"deliver_group"in $||"idle_heartbeat"in $;return!1}Ds1.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"};Ds1.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"};Ds1.DirectMsgHeaders={Stream:"Nats-Stream",Sequence:"Nats-Sequence",TimeStamp:"Nats-Time-Stamp",Subject:"Nats-Subject",LastSequence:"Nats-Last-Sequence",NumPending:"Nats-Num-Pending"};Ds1.RepublishHeaders={Stream:"Nats-Stream",Subject:"Nats-Subject",Sequence:"Nats-Sequence",LastSequence:"Nats-Last-Sequence",Size:"Nats-Msg-Size"}});var XG=v((Es1)=>{Object.defineProperty(Es1,"__esModule",{value:!0});Es1.TD=Es1.TE=Es1.Empty=void 0;Es1.encode=Ue8;Es1.decode=Be8;Es1.Empty=new Uint8Array(0);Es1.TE=new TextEncoder;Es1.TD=new TextDecoder;function Ne8(...$){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 Ue8(...$){let Z=[];for(let Q=0;Q<$.length;Q++)Z.push(Es1.TE.encode($[Q]));if(Z.length===0)return Es1.Empty;if(Z.length===1)return Z[0];return Ne8(...Z)}function Be8($){if(!$||$.length===0)return"";return Es1.TD.decode($)}});var YG=v((Ps1)=>{Object.defineProperty(Ps1,"__esModule",{value:!0});Ps1.errors=Ps1.PermissionViolationError=Ps1.NoRespondersError=Ps1.TimeoutError=Ps1.RequestError=Ps1.ProtocolError=Ps1.ConnectionError=Ps1.DrainingConnectionError=Ps1.ClosedConnectionError=Ps1.AuthorizationError=Ps1.UserAuthenticationExpiredError=Ps1.InvalidOperationError=Ps1.InvalidArgumentError=Ps1.InvalidSubjectError=void 0;class Kn0 extends Error{constructor($,Z){super(`illegal subject: '${$}'`,Z);this.name="InvalidSubjectError"}}Ps1.InvalidSubjectError=Kn0;class A70 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 A70(`${$} ${Z}`,Q)}}Ps1.InvalidArgumentError=A70;class Wn0 extends Error{constructor($,Z){super($,Z);this.name="InvalidOperationError"}}Ps1.InvalidOperationError=Wn0;class T70 extends Error{constructor($,Z){super($,Z);this.name="UserAuthenticationExpiredError"}static parse($){if($.toLowerCase().indexOf("user authentication expired")!==-1)return new T70($);return null}}Ps1.UserAuthenticationExpiredError=T70;class R70 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 R70($);return null}}Ps1.AuthorizationError=R70;class Hn0 extends Error{constructor(){super("closed connection");this.name="ClosedConnectionError"}}Ps1.ClosedConnectionError=Hn0;class Fn0 extends Error{constructor(){super("connection draining");this.name="DrainingConnectionError"}}Ps1.DrainingConnectionError=Fn0;class Nn0 extends Error{constructor($,Z){super($,Z);this.name="ConnectionError"}}Ps1.ConnectionError=Nn0;class Un0 extends Error{constructor($,Z){super($,Z);this.name="ProtocolError"}}Ps1.ProtocolError=Un0;class Bn0 extends Error{constructor($="",Z){super($,Z);this.name="RequestError"}isNoResponders(){return this.cause instanceof I70}}Ps1.RequestError=Bn0;class On0 extends Error{constructor($){super("timeout",$);this.name="TimeoutError"}}Ps1.TimeoutError=On0;class I70 extends Error{subject;constructor($,Z){super(`no responders: '${$}'`,Z);this.subject=$,this.name="NoResponders"}}Ps1.NoRespondersError=I70;class q70 extends Error{operation;subject;queue;constructor($,Z,Q,X,Y){super($,Y);this.name="PermissionViolationError",this.operation=Z,this.subject=Q,this.queue=X}static parse($){if(($?$.toLowerCase():"").indexOf("permissions violation")===-1)return null;let Q="publish",X="",Y=void 0,G=$.match(/(Publish|Subscription) to "(\S+)"/);if(G){if(Q=G[1].toLowerCase(),X=G[2],Q==="subscription"){let J=$.match(/using queue "(\S+)"/);if(J)Y=J[1]}}return new q70($,Q,X,Y)}}Ps1.PermissionViolationError=q70;Ps1.errors={AuthorizationError:R70,ClosedConnectionError:Hn0,ConnectionError:Nn0,DrainingConnectionError:Fn0,InvalidArgumentError:A70,InvalidOperationError:Wn0,InvalidSubjectError:Kn0,NoRespondersError:I70,PermissionViolationError:q70,ProtocolError:Un0,RequestError:Bn0,TimeoutError:On0,UserAuthenticationExpiredError:T70}});var d3=v((qs1)=>{Object.defineProperty(qs1,"__esModule",{value:!0});qs1.SimpleMutex=qs1.Perf=void 0;qs1.extend=Se8;qs1.render=Ce8;qs1.timeout=_e8;qs1.delay=ve8;qs1.deadline=xe8;qs1.deferred=Dn0;qs1.debugDeferred=fe8;qs1.shuffle=be8;qs1.collect=ye8;qs1.jitter=Is1;qs1.backoff=ge8;qs1.nanos=he8;qs1.millis=ue8;qs1.randomToken=me8;var ke8=XG(),Ln0=YG();function Se8($,...Z){for(let Q=0;Q<Z.length;Q++){let X=Z[Q];Object.keys(X).forEach(function(Y){$[Y]=X[Y]})}return $}function Ce8($){return ke8.TD.decode($).replace(/\n/g,"\u240A").replace(/\r/g,"\u240D")}function _e8($,Z=!0){let Q=Z?new Ln0.TimeoutError:null,X,Y,G=new Promise((J,K)=>{X={cancel:()=>{if(Y)clearTimeout(Y)}},Y=setTimeout(()=>{if(Q===null)K(new Ln0.TimeoutError);else K(Q)},$)});return Object.assign(G,X)}function ve8($=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 xe8($,Z=1000){let Q=Dn0(),X=setTimeout(()=>{Q.reject(new Ln0.TimeoutError)},Z);try{return await Promise.race([$,Q])}finally{clearTimeout(X)}}function Dn0(){let $={},Z=new Promise((Q,X)=>{$={resolve:Q,reject:X}});return Object.assign(Z,$)}function fe8(){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 be8($){for(let Z=$.length-1;Z>0;Z--){let Q=Math.floor(Math.random()*(Z+1));[$[Z],$[Q]]=[$[Q],$[Z]]}return $}async function ye8($){let Z=[];for await(let Q of $)Z.push(Q);return Z}class Ts1{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})}),$}}qs1.Perf=Ts1;class Rs1{max;current;waiting;constructor($=1){this.max=$,this.current=0,this.waiting=[]}lock(){if(this.current++,this.current<=this.max)return Promise.resolve();let $=Dn0();return this.waiting.push($),$}unlock(){this.current--,this.waiting.pop()?.resolve()}}qs1.SimpleMutex=Rs1;function Is1($){if($===0)return 0;return Math.floor($/2+Math.random()*$)}function ge8($=[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 Is1(Q>Z?$[Z]:$[Q])}}}function he8($){return $*1e6}function ue8($){return Math.floor($/1e6)}var ce8="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",BN=new Uint8Array(62);for(let $=0;$<62;$++)BN[$]=ce8.charCodeAt($);var le8=218340105584896;function me8(){let $=Math.floor(Math.random()*le8),Z=$%62,Q=BN[Z];$=($-Z)/62,Z=$%62;let X=BN[Z];$=($-Z)/62,Z=$%62;let Y=BN[Z];$=($-Z)/62,Z=$%62;let G=BN[Z];$=($-Z)/62,Z=$%62;let J=BN[Z];$=($-Z)/62,Z=$%62;let K=BN[Z];$=($-Z)/62,Z=$%62;let W=BN[Z];$=($-Z)/62;let H=BN[$];return String.fromCharCode(Q,X,Y,G,J,K,W,H)}});var xs1=v((_s1)=>{Object.defineProperty(_s1,"__esModule",{value:!0});_s1.nuid=_s1.NuidImpl=void 0;var G04="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",NO=62,V70=12,Ss1=10,Vs1=33,J04=333,ks1=V70+Ss1,En0=new Uint8Array(NO);for(let $=0;$<NO;$++)En0[$]=G04.charCodeAt($);var M70=4294967296,Cs1=BigInt(NO)**BigInt(Ss1),Ep=Number(Cs1/(1n<<32n)),wn0=Number(Cs1%(1n<<32n));function K04($){for(let Z=0;Z<$.length;Z++)$[Z]=Math.floor(Math.random()*256)}function W04($){if(globalThis?.crypto?.getRandomValues)globalThis.crypto.getRandomValues($);else K04($)}class jn0{buf;cbuf;seqHi;seqLo;inc;inited;constructor(){this.buf=new Uint8Array(ks1),this.cbuf=new Uint8Array(V70),this.inited=!1}init(){this.inited=!0,this.setPre(),this.initSeqAndInc(),this.fillSeq()}initSeqAndInc(){let $=0;do this.seqHi=Math.floor(Math.random()*(Ep+1)),this.seqLo=Math.floor(Math.random()*M70);while($++<8&&this.seqHi===Ep&&this.seqLo>=wn0);if(this.seqHi===Ep&&this.seqLo>=wn0)this.seqLo=0;this.inc=Math.random()*(J04-Vs1)+Vs1|0}setPre(){W04(this.cbuf);for(let $=0;$<V70;$++)this.buf[$]=En0[this.cbuf[$]%NO]}fillSeq(){let $=this.seqHi,Z=this.seqLo;for(let Q=ks1-1;Q>=V70;Q--){let X=Math.floor($/NO),G=($-X*NO)*M70+Z,J=Math.floor(G/NO),K=G-J*NO;this.buf[Q]=En0[K],$=X,Z=J}}next(){if(!this.inited)this.init();if(this.seqLo+=this.inc,this.seqLo>=M70)this.seqLo-=M70,this.seqHi+=1;if(this.seqHi>Ep||this.seqHi===Ep&&this.seqLo>=wn0)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()}}_s1.NuidImpl=jn0;_s1.nuid=new jn0});var gs1=v((bs1)=>{Object.defineProperty(bs1,"__esModule",{value:!0});bs1.nuid=bs1.Nuid=void 0;var fs1=xs1();bs1.Nuid=fs1.NuidImpl;bs1.nuid=fs1.nuid});var S70=v((k70)=>{Object.defineProperty(k70,"__esModule",{value:!0});k70.nuid=k70.Nuid=void 0;var hs1=gs1();Object.defineProperty(k70,"Nuid",{enumerable:!0,get:function(){return hs1.Nuid}});Object.defineProperty(k70,"nuid",{enumerable:!0,get:function(){return hs1.nuid}})});var UO=v((us1)=>{Object.defineProperty(us1,"__esModule",{value:!0});us1.DEFAULT_HOST=us1.DEFAULT_PORT=us1.Match=void 0;us1.syncIterator=O04;us1.createInbox=L04;var U04=S70(),B04=YG();us1.Match={Exact:"exact",CanonicalMIME:"canonical",IgnoreCase:"insensitive"};function O04($){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 L04($=""){if($=$||"_INBOX",typeof $!=="string")throw TypeError("prefix must be a string");return $.split(".").forEach((Z)=>{if(Z==="*"||Z===">")throw B04.InvalidArgumentError.format("prefix",`cannot have wildcards ('${$}')`)}),`${$}.${U04.nuid.next()}`}us1.DEFAULT_PORT=4222;us1.DEFAULT_HOST="127.0.0.1"});var jp=v((ds1)=>{Object.defineProperty(ds1,"__esModule",{value:!0});ds1.DataBuffer=void 0;var ls1=XG();class ms1{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 ls1.TE.encode($)}static toAscii($){return ls1.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}}ds1.DataBuffer=ms1});var rE=v((ns1)=>{Object.defineProperty(ns1,"__esModule",{value:!0});ns1.LF=ns1.CR=ns1.CRLF=ns1.CR_LF_LEN=ns1.CR_LF=void 0;ns1.setTransportFactory=T04;ns1.defaultPort=R04;ns1.getUrlParseFn=I04;ns1.newTransport=q04;ns1.getResolveFn=M04;ns1.protoLen=ps1;ns1.extractProtocolMessage=V04;var z04=XG(),P04=UO(),A04=jp(),GG;function T04($){GG=$}function R04(){return GG!==void 0&&GG.defaultPort!==void 0?GG.defaultPort:P04.DEFAULT_PORT}function I04(){return GG!==void 0&&GG.urlParseFn?GG.urlParseFn:void 0}function q04(){if(!GG||typeof GG.factory!=="function")throw Error("transport fn is not set");return GG.factory()}function M04(){return GG!==void 0&&GG.dnsResolveFn?GG.dnsResolveFn:void 0}ns1.CR_LF=`\r
1492
+ `);X=G.pop()??"";for(let J of G){let K=Bun.stripANSI(J).replace(/^\[\d+\]\s*/,"").trim();if(!K)continue;WO({method:"",path:"",status:0,duration:0,timestamp:new Date,rawLine:K})}}(async()=>{try{for(;;){let{done:G,value:J}=await Z.read();if(G)break;X+=Q.decode(J,{stream:!0}),Y()}}catch{}if(X.trim()){let G=Bun.stripANSI(X).replace(/^\[\d+\]\s*/,"").trim();if(G)WO({method:"",path:"",status:0,duration:0,timestamp:new Date,rawLine:G})}})()}async function fs8($){let{baseUrl:Z,noTui:Q}=$,X=process.env.HOST==="0.0.0.0"&&Boolean(process.env.PORT),Y=X?process.env.PORT:$.vitePort,G=Z||`http://localhost:${Y}`,J=X?await Dp(Number(Y)+1):await Dp(Number($.port)),{settings:K,services:W,managedServiceNames:H}=await w70({port:String(J),home:$.home,baseUrl:$.baseUrl,localMode:$.localMode,skipMigrations:$.skipMigrations,noTui:$.noTui,vitePort:$.vitePort});for(let D of W)dE({name:D.name,status:"ready",port:D.port});Op();let F=xs8(import.meta.dir,"..","..","..","..",".."),N=Q===!0,U=Bun.spawn(["bun","run","dev:servers"],{cwd:F,env:{...process.env,PORT:String(K.port),VITE_PORT:String(Y),DATABASE_URL:K.databaseUrl,NATS_URL:K.natsUrls.join(","),NODE_ENV:K.nodeEnv,BASE_URL:G,DECOCMS_LOCAL_MODE:String(K.localMode),DECOCMS_HOME:K.dataDir,DATA_DIR:K.dataDir,DECO_CLI:"1",...K.betterAuthSecret?{BETTER_AUTH_SECRET:K.betterAuthSecret}:{},...K.s3Endpoint?{S3_ENDPOINT:K.s3Endpoint,S3_BUCKET:K.s3Bucket??"",S3_ACCESS_KEY_ID:K.s3AccessKeyId??"",S3_SECRET_ACCESS_KEY:K.s3SecretAccessKey??"",S3_FORCE_PATH_STYLE:String(K.s3ForcePathStyle)}:{},...K.natsCredsPath?{NATS_CREDS:K.natsCredsPath}:{}},stdio:["inherit",N?"inherit":"pipe",N?"inherit":"pipe"]});if(!N)ap0(U.stdout),ap0(U.stderr);Lp(G),dE({name:"Vite",status:"ready",port:Number(Y)}),dE({name:"API",status:"ready",port:Number(K.port)});let O=async(D)=>{if(U.kill(D),await U.exited,H.length>0){let{stopServices:w}=await Promise.resolve().then(() => (AZ0(),PZ0));await w(K.dataDir)}};return process.on("SIGINT",()=>O("SIGINT")),process.on("SIGTERM",()=>O("SIGTERM")),{port:Number(Y),process:U}}var ep0=L(()=>{pp0();iE();rp0()});var z70;var $n0=L(()=>{z70={name:"decocms",version:"4.303.19",description:"Deco CMS \u2014 Self-hostable MCP Gateway for managing AI connections and tools",author:"Deco team",repository:{type:"git",url:"git+https://github.com/decocms/studio.git",directory:"apps/api"},bugs:{url:"https://github.com/decocms/studio/issues"},type:"module",bin:{deco:"./dist/server/cli.js"},files:["dist/**/*"],scripts:{dev:"bun run migrate && bun run dev:server","dev:server":"bun run --cwd=../../packages/sandbox build && NODE_ENV=development bun --env-file=.env --hot run src/index.ts",build:"bun run build:server","build:server":"bun run scripts/bundle-server-script.ts --dist ./dist/server","generate:tool-contracts":"bun run scripts/generate-tool-contracts.ts","db:migrate":"bun run ./dist/server/migrate.js","db:migrate:dbos":"bun run ./dist/server/migrate-dbos.js",check:"tsc --noEmit",start:"bun run ./dist/server/server.js",migrate:"bun run src/database/migrate.ts","migrate:dbos":"bun run src/database/migrate-dbos.ts",test:"bun test src","better-auth:migrate":"bunx --bun @better-auth/cli migrate -y --config src/auth/index.ts",prepublishOnly:"bun run --cwd=../.. build:studio"},optionalDependencies:{"@duckdb/node-api":"^1.5.0-r.1"},dependencies:{"@ai-sdk/anthropic":"^3.0.85","@ai-sdk/google":"^3.0.83","@ai-sdk/openai":"^3.0.73","@anthropic-ai/sdk":"^0.105.0","@aws-sdk/client-s3":"^3.1013.0","@aws-sdk/client-sts":"^3.1013.0","@aws-sdk/lib-storage":"^3.1013.0","@aws-sdk/s3-request-presigner":"^3.1013.0","@clickhouse/client":"^1.8.1","@dbos-inc/dbos-sdk":"^4.21.6","@inkjs/ui":"^2.0.0","@nats-io/jetstream":"3.4.0","@nats-io/kv":"3.4.0","@nats-io/nats-core":"3.4.0","@nats-io/transport-node":"3.4.0","@openrouter/ai-sdk-provider":"^2.9.1","@opentelemetry/core":"^2.6.0","embedded-postgres":"^18.3.0-beta.16",ink:"^6.8.0",kysely:"^0.28.12","posthog-node":"^5.0.0",react:"^19.2.6","react-dom":"^19.2.6"},devDependencies:{"@ai-sdk/provider":"^3.0.10","@better-auth/sso":"1.4.1","@decocms/better-auth":"1.5.17","@decocms/bindings":"workspace:*","@decocms/mcp-utils":"workspace:*","@decocms/runtime":"workspace:*","@decocms/sandbox":"workspace:*","@decocms/shared":"workspace:*","@jitl/quickjs-wasmfile-release-sync":"0.31.0","@modelcontextprotocol/sdk":"1.29.0","@opentelemetry/api":"^1.9.0","@opentelemetry/api-logs":"^0.211.0","@opentelemetry/exporter-logs-otlp-proto":"^0.211.0","@opentelemetry/exporter-prometheus":"^0.208.0","@opentelemetry/exporter-trace-otlp-proto":"^0.207.0","@opentelemetry/instrumentation-runtime-node":"^0.24.0","@opentelemetry/resources":"^2.6.0","@opentelemetry/sdk-logs":"^0.211.0","@opentelemetry/sdk-metrics":"^2.2.0","@opentelemetry/sdk-node":"^0.207.0","@opentelemetry/sdk-trace-base":"^2.5.0","@types/bun":"^1.3.1","@types/google.maps":"^3.65.2","@types/pg":"^8.15.6","@types/react-syntax-highlighter":"^15.5.13","@vercel/nft":"^1.1.1",ai:"^6.0.208","better-auth":"1.4.22",croner:"^9.1.0",degit:"^2.8.4",hono:"^4.10.7",jose:"^6.0.11",nanoid:"^5.1.6",pg:"^8.16.3",typescript:"^7.0.2",typescript5:"npm:typescript@^5.9.3",zod:"4.3.6"},homepage:"https://github.com/decocms/studio",keywords:["mcp","model-context-protocol","ai","gateway","self-hosted","tools"],license:"MIT",publishConfig:{access:"public"}}});import{Box as ys8,Text as na1}from"ink";import{jsx as gs8,jsxs as ta1}from"react/jsx-runtime";function oa1({version:$}){return ta1(ys8,{flexDirection:"column",marginTop:1,children:[iZ0.map((Z,Q)=>gs8(na1,{color:pZ0[Q],children:Z},Q)),ta1(na1,{dimColor:!0,children:[" v",$]})]})}var ra1=L(()=>{Zp()});import{Box as pE,Text as HO}from"ink";import{Spinner as hs8}from"@inkjs/ui";import{jsx as QG,jsxs as zy}from"react/jsx-runtime";function aa1({status:$}){if($==="pending")return QG(hs8,{label:""});return QG(HO,{color:"green",children:"\u2713"})}function us8($){return`${$.name}: ${$.port||"...."}`}function sa1({services:$,migrationsStatus:Z,home:Q,serverUrl:X}){return zy(pE,{flexDirection:"column",paddingBottom:1,children:[QG(oa1,{version:z70.version}),QG(pE,{marginBottom:1,children:QG(HO,{dimColor:!0,children:"\u2500".repeat(80)})}),QG(pE,{children:zy(HO,{dimColor:!0,children:["Home: ",Q]})}),zy(pE,{gap:2,children:[$.map((Y)=>zy(pE,{gap:1,children:[QG(HO,{children:us8(Y)}),QG(aa1,{status:Y.status})]},Y.name)),zy(pE,{gap:1,children:[QG(HO,{children:"Migrations"}),QG(aa1,{status:Z})]})]}),QG(pE,{children:X?zy(HO,{children:["Open in browser: ",QG(HO,{color:"cyan",children:X})]}):QG(HO,{dimColor:!0,children:"Starting..."})})]})}var ea1=L(()=>{$n0();ra1()});import{Box as cs8,Text as wp}from"ink";import{jsx as Zn0,jsxs as Qn0}from"react/jsx-runtime";function ls8($){if($>=500)return"red";if($>=400)return"yellow";if($>=300)return"cyan";return"green"}function $s1({logs:$}){return Zn0(cs8,{flexDirection:"column",children:$.map((Z,Q)=>{if(Z.rawLine)return Zn0(wp,{dimColor:!0,children:Z.rawLine},Q);let X=Z.duration<1000?`${Z.duration}ms`:`${(Z.duration/1000).toFixed(1)}s`;return Qn0(wp,{children:[Qn0(wp,{dimColor:!0,children:[Z.method.padEnd(6)," ",Z.path.padEnd(30)," "]}),Zn0(wp,{color:ls8(Z.status),children:Z.status}),Qn0(wp,{dimColor:!0,children:[" ",X.padStart(8)]})]},Q)})})}var Zs1=()=>{};var Xn0={};Z0(Xn0,{App:()=>is8});import{Box as ms8}from"ink";import{useSyncExternalStore as ds8}from"react";import{jsx as Qs1,jsxs as ps8}from"react/jsx-runtime";function is8({home:$}){let Z=ds8(op0,tp0);return ps8(ms8,{flexDirection:"column",children:[Qs1(sa1,{services:Z.services,migrationsStatus:Z.migrationsStatus,home:$,serverUrl:Z.serverUrl}),Qs1($s1,{logs:Z.logs})]})}var Yn0=L(()=>{ea1();Zs1();iE()});var m3="thread-gate",NN="decopilot-hosted-harness",UN="decopilot-hosted-harness-sandboxed",EJ="automations",FO="background-tools",nE="task-board-github-reads",tE="jira-push";var Xs1="9";function Ys1($){return{name:"decocms",systemDatabaseUrl:$.systemDatabaseUrl,systemDatabaseSchemaName:"dbos",systemDatabasePoolSize:$.poolSize,runAdminServer:!1,executorID:$.executorID,applicationVersion:Xs1,...$.listenQueues!==void 0?{listenQueues:$.listenQueues}:{}}}var Gs1=()=>{};import ns8 from"pg";async function Ks1($,Z){let{databaseUrl:Q,lockTimeoutMs:X=ts8}=$,Y=$.log??((W)=>console.log(W)),G=new ns8.Client({connectionString:Q});await G.connect();let J=Date.now(),K=!1;try{while(!K){if(K=(await G.query("SELECT pg_try_advisory_lock($1) AS locked",[Js1.toString()])).rows[0]?.locked===!0,K)break;if(Date.now()-J>=X)throw Error(`Timed out after ${X}ms waiting for the DBOS migration lock. Another process is still migrating the dbos schema; this pod will restart and retry.`);await H$(os8)}let W=Date.now()-J;if(W>1000)Y(`[dbos] waited ${W}ms for the migration lock; another process migrated first`);return await Z()}finally{if(K)try{await G.query("SELECT pg_advisory_unlock($1)",[Js1.toString()])}catch{}await G.end().catch(()=>{})}}var Js1=8314027461559302n,ts8=600000,os8=500;var Ws1=L(()=>{J4()});function rs8(){let $=(process.env.BUN_OPTIONS??"").split(/\s+/).filter(Boolean);return[...process.argv.slice(1),...$]}function Gn0($,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 Hs1(){let $=rs8();if($.includes("--cpu-prof")){console.log(JSON.stringify({msg:"cpu-profiling-active",dir:Gn0($,"--cpu-prof-dir")??process.cwd(),name:Gn0($,"--cpu-prof-name"),markdown:$.includes("--cpu-prof-md"),intervalUs:Number(Gn0($,"--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 Fs1(){if(process.env.HEAP_WATCH!=="1")return()=>{};let $=Number(process.env.HEAP_WATCH_INTERVAL_MS??60000),Z=async()=>{let Q=uE();if(!Q)return;let X={};try{let{heapStats:Y}=await import("bun:jsc"),G=Y(),J=Object.entries(G.objectTypeCounts).sort((K,W)=>W[1]-K[1]).slice(0,20);X={objectCount:G.objectCount,heapSize:G.heapSize,top:Object.fromEntries(J)}}catch{}console.log(JSON.stringify({msg:"heap-watch",ts:new Date().toISOString(),uptimeS:Math.round(process.uptime()),rss:Q.rss,heapUsed:Q.heapUsed,heapTotal:Q.heapTotal,external:Q.external,arrayBuffers:Q.arrayBuffers,...X}))};return Z().catch(()=>{}),P70=setInterval(()=>void Z().catch(()=>{}),$),P70.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(P70)clearInterval(P70)}}var P70;var Ns1=()=>{};import*as as8 from"bun:jsc";function Us1(){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{ss8()}catch(G){return console.error("[stall-watchdog] failed to start sampling profiler:",G),()=>{}}let Q,X=performance.now()+Z,Y=()=>{let G=performance.now(),J=G-X;X=G+Z;let K=[];try{K=es8()?.traces??[]}catch{}if(J>$&&K.length>0){let W=new Map;for(let F of K){let N=F.frames.find((O)=>O.sourceURL&&!/Unknown Executable/.test(O.category??""))??F.frames[0];if(!N)continue;let U=(N.sourceURL??"?").replace(/^.*\/node_modules\//,"node_modules/"),B=`${N.name??"?"} @ ${U}:${N.line??"?"}`;W.set(B,(W.get(B)??0)+1)}let H=[...W.entries()].sort((F,N)=>N[1]-F[1]).slice(0,8).map(([F,N])=>({frame:F,count:N}));console.warn(JSON.stringify({msg:"stall-stack",ts:new Date().toISOString(),lagMs:Math.round(J),samplesInWindow:K.length,top:H}))}Q=setTimeout(Y,Z),Q.unref?.()};return Q=setTimeout(Y,Z),Q.unref?.(),()=>{if(Q)clearTimeout(Q)}}var ss8,es8;var Bs1=L(()=>{({startSamplingProfiler:ss8,samplingProfilerStackTraces:es8}=as8)});function Os1(){Hs1();let $=[Fs1(),Cn1(),Us1()];return()=>{for(let Z of $)Z()}}var Ls1=L(()=>{Cl0();Ns1();Bs1()});var oE=v((Ds1)=>{Object.defineProperty(Ds1,"__esModule",{value:!0});Ds1.RepublishHeaders=Ds1.DirectMsgHeaders=Ds1.JsHeaders=Ds1.AdvisoryKind=void 0;Ds1.isOrderedPushConsumerOptions=$e8;Ds1.isPullConsumer=Ze8;Ds1.isPushConsumer=Qe8;Ds1.isBoundPushConsumerOptions=Xe8;function $e8($){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 Ze8($){return $.isPullConsumer()}function Qe8($){return $.isPushConsumer()}function Xe8($){if($&&typeof $==="object")return"deliver_subject"in $||"deliver_group"in $||"idle_heartbeat"in $;return!1}Ds1.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"};Ds1.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"};Ds1.DirectMsgHeaders={Stream:"Nats-Stream",Sequence:"Nats-Sequence",TimeStamp:"Nats-Time-Stamp",Subject:"Nats-Subject",LastSequence:"Nats-Last-Sequence",NumPending:"Nats-Num-Pending"};Ds1.RepublishHeaders={Stream:"Nats-Stream",Subject:"Nats-Subject",Sequence:"Nats-Sequence",LastSequence:"Nats-Last-Sequence",Size:"Nats-Msg-Size"}});var XG=v((Es1)=>{Object.defineProperty(Es1,"__esModule",{value:!0});Es1.TD=Es1.TE=Es1.Empty=void 0;Es1.encode=Ue8;Es1.decode=Be8;Es1.Empty=new Uint8Array(0);Es1.TE=new TextEncoder;Es1.TD=new TextDecoder;function Ne8(...$){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 Ue8(...$){let Z=[];for(let Q=0;Q<$.length;Q++)Z.push(Es1.TE.encode($[Q]));if(Z.length===0)return Es1.Empty;if(Z.length===1)return Z[0];return Ne8(...Z)}function Be8($){if(!$||$.length===0)return"";return Es1.TD.decode($)}});var YG=v((Ps1)=>{Object.defineProperty(Ps1,"__esModule",{value:!0});Ps1.errors=Ps1.PermissionViolationError=Ps1.NoRespondersError=Ps1.TimeoutError=Ps1.RequestError=Ps1.ProtocolError=Ps1.ConnectionError=Ps1.DrainingConnectionError=Ps1.ClosedConnectionError=Ps1.AuthorizationError=Ps1.UserAuthenticationExpiredError=Ps1.InvalidOperationError=Ps1.InvalidArgumentError=Ps1.InvalidSubjectError=void 0;class Kn0 extends Error{constructor($,Z){super(`illegal subject: '${$}'`,Z);this.name="InvalidSubjectError"}}Ps1.InvalidSubjectError=Kn0;class A70 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 A70(`${$} ${Z}`,Q)}}Ps1.InvalidArgumentError=A70;class Wn0 extends Error{constructor($,Z){super($,Z);this.name="InvalidOperationError"}}Ps1.InvalidOperationError=Wn0;class T70 extends Error{constructor($,Z){super($,Z);this.name="UserAuthenticationExpiredError"}static parse($){if($.toLowerCase().indexOf("user authentication expired")!==-1)return new T70($);return null}}Ps1.UserAuthenticationExpiredError=T70;class R70 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 R70($);return null}}Ps1.AuthorizationError=R70;class Hn0 extends Error{constructor(){super("closed connection");this.name="ClosedConnectionError"}}Ps1.ClosedConnectionError=Hn0;class Fn0 extends Error{constructor(){super("connection draining");this.name="DrainingConnectionError"}}Ps1.DrainingConnectionError=Fn0;class Nn0 extends Error{constructor($,Z){super($,Z);this.name="ConnectionError"}}Ps1.ConnectionError=Nn0;class Un0 extends Error{constructor($,Z){super($,Z);this.name="ProtocolError"}}Ps1.ProtocolError=Un0;class Bn0 extends Error{constructor($="",Z){super($,Z);this.name="RequestError"}isNoResponders(){return this.cause instanceof I70}}Ps1.RequestError=Bn0;class On0 extends Error{constructor($){super("timeout",$);this.name="TimeoutError"}}Ps1.TimeoutError=On0;class I70 extends Error{subject;constructor($,Z){super(`no responders: '${$}'`,Z);this.subject=$,this.name="NoResponders"}}Ps1.NoRespondersError=I70;class q70 extends Error{operation;subject;queue;constructor($,Z,Q,X,Y){super($,Y);this.name="PermissionViolationError",this.operation=Z,this.subject=Q,this.queue=X}static parse($){if(($?$.toLowerCase():"").indexOf("permissions violation")===-1)return null;let Q="publish",X="",Y=void 0,G=$.match(/(Publish|Subscription) to "(\S+)"/);if(G){if(Q=G[1].toLowerCase(),X=G[2],Q==="subscription"){let J=$.match(/using queue "(\S+)"/);if(J)Y=J[1]}}return new q70($,Q,X,Y)}}Ps1.PermissionViolationError=q70;Ps1.errors={AuthorizationError:R70,ClosedConnectionError:Hn0,ConnectionError:Nn0,DrainingConnectionError:Fn0,InvalidArgumentError:A70,InvalidOperationError:Wn0,InvalidSubjectError:Kn0,NoRespondersError:I70,PermissionViolationError:q70,ProtocolError:Un0,RequestError:Bn0,TimeoutError:On0,UserAuthenticationExpiredError:T70}});var d3=v((qs1)=>{Object.defineProperty(qs1,"__esModule",{value:!0});qs1.SimpleMutex=qs1.Perf=void 0;qs1.extend=Se8;qs1.render=Ce8;qs1.timeout=_e8;qs1.delay=ve8;qs1.deadline=xe8;qs1.deferred=Dn0;qs1.debugDeferred=fe8;qs1.shuffle=be8;qs1.collect=ye8;qs1.jitter=Is1;qs1.backoff=ge8;qs1.nanos=he8;qs1.millis=ue8;qs1.randomToken=me8;var ke8=XG(),Ln0=YG();function Se8($,...Z){for(let Q=0;Q<Z.length;Q++){let X=Z[Q];Object.keys(X).forEach(function(Y){$[Y]=X[Y]})}return $}function Ce8($){return ke8.TD.decode($).replace(/\n/g,"\u240A").replace(/\r/g,"\u240D")}function _e8($,Z=!0){let Q=Z?new Ln0.TimeoutError:null,X,Y,G=new Promise((J,K)=>{X={cancel:()=>{if(Y)clearTimeout(Y)}},Y=setTimeout(()=>{if(Q===null)K(new Ln0.TimeoutError);else K(Q)},$)});return Object.assign(G,X)}function ve8($=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 xe8($,Z=1000){let Q=Dn0(),X=setTimeout(()=>{Q.reject(new Ln0.TimeoutError)},Z);try{return await Promise.race([$,Q])}finally{clearTimeout(X)}}function Dn0(){let $={},Z=new Promise((Q,X)=>{$={resolve:Q,reject:X}});return Object.assign(Z,$)}function fe8(){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 be8($){for(let Z=$.length-1;Z>0;Z--){let Q=Math.floor(Math.random()*(Z+1));[$[Z],$[Q]]=[$[Q],$[Z]]}return $}async function ye8($){let Z=[];for await(let Q of $)Z.push(Q);return Z}class Ts1{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})}),$}}qs1.Perf=Ts1;class Rs1{max;current;waiting;constructor($=1){this.max=$,this.current=0,this.waiting=[]}lock(){if(this.current++,this.current<=this.max)return Promise.resolve();let $=Dn0();return this.waiting.push($),$}unlock(){this.current--,this.waiting.pop()?.resolve()}}qs1.SimpleMutex=Rs1;function Is1($){if($===0)return 0;return Math.floor($/2+Math.random()*$)}function ge8($=[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 Is1(Q>Z?$[Z]:$[Q])}}}function he8($){return $*1e6}function ue8($){return Math.floor($/1e6)}var ce8="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",BN=new Uint8Array(62);for(let $=0;$<62;$++)BN[$]=ce8.charCodeAt($);var le8=218340105584896;function me8(){let $=Math.floor(Math.random()*le8),Z=$%62,Q=BN[Z];$=($-Z)/62,Z=$%62;let X=BN[Z];$=($-Z)/62,Z=$%62;let Y=BN[Z];$=($-Z)/62,Z=$%62;let G=BN[Z];$=($-Z)/62,Z=$%62;let J=BN[Z];$=($-Z)/62,Z=$%62;let K=BN[Z];$=($-Z)/62,Z=$%62;let W=BN[Z];$=($-Z)/62;let H=BN[$];return String.fromCharCode(Q,X,Y,G,J,K,W,H)}});var xs1=v((_s1)=>{Object.defineProperty(_s1,"__esModule",{value:!0});_s1.nuid=_s1.NuidImpl=void 0;var G04="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",NO=62,V70=12,Ss1=10,Vs1=33,J04=333,ks1=V70+Ss1,En0=new Uint8Array(NO);for(let $=0;$<NO;$++)En0[$]=G04.charCodeAt($);var M70=4294967296,Cs1=BigInt(NO)**BigInt(Ss1),Ep=Number(Cs1/(1n<<32n)),wn0=Number(Cs1%(1n<<32n));function K04($){for(let Z=0;Z<$.length;Z++)$[Z]=Math.floor(Math.random()*256)}function W04($){if(globalThis?.crypto?.getRandomValues)globalThis.crypto.getRandomValues($);else K04($)}class jn0{buf;cbuf;seqHi;seqLo;inc;inited;constructor(){this.buf=new Uint8Array(ks1),this.cbuf=new Uint8Array(V70),this.inited=!1}init(){this.inited=!0,this.setPre(),this.initSeqAndInc(),this.fillSeq()}initSeqAndInc(){let $=0;do this.seqHi=Math.floor(Math.random()*(Ep+1)),this.seqLo=Math.floor(Math.random()*M70);while($++<8&&this.seqHi===Ep&&this.seqLo>=wn0);if(this.seqHi===Ep&&this.seqLo>=wn0)this.seqLo=0;this.inc=Math.random()*(J04-Vs1)+Vs1|0}setPre(){W04(this.cbuf);for(let $=0;$<V70;$++)this.buf[$]=En0[this.cbuf[$]%NO]}fillSeq(){let $=this.seqHi,Z=this.seqLo;for(let Q=ks1-1;Q>=V70;Q--){let X=Math.floor($/NO),G=($-X*NO)*M70+Z,J=Math.floor(G/NO),K=G-J*NO;this.buf[Q]=En0[K],$=X,Z=J}}next(){if(!this.inited)this.init();if(this.seqLo+=this.inc,this.seqLo>=M70)this.seqLo-=M70,this.seqHi+=1;if(this.seqHi>Ep||this.seqHi===Ep&&this.seqLo>=wn0)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()}}_s1.NuidImpl=jn0;_s1.nuid=new jn0});var gs1=v((bs1)=>{Object.defineProperty(bs1,"__esModule",{value:!0});bs1.nuid=bs1.Nuid=void 0;var fs1=xs1();bs1.Nuid=fs1.NuidImpl;bs1.nuid=fs1.nuid});var S70=v((k70)=>{Object.defineProperty(k70,"__esModule",{value:!0});k70.nuid=k70.Nuid=void 0;var hs1=gs1();Object.defineProperty(k70,"Nuid",{enumerable:!0,get:function(){return hs1.Nuid}});Object.defineProperty(k70,"nuid",{enumerable:!0,get:function(){return hs1.nuid}})});var UO=v((us1)=>{Object.defineProperty(us1,"__esModule",{value:!0});us1.DEFAULT_HOST=us1.DEFAULT_PORT=us1.Match=void 0;us1.syncIterator=O04;us1.createInbox=L04;var U04=S70(),B04=YG();us1.Match={Exact:"exact",CanonicalMIME:"canonical",IgnoreCase:"insensitive"};function O04($){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 L04($=""){if($=$||"_INBOX",typeof $!=="string")throw TypeError("prefix must be a string");return $.split(".").forEach((Z)=>{if(Z==="*"||Z===">")throw B04.InvalidArgumentError.format("prefix",`cannot have wildcards ('${$}')`)}),`${$}.${U04.nuid.next()}`}us1.DEFAULT_PORT=4222;us1.DEFAULT_HOST="127.0.0.1"});var jp=v((ds1)=>{Object.defineProperty(ds1,"__esModule",{value:!0});ds1.DataBuffer=void 0;var ls1=XG();class ms1{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 ls1.TE.encode($)}static toAscii($){return ls1.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}}ds1.DataBuffer=ms1});var rE=v((ns1)=>{Object.defineProperty(ns1,"__esModule",{value:!0});ns1.LF=ns1.CR=ns1.CRLF=ns1.CR_LF_LEN=ns1.CR_LF=void 0;ns1.setTransportFactory=T04;ns1.defaultPort=R04;ns1.getUrlParseFn=I04;ns1.newTransport=q04;ns1.getResolveFn=M04;ns1.protoLen=ps1;ns1.extractProtocolMessage=V04;var z04=XG(),P04=UO(),A04=jp(),GG;function T04($){GG=$}function R04(){return GG!==void 0&&GG.defaultPort!==void 0?GG.defaultPort:P04.DEFAULT_PORT}function I04(){return GG!==void 0&&GG.urlParseFn?GG.urlParseFn:void 0}function q04(){if(!GG||typeof GG.factory!=="function")throw Error("transport fn is not set");return GG.factory()}function M04(){return GG!==void 0&&GG.dnsResolveFn?GG.dnsResolveFn:void 0}ns1.CR_LF=`\r
1493
1493
  `;ns1.CR_LF_LEN=ns1.CR_LF.length;ns1.CRLF=A04.DataBuffer.fromAscii(ns1.CR_LF);ns1.CR=new Uint8Array(ns1.CRLF)[0];ns1.LF=new Uint8Array(ns1.CRLF)[1];function ps1($){for(let Z=0;Z<$.length;Z++){let Q=Z+1;if($.byteLength>Q&&$[Z]===ns1.CR&&$[Q]===ns1.LF)return Q+1}return 0}function V04($){let Z=ps1($);if(Z>0){let X=new Uint8Array($).slice(0,Z);return z04.TD.decode(X)}return""}});var Rn0=v((Ze1)=>{Object.defineProperty(Ze1,"__esModule",{value:!0});Ze1.ipV4=ss1;Ze1.isIP=h04;Ze1.parseIP=es1;var zp=4,aE=16,C70=48,as1=57,os1=65,y04=70,rs1=97,g04=102,Tn0=16777215;function ss1($,Z,Q,X){let Y=new Uint8Array(aE);return[0,0,0,0,0,0,0,0,0,0,255,255].forEach((J,K)=>{Y[K]=J}),Y[12]=$,Y[13]=Z,Y[14]=Q,Y[15]=X,Y}function h04($){return es1($)!==void 0}function es1($){for(let Z=0;Z<$.length;Z++)switch($[Z]){case".":return $e1($);case":":return u04($)}return}function $e1($){let Z=new Uint8Array(zp);for(let Q=0;Q<zp;Q++){if($.length===0)return;if(Q>0){if($[0]!==".")return;$=$.substring(1)}let{n:X,c:Y,ok:G}=c04($);if(!G||X>255)return;$=$.substring(Y),Z[Q]=X}return ss1(Z[0],Z[1],Z[2],Z[3])}function u04($){let Z=new Uint8Array(aE),Q=-1;if($.length>=2&&$[0]===":"&&$[1]===":"){if(Q=0,$=$.substring(2),$.length===0)return Z}let X=0;while(X<aE){let{n:Y,c:G,ok:J}=l04($);if(!J||Y>65535)return;if(G<$.length&&$[G]==="."){if(Q<0&&X!=aE-zp)return;if(X+zp>aE)return;let K=$e1($);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+=zp;break}if(Z[X]=Y>>8,Z[X+1]=Y,X+=2,$=$.substring(G),$.length===0)break;if($[0]!==":"||$.length==1)return;if($=$.substring(1),$[0]===":"){if(Q>=0)return;if(Q=X,$=$.substring(1),$.length===0)break}}if($.length!==0)return;if(X<aE){if(Q<0)return;let Y=aE-X;for(let G=X-1;G>=Q;G--)Z[G+Y]=Z[G];for(let G=Q+Y-1;G>=Q;G--)Z[G]=0}else if(Q>=0)return;return Z}function c04($){let Z=0,Q=0;for(Z=0;Z<$.length&&C70<=$.charCodeAt(Z)&&$.charCodeAt(Z)<=as1;Z++)if(Q=Q*10+($.charCodeAt(Z)-C70),Q>=Tn0)return{n:Tn0,c:Z,ok:!1};if(Z===0)return{n:0,c:0,ok:!1};return{n:Q,c:Z,ok:!0}}function l04($){let Z=0,Q=0;for(Q=0;Q<$.length;Q++){if(C70<=$.charCodeAt(Q)&&$.charCodeAt(Q)<=as1)Z*=16,Z+=$.charCodeAt(Q)-C70;else if(rs1<=$.charCodeAt(Q)&&$.charCodeAt(Q)<=g04)Z*=16,Z+=$.charCodeAt(Q)-rs1+10;else if(os1<=$.charCodeAt(Q)&&$.charCodeAt(Q)<=y04)Z*=16,Z+=$.charCodeAt(Q)-os1+10;else break;if(Z>=Tn0)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 Sn0=v((Xe1)=>{Object.defineProperty(Xe1,"__esModule",{value:!0});Xe1.Servers=Xe1.ServerImpl=void 0;Xe1.isIPV4OrHostname=Qe1;Xe1.hostPort=kn0;var In0=rE(),qn0=d3(),Mn0=Rn0(),p04=UO(),n04=YG();function Qe1($){if($.indexOf("[")!==-1||$.indexOf("::")!==-1)return!1;if($.indexOf(".")!==-1)return!0;if($.split(":").length<=2)return!0;return!1}function Vn0($){return!Qe1($)}function t04($){let Q=$.toUpperCase().indexOf("::FFFF:");if(Q!==-1&&$.indexOf(".")!==-1){let X=$.substring(Q+7);return X=X.replace("[",""),X.replace("]","")}return $}function kn0($){if($=$.trim(),$.match(/^(.*:\/\/)(.*)/m))$=$.replace(/^(.*:\/\/)(.*)/gm,"$2");if($=t04($),Vn0($)&&$.indexOf("[")===-1)$=`[${$}]`;let Z=Vn0($)?$.match(/(]:)(\d+)/):$.match(/(:)(\d+)/),Q=Z&&Z.length===3&&Z[1]&&Z[2]?parseInt(Z[2]):p04.DEFAULT_PORT,Y=new URL(`${Q===80?"https":"http"}://${$}`);Y.port=`${Q}`;let G=Y.hostname;if(G.charAt(0)==="[")G=G.substring(1,G.length-1);return{listen:Y.host,hostname:G,port:Q}}class Py{src;listen;hostname;port;didConnect;reconnects;lastConnect;gossiped;tlsName;resolves;constructor($,Z=!1){this.src=$,this.tlsName="";let Q=kn0($);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,Mn0.isIP)(this.hostname))return[this];else{let Q=await $.fn(this.hostname);if($.debug)console.log(`resolve ${this.hostname} = ${Q.join(",")}`);for(let X of Q){let Y=this.port===80?"https":"http",G=new URL(`${Y}://${Vn0(X)?"["+X+"]":X}`);G.port=`${this.port}`;let J=new Py(G.host,!1);J.tlsName=this.hostname,Z.push(J)}}if($.randomize)(0,qn0.shuffle)(Z);return this.resolves=Z,Z}}Xe1.ServerImpl=Py;class _70{firstSelect;servers;currentServer;tlsName;randomize;constructor($={}){this.firstSelect=!0,this.servers=[],this.tlsName="",this.randomize=$.randomize||!1}setServers($){if(!Array.isArray($)||$.length===0)throw n04.InvalidArgumentError.format("servers","cannot be empty");let Z=(0,In0.getUrlParseFn)(),Q=new Map;for(let Y of this.servers)Q.set(Y.listen,Y);let X=[];for(let Y of $){Y=Z?Z(Y):Y;let{listen:G}=kn0(Y),J=Q.get(G);if(J)J.gossiped=!1,X.push(J);else X.push(new Py(Y))}if(this.randomize)(0,qn0.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,Mn0.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,In0.getUrlParseFn)();$=Q?Q($):$;let X=new Py($,Z);if((0,Mn0.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 _70.freezeAll(this.servers)}snapshotForHandler(){let $=this.currentServer;if(!$)return this.snapshot();let Z=this.servers.indexOf($);if(Z<=0)return this.snapshot();return _70.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,In0.getUrlParseFn)(),G=new Map;if($.connect_urls&&$.connect_urls.length>0)$.connect_urls.forEach((K)=>{K=Y?Y(K,Z):K;let W=new Py(K,!0);G.set(K,W)});let J=[];if(this.servers.forEach((K,W)=>{let H=K.listen;if(K.gossiped&&this.currentServer.listen!==H&&G.get(H)===void 0)J.push(W);G.delete(H)}),J.reverse(),J.forEach((K)=>{let W=this.servers.splice(K,1);X=X.concat(W[0].listen)}),G.forEach((K,W)=>{this.servers.push(K),Q.push(W)}),this.randomize&&Q.length>0){let K=this.currentServer,W=this.servers.filter((H)=>H!==K);(0,qn0.shuffle)(W),this.servers=K?[K,...W]:W}return{added:Q,deleted:X}}}Xe1.Servers=_70});var v70=v((Ke1)=>{Object.defineProperty(Ke1,"__esModule",{value:!0});Ke1.QueuedIteratorImpl=void 0;var Cn0=d3(),Ge1=YG();class Je1{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,Cn0.deferred)(),this.yields=[],this.iterClosed=(0,Cn0.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 Ge1.InvalidOperationError("iterator cannot be used when a callback is registered");if(this.yielding)throw new Ge1.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,Cn0.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}}Ke1.QueuedIteratorImpl=Je1});var _n0=v((Ne1)=>{Object.defineProperty(Ne1,"__esModule",{value:!0});Ne1.MuxSubscription=void 0;var s04=UO(),He1=YG();class Fe1{baseInbox;reqs;constructor(){this.reqs=new Map}size(){return this.reqs.size}init($){return this.baseInbox=`${(0,s04.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 He1.NoRespondersError(X.requestSubject):null;X.resolver($,Z)}}}}close(){let $=new He1.RequestError("connection closed");this.reqs.forEach((Z)=>{Z.resolver($,{})})}}Ne1.MuxSubscription=Fe1});var vn0=v((Oe1)=>{Object.defineProperty(Oe1,"__esModule",{value:!0});Oe1.Heartbeat=void 0;var e04=d3();class Be1{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,e04.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})}}Oe1.Heartbeat=Be1});var bn0=v((je1)=>{Object.defineProperty(je1,"__esModule",{value:!0});je1.DenoBuffer=je1.MAX_SIZE=je1.AssertionError=void 0;je1.assert=we1;je1.concat=Ee1;je1.append=Z14;je1.readAll=Q14;je1.writeAll=X14;var $14=XG();class xn0 extends Error{constructor($){super($);this.name="AssertionError"}}je1.AssertionError=xn0;function we1($,Z="Assertion failed."){if(!$)throw new xn0(Z)}var De1=32768;je1.MAX_SIZE=4294967294;function x70($,Z,Q=0){let X=Z.byteLength-Q;if($.byteLength>X)$=$.subarray(0,X);return Z.set($,Q),$.byteLength}function Ee1($,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 Z14($,Z){return Ee1($,Uint8Array.of(Z))}class fn0{_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($){we1($<=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=x70(this._buf.subarray(this._off),$);return this._off+=Z,Z}writeByte($){return this.write(Uint8Array.of($))}writeString($){return this.write($14.TE.encode($))}write($){let Z=this._grow($.byteLength);return x70($,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)x70(this._buf.subarray(this._off),this._buf);else if(X+$>je1.MAX_SIZE)throw Error("The buffer cannot be grown beyond the maximum size.");else{let Y=new Uint8Array(Math.min(2*X+$,je1.MAX_SIZE));x70(this._buf.subarray(this._off),Y),this._buf=Y}return this._off=0,this._reslice(Math.min(Z+$,je1.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(De1);while(!0){let X=this.capacity-this.length<De1,Y=X?Q:new Uint8Array(this._buf.buffer,this.length),G=$.read(Y);if(G===null)return Z;if(X)this.write(Y.subarray(0,G));else this._reslice(this.length+G);Z+=G}}}je1.DenoBuffer=fn0;function Q14($){let Z=new fn0;return Z.readFrom($),Z.bytes()}function X14($,Z){let Q=0;while(Q<Z.length)Q+=$.write(Z.subarray(Q))}});var hn0=v((Re1)=>{Object.defineProperty(Re1,"__esModule",{value:!0});Re1.cc=Re1.State=Re1.Parser=Re1.Kind=void 0;Re1.describe=F14;var yn0=bn0(),gn0=XG();Re1.Kind={OK:0,ERR:1,MSG:2,INFO:3,PING:4,PONG:5};function F14($){let Z,Q="";switch($.kind){case Re1.Kind.MSG:Z="MSG";break;case Re1.Kind.OK:Z="OK";break;case Re1.Kind.ERR:Z="ERR",Q=gn0.TD.decode($.data);break;case Re1.Kind.PING:Z="PING";break;case Re1.Kind.PONG:Z="PONG";break;case Re1.Kind.INFO:Z="INFO",Q=gn0.TD.decode($.data)}return`${Z}: ${Q}`}function Pe1(){let $={};return $.sid=-1,$.hdr=-1,$.size=-1,$}var Ae1=48,N14=57,Ay=67108864;class Te1{dispatcher;state;as;drop;hdr;ma;argBuf;msgBuf;constructor($){this.dispatcher=$,this.state=Re1.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 Re1.State.OP_START:switch(Q){case Re1.cc.M:case Re1.cc.m:this.state=Re1.State.OP_M,this.hdr=-1,this.ma=Pe1();break;case Re1.cc.H:case Re1.cc.h:this.state=Re1.State.OP_H,this.hdr=0,this.ma=Pe1();break;case Re1.cc.P:case Re1.cc.p:this.state=Re1.State.OP_P;break;case Re1.cc.PLUS:this.state=Re1.State.OP_PLUS;break;case Re1.cc.MINUS:this.state=Re1.State.OP_MINUS;break;case Re1.cc.I:case Re1.cc.i:this.state=Re1.State.OP_I;break;default:throw this.fail($.subarray(Z))}break;case Re1.State.OP_H:switch(Q){case Re1.cc.M:case Re1.cc.m:this.state=Re1.State.OP_M;break;default:throw this.fail($.subarray(Z))}break;case Re1.State.OP_M:switch(Q){case Re1.cc.S:case Re1.cc.s:this.state=Re1.State.OP_MS;break;default:throw this.fail($.subarray(Z))}break;case Re1.State.OP_MS:switch(Q){case Re1.cc.G:case Re1.cc.g:this.state=Re1.State.OP_MSG;break;default:throw this.fail($.subarray(Z))}break;case Re1.State.OP_MSG:switch(Q){case Re1.cc.SPACE:case Re1.cc.TAB:this.state=Re1.State.OP_MSG_SPC;break;default:throw this.fail($.subarray(Z))}break;case Re1.State.OP_MSG_SPC:switch(Q){case Re1.cc.SPACE:case Re1.cc.TAB:continue;default:this.state=Re1.State.MSG_ARG,this.as=Z}break;case Re1.State.MSG_ARG:switch(Q){case Re1.cc.CR:this.drop=1;break;case Re1.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=Re1.State.MSG_PAYLOAD,Z=this.as+this.ma.size-1;break}default:if(this.argBuf)this.argBuf.writeByte(Q)}break;case Re1.State.MSG_PAYLOAD:if(this.msgBuf)if(this.msgBuf.length>=this.ma.size){let X=this.msgBuf.bytes({copy:!1});this.dispatcher.push({kind:Re1.Kind.MSG,msg:this.ma,data:X}),this.argBuf=void 0,this.msgBuf=void 0,this.state=Re1.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:Re1.Kind.MSG,msg:this.ma,data:$.subarray(this.as,Z)}),this.argBuf=void 0,this.msgBuf=void 0,this.state=Re1.State.MSG_END;break;case Re1.State.MSG_END:switch(Q){case Re1.cc.NL:this.drop=0,this.as=Z+1,this.state=Re1.State.OP_START;break;default:continue}break;case Re1.State.OP_PLUS:switch(Q){case Re1.cc.O:case Re1.cc.o:this.state=Re1.State.OP_PLUS_O;break;default:throw this.fail($.subarray(Z))}break;case Re1.State.OP_PLUS_O:switch(Q){case Re1.cc.K:case Re1.cc.k:this.state=Re1.State.OP_PLUS_OK;break;default:throw this.fail($.subarray(Z))}break;case Re1.State.OP_PLUS_OK:switch(Q){case Re1.cc.NL:this.dispatcher.push({kind:Re1.Kind.OK}),this.drop=0,this.state=Re1.State.OP_START;break}break;case Re1.State.OP_MINUS:switch(Q){case Re1.cc.E:case Re1.cc.e:this.state=Re1.State.OP_MINUS_E;break;default:throw this.fail($.subarray(Z))}break;case Re1.State.OP_MINUS_E:switch(Q){case Re1.cc.R:case Re1.cc.r:this.state=Re1.State.OP_MINUS_ER;break;default:throw this.fail($.subarray(Z))}break;case Re1.State.OP_MINUS_ER:switch(Q){case Re1.cc.R:case Re1.cc.r:this.state=Re1.State.OP_MINUS_ERR;break;default:throw this.fail($.subarray(Z))}break;case Re1.State.OP_MINUS_ERR:switch(Q){case Re1.cc.SPACE:case Re1.cc.TAB:this.state=Re1.State.OP_MINUS_ERR_SPC;break;default:throw this.fail($.subarray(Z))}break;case Re1.State.OP_MINUS_ERR_SPC:switch(Q){case Re1.cc.SPACE:case Re1.cc.TAB:continue;default:this.state=Re1.State.MINUS_ERR_ARG,this.as=Z}break;case Re1.State.MINUS_ERR_ARG:switch(Q){case Re1.cc.CR:this.drop=1;break;case Re1.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:Re1.Kind.ERR,data:X}),this.drop=0,this.as=Z+1,this.state=Re1.State.OP_START;break}default:if(this.argBuf)this.argBuf.write(Uint8Array.of(Q))}break;case Re1.State.OP_P:switch(Q){case Re1.cc.I:case Re1.cc.i:this.state=Re1.State.OP_PI;break;case Re1.cc.O:case Re1.cc.o:this.state=Re1.State.OP_PO;break;default:throw this.fail($.subarray(Z))}break;case Re1.State.OP_PO:switch(Q){case Re1.cc.N:case Re1.cc.n:this.state=Re1.State.OP_PON;break;default:throw this.fail($.subarray(Z))}break;case Re1.State.OP_PON:switch(Q){case Re1.cc.G:case Re1.cc.g:this.state=Re1.State.OP_PONG;break;default:throw this.fail($.subarray(Z))}break;case Re1.State.OP_PONG:switch(Q){case Re1.cc.NL:this.dispatcher.push({kind:Re1.Kind.PONG}),this.drop=0,this.state=Re1.State.OP_START;break}break;case Re1.State.OP_PI:switch(Q){case Re1.cc.N:case Re1.cc.n:this.state=Re1.State.OP_PIN;break;default:throw this.fail($.subarray(Z))}break;case Re1.State.OP_PIN:switch(Q){case Re1.cc.G:case Re1.cc.g:this.state=Re1.State.OP_PING;break;default:throw this.fail($.subarray(Z))}break;case Re1.State.OP_PING:switch(Q){case Re1.cc.NL:this.dispatcher.push({kind:Re1.Kind.PING}),this.drop=0,this.state=Re1.State.OP_START;break}break;case Re1.State.OP_I:switch(Q){case Re1.cc.N:case Re1.cc.n:this.state=Re1.State.OP_IN;break;default:throw this.fail($.subarray(Z))}break;case Re1.State.OP_IN:switch(Q){case Re1.cc.F:case Re1.cc.f:this.state=Re1.State.OP_INF;break;default:throw this.fail($.subarray(Z))}break;case Re1.State.OP_INF:switch(Q){case Re1.cc.O:case Re1.cc.o:this.state=Re1.State.OP_INFO;break;default:throw this.fail($.subarray(Z))}break;case Re1.State.OP_INFO:switch(Q){case Re1.cc.SPACE:case Re1.cc.TAB:this.state=Re1.State.OP_INFO_SPC;break;default:throw this.fail($.subarray(Z))}break;case Re1.State.OP_INFO_SPC:switch(Q){case Re1.cc.SPACE:case Re1.cc.TAB:continue;default:this.state=Re1.State.INFO_ARG,this.as=Z}break;case Re1.State.INFO_ARG:switch(Q){case Re1.cc.CR:this.drop=1;break;case Re1.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:Re1.Kind.INFO,data:X}),this.drop=0,this.as=Z+1,this.state=Re1.State.OP_START;break}default:if(this.argBuf)this.argBuf.writeByte(Q)}break;default:throw this.fail($.subarray(Z))}}if((this.state===Re1.State.MSG_ARG||this.state===Re1.State.MINUS_ERR_ARG||this.state===Re1.State.INFO_ARG)&&!this.argBuf)this.argBuf=new yn0.DenoBuffer($.subarray(this.as,Z-this.drop));if(this.state===Re1.State.MSG_PAYLOAD&&!this.msgBuf){if(!this.argBuf)this.cloneMsgArg();this.msgBuf=new yn0.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 yn0.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 Re1.cc.SPACE:case Re1.cc.TAB:case Re1.cc.CR:case Re1.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],Ay);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],Ay);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}: ${gn0.TD.decode($)}`)}processHeaderMsgArgs($){let Z=[],Q=-1;for(let X=0;X<$.length;X++)switch($[X]){case Re1.cc.SPACE:case Re1.cc.TAB:case Re1.cc.CR:case Re1.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],Ay),this.ma.size=this.protoParseInt(Z[3],Ay);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],Ay),this.ma.size=this.protoParseInt(Z[4],Ay);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]<Ae1||$[X]>N14)return-1;Q=Q*10+($[X]-Ae1)}return Z!==void 0&&Q>Z?-1:Q}}Re1.Parser=Te1;Re1.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};Re1.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 y70=v((qe1)=>{Object.defineProperty(qe1,"__esModule",{value:!0});qe1.MsgHdrsImpl=void 0;qe1.canonicalMIMEHeaderKey=cn0;qe1.headers=O14;var Ie1=XG(),i3=UO(),b70=YG();function cn0($){let F=!0,N=Array($.length);for(let U=0;U<$.length;U++){let B=$.charCodeAt(U);if(B===58||B<33||B>126)throw b70.InvalidArgumentError.format("header",`'${$[U]}' is not a valid character in a header name`);if(F&&97<=B&&B<=122)B-=32;else if(!F&&65<=B&&B<=90)B+=32;N[U]=B,F=B==45}return String.fromCharCode(...N)}function O14($=0,Z=""){if($===0&&Z!=="")throw b70.InvalidArgumentError.format("code","is required");else if($>0&&Z==="")throw b70.InvalidArgumentError.format("description","is required");return new Ty($,Z)}var un0="NATS/1.0";class Ty{_code;headers;_description;constructor($=0,Z=""){this._code=$,this._description=Z,this.headers=new Map}[Symbol.iterator](){return this.headers.entries()}size(){return this.headers.size}equals($){if($&&this.headers.size===$.headers.size&&this._code===$._code){for(let[Z,Q]of this.headers){let X=$.values(Z);if(Q.length!==X.length)return!1;let Y=[...Q].sort(),G=[...X].sort();for(let J=0;J<Y.length;J++)if(Y[J]!==G[J])return!1}return!0}return!1}static decode($){let Z=new Ty,X=Ie1.TD.decode($).split(`\r
1494
1494
  `),Y=X[0];if(Y!==un0){let G=Y.replace(un0,"").trim();if(G.length>0){if(Z._code=parseInt(G,10),isNaN(Z._code))Z._code=0;let J=Z._code.toString();G=G.replace(J,""),Z._description=G.trim()}}if(X.length>=1)X.slice(1).map((G)=>{if(G){let J=G.indexOf(":");if(J>-1){let K=G.slice(0,J),W=G.slice(J+1).trim();Z.append(K,W)}}});return Z}toString(){if(this.headers.size===0&&this._code===0)return"";let $=un0;if(this._code>0&&this._description!=="")$+=` ${this._code} ${this._description}`;for(let[Z,Q]of this.headers)for(let X=0;X<Q.length;X++)$=`${$}\r
1495
1495
  ${Z}: ${Q[X]}`;return`${$}\r
@@ -2801,13 +2801,13 @@ ${G}`.trim().slice(0,x_$)}function cn4($){let Z=$.fields.priority?.name?.toLower
2801
2801
 
2802
2802
  ${O}`});if(!D)continue;try{await $.storage.jiraIntegrations.createCommentLink({commentId:D.id,organizationId:K,jiraCommentId:B.id})}catch(w){if(w.code==="23505"){await $.storage.taskBoard.deleteComment(D.id,K,cH);continue}throw w}}}class f_${ctx;organizationId;ids=new Map;constructor($,Z){this.ctx=$;this.organizationId=Z}async seed($){if($.length===0)return;let Z=await this.ctx.storage.sprints.upsertManyFromJira(this.organizationId,$.map(__$));for(let[Q,X]of Z)this.ids.set(Q,X)}async localIdFor($){if(!$)return null;let Z=this.ids.get($.id);if(Z)return Z;let Q=await this.ctx.storage.sprints.upsertFromJira(this.organizationId,__$($));return this.ids.set($.id,Q),Q}}function __$($){return{jiraSprintId:$.id,name:$.name,state:$.state,startsAt:$.startsAt,endsAt:$.endsAt}}function ln4($,Z){if($.size===0)return[];return Z.filter((Q)=>!$.has(Q.jiraIssueId))}async function mn4($,Z,Q,X){let Y=Z.organizationId,G=await Q.searchIssueIds(`(${X}) AND issuetype IN standardIssueTypes()`);if(G.size===0)return console.warn(`[jira] scope for org ${Y} came back empty \u2014 skipping reconciliation rather than archiving the whole board`),0;let J=ln4(G,await $.storage.jiraIntegrations.listLinkedIssuesOnBoard(Y));if(J.length===0)return 0;for(let K of J){let W=await $.storage.taskBoard.getById(K.itemId,Y);if(!W||W.status==="archived")continue;let H=await $.storage.taskBoard.update(K.itemId,Y,{status:"archived"},cH);await $.storage.taskBoard.recordActivity({taskBoardItemId:K.itemId,action:"status_changed",actorId:null,data:{from:W.status,to:"archived"}}),h$(Y,H),console.log(`[jira] ${K.jiraIssueKey} is no longer in board ${Z.boardId}'s scope \u2014 archived its card`)}return J.length}async function dn4($,Z){let{organizationId:Q,boardId:X}=Z;if(!X)throw Error("No Jira board selected");let Y=await $.storage.organizationSettings.get(Z.organizationId),G=k7(Y?.flags,"org_board_columns"),J=await M5($,Z.organizationId),K=G?await fn4($,Z,X):yC$(Z.statusMapping),W=new Set((await J.columns()).map((S)=>S.key));if(K.size===0)throw Error(G?"This Jira board has no columns to mirror":"No status mapping configured");let H=Z.lastSyncedAt===null||Z.rescanPending,F=new _G(Z.siteUrl,Z.email,Z.apiToken),{accountId:N}=await F.myself(),U=new B71(F),B=new Date,O=await F.getBoardScopeJql(X),D=yn4(Z,O,B),w=new f_$($,Q);await w.seed(await F.listBoardSprints(X));let E={created:0,updated:0,unchanged:0,skipped:0,archived:0,unmappedStatuses:[]},j=new Set,z,A,P=0,I=0;while(P<O71&&I<v_$){I++;let S=await F.searchIssues({jql:D,nextPageToken:A});if(A=S.nextPageToken??void 0,S.issues.length===0){if(!A)break;continue}let d=await $.storage.jiraIntegrations.getLinksByIssueIds(Q,S.issues.map((x)=>x.id));await U.resolve(S.issues.flatMap((x)=>[...oa(x.fields.description),...(x.fields.comment?.comments??[]).flatMap((b)=>oa(b.body))]));for(let x of S.issues){if(P>=O71)break;P++;let b=new Date(x.fields.updated);if(Number.isNaN(b.getTime()))throw Error(`Unparseable updated on ${x.key}`);let l=K.get(x.fields.status.name);if(!l||!k_$(x)){if(!l&&k_$(x))j.add(x.fields.status.name);E.skipped++,z=b;continue}let y=d.get(x.id);if(y&&gn4(y.jiraUpdatedAt,b,H)){E.unchanged++,z=b;continue}let p=x.fields.status.name,Y0={title:x.fields.summary,description:await un4(Z.siteUrl,x,U),priority:cn4(x),sprintId:await w.localIdFor(H_$(x.sprints)),boardColumnOrg:J.columnOwner()};if(y){let N0=y.jiraStatus!==p,o=await $.storage.taskBoard.getById(y.itemId,Q),t=bn4({jiraStatusChanged:N0,currentStatus:o?.status??null,boardColumns:W}),D0=await $.storage.taskBoard.update(y.itemId,Q,{...Y0,...t?{status:l}:{}},cH);if(await $.storage.jiraIntegrations.touchLink(y.itemId,{jiraStatus:p}),o&&t&&o.status!==l)await $.storage.taskBoard.recordActivity({taskBoardItemId:y.itemId,action:"status_changed",actorId:null,data:{from:o.status,to:l}});if(N0&&!H)D0=await S_$($,Z,D0);await C_$($,Z,F,x,y.itemId,N,U),await $.storage.jiraIntegrations.touchLink(y.itemId,{jiraUpdatedAt:b}),h$(Q,D0),E.updated++}else{let N0=await $.storage.taskBoard.create({organizationId:Q,...Y0,status:l,by:cH});try{await $.storage.jiraIntegrations.createLink({itemId:N0.id,organizationId:Q,jiraIssueId:x.id,jiraIssueKey:x.key,jiraUpdatedAt:new Date(0),jiraStatus:p})}catch(o){if(o.code==="23505"){await $.storage.taskBoard.delete(N0.id,Q,cH),E.unchanged++,z=b;continue}throw o}if(!H)N0=await S_$($,Z,N0);await C_$($,Z,F,x,N0.id,N,U),await $.storage.jiraIntegrations.touchLink(N0.id,{jiraUpdatedAt:b}),h$(Q,N0),E.created++}z=b}if(!A)break}E.unmappedStatuses=[...j].sort();let V=hn4(P,I);if(!V)E.archived=await mn4($,Z,F,O);let q=H&&V;if(z===void 0&&P===0)return{counts:E,watermark:B,rescanPending:q};return{counts:E,watermark:z,rescanPending:q}}var cH="jira",O71=500,vn4=5,v_$=25,x_$=1e4,xn4;var XT0=L(()=>{a9();kG();h6();zU();V5();QT0();Y71();xn4={highest:"urgent",high:"high",medium:"medium",low:"low",lowest:"low"}});var b_$={};Z0(b_$,{setJiraSyncRuntime:()=>E71,registerJiraSyncWorkflow:()=>z71,maybeEnqueueJiraStatusPush:()=>Jt4,enqueueJiraCommentPush:()=>j71});import{DBOS as IX,SchedulerMode as in4}from"@dbos-inc/dbos-sdk";function E71($){YT0=$}function aa(){if(!YT0)throw Error("[jira] sync runtime not initialized \u2014 setJiraSyncRuntime() must run before the workflow fires");return YT0}function PU(){let{db:$,encryptionKey:Z}=aa();return new kv($,new WG(Z))}function nn4(){return new RX(aa().db)}async function tn4($){try{let{db:Z}=aa(),Q=await PU().getById($);if(!Q)return{id:$,error:"integration no longer exists"};if(!Q.enabled)return{id:$};let X=await uK(Z,Q.organizationId);if(!X)return{id:$,error:"organization no longer exists"};let Y=await su(X,Q);return"error"in Y?{id:$,error:Y.error}:{id:$}}catch(Z){return{id:$,error:Z instanceof Error?Z.message:String(Z)}}}async function on4($,Z){let Q=await IX.runStep(()=>PU().listEnabledIds(),{name:"loadJiraIntegrations"});for(let X of Q){let Y=await IX.runStep(()=>tn4(X),{name:`syncJira:${X}`});if(Y.error)console.warn(`[jira] sync ${Y.id} failed: ${Y.error}`)}}async function an4($){let Z=PU();if(!(await Z.getByOrg($.organizationId))?.enabled)return null;let X=await Z.getLinkByItemId($.taskBoardItemId,$.organizationId);if(!X)return null;if(await Z.hasCommentLink($.commentId))return null;return{jiraIssueId:X.jiraIssueId}}async function sn4($){return(await aa().db.selectFrom("organization").select("slug").where("id","=",$).executeTakeFirst())?.slug??null}async function en4($,Z,Q){let X=await PU().getByOrg($);if(!X?.enabled)return null;let G=(await uK(aa().db,$))?.orgFs;if(!G)return null;let J=new _G(X.siteUrl,X.email,X.apiToken);return M_$(Q,{read:(K)=>G.read(K.volume,K.path).catch((W)=>{if(W instanceof jJ)return null;throw W}),listAttachments:()=>J.listAttachments(Z),upload:(K)=>J.addAttachment(Z,K),mediaIdFor:(K)=>J.resolveMediaId(K)})}async function $t4($,Z,Q){let X=PU(),Y=await X.getByOrg($.organizationId);if(!Y?.enabled)return null;let G=await X.getLinkByItemId($.taskBoardItemId,$.organizationId);if(!G)return null;if(await X.hasCommentLink($.commentId))return null;return(await new _G(Y.siteUrl,Y.email,Y.apiToken).addComment(G.jiraIssueId,Z,{header:`${$.authorLabel} \xB7 via Studio:`,media:new Map(Q)})).id}async function Zt4($,Z){try{await PU().createCommentLink({commentId:$.commentId,organizationId:$.organizationId,jiraCommentId:Z})}catch(Q){if(Q.code!=="23505")throw Q}}async function Qt4($){let Z=$.body.slice(0,rn4),Q=await IX.runStep(()=>an4($),{name:"resolveCommentTarget",retriesAllowed:!0,maxAttempts:3});if(!Q)return;let X=[],Y=oC$(Z);if(Y.length>0){let J=await IX.runStep(()=>sn4($.organizationId),{name:"readOrgSlug",retriesAllowed:!0,maxAttempts:3});for(let K of q_$(Y,J??""))try{let W=await IX.runStep(()=>en4($.organizationId,Q.jiraIssueId,K),{name:`attachCommentImage:${K.name}`,retriesAllowed:!0,maxAttempts:3});if(W)X.push([K.target,W])}catch(W){if(!xC$(W))throw W;console.warn(`[jira] could not attach ${K.ref.path}:`,W)}}let G=await IX.runStep(()=>$t4($,Z,X),{name:"postCommentToJira",retriesAllowed:!1});if(!G)return;await IX.runStep(()=>Zt4($,G),{name:"recordCommentLink",retriesAllowed:!0,maxAttempts:4})}async function Xt4($){let Z=PU(),Q=await Z.getByOrg($.organizationId);if(!Q?.enabled)return null;let X=await Z.getLinkByItemId($.itemId,$.organizationId);if(!X)return null;let Y=await nn4().getById($.itemId,$.organizationId);if(!Y)return null;if(pZ1(Q.statusMapping,Y.status,X.jiraStatus))return null;let J=await new _G(Q.siteUrl,Q.email,Q.apiToken).listTransitions(X.jiraIssueId),K=hC$({mapping:Q.statusMapping,lane:Y.status,currentJiraStatus:X.jiraStatus,availableTransitions:J.map((H)=>H.to.name)});if(K.kind!=="transition"){if(K.kind==="unreachable")console.warn(`[jira] ${X.jiraIssueKey} is ${Y.status} on the board, but its workflow offers no transition to ${K.targets.join(" / ")} \u2014 `+"the card will not move on the Jira board");return null}let W=J.find((H)=>H.to.name===K.targetName);if(!W)return null;return{jiraIssueId:X.jiraIssueId,transitionId:W.id,targetName:K.targetName}}async function Yt4($,Z){let Q=PU(),X=await Q.getByOrg($.organizationId);if(!X?.enabled)return;let Y=await Q.getLinkByItemId($.itemId,$.organizationId);if(!Y||Y.jiraStatus===Z.targetName)return;let G=new _G(X.siteUrl,X.email,X.apiToken);if(await G.getStatusName(Z.jiraIssueId)===Z.targetName){await Q.touchLink($.itemId,{jiraStatus:Z.targetName});return}await G.transitionIssue(Z.jiraIssueId,Z.transitionId),await Q.touchLink($.itemId,{jiraStatus:Z.targetName})}async function Gt4($){let Z=await IX.runStep(()=>Xt4($),{name:"resolveStatusTransition",retriesAllowed:!0,maxAttempts:3});if(!Z)return;await IX.runStep(()=>Yt4($,Z),{name:"executeStatusTransition",retriesAllowed:!0,maxAttempts:3})}function Jt4($,Z){if(Z.updatedBy===cH)return;if(!w71||!YT0)return;let Q=w71;(async()=>{if(!await PU().getLinkByItemId(Z.id,$))return;await IX.startWorkflow(Q,{queueName:tE,workflowID:`jira-status:${Z.id}:${Z.status}:${Date.parse(Z.updatedAt)}`,enqueueOptions:{queuePartitionKey:$}})({organizationId:$,itemId:Z.id})})().catch((X)=>{console.warn(`[jira] status push enqueue failed for ${Z.id}:`,X instanceof Error?X.message:X)})}async function j71($,Z){try{if(!D71)return;if(!await $.storage.jiraIntegrations.getLinkByItemId(Z.taskBoardItemId,Z.organizationId))return;await IX.startWorkflow(D71,{queueName:tE,workflowID:`jira-cmt-push:${Z.commentId}`,enqueueOptions:{queuePartitionKey:Z.organizationId}})(Z)}catch(Q){console.warn(`[jira] comment push enqueue failed for ${Z.commentId}:`,Q instanceof Error?Q.message:Q)}}function z71(){if(L71)return;L71=IX.registerWorkflow(on4,{name:"jiraSyncWorkflow"}),IX.registerScheduled(L71,{name:"jiraSyncWorkflow",crontab:pn4,mode:in4.ExactlyOncePerIntervalWhenActive}),D71=IX.registerWorkflow(Qt4,{name:"jiraCommentPushWorkflow"}),w71=IX.registerWorkflow(Gt4,{name:"jiraStatusPushWorkflow"})}var pn4="2-59/10 * * * *",YT0=null,rn4=30000,L71=null,D71=null,w71=null;var GT0=L(()=>{fC$();jO();ou();tA0();gH();Hj();QT0();V_$();Z71();XT0()});function JT0($,Z,Q,X){OG({event:$,organizationId:Z,properties:{task_id:Q.id,reports_task:HY(Q),...X}})}function h$($,Z){l5.emit($,{id:crypto.randomUUID(),type:VL$,source:"task-board",subject:Z.id,data:Z,time:new Date().toISOString()}),Promise.resolve().then(() => (GT0(),b_$)).then((Q)=>Q.maybeEnqueueJiraStatusPush($,Z)).catch((Q)=>{console.warn("[jira] status push hook unavailable:",Q)})}function y_$($,Z){l5.emit($,{id:crypto.randomUUID(),type:kL$,source:"task-board",subject:Z,data:{id:Z},time:new Date().toISOString()})}function Kt4($,Z){return $?[$]:Z}async function _v($,Z,Q){let X=$.metadata?.runMetadata?.taskBoardItemId,Y=!X&&Q?await $.storage.taskBoard.linkedTaskIds(Q,Z):[];return Kt4(X,Y)}async function g_$($,Z,Q){let X=$.organization?.id;if(!X)return;try{for(let Y of await _v($,X,Q)){let G=await $.storage.taskBoard.getById(Y,X),J=Vv(Z),K=Vv(G?.status??"");if(!G||J!==null&&K!==null&&J<=K)continue;let W=await $.storage.taskBoard.update(Y,X,{status:Z},$.auth?.user?.id??G.updatedBy);if(await $.storage.taskBoard.recordActivity({taskBoardItemId:Y,action:"status_changed",actorId:null,data:{from:G.status,to:Z}}).catch((H)=>console.error("[task-board] activity log write failed",H)),h$(X,W),Z==="in_progress")JT0("task_run_started",X,W,{from:G.status})}}catch(Y){console.error("[task-board] run transition failed",Y)}}async function KT0($,Z){let Q=$.organization?.id;if(!Q)return;try{for(let X of await _v($,Q,Z)){let Y=await $.storage.taskBoard.openReviewCycleIfInProgress(X,Q);if(!Y)continue;h$(Q,Y),JT0("task_run_completed",Q,Y,{from:"in_progress",via:"pr_open"})}}catch(X){console.error("[task-board] review-cycle open failed",X)}}async function WT0($,Z,Q,X){let Y=$.organization?.id;if(!Y)return;try{let G=iA0(Z);if(!G)return;let J=await _v($,Y,X);for(let K of J)await $.storage.taskBoard.linkPr({taskBoardItemId:K,organizationId:Y,url:G.url,prNumber:G.number,repoOwner:G.owner,repoName:G.repo,connectionId:Q??null})}catch(G){console.error("[task-board] PR capture failed",G)}}async function eu($,Z,Q,X){try{let Y=await $.advanceLinkedTasksToReviewOnThreadFinish(Z,Q);for(let G of Y)h$(Q,G),JT0("task_run_completed",Q,G,{from:"in_progress",via:"thread_finish"});for(let G of Y)await $.clearRunRetry(G.id,Q).catch(()=>{})}catch(Y){console.error("[task-board] thread-finish transition failed",Y)}await P71($,Z,Q),await A71($,X,Z,Q)}function h_$($){return(Vv($.status)??-1)>=nA0.in_review||Boolean($.reviewCycleStartedAt)}async function P71($,Z,Q){try{let X=await $.failedRunInfo(Z,Q);if(!X)return;let Y=MC$(X);for(let G of await $.linkedTaskIds(Z,Q)){let J=await $.getById(G,Q);if(!J)continue;if(h_$(J))await $.relabelDeliveredFailure(Z,Q,Ft4).catch(()=>{});if(J.status!=="in_progress")continue;if(J.reviewCycleStartedAt)continue;if(J.threads.some((H)=>H.hasMessages&&H.status==="in_progress"))continue;let K=J.retryAttempts;if(K<Y){let H=U7(Ht4,Wt4,K,2,0.5);if(!await $.scheduleRunRetry(G,Q,K+1,new Date(Date.now()+H)))continue;await $.recordActivity({taskBoardItemId:G,action:"status_changed",actorId:null,data:{from:"in_progress",to:"in_progress",retry:K+1,of:Y,reason:X.errorText??X.kind}}).catch(()=>{});continue}let W=await $.returnToTodoAfterFailure(G,Q,J.updatedBy);if(!W)continue;await $.recordActivity({taskBoardItemId:G,action:"status_changed",actorId:null,data:{from:"in_progress",to:"todo",reason:X.errorText??X.kind,retriesSpent:K}}).catch(()=>{}),h$(Q,W),JT0("task_run_failed",Q,J,{reason:X.kind??"error",retries_spent:K})}}catch(X){console.error("[task-board] failed-run reaction failed",X)}}async function A71($,Z,Q,X){try{for(let Y of await $.linkedTaskIds(Q,X)){let G=await $.getById(Y,X);if(!G)continue;if(h_$(G))continue;if(G.threads.some((K)=>K.hasMessages&&(K.status===null||!pa.has(K.status))))continue;if((await $.listPrs(Y,X)).length>0)continue;await vL$(Z,X,Y)}}catch(Y){console.error("[task-board] quota refund pass failed",Y)}}async function T71($,Z){if(Z.status!=="in_progress"||!RY(Z))return;try{let Q=await $.storage.taskBoard.update(Z.id,Z.organizationId,{status:"in_review"},Z.updatedBy);await $.storage.taskBoard.recordActivity({taskBoardItemId:Z.id,action:"status_changed",actorId:null,data:{from:Z.status,to:"in_review"}}).catch(()=>{}),h$(Z.organizationId,Q)}catch(Q){console.error(`[task-board] parking ${Z.id} for review failed`,Q)}}async function lH($,Z,Q){let X=Z.organizationId;if(Z.assigneeId!==J8)return!1;try{await T71($,Z);let Y=await $.storage.taskBoard.unassignSuperAgent(Z.id,X,Z.updatedBy);if(!Y)return!1;return await M6($,{taskBoardItemId:Z.id,action:"assignee_changed",actorId:null,data:{from:Z.assigneeId,to:null,reason:Q}}),console.warn(`[task-board] ${Z.id} handed to a human: ${Q}`),h$(X,Y),!0}catch(Y){return console.error(`[task-board] handing ${Z.id} to a human failed`,Y),!1}}async function u_$($,Z,Q){if(!(Q instanceof DX))return!1;if(Q.reason!=="runs_exhausted")return!1;return await lH($,Z,"per-task run limit reached \u2014 the Super Agent can no longer re-dispatch "+"itself on this task. Re-run it manually to continue."),!0}async function c_$($,Z){let Q=$.organization?.id;if(!Q)return;try{let X=await $.storage.taskBoard.reopenLinkedTasksOnThreadRun(Z,Q);for(let Y of X)h$(Q,Y)}catch(X){console.error("[task-board] thread-run reopen failed",X)}}function l_$($){return $.includes("create_pull_request")||$.includes("createPullRequest")}function m_$($){if(Nt4.test($))return!0;return Ut4.test($)&&Bt4.test($)}var Wt4=30000,Ht4=120000,Ft4="Run ended after it had already delivered \u2014 the task moved on without it",Nt4,Ut4,Bt4;var V5=L(()=>{cJ();x4();gH();tu();VC$();J4();da();h6();qQ();hH();Nt4=/\bgh\s+pr\s+create\b/,Ut4=/api\.github\.com\/repos\/[^\s"']+\/pulls\b/,Bt4=/(?:-X|--request)\s+POST/});function Ot4($){if($.status==="completed")return"advance";if($.status==="failed"&&$.messageStorageVersion===2&&($.harnessId==="decopilot"||$.harnessId==="claude-code"))return"nudge";return"none"}function Lt4($){return["This task is still In Progress on the board and your last run ended without finishing it.","","Look at what you already did (`git log`, `git status`, and the messages above), then either:","- finish the remaining work (and open the PR, if it needed code changes),","- or, if it's actually done, say so in one line \u2014 the board moves the card for you,",$==="decopilot"?"- or, if you're blocked on something only a human knows, call the `user_ask` tool.":"- or, if you're blocked on something only a human knows, say what you need and stop.","","Don't start over and don't redo work you already committed or pushed. You are on the same branch as before \u2014 push to it and update your existing pull request rather than opening a second one."].join(`
2803
2803
  `)}async function Dt4($,Z,Q){await iu($,Z,Q,{messageId:`stall-nudge-${Z.id}-${Q.id}`,prompt:Lt4(Q.harness_id),workflowID:`stall-nudge:${Z.id}:${Q.id}`})}async function wt4($,Z){let Q=await $.storage.threads.get(Z);if(!Q)return{action:"none",thread:null};return{action:Ot4({status:Q.status,messageStorageVersion:Q.message_storage_version,harnessId:Q.harness_id}),thread:Q}}function Et4($,Z=Date.now()){if($.status!=="in_progress")return!1;if($.run_started_at)return!1;return la($,Z)}async function jt4($,Z){let Q=[];for(let X of Z.threads){if(X.status!=="in_progress")continue;let Y=await $.storage.threads.get(X.threadId);if(!Y||!Et4(Y))continue;if(await $.storage.threads.markRunFailed(X.threadId,R71,"abandoned"))Q.push(X.threadId),console.warn(`[task-board] failed never-started thread ${X.threadId} on ${Z.id}`)}return Q}async function d_$($,Z){let Q=$.organization?.id;if(!Q)return;for(let X of Z){if(X.status==="in_progress")try{if((await jt4($,X)).length>0)continue}catch(J){console.error(`[task-board] reaping threads for ${X.id} failed`,J)}let Y;try{Y=X.repo!=null&&(await $.storage.taskBoard.listPrs(X.id,Q)).length>0}catch(J){console.error(`[task-board] listPrs for ${X.id} failed`,J);continue}if(!mZ1(X,Y))continue;let G=X.threads.find((J)=>J.hasMessages);if(!G)continue;try{let{action:J,thread:K}=await wt4($,G.threadId);if(J==="none"||!K)continue;if(J==="advance")await eu($.storage.taskBoard,G.threadId,Q,$.storage.organizationBilling);else await Dt4($,X,K)}catch(J){console.error(`[task-board] stall recovery failed for ${X.id}`,J)}}}var R71="Run never started \u2014 no pod picked it up before the idle window elapsed";var I71=L(()=>{hA0();gH();V5()});import{z as Z3}from"zod";var zt4,vv;var q71=L(()=>{kG();k0();GY();gK();I71();zt4=Z3.object({key:Z3.string(),title:Z3.string(),position:Z3.number(),role:Z3.string().nullable()}),vv=c({name:"TASK_BOARD_ITEM_LIST",description:"List all task board items for the organization, plus the `owner/name` repos this organization has imported (the valid values for a task's `repo` field).",annotations:{title:"List Task Board Items",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:Z3.object({}),outputSchema:Z3.object({items:Z3.array(gu),repos:Z3.array(Z3.string()),sprints:Z3.array(Qk$),columns:Z3.array(zt4)}),handler:async($,Z)=>{a(Z),await Z.access.check();let Q=Z.organization?.id;if(!Q)throw Error("Organization ID required (no active organization in context)");let[X,{items:Y},G,J]=await Promise.all([Z.storage.taskBoard.list(Q),Z.storage.connections.list(Q,{slug:"mcp-github"}),Z.storage.sprints.listByOrg(Q),M5(Z,Q).then((W)=>W.columns())]),K=_O$(Y);return d_$(Z,X),{items:X,repos:K,sprints:G,columns:J}}})});import{z as vG}from"zod";function Tt4($){return At4.some((Z)=>$[Z]!==void 0)}function Rt4($,Z){let Q=[];for(let{field:G,action:J}of Pt4){if(Z[G]===$[G])continue;Q.push({action:J,data:{from:$[G],to:Z[G]}})}if(Z.description!==$.description)Q.push({action:"description_changed"});let X=new Set($.tags.map((G)=>G.id));if(Z.tags.length!==$.tags.length||Z.tags.some((G)=>!X.has(G.id)))Q.push({action:"tags_changed",data:{from:$.tags,to:Z.tags}});return Q}function It4($,Z){if($!==J8)return!1;if(!Z)return!1;return Z.assigneeId!==J8?!0:Z.status==="todo"}function Mt4($,Z,Q){let X=$!==void 0&&qt4.has($),Y=Z!==void 0&&RY(Z);return Q&&X&&Y}function M71($,Z){return $!==void 0&&iZ1($)&&!Z}var Pt4,At4,qt4,xv;var HT0=L(()=>{kG();k0();a9();gK();hH();n91();zU();qQ();TD();V5();tu();cJ();Pt4=[{field:"status",action:"status_changed"},{field:"assigneeId",action:"assignee_changed"},{field:"priority",action:"priority_changed"},{field:"type",action:"type_changed"},{field:"dueDate",action:"due_date_changed"},{field:"title",action:"title_changed"}],At4=["title","description","status","priority","type","assigneeId","repo","dueDate","sortOrder","tagIds"];qt4=new Set(["approved","merged","post_deploy_validation","done","archived"]);xv=c({name:"TASK_BOARD_ITEM_UPDATE",description:"Update a task board item's fields (title, description, status, priority, assignee), and/or link a chat thread to it.",annotations:{title:"Update Task Board Item",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0,openWorldHint:!1},inputSchema:vG.object({id:vG.string(),title:vG.string().min(1).max(WA0).optional(),description:vG.string().max(KA0).nullable().optional(),status:NU.optional(),priority:zv.optional(),type:Va.optional(),assigneeId:vG.string().nullable().optional(),repo:vG.string().max(HA0).nullable().optional(),dueDate:vG.string().datetime().nullable().optional(),sortOrder:vG.number().optional(),tagIds:vG.array(vG.string()).max(1000).optional(),linkThreadId:vG.string().optional(),prUrl:vG.string().nullable().optional().describe("GitHub pull request URL to link to this task, e.g. https://github.com/owner/repo/pull/123. Pass it after opening a PR for an existing card; linking one is what starts its review.")}),outputSchema:vG.object({item:gu}),handler:async($,Z)=>{a(Z),await Z.access.check();let Q=Z.organization?.id;if(!Q)throw Error("Organization ID required (no active organization in context)");let X=$.prUrl?CD($.prUrl):null;if($.prUrl&&!X)throw Error(`Not a GitHub pull request URL: ${$.prUrl} (expected https://github.com/<owner>/<repo>/pull/<number>)`);if($.assigneeId)await FA0(Z,Q,$.assigneeId);if($.linkThreadId){if(!await Z.storage.taskBoard.getById($.id,Q))throw Error(`Task board item not found: ${$.id}`);if(!await Z.storage.threads.get($.linkThreadId))throw Error(`Thread not found: ${$.linkThreadId}`);await Z.storage.taskBoard.linkThread($.id,$.linkThreadId,Q)}let Y=Tt4($),G=Y?await Z.storage.taskBoard.getById($.id,Q):null;if(Y&&!G)throw Error(`Task board item not found: ${$.id}`);let J=await M5(Z,Q);if($.status!==void 0)await GA0(J,$.status);if($.status!==void 0&&iZ1($.status)){let N=await Z.storage.organizationSettings.get(Q);if(M71($.status,k7(N?.flags,"delivery_lanes_enabled")))throw Error("Delivery lanes are not enabled for this organization \u2014 enable "+"them in Settings before moving a task to Approved, Merged, or Post-deploy Validation.")}let K=FU.getStore()!==void 0;if(Mt4($.status,G??void 0,K))throw Error("This task is under review \u2014 a run can't move it to Done or Archived. "+"Leave it for the reviewer; only a person, or TASK_BOARD_REVIEW_DECISION on a reviewer's own run, closes out a task under review.");let W=$.assigneeId!==void 0&&$.assigneeId!==(G?.assigneeId??null),H=It4($.assigneeId,G);if(G&&HY(G)){if($.title!==void 0||$.description!==void 0||$.priority!==void 0)throw Error("This task was generated from your report and can't be edited \u2014 create your own task instead.");if(H)await $u(Z,G,tL())}if($.tagIds!==void 0){let N=await Z.storage.tags.listOrgTags(Q),U=new Set(N.map((B)=>B.id));for(let B of $.tagIds)if(!U.has(B))throw Error(`Tag not found: ${B}`);await Z.storage.taskBoard.setItemTags($.id,$.tagIds,a0(Z))}let F;if(Y)F=await Z.storage.taskBoard.update($.id,Q,{title:$.title,description:$.description,status:H?"todo":$.status,...$.status!==void 0||H?{boardColumnOrg:J.columnOwner()}:{},priority:$.priority,type:$.type,assigneeId:$.assigneeId,assignedBy:W?$.assigneeId?a0(Z):null:void 0,repo:$.repo,dueDate:$.dueDate,sortOrder:$.sortOrder},a0(Z));else{let N=await Z.storage.taskBoard.getById($.id,Q);if(!N)throw Error(`Task board item not found: ${$.id}`);F=N}if(X)await Z.storage.taskBoard.linkPr({taskBoardItemId:F.id,organizationId:Q,url:X.url,prNumber:X.number,repoOwner:X.owner,repoName:X.repo,connectionId:null});if(G){let N=a0(Z),U=Rt4(G,F);if(U.length>0)await kC$(Z,U.map((B)=>({taskBoardItemId:F.id,actorId:N,...B,alsoSubscribe:B.action==="assignee_changed"&&F.assigneeId!==J8?[F.assigneeId]:void 0})))}if(G&&F.description!==G.description)await Z.storage.notifications.notifyMentions({taskBoardItemId:F.id,organizationId:Q,actorId:a0(Z),body:F.description??"",previousBody:G.description});if(Y||$.linkThreadId||X)h$(Q,F);if(H)await fD(Z,F,{userInitiated:!0});return{item:F}}})});import{z as FT0}from"zod";var fv;var V71=L(()=>{k0();V5();fv=c({name:"TASK_BOARD_ITEM_DELETE",description:"Delete a task board item. A reports-pushed task also dismisses its finding, so the next diagnostic import won't re-create the card.",annotations:{title:"Delete Task Board Item",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0,openWorldHint:!1},inputSchema:FT0.object({id:FT0.string()}),outputSchema:FT0.object({success:FT0.boolean()}),handler:async($,Z)=>{a(Z),await Z.access.check();let Q=Z.organization?.id;if(!Q)throw Error("Organization ID required (no active organization in context)");if(!await Z.storage.taskBoard.delete($.id,Q,a0(Z)??"system"))throw Error(`Task board item not found: ${$.id}`);return y_$(Q,$.id),{success:!0}}})});function bv($){if($.length===0)return!1;let Z=new Map;for(let Q of $){let X=`${Q.repoOwner}/${Q.repoName}`.toLowerCase(),Y=Z.get(X);if(Y)Y.push(Q);else Z.set(X,[Q])}return[...Z.values()].every(Vt4)}function Vt4($){return $.some((Z)=>Z.merged===!0)&&$.every((Z)=>Z.merged===!0||Z.state==="closed")}async function kt4($,Z,Q,X){let Y=await $.storage.taskBoard.getById(Q,Z);if(!Y||Y.status!=="done")return!1;let G=await $.storage.taskBoard.listPrs(Q,Z),J=await Promise.all(G.map(async(F)=>({...F,...await X($,Z,F)})));if(!bv(J))return!1;let K=await M5($,Z),W=await K.archiveColumn();if(!W)return!1;let H=await $.storage.taskBoard.update(Q,Z,rJ(K,W),Y.updatedBy);return await M6($,{taskBoardItemId:Q,action:"status_changed",actorId:null,data:{from:"done",to:W,reason:"merged_pr_auto_archive"}}),h$(Z,H),!0}async function i_$($,Z,Q,X=UT0){let Y=0;for(let G of Q)try{if(await kt4($,Z,G,X))Y+=1}catch(J){console.error(`[task-board-archive] ${G} failed`,J)}return{archived:Y}}function NT0($){let Z=new Map;for(let{id:Q,organizationId:X}of $){let Y=Z.get(X);if(Y)Y.push(Q);else Z.set(X,[Q])}return[...Z].map(([Q,X])=>({organizationId:Q,itemIds:X}))}var $c=L(()=>{kG();qQ();xG();V5()});function BT0($){return $.replace(/\/api\/[^/\s)]+\/fs\/([^/\s)]+)\/read\?path=([^)\s]+)/g,(Z,Q,X)=>{let Y,G;try{Y=decodeURIComponent(Q),G=decodeURIComponent(X)}catch{return Z}let J=(K)=>K.startsWith("/")||K.split("/").includes("..");if(J(Y)||J(G))return Z;return kH(Y,G)})}function OT0($,Z){return Z===$?null:"The image and file links in that description are real paths in this sandbox, not URLs \u2014 `Read` them. A screenshot the task points at is usually the clearest statement of what it wants."}var k71=L(()=>{lz()});function St4($){let Z=new Map($.map((G)=>[G.id,G])),Q=new Map;for(let G of yu($)){let J=p_$(G.owner,G.repo);Q.set(J,[...Q.get(J)??[],G])}if(Q.size!==1)return null;let X=[...Q.values()][0],Y=X.find((G)=>{let J=Z.get(G.connectionId);return J?Pz(J):!1})??X[0];return{connectionId:Y.connectionId,owner:Y.owner,name:Y.repo,installationId:Y.installationId,url:`https://github.com/${Y.owner}/${Y.repo}`}}async function LT0($,Z){if(!TZ0())return console.warn(`[task-board] claude-code skipped for org ${Z}: `+"hosted sandbox unavailable \u2014 running Decopilot"),null;try{let{items:Q}=await $.storage.connections.list(Z,{slug:"mcp-github"}),X=St4(Q);if(X)return{repo:X};let Y=new Map;for(let J of yu(Q)){let K=p_$(J.owner,J.repo);if(!Y.has(K))Y.set(K,{connectionId:J.connectionId,repo:`${J.owner}/${J.repo}`})}let G=Y;if(G.size===0)return console.warn(`[task-board] claude-code skipped for org ${Z}: `+"no importable repos \u2014 running Decopilot"),null;return console.warn(`[task-board] claude-code for org ${Z}: ${G.size} importable repos \u2014 the run picks one with TASK_ADD_REPO`),{choices:[...G.values()]}}catch(Q){return console.warn("[task-board] repo lookup for claude-code failed",Q),null}}function n_$($,Z,Q){let X=["You've been assigned this task. Complete it and finish with a pull request if it makes sense (like a coding task) or is explicitly requested.","","You are running AUTONOMOUSLY \u2014 no human is watching, so drive this to "+"completion yourself. Make reasonable decisions and move on; do not stop to ask for confirmation.","",`Title: ${$.title}`];if($.description){let Y=BT0($.description);X.push("","Description:",Y);let G=OT0($.description,Y);if(G)X.push("",G)}if(X.push("",Z?`The repository ${Z.owner}/${Z.name} is already cloned at your working directory, on its own branch. \`git\` and \`gh\` are authenticated. ${zr}`:["Your working directory is EMPTY: this organization has several repositories, so nothing has been cloned yet. FIRST call `mcp__studio__TASK_ADD_REPO` with the connectionId of the repository this task is about. It clones that repository into your working directory and waits for the checkout, so once it returns the repository is there on its own branch and `git` and `gh` are authenticated. Do not read files, run `git`, or run `gh` before it returns; there is nothing there yet.","","Repositories in this organization:",...(Q?.repoChoices??[]).map((Y)=>`- ${Y.repo} (connectionId: ${Y.connectionId})`),Q?.repoChoices?.length?"Start with the one the task is about. If it turns out to need a change in "+"another of them too, call `mcp__studio__TASK_ADD_REPO` again \u2014 repositories "+"accumulate, so a second call adds a checkout beside the first rather than replacing it. Each lands in its own directory and keeps its own git remote, so open one pull request per repository you changed.":"Call `mcp__studio__TASK_ADD_REPO` with no arguments to list them."].join(`
2804
- `),""),Q?.resolveConflict&&Q.pr)X.push(`Pull request #${Q.pr.number} (${Q.pr.url}) is approved but has a MERGE CONFLICT with its base branch.`,`Check that branch out (\`gh pr checkout ${Q.pr.number}\`), merge or rebase the base branch into it, resolve the conflicts, and push to update the SAME pull request \u2014 do NOT open a new one. Resolve by preserving BOTH sides' intent; never blindly discard either side, and change only what the conflict requires.`,"");else if(Q?.feedback)X.push(Q.pr?`A reviewer requested changes on pull request #${Q.pr.number} (${Q.pr.url}):`:"A reviewer requested changes on your previous work:",Q.feedback,Q.pr?`Check that branch out (\`gh pr checkout ${Q.pr.number}\`) before editing, address the feedback, then push to update the SAME pull request \u2014 do NOT open a new one.`:"Address this feedback.","");else if(Q?.pr)X.push(`This task already has an open pull request #${Q.pr.number} (${Q.pr.url}), and you are already on its branch.`,"Continue that work: commit and push to update the SAME pull request \u2014 do NOT open a new one. If it already does everything the task asks, say so and stop rather than changing it.","");return X.push("How to finish:","- Make the change, commit it, push the branch, and open a pull request"+(Q?.pr?" \u2014 or push to the existing one, per the instruction above.":"."),"- Change only what the task needs. Don't refactor around it.","- The change must be REACHABLE from the surface the task names: edit the component that route actually renders, not one that merely looks like the right place. A change nothing imports is dead code, and it is the most common reason a task comes back rejected.","- Before handing over, VERIFY the task's outcome LOCALLY, in the sandbox: exercise the affected code path (the dev server hot-reloads, so hit the route it renders) and confirm the behaviour actually happens. A green test suite is not the bar. Do NOT wait for, or verify against, the PR's deploy preview \u2014 a reviewer checks that after you hand over.","- For a VISUAL change that means LOOKING at it: `qa-screenshot <url> <path>.png [--mobile] [--full] [--selector=<css>]` renders the page in headless Chromium \u2014 it reaches your own dev server on localhost, and unlike `curl` it runs the page's JS, so lazily-rendered sections are actually there. Then `Read` the file: a screenshot you never opened is not verification. It is already installed; do NOT look for playwright in the repo's `node_modules` or start a browser yourself.","- As soon as `gh pr create` prints the URL, call `mcp__studio__TASK_BOARD_ITEM_PR_LINK` with that url. Do this even if you also mention the PR in a comment \u2014 the reviewers are dispatched from the linked PR, not from your message.",'- If the task turns out to need no code change, do NOT open a PR: explain why in a comment on the task (`mcp__studio__TASK_BOARD_COMMENT_CREATE`) and move it to "done". There is nothing for a reviewer to review, so leaving it for one would strand it.',`- Anything a reviewer should know (a decision you made, something you found and deliberately left alone, a question) goes on the task as a comment: \`mcp__studio__TASK_BOARD_COMMENT_CREATE\` with taskBoardItemId "${$.id}". Read what's already there first with \`mcp__studio__TASK_BOARD_COMMENT_LIST\` \u2014 a comment may be addressed to you.`,"",`(task id: ${$.id})`),X.join(`
2804
+ `),""),Q?.resolveConflict&&Q.pr)X.push(`Pull request #${Q.pr.number} (${Q.pr.url}) is approved but has a MERGE CONFLICT with its base branch.`,`Check that branch out (\`gh pr checkout ${Q.pr.number}\`), merge or rebase the base branch into it, resolve the conflicts, and push to update the SAME pull request \u2014 do NOT open a new one. Resolve by preserving BOTH sides' intent; never blindly discard either side, and change only what the conflict requires.`,"");else if(Q?.feedback)X.push(Q.pr?`A reviewer requested changes on pull request #${Q.pr.number} (${Q.pr.url}):`:"A reviewer requested changes on your previous work:",Q.feedback,Q.pr?`Check that branch out (\`gh pr checkout ${Q.pr.number}\`) before editing, address the feedback, then push to update the SAME pull request \u2014 do NOT open a new one.`:"Address this feedback.","");else if(Q?.pr)X.push(`This task already has an open pull request #${Q.pr.number} (${Q.pr.url}), and you are already on its branch.`,"Continue that work: commit and push to update the SAME pull request \u2014 do NOT open a new one. If it already does everything the task asks, say so and stop rather than changing it.","");return X.push("How to finish:","- Make the change, commit it, push the branch, and open a pull request"+(Q?.pr?" \u2014 or push to the existing one, per the instruction above.":"."),"- Change only what the task needs. Don't refactor around it.","- The change must be REACHABLE from the surface the task names: edit the component that route actually renders, not one that merely looks like the right place. A change nothing imports is dead code, and it is the most common reason a task comes back rejected.","- Before handing over, VERIFY the task's outcome LOCALLY, in the sandbox: exercise the affected code path and confirm the behaviour actually happens. A green test suite is not the bar. Do NOT wait for, or verify against, the PR's deploy preview \u2014 a reviewer checks that after you hand over.","- Nothing is installed and NO dev server is running \u2014 this sandbox is a checkout. Usually you don't need one: read the code path end to end, run the repo's tests, and `curl` the LIVE site for how it behaves today. Only start a dev server if you must see YOUR change rendered \u2014 it is a cold start, so expect several minutes: launch it ONCE in the background and poll until it answers rather than guessing a sleep.","- For a VISUAL change that means LOOKING at it: `qa-screenshot <url> <path>.png [--mobile] [--full] [--selector=<css>]` renders the page in headless Chromium \u2014 it reaches a dev server you started on localhost as well as any public URL, and unlike `curl` it runs the page's JS, so lazily-rendered sections are actually there. Then `Read` the file: a screenshot you never opened is not verification. It is already installed; do NOT look for playwright in the repo's `node_modules` or start a browser yourself.","- As soon as `gh pr create` prints the URL, call `mcp__studio__TASK_BOARD_ITEM_PR_LINK` with that url. Do this even if you also mention the PR in a comment \u2014 the reviewers are dispatched from the linked PR, not from your message.",'- If the task turns out to need no code change, do NOT open a PR: explain why in a comment on the task (`mcp__studio__TASK_BOARD_COMMENT_CREATE`) and move it to "done". There is nothing for a reviewer to review, so leaving it for one would strand it.',`- Anything a reviewer should know (a decision you made, something you found and deliberately left alone, a question) goes on the task as a comment: \`mcp__studio__TASK_BOARD_COMMENT_CREATE\` with taskBoardItemId "${$.id}". Read what's already there first with \`mcp__studio__TASK_BOARD_COMMENT_LIST\` \u2014 a comment may be addressed to you.`,"",`(task id: ${$.id})`),X.join(`
2805
2805
  `)}var p_$=($,Z)=>`${$}/${Z}`.toLowerCase();var S71=L(()=>{XA0();GY();h6();R$();k71()});import{createHmac as Ct4,randomBytes as _t4,timingSafeEqual as vt4}from"crypto";function xt4(){if(DT0)return DT0;let $;try{let Z=y0();$=Z.studioJwtSecret??Z.betterAuthSecret}catch{$=void 0}return DT0=$?Buffer.from($):_t4(32),DT0}function C71($,Z,Q){return`rtok_${Ct4("sha256",xt4()).update(`${$}:${Z}:${Q.toISOString()}`).digest("base64url")}`}function t_$($,Z,Q,X){let Y=Buffer.from($),G=Buffer.from(C71(Z,Q,X));return Y.length===G.length&&vt4(Y,G)}var DT0=null;var _71=L(()=>{R$()});import{createHash as ft4}from"crypto";function sa($,Z){if($.status===null||o_$.has($.status))return!1;return!la({updated_at:$.lastActiveAt,last_progress_at:null},Z)}function bt4($,Z){return $.threads.some((Q)=>!wH.some((X)=>pL(Q.title,X))&&sa(Q,Z))}function ht4($,Z){return Z-$>=gt4}async function wT0($,Z,Q){let X=await $.storage.organizationSettings.get(Z.organizationId),Y=pN(X?.flags);if(Y.length===0)return;if(bt4(Z,Date.now()))return;let G=k7(X?.flags,"cheap_reviewer_model")?"reviewer":"default",J=await $.storage.taskBoard.listActivity(Z.id,Z.organizationId),K=Z.reviewCycleStartedAt,W=nN(J,K),H=new Date(W),F=nL(J,{cycleStartedAt:K});await Promise.all(Y.map(async(N)=>{let U=F.has(N);if(!U){let O=pt4(J,W),D=it4(Z,N,W,O);if(D){await rt4($,Z,N,D).catch((w)=>console.error(`[task-board] ${N} verdict nudge failed`,w));return}if(tt4(O,Date.now()))return}if(mt4(Z,N,W,Date.now(),U)){await lH($,Z,`${EH[N]} failed ${v71} times on `+"this review \u2014 it will not be retried");return}if(Q?.previewMatchesHead===!1){if(ht4(W,Date.now()))await lH($,Z,"the pull request's deploy preview is not showing its latest commit (its checks never went green), so the Reviewer cannot verify this change against what the PR actually does");return}if(dt4(Z,N,W,Date.now(),U))return;let B=ut4(Z,N,W,Date.now(),U);await et4($,Z,N,H,B,G).catch((O)=>console.error(`[task-board] ${N} reviewer enqueue failed`,O))}))}function ut4($,Z,Q,X=Date.now(),Y=!0){return $.threads.filter((G)=>pL(G.title,Z)&&x71(G,X,Y)&&new Date(G.createdAt).getTime()>=Q).length}function ct4($,Z){if(!$||!Z||!("choices"in Z))return null;return Z.choices.find((Q)=>Q.repo===$)?.connectionId??null}function lt4($,Z,Q){let X=$.threads.filter((Y)=>pL(Y.title,Z)&&Y.status==="completed"&&new Date(Y.createdAt).getTime()<Q).map((Y)=>new Date(Y.lastActiveAt).getTime()).filter((Y)=>Number.isFinite(Y));return X.length===0?0:Math.max(...X)}function x71($,Z,Q=!0){if($.status==="failed")return!0;if($.status!==null&&o_$.has($.status))return!Q;return $.status!==null&&!sa($,Z)}function r_$($,Z,Q,X=Date.now()){return $.threads.filter((Y)=>{if(!pL(Y.title,Z))return!1;return sa(Y,X)||new Date(Y.createdAt).getTime()>=Q})}function mt4($,Z,Q,X=Date.now(),Y=!0){let G=r_$($,Z,Q,X);return G.length>0&&G.every((J)=>x71(J,X,Y))&&G.length>=v71}function dt4($,Z,Q,X=Date.now(),Y=!0){let G=r_$($,Z,Q,X);if(G.length===0)return!1;if(G.some((K)=>sa(K,X)))return!0;let J=G.filter((K)=>x71(K,X,Y));if(J.length>=v71)return!0;return J.length!==G.length}function it4($,Z,Q,X,Y=Date.now()){return $.threads.find((G)=>pL(G.title,Z)&&G.status==="completed"&&!sa(G,Y)&&new Date(G.createdAt).getTime()>=Q&&!X.has(G.threadId))??null}function pt4($,Z){let Q=new Map;for(let X of $){if(X.action!=="review_verdict_requested")continue;let Y=new Date(X.occurredAt).getTime();if(Y<Z)continue;let G=X.data?.threadId;if(typeof G==="string")Q.set(G,Y)}return Q}function tt4($,Z){for(let Q of $.values())if(Z-Q<nt4)return!0;return!1}function ot4($){return[`Your ${EH[$]} run ended without recording a decision, so the task is stuck: nothing ships and nobody is told why. A review that reaches no verdict is not a review.`,"","Do exactly ONE thing in this run and then stop:","- Call `TASK_BOARD_REVIEW_DECISION` now, with the verdict your review already reached and notes that say what you checked.","- Approve ONLY if you actually exercised the change and it holds. If you could not finish \u2014 a check never came back, a preview never rendered, you ran out of room \u2014 `request_changes` and say exactly what is unresolved. That hands the card to a person, which is the correct outcome for an unfinished review.","- Do NOT re-run the review, do NOT change any code, and do NOT wait on any background task: whatever you know right now is the verdict."].join(`
2806
2806
  `)}async function rt4($,Z,Q,X){let Y=await $.storage.threads.get(X.threadId);if(!Y||Y.message_storage_version!==2)return;await $.storage.taskBoard.recordActivity({taskBoardItemId:Z.id,action:"review_verdict_requested",actorId:null,data:{reviewer:Q,threadId:X.threadId}}),console.warn(`[task-board] ${Q} reviewer on ${Z.id} completed with no verdict \u2014 `+"asking for one"),await iu($,Z,Y,{messageId:`review-verdict-${X.threadId}`,prompt:ot4(Q),workflowID:`review-verdict:${X.threadId}`,runClass:"reviewer"})}function at4($,Z,Q,X){return`review:${$}:${Z}:${Q.toISOString()}:${X}`}function st4($){return`thrd_${ft4("sha256").update($).digest("hex").slice(0,32)}`}async function et4($,Z,Q,X,Y,G){let J=Z.organizationId,K=C71(Z.id,Q,X),W=await LT0($,J),H=W&&"repo"in W?W.repo:null,F=W!==null,N=lt4(Z,Q,X.getTime()),U=ct4(Z.repo,W),B=F?"mcp__studio__TASK_BOARD_ITEM_PRS_GET":"TASK_BOARD_ITEM_PRS_GET",O=F?"mcp__studio__TASK_BOARD_REVIEW_DECISION":"TASK_BOARD_REVIEW_DECISION",D=F?"mcp__studio__TASK_BOARD_COMMENT_CREATE":"TASK_BOARD_COMMENT_CREATE",w=F?"mcp__studio__TASK_BOARD_COMMENT_LIST":"TASK_BOARD_COMMENT_LIST",E=[yt4[Q],"","You are running AUTONOMOUSLY \u2014 no human is watching this run. Making the "+'approve / request-changes call IS your job; you are the decision-maker, not an assistant asking a human to decide. NEVER use `user_ask` to ask whether to approve, or to confirm an obvious call ("Approve the PR?"). Reserve `user_ask` for a genuine, unresolvable blocker only a human can clear (e.g. a missing credential, or a requirement so ambiguous you '+"truly cannot judge the outcome) \u2014 that should be rare. When in doubt "+"between asking and deciding, DECIDE.","","Do NOT merge the pull request \u2014 the board does that itself once your "+"approval is in. Pushing fixes to the PR's own branch is expected of you; opening a second pull request, force-pushing, or touching any other ref is not."].join(`
2807
2807
  `),j=Z.description&&F?BT0(Z.description):Z.description,z=Z.description&&j?OT0(Z.description,j):null,A=[...F?[]:[E,""],`Task title: ${Z.title}`,j?`
2808
2808
  Task description:
2809
2809
  ${j}
2810
- `:"",...z?[z,""]:[],"How to work:",`- Call \`${B}\` with the task id below to find the pull request under review.`,H?`- The repository ${H.owner}/${H.name} is already cloned at your working directory and \`git\` and \`gh\` are authenticated \u2014 check the PR's branch out there to inspect / exercise the change. ${zr}`:F?`- Your working directory is EMPTY. Call \`mcp__studio__TASK_ADD_REPO\` ${U?`with connectionId \`${U}\` (${Z.repo}) FIRST \u2014 do NOT call it with no arguments, that only lists the org's repositories and costs you a turn.`:"with the connectionId of the PR's repository FIRST;"} it clones the repository and waits for the checkout, and \`git\` and \`gh\` are authenticated once it returns. ${zr}`:"- Load the PR's repository to inspect / exercise the change.",`- ${IL$}`,...N>0?[`- This is a RE-REVIEW. You already reviewed an earlier version of this pull request and asked for changes, and there are more commits since (a human re-delegated the card, or your own fixes from that round are in the history). Read your own previous notes with \`${w}\`, then review WHAT MOVED SINCE \u2014 \`gh pr diff <number>\` still shows the whole PR, so narrow it with \`git log --since='${new Date(N).toISOString()}' --oneline\` and diff only those commits. Confirm your earlier notes were addressed and check the new commits for their own problems. Do NOT re-read the parts of the PR you already cleared.`]:[],"- Fix the issues you find on the PR's branch, run the repository's own checks, and push to that same PR. You are the last automated run on this task \u2014 nothing picks up findings you only describe.",`- THEN exercise the change on the PR's deploy \`previewUrl\` (from \`${B}\`) \u2014 re-read it after your push so you get the preview of YOUR commit, and wait for it if it is still building. Deep-link to the page/route the task affects (not root). If you cannot render or exercise it, do NOT approve \u2014 \`request_changes\` with what's blocking.`,"- For a VISUAL change, capture before/after by running `qa-screenshot <url> org/output/qa/<name>.png [--mobile] [--full] [--selector=<css>] [--console]` (headless Chromium, baked into the sandbox; also works against your own dev server on localhost). Choose the framing: default is the top viewport, `--full` is the whole page, and `--selector='<css>'` frames just the component you changed (best for a focused before/after). Add `--mobile` too for a responsive change, and `--console` to catch the runtime errors a screenshot alone reports as a pass. WRITE them under `org/output/` \u2014 that's what surfaces them on the task. Then `Read` the files to actually LOOK at them: a screenshot you never opened is not verification.",`- Record what you validated with \`${D}\` (scenarios + pass/fail, the exact URL + viewport, and anything you couldn't verify) BEFORE your decision. EMBED the before/after shots inline as markdown images referencing their org/output path, and put each before/after PAIR in a two-column table so they render side by side, e.g.:
2810
+ `:"",...z?[z,""]:[],"How to work:",`- Call \`${B}\` with the task id below to find the pull request under review.`,H?`- The repository ${H.owner}/${H.name} is already cloned at your working directory and \`git\` and \`gh\` are authenticated \u2014 check the PR's branch out there to inspect / exercise the change. ${zr}`:F?`- Your working directory is EMPTY. Call \`mcp__studio__TASK_ADD_REPO\` ${U?`with connectionId \`${U}\` (${Z.repo}) FIRST \u2014 do NOT call it with no arguments, that only lists the org's repositories and costs you a turn.`:"with the connectionId of the PR's repository FIRST;"} it clones the repository and waits for the checkout, and \`git\` and \`gh\` are authenticated once it returns. ${zr}`:"- Load the PR's repository to inspect / exercise the change.",`- ${IL$}`,...N>0?[`- This is a RE-REVIEW. You already reviewed an earlier version of this pull request and asked for changes, and there are more commits since (a human re-delegated the card, or your own fixes from that round are in the history). Read your own previous notes with \`${w}\`, then review WHAT MOVED SINCE \u2014 \`gh pr diff <number>\` still shows the whole PR, so narrow it with \`git log --since='${new Date(N).toISOString()}' --oneline\` and diff only those commits. Confirm your earlier notes were addressed and check the new commits for their own problems. Do NOT re-read the parts of the PR you already cleared.`]:[],"- Fix the issues you find on the PR's branch, run the repository's own checks, and push to that same PR. You are the last automated run on this task \u2014 nothing picks up findings you only describe.",`- THEN exercise the change on the PR's deploy \`previewUrl\` (from \`${B}\`) \u2014 re-read it after your push so you get the preview of YOUR commit, and wait for it if it is still building. Deep-link to the page/route the task affects (not root). If you cannot render or exercise it, do NOT approve \u2014 \`request_changes\` with what's blocking.`,"- For a VISUAL change, capture before/after by running `qa-screenshot <url> org/output/qa/<name>.png [--mobile] [--full] [--selector=<css>] [--console]` (headless Chromium, baked into the sandbox; also works against a dev server you started on localhost \u2014 none is running by default, this pod is a checkout). Choose the framing: default is the top viewport, `--full` is the whole page, and `--selector='<css>'` frames just the component you changed (best for a focused before/after). Add `--mobile` too for a responsive change, and `--console` to catch the runtime errors a screenshot alone reports as a pass. WRITE them under `org/output/` \u2014 that's what surfaces them on the task. Then `Read` the files to actually LOOK at them: a screenshot you never opened is not verification.",`- Record what you validated with \`${D}\` (scenarios + pass/fail, the exact URL + viewport, and anything you couldn't verify) BEFORE your decision. EMBED the before/after shots inline as markdown images referencing their org/output path, and put each before/after PAIR in a two-column table so they render side by side, e.g.:
2811
2811
 
2812
2812
  | Before | After |
2813
2813
  | --- | --- |
@@ -2915,7 +2915,7 @@ ${$.description}
2915
2915
  `:"",Z?.resolveConflict&&Z.pr?[`Your pull request #${Z.pr.number} (${Z.pr.url}) is approved but can't be merged \u2014 it has a MERGE CONFLICT with its base branch.`,`Load the repo, CHECK OUT that PR's branch (e.g. \`gh pr checkout ${Z.pr.number}\`), then merge (or rebase) the base branch into it and resolve the conflicts, and push to update the SAME pull request \u2014 do NOT open a new one or start a new branch. Resolve conflicts by preserving BOTH sides' intent; never blindly discard either side. Change only what resolving the conflict requires.`,""].join(`
2916
2916
  `):Z?.feedback?[Z.pr?`A reviewer requested changes on the existing pull request #${Z.pr.number} (${Z.pr.url}):`:"A reviewer requested changes on your previous work:",Z.feedback,Z.pr?`Load the repo, then CHECK OUT that PR's branch (e.g. \`gh pr checkout ${Z.pr.number}\`) before editing, address the feedback, commit, and push to update the SAME pull request \u2014 do NOT open a new one or start a new branch.`:"Address this feedback.",""].join(`
2917
2917
  `):Z?.pr?[`This task already has an open pull request #${Z.pr.number} (${Z.pr.url}), and you are already on its branch.`,"Continue that work: commit and push to update the SAME pull request \u2014 do NOT open a new one or start a new branch. If you find it already does everything the task asks, say so and stop rather than changing it.",""].join(`
2918
- `):"","How to work:","- First decide whether this task requires changing code in a repository. Some tasks (research, answering a question, planning) don't. If it doesn't, just do the work directly \u2014 don't load a repo or open a PR.",Z?.pr?"- If it DOES need code changes: use the `load_repo` tool to load the relevant repository, make the change, then commit and push to the pull request named above.":"- If it DOES need code changes: use the `load_repo` tool to load the relevant repository, then make the change, commit on a new branch, push, and open a pull request. Only then does a PR apply.","- Prefer the GitHub tool to open the PR. If it errors or targets the wrong repo, fall back to `git push` + the GitHub REST API (the auth token is embedded in the `origin` URL).","- If a dev server is running it hot-reloads your changes \u2014 don't restart it, hunt for its port, or run a full typecheck/build just to verify a small edit.","- Change only what the task needs. Don't trace the definition of a pre-existing symbol that's incidental to your change \u2014 note it in one line and move on. Prefer one or two broad searches over many narrow retries.","- Only if you hit a genuine blocker a human must clear (see above) may you call `user_ask` \u2014 otherwise keep going and finish the task.","",`(task id: ${$.id})`].join(`
2918
+ `):"","How to work:","- First decide whether this task requires changing code in a repository. Some tasks (research, answering a question, planning) don't. If it doesn't, just do the work directly \u2014 don't load a repo or open a PR.",Z?.pr?"- If it DOES need code changes: use the `load_repo` tool to load the relevant repository, make the change, then commit and push to the pull request named above.":"- If it DOES need code changes: use the `load_repo` tool to load the relevant repository, then make the change, commit on a new branch, push, and open a pull request. Only then does a PR apply.","- Prefer the GitHub tool to open the PR. If it errors or targets the wrong repo, fall back to `git push` + the GitHub REST API (the auth token is embedded in the `origin` URL).","- No dev server is running and dependencies are NOT installed \u2014 this sandbox is a checkout. Don't hunt for a port, and don't run a full typecheck/build just to verify a small edit.","- Change only what the task needs. Don't trace the definition of a pre-existing symbol that's incidental to your change \u2014 note it in one line and move on. Prefer one or two broad searches over many narrow retries.","- Only if you hit a genuine blocker a human must clear (see above) may you call `user_ask` \u2014 otherwise keep going and finish the task.","",`(task id: ${$.id})`].join(`
2919
2919
  `)}async function Y86($,Z,Q){let Y=(await $.storage.taskBoard.listPrs(Z.id,Z.organizationId).catch(()=>[])).find((G)=>G.number===Q);if(!Y)return null;return Uv$($,Z.organizationId,Y).catch(()=>null)}async function G86($,Z){let Q=await $.storage.taskBoard.listActivity(Z.id,Z.organizationId).catch(()=>[]);return ML$(Q)}function J86($){return $!=="closed"}async function K86($,Z){let Q=await $.storage.taskBoard.listPrs(Z.id,Z.organizationId).catch(()=>[]);for(let X of Q){let{state:Y}=await Qc(Z.organizationId,X);if(J86(Y))return{number:X.number,url:X.url}}return}async function AU($,Z,Q){let X=await SL$($,Z,Q?.userInitiated?tL():void 0),Y="decopilot";try{let G=y0().taskBoardRerunReusesPrBranch,J=Q?.pr??(G?await K86($,Z):void 0),K=G&&J?await Y86($,Z,J.number):null,W=!Q?.feedback&&!Q?.resolveConflict,H=J&&W?await G86($,Z):null,F=J&&J!==Q?.pr||H?{...Q,...J?{pr:J}:{},...H?{feedback:H}:{}}:Q,N=await LT0($,Z.organizationId);if(N){Y="claude-code";let U="repo"in N?N.repo:null;await ea($,Z,{title:`Super Agent: ${Z.title}`,...Q?.runClass?{runClass:Q.runClass}:{},...K?{pinnedRef:K}:{},prompt:n_$(Z,U,{...F,..."choices"in N?{repoChoices:N.choices}:{}}),temperature:0.5,harnessId:"claude-code",...U?{repo:U}:{}})}else await ea($,Z,{title:`Super Agent: ${Z.title}`,...Q?.runClass?{runClass:Q.runClass}:{},prompt:X86(Z,F),temperature:0.5,...K?{pinnedRef:K}:{}})}catch(G){throw await CL$($.storage.organizationBilling,Z.organizationId,Z.id,X),G}await $.storage.taskBoard.supersedeFailedThreads(Z.id,Z.organizationId).catch((G)=>console.error("[task-board] superseding failed threads failed",G)),OG({event:"task_run_enqueued",organizationId:Z.organizationId,properties:{task_id:Z.id,reports_task:HY(Z),claim:X,harness:Y,...Q?.runClass?{run_class:Q.runClass}:{}}})}var zU=L(()=>{h6();cJ();h6();x4();R$();b71();xG();Zs();S71()});import{z as oH}from"zod";var hv;var p71=L(()=>{kG();k0();a9();gK();n91();zU();qQ();V5();tu();HT0();hv=c({name:"TASK_BOARD_ITEM_CREATE",description:"Create a new task board item for the organization.",annotations:{title:"Create Task Board Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},inputSchema:oH.object({title:oH.string().min(1).max(WA0),description:oH.string().max(KA0).nullable().optional(),status:NU.optional(),priority:zv.optional(),type:Va.optional(),assigneeId:oH.string().nullable().optional(),repo:oH.string().max(HA0).nullable().optional(),dueDate:oH.string().datetime().nullable().optional(),tagIds:oH.array(oH.string()).max(1000).optional(),prUrl:oH.string().nullable().optional().describe("GitHub pull request URL to link to the new task, e.g. https://github.com/owner/repo/pull/123. Pass it right after you open a PR so the card lands on the board with its PR already attached for review.")}),outputSchema:oH.object({item:gu}),handler:async($,Z)=>{a(Z),await Z.access.check();let Q=Z.organization?.id;if(!Q)throw Error("Organization ID required (no active organization in context)");let X=$.prUrl?CD($.prUrl):null;if($.prUrl&&!X)throw Error(`Not a GitHub pull request URL: ${$.prUrl} (expected https://github.com/<owner>/<repo>/pull/<number>)`);let Y=await M5(Z,Q);if($.status!==void 0){await GA0(Y,$.status);let K=await Z.storage.organizationSettings.get(Q);if(M71($.status,k7(K?.flags,"delivery_lanes_enabled")))throw Error("Delivery lanes are not enabled for this organization \u2014 enable "+"them in Settings before creating a task in Approved, Merged, or Post-deploy Validation.")}if($.assigneeId)await FA0(Z,Q,$.assigneeId);let G=$.assigneeId===J8;if($.tagIds?.length){let K=await Z.storage.tags.listOrgTags(Q),W=new Set(K.map((H)=>H.id));for(let H of $.tagIds)if(!W.has(H))throw Error(`Tag not found: ${H}`)}let J=await Z.storage.taskBoard.create({organizationId:Q,title:$.title,description:$.description??null,status:G?"todo":$.status,boardColumnOrg:Y.columnOwner(),priority:$.priority,type:$.type,assigneeId:$.assigneeId??null,assignedBy:$.assigneeId?a0(Z):null,repo:$.repo??null,dueDate:$.dueDate??null,by:a0(Z)});if($.tagIds?.length)await Z.storage.taskBoard.setItemTags(J.id,$.tagIds,a0(Z)),J=await Z.storage.taskBoard.getById(J.id,Q);if(X)await Z.storage.taskBoard.linkPr({taskBoardItemId:J.id,organizationId:Q,url:X.url,prNumber:X.number,repoOwner:X.owner,repoName:X.repo,connectionId:null});return await M6(Z,{taskBoardItemId:J.id,action:"created",actorId:a0(Z),alsoSubscribe:[a0(Z),J.assigneeId===J8?null:J.assigneeId]}),await Z.storage.notifications.notifyMentions({taskBoardItemId:J.id,organizationId:Q,actorId:a0(Z),body:J.description??""}),h$(Q,J),await fD(Z,J),{item:J}}})});import{z as Dc}from"zod";var W86,H86,IX1;var ly$=L(()=>{k0();kG();W86=["in_review","archived"],H86=Dc.enum(W86),IX1=c({name:"TASK_BOARD_COLUMN_ROLE_SET",description:"Say what one of this board's columns means to Studio, or unsay it. `in_review` is where a card sits while it is being reviewed; `archived` is where a finished card retires to, and a board with no archived column simply never archives. Pass null to clear. Only a board whose columns are "+"the org's own can be told this \u2014 Studio's own lanes already mean what "+"they say.",inputSchema:Dc.object({columnKey:Dc.string().min(1),role:H86.nullable()}),outputSchema:Dc.object({columnKey:Dc.string(),role:Dc.string().nullable()}),handler:async($,Z)=>{a(Z),await Z.access.check();let Q=Z.organization?.id;if(!Q)throw Error("Organization ID required (no active organization in context)");let X=await(await M5(Z,Q)).columns();if(!X.some((G)=>G.key===$.columnKey))throw Error(`This board has no column "${$.columnKey}" \u2014 it has ${X.map((G)=>G.key).join(", ")||"none yet"}`);if(!await Z.storage.boardColumns.setRole(Q,$.columnKey,$.role))throw Error("Only a board whose columns are the org's own can be given roles \u2014 "+"Studio's own lanes already mean what they say.");return{columnKey:$.columnKey,role:$.role}}})});import{z as MY}from"zod";var my$,qX1,MX1,VX1;var dy$=L(()=>{k0();kG();gK();my$=MY.object({columnKey:MY.string(),prompt:MY.string().nullable()}),qX1=c({name:"TASK_BOARD_AUTOMATION_LIST",description:"List what the board runs when a card lands in each of its columns. A "+"column with no rule is uneventful \u2014 nothing runs there.",inputSchema:MY.object({}),outputSchema:MY.object({automations:MY.array(my$)}),handler:async($,Z)=>{a(Z),await Z.access.check();let Q=Z.organization?.id;if(!Q)throw Error("Organization ID required (no active organization in context)");return{automations:await Z.storage.columnAutomations.listByOrg(Q)}}}),MX1=c({name:"TASK_BOARD_AUTOMATION_UPSERT",description:"Run the agent on every card that lands in a column. Replaces the rule already on that column, if any. Omit `prompt` to use the agent's own instruction; give one to say what it should do there instead. The card's title and description are always included, so the prompt is the instruction, not the whole message.",inputSchema:MY.object({columnKey:MY.string().min(1).describe("A column of this board \u2014 see TASK_BOARD_ITEM_LIST."),prompt:MY.string().max(Zk$).nullable().optional().describe("What to do with a card landing here; null for the default.")}),outputSchema:MY.object({automation:my$}),handler:async($,Z)=>{a(Z),await Z.access.check();let Q=Z.organization?.id;if(!Q)throw Error("Organization ID required (no active organization in context)");let X=await(await M5(Z,Q)).columns();if(!X.some((G)=>G.key===$.columnKey))throw Error(`This board has no column "${$.columnKey}" \u2014 it has ${X.map((G)=>G.key).join(", ")}`);let Y=$.prompt?.trim()?$.prompt.trim():null;return{automation:await Z.storage.columnAutomations.upsert(Q,$.columnKey,Y)}}}),VX1=c({name:"TASK_BOARD_AUTOMATION_DELETE",description:"Stop running the agent on cards landing in a column. Removing the rule IS the off switch, so a column cannot be configured-but-disabled.",inputSchema:MY.object({columnKey:MY.string().min(1)}),outputSchema:MY.object({removed:MY.boolean()}),handler:async($,Z)=>{a(Z),await Z.access.check();let Q=Z.organization?.id;if(!Q)throw Error("Organization ID required (no active organization in context)");return{removed:await Z.storage.columnAutomations.remove(Q,$.columnKey)}}})});import{z as Zx}from"zod";var kX1;var iy$=L(()=>{k0();tu();V5();TD();kX1=c({name:"TASK_BOARD_ITEM_PR_LINK",description:"Link the pull request you just opened to this run's task board item. Call this right after `gh pr create` succeeds, with the PR URL it printed. Reviewers (QA, code review) are dispatched from the linked PR, so a task whose PR is not linked never gets reviewed.",annotations:{title:"Link Pull Request to Task",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:Zx.object({url:Zx.string().describe("The pull request URL, e.g. https://github.com/owner/repo/pull/123")}),outputSchema:Zx.object({url:Zx.string(),prNumber:Zx.number(),taskBoardItemIds:Zx.array(Zx.string())}),handler:async($,Z)=>{a(Z),await Z.access.check();let Q=s(Z).id,{threadId:X}=YA0(),Y=CD($.url);if(!Y)throw Error(`Not a GitHub pull request URL: ${$.url} (expected https://github.com/<owner>/<repo>/pull/<number>)`);let G=await _v(Z,Q,X);for(let J of G)await Z.storage.taskBoard.linkPr({taskBoardItemId:J,organizationId:Q,url:Y.url,prNumber:Y.number,repoOwner:Y.owner,repoName:Y.repo}),await Z.storage.taskBoard.openReviewCycleIfInProgress(J,Q),await Z.storage.taskBoard.clearSweepBudget(J,Q);return{url:Y.url,prNumber:Y.number,taskBoardItemIds:G}}})});function ny$($){py$=$}function F20($){py$?.broadcast($)}var py$=null;import{DBOS as N20}from"@dbos-inc/dbos-sdk";function F86($,Z){let Q=`thread-run:${Z}:`;if(!$.workflowID.startsWith(Q))return null;let X=$.input?.[0],Y=X?.request;return{workflowId:$.workflowID,messageId:Y?.messageId??$.workflowID.slice(Q.length),status:$.status==="PENDING"?"running":"queued",enqueuedAt:$.createdAt,...X?.source!==void 0?{source:X.source}:{}}}async function SX1($){return(await N20.listWorkflows({workflow_id_prefix:`thread-run:${$}:`,status:["PENDING","ENQUEUED"],loadInput:!0,loadOutput:!1})).map((Q)=>F86(Q,$)).filter((Q)=>Q!==null).sort((Q,X)=>Q.enqueuedAt-X.enqueuedAt)}async function ty$($,Z){if(!Z.startsWith(`thread-run:${$}:`))return!1;return await N20.cancelWorkflows([Z]),!0}async function wc($){let Z=await N20.listWorkflows({workflow_id_prefix:`thread-run:${$}:`,status:["PENDING"],loadInput:!1,loadOutput:!1});if(Z.length===0)return;await N20.cancelWorkflows(Z.map((Q)=>Q.workflowID))}var U20=()=>{};function B86($){return/\b405\b/.test($)&&/not allowed on this repository/i.test($)}function L86($,Z={}){if($==="failing")return!0;if($==="pending")return!Z.allowPendingChecks;return!1}async function D86($,Z,Q,X,Y){if(O86.has(X))return;let J=(await $.storage.taskBoard.listActivity(Q,Z).catch(()=>[])).at(-1);if(J?.action==="merge_failed"&&J.data?.reason===X)return;await M6($,{taskBoardItemId:Q,action:"merge_failed",actorId:null,data:{reason:X,...Y?{detail:Y}:{}}})}function w86($){if(!$?.isError)return{kind:"merged"};let Z=JSON.stringify($?.content)??"";if(B86(Z))return{kind:"method_not_allowed",detail:Z};if(PT0(Z))return{kind:"rate_limited",detail:Z};return{kind:"refused",detail:Z}}async function E86($,Z,Q){let X=await $.callTool({name:"merge_pull_request",arguments:{owner:Z.repoOwner,repo:Z.repoName,pullNumber:Z.number,merge_method:Q}},void 0,{timeout:N86});return w86(X)}async function Rs($,Z,Q,X={}){let Y=async(N,U)=>{return await D86($,Z,Q,N,U),{merged:!1,reason:N,...U?{detail:U}:{}}},G=await $.storage.taskBoard.listPrs(Q,Z),J=await yv($,Z,G);if(!J)return console.warn(`[task-board] merge skipped \u2014 no linked PR on ${Q}`),Y("no_pr");let K=await Hv$($,Z,J);if(L86(K,X))return console.warn(`[task-board] merge blocked \u2014 checks ${K} on PR #${J.number}`),Y(K==="failing"?"checks_failing":"checks_pending");let W=`${J.repoOwner}/${J.repoName}`,H=await TU($,Z,J.connectionId,{owner:J.repoOwner,name:J.repoName});if(!H)return console.warn("[task-board] merge blocked \u2014 no active GitHub connection for "+`${W} (PR #${J.number})`),Y("no_connection",W);let F=await P5(H,$,!0);try{let N=null;for(let U of U86){let B=await E86(F,J,U);if(B.kind==="merged")return Xv$(H.id),{merged:!0};if(B.kind==="rate_limited")return console.warn(`[task-board] merge rate-limited on PR #${J.number} \u2014 sweep retries`),Y("rate_limited",B.detail.slice(0,500));if(B.kind==="method_not_allowed"){console.warn(`[task-board] merge method '${U}' not allowed on ${W} \u2014 trying next`),N=B.detail;continue}return console.error(`[task-board] merge refused by GitHub on PR #${J.number}:`,B.detail),Y("refused",B.detail.slice(0,500))}return console.error(`[task-board] no merge method allowed on ${W} (PR #${J.number})`,N),Y("refused",N?.slice(0,500))}catch(N){let U=N instanceof Error?N.message:String(N);if(PT0(N))return Y("rate_limited",U);return console.error("[task-board] merge PR failed",N),Y("error",U)}finally{await F.close().catch(()=>{})}}async function Is($,Z,Q){let X=await $.storage.organizationSettings.get(Z),Y=pN(X?.flags),G=await $.storage.taskBoard.listActivity(Q,Z),J=await $.storage.taskBoard.getById(Q,Z);return iL(G,Y,{cycleStartedAt:J?.reviewCycleStartedAt??null,verifiedOnly:!0})}async function j86($,Z){let Q=await $.storage.organizationSettings.get(Z.organizationId),X=pN(Q?.flags),Y=await $.storage.taskBoard.listActivity(Z.id,Z.organizationId);if(!qL$(Y,X,{cycleStartedAt:Z.reviewCycleStartedAt}))return;await lH($,Z,"every reviewer approved, but an approval could not be verified \u2014 "+"auto-merge is blocked and no reviewer can be re-dispatched this cycle")}function oy$($){return!$.merged&&$.reason==="refused"}function CX1($,Z){if($!==null)return $;if(Z===null||!oy$(Z))return null;return(Z.detail??"").toLowerCase().includes("merge conflict")?!0:null}async function z86($,Z,Q){if(!oy$(Q))return;let X=Z.organizationId,Y=await $.storage.taskBoard.listPrs(Z.id,X),G=await yv($,X,Y);if(!G)return;await Zc($,X,Z,{pr:{number:G.number,url:G.url},conflict:CX1(await bD($,X,G),Q)}).catch((J)=>{console.error("[task-board] sweep conflict auto-resolve failed",J)})}async function ry$($,Z){let Q=Z.organizationId;if(!RY(Z))return!1;let X=await $.storage.organizationSettings.get(Q);if(X?.flags?.auto_merge!==!0)return!1;if(await $.storage.taskBoard.hasHumanRejectedDone(Z.id,Q))return!1;if(!await Is($,Q,Z.id))return await j86($,Z),!1;let Y=await Rs($,Q,Z.id);if(!Y.merged)return await z86($,Z,Y),!1;let G=jH(X?.flags),J=await M5($,Q),K=await $.storage.taskBoard.update(Z.id,Q,rJ(J,G),Z.updatedBy);return await M6($,{taskBoardItemId:Z.id,action:"status_changed",actorId:null,data:{from:Z.status,to:G}}),h$(Q,K),!0}var N86=15000,U86,O86;var qs=L(()=>{hN();h6();qQ();kG();$s();xG();hH();V5();U86=["merge","squash","rebase"];O86=new Set(["checks_pending"])});import{z as Ec}from"zod";function A86($){return $.threads.filter((Z)=>Z.status!==null&&!pa.has(Z.status)).map((Z)=>Z.threadId)}async function T86($,Z,Q){let X=(G)=>(J)=>console.error("[task-board] rerun takeover step failed",{threadId:Z,step:G,err:J});await $.storage.threads.setCancelRequested(Z,Q).catch(X("cancel-flag")),await Fc(Z).catch(X("background-jobs")),await wc(Z).catch(X("gate-head"));let Y=await $.storage.threads.getRunFence(Z).catch(()=>null);if(Y)await $x(Z,Y).catch(X("hosted-harness"));F20(Z)}function R86($,Z){return $===!0&&y71(Z)}async function I86($,Z,Q){let X=Z.organizationId,Y=await $.storage.taskBoard.listPrs(Z.id,X).catch(()=>[]),G=await yv($,X,Y).catch(()=>{return});if(!G)return!1;let J=await bD($,X,G).catch(()=>null);return R86(J,Q)}function M86($,Z,Q){let X=nN($,Q),Y=0;for(let G of $){if(G.action!=="review_approved")continue;let J=new Date(G.occurredAt).getTime();if(J>=X)Y=Math.max(Y,J)}return Z-Y>=q86}async function V86($,Z){if(!RY(Z))return;if((await $.storage.organizationSettings.get(Z.organizationId))?.flags?.auto_merge!==!0)return;if(!await Is($,Z.organizationId,Z.id))return;let Y=await $.storage.taskBoard.listActivity(Z.id,Z.organizationId).catch(()=>[]);if(M86(Y,Date.now(),Z.reviewCycleStartedAt))return;if(await I86($,Z,Y))return;throw Error("Every reviewer approved this task and its merge is retrying \u2014 re-running "+"would throw that away and start a new review cycle. Wait for the merge, or use the ship button if the PR needs a nudge.")}var P86="Superseded by a manual re-run of this task",q86=900000,_X1;var ay$=L(()=>{k0();h6();gH();hH();jU();U20();Nc();qQ();V5();zU();qs();xG();$s();cJ();_X1=c({name:"TASK_BOARD_ITEM_RERUN",description:"Re-run a task board item with the Super Agent, whatever lane it is in. Use this to retry a task that stalled, finished without doing the job, or is already assigned to the Super Agent (in which case re-assigning it does nothing). Fails any run still holding the task open, moves it to In Progress, and queues a fresh run.",annotations:{title:"Re-run Task",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1,openWorldHint:!0},inputSchema:Ec.object({id:Ec.string().describe("The task board item to re-run.")}),outputSchema:Ec.object({status:Ec.string().describe("The task's lane after the re-run was queued."),supersededThreadIds:Ec.array(Ec.string()).describe("Runs that were failed to make room for this one.")}),handler:async({id:$},Z)=>{a(Z),await Z.access.check();let Q=Z.organization?.id;if(!Q)throw Error("Organization ID required (no active organization in context)");let X=await Z.storage.taskBoard.getById($,Q);if(!X)throw Error(`Task board item not found: ${$}`);if(X.assigneeId!==J8)throw Error("Only a task assigned to the Super Agent can be re-run. Assign it to "+"the Super Agent instead \u2014 that queues a run by itself.");await V86(Z,X),await $u(Z,X,tL());let Y=[];for(let J of A86(X)){if(!await Z.storage.threads.failIfNotTerminal(J,P86,"superseded"))continue;Y.push(J),await T86(Z,J,Q)}await Z.storage.taskBoard.closeReviewCycle($,Q);let G=await Z.storage.taskBoard.update($,Q,{status:"in_progress"},a0(Z));return await M6(Z,{taskBoardItemId:$,action:"status_changed",actorId:a0(Z),data:{from:X.status,to:"in_progress",reason:"rerun"}}),h$(Q,G),await AU(Z,G,{userInitiated:!0}),{status:G.status,supersededThreadIds:Y}}})});import{z as Ms}from"zod";var vX1;var sy$=L(()=>{k0();cJ();qQ();V5();zU();xG();vX1=c({name:"TASK_BOARD_RESOLVE_CONFLICT",description:"Hand a task's pull request back to the Super Agent to resolve a merge conflict with its base branch. Use when a reviewed PR can't be shipped because it conflicts. Bounces the task to In Progress and queues a run that checks out the existing PR's branch, merges the base, resolves the conflicts, and pushes to the same PR.",annotations:{title:"Resolve Merge Conflict",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1,openWorldHint:!0},inputSchema:Ms.object({id:Ms.string().describe("The task board item whose PR conflicts."),prNumber:Ms.number().describe("The conflicting pull request's number, linked to this task.")}),outputSchema:Ms.object({status:Ms.string().describe("The task's lane after the resolution run was queued.")}),handler:async({id:$,prNumber:Z},Q)=>{a(Q),await Q.access.check();let X=Q.organization?.id;if(!X)throw Error("Organization ID required (no active organization in context)");let Y=await Q.storage.taskBoard.getById($,X);if(!Y)throw Error(`Task board item not found: ${$}`);let J=(await Q.storage.taskBoard.listPrs($,X)).find((H)=>H.number===Z);if(!J)throw Error(`Pull request #${Z} is not linked to this task.`);if(await bD(Q,X,J).catch(()=>null)!==!0)throw Error("This pull request no longer has a merge conflict \u2014 refresh and try again.");await $u(Q,Y,tL());let W=await Q.storage.taskBoard.claimConflictResolution($,X,a0(Q));if(!W)throw Error("Couldn't start conflict resolution \u2014 the task may have moved, been "+"reassigned, or already be resolving. Refresh and try again.");h$(X,W);try{await AU(Q,W,{pr:{number:J.number,url:J.url},resolveConflict:!0,runClass:"retry",userInitiated:!0})}catch(H){throw await Q.storage.taskBoard.update(W.id,X,{status:"in_review"},"system").then((F)=>h$(X,F)).catch((F)=>console.error("[task-board] resolve-conflict status revert failed",F)),H}return await M6(Q,{taskBoardItemId:$,action:"merge_conflict_resolution",actorId:null,data:{prNumber:J.number}}),{status:W.status}}})});function S86($,Z){let Q=$.filter((X)=>X.threadId===Z&&X.body.trim().length>=k86);if(Q.length===0)return"missing";return Q.some((X)=>ey$(X.body))?null:"no_screenshots"}function ey$($){return $.includes("![")||$.includes(Pr)}function C86($){return ey$($)?null:"no_screenshots"}function _86($,Z,Q){let X=Z==="approve"?"approved":"requested changes";return`**${EH[$]}** ${X}:
2920
2920
 
2921
2921
  ${Q.trim()}`}function v86($){return[`Your ${EH[$]} comment carries no screenshots and does not declare the change free of any visual surface. One of the two is required \u2014 a pass on a visual change nobody can SEE is not a pass.`,"","Do exactly ONE thing in this run and then stop:","- Post a comment with `TASK_BOARD_COMMENT_CREATE` carrying the before/after screenshots you captured, embedded as markdown images referencing their `org/output/...` path, each pair in a two-column table.","- If the change genuinely has none, or you could not capture it (no deploy preview, the page would not render), write the exact words `"+Pr+"` in the comment instead, followed by one sentence naming why. That literal is what the check looks for \u2014 no paraphrase and no translation of it counts.","- Do NOT re-run the review, do NOT call `TASK_BOARD_REVIEW_DECISION` again (your verdict is already recorded), and do NOT change any code.","- If you have already posted such a comment, do nothing and say so."].join(`