decocms 4.297.5 → 4.297.6
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.
- package/dist/client/assets/{AlertCircle-_dKQYyLm.js → AlertCircle-Dp6ZlZYR.js} +1 -1
- package/dist/client/assets/{AreaChart-Br4AURer.js → AreaChart-CLIsSolL.js} +1 -1
- package/dist/client/assets/{ArrowLeft-CTckNarV.js → ArrowLeft-DcwBClUS.js} +1 -1
- package/dist/client/assets/{ArrowUp-DI6O-me7.js → ArrowUp-he2sU4Sr.js} +1 -1
- package/dist/client/assets/{Check-Dx6Jilyu.js → Check-07BNkESk.js} +1 -1
- package/dist/client/assets/{CheckCircle-D9s0Miro.js → CheckCircle-D0NiMcGY.js} +1 -1
- package/dist/client/assets/{ChevronDown-C4geT7hd.js → ChevronDown-DhOyrBbL.js} +1 -1
- package/dist/client/assets/{ChevronRight-BrJIIvGQ.js → ChevronRight-Cv2J3rWD.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-Dd-tJPH5.js → ChevronSelectorVertical-CsgsXPiX.js} +1 -1
- package/dist/client/assets/{ChevronUp-BkSDpS0a.js → ChevronUp-YHn02fNr.js} +1 -1
- package/dist/client/assets/{Copy01-DAXdkrcq.js → Copy01-CmIcrSa6.js} +1 -1
- package/dist/client/assets/{CreditCard01-DY2ollJ7.js → CreditCard01-CIhTHldk.js} +1 -1
- package/dist/client/assets/{DotsVertical-G8Mz1cUi.js → DotsVertical--3-_GzX9.js} +1 -1
- package/dist/client/assets/{Download01-BXb_GLPB.js → Download01-toNys3fD.js} +1 -1
- package/dist/client/assets/{Eye-opJVAUIw.js → Eye-DTjOHr1S.js} +1 -1
- package/dist/client/assets/{FilterLines-BdTkKIdO.js → FilterLines-MpMMN0by.js} +1 -1
- package/dist/client/assets/{Globe01-CcwZYK5w.js → Globe01-CAdoRaMK.js} +1 -1
- package/dist/client/assets/{Globe04-BEpeirqG.js → Globe04-nAO-wIKX.js} +1 -1
- package/dist/client/assets/{HardDrive-BULz-Uit.js → HardDrive-C0hN27ts.js} +1 -1
- package/dist/client/assets/{Key01-DjAus05D.js → Key01-wRDbp013.js} +1 -1
- package/dist/client/assets/{LinkExternal01-Cl9BJIic.js → LinkExternal01-DDRldwTf.js} +1 -1
- package/dist/client/assets/{LockUnlocked01-DCNThh5w.js → LockUnlocked01-CdQhQaHo.js} +1 -1
- package/dist/client/assets/{LogOut01-C8yxFbDK.js → LogOut01-CnFpkvWe.js} +1 -1
- package/dist/client/assets/{Monitor01-Cws_hyK1.js → Monitor01-DalysQsB.js} +1 -1
- package/dist/client/assets/{Palette-DJquTsKt.js → Palette-D-kLCHzw.js} +1 -1
- package/dist/client/assets/{Play-BJig3Hma.js → Play-Ba4OZRO0.js} +1 -1
- package/dist/client/assets/{Plus-DplAwTzu.js → Plus-Cr5CpNvW.js} +1 -1
- package/dist/client/assets/{SearchLg-DKfDlf2B.js → SearchLg-BD9EVt5N.js} +1 -1
- package/dist/client/assets/{SearchMd-WwqLArcb.js → SearchMd-BnpHcTtG.js} +1 -1
- package/dist/client/assets/{Settings02-DKqJklo6.js → Settings02-CIRSyyiS.js} +1 -1
- package/dist/client/assets/{Share07-BFNMphwZ.js → Share07-G9fx3Q9L.js} +1 -1
- package/dist/client/assets/{Shield01-DkQ3-Wuh.js → Shield01-DOrHTNkg.js} +1 -1
- package/dist/client/assets/{Stars01-WAIDqPTc.js → Stars01-75kZesHq.js} +1 -1
- package/dist/client/assets/{Stars02-Bz7g2T3T.js → Stars02-D5uaU5zd.js} +1 -1
- package/dist/client/assets/{Sun-Bb3k_JiI.js → Sun-Bz3jRIqc.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-D1IHpvoh.js → SwitchHorizontal01-BtFl3JWf.js} +1 -1
- package/dist/client/assets/{Tool01-BvO-aJRz.js → Tool01-VmLtH0nt.js} +1 -1
- package/dist/client/assets/{Tool02-Um8w3S00.js → Tool02-CLP5V5w_.js} +1 -1
- package/dist/client/assets/{Trash01-D1j2us9_.js → Trash01-B_i3PMbq.js} +1 -1
- package/dist/client/assets/{TrendUp01-D-pYOI27.js → TrendUp01-DiRmR7Jx.js} +1 -1
- package/dist/client/assets/{Upload01-lKTwpNsL.js → Upload01-4W6462bd.js} +1 -1
- package/dist/client/assets/{User01-CzaJZtDP.js → User01-acLUirHu.js} +1 -1
- package/dist/client/assets/{UserSquare-I8KZDiP3.js → UserSquare-CD6rB0Mt.js} +1 -1
- package/dist/client/assets/{Users01-Bb1Odrhe.js → Users01-CPikD5PC.js} +1 -1
- package/dist/client/assets/{Users03-D_Qzpo0w.js → Users03-DM6R-U2Y.js} +1 -1
- package/dist/client/assets/{XCircle-DWwaGX-T.js → XCircle-nx54qiA1.js} +1 -1
- package/dist/client/assets/{XClose-BoczrFtB.js → XClose-DWRp5M8X.js} +1 -1
- package/dist/client/assets/{YAxis-Y9IBklIh.js → YAxis-Blx93tnj.js} +1 -1
- package/dist/client/assets/{Zap-C_cEZtR5.js → Zap-DJCvDwma.js} +1 -1
- package/dist/client/assets/{ZapSquare-CmW3PzOh.js → ZapSquare-7BZcnvlP.js} +1 -1
- package/dist/client/assets/{access-gate-Btqq7-3X.js → access-gate-BqJfgvia.js} +1 -1
- package/dist/client/assets/{agent-icon-Bm0mBNmu.js → agent-icon-DbEHgX-P.js} +1 -1
- package/dist/client/assets/{agents-list-Bz-4iej6.js → agents-list-u3uKfJUZ.js} +1 -1
- package/dist/client/assets/{ai-providers-Ch3me05c.js → ai-providers-BRMGsfAO.js} +1 -1
- package/dist/client/assets/{alert-t9hKa1GN.js → alert-87ZoISUI.js} +1 -1
- package/dist/client/assets/{alert-dialog-DY_67i8D.js → alert-dialog-BUuk5lcR.js} +1 -1
- package/dist/client/assets/{api-keys-V0eYDBvn.js → api-keys-D70DMJZx.js} +1 -1
- package/dist/client/assets/{app-editor-3h5fdupo.js → app-editor-D97p-uts.js} +1 -1
- package/dist/client/assets/{auth-D8BzOPfU.js → auth-BjjAKPdO.js} +1 -1
- package/dist/client/assets/{auth-catchall-lzuTWWYn.js → auth-catchall-DLNpdPYX.js} +1 -1
- package/dist/client/assets/{auth-entry-b8Y7eCFF.js → auth-entry-uAAYHr0C.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DfWPYe89.js → auth-split-layout-BfI9c-zJ.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-14DQJW7S.js → authenticate-and-persist-oauth-BpIYdUlz.js} +1 -1
- package/dist/client/assets/{automation-list-row-BsalfBXm.js → automation-list-row-BTLGh__Y.js} +1 -1
- package/dist/client/assets/{automation-runs-DE9VSUhn.js → automation-runs-Dt5duQ0J.js} +1 -1
- package/dist/client/assets/{automations-BvPtowk4.js → automations-CROR6ZNT.js} +1 -1
- package/dist/client/assets/{avatar-CYKYYtZa.js → avatar-BS-tEYCe.js} +1 -1
- package/dist/client/assets/{badge-C1elUCLo.js → badge-CFRe-nD1.js} +1 -1
- package/dist/client/assets/{block-document-CcYvo27W.js → block-document-DLPEnvuu.js} +1 -1
- package/dist/client/assets/{breadcrumb-BXE_nF_r.js → breadcrumb-2i2x9k0L.js} +1 -1
- package/dist/client/assets/{buckets-DA_r918X.js → buckets-BSoW2eqi.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-DM-IOghT.js → bulk-category-panel-Cc_OMOog.js} +1 -1
- package/dist/client/assets/{capability-load-error-BaKYKM-d.js → capability-load-error-COL43_Mx.js} +1 -1
- package/dist/client/assets/{cards-CiLBDj3F.js → cards-DYEOYym-.js} +1 -1
- package/dist/client/assets/{category-editor-BNcSqgPW.js → category-editor-CPMdxySY.js} +1 -1
- package/dist/client/assets/{chart-BimnkeiK.js → chart-BhO82AZ9.js} +1 -1
- package/dist/client/assets/{chat-context-z1n7Mvsc.js → chat-context-BEqsjQmO.js} +1 -1
- package/dist/client/assets/{checkbox-BLQwT4c5.js → checkbox-D5nOQ93h.js} +1 -1
- package/dist/client/assets/{choose-editor-NuXPws_0.js → choose-editor-Bl4ixlsS.js} +1 -1
- package/dist/client/assets/{cli-auth-success-Dofvym4S.js → cli-auth-success-DHoExdJx.js} +1 -1
- package/dist/client/assets/{collection-detail-BXt_415y.js → collection-detail-CxCCExnM.js} +1 -1
- package/dist/client/assets/{collection-display-button-DOWt7Yw-.js → collection-display-button-PH5obTEl.js} +1 -1
- package/dist/client/assets/{collection-search-Bn9IJGT5.js → collection-search-_icrgZY2.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-BvHvi5W2.js → collection-table-wrapper-DUao6haA.js} +1 -1
- package/dist/client/assets/{collection-tabs-C_Plt4eY.js → collection-tabs-C9z-M1hW.js} +1 -1
- package/dist/client/assets/{command-DocuPiQB.js → command-Cr6yO9J6.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-CiTn_n8b.js → commerce-onboarding-CPAGL1fF.js} +1 -1
- package/dist/client/assets/{config-CFrJB4k3.js → config-DjJwkqAh.js} +1 -1
- package/dist/client/assets/{connect-Ca21orjk.js → connect-CtKH97QE.js} +1 -1
- package/dist/client/assets/{connection-card-DJzzmdJa.js → connection-card-oGGVJVEj.js} +1 -1
- package/dist/client/assets/{connection-detail-DtmtoNno.js → connection-detail-B0gkC1Zi.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-COjxkHTU.js → connection-form-helpers-GREUhGXH.js} +1 -1
- package/dist/client/assets/{connection-DeRdPQfN.js → connection-hAIey6c9.js} +1 -1
- package/dist/client/assets/{connections-PoKXlEr5.js → connections-Cr76VzkO.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-CIsbpW60.js → decopilot-sse-pool-XTa9osf_.js} +1 -1
- package/dist/client/assets/{dialog-D9B8YUq0.js → dialog-Bw8jIxhH.js} +1 -1
- package/dist/client/assets/{domain-settings-DLt8E7za.js → domain-settings-DdYf0Rwz.js} +1 -1
- package/dist/client/assets/{drawer-IGxCcmhW.js → drawer-BFvmL2Y1.js} +1 -1
- package/dist/client/assets/{dropdown-menu-trkRQR5u.js → dropdown-menu-DP13EbUQ.js} +1 -1
- package/dist/client/assets/{empty-state-BagbYGYk.js → empty-state-V20uqIl7.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DTKuu3uW.js → extract-connection-data-C40FHFBb.js} +1 -1
- package/dist/client/assets/{file-explorer-svpcOOYu.js → file-explorer-9Mlxcrfr.js} +1 -1
- package/dist/client/assets/{file-type-icon-BImZ4yGz.js → file-type-icon-BunvGKDc.js} +1 -1
- package/dist/client/assets/{form-DdcrlWMG.js → form-Co9Mo2GI.js} +1 -1
- package/dist/client/assets/{general-B0J2mS9n.js → general-DdBZ_dD-.js} +1 -1
- package/dist/client/assets/{github-repo-picker-BsNgTNpd.js → github-repo-picker-ChEu6h_O.js} +1 -1
- package/dist/client/assets/{hooks-DZlZk47y.js → hooks-pL2E-0zH.js} +1 -1
- package/dist/client/assets/{index-1ChrX-NZ.js → index-2L98sMK_.js} +1 -1
- package/dist/client/assets/{index-CU8H1ECu.js → index-BD4hER2u.js} +1 -1
- package/dist/client/assets/{index-BTRn8yLm.js → index-BrDSS0vH.js} +3 -3
- package/dist/client/assets/{index-CKX6jbl4.js → index-CH20ZECW.js} +1 -1
- package/dist/client/assets/{index-qdSW6F8F.js → index-Cj8ZZ4fT.js} +1 -1
- package/dist/client/assets/{index-DAs7sx9F.js → index-DotZRxLq.js} +1 -1
- package/dist/client/assets/{index-CPPVCYTR.js → index-DpPE5ISD.js} +1 -1
- package/dist/client/assets/{index-DhVzPBx8.js → index-PaLatgUv.js} +6 -6
- package/dist/client/assets/{index-Cxp8u-0t.js → index-S0YqkiQf.js} +1 -1
- package/dist/client/assets/{index-redirect-DENqiKOe.js → index-redirect-CC2Sa-aj.js} +1 -1
- package/dist/client/assets/{infra-billing-BYssFvIs.js → infra-billing-ZonDjQey.js} +1 -1
- package/dist/client/assets/{input-B9Q64Q29.js → input-CG2BXvBG.js} +1 -1
- package/dist/client/assets/{integration-icon-CqMRHU_a.js → integration-icon-DNJlj9SH.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-Dn4IAUK2.js → invite-member-dialog-BtV1hFV0.js} +1 -1
- package/dist/client/assets/{label-BrYhPu77.js → label-DO8rqj8R.js} +1 -1
- package/dist/client/assets/{layout-6imak1bs.js → layout-CvyGinSF.js} +1 -1
- package/dist/client/assets/{login-bZEIHxWO.js → login-BXwH6k7w.js} +1 -1
- package/dist/client/assets/{mcp-oauth-JNMVR7nj.js → mcp-oauth-CTPC1gLp.js} +1 -1
- package/dist/client/assets/{members-BDFlTHSU.js → members-D7maqetW.js} +1 -1
- package/dist/client/assets/{monaco-editor-DBOIld70.js → monaco-editor-DeCGAxQs.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-BTO2RjKc.js → monitoring-stats-row-B6LpZc_k.js} +1 -1
- package/dist/client/assets/{multi-select-DS1S2iFF.js → multi-select-DXNwV172.js} +1 -1
- package/dist/client/assets/{oauth-callback-sud7yA57.js → oauth-callback-CEKSqYcn.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DJysmHBZ.js → oauth-callback-ai-provider-DUIbaTiW.js} +1 -1
- package/dist/client/assets/{onboarding-B89NhuNo.js → onboarding-DEwiMojw.js} +1 -1
- package/dist/client/assets/{org-layout-y-wgo3lk.js → org-layout-DMMr4dJ0.js} +1 -1
- package/dist/client/assets/{organization-choice-n5LXYsp6.js → organization-choice-Dk_FX4P6.js} +1 -1
- package/dist/client/assets/{orgs-ggeMeO4b.js → orgs-Di6SKByT.js} +1 -1
- package/dist/client/assets/{page-seo-form-MwfvT2cu.js → page-seo-form-DlHjGiwH.js} +1 -1
- package/dist/client/assets/{popover-BdLEPYkg.js → popover-Bv7C0yQo.js} +1 -1
- package/dist/client/assets/{post-calendar-BQHzjF2q.js → post-calendar-Cxd75fx7.js} +1 -1
- package/dist/client/assets/{post-editor-QRl0Sagr.js → post-editor-Cg-zq355.js} +1 -1
- package/dist/client/assets/{primitives-6WK_sR50.js → primitives-CgbIYl4-.js} +1 -1
- package/dist/client/assets/{profile-CeXku40U.js → profile-CdeZVVAJ.js} +1 -1
- package/dist/client/assets/{project-app-view-Bamps5mp.js → project-app-view-DL0bWcLc.js} +1 -1
- package/dist/client/assets/{prompts-CSI9UdFJ.js → prompts-IHTaxT_o.js} +1 -1
- package/dist/client/assets/record-editor-TEY7fcTW.js +1 -0
- package/dist/client/assets/{redirect-editor-XNrrauEJ.js → redirect-editor-TBzcW6tr.js} +1 -1
- package/dist/client/assets/registry-DhYngTg1.js +2 -0
- package/dist/client/assets/{registry-layout-BEh7PoWm.js → registry-layout-CZIbrMOo.js} +1 -1
- package/dist/client/assets/{reports-BoQbVwsq.js → reports-CJrbJ-aD.js} +1 -1
- package/dist/client/assets/{require-capability-Dgl1K9kd.js → require-capability-10i6vpoS.js} +1 -1
- package/dist/client/assets/{required-auth-layout-fHFPe37p.js → required-auth-layout-C3Ofr9_V.js} +1 -1
- package/dist/client/assets/{reset-password-CND6xVOj.js → reset-password-CIrEuZXd.js} +1 -1
- package/dist/client/assets/{review-settings-bbWlNJ4z.js → review-settings-SSNM19fg.js} +1 -1
- package/dist/client/assets/{roles-Dd7V2wdR.js → roles-C6FlHdCA.js} +1 -1
- package/dist/client/assets/{scroll-area-B__HV5_s.js → scroll-area-C1ovkzqz.js} +1 -1
- package/dist/client/assets/{search-input-QsS8qM0_.js → search-input-CGMH8IA5.js} +1 -1
- package/dist/client/assets/{secrets-D27TPpeq.js → secrets-4alwTWuf.js} +1 -1
- package/dist/client/assets/{sections-editor-_166VgKv.js → sections-editor-C6zith-E.js} +1 -1
- package/dist/client/assets/{select-DzzbmWa-.js → select-DpcwZ72F.js} +1 -1
- package/dist/client/assets/{select-model-WSwYwLFN.js → select-model-BI-dA8gZ.js} +1 -1
- package/dist/client/assets/{self-tool-result-BH7zYU5J.js → self-tool-result-DCxhe8ja.js} +1 -1
- package/dist/client/assets/{seo-editor-BQugaBLO.js → seo-editor-C7gzHB1I.js} +1 -1
- package/dist/client/assets/{settings-layout-CIovajcW.js → settings-layout-DkAZTQ2a.js} +1 -1
- package/dist/client/assets/{shell-controls-BFmzMpcf.js → shell-controls-wcxv3dCy.js} +1 -1
- package/dist/client/assets/{shell-layout-DgzMjG_g.js → shell-layout-63QoGcpp.js} +1 -1
- package/dist/client/assets/{spinner-Bm_hTWFz.js → spinner-CuCGw0zq.js} +1 -1
- package/dist/client/assets/{sso-NnsFLHgi.js → sso-BvJ-0huH.js} +1 -1
- package/dist/client/assets/{store-mhkHFkpg.js → store-BP5AR9Ic.js} +1 -1
- package/dist/client/assets/store-registry-Biov3Lnl.js +2 -0
- package/dist/client/assets/{super-agent-icon-7Ukfr6bc.js → super-agent-icon-GgzP8ta8.js} +1 -1
- package/dist/client/assets/{switch-uKoBYqyg.js → switch--ZlKCa-F.js} +1 -1
- package/dist/client/assets/{synced-repos-DzxugRrm.js → synced-repos-C_5rDao7.js} +1 -1
- package/dist/client/assets/{table-D-jgMVGz.js → table-BipKiwEL.js} +1 -1
- package/dist/client/assets/{tabs-DDIxVoHb.js → tabs-CKMDW8vU.js} +1 -1
- package/dist/client/assets/{task-board-qKQWRm20.js → task-board-Dp7JXy98.js} +1 -1
- package/dist/client/assets/{tasks-DVMsPLA_.js → tasks-DRGb0eLU.js} +1 -1
- package/dist/client/assets/{textarea-BVnIs1Lw.js → textarea-BoTumDit.js} +1 -1
- package/dist/client/assets/{toggle-group-B1ycOPkn.js → toggle-group-zLUBlOPI.js} +1 -1
- package/dist/client/assets/{toolbar-DrAJ1hMc.js → toolbar-Dk5WFAot.js} +1 -1
- package/dist/client/assets/{track-Ti4l0BMG.js → track-B0Yrx2v1.js} +1 -1
- package/dist/client/assets/{types-V8BEN32x.js → types-rth0od0M.js} +1 -1
- package/dist/client/assets/{use-ai-providers-VnHj1RvS.js → use-ai-providers-CxY1HQ0n.js} +1 -1
- package/dist/client/assets/{use-api-keys-CWhEZZIl.js → use-api-keys-ej0l_Wa_.js} +1 -1
- package/dist/client/assets/{use-automations-EMCvEash.js → use-automations-tkJpD40-.js} +1 -1
- package/dist/client/assets/{use-autosave-WGhfzLOa.js → use-autosave-Bo6QQt-2.js} +1 -1
- package/dist/client/assets/{use-connection-08hpR6qS.js → use-connection-CigRkG_8.js} +1 -1
- package/dist/client/assets/{use-copy--NTZaUPq.js → use-copy-CM2jC_7i.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-CFZ2nSQA.js → use-create-virtual-mcp-EWwwwVz_.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-CI3PX6ch.js → use-debounced-autosave-crX_AMVn.js} +1 -1
- package/dist/client/assets/{use-debounced-value-BeOljBqX.js → use-debounced-value-DWJO8nvY.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-CLCNDljy.js → use-decopilot-events-C0F2SQd9.js} +1 -1
- package/dist/client/assets/{use-delete-connection-Ba6MOgeg.js → use-delete-connection-BYaP7eW8.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-CBUm01nq.js → use-deployment-admin-DD08Dk6l.js} +1 -1
- package/dist/client/assets/{use-destination-route-qnDA60ks.js → use-destination-route-D-tMiU7z.js} +1 -1
- package/dist/client/assets/{use-file-configs-D5W3ysgO.js → use-file-configs-CS0ZXqXi.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-CFHj-DEA.js → use-infinite-scroll-mm-iRnP3.js} +1 -1
- package/dist/client/assets/{use-join-requests-CLmH1kQW.js → use-join-requests-CsEZPmjA.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-DeG0R3iT.js → use-mcp-auth-status-C4AweF_A.js} +1 -1
- package/dist/client/assets/{use-mcp-client-CLbu-qTW.js → use-mcp-client-Bvg7XHk9.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BZuie7xe.js → use-mcp-tools-QHHoZ2b5.js} +1 -1
- package/dist/client/assets/{use-members-I61j4Bg0.js → use-members-dnCEd_I-.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-BenTIjx1.js → use-navigate-to-agent-DgDtQ7iN.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-CfCWX5xw.js → use-org-auth-client-cQ44YMKg.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-JMXTBQ5z.js → use-org-repo-syncs-CTap8mHN.js} +1 -1
- package/dist/client/assets/{use-org-sso-CvRPBMtq.js → use-org-sso-C9uxUHvy.js} +1 -1
- package/dist/client/assets/{use-organization-roles-C8et_n2k.js → use-organization-roles-D5IggfUv.js} +1 -1
- package/dist/client/assets/{use-organization-settings-vq5Gp8qn.js → use-organization-settings-B5x_2l31.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-DAo-IaMv.js → use-panel-navigate-BPSosfvG.js} +1 -1
- package/dist/client/assets/{use-registry-connections-BEAIbWtg.js → use-registry-connections-DNfmYK-s.js} +1 -1
- package/dist/client/assets/{use-secrets-gYiFcE--.js → use-secrets-DuRMdB6_.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-tDIjGvnW.js → use-section-preview-base-BFNeWLDp.js} +1 -1
- package/dist/client/assets/{use-status-sounds-DfVtBshF.js → use-status-sounds-B7qbfIHU.js} +1 -1
- package/dist/client/assets/{use-tags-C7utoOLS.js → use-tags-CJoE7Mdv.js} +1 -1
- package/dist/client/assets/{use-view-mode-DanQlbJE.js → use-view-mode-BDsVnHNu.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-B6XJTyzc.js → use-virtual-mcp-DmXgREYQ.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-KYE-CFE3.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-BO9Wr8TN.js +1 -0
- package/dist/client/assets/{users-Z1TG0oPn.js → users-CSxyAh6H.js} +1 -1
- package/dist/client/assets/{variant-calendar-BUBtIHZL.js → variant-calendar-DHBUpFID.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-I_KCAKl6.js → view-mode-toggle--pHeBkRS.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +2 -2
- package/dist/server/server.js +2 -2
- package/package.json +1 -1
- package/dist/client/assets/record-editor-Bo-hHNi9.js +0 -1
- package/dist/client/assets/registry-BmqhOmKk.js +0 -2
- package/dist/client/assets/store-registry-CxC5WexV.js +0 -2
- package/dist/client/assets/useInfiniteQuery-PGfyfehP.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CVgzVaXm.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as K,b as X,r as Z,j as o,n as rt,a8 as ut,ab as ht,B as tt,a9 as xt}from"./index-BTRn8yLm.js";import{r as gt,a6 as at,aF as bt}from"./agent-icon-Bm0mBNmu.js";import{i as vt}from"./ChevronRight-BrJIIvGQ.js";import{L as yt}from"./label-BrYhPu77.js";import{S as lt}from"./scroll-area-B__HV5_s.js";import{S as jt}from"./switch-uKoBYqyg.js";import{V as Tt}from"./view-mode-toggle-I_KCAKl6.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-DhVzPBx8.js";import"./AlertCircle-_dKQYyLm.js";import"./UserSquare-I8KZDiP3.js";import"./Tool01-BvO-aJRz.js";import"./ArrowUp-DI6O-me7.js";import"./ArrowLeft-CTckNarV.js";import"./Tool02-Um8w3S00.js";import"./XCircle-DWwaGX-T.js";import"./TrendUp01-D-pYOI27.js";import"./ZapSquare-CmW3PzOh.js";import"./Users03-D_Qzpo0w.js";import"./CheckCircle-D9s0Miro.js";import"./Check-Dx6Jilyu.js";import"./ChevronDown-C4geT7hd.js";import"./ChevronSelectorVertical-Dd-tJPH5.js";import"./ChevronUp-BkSDpS0a.js";import"./DotsVertical-G8Mz1cUi.js";import"./Stars02-Bz7g2T3T.js";import"./Copy01-DAXdkrcq.js";import"./CreditCard01-DY2ollJ7.js";import"./Download01-BXb_GLPB.js";import"./Settings02-DKqJklo6.js";import"./Eye-opJVAUIw.js";import"./FilterLines-BdTkKIdO.js";import"./Share07-BFNMphwZ.js";import"./Globe01-CcwZYK5w.js";import"./Globe04-BEpeirqG.js";import"./SwitchHorizontal01-D1IHpvoh.js";import"./HardDrive-BULz-Uit.js";import"./Key01-DjAus05D.js";import"./LinkExternal01-Cl9BJIic.js";import"./LockUnlocked01-DCNThh5w.js";import"./LogOut01-C8yxFbDK.js";import"./Monitor01-Cws_hyK1.js";import"./Sun-Bb3k_JiI.js";import"./Palette-DJquTsKt.js";import"./Play-BJig3Hma.js";import"./Plus-DplAwTzu.js";import"./SearchLg-DKfDlf2B.js";import"./SearchMd-WwqLArcb.js";import"./Shield01-DkQ3-Wuh.js";import"./Stars01-WAIDqPTc.js";import"./Trash01-D1j2us9_.js";import"./Upload01-lKTwpNsL.js";import"./User01-CzaJZtDP.js";import"./Users01-Bb1Odrhe.js";import"./XClose-BoczrFtB.js";import"./Zap-C_cEZtR5.js";import"./select-DzzbmWa-.js";import"./chat-context-z1n7Mvsc.js";import"./use-panel-navigate-DAo-IaMv.js";import"./dialog-D9B8YUq0.js";import"./use-destination-route-qnDA60ks.js";import"./constants-dLUUoWH7.js";import"./session-runtime-C-KTDVeQ.js";import"./slugify-CEUa2lfQ.js";import"./hooks-DZlZk47y.js";import"./use-mcp-client-CLbu-qTW.js";import"./auth-D8BzOPfU.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-CIsbpW60.js";import"./task-board-qKQWRm20.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-B6XJTyzc.js";import"./use-ai-providers-VnHj1RvS.js";import"./use-decopilot-events-CLCNDljy.js";import"./use-organization-settings-vq5Gp8qn.js";import"./automation-runs-DE9VSUhn.js";import"./useInfiniteQuery-PGfyfehP.js";import"./use-infinite-scroll-CFHj-DEA.js";import"./use-connection-08hpR6qS.js";import"./table-D-jgMVGz.js";import"./empty-state-BagbYGYk.js";import"./use-members-I61j4Bg0.js";import"./use-org-auth-client-CfCWX5xw.js";import"./use-automations-EMCvEash.js";import"./useSuspenseInfiniteQuery-CVgzVaXm.js";import"./avatar-CYKYYtZa.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy--NTZaUPq.js";import"./monaco-editor-DBOIld70.js";import"./spinner-Bm_hTWFz.js";import"./types-V8BEN32x.js";import"./shell-layout-DgzMjG_g.js";import"./required-auth-layout-fHFPe37p.js";import"./use-org-sso-CvRPBMtq.js";import"./integration-icon-CqMRHU_a.js";import"./use-navigate-to-agent-BenTIjx1.js";import"./chart-BimnkeiK.js";import"./index-Cxp8u-0t.js";import"./form-DdcrlWMG.js";import"./input-B9Q64Q29.js";import"./file-type-icon-BImZ4yGz.js";import"./drawer-IGxCcmhW.js";import"./collection-search-Bn9IJGT5.js";import"./tabs-DDIxVoHb.js";import"./toggle-group-B1ycOPkn.js";import"./super-agent-icon-7Ukfr6bc.js";import"./self-tool-result-BH7zYU5J.js";import"./alert-dialog-DY_67i8D.js";import"./extract-connection-data-DTKuu3uW.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-CMPWtdMv.js";import"./use-debounced-value-BeOljBqX.js";import"./authenticate-and-persist-oauth-14DQJW7S.js";import"./mcp-oauth-JNMVR7nj.js";import"./track-Ti4l0BMG.js";import"./popover-BdLEPYkg.js";import"./toolbar-DrAJ1hMc.js";import"./github-repo-picker-BsNgTNpd.js";import"./use-mcp-tools-BZuie7xe.js";import"./agent-capabilities-B52k7xCe.js";import"./connection-card-DJzzmdJa.js";import"./use-registry-connections-BEAIbWtg.js";import"./retry-CErkP7V6.js";import"./connection-slug-CITJ0kGN.js";import"./textarea-BVnIs1Lw.js";import"./connection-form-helpers-COjxkHTU.js";import"./collection-tabs-C_Plt4eY.js";import"./badge-C1elUCLo.js";import"./select-model-WSwYwLFN.js";import"./checkbox-BLQwT4c5.js";import"./ai-providers-logos-DD3qZ33J.js";import"./cards-CiLBDj3F.js";import"./dropdown-menu-trkRQR5u.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-DfVtBshF.js";import"./use-file-configs-D5W3ysgO.js";import"./pt-BR-CLy76QW2.js";import"./use-debounced-autosave-CI3PX6ch.js";import"./search-input-QsS8qM0_.js";import"./use-mcp-auth-status-DeG0R3iT.js";import"./use-secrets-gYiFcE--.js";import"./AreaChart-Br4AURer.js";import"./config-CFrJB4k3.js";import"./breadcrumb-BXE_nF_r.js";import"./command-DocuPiQB.js";import"./index-DAs7sx9F.js";import"./get-initials-D-f_fDFw.js";import"./use-tags-C7utoOLS.js";import"./automation-list-row-BsalfBXm.js";import"./site-error--i37Vnuw.js";import"./use-org-repo-syncs-JMXTBQ5z.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 J(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"&&J(m.value,t,r,[...n,"variants",l,"value"],s)}return}if(Array.isArray(e)){for(let i=0;i<e.length;i++)J(e[i],t,r,[...n,i],s);return}if(e&&typeof e=="object")for(const[i,a]of Object.entries(e))i!=="__resolveType"&&J(a,t,r,[...n,i],s)}function Vt(e){if(!e)return[];const t=[];for(const[r,n]of Object.entries(e))J(n,r,Rt(r),[],t);return t.sort((r,n)=>r.start.getTime()-n.start.getTime())}function It(e){const t=[...new Set(e)].sort(),r=new Map;return t.forEach((n,s)=>{const i=s*137.508%360;r.set(n,{bg:`oklch(0.62 0.14 ${i})`,text:"white",border:`oklch(0.50 0.14 ${i})`})}),r}const Ht={bg:"oklch(0.62 0.14 0)",text:"white",border:"oklch(0.50 0.14 0)"};function dt(e,t){return e.get(t)??Ht}const nt=new Intl.DateTimeFormat("en",{dateStyle:"medium",timeStyle:"short"});function Bt(e,t){const r=e.openStart?t("sandbox.variantCalendar.always"):nt.format(e.start),n=e.openEnd?t("sandbox.variantCalendar.ongoing"):nt.format(e.end);return`${r} → ${n}`}function Ft(e){const t=K.c(18),{variant:r}=e,n=X();let s;t[0]!==r.blockLabel?(s=o.jsx("div",{className:"font-semibold",children:r.blockLabel}),t[0]=r.blockLabel,t[1]=s):s=t[1];let i;t[2]!==r.innerPath?(i=r.innerPath&&o.jsx("div",{className:"text-muted-foreground",children:r.innerPath}),t[2]=r.innerPath,t[3]=i):i=t[3];let a;t[4]!==r.blockLabel||t[5]!==r.innerPath||t[6]!==r.label?(a=r.label!==r.blockLabel&&r.label!==r.innerPath&&o.jsx("div",{className:"text-muted-foreground",children:r.label}),t[4]=r.blockLabel,t[5]=r.innerPath,t[6]=r.label,t[7]=a):a=t[7];let c;t[8]!==n||t[9]!==r?(c=Bt(r,n),t[8]=n,t[9]=r,t[10]=c):c=t[10];let l;t[11]!==c?(l=o.jsx("div",{className:"mt-1",children:c}),t[11]=c,t[12]=l):l=t[12];let m;return t[13]!==s||t[14]!==i||t[15]!==a||t[16]!==l?(m=o.jsx(xt,{children:o.jsxs("div",{className:"text-xs",children:[s,i,a,l]})}),t[13]=s,t[14]=i,t[15]=a,t[16]=l,t[17]=m):m=t[17],m}const ot=16;function 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=X(),[s,i]=Z.useState("calendar"),[a,c]=Z.useState(Kt),[l,m]=Z.useState(!1);let p,h,f;if(t[0]!==r||t[1]!==l){const V=Vt(r);p=V.filter(Ut).length,f=l?V:V.filter(Gt),h=It(f.map(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(qt,{monthStart:a,variants:f,colorMap:g}):o.jsx(te,{monthStart:a,variants:f,colorMap:g}),t[62]=g,t[63]=a,t[64]=p,t[65]=l,t[66]=f,t[67]=s,t[68]=G):G=t[68];let Q;return t[69]!==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=X();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(at,{size:24,className:"text-muted-foreground/60"}),t[0]=i):i=t[0];let a;return t[1]!==n||t[2]!==s?(a=o.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-2 text-center text-sm text-muted-foreground p-6",children:[i,n>0?o.jsxs(o.Fragment,{children:[o.jsx("div",{children:s("sandbox.variantCalendar.noDatedVariants")}),o.jsx("div",{className:"text-xs text-muted-foreground/80",children:s("sandbox.variantCalendar.hiddenOngoingVariants",{count:n})})]}):o.jsxs(o.Fragment,{children:[o.jsx("div",{children:s("sandbox.variantCalendar.noScheduledVariants")}),o.jsx("div",{className:"text-xs text-muted-foreground/80",children:s("sandbox.variantCalendar.dateMatcherInfo")})]})]}),t[1]=n,t[2]=s,t[3]=a):a=t[3],a}const et=20,it=2,st=28,Qt=6;function qt(e){const t=K.c(17),{monthStart:r,variants:n,colorMap:s}=e;let i,a,c,l,m;if(t[0]!==s||t[1]!==r||t[2]!==n){const f=Nt(r),g=_t(new Date);i=lt,m="flex-1 min-h-0",a="min-w-[840px]",t[8]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx("div",{className:"grid grid-cols-7 border-b text-xs text-muted-foreground sticky top-0 bg-background z-10",children:wt.map(Xt)}),t[8]=c):c=t[8],l=f.map((u,x)=>{const b=kt(u,n),E=b.reduce(Jt,0),T=st+E*(et+it)+8;return o.jsxs("div",{className:"grid grid-cols-7 relative border-b",style:{height:T},children:[u.map((d,v)=>{const y=d.getMonth()===r.getMonth(),N=d.getTime()===g.getTime();return o.jsx("div",{className:rt("border-r last:border-r-0 px-2 pt-1.5 text-xs",y?"bg-background":"bg-muted/30 text-muted-foreground"),children:o.jsx("span",{className:rt("inline-flex h-5 min-w-5 items-center justify-center rounded-full px-1",N&&"bg-primary text-primary-foreground font-semibold"),children:d.getDate()})},v)}),b.map((d,v)=>{const y=dt(s,d.variant.blockKey),N=st+d.lane*(et+it),A=d.leftUnits/7*100,_=d.widthUnits/7*100,k=d.variant.openStart&&x===0,C=d.variant.openEnd&&x===f.length-1;return o.jsxs(ft,{variant:d.variant,color:y,fadeStart:k,fadeEnd:C,style:{top:N,left:`calc(${A}% + 2px)`,width:`calc(${_}% - 4px)`,minWidth:Qt,height:et},children:[d.variant.blockLabel,d.variant.label!==d.variant.blockLabel&&o.jsxs("span",{className:"opacity-70",children:[" · ",d.variant.label]})]},`${x}-${v}`)})]},x)}),t[0]=s,t[1]=r,t[2]=n,t[3]=i,t[4]=a,t[5]=c,t[6]=l,t[7]=m}else i=t[3],a=t[4],c=t[5],l=t[6],m=t[7];let p;t[9]!==a||t[10]!==c||t[11]!==l?(p=o.jsxs("div",{className:a,children:[c,l]}),t[9]=a,t[10]=c,t[11]=l,t[12]=p):p=t[12];let h;return t[13]!==i||t[14]!==m||t[15]!==p?(h=o.jsx(i,{className:m,children:p}),t[13]=i,t[14]=m,t[15]=p,t[16]=h):h=t[16],h}function Jt(e,t){return Math.max(e,t.lane+1)}function Xt(e){return o.jsx("div",{className:"px-2 py-2 text-center uppercase tracking-wide",children:e},e)}const q=4,Zt=32,Y=240;function te(e){const t=K.c(23),{monthStart:r,variants:n,colorMap:s}=e,i=r,a=U(r,q),c=new Date,l=new Map;for(const w of n){const j=l.get(w.blockKey)??[];j.push(w),l.set(w.blockKey,j)}const m=Array.from(l.entries()).sort(ne),p=a.getTime()-i.getTime(),h=w=>(Math.max(i.getTime(),Math.min(a.getTime(),w.getTime()))-i.getTime())/p*100;let f;t[0]!==i?(f=(w,j)=>U(i,j),t[0]=i,t[1]=f):f=t[1];const g=Array.from({length:q},f),u=c.getTime()>=i.getTime()&&c.getTime()<=a.getTime()?h(c):null,x=X(),b=lt,E="flex-1 min-h-0",T="min-w-[900px] relative";let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d={width:Y},t[2]=d):d=t[2];let v;t[3]!==x?(v=x("sandbox.variantCalendar.variantBlock"),t[3]=x,t[4]=v):v=t[4];let y;t[5]!==v?(y=o.jsx("div",{className:"shrink-0 px-3 py-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground border-r",style:d,children:v}),t[5]=v,t[6]=y):y=t[6];let N;t[7]===Symbol.for("react.memo_cache_sentinel")?(N={gridTemplateColumns:`repeat(${q}, minmax(0, 1fr))`},t[7]=N):N=t[7];const A=g.map(re);let _;t[8]!==A?(_=o.jsx("div",{className:"flex-1 grid",style:N,children:A}),t[8]=A,t[9]=_):_=t[9];let k;t[10]!==y||t[11]!==_?(k=o.jsxs("div",{className:"flex border-b sticky top-0 bg-background z-10",children:[y,_]}),t[10]=y,t[11]=_,t[12]=k):k=t[12];let C;t[13]!==x||t[14]!==u?(C=u!==null&&o.jsx("div",{className:"pointer-events-none absolute top-0 bottom-0 w-px bg-primary/70 z-[5]",style:{left:`calc(${Y}px + (100% - ${Y}px) * ${u} / 100)`},children:o.jsx("span",{className:"absolute -top-0.5 -translate-x-1/2 rounded-sm bg-primary px-1.5 py-px text-[10px] font-medium text-primary-foreground",children:x("sandbox.variantCalendar.todayLabel")})}),t[13]=x,t[14]=u,t[15]=C):C=t[15];const $=m.map(w=>{const[j,L]=w,B=dt(s,j),I=L[0]?.blockLabel??j;return o.jsxs("div",{children:[o.jsx("div",{className:"flex items-center bg-muted/40 border-b text-xs font-semibold uppercase tracking-wide text-muted-foreground",style:{height:28},children:o.jsx("div",{className:"px-3 truncate",style:{width:Y},children:I})}),L.map((S,F)=>o.jsxs("div",{className:"flex border-b items-center",style:{height:Zt},children:[o.jsxs("div",{className:"flex items-center gap-2 px-3 text-sm border-r shrink-0",style:{width:Y},children:[o.jsx("span",{className:"inline-block h-2 w-2 rounded-full shrink-0",style:{background:B.bg}}),o.jsx("span",{className:"truncate text-foreground/80",children:S.label})]}),o.jsxs("div",{className:"relative flex-1 h-full",children:[o.jsx("div",{className:"absolute inset-0 grid",style:{gridTemplateColumns:`repeat(${q}, minmax(0, 1fr))`},children:g.map(ee)}),(()=>{const D=Math.max(S.start.getTime(),i.getTime()),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 X,r as Z,j as o,n as rt,a8 as ut,ab as ht,B as tt,a9 as xt}from"./index-BrDSS0vH.js";import{r as gt,a6 as at,aF as bt}from"./agent-icon-DbEHgX-P.js";import{i as vt}from"./ChevronRight-Cv2J3rWD.js";import{L as yt}from"./label-DO8rqj8R.js";import{S as lt}from"./scroll-area-C1ovkzqz.js";import{S as jt}from"./switch--ZlKCa-F.js";import{V as Tt}from"./view-mode-toggle--pHeBkRS.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-PaLatgUv.js";import"./AlertCircle-Dp6ZlZYR.js";import"./UserSquare-CD6rB0Mt.js";import"./Tool01-VmLtH0nt.js";import"./ArrowUp-he2sU4Sr.js";import"./ArrowLeft-DcwBClUS.js";import"./Tool02-CLP5V5w_.js";import"./XCircle-nx54qiA1.js";import"./TrendUp01-DiRmR7Jx.js";import"./ZapSquare-7BZcnvlP.js";import"./Users03-DM6R-U2Y.js";import"./CheckCircle-D0NiMcGY.js";import"./Check-07BNkESk.js";import"./ChevronDown-DhOyrBbL.js";import"./ChevronSelectorVertical-CsgsXPiX.js";import"./ChevronUp-YHn02fNr.js";import"./DotsVertical--3-_GzX9.js";import"./Stars02-D5uaU5zd.js";import"./Copy01-CmIcrSa6.js";import"./CreditCard01-CIhTHldk.js";import"./Download01-toNys3fD.js";import"./Settings02-CIRSyyiS.js";import"./Eye-DTjOHr1S.js";import"./FilterLines-MpMMN0by.js";import"./Share07-G9fx3Q9L.js";import"./Globe01-CAdoRaMK.js";import"./Globe04-nAO-wIKX.js";import"./SwitchHorizontal01-BtFl3JWf.js";import"./HardDrive-C0hN27ts.js";import"./Key01-wRDbp013.js";import"./LinkExternal01-DDRldwTf.js";import"./LockUnlocked01-CdQhQaHo.js";import"./LogOut01-CnFpkvWe.js";import"./Monitor01-DalysQsB.js";import"./Sun-Bz3jRIqc.js";import"./Palette-D-kLCHzw.js";import"./Play-Ba4OZRO0.js";import"./Plus-Cr5CpNvW.js";import"./SearchLg-BD9EVt5N.js";import"./SearchMd-BnpHcTtG.js";import"./Shield01-DOrHTNkg.js";import"./Stars01-75kZesHq.js";import"./Trash01-B_i3PMbq.js";import"./Upload01-4W6462bd.js";import"./User01-acLUirHu.js";import"./Users01-CPikD5PC.js";import"./XClose-DWRp5M8X.js";import"./Zap-DJCvDwma.js";import"./select-DpcwZ72F.js";import"./chat-context-BEqsjQmO.js";import"./use-panel-navigate-BPSosfvG.js";import"./dialog-Bw8jIxhH.js";import"./use-destination-route-D-tMiU7z.js";import"./constants-dLUUoWH7.js";import"./session-runtime-C-KTDVeQ.js";import"./slugify-CEUa2lfQ.js";import"./hooks-pL2E-0zH.js";import"./use-mcp-client-Bvg7XHk9.js";import"./auth-BjjAKPdO.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-XTa9osf_.js";import"./task-board-Dp7JXy98.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-DmXgREYQ.js";import"./use-ai-providers-CxY1HQ0n.js";import"./use-decopilot-events-C0F2SQd9.js";import"./use-organization-settings-B5x_2l31.js";import"./automation-runs-Dt5duQ0J.js";import"./useInfiniteQuery-KYE-CFE3.js";import"./use-infinite-scroll-mm-iRnP3.js";import"./use-connection-CigRkG_8.js";import"./table-BipKiwEL.js";import"./empty-state-V20uqIl7.js";import"./use-members-dnCEd_I-.js";import"./use-org-auth-client-cQ44YMKg.js";import"./use-automations-tkJpD40-.js";import"./useSuspenseInfiniteQuery-BO9Wr8TN.js";import"./avatar-BS-tEYCe.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-CM2jC_7i.js";import"./monaco-editor-DeCGAxQs.js";import"./spinner-CuCGw0zq.js";import"./types-rth0od0M.js";import"./shell-layout-63QoGcpp.js";import"./required-auth-layout-C3Ofr9_V.js";import"./use-org-sso-C9uxUHvy.js";import"./integration-icon-DNJlj9SH.js";import"./use-navigate-to-agent-DgDtQ7iN.js";import"./chart-BhO82AZ9.js";import"./index-S0YqkiQf.js";import"./form-Co9Mo2GI.js";import"./input-CG2BXvBG.js";import"./file-type-icon-BunvGKDc.js";import"./drawer-BFvmL2Y1.js";import"./collection-search-_icrgZY2.js";import"./tabs-CKMDW8vU.js";import"./toggle-group-zLUBlOPI.js";import"./super-agent-icon-GgzP8ta8.js";import"./self-tool-result-DCxhe8ja.js";import"./alert-dialog-BUuk5lcR.js";import"./extract-connection-data-C40FHFBb.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-CMPWtdMv.js";import"./use-debounced-value-DWJO8nvY.js";import"./authenticate-and-persist-oauth-BpIYdUlz.js";import"./mcp-oauth-CTPC1gLp.js";import"./track-B0Yrx2v1.js";import"./popover-Bv7C0yQo.js";import"./toolbar-Dk5WFAot.js";import"./github-repo-picker-ChEu6h_O.js";import"./use-mcp-tools-QHHoZ2b5.js";import"./agent-capabilities-B52k7xCe.js";import"./connection-card-oGGVJVEj.js";import"./use-registry-connections-DNfmYK-s.js";import"./retry-CErkP7V6.js";import"./connection-slug-CITJ0kGN.js";import"./textarea-BoTumDit.js";import"./connection-form-helpers-GREUhGXH.js";import"./collection-tabs-C9z-M1hW.js";import"./badge-CFRe-nD1.js";import"./select-model-BI-dA8gZ.js";import"./checkbox-D5nOQ93h.js";import"./ai-providers-logos-DD3qZ33J.js";import"./cards-DYEOYym-.js";import"./dropdown-menu-DP13EbUQ.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-B7qbfIHU.js";import"./use-file-configs-CS0ZXqXi.js";import"./pt-BR-CLy76QW2.js";import"./use-debounced-autosave-crX_AMVn.js";import"./search-input-CGMH8IA5.js";import"./use-mcp-auth-status-C4AweF_A.js";import"./use-secrets-DuRMdB6_.js";import"./AreaChart-CLIsSolL.js";import"./config-DjJwkqAh.js";import"./breadcrumb-2i2x9k0L.js";import"./command-Cr6yO9J6.js";import"./index-DotZRxLq.js";import"./get-initials-D-f_fDFw.js";import"./use-tags-CJoE7Mdv.js";import"./automation-list-row-BTLGh__Y.js";import"./site-error--i37Vnuw.js";import"./use-org-repo-syncs-CTap8mHN.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 J(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"&&J(m.value,t,r,[...n,"variants",l,"value"],s)}return}if(Array.isArray(e)){for(let i=0;i<e.length;i++)J(e[i],t,r,[...n,i],s);return}if(e&&typeof e=="object")for(const[i,a]of Object.entries(e))i!=="__resolveType"&&J(a,t,r,[...n,i],s)}function Vt(e){if(!e)return[];const t=[];for(const[r,n]of Object.entries(e))J(n,r,Rt(r),[],t);return t.sort((r,n)=>r.start.getTime()-n.start.getTime())}function It(e){const t=[...new Set(e)].sort(),r=new Map;return t.forEach((n,s)=>{const i=s*137.508%360;r.set(n,{bg:`oklch(0.62 0.14 ${i})`,text:"white",border:`oklch(0.50 0.14 ${i})`})}),r}const Ht={bg:"oklch(0.62 0.14 0)",text:"white",border:"oklch(0.50 0.14 0)"};function dt(e,t){return e.get(t)??Ht}const nt=new Intl.DateTimeFormat("en",{dateStyle:"medium",timeStyle:"short"});function Bt(e,t){const r=e.openStart?t("sandbox.variantCalendar.always"):nt.format(e.start),n=e.openEnd?t("sandbox.variantCalendar.ongoing"):nt.format(e.end);return`${r} → ${n}`}function Ft(e){const t=K.c(18),{variant:r}=e,n=X();let s;t[0]!==r.blockLabel?(s=o.jsx("div",{className:"font-semibold",children:r.blockLabel}),t[0]=r.blockLabel,t[1]=s):s=t[1];let i;t[2]!==r.innerPath?(i=r.innerPath&&o.jsx("div",{className:"text-muted-foreground",children:r.innerPath}),t[2]=r.innerPath,t[3]=i):i=t[3];let a;t[4]!==r.blockLabel||t[5]!==r.innerPath||t[6]!==r.label?(a=r.label!==r.blockLabel&&r.label!==r.innerPath&&o.jsx("div",{className:"text-muted-foreground",children:r.label}),t[4]=r.blockLabel,t[5]=r.innerPath,t[6]=r.label,t[7]=a):a=t[7];let c;t[8]!==n||t[9]!==r?(c=Bt(r,n),t[8]=n,t[9]=r,t[10]=c):c=t[10];let l;t[11]!==c?(l=o.jsx("div",{className:"mt-1",children:c}),t[11]=c,t[12]=l):l=t[12];let m;return t[13]!==s||t[14]!==i||t[15]!==a||t[16]!==l?(m=o.jsx(xt,{children:o.jsxs("div",{className:"text-xs",children:[s,i,a,l]})}),t[13]=s,t[14]=i,t[15]=a,t[16]=l,t[17]=m):m=t[17],m}const ot=16;function 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=X(),[s,i]=Z.useState("calendar"),[a,c]=Z.useState(Kt),[l,m]=Z.useState(!1);let p,h,f;if(t[0]!==r||t[1]!==l){const V=Vt(r);p=V.filter(Ut).length,f=l?V:V.filter(Gt),h=It(f.map(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(qt,{monthStart:a,variants:f,colorMap:g}):o.jsx(te,{monthStart:a,variants:f,colorMap:g}),t[62]=g,t[63]=a,t[64]=p,t[65]=l,t[66]=f,t[67]=s,t[68]=G):G=t[68];let Q;return t[69]!==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=X();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(at,{size:24,className:"text-muted-foreground/60"}),t[0]=i):i=t[0];let a;return t[1]!==n||t[2]!==s?(a=o.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-2 text-center text-sm text-muted-foreground p-6",children:[i,n>0?o.jsxs(o.Fragment,{children:[o.jsx("div",{children:s("sandbox.variantCalendar.noDatedVariants")}),o.jsx("div",{className:"text-xs text-muted-foreground/80",children:s("sandbox.variantCalendar.hiddenOngoingVariants",{count:n})})]}):o.jsxs(o.Fragment,{children:[o.jsx("div",{children:s("sandbox.variantCalendar.noScheduledVariants")}),o.jsx("div",{className:"text-xs text-muted-foreground/80",children:s("sandbox.variantCalendar.dateMatcherInfo")})]})]}),t[1]=n,t[2]=s,t[3]=a):a=t[3],a}const et=20,it=2,st=28,Qt=6;function qt(e){const t=K.c(17),{monthStart:r,variants:n,colorMap:s}=e;let i,a,c,l,m;if(t[0]!==s||t[1]!==r||t[2]!==n){const f=Nt(r),g=_t(new Date);i=lt,m="flex-1 min-h-0",a="min-w-[840px]",t[8]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx("div",{className:"grid grid-cols-7 border-b text-xs text-muted-foreground sticky top-0 bg-background z-10",children:wt.map(Xt)}),t[8]=c):c=t[8],l=f.map((u,x)=>{const b=kt(u,n),E=b.reduce(Jt,0),T=st+E*(et+it)+8;return o.jsxs("div",{className:"grid grid-cols-7 relative border-b",style:{height:T},children:[u.map((d,v)=>{const y=d.getMonth()===r.getMonth(),N=d.getTime()===g.getTime();return o.jsx("div",{className:rt("border-r last:border-r-0 px-2 pt-1.5 text-xs",y?"bg-background":"bg-muted/30 text-muted-foreground"),children:o.jsx("span",{className:rt("inline-flex h-5 min-w-5 items-center justify-center rounded-full px-1",N&&"bg-primary text-primary-foreground font-semibold"),children:d.getDate()})},v)}),b.map((d,v)=>{const y=dt(s,d.variant.blockKey),N=st+d.lane*(et+it),A=d.leftUnits/7*100,_=d.widthUnits/7*100,k=d.variant.openStart&&x===0,C=d.variant.openEnd&&x===f.length-1;return o.jsxs(ft,{variant:d.variant,color:y,fadeStart:k,fadeEnd:C,style:{top:N,left:`calc(${A}% + 2px)`,width:`calc(${_}% - 4px)`,minWidth:Qt,height:et},children:[d.variant.blockLabel,d.variant.label!==d.variant.blockLabel&&o.jsxs("span",{className:"opacity-70",children:[" · ",d.variant.label]})]},`${x}-${v}`)})]},x)}),t[0]=s,t[1]=r,t[2]=n,t[3]=i,t[4]=a,t[5]=c,t[6]=l,t[7]=m}else i=t[3],a=t[4],c=t[5],l=t[6],m=t[7];let p;t[9]!==a||t[10]!==c||t[11]!==l?(p=o.jsxs("div",{className:a,children:[c,l]}),t[9]=a,t[10]=c,t[11]=l,t[12]=p):p=t[12];let h;return t[13]!==i||t[14]!==m||t[15]!==p?(h=o.jsx(i,{className:m,children:p}),t[13]=i,t[14]=m,t[15]=p,t[16]=h):h=t[16],h}function Jt(e,t){return Math.max(e,t.lane+1)}function Xt(e){return o.jsx("div",{className:"px-2 py-2 text-center uppercase tracking-wide",children:e},e)}const q=4,Zt=32,Y=240;function te(e){const t=K.c(23),{monthStart:r,variants:n,colorMap:s}=e,i=r,a=U(r,q),c=new Date,l=new Map;for(const w of n){const j=l.get(w.blockKey)??[];j.push(w),l.set(w.blockKey,j)}const m=Array.from(l.entries()).sort(ne),p=a.getTime()-i.getTime(),h=w=>(Math.max(i.getTime(),Math.min(a.getTime(),w.getTime()))-i.getTime())/p*100;let f;t[0]!==i?(f=(w,j)=>U(i,j),t[0]=i,t[1]=f):f=t[1];const g=Array.from({length:q},f),u=c.getTime()>=i.getTime()&&c.getTime()<=a.getTime()?h(c):null,x=X(),b=lt,E="flex-1 min-h-0",T="min-w-[900px] relative";let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d={width:Y},t[2]=d):d=t[2];let v;t[3]!==x?(v=x("sandbox.variantCalendar.variantBlock"),t[3]=x,t[4]=v):v=t[4];let y;t[5]!==v?(y=o.jsx("div",{className:"shrink-0 px-3 py-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground border-r",style:d,children:v}),t[5]=v,t[6]=y):y=t[6];let N;t[7]===Symbol.for("react.memo_cache_sentinel")?(N={gridTemplateColumns:`repeat(${q}, minmax(0, 1fr))`},t[7]=N):N=t[7];const A=g.map(re);let _;t[8]!==A?(_=o.jsx("div",{className:"flex-1 grid",style:N,children:A}),t[8]=A,t[9]=_):_=t[9];let k;t[10]!==y||t[11]!==_?(k=o.jsxs("div",{className:"flex border-b sticky top-0 bg-background z-10",children:[y,_]}),t[10]=y,t[11]=_,t[12]=k):k=t[12];let C;t[13]!==x||t[14]!==u?(C=u!==null&&o.jsx("div",{className:"pointer-events-none absolute top-0 bottom-0 w-px bg-primary/70 z-[5]",style:{left:`calc(${Y}px + (100% - ${Y}px) * ${u} / 100)`},children:o.jsx("span",{className:"absolute -top-0.5 -translate-x-1/2 rounded-sm bg-primary px-1.5 py-px text-[10px] font-medium text-primary-foreground",children:x("sandbox.variantCalendar.todayLabel")})}),t[13]=x,t[14]=u,t[15]=C):C=t[15];const $=m.map(w=>{const[j,L]=w,B=dt(s,j),I=L[0]?.blockLabel??j;return o.jsxs("div",{children:[o.jsx("div",{className:"flex items-center bg-muted/40 border-b text-xs font-semibold uppercase tracking-wide text-muted-foreground",style:{height:28},children:o.jsx("div",{className:"px-3 truncate",style:{width:Y},children:I})}),L.map((S,F)=>o.jsxs("div",{className:"flex border-b items-center",style:{height:Zt},children:[o.jsxs("div",{className:"flex items-center gap-2 px-3 text-sm border-r shrink-0",style:{width:Y},children:[o.jsx("span",{className:"inline-block h-2 w-2 rounded-full shrink-0",style:{background:B.bg}}),o.jsx("span",{className:"truncate text-foreground/80",children:S.label})]}),o.jsxs("div",{className:"relative flex-1 h-full",children:[o.jsx("div",{className:"absolute inset-0 grid",style:{gridTemplateColumns:`repeat(${q}, minmax(0, 1fr))`},children:g.map(ee)}),(()=>{const D=Math.max(S.start.getTime(),i.getTime()),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-
|
|
1
|
+
import{c as $,r as C,n as f,j as i,ab as k,a8 as I,a9 as P}from"./index-BrDSS0vH.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};
|
package/dist/client/index.html
CHANGED
|
@@ -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-
|
|
53
|
+
<script type="module" crossorigin src="/assets/index-BrDSS0vH.js"></script>
|
|
54
54
|
<link rel="stylesheet" crossorigin href="/assets/index-DJSuP9VA.css">
|
|
55
55
|
</head>
|
|
56
56
|
<body>
|
package/dist/server/cli.js
CHANGED
|
@@ -1473,7 +1473,7 @@ Usage: deco services <up|down|status>`),process.exit(1)}}var ip1=L(()=>{tf()});f
|
|
|
1473
1473
|
`.execute($);if(Number(W.rows[0]?.cnt)===0){console.warn(`Failed to migrate ${J}/${K}, keeping in old table`);continue}}await jy`
|
|
1474
1474
|
DELETE FROM kysely_migration WHERE name = ${Q}
|
|
1475
1475
|
`.execute($)}}async function ha1($){await Cs8($),await _s8($);let Z=new ya1({db:$,provider:{getMigrations:()=>Promise.resolve(np0)}}),{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 vs8($){let{keepOpen:Z=!1,database:Q,skipBetterAuth:X=!1}=$??{},Y="skipped";if(!X&&!Q)Y=await ml0();let G=Q??F8(),J=async()=>{if(!Z&&!Q)await $O(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 xs8(){let $=F8(),Z=new ya1({db:$.db,provider:{getMigrations:()=>Promise.resolve(np0)}}),{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();dl0();QQ()});async function E70($){let Z={...process.env},Q=U80($,Z);console.log(nw1(Q.settings.encryptionKey));let X=Q.settings.betterAuthSecret||(Q.settings.localMode?At1(Q.settings.dataDir):""),{ensureServices:Y}=await Promise.resolve().then(() => (RZ0(),TZ0)),{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(() => (dl0(),Rt1));await W(G.databaseUrl);let{createDatabase:H}=await Promise.resolve().then(() => (QQ(),un1)),{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 pp1(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 tp0=L(()=>{tf();Tt1();R$()});var ia1={};Z0(ia1,{updateService:()=>dE,subscribeCliState:()=>ap0,setTuiConsoleIntercepted:()=>j70,setServerUrl:()=>jp,setMigrationsDone:()=>Ep,setDevMode:()=>bs8,resetCliStateForTests:()=>fs8,isTuiConsoleIntercepted:()=>z70,getCliState:()=>rp0,addLogEntry:()=>KO});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 fs8(){mX=ma1()}function wp(){for(let $ of op0)$()}function rp0(){return mX}function ap0($){return op0.add($),()=>op0.delete($)}function dE($){mX={...mX,services:mX.services.map((Z)=>Z.name===$.name?$:Z)},wp()}function Ep(){mX={...mX,migrationsStatus:"done"},wp()}function jp($){mX={...mX,serverUrl:$},wp()}function KO($){let Z=[...mX.logs,$];mX={...mX,logs:Z.length>500?Z.slice(-500):Z},wp()}function bs8(){mX={...mX,services:[...la1(),{name:"API",status:"pending",port:0},{name:"Vite",status:"pending",port:0}]},wp()}function j70($){da1=$}function z70(){return da1}var mX,op0,da1=!1;var iE=L(()=>{mX=ma1();op0=new Set});import{createServer as pa1}from"net";function ys8($){return new Promise((Z)=>{let Q=pa1();Q.once("error",()=>Z(!1)),Q.listen($,"0.0.0.0",()=>{Q.close(()=>Z(!0))})})}async function zp($){if(await ys8($))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 sp0=()=>{};var $n0={};Z0($n0,{startDevServer:()=>hs8,pipeToLogStore:()=>ep0});import{join as gs8}from"path";function ep0($){let Z=$.getReader(),Q=new TextDecoder,X="";function Y(){let G=X.split(`
|
|
1476
|
-
`);X=G.pop()??"";for(let J of G){let K=Bun.stripANSI(J).replace(/^\[\d+\]\s*/,"").trim();if(!K)continue;KO({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)KO({method:"",path:"",status:0,duration:0,timestamp:new Date,rawLine:G})}})()}async function hs8($){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 zp(Number(Y)+1):await zp(Number($.port)),{settings:K,services:W,managedServiceNames:H}=await E70({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});Ep();let F=gs8(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)ep0(U.stdout),ep0(U.stderr);jp(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(() => (RZ0(),TZ0));await w(K.dataDir)}};return process.on("SIGINT",()=>O("SIGINT")),process.on("SIGTERM",()=>O("SIGTERM")),{port:Number(Y),process:U}}var Zn0=L(()=>{tp0();iE();sp0()});var P70;var Qn0=L(()=>{P70={name:"decocms",version:"4.297.5",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 cs8,Text as na1}from"ink";import{jsx as ls8,jsxs as ta1}from"react/jsx-runtime";function oa1({version:$}){return ta1(cs8,{flexDirection:"column",marginTop:1,children:[nZ0.map((Z,Q)=>ls8(na1,{color:tZ0[Q],children:Z},Q)),ta1(na1,{dimColor:!0,children:[" v",$]})]})}var ra1=L(()=>{Gp()});import{Box as pE,Text as WO}from"ink";import{Spinner as ms8}from"@inkjs/ui";import{jsx as XG,jsxs as zy}from"react/jsx-runtime";function aa1({status:$}){if($==="pending")return XG(ms8,{label:""});return XG(WO,{color:"green",children:"\u2713"})}function ds8($){return`${$.name}: ${$.port||"...."}`}function sa1({services:$,migrationsStatus:Z,home:Q,serverUrl:X}){return zy(pE,{flexDirection:"column",paddingBottom:1,children:[XG(oa1,{version:P70.version}),XG(pE,{marginBottom:1,children:XG(WO,{dimColor:!0,children:"\u2500".repeat(80)})}),XG(pE,{children:zy(WO,{dimColor:!0,children:["Home: ",Q]})}),zy(pE,{gap:2,children:[$.map((Y)=>zy(pE,{gap:1,children:[XG(WO,{children:ds8(Y)}),XG(aa1,{status:Y.status})]},Y.name)),zy(pE,{gap:1,children:[XG(WO,{children:"Migrations"}),XG(aa1,{status:Z})]})]}),XG(pE,{children:X?zy(WO,{children:["Open in browser: ",XG(WO,{color:"cyan",children:X})]}):XG(WO,{dimColor:!0,children:"Starting..."})})]})}var ea1=L(()=>{Qn0();ra1()});import{Box as is8,Text as Pp}from"ink";import{jsx as Xn0,jsxs as Yn0}from"react/jsx-runtime";function ps8($){if($>=500)return"red";if($>=400)return"yellow";if($>=300)return"cyan";return"green"}function $s1({logs:$}){return Xn0(is8,{flexDirection:"column",children:$.map((Z,Q)=>{if(Z.rawLine)return Xn0(Pp,{dimColor:!0,children:Z.rawLine},Q);let X=Z.duration<1000?`${Z.duration}ms`:`${(Z.duration/1000).toFixed(1)}s`;return Yn0(Pp,{children:[Yn0(Pp,{dimColor:!0,children:[Z.method.padEnd(6)," ",Z.path.padEnd(30)," "]}),Xn0(Pp,{color:ps8(Z.status),children:Z.status}),Yn0(Pp,{dimColor:!0,children:[" ",X.padStart(8)]})]},Q)})})}var Zs1=()=>{};var Gn0={};Z0(Gn0,{App:()=>os8});import{Box as ns8}from"ink";import{useSyncExternalStore as ts8}from"react";import{jsx as Qs1,jsxs as rs8}from"react/jsx-runtime";function os8({home:$}){let Z=ts8(ap0,rp0);return rs8(ns8,{flexDirection:"column",children:[Qs1(sa1,{services:Z.services,migrationsStatus:Z.migrationsStatus,home:$,serverUrl:Z.serverUrl}),Qs1($s1,{logs:Z.logs})]})}var Jn0=L(()=>{ea1();Zs1();iE()});var d3="thread-gate",BN="decopilot-hosted-harness",ON="decopilot-hosted-harness-sandboxed",wJ="automations",HO="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 as8 from"pg";async function Ks1($,Z){let{databaseUrl:Q,lockTimeoutMs:X=ss8}=$,Y=$.log??((W)=>console.log(W)),G=new as8.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$(es8)}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,ss8=600000,es8=500;var Ws1=L(()=>{J4()});function $e8(){let $=(process.env.BUN_OPTIONS??"").split(/\s+/).filter(Boolean);return[...process.argv.slice(1),...$]}function Kn0($,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 $=$e8();if($.includes("--cpu-prof")){console.log(JSON.stringify({msg:"cpu-profiling-active",dir:Kn0($,"--cpu-prof-dir")??process.cwd(),name:Kn0($,"--cpu-prof-name"),markdown:$.includes("--cpu-prof-md"),intervalUs:Number(Kn0($,"--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(()=>{}),A70=setInterval(()=>void Z().catch(()=>{}),$),A70.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(A70)clearInterval(A70)}}var A70;var Ns1=()=>{};import*as Ze8 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{Qe8()}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=Xe8()?.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 Qe8,Xe8;var Bs1=L(()=>{({startSamplingProfiler:Qe8,samplingProfilerStackTraces:Xe8}=Ze8)});function Os1(){Hs1();let $=[Fs1(),_n1(),Us1()];return()=>{for(let Z of $)Z()}}var Ls1=L(()=>{xl0();Ns1();Bs1()});var oE=v((Ds1)=>{Object.defineProperty(Ds1,"__esModule",{value:!0});Ds1.RepublishHeaders=Ds1.DirectMsgHeaders=Ds1.JsHeaders=Ds1.AdvisoryKind=void 0;Ds1.isOrderedPushConsumerOptions=Ye8;Ds1.isPullConsumer=Ge8;Ds1.isPushConsumer=Je8;Ds1.isBoundPushConsumerOptions=Ke8;function Ye8($){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 Ge8($){return $.isPullConsumer()}function Je8($){return $.isPushConsumer()}function Ke8($){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 YG=v((Es1)=>{Object.defineProperty(Es1,"__esModule",{value:!0});Es1.TD=Es1.TE=Es1.Empty=void 0;Es1.encode=De8;Es1.decode=we8;Es1.Empty=new Uint8Array(0);Es1.TE=new TextEncoder;Es1.TD=new TextDecoder;function Le8(...$){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 De8(...$){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 Le8(...Z)}function we8($){if(!$||$.length===0)return"";return Es1.TD.decode($)}});var GG=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 Hn0 extends Error{constructor($,Z){super(`illegal subject: '${$}'`,Z);this.name="InvalidSubjectError"}}Ps1.InvalidSubjectError=Hn0;class T70 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 T70(`${$} ${Z}`,Q)}}Ps1.InvalidArgumentError=T70;class Fn0 extends Error{constructor($,Z){super($,Z);this.name="InvalidOperationError"}}Ps1.InvalidOperationError=Fn0;class R70 extends Error{constructor($,Z){super($,Z);this.name="UserAuthenticationExpiredError"}static parse($){if($.toLowerCase().indexOf("user authentication expired")!==-1)return new R70($);return null}}Ps1.UserAuthenticationExpiredError=R70;class I70 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 I70($);return null}}Ps1.AuthorizationError=I70;class Nn0 extends Error{constructor(){super("closed connection");this.name="ClosedConnectionError"}}Ps1.ClosedConnectionError=Nn0;class Un0 extends Error{constructor(){super("connection draining");this.name="DrainingConnectionError"}}Ps1.DrainingConnectionError=Un0;class Bn0 extends Error{constructor($,Z){super($,Z);this.name="ConnectionError"}}Ps1.ConnectionError=Bn0;class On0 extends Error{constructor($,Z){super($,Z);this.name="ProtocolError"}}Ps1.ProtocolError=On0;class Ln0 extends Error{constructor($="",Z){super($,Z);this.name="RequestError"}isNoResponders(){return this.cause instanceof q70}}Ps1.RequestError=Ln0;class Dn0 extends Error{constructor($){super("timeout",$);this.name="TimeoutError"}}Ps1.TimeoutError=Dn0;class q70 extends Error{subject;constructor($,Z){super(`no responders: '${$}'`,Z);this.subject=$,this.name="NoResponders"}}Ps1.NoRespondersError=q70;class M70 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 M70($,Q,X,Y)}}Ps1.PermissionViolationError=M70;Ps1.errors={AuthorizationError:I70,ClosedConnectionError:Nn0,ConnectionError:Bn0,DrainingConnectionError:Un0,InvalidArgumentError:T70,InvalidOperationError:Fn0,InvalidSubjectError:Hn0,NoRespondersError:q70,PermissionViolationError:M70,ProtocolError:On0,RequestError:Ln0,TimeoutError:Dn0,UserAuthenticationExpiredError:R70}});var i3=v((qs1)=>{Object.defineProperty(qs1,"__esModule",{value:!0});qs1.SimpleMutex=qs1.Perf=void 0;qs1.extend=xe8;qs1.render=fe8;qs1.timeout=be8;qs1.delay=ye8;qs1.deadline=ge8;qs1.deferred=En0;qs1.debugDeferred=he8;qs1.shuffle=ue8;qs1.collect=ce8;qs1.jitter=Is1;qs1.backoff=le8;qs1.nanos=me8;qs1.millis=de8;qs1.randomToken=ne8;var ve8=YG(),wn0=GG();function xe8($,...Z){for(let Q=0;Q<Z.length;Q++){let X=Z[Q];Object.keys(X).forEach(function(Y){$[Y]=X[Y]})}return $}function fe8($){return ve8.TD.decode($).replace(/\n/g,"\u240A").replace(/\r/g,"\u240D")}function be8($,Z=!0){let Q=Z?new wn0.TimeoutError:null,X,Y,G=new Promise((J,K)=>{X={cancel:()=>{if(Y)clearTimeout(Y)}},Y=setTimeout(()=>{if(Q===null)K(new wn0.TimeoutError);else K(Q)},$)});return Object.assign(G,X)}function ye8($=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 ge8($,Z=1000){let Q=En0(),X=setTimeout(()=>{Q.reject(new wn0.TimeoutError)},Z);try{return await Promise.race([$,Q])}finally{clearTimeout(X)}}function En0(){let $={},Z=new Promise((Q,X)=>{$={resolve:Q,reject:X}});return Object.assign(Z,$)}function he8(){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 ue8($){for(let Z=$.length-1;Z>0;Z--){let Q=Math.floor(Math.random()*(Z+1));[$[Z],$[Q]]=[$[Q],$[Z]]}return $}async function ce8($){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 $=En0();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 le8($=[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 me8($){return $*1e6}function de8($){return Math.floor($/1e6)}var ie8="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",LN=new Uint8Array(62);for(let $=0;$<62;$++)LN[$]=ie8.charCodeAt($);var pe8=218340105584896;function ne8(){let $=Math.floor(Math.random()*pe8),Z=$%62,Q=LN[Z];$=($-Z)/62,Z=$%62;let X=LN[Z];$=($-Z)/62,Z=$%62;let Y=LN[Z];$=($-Z)/62,Z=$%62;let G=LN[Z];$=($-Z)/62,Z=$%62;let J=LN[Z];$=($-Z)/62,Z=$%62;let K=LN[Z];$=($-Z)/62,Z=$%62;let W=LN[Z];$=($-Z)/62;let H=LN[$];return String.fromCharCode(Q,X,Y,G,J,K,W,H)}});var xs1=v((_s1)=>{Object.defineProperty(_s1,"__esModule",{value:!0});_s1.nuid=_s1.NuidImpl=void 0;var H04="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",FO=62,k70=12,Ss1=10,Vs1=33,F04=333,ks1=k70+Ss1,zn0=new Uint8Array(FO);for(let $=0;$<FO;$++)zn0[$]=H04.charCodeAt($);var V70=4294967296,Cs1=BigInt(FO)**BigInt(Ss1),Ap=Number(Cs1/(1n<<32n)),jn0=Number(Cs1%(1n<<32n));function N04($){for(let Z=0;Z<$.length;Z++)$[Z]=Math.floor(Math.random()*256)}function U04($){if(globalThis?.crypto?.getRandomValues)globalThis.crypto.getRandomValues($);else N04($)}class Pn0{buf;cbuf;seqHi;seqLo;inc;inited;constructor(){this.buf=new Uint8Array(ks1),this.cbuf=new Uint8Array(k70),this.inited=!1}init(){this.inited=!0,this.setPre(),this.initSeqAndInc(),this.fillSeq()}initSeqAndInc(){let $=0;do this.seqHi=Math.floor(Math.random()*(Ap+1)),this.seqLo=Math.floor(Math.random()*V70);while($++<8&&this.seqHi===Ap&&this.seqLo>=jn0);if(this.seqHi===Ap&&this.seqLo>=jn0)this.seqLo=0;this.inc=Math.random()*(F04-Vs1)+Vs1|0}setPre(){U04(this.cbuf);for(let $=0;$<k70;$++)this.buf[$]=zn0[this.cbuf[$]%FO]}fillSeq(){let $=this.seqHi,Z=this.seqLo;for(let Q=ks1-1;Q>=k70;Q--){let X=Math.floor($/FO),G=($-X*FO)*V70+Z,J=Math.floor(G/FO),K=G-J*FO;this.buf[Q]=zn0[K],$=X,Z=J}}next(){if(!this.inited)this.init();if(this.seqLo+=this.inc,this.seqLo>=V70)this.seqLo-=V70,this.seqHi+=1;if(this.seqHi>Ap||this.seqHi===Ap&&this.seqLo>=jn0)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=Pn0;_s1.nuid=new Pn0});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 C70=v((S70)=>{Object.defineProperty(S70,"__esModule",{value:!0});S70.nuid=S70.Nuid=void 0;var hs1=gs1();Object.defineProperty(S70,"Nuid",{enumerable:!0,get:function(){return hs1.Nuid}});Object.defineProperty(S70,"nuid",{enumerable:!0,get:function(){return hs1.nuid}})});var NO=v((us1)=>{Object.defineProperty(us1,"__esModule",{value:!0});us1.DEFAULT_HOST=us1.DEFAULT_PORT=us1.Match=void 0;us1.syncIterator=E04;us1.createInbox=j04;var D04=C70(),w04=GG();us1.Match={Exact:"exact",CanonicalMIME:"canonical",IgnoreCase:"insensitive"};function E04($){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 j04($=""){if($=$||"_INBOX",typeof $!=="string")throw TypeError("prefix must be a string");return $.split(".").forEach((Z)=>{if(Z==="*"||Z===">")throw w04.InvalidArgumentError.format("prefix",`cannot have wildcards ('${$}')`)}),`${$}.${D04.nuid.next()}`}us1.DEFAULT_PORT=4222;us1.DEFAULT_HOST="127.0.0.1"});var Tp=v((ds1)=>{Object.defineProperty(ds1,"__esModule",{value:!0});ds1.DataBuffer=void 0;var ls1=YG();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=M04;ns1.defaultPort=V04;ns1.getUrlParseFn=k04;ns1.newTransport=S04;ns1.getResolveFn=C04;ns1.protoLen=ps1;ns1.extractProtocolMessage=_04;var R04=YG(),I04=NO(),q04=Tp(),JG;function M04($){JG=$}function V04(){return JG!==void 0&&JG.defaultPort!==void 0?JG.defaultPort:I04.DEFAULT_PORT}function k04(){return JG!==void 0&&JG.urlParseFn?JG.urlParseFn:void 0}function S04(){if(!JG||typeof JG.factory!=="function")throw Error("transport fn is not set");return JG.factory()}function C04(){return JG!==void 0&&JG.dnsResolveFn?JG.dnsResolveFn:void 0}ns1.CR_LF=`\r
|
|
1476
|
+
`);X=G.pop()??"";for(let J of G){let K=Bun.stripANSI(J).replace(/^\[\d+\]\s*/,"").trim();if(!K)continue;KO({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)KO({method:"",path:"",status:0,duration:0,timestamp:new Date,rawLine:G})}})()}async function hs8($){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 zp(Number(Y)+1):await zp(Number($.port)),{settings:K,services:W,managedServiceNames:H}=await E70({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});Ep();let F=gs8(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)ep0(U.stdout),ep0(U.stderr);jp(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(() => (RZ0(),TZ0));await w(K.dataDir)}};return process.on("SIGINT",()=>O("SIGINT")),process.on("SIGTERM",()=>O("SIGTERM")),{port:Number(Y),process:U}}var Zn0=L(()=>{tp0();iE();sp0()});var P70;var Qn0=L(()=>{P70={name:"decocms",version:"4.297.6",description:"Deco CMS \u2014 Self-hostable MCP Gateway for managing AI connections and tools",author:"Deco team",repository:{type:"git",url:"git+https://github.com/decocms/studio.git",directory:"apps/api"},bugs:{url:"https://github.com/decocms/studio/issues"},type:"module",bin:{deco:"./dist/server/cli.js"},files:["dist/**/*"],scripts:{dev:"bun run migrate && bun run dev:server","dev:server":"bun run --cwd=../../packages/sandbox build && NODE_ENV=development bun --env-file=.env --hot run src/index.ts",build:"bun run build:server","build:server":"bun run scripts/bundle-server-script.ts --dist ./dist/server","generate:tool-contracts":"bun run scripts/generate-tool-contracts.ts","db:migrate":"bun run ./dist/server/migrate.js","db:migrate:dbos":"bun run ./dist/server/migrate-dbos.js",check:"tsc --noEmit",start:"bun run ./dist/server/server.js",migrate:"bun run src/database/migrate.ts","migrate:dbos":"bun run src/database/migrate-dbos.ts",test:"bun test src","better-auth:migrate":"bunx --bun @better-auth/cli migrate -y --config src/auth/index.ts",prepublishOnly:"bun run --cwd=../.. build:studio"},optionalDependencies:{"@duckdb/node-api":"^1.5.0-r.1"},dependencies:{"@ai-sdk/anthropic":"^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 cs8,Text as na1}from"ink";import{jsx as ls8,jsxs as ta1}from"react/jsx-runtime";function oa1({version:$}){return ta1(cs8,{flexDirection:"column",marginTop:1,children:[nZ0.map((Z,Q)=>ls8(na1,{color:tZ0[Q],children:Z},Q)),ta1(na1,{dimColor:!0,children:[" v",$]})]})}var ra1=L(()=>{Gp()});import{Box as pE,Text as WO}from"ink";import{Spinner as ms8}from"@inkjs/ui";import{jsx as XG,jsxs as zy}from"react/jsx-runtime";function aa1({status:$}){if($==="pending")return XG(ms8,{label:""});return XG(WO,{color:"green",children:"\u2713"})}function ds8($){return`${$.name}: ${$.port||"...."}`}function sa1({services:$,migrationsStatus:Z,home:Q,serverUrl:X}){return zy(pE,{flexDirection:"column",paddingBottom:1,children:[XG(oa1,{version:P70.version}),XG(pE,{marginBottom:1,children:XG(WO,{dimColor:!0,children:"\u2500".repeat(80)})}),XG(pE,{children:zy(WO,{dimColor:!0,children:["Home: ",Q]})}),zy(pE,{gap:2,children:[$.map((Y)=>zy(pE,{gap:1,children:[XG(WO,{children:ds8(Y)}),XG(aa1,{status:Y.status})]},Y.name)),zy(pE,{gap:1,children:[XG(WO,{children:"Migrations"}),XG(aa1,{status:Z})]})]}),XG(pE,{children:X?zy(WO,{children:["Open in browser: ",XG(WO,{color:"cyan",children:X})]}):XG(WO,{dimColor:!0,children:"Starting..."})})]})}var ea1=L(()=>{Qn0();ra1()});import{Box as is8,Text as Pp}from"ink";import{jsx as Xn0,jsxs as Yn0}from"react/jsx-runtime";function ps8($){if($>=500)return"red";if($>=400)return"yellow";if($>=300)return"cyan";return"green"}function $s1({logs:$}){return Xn0(is8,{flexDirection:"column",children:$.map((Z,Q)=>{if(Z.rawLine)return Xn0(Pp,{dimColor:!0,children:Z.rawLine},Q);let X=Z.duration<1000?`${Z.duration}ms`:`${(Z.duration/1000).toFixed(1)}s`;return Yn0(Pp,{children:[Yn0(Pp,{dimColor:!0,children:[Z.method.padEnd(6)," ",Z.path.padEnd(30)," "]}),Xn0(Pp,{color:ps8(Z.status),children:Z.status}),Yn0(Pp,{dimColor:!0,children:[" ",X.padStart(8)]})]},Q)})})}var Zs1=()=>{};var Gn0={};Z0(Gn0,{App:()=>os8});import{Box as ns8}from"ink";import{useSyncExternalStore as ts8}from"react";import{jsx as Qs1,jsxs as rs8}from"react/jsx-runtime";function os8({home:$}){let Z=ts8(ap0,rp0);return rs8(ns8,{flexDirection:"column",children:[Qs1(sa1,{services:Z.services,migrationsStatus:Z.migrationsStatus,home:$,serverUrl:Z.serverUrl}),Qs1($s1,{logs:Z.logs})]})}var Jn0=L(()=>{ea1();Zs1();iE()});var d3="thread-gate",BN="decopilot-hosted-harness",ON="decopilot-hosted-harness-sandboxed",wJ="automations",HO="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 as8 from"pg";async function Ks1($,Z){let{databaseUrl:Q,lockTimeoutMs:X=ss8}=$,Y=$.log??((W)=>console.log(W)),G=new as8.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$(es8)}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,ss8=600000,es8=500;var Ws1=L(()=>{J4()});function $e8(){let $=(process.env.BUN_OPTIONS??"").split(/\s+/).filter(Boolean);return[...process.argv.slice(1),...$]}function Kn0($,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 $=$e8();if($.includes("--cpu-prof")){console.log(JSON.stringify({msg:"cpu-profiling-active",dir:Kn0($,"--cpu-prof-dir")??process.cwd(),name:Kn0($,"--cpu-prof-name"),markdown:$.includes("--cpu-prof-md"),intervalUs:Number(Kn0($,"--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(()=>{}),A70=setInterval(()=>void Z().catch(()=>{}),$),A70.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(A70)clearInterval(A70)}}var A70;var Ns1=()=>{};import*as Ze8 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{Qe8()}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=Xe8()?.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 Qe8,Xe8;var Bs1=L(()=>{({startSamplingProfiler:Qe8,samplingProfilerStackTraces:Xe8}=Ze8)});function Os1(){Hs1();let $=[Fs1(),_n1(),Us1()];return()=>{for(let Z of $)Z()}}var Ls1=L(()=>{xl0();Ns1();Bs1()});var oE=v((Ds1)=>{Object.defineProperty(Ds1,"__esModule",{value:!0});Ds1.RepublishHeaders=Ds1.DirectMsgHeaders=Ds1.JsHeaders=Ds1.AdvisoryKind=void 0;Ds1.isOrderedPushConsumerOptions=Ye8;Ds1.isPullConsumer=Ge8;Ds1.isPushConsumer=Je8;Ds1.isBoundPushConsumerOptions=Ke8;function Ye8($){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 Ge8($){return $.isPullConsumer()}function Je8($){return $.isPushConsumer()}function Ke8($){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 YG=v((Es1)=>{Object.defineProperty(Es1,"__esModule",{value:!0});Es1.TD=Es1.TE=Es1.Empty=void 0;Es1.encode=De8;Es1.decode=we8;Es1.Empty=new Uint8Array(0);Es1.TE=new TextEncoder;Es1.TD=new TextDecoder;function Le8(...$){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 De8(...$){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 Le8(...Z)}function we8($){if(!$||$.length===0)return"";return Es1.TD.decode($)}});var GG=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 Hn0 extends Error{constructor($,Z){super(`illegal subject: '${$}'`,Z);this.name="InvalidSubjectError"}}Ps1.InvalidSubjectError=Hn0;class T70 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 T70(`${$} ${Z}`,Q)}}Ps1.InvalidArgumentError=T70;class Fn0 extends Error{constructor($,Z){super($,Z);this.name="InvalidOperationError"}}Ps1.InvalidOperationError=Fn0;class R70 extends Error{constructor($,Z){super($,Z);this.name="UserAuthenticationExpiredError"}static parse($){if($.toLowerCase().indexOf("user authentication expired")!==-1)return new R70($);return null}}Ps1.UserAuthenticationExpiredError=R70;class I70 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 I70($);return null}}Ps1.AuthorizationError=I70;class Nn0 extends Error{constructor(){super("closed connection");this.name="ClosedConnectionError"}}Ps1.ClosedConnectionError=Nn0;class Un0 extends Error{constructor(){super("connection draining");this.name="DrainingConnectionError"}}Ps1.DrainingConnectionError=Un0;class Bn0 extends Error{constructor($,Z){super($,Z);this.name="ConnectionError"}}Ps1.ConnectionError=Bn0;class On0 extends Error{constructor($,Z){super($,Z);this.name="ProtocolError"}}Ps1.ProtocolError=On0;class Ln0 extends Error{constructor($="",Z){super($,Z);this.name="RequestError"}isNoResponders(){return this.cause instanceof q70}}Ps1.RequestError=Ln0;class Dn0 extends Error{constructor($){super("timeout",$);this.name="TimeoutError"}}Ps1.TimeoutError=Dn0;class q70 extends Error{subject;constructor($,Z){super(`no responders: '${$}'`,Z);this.subject=$,this.name="NoResponders"}}Ps1.NoRespondersError=q70;class M70 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 M70($,Q,X,Y)}}Ps1.PermissionViolationError=M70;Ps1.errors={AuthorizationError:I70,ClosedConnectionError:Nn0,ConnectionError:Bn0,DrainingConnectionError:Un0,InvalidArgumentError:T70,InvalidOperationError:Fn0,InvalidSubjectError:Hn0,NoRespondersError:q70,PermissionViolationError:M70,ProtocolError:On0,RequestError:Ln0,TimeoutError:Dn0,UserAuthenticationExpiredError:R70}});var i3=v((qs1)=>{Object.defineProperty(qs1,"__esModule",{value:!0});qs1.SimpleMutex=qs1.Perf=void 0;qs1.extend=xe8;qs1.render=fe8;qs1.timeout=be8;qs1.delay=ye8;qs1.deadline=ge8;qs1.deferred=En0;qs1.debugDeferred=he8;qs1.shuffle=ue8;qs1.collect=ce8;qs1.jitter=Is1;qs1.backoff=le8;qs1.nanos=me8;qs1.millis=de8;qs1.randomToken=ne8;var ve8=YG(),wn0=GG();function xe8($,...Z){for(let Q=0;Q<Z.length;Q++){let X=Z[Q];Object.keys(X).forEach(function(Y){$[Y]=X[Y]})}return $}function fe8($){return ve8.TD.decode($).replace(/\n/g,"\u240A").replace(/\r/g,"\u240D")}function be8($,Z=!0){let Q=Z?new wn0.TimeoutError:null,X,Y,G=new Promise((J,K)=>{X={cancel:()=>{if(Y)clearTimeout(Y)}},Y=setTimeout(()=>{if(Q===null)K(new wn0.TimeoutError);else K(Q)},$)});return Object.assign(G,X)}function ye8($=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 ge8($,Z=1000){let Q=En0(),X=setTimeout(()=>{Q.reject(new wn0.TimeoutError)},Z);try{return await Promise.race([$,Q])}finally{clearTimeout(X)}}function En0(){let $={},Z=new Promise((Q,X)=>{$={resolve:Q,reject:X}});return Object.assign(Z,$)}function he8(){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 ue8($){for(let Z=$.length-1;Z>0;Z--){let Q=Math.floor(Math.random()*(Z+1));[$[Z],$[Q]]=[$[Q],$[Z]]}return $}async function ce8($){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 $=En0();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 le8($=[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 me8($){return $*1e6}function de8($){return Math.floor($/1e6)}var ie8="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",LN=new Uint8Array(62);for(let $=0;$<62;$++)LN[$]=ie8.charCodeAt($);var pe8=218340105584896;function ne8(){let $=Math.floor(Math.random()*pe8),Z=$%62,Q=LN[Z];$=($-Z)/62,Z=$%62;let X=LN[Z];$=($-Z)/62,Z=$%62;let Y=LN[Z];$=($-Z)/62,Z=$%62;let G=LN[Z];$=($-Z)/62,Z=$%62;let J=LN[Z];$=($-Z)/62,Z=$%62;let K=LN[Z];$=($-Z)/62,Z=$%62;let W=LN[Z];$=($-Z)/62;let H=LN[$];return String.fromCharCode(Q,X,Y,G,J,K,W,H)}});var xs1=v((_s1)=>{Object.defineProperty(_s1,"__esModule",{value:!0});_s1.nuid=_s1.NuidImpl=void 0;var H04="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",FO=62,k70=12,Ss1=10,Vs1=33,F04=333,ks1=k70+Ss1,zn0=new Uint8Array(FO);for(let $=0;$<FO;$++)zn0[$]=H04.charCodeAt($);var V70=4294967296,Cs1=BigInt(FO)**BigInt(Ss1),Ap=Number(Cs1/(1n<<32n)),jn0=Number(Cs1%(1n<<32n));function N04($){for(let Z=0;Z<$.length;Z++)$[Z]=Math.floor(Math.random()*256)}function U04($){if(globalThis?.crypto?.getRandomValues)globalThis.crypto.getRandomValues($);else N04($)}class Pn0{buf;cbuf;seqHi;seqLo;inc;inited;constructor(){this.buf=new Uint8Array(ks1),this.cbuf=new Uint8Array(k70),this.inited=!1}init(){this.inited=!0,this.setPre(),this.initSeqAndInc(),this.fillSeq()}initSeqAndInc(){let $=0;do this.seqHi=Math.floor(Math.random()*(Ap+1)),this.seqLo=Math.floor(Math.random()*V70);while($++<8&&this.seqHi===Ap&&this.seqLo>=jn0);if(this.seqHi===Ap&&this.seqLo>=jn0)this.seqLo=0;this.inc=Math.random()*(F04-Vs1)+Vs1|0}setPre(){U04(this.cbuf);for(let $=0;$<k70;$++)this.buf[$]=zn0[this.cbuf[$]%FO]}fillSeq(){let $=this.seqHi,Z=this.seqLo;for(let Q=ks1-1;Q>=k70;Q--){let X=Math.floor($/FO),G=($-X*FO)*V70+Z,J=Math.floor(G/FO),K=G-J*FO;this.buf[Q]=zn0[K],$=X,Z=J}}next(){if(!this.inited)this.init();if(this.seqLo+=this.inc,this.seqLo>=V70)this.seqLo-=V70,this.seqHi+=1;if(this.seqHi>Ap||this.seqHi===Ap&&this.seqLo>=jn0)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=Pn0;_s1.nuid=new Pn0});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 C70=v((S70)=>{Object.defineProperty(S70,"__esModule",{value:!0});S70.nuid=S70.Nuid=void 0;var hs1=gs1();Object.defineProperty(S70,"Nuid",{enumerable:!0,get:function(){return hs1.Nuid}});Object.defineProperty(S70,"nuid",{enumerable:!0,get:function(){return hs1.nuid}})});var NO=v((us1)=>{Object.defineProperty(us1,"__esModule",{value:!0});us1.DEFAULT_HOST=us1.DEFAULT_PORT=us1.Match=void 0;us1.syncIterator=E04;us1.createInbox=j04;var D04=C70(),w04=GG();us1.Match={Exact:"exact",CanonicalMIME:"canonical",IgnoreCase:"insensitive"};function E04($){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 j04($=""){if($=$||"_INBOX",typeof $!=="string")throw TypeError("prefix must be a string");return $.split(".").forEach((Z)=>{if(Z==="*"||Z===">")throw w04.InvalidArgumentError.format("prefix",`cannot have wildcards ('${$}')`)}),`${$}.${D04.nuid.next()}`}us1.DEFAULT_PORT=4222;us1.DEFAULT_HOST="127.0.0.1"});var Tp=v((ds1)=>{Object.defineProperty(ds1,"__esModule",{value:!0});ds1.DataBuffer=void 0;var ls1=YG();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=M04;ns1.defaultPort=V04;ns1.getUrlParseFn=k04;ns1.newTransport=S04;ns1.getResolveFn=C04;ns1.protoLen=ps1;ns1.extractProtocolMessage=_04;var R04=YG(),I04=NO(),q04=Tp(),JG;function M04($){JG=$}function V04(){return JG!==void 0&&JG.defaultPort!==void 0?JG.defaultPort:I04.DEFAULT_PORT}function k04(){return JG!==void 0&&JG.urlParseFn?JG.urlParseFn:void 0}function S04(){if(!JG||typeof JG.factory!=="function")throw Error("transport fn is not set");return JG.factory()}function C04(){return JG!==void 0&&JG.dnsResolveFn?JG.dnsResolveFn:void 0}ns1.CR_LF=`\r
|
|
1477
1477
|
`;ns1.CR_LF_LEN=ns1.CR_LF.length;ns1.CRLF=q04.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 _04($){let Z=ps1($);if(Z>0){let X=new Uint8Array($).slice(0,Z);return R04.TD.decode(X)}return""}});var qn0=v((Ze1)=>{Object.defineProperty(Ze1,"__esModule",{value:!0});Ze1.ipV4=ss1;Ze1.isIP=m04;Ze1.parseIP=es1;var Rp=4,aE=16,_70=48,as1=57,os1=65,c04=70,rs1=97,l04=102,In0=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 m04($){return es1($)!==void 0}function es1($){for(let Z=0;Z<$.length;Z++)switch($[Z]){case".":return $e1($);case":":return d04($)}return}function $e1($){let Z=new Uint8Array(Rp);for(let Q=0;Q<Rp;Q++){if($.length===0)return;if(Q>0){if($[0]!==".")return;$=$.substring(1)}let{n:X,c:Y,ok:G}=i04($);if(!G||X>255)return;$=$.substring(Y),Z[Q]=X}return ss1(Z[0],Z[1],Z[2],Z[3])}function d04($){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}=p04($);if(!J||Y>65535)return;if(G<$.length&&$[G]==="."){if(Q<0&&X!=aE-Rp)return;if(X+Rp>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+=Rp;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 i04($){let Z=0,Q=0;for(Z=0;Z<$.length&&_70<=$.charCodeAt(Z)&&$.charCodeAt(Z)<=as1;Z++)if(Q=Q*10+($.charCodeAt(Z)-_70),Q>=In0)return{n:In0,c:Z,ok:!1};if(Z===0)return{n:0,c:0,ok:!1};return{n:Q,c:Z,ok:!0}}function p04($){let Z=0,Q=0;for(Q=0;Q<$.length;Q++){if(_70<=$.charCodeAt(Q)&&$.charCodeAt(Q)<=as1)Z*=16,Z+=$.charCodeAt(Q)-_70;else if(rs1<=$.charCodeAt(Q)&&$.charCodeAt(Q)<=l04)Z*=16,Z+=$.charCodeAt(Q)-rs1+10;else if(os1<=$.charCodeAt(Q)&&$.charCodeAt(Q)<=c04)Z*=16,Z+=$.charCodeAt(Q)-os1+10;else break;if(Z>=In0)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 _n0=v((Xe1)=>{Object.defineProperty(Xe1,"__esModule",{value:!0});Xe1.Servers=Xe1.ServerImpl=void 0;Xe1.isIPV4OrHostname=Qe1;Xe1.hostPort=Cn0;var Mn0=rE(),Vn0=i3(),kn0=qn0(),r04=NO(),a04=GG();function Qe1($){if($.indexOf("[")!==-1||$.indexOf("::")!==-1)return!1;if($.indexOf(".")!==-1)return!0;if($.split(":").length<=2)return!0;return!1}function Sn0($){return!Qe1($)}function s04($){let Q=$.toUpperCase().indexOf("::FFFF:");if(Q!==-1&&$.indexOf(".")!==-1){let X=$.substring(Q+7);return X=X.replace("[",""),X.replace("]","")}return $}function Cn0($){if($=$.trim(),$.match(/^(.*:\/\/)(.*)/m))$=$.replace(/^(.*:\/\/)(.*)/gm,"$2");if($=s04($),Sn0($)&&$.indexOf("[")===-1)$=`[${$}]`;let Z=Sn0($)?$.match(/(]:)(\d+)/):$.match(/(:)(\d+)/),Q=Z&&Z.length===3&&Z[1]&&Z[2]?parseInt(Z[2]):r04.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=Cn0($);this.listen=Q.listen,this.hostname=Q.hostname,this.port=Q.port,this.didConnect=!1,this.reconnects=0,this.lastConnect=0,this.gossiped=Z}toString(){return this.listen}async resolve($){if(!$.fn||$.resolve===!1)return[this];let Z=[];if((0,kn0.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}://${Sn0(X)?"["+X+"]":X}`);G.port=`${this.port}`;let J=new Py(G.host,!1);J.tlsName=this.hostname,Z.push(J)}}if($.randomize)(0,Vn0.shuffle)(Z);return this.resolves=Z,Z}}Xe1.ServerImpl=Py;class v70{firstSelect;servers;currentServer;tlsName;randomize;constructor($={}){this.firstSelect=!0,this.servers=[],this.tlsName="",this.randomize=$.randomize||!1}setServers($){if(!Array.isArray($)||$.length===0)throw a04.InvalidArgumentError.format("servers","cannot be empty");let Z=(0,Mn0.getUrlParseFn)(),Q=new Map;for(let Y of this.servers)Q.set(Y.listen,Y);let X=[];for(let Y of $){Y=Z?Z(Y):Y;let{listen:G}=Cn0(Y),J=Q.get(G);if(J)J.gossiped=!1,X.push(J);else X.push(new Py(Y))}if(this.randomize)(0,Vn0.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,kn0.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,Mn0.getUrlParseFn)();$=Q?Q($):$;let X=new Py($,Z);if((0,kn0.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 v70.freezeAll(this.servers)}snapshotForHandler(){let $=this.currentServer;if(!$)return this.snapshot();let Z=this.servers.indexOf($);if(Z<=0)return this.snapshot();return v70.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,Mn0.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,Vn0.shuffle)(W),this.servers=K?[K,...W]:W}return{added:Q,deleted:X}}}Xe1.Servers=v70});var x70=v((Ke1)=>{Object.defineProperty(Ke1,"__esModule",{value:!0});Ke1.QueuedIteratorImpl=void 0;var vn0=i3(),Ge1=GG();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,vn0.deferred)(),this.yields=[],this.iterClosed=(0,vn0.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,vn0.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 xn0=v((Ne1)=>{Object.defineProperty(Ne1,"__esModule",{value:!0});Ne1.MuxSubscription=void 0;var Q14=NO(),He1=GG();class Fe1{baseInbox;reqs;constructor(){this.reqs=new Map}size(){return this.reqs.size}init($){return this.baseInbox=`${(0,Q14.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 fn0=v((Oe1)=>{Object.defineProperty(Oe1,"__esModule",{value:!0});Oe1.Heartbeat=void 0;var X14=i3();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,X14.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 gn0=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=G14;je1.readAll=J14;je1.writeAll=K14;var Y14=YG();class bn0 extends Error{constructor($){super($);this.name="AssertionError"}}je1.AssertionError=bn0;function we1($,Z="Assertion failed."){if(!$)throw new bn0(Z)}var De1=32768;je1.MAX_SIZE=4294967294;function f70($,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 G14($,Z){return Ee1($,Uint8Array.of(Z))}class yn0{_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=f70(this._buf.subarray(this._off),$);return this._off+=Z,Z}writeByte($){return this.write(Uint8Array.of($))}writeString($){return this.write(Y14.TE.encode($))}write($){let Z=this._grow($.byteLength);return f70($,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)f70(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));f70(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=yn0;function J14($){let Z=new yn0;return Z.readFrom($),Z.bytes()}function K14($,Z){let Q=0;while(Q<Z.length)Q+=$.write(Z.subarray(Q))}});var cn0=v((Re1)=>{Object.defineProperty(Re1,"__esModule",{value:!0});Re1.cc=Re1.State=Re1.Parser=Re1.Kind=void 0;Re1.describe=O14;var hn0=gn0(),un0=YG();Re1.Kind={OK:0,ERR:1,MSG:2,INFO:3,PING:4,PONG:5};function O14($){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=un0.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=un0.TD.decode($.data)}return`${Z}: ${Q}`}function Pe1(){let $={};return $.sid=-1,$.hdr=-1,$.size=-1,$}var Ae1=48,L14=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 hn0.DenoBuffer($.subarray(this.as,Z-this.drop));if(this.state===Re1.State.MSG_PAYLOAD&&!this.msgBuf){if(!this.argBuf)this.cloneMsgArg();this.msgBuf=new hn0.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 hn0.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}: ${un0.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]>L14)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 g70=v((qe1)=>{Object.defineProperty(qe1,"__esModule",{value:!0});qe1.MsgHdrsImpl=void 0;qe1.canonicalMIMEHeaderKey=mn0;qe1.headers=E14;var Ie1=YG(),p3=NO(),y70=GG();function mn0($){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 y70.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 E14($=0,Z=""){if($===0&&Z!=="")throw y70.InvalidArgumentError.format("code","is required");else if($>0&&Z==="")throw y70.InvalidArgumentError.format("description","is required");return new Ty($,Z)}var ln0="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
|
|
1478
1478
|
`),Y=X[0];if(Y!==ln0){let G=Y.replace(ln0,"").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 $=ln0;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
|
|
1479
1479
|
${Z}: ${Q[X]}`;return`${$}\r
|
|
@@ -2829,7 +2829,7 @@ ${G}`.trim().slice(0,m_$)}function Zt4($){let Z=$.fields.priority?.name?.toLower
|
|
|
2829
2829
|
|
|
2830
2830
|
${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,mH);continue}throw w}}}class d_${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(c_$));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,c_$($));return this.ids.set($.id,Q),Q}}function c_$($){return{jiraSprintId:$.id,name:$.name,state:$.state,startsAt:$.startsAt,endsAt:$.endsAt}}function Qt4($,Z){if($.size===0)return[];return Z.filter((Q)=>!$.has(Q.jiraIssueId))}async function Xt4($,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=Qt4(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"},mH);await $.storage.taskBoard.recordActivity({taskBoardItemId:K.itemId,action:"status_changed",actorId:null,data:{from:W.status,to:"archived"}}),u$(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 Yt4($,Z){let{organizationId:Q,boardId:X}=Z;if(!X)throw Error("No Jira board selected");let Y=pC$(Z.statusMapping);if(Y.size===0)throw Error("No status mapping configured");let G=Z.lastSyncedAt===null||Z.rescanPending,J=new Z3(Z.siteUrl,Z.email,Z.apiToken),{accountId:K}=await J.myself(),W=new D71(J),H=new Date,F=await J.getBoardScopeJql(X),N=an4(Z,F,H),U=new d_$($,Q);await U.seed(await J.listBoardSprints(X));let B={created:0,updated:0,unchanged:0,skipped:0,archived:0,unmappedStatuses:[]},O=new Set,D,w,E=0,j=0;while(E<w71&&j<l_$){j++;let P=await J.searchIssues({jql:N,nextPageToken:w});if(w=P.nextPageToken??void 0,P.issues.length===0){if(!w)break;continue}let I=await $.storage.jiraIntegrations.getLinksByIssueIds(Q,P.issues.map((q)=>q.id));await W.resolve(P.issues.flatMap((q)=>[...aa(q.fields.description),...(q.fields.comment?.comments??[]).flatMap((M)=>aa(M.body))]));for(let q of P.issues){if(E>=w71)break;E++;let M=new Date(q.fields.updated);if(Number.isNaN(M.getTime()))throw Error(`Unparseable updated on ${q.key}`);let S=Y.get(q.fields.status.name);if(!S||!g_$(q)){if(!S&&g_$(q))O.add(q.fields.status.name);B.skipped++,D=M;continue}let m=I.get(q.id);if(m&&sn4(m.jiraUpdatedAt,M,G)){B.unchanged++,D=M;continue}let f=q.fields.status.name,b={title:q.fields.summary,description:await $t4(Z.siteUrl,q,W),priority:Zt4(q),sprintId:await U.localIdFor(E_$(q.sprints))};if(m){let l=m.jiraStatus!==f,y=await $.storage.taskBoard.getById(m.itemId,Q),p=await $.storage.taskBoard.update(m.itemId,Q,{...b,...l?{status:S}:{}},mH);if(await $.storage.jiraIntegrations.touchLink(m.itemId,{jiraStatus:f}),y&&l&&y.status!==S)await $.storage.taskBoard.recordActivity({taskBoardItemId:m.itemId,action:"status_changed",actorId:null,data:{from:y.status,to:S}});if(l&&!G)p=await h_$($,Z,p);await u_$($,Z,J,q,m.itemId,K,W),await $.storage.jiraIntegrations.touchLink(m.itemId,{jiraUpdatedAt:M}),u$(Q,p),B.updated++}else{let l=await $.storage.taskBoard.create({organizationId:Q,...b,status:S,by:mH});try{await $.storage.jiraIntegrations.createLink({itemId:l.id,organizationId:Q,jiraIssueId:q.id,jiraIssueKey:q.key,jiraUpdatedAt:new Date(0),jiraStatus:f})}catch(y){if(y.code==="23505"){await $.storage.taskBoard.delete(l.id,Q,mH),B.unchanged++,D=M;continue}throw y}if(!G)l=await h_$($,Z,l);await u_$($,Z,J,q,l.id,K,W),await $.storage.jiraIntegrations.touchLink(l.id,{jiraUpdatedAt:M}),u$(Q,l),B.created++}D=M}if(!w)break}B.unmappedStatuses=[...O].sort();let z=en4(E,j);if(!z)B.archived=await Xt4($,Z,J,F);let A=G&&z;if(D===void 0&&E===0)return{counts:B,watermark:H,rescanPending:A};return{counts:B,watermark:D,rescanPending:A}}var mH="jira",w71=500,on4=5,l_$=25,m_$=1e4,rn4;var WT0=L(()=>{mA0();h6();jU();M5();KT0();K71();rn4={highest:"urgent",high:"high",medium:"medium",low:"low",lowest:"low"}});var i_$={};Z0(i_$,{setJiraSyncRuntime:()=>P71,registerJiraSyncWorkflow:()=>T71,maybeEnqueueJiraStatusPush:()=>zt4,enqueueJiraCommentPush:()=>A71});import{DBOS as qX,SchedulerMode as Gt4}from"@dbos-inc/dbos-sdk";function P71($){HT0=$}function ea(){if(!HT0)throw Error("[jira] sync runtime not initialized \u2014 setJiraSyncRuntime() must run before the workflow fires");return HT0}function zU(){let{db:$,encryptionKey:Z}=ea();return new kv($,new HG(Z))}function Kt4(){return new IX(ea().db)}async function Wt4($){try{let{db:Z}=ea(),Q=await zU().getById($);if(!Q)return{id:$,error:"integration no longer exists"};if(!Q.enabled)return{id:$};let X=await mK(Z,Q.organizationId);if(!X)return{id:$,error:"organization no longer exists"};let Y=await Xc(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 Ht4($,Z){let Q=await qX.runStep(()=>zU().listEnabledIds(),{name:"loadJiraIntegrations"});for(let X of Q){let Y=await qX.runStep(()=>Wt4(X),{name:`syncJira:${X}`});if(Y.error)console.warn(`[jira] sync ${Y.id} failed: ${Y.error}`)}}async function Nt4($){let Z=zU();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 Ut4($){return(await ea().db.selectFrom("organization").select("slug").where("id","=",$).executeTakeFirst())?.slug??null}async function Bt4($,Z,Q){let X=await zU().getByOrg($);if(!X?.enabled)return null;let G=(await mK(ea().db,$))?.orgFs;if(!G)return null;let J=new Z3(X.siteUrl,X.email,X.apiToken);return b_$(Q,{read:(K)=>G.read(K.volume,K.path).catch((W)=>{if(W instanceof EJ)return null;throw W}),listAttachments:()=>J.listAttachments(Z),upload:(K)=>J.addAttachment(Z,K),mediaIdFor:(K)=>J.resolveMediaId(K)})}async function Ot4($,Z,Q){let X=zU(),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 Z3(Y.siteUrl,Y.email,Y.apiToken).addComment(G.jiraIssueId,Z,{header:`${$.authorLabel} \xB7 via Studio:`,media:new Map(Q)})).id}async function Lt4($,Z){try{await zU().createCommentLink({commentId:$.commentId,organizationId:$.organizationId,jiraCommentId:Z})}catch(Q){if(Q.code!=="23505")throw Q}}async function Dt4($){let Z=$.body.slice(0,Ft4),Q=await qX.runStep(()=>Nt4($),{name:"resolveCommentTarget",retriesAllowed:!0,maxAttempts:3});if(!Q)return;let X=[],Y=Y_$(Z);if(Y.length>0){let J=await qX.runStep(()=>Ut4($.organizationId),{name:"readOrgSlug",retriesAllowed:!0,maxAttempts:3});for(let K of f_$(Y,J??""))try{let W=await qX.runStep(()=>Bt4($.organizationId,Q.jiraIssueId,K),{name:`attachCommentImage:${K.name}`,retriesAllowed:!0,maxAttempts:3});if(W)X.push([K.target,W])}catch(W){if(!mC$(W))throw W;console.warn(`[jira] could not attach ${K.ref.path}:`,W)}}let G=await qX.runStep(()=>Ot4($,Z,X),{name:"postCommentToJira",retriesAllowed:!1});if(!G)return;await qX.runStep(()=>Lt4($,G),{name:"recordCommentLink",retriesAllowed:!0,maxAttempts:4})}async function wt4($){let Z=zU(),Q=await Z.getByOrg($.organizationId);if(!Q?.enabled)return null;let X=await Z.getLinkByItemId($.itemId,$.organizationId);if(!X)return null;let Y=await Kt4().getById($.itemId,$.organizationId);if(!Y)return null;if(oZ1(Q.statusMapping,Y.status,X.jiraStatus))return null;let J=await new Z3(Q.siteUrl,Q.email,Q.apiToken).listTransitions(X.jiraIssueId),K=tC$({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 Et4($,Z){let Q=zU(),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 Z3(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 jt4($){let Z=await qX.runStep(()=>wt4($),{name:"resolveStatusTransition",retriesAllowed:!0,maxAttempts:3});if(!Z)return;await qX.runStep(()=>Et4($,Z),{name:"executeStatusTransition",retriesAllowed:!0,maxAttempts:3})}function zt4($,Z){if(Z.updatedBy===mH)return;if(!z71||!HT0)return;let Q=z71;(async()=>{if(!await zU().getLinkByItemId(Z.id,$))return;await qX.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 A71($,Z){try{if(!j71)return;if(!await $.storage.jiraIntegrations.getLinkByItemId(Z.taskBoardItemId,Z.organizationId))return;await qX.startWorkflow(j71,{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 T71(){if(E71)return;E71=qX.registerWorkflow(Ht4,{name:"jiraSyncWorkflow"}),qX.registerScheduled(E71,{name:"jiraSyncWorkflow",crontab:Jt4,mode:Gt4.ExactlyOncePerIntervalWhenActive}),j71=qX.registerWorkflow(Dt4,{name:"jiraCommentPushWorkflow"}),z71=qX.registerWorkflow(jt4,{name:"jiraStatusPushWorkflow"})}var Jt4="2-59/10 * * * *",HT0=null,Ft4=30000,E71=null,j71=null,z71=null;var FT0=L(()=>{dC$();EO();$c();eA0();uH();Hj();KT0();y_$();Y71();WT0()});function NT0($,Z,Q,X){LG({event:$,organizationId:Z,properties:{task_id:Q.id,reports_task:FY(Q),...X}})}function u$($,Z){c5.emit($,{id:crypto.randomUUID(),type:VL$,source:"task-board",subject:Z.id,data:Z,time:new Date().toISOString()}),Promise.resolve().then(() => (FT0(),i_$)).then((Q)=>Q.maybeEnqueueJiraStatusPush($,Z)).catch((Q)=>{console.warn("[jira] status push hook unavailable:",Q)})}function p_$($,Z){c5.emit($,{id:crypto.randomUUID(),type:kL$,source:"task-board",subject:Z,data:{id:Z},time:new Date().toISOString()})}function Pt4($,Z){return $?[$]:Z}async function _v($,Z,Q){let X=$.metadata?.runMetadata?.taskBoardItemId,Y=!X&&Q?await $.storage.taskBoard.linkedTaskIds(Q,Z):[];return Pt4(X,Y)}async function n_$($,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);if(!G||EU[Z]<=EU[G.status])continue;let J=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((K)=>console.error("[task-board] activity log write failed",K)),u$(X,J),Z==="in_progress")NT0("task_run_started",X,J,{from:G.status})}}catch(Y){console.error("[task-board] run transition failed",Y)}}async function UT0($,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;u$(Q,Y),NT0("task_run_completed",Q,Y,{from:"in_progress",via:"pr_open"})}}catch(X){console.error("[task-board] review-cycle open failed",X)}}async function BT0($,Z,Q,X){let Y=$.organization?.id;if(!Y)return;try{let G=aA0(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 Yc($,Z,Q,X){try{let Y=await $.advanceLinkedTasksToReviewOnThreadFinish(Z,Q);for(let G of Y)u$(Q,G),NT0("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 R71($,Z,Q),await I71($,X,Z,Q)}function t_$($){return EU[$.status]>=EU.in_review||Boolean($.reviewCycleStartedAt)}async function R71($,Z,Q){try{let X=await $.failedRunInfo(Z,Q);if(!X)return;let Y=bC$(X);for(let G of await $.linkedTaskIds(Z,Q)){let J=await $.getById(G,Q);if(!J)continue;if(t_$(J))await $.relabelDeliveredFailure(Z,Q,Rt4).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=N7(Tt4,At4,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(()=>{}),u$(Q,W),NT0("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 I71($,Z,Q,X){try{for(let Y of await $.linkedTaskIds(Q,X)){let G=await $.getById(Y,X);if(!G)continue;if(t_$(G))continue;if(G.threads.some((K)=>K.hasMessages&&(K.status===null||!ta.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 q71($,Z){if(Z.status!=="in_progress"||!IY(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(()=>{}),u$(Z.organizationId,Q)}catch(Q){console.error(`[task-board] parking ${Z.id} for review failed`,Q)}}async function dH($,Z,Q){let X=Z.organizationId;if(Z.assigneeId!==G8)return!1;try{await q71($,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}`),u$(X,Y),!0}catch(Y){return console.error(`[task-board] handing ${Z.id} to a human failed`,Y),!1}}async function o_$($,Z,Q){if(!(Q instanceof DX))return!1;if(Q.reason!=="runs_exhausted")return!1;return await dH($,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 r_$($,Z){let Q=$.organization?.id;if(!Q)return;try{let X=await $.storage.taskBoard.reopenLinkedTasksOnThreadRun(Z,Q);for(let Y of X)u$(Q,Y)}catch(X){console.error("[task-board] thread-run reopen failed",X)}}function a_$($){return $.includes("create_pull_request")||$.includes("createPullRequest")}function s_$($){if(It4.test($))return!0;return qt4.test($)&&Mt4.test($)}var At4=30000,Tt4=120000,Rt4="Run ended after it had already delivered \u2014 the task moved on without it",It4,qt4,Mt4;var M5=L(()=>{uJ();f4();uH();eu();yC$();J4();pa();h6();IQ();cH();It4=/\bgh\s+pr\s+create\b/,qt4=/api\.github\.com\/repos\/[^\s"']+\/pulls\b/,Mt4=/(?:-X|--request)\s+POST/});function Vt4($){if($.status==="completed")return"advance";if($.status==="failed"&&$.messageStorageVersion===2&&($.harnessId==="decopilot"||$.harnessId==="claude-code"))return"nudge";return"none"}function kt4($){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(`
|
|
2831
2831
|
`)}async function St4($,Z,Q){await ru($,Z,Q,{messageId:`stall-nudge-${Z.id}-${Q.id}`,prompt:kt4(Q.harness_id),workflowID:`stall-nudge:${Z.id}:${Q.id}`})}async function Ct4($,Z){let Q=await $.storage.threads.get(Z);if(!Q)return{action:"none",thread:null};return{action:Vt4({status:Q.status,messageStorageVersion:Q.message_storage_version,harnessId:Q.harness_id}),thread:Q}}function _t4($,Z=Date.now()){if($.status!=="in_progress")return!1;if($.run_started_at)return!1;return da($,Z)}async function vt4($,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||!_t4(Y))continue;if(await $.storage.threads.markRunFailed(X.threadId,M71,"abandoned"))Q.push(X.threadId),console.warn(`[task-board] failed never-started thread ${X.threadId} on ${Z.id}`)}return Q}async function e_$($,Z){let Q=$.organization?.id;if(!Q)return;for(let X of Z){if(X.status==="in_progress")try{if((await vt4($,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(!pZ1(X,Y))continue;let G=X.threads.find((J)=>J.hasMessages);if(!G)continue;try{let{action:J,thread:K}=await Ct4($,G.threadId);if(J==="none"||!K)continue;if(J==="advance")await Yc($.storage.taskBoard,G.threadId,Q,$.storage.organizationBilling);else await St4($,X,K)}catch(J){console.error(`[task-board] stall recovery failed for ${X.id}`,J)}}}var M71="Run never started \u2014 no pod picked it up before the idle window elapsed";var V71=L(()=>{iA0();uH();M5()});import{z as Q3}from"zod";var xt4,vv;var k71=L(()=>{mA0();k0();JY();oJ();V71();xt4=Q3.object({key:Q3.string(),title:Q3.string(),position:Q3.number(),role:Q3.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:Q3.object({}),outputSchema:Q3.object({items:Q3.array(hu),repos:Q3.array(Q3.string()),sprints:Q3.array($k$),columns:Q3.array(xt4)}),handler:async($,Z)=>{s(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),ou(Z,Q).then((W)=>W.columns())]),K=_O$(Y);return e_$(Z,X),{items:X,repos:K,sprints:G,columns:J}}})});import{z as _G}from"zod";function yt4($){return bt4.some((Z)=>$[Z]!==void 0)}function gt4($,Z){let Q=[];for(let{field:G,action:J}of ft4){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 ht4($,Z){if($!==G8)return!1;if(!Z)return!1;return Z.assigneeId!==G8?!0:Z.status==="todo"}function ct4($,Z,Q){let X=$!==void 0&&ut4.has($),Y=Z!==void 0&&IY(Z);return Q&&X&&Y}function S71($,Z){return $!==void 0&&tZ1($)&&!Z}var ft4,bt4,ut4,xv;var OT0=L(()=>{k0();wZ();oJ();cH();o91();jU();IQ();TD();M5();eu();uJ();ft4=[{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"}],bt4=["title","description","status","priority","type","assigneeId","repo","dueDate","sortOrder","tagIds"];ut4=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:_G.object({id:_G.string(),title:_G.string().min(1).max(WA0).optional(),description:_G.string().max(KA0).nullable().optional(),status:hK.optional(),priority:jv.optional(),type:_a.optional(),assigneeId:_G.string().nullable().optional(),repo:_G.string().max(HA0).nullable().optional(),dueDate:_G.string().datetime().nullable().optional(),sortOrder:_G.number().optional(),tagIds:_G.array(_G.string()).max(1000).optional(),linkThreadId:_G.string().optional(),prUrl:_G.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:_G.object({item:hu}),handler:async($,Z)=>{s(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=yt4($),G=Y?await Z.storage.taskBoard.getById($.id,Q):null;if(Y&&!G)throw Error(`Task board item not found: ${$.id}`);if($.status!==void 0&&tZ1($.status)){let F=await Z.storage.organizationSettings.get(Q);if(S71($.status,LX(F?.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 J=UU.getStore()!==void 0;if(ct4($.status,G??void 0,J))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 K=$.assigneeId!==void 0&&$.assigneeId!==(G?.assigneeId??null),W=ht4($.assigneeId,G);if(G&&FY(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(W)await $u(Z,G,nL())}if($.tagIds!==void 0){let F=await Z.storage.tags.listOrgTags(Q),N=new Set(F.map((U)=>U.id));for(let U of $.tagIds)if(!N.has(U))throw Error(`Tag not found: ${U}`);await Z.storage.taskBoard.setItemTags($.id,$.tagIds,a0(Z))}let H;if(Y)H=await Z.storage.taskBoard.update($.id,Q,{title:$.title,description:$.description,status:W?"todo":$.status,priority:$.priority,type:$.type,assigneeId:$.assigneeId,assignedBy:K?$.assigneeId?a0(Z):null:void 0,repo:$.repo,dueDate:$.dueDate,sortOrder:$.sortOrder},a0(Z));else{let F=await Z.storage.taskBoard.getById($.id,Q);if(!F)throw Error(`Task board item not found: ${$.id}`);H=F}if(X)await Z.storage.taskBoard.linkPr({taskBoardItemId:H.id,organizationId:Q,url:X.url,prNumber:X.number,repoOwner:X.owner,repoName:X.repo,connectionId:null});if(G){let F=a0(Z),N=gt4(G,H);if(N.length>0)await gC$(Z,N.map((U)=>({taskBoardItemId:H.id,actorId:F,...U,alsoSubscribe:U.action==="assignee_changed"&&H.assigneeId!==G8?[H.assigneeId]:void 0})))}if(G&&H.description!==G.description)await Z.storage.notifications.notifyMentions({taskBoardItemId:H.id,organizationId:Q,actorId:a0(Z),body:H.description??"",previousBody:G.description});if(Y||$.linkThreadId||X)u$(Q,H);if(W)await fD(Z,H,{userInitiated:!0});return{item:H}}})});import{z as LT0}from"zod";var fv;var C71=L(()=>{k0();M5();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:LT0.object({id:LT0.string()}),outputSchema:LT0.object({success:LT0.boolean()}),handler:async($,Z)=>{s(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 p_$(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(lt4)}function lt4($){return $.some((Z)=>Z.merged===!0)&&$.every((Z)=>Z.merged===!0||Z.state==="closed")}async function mt4($,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(W)=>({...W,...await X($,Z,W)})));if(!bv(J))return!1;let K=await $.storage.taskBoard.update(Q,Z,{status:"archived"},Y.updatedBy);return await M6($,{taskBoardItemId:Q,action:"status_changed",actorId:null,data:{from:"done",to:"archived",reason:"merged_pr_auto_archive"}}),u$(Z,K),!0}async function $v$($,Z,Q,X=wT0){let Y=0;for(let G of Q)try{if(await mt4($,Z,G,X))Y+=1}catch(J){console.error(`[task-board-archive] ${G} failed`,J)}return{archived:Y}}function DT0($){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 Gc=L(()=>{IQ();vG();M5()});function dt4($){let Z=new Map($.map((G)=>[G.id,G])),Q=new Map;for(let G of gu($)){let J=Zv$(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 ET0($,Z){if(!IZ0())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=dt4(Q);if(X)return{repo:X};let Y=new Map;for(let J of gu(Q)){let K=Zv$(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 Qv$($,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)X.push("","Description:",$.description);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. ${Rr}`:["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(`
|
|
2832
|
-
`),""),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.","- 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(`
|
|
2832
|
+
`),""),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(`
|
|
2833
2833
|
`)}var Zv$=($,Z)=>`${$}/${Z}`.toLowerCase();var _71=L(()=>{YA0();JY();h6();R$()});import{createHmac as it4,randomBytes as pt4,timingSafeEqual as nt4}from"crypto";function tt4(){if(jT0)return jT0;let $;try{let Z=y0();$=Z.studioJwtSecret??Z.betterAuthSecret}catch{$=void 0}return jT0=$?Buffer.from($):pt4(32),jT0}function v71($,Z,Q){return`rtok_${it4("sha256",tt4()).update(`${$}:${Z}:${Q.toISOString()}`).digest("base64url")}`}function Xv$($,Z,Q,X){let Y=Buffer.from($),G=Buffer.from(v71(Z,Q,X));return Y.length===G.length&&nt4(Y,G)}var jT0=null;var x71=L(()=>{R$()});import{createHash as ot4}from"crypto";function $s($,Z){if($.status===null||Yv$.has($.status))return!1;return!da({updated_at:$.lastActiveAt,last_progress_at:null},Z)}function rt4($,Z){return $.threads.some((Q)=>!zH.some((X)=>iL(Q.title,X))&&$s(Q,Z))}function et4($,Z){return Z-$>=st4}async function zT0($,Z,Q){let X=await $.storage.organizationSettings.get(Z.organizationId),Y=tN(X?.flags);if(Y.length===0)return;if(rt4(Z,Date.now()))return;let G=LX(X?.flags,"cheap_reviewer_model")?"reviewer":"default",J=await $.storage.taskBoard.listActivity(Z.id,Z.organizationId),K=Z.reviewCycleStartedAt,W=oN(J,K),H=new Date(W),F=pL(J,{cycleStartedAt:K});await Promise.all(Y.map(async(N)=>{let U=F.has(N);if(!U){let O=Jo4(J,W),D=Go4(Z,N,W,O);if(D){await Fo4($,Z,N,D).catch((w)=>console.error(`[task-board] ${N} verdict nudge failed`,w));return}if(Wo4(O,Date.now()))return}if(Xo4(Z,N,W,Date.now(),U)){await dH($,Z,`${PH[N]} failed ${f71} times on `+"this review \u2014 it will not be retried");return}if(Q?.previewMatchesHead===!1){if(et4(W,Date.now()))await dH($,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(Yo4(Z,N,W,Date.now(),U))return;let B=$o4(Z,N,W,Date.now(),U);await Bo4($,Z,N,H,B,G).catch((O)=>console.error(`[task-board] ${N} reviewer enqueue failed`,O))}))}function $o4($,Z,Q,X=Date.now(),Y=!0){return $.threads.filter((G)=>iL(G.title,Z)&&b71(G,X,Y)&&new Date(G.createdAt).getTime()>=Q).length}function Zo4($,Z){if(!$||!Z||!("choices"in Z))return null;return Z.choices.find((Q)=>Q.repo===$)?.connectionId??null}function Qo4($,Z,Q){let X=$.threads.filter((Y)=>iL(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 b71($,Z,Q=!0){if($.status==="failed")return!0;if($.status!==null&&Yv$.has($.status))return!Q;return $.status!==null&&!$s($,Z)}function Gv$($,Z,Q,X=Date.now()){return $.threads.filter((Y)=>{if(!iL(Y.title,Z))return!1;return $s(Y,X)||new Date(Y.createdAt).getTime()>=Q})}function Xo4($,Z,Q,X=Date.now(),Y=!0){let G=Gv$($,Z,Q,X);return G.length>0&&G.every((J)=>b71(J,X,Y))&&G.length>=f71}function Yo4($,Z,Q,X=Date.now(),Y=!0){let G=Gv$($,Z,Q,X);if(G.length===0)return!1;if(G.some((K)=>$s(K,X)))return!0;let J=G.filter((K)=>b71(K,X,Y));if(J.length>=f71)return!0;return J.length!==G.length}function Go4($,Z,Q,X,Y=Date.now()){return $.threads.find((G)=>iL(G.title,Z)&&G.status==="completed"&&!$s(G,Y)&&new Date(G.createdAt).getTime()>=Q&&!X.has(G.threadId))??null}function Jo4($,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 Wo4($,Z){for(let Q of $.values())if(Z-Q<Ko4)return!0;return!1}function Ho4($){return[`Your ${PH[$]} 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(`
|
|
2834
2834
|
`)}async function Fo4($,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 ru($,Z,Y,{messageId:`review-verdict-${X.threadId}`,prompt:Ho4(Q),workflowID:`review-verdict:${X.threadId}`,runClass:"reviewer"})}function No4($,Z,Q,X){return`review:${$}:${Z}:${Q.toISOString()}:${X}`}function Uo4($){return`thrd_${ot4("sha256").update($).digest("hex").slice(0,32)}`}async function Bo4($,Z,Q,X,Y,G){let J=Z.organizationId,K=v71(Z.id,Q,X),W=await ET0($,J),H=W&&"repo"in W?W.repo:null,F=W!==null,N=Qo4(Z,Q,X.getTime()),U=Zo4(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=[at4[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(`
|
|
2835
2835
|
`),j=[...F?[]:[E,""],`Task title: ${Z.title}`,Z.description?`
|