decocms 4.294.2 → 4.294.4
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-qZDg2e-H.js → AlertCircle-COfoHlYo.js} +1 -1
- package/dist/client/assets/{AreaChart-D1rWRcUm.js → AreaChart-k1GdGLk3.js} +1 -1
- package/dist/client/assets/{ArrowLeft-CatEVOI7.js → ArrowLeft-DvfIRo1L.js} +1 -1
- package/dist/client/assets/{ArrowUp-DMDdMhAA.js → ArrowUp-CukalgWz.js} +1 -1
- package/dist/client/assets/{Check-C5RWnyNL.js → Check-CQfGOUkn.js} +1 -1
- package/dist/client/assets/{CheckCircle-V0GvWvtd.js → CheckCircle-B5B8UVD6.js} +1 -1
- package/dist/client/assets/{ChevronDown-CeGZsBnS.js → ChevronDown-DJW5HhkM.js} +1 -1
- package/dist/client/assets/{ChevronRight-Dh8_6pj1.js → ChevronRight-CdylS1le.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-Im3Lz_4E.js → ChevronSelectorVertical-DjiLaY0h.js} +1 -1
- package/dist/client/assets/{ChevronUp-DCx43qHY.js → ChevronUp-DOnt1lNa.js} +1 -1
- package/dist/client/assets/{Copy01-DhfruII6.js → Copy01-DT_VNucR.js} +1 -1
- package/dist/client/assets/{CreditCard01-Cy0s6gAf.js → CreditCard01-Bi19p04V.js} +1 -1
- package/dist/client/assets/{DotsVertical-B39kxqbi.js → DotsVertical-veJCsKg6.js} +1 -1
- package/dist/client/assets/{Download01-C1FmC7JV.js → Download01-BC66vxkd.js} +1 -1
- package/dist/client/assets/{Eye-m8QZKf2Y.js → Eye-DhvNNTcF.js} +1 -1
- package/dist/client/assets/{FilterLines-BBF-m2ZJ.js → FilterLines-DCFzTCRB.js} +1 -1
- package/dist/client/assets/{Globe01-C2F_PPuX.js → Globe01-CnIzUI9D.js} +1 -1
- package/dist/client/assets/{Globe04-CMCnFTSr.js → Globe04-DtNi2ZyL.js} +1 -1
- package/dist/client/assets/{HardDrive-DmqNZKD8.js → HardDrive-CLNcCFxS.js} +1 -1
- package/dist/client/assets/{Key01-DbCU9LZF.js → Key01-28MkH09O.js} +1 -1
- package/dist/client/assets/{LinkExternal01-kQnRXU4w.js → LinkExternal01-BmdVn0um.js} +1 -1
- package/dist/client/assets/{LockUnlocked01-D5OpQeQe.js → LockUnlocked01-xbaMcbOK.js} +1 -1
- package/dist/client/assets/{LogOut01-BePTyd5L.js → LogOut01-CUumDUY-.js} +1 -1
- package/dist/client/assets/{Monitor01-DPqlemzQ.js → Monitor01-DnWcZI3D.js} +1 -1
- package/dist/client/assets/{Palette-DzT0S9Gl.js → Palette-BbL1PNN-.js} +1 -1
- package/dist/client/assets/{Play-Btu3v5FX.js → Play-DWeLA7lK.js} +1 -1
- package/dist/client/assets/{Plus-B7vTVmKH.js → Plus-DEP38EYY.js} +1 -1
- package/dist/client/assets/{SearchLg-CAAIuTYj.js → SearchLg-BO_-rqE7.js} +1 -1
- package/dist/client/assets/{SearchMd-COQJLRw-.js → SearchMd-B7xHuJq4.js} +1 -1
- package/dist/client/assets/{Settings02-xEBQxvJD.js → Settings02-DE8fnfTk.js} +1 -1
- package/dist/client/assets/{Share07-CLkT7SlV.js → Share07-Bk8835lK.js} +1 -1
- package/dist/client/assets/{Shield01-C2USnj9G.js → Shield01-BUK8VCxJ.js} +1 -1
- package/dist/client/assets/{Stars01-DkoqcM4j.js → Stars01-C5onyQkg.js} +1 -1
- package/dist/client/assets/{Stars02-4GZ9SjIq.js → Stars02-b1P1T_48.js} +1 -1
- package/dist/client/assets/{Sun-D0KW7MLF.js → Sun-B_-yVQ2_.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-DwxljZOI.js → SwitchHorizontal01-rtsYQduN.js} +1 -1
- package/dist/client/assets/{Tool01-tn2PFBHQ.js → Tool01-BMVX3tOF.js} +1 -1
- package/dist/client/assets/{Tool02-BalBR7uK.js → Tool02-WBvKkURX.js} +1 -1
- package/dist/client/assets/{Trash01-CwqV1gzD.js → Trash01-CiqyPob_.js} +1 -1
- package/dist/client/assets/{TrendUp01-6TR_k_0Y.js → TrendUp01-CahTnQ2p.js} +1 -1
- package/dist/client/assets/{Upload01-mqAHBbZV.js → Upload01-CWR5PH57.js} +1 -1
- package/dist/client/assets/{User01-DWaPmCwS.js → User01-S_RGxi2I.js} +1 -1
- package/dist/client/assets/{UserSquare-ClSByuB-.js → UserSquare-nHDcwF_u.js} +1 -1
- package/dist/client/assets/{Users01-CFDNbxgJ.js → Users01-OC7kfFvk.js} +1 -1
- package/dist/client/assets/{Users03-BT3gPqQL.js → Users03-CasZyOXJ.js} +1 -1
- package/dist/client/assets/{XCircle-BOrCVYLf.js → XCircle-BrD26F_t.js} +1 -1
- package/dist/client/assets/{XClose-DMSeuF30.js → XClose-DbkY8wiR.js} +1 -1
- package/dist/client/assets/{YAxis-CjueDU_j.js → YAxis-DrMnrLGw.js} +1 -1
- package/dist/client/assets/{Zap-CwYGo5D6.js → Zap-uo4AxzhY.js} +1 -1
- package/dist/client/assets/{ZapSquare-DkKtoQ7W.js → ZapSquare-BXyJZB2H.js} +1 -1
- package/dist/client/assets/{access-gate-DXIgG9H-.js → access-gate-Doy8MTWW.js} +1 -1
- package/dist/client/assets/{agent-icon-C9_7Msf7.js → agent-icon-BK-LdAbb.js} +1 -1
- package/dist/client/assets/{agents-list-CrYr2LdT.js → agents-list-BExPOUFd.js} +1 -1
- package/dist/client/assets/{ai-providers-9B822Ytz.js → ai-providers-ByfOx-iG.js} +1 -1
- package/dist/client/assets/{alert-DeOSO_Ec.js → alert-DHk1Duu5.js} +1 -1
- package/dist/client/assets/{alert-dialog-BWONJIzw.js → alert-dialog-EuQzy5n4.js} +1 -1
- package/dist/client/assets/{api-keys-BHGQjiZT.js → api-keys-CkO4l_xX.js} +1 -1
- package/dist/client/assets/{app-editor-GCmyfLNC.js → app-editor-BqXRQEpA.js} +1 -1
- package/dist/client/assets/{auth-BqxUQw-v.js → auth-Ck-CYI0s.js} +1 -1
- package/dist/client/assets/{auth-catchall-q5v2tPZU.js → auth-catchall-Bwnt6nAM.js} +1 -1
- package/dist/client/assets/{auth-entry-Dx-_gZ2g.js → auth-entry-xKtC3zLP.js} +1 -1
- package/dist/client/assets/{auth-split-layout-YdeWuYN1.js → auth-split-layout-BQ1bEHAM.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-DRVU48ic.js → authenticate-and-persist-oauth-Bnxs7yjQ.js} +1 -1
- package/dist/client/assets/{automation-list-row-BMiRTeOK.js → automation-list-row-CbU006h8.js} +1 -1
- package/dist/client/assets/{automation-runs-CzcGADVN.js → automation-runs-DJXgmGit.js} +1 -1
- package/dist/client/assets/{automations-DDnrk0LJ.js → automations-4WtbAMRr.js} +1 -1
- package/dist/client/assets/{avatar-1XE5IjoT.js → avatar-BGhjOwGM.js} +1 -1
- package/dist/client/assets/{badge-CXIV4O-0.js → badge-Db5xIffE.js} +1 -1
- package/dist/client/assets/{block-document-BufBxpL6.js → block-document-BreIOxf_.js} +1 -1
- package/dist/client/assets/{breadcrumb-FUX_wv57.js → breadcrumb-yuTxiBYX.js} +1 -1
- package/dist/client/assets/{buckets-DQPGFSM3.js → buckets-DpGmU5zM.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-CNgfZPUK.js → bulk-category-panel--UILFV7T.js} +1 -1
- package/dist/client/assets/{capability-load-error-BKGEHfpt.js → capability-load-error-D0M3HC9t.js} +1 -1
- package/dist/client/assets/{cards-DJSm_nho.js → cards-DjdS8mnO.js} +1 -1
- package/dist/client/assets/{category-editor-ByRsnfkE.js → category-editor-BVw0za2r.js} +1 -1
- package/dist/client/assets/{chart-Bgue_7DQ.js → chart-CsLoGKFV.js} +1 -1
- package/dist/client/assets/{chat-context-C-BdNZCf.js → chat-context-BaV72O1g.js} +1 -1
- package/dist/client/assets/{checkbox-DvC3nAT5.js → checkbox-YMTFrO1r.js} +1 -1
- package/dist/client/assets/{choose-editor-CFBXNqp3.js → choose-editor-BlU5Wexq.js} +1 -1
- package/dist/client/assets/{cli-auth-success-CUav6RQy.js → cli-auth-success-z65wjSmk.js} +1 -1
- package/dist/client/assets/{collection-detail-LByozjyF.js → collection-detail-Bqyrlcae.js} +1 -1
- package/dist/client/assets/{collection-display-button-D4ItaSc8.js → collection-display-button-CUsSTflP.js} +1 -1
- package/dist/client/assets/{collection-search-DBnGb4Zg.js → collection-search-CiPLUXMb.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-DCUZlFkx.js → collection-table-wrapper-ClqU84Kc.js} +1 -1
- package/dist/client/assets/{collection-tabs-CAUEdmSI.js → collection-tabs-B32iAo6N.js} +1 -1
- package/dist/client/assets/{command-Ct_4mokr.js → command-DOfXQ3iQ.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-C2UgJ-TR.js → commerce-onboarding-BhfT16ic.js} +1 -1
- package/dist/client/assets/{config-DG69PD1X.js → config-sObTbFZQ.js} +1 -1
- package/dist/client/assets/{connect-DLRRtQi0.js → connect-C5xAKAEp.js} +1 -1
- package/dist/client/assets/{connection-Dg1mnPcO.js → connection-RGa3bMYb.js} +1 -1
- package/dist/client/assets/{connection-card-CgUgSGsh.js → connection-card-CaXPkEtx.js} +1 -1
- package/dist/client/assets/{connection-detail-CAhXUEiD.js → connection-detail-j6Hg2C9_.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-gU6TF210.js → connection-form-helpers-CAJu7GAu.js} +1 -1
- package/dist/client/assets/{connections-tQk1fh_m.js → connections-BFlBx3eR.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-DDszDk42.js → decopilot-sse-pool-RJKXQFNl.js} +1 -1
- package/dist/client/assets/{dialog-DYg0AoO0.js → dialog-v9lm8kV3.js} +1 -1
- package/dist/client/assets/{domain-settings-xR7ZmjBb.js → domain-settings-DtzQhB08.js} +1 -1
- package/dist/client/assets/{drawer-DrqU_8fl.js → drawer-DBmJy2OH.js} +1 -1
- package/dist/client/assets/{dropdown-menu-BGreHXNg.js → dropdown-menu-kAhQsmIq.js} +1 -1
- package/dist/client/assets/{empty-state-DNKOHljA.js → empty-state-DGfgLPT9.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BI_gbc3h.js → extract-connection-data-BPW_Djea.js} +1 -1
- package/dist/client/assets/{file-explorer-D9_-DWtI.js → file-explorer-D9vNN4Ai.js} +1 -1
- package/dist/client/assets/{file-type-icon-Cr_jiDFe.js → file-type-icon-Cp2yVzTz.js} +1 -1
- package/dist/client/assets/{form-DUYaeuN1.js → form-KfWVSNEC.js} +1 -1
- package/dist/client/assets/{general-CVMzbMNL.js → general-Cq15YFKz.js} +1 -1
- package/dist/client/assets/{github-repo-picker-BjTlfZRh.js → github-repo-picker-BgSzUzWL.js} +1 -1
- package/dist/client/assets/{hooks-DvV-YCly.js → hooks-ndMd0rOE.js} +1 -1
- package/dist/client/assets/{index-CgA3qf5E.js → index-AYOlfrqu.js} +1 -1
- package/dist/client/assets/{index-BOALwCeh.js → index-BAkM-bvY.js} +1 -1
- package/dist/client/assets/{index-Bk7mmffp.js → index-BLOTG8F6.js} +1 -1
- package/dist/client/assets/{index-pYJ2-T-r.js → index-BMtomEba.js} +1 -1
- package/dist/client/assets/{index-BWVLjCpL.js → index-BUlvC5Z0.js} +6 -6
- package/dist/client/assets/{index-RXRS2M8q.js → index-Cvq1ebr1.js} +1 -1
- package/dist/client/assets/{index-CxsfTXSQ.js → index-DkH2JDxv.js} +1 -1
- package/dist/client/assets/{index-CXtbLiKC.js → index-Gwx_pD8S.js} +1 -1
- package/dist/client/assets/{index-DHLutK6v.js → index-kc-p0Tho.js} +3 -3
- package/dist/client/assets/{index-redirect-CUFx5Ci3.js → index-redirect-Dtrld574.js} +1 -1
- package/dist/client/assets/{infra-billing-C7HR_T7J.js → infra-billing-CiXyqP0z.js} +1 -1
- package/dist/client/assets/{input-zNG5Uz1T.js → input-CoA1YEYW.js} +1 -1
- package/dist/client/assets/{integration-icon-CVsQlE88.js → integration-icon-Db_3_1Xt.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-BocroOxJ.js → invite-member-dialog--rStSant.js} +1 -1
- package/dist/client/assets/{label-CEq9oqa2.js → label-COrU7OvG.js} +1 -1
- package/dist/client/assets/{layout-DFoH_xu7.js → layout-Dw5HsV5p.js} +1 -1
- package/dist/client/assets/{login-DQ-omlrv.js → login-zSNYYLrC.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DGSZYZtZ.js → mcp-oauth-KDpSMvkd.js} +1 -1
- package/dist/client/assets/{members-1vFWUjqy.js → members-DBUg3WK3.js} +1 -1
- package/dist/client/assets/{monaco-editor-BIUU4YtT.js → monaco-editor-C37CkGWQ.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-Drb7zrQ3.js → monitoring-stats-row-4aj-ddP2.js} +1 -1
- package/dist/client/assets/{multi-select-CeA0LiDA.js → multi-select-CNe6aWif.js} +1 -1
- package/dist/client/assets/{oauth-callback-BLBnsV0m.js → oauth-callback-CplvzY-h.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-_ZIgbe1k.js → oauth-callback-ai-provider-xi9UFQxQ.js} +1 -1
- package/dist/client/assets/{onboarding-DHEpPKxX.js → onboarding-D0Phxs-H.js} +1 -1
- package/dist/client/assets/{org-layout-CZwey9tp.js → org-layout-BMiLJodT.js} +1 -1
- package/dist/client/assets/{organization-choice-CinweDu8.js → organization-choice-BM0bUwZh.js} +1 -1
- package/dist/client/assets/{orgs-Cewt5f_m.js → orgs-B3KfLtXg.js} +1 -1
- package/dist/client/assets/{page-seo-form-DCXZwoTq.js → page-seo-form-B-kTujwr.js} +1 -1
- package/dist/client/assets/{popover-CPDUuAsK.js → popover-B0YbN5z6.js} +1 -1
- package/dist/client/assets/{post-calendar-B2MLz9zN.js → post-calendar-Dtrz1ddb.js} +1 -1
- package/dist/client/assets/{post-editor-xPbcpUyS.js → post-editor-DsQuK9Oa.js} +1 -1
- package/dist/client/assets/{primitives-bdzFl9KQ.js → primitives-Xx0pIitg.js} +1 -1
- package/dist/client/assets/{profile-DRVuFWo1.js → profile-DytMpCX8.js} +1 -1
- package/dist/client/assets/{project-app-view-C0-tH6m6.js → project-app-view-CgtJDq_r.js} +1 -1
- package/dist/client/assets/{prompts-DHayAFpv.js → prompts-DGB_aYxK.js} +1 -1
- package/dist/client/assets/record-editor-BKnPZeAl.js +1 -0
- package/dist/client/assets/{redirect-editor-OElGvzsY.js → redirect-editor-5tWecuOB.js} +1 -1
- package/dist/client/assets/registry-BH-InggM.js +2 -0
- package/dist/client/assets/{registry-layout-BTzECwAf.js → registry-layout-BObW66Mi.js} +1 -1
- package/dist/client/assets/{reports-BlhyDDdZ.js → reports-BKQhqTCw.js} +1 -1
- package/dist/client/assets/{require-capability-BJjD7GXa.js → require-capability-B-toWf1T.js} +1 -1
- package/dist/client/assets/{required-auth-layout-Bi3hMcfQ.js → required-auth-layout-CPEZLxXW.js} +1 -1
- package/dist/client/assets/{reset-password-BLXOXnD3.js → reset-password-B2xsPOz7.js} +1 -1
- package/dist/client/assets/{review-settings-0bpnzbvB.js → review-settings-CQcW0UJP.js} +1 -1
- package/dist/client/assets/{roles-C9DLuLWB.js → roles-BahMe3Yj.js} +1 -1
- package/dist/client/assets/{scroll-area-Dw0578rC.js → scroll-area-Dy82C7p_.js} +1 -1
- package/dist/client/assets/{search-input-lOvS7ZZY.js → search-input-BupwGxLP.js} +1 -1
- package/dist/client/assets/{secrets-DEtSas2W.js → secrets-CMSdKJ02.js} +1 -1
- package/dist/client/assets/{sections-editor-DDSHgrQf.js → sections-editor-K0jU5DNu.js} +1 -1
- package/dist/client/assets/{select-W8jorDji.js → select-DwECBvqm.js} +1 -1
- package/dist/client/assets/{select-model-CVJuTB71.js → select-model-D3_B27r5.js} +1 -1
- package/dist/client/assets/{self-tool-result-DYCZ2dxI.js → self-tool-result-BWeTClq7.js} +1 -1
- package/dist/client/assets/{seo-editor-CqSjFrJe.js → seo-editor-Bv2R8igF.js} +1 -1
- package/dist/client/assets/{settings-layout-Cj60dDE0.js → settings-layout-BdmXRuID.js} +1 -1
- package/dist/client/assets/{shell-controls-CcajpdEy.js → shell-controls-Be5eyBnD.js} +1 -1
- package/dist/client/assets/{shell-layout-BbKgiGKQ.js → shell-layout-Btlvd1G3.js} +1 -1
- package/dist/client/assets/{spinner-DEaGcbnH.js → spinner-Ba0CkhBN.js} +1 -1
- package/dist/client/assets/{sso-DFyPw3S-.js → sso-zfNVjVfI.js} +1 -1
- package/dist/client/assets/{store-B-DY1jsG.js → store-CgKz3-lQ.js} +1 -1
- package/dist/client/assets/store-registry-CXJ_5Ae5.js +2 -0
- package/dist/client/assets/{super-agent-icon-DxowWKwv.js → super-agent-icon-f5MMUEZI.js} +1 -1
- package/dist/client/assets/{switch-BsAR0Ue8.js → switch-CvaUzcu8.js} +1 -1
- package/dist/client/assets/{synced-repos-BxJ8BZWX.js → synced-repos-VI3iwOU2.js} +1 -1
- package/dist/client/assets/{table-RKi74_kY.js → table-CNWQQ1ny.js} +1 -1
- package/dist/client/assets/{tabs-DFRRVuh7.js → tabs---ylShNh.js} +1 -1
- package/dist/client/assets/{task-board-D9PHUZff.js → task-board-d9aI3xON.js} +1 -1
- package/dist/client/assets/{tasks-CiijDgSs.js → tasks-CqsZedy1.js} +1 -1
- package/dist/client/assets/{textarea-XbuS70jj.js → textarea-CvXIGUrZ.js} +1 -1
- package/dist/client/assets/{toggle-group-WZyFFujP.js → toggle-group-9H7MENld.js} +1 -1
- package/dist/client/assets/{toolbar-CmaLqa3-.js → toolbar-CFGjTZKp.js} +1 -1
- package/dist/client/assets/{track-BFh4WctH.js → track-rDKtvIJ6.js} +1 -1
- package/dist/client/assets/{types-CrdXjhQP.js → types-BR-rJmTQ.js} +1 -1
- package/dist/client/assets/{use-ai-providers-WmO5B1wa.js → use-ai-providers-D-DLX2r-.js} +1 -1
- package/dist/client/assets/{use-api-keys-CHuWewKt.js → use-api-keys-Ba1kau-j.js} +1 -1
- package/dist/client/assets/{use-automations-g--nS4Go.js → use-automations-DCQErfJY.js} +1 -1
- package/dist/client/assets/{use-autosave-BsqWx81g.js → use-autosave-COQ2KNxK.js} +1 -1
- package/dist/client/assets/{use-connection-D8j2CnOC.js → use-connection-DN4iufew.js} +1 -1
- package/dist/client/assets/{use-copy-lK-vhEre.js → use-copy-BrNQw893.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-Bdpos1w0.js → use-create-virtual-mcp-mTrVU1Cr.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-DsCulVkO.js → use-debounced-autosave-C96mZ7FL.js} +1 -1
- package/dist/client/assets/{use-debounced-value-D5wCJf5h.js → use-debounced-value-w4-tTzSs.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-CEhAvB_E.js → use-decopilot-events-DQphD5G3.js} +1 -1
- package/dist/client/assets/{use-delete-connection-BAty9GWK.js → use-delete-connection-B2YaAVmg.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-CD-qM4Qw.js → use-deployment-admin-ChQMmdpu.js} +1 -1
- package/dist/client/assets/{use-destination-route-BMJNYrmL.js → use-destination-route-DwR5EZdM.js} +1 -1
- package/dist/client/assets/{use-file-configs-CEny8PB8.js → use-file-configs-BQA5pT_r.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DzHJHyr0.js → use-infinite-scroll-xFY_A5TW.js} +1 -1
- package/dist/client/assets/{use-join-requests-z_I5qiFl.js → use-join-requests-BVeSRkzW.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-dyqIaOq0.js → use-mcp-auth-status-g4f-5p6M.js} +1 -1
- package/dist/client/assets/{use-mcp-client-Bac4vccq.js → use-mcp-client-C2WpJqGp.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-FenH0JaE.js → use-mcp-tools-D2jDyaSa.js} +1 -1
- package/dist/client/assets/{use-members-_2HCzEHc.js → use-members-D3qbSIYx.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-yAkGdje4.js → use-navigate-to-agent-BnGGkvww.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-Cb5lYh1t.js → use-org-auth-client-6ydcGnsW.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-DbzFw6wJ.js → use-org-repo-syncs-ioAfxmUp.js} +1 -1
- package/dist/client/assets/{use-org-sso-cefqXe6X.js → use-org-sso-DMKUn11x.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DA6OSxjH.js → use-organization-roles-JJdzyzc2.js} +1 -1
- package/dist/client/assets/{use-organization-settings-BsgcrCz-.js → use-organization-settings-BqyTxtql.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-C8-xot4V.js → use-panel-navigate-DSXuFDWh.js} +1 -1
- package/dist/client/assets/{use-registry-connections-BoC6e9Ko.js → use-registry-connections-owrgLOps.js} +1 -1
- package/dist/client/assets/{use-secrets-CNOFekf-.js → use-secrets-D8LOTarp.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-CFAiIdAN.js → use-section-preview-base-BWjBzoZV.js} +1 -1
- package/dist/client/assets/{use-status-sounds-CdtGOM4G.js → use-status-sounds-BxmwD3Ts.js} +1 -1
- package/dist/client/assets/{use-tags-CnmdA4eJ.js → use-tags-CsnYBdZ3.js} +1 -1
- package/dist/client/assets/{use-view-mode-DHrNQrCI.js → use-view-mode-Ce8VSwQi.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-X7MaI4-V.js → use-virtual-mcp-C1lgXcOb.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-PqMaSXlJ.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-BO55lV73.js +1 -0
- package/dist/client/assets/{users-CNOqKONO.js → users-WlHHd84i.js} +1 -1
- package/dist/client/assets/{variant-calendar-DzbjSxwP.js → variant-calendar-BbU1vB51.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-C_beZllv.js → view-mode-toggle-SNjppYRr.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +3 -3
- package/dist/server/server.js +3 -3
- package/package.json +1 -1
- package/dist/client/assets/record-editor-BabiokFj.js +0 -1
- package/dist/client/assets/registry-Bpp0Gik6.js +0 -2
- package/dist/client/assets/store-registry-CW8CS7Je.js +0 -2
- package/dist/client/assets/useInfiniteQuery-CP11XfQS.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-vPet_vok.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-DHLutK6v.js";import{r as gt,a6 as at,aF as bt}from"./agent-icon-C9_7Msf7.js";import{i as vt}from"./ChevronRight-Dh8_6pj1.js";import{L as yt}from"./label-CEq9oqa2.js";import{S as lt}from"./scroll-area-Dw0578rC.js";import{S as jt}from"./switch-BsAR0Ue8.js";import{V as Tt}from"./view-mode-toggle-C_beZllv.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-BWVLjCpL.js";import"./AlertCircle-qZDg2e-H.js";import"./UserSquare-ClSByuB-.js";import"./Tool01-tn2PFBHQ.js";import"./ArrowUp-DMDdMhAA.js";import"./ArrowLeft-CatEVOI7.js";import"./Tool02-BalBR7uK.js";import"./XCircle-BOrCVYLf.js";import"./TrendUp01-6TR_k_0Y.js";import"./ZapSquare-DkKtoQ7W.js";import"./Users03-BT3gPqQL.js";import"./CheckCircle-V0GvWvtd.js";import"./Check-C5RWnyNL.js";import"./ChevronDown-CeGZsBnS.js";import"./ChevronSelectorVertical-Im3Lz_4E.js";import"./ChevronUp-DCx43qHY.js";import"./DotsVertical-B39kxqbi.js";import"./Stars02-4GZ9SjIq.js";import"./Copy01-DhfruII6.js";import"./CreditCard01-Cy0s6gAf.js";import"./Download01-C1FmC7JV.js";import"./Settings02-xEBQxvJD.js";import"./Eye-m8QZKf2Y.js";import"./FilterLines-BBF-m2ZJ.js";import"./Share07-CLkT7SlV.js";import"./Globe01-C2F_PPuX.js";import"./Globe04-CMCnFTSr.js";import"./SwitchHorizontal01-DwxljZOI.js";import"./HardDrive-DmqNZKD8.js";import"./Key01-DbCU9LZF.js";import"./LinkExternal01-kQnRXU4w.js";import"./LockUnlocked01-D5OpQeQe.js";import"./LogOut01-BePTyd5L.js";import"./Monitor01-DPqlemzQ.js";import"./Sun-D0KW7MLF.js";import"./Palette-DzT0S9Gl.js";import"./Play-Btu3v5FX.js";import"./Plus-B7vTVmKH.js";import"./SearchLg-CAAIuTYj.js";import"./SearchMd-COQJLRw-.js";import"./Shield01-C2USnj9G.js";import"./Stars01-DkoqcM4j.js";import"./Trash01-CwqV1gzD.js";import"./Upload01-mqAHBbZV.js";import"./User01-DWaPmCwS.js";import"./Users01-CFDNbxgJ.js";import"./XClose-DMSeuF30.js";import"./Zap-CwYGo5D6.js";import"./select-W8jorDji.js";import"./chat-context-C-BdNZCf.js";import"./use-panel-navigate-C8-xot4V.js";import"./dialog-DYg0AoO0.js";import"./use-destination-route-BMJNYrmL.js";import"./constants-dLUUoWH7.js";import"./session-runtime-wVXsCwcJ.js";import"./hooks-DvV-YCly.js";import"./use-mcp-client-Bac4vccq.js";import"./auth-BqxUQw-v.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-DDszDk42.js";import"./task-board-D9PHUZff.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-X7MaI4-V.js";import"./use-ai-providers-WmO5B1wa.js";import"./use-decopilot-events-CEhAvB_E.js";import"./use-organization-settings-BsgcrCz-.js";import"./automation-runs-CzcGADVN.js";import"./useInfiniteQuery-CP11XfQS.js";import"./use-infinite-scroll-DzHJHyr0.js";import"./use-connection-D8j2CnOC.js";import"./table-RKi74_kY.js";import"./empty-state-DNKOHljA.js";import"./use-members-_2HCzEHc.js";import"./use-org-auth-client-Cb5lYh1t.js";import"./use-automations-g--nS4Go.js";import"./useSuspenseInfiniteQuery-vPet_vok.js";import"./avatar-1XE5IjoT.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-lK-vhEre.js";import"./monaco-editor-BIUU4YtT.js";import"./spinner-DEaGcbnH.js";import"./types-CrdXjhQP.js";import"./shell-layout-BbKgiGKQ.js";import"./required-auth-layout-Bi3hMcfQ.js";import"./use-org-sso-cefqXe6X.js";import"./integration-icon-CVsQlE88.js";import"./use-navigate-to-agent-yAkGdje4.js";import"./chart-Bgue_7DQ.js";import"./index-pYJ2-T-r.js";import"./form-DUYaeuN1.js";import"./input-zNG5Uz1T.js";import"./file-type-icon-Cr_jiDFe.js";import"./drawer-DrqU_8fl.js";import"./collection-search-DBnGb4Zg.js";import"./tabs-DFRRVuh7.js";import"./toggle-group-WZyFFujP.js";import"./super-agent-icon-DxowWKwv.js";import"./self-tool-result-DYCZ2dxI.js";import"./alert-dialog-BWONJIzw.js";import"./extract-connection-data-BI_gbc3h.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-CMPWtdMv.js";import"./use-debounced-value-D5wCJf5h.js";import"./authenticate-and-persist-oauth-DRVU48ic.js";import"./mcp-oauth-DGSZYZtZ.js";import"./track-BFh4WctH.js";import"./popover-CPDUuAsK.js";import"./toolbar-CmaLqa3-.js";import"./github-repo-picker-BjTlfZRh.js";import"./use-mcp-tools-FenH0JaE.js";import"./agent-capabilities-B52k7xCe.js";import"./connection-card-CgUgSGsh.js";import"./use-registry-connections-BoC6e9Ko.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-XbuS70jj.js";import"./connection-form-helpers-gU6TF210.js";import"./collection-tabs-CAUEdmSI.js";import"./badge-CXIV4O-0.js";import"./select-model-CVJuTB71.js";import"./checkbox-DvC3nAT5.js";import"./ai-providers-logos-DD3qZ33J.js";import"./cards-DJSm_nho.js";import"./dropdown-menu-BGreHXNg.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-CdtGOM4G.js";import"./use-file-configs-CEny8PB8.js";import"./pt-BR-CLy76QW2.js";import"./use-debounced-autosave-DsCulVkO.js";import"./search-input-lOvS7ZZY.js";import"./use-mcp-auth-status-dyqIaOq0.js";import"./use-secrets-CNOFekf-.js";import"./AreaChart-D1rWRcUm.js";import"./config-DG69PD1X.js";import"./breadcrumb-FUX_wv57.js";import"./command-Ct_4mokr.js";import"./index-RXRS2M8q.js";import"./get-initials-D-f_fDFw.js";import"./use-tags-CnmdA4eJ.js";import"./automation-list-row-BMiRTeOK.js";import"./site-error--i37Vnuw.js";import"./use-org-repo-syncs-DbzFw6wJ.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 Yn(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{Yn 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-kc-p0Tho.js";import{r as gt,a6 as at,aF as bt}from"./agent-icon-BK-LdAbb.js";import{i as vt}from"./ChevronRight-CdylS1le.js";import{L as yt}from"./label-COrU7OvG.js";import{S as lt}from"./scroll-area-Dy82C7p_.js";import{S as jt}from"./switch-CvaUzcu8.js";import{V as Tt}from"./view-mode-toggle-SNjppYRr.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-BUlvC5Z0.js";import"./AlertCircle-COfoHlYo.js";import"./UserSquare-nHDcwF_u.js";import"./Tool01-BMVX3tOF.js";import"./ArrowUp-CukalgWz.js";import"./ArrowLeft-DvfIRo1L.js";import"./Tool02-WBvKkURX.js";import"./XCircle-BrD26F_t.js";import"./TrendUp01-CahTnQ2p.js";import"./ZapSquare-BXyJZB2H.js";import"./Users03-CasZyOXJ.js";import"./CheckCircle-B5B8UVD6.js";import"./Check-CQfGOUkn.js";import"./ChevronDown-DJW5HhkM.js";import"./ChevronSelectorVertical-DjiLaY0h.js";import"./ChevronUp-DOnt1lNa.js";import"./DotsVertical-veJCsKg6.js";import"./Stars02-b1P1T_48.js";import"./Copy01-DT_VNucR.js";import"./CreditCard01-Bi19p04V.js";import"./Download01-BC66vxkd.js";import"./Settings02-DE8fnfTk.js";import"./Eye-DhvNNTcF.js";import"./FilterLines-DCFzTCRB.js";import"./Share07-Bk8835lK.js";import"./Globe01-CnIzUI9D.js";import"./Globe04-DtNi2ZyL.js";import"./SwitchHorizontal01-rtsYQduN.js";import"./HardDrive-CLNcCFxS.js";import"./Key01-28MkH09O.js";import"./LinkExternal01-BmdVn0um.js";import"./LockUnlocked01-xbaMcbOK.js";import"./LogOut01-CUumDUY-.js";import"./Monitor01-DnWcZI3D.js";import"./Sun-B_-yVQ2_.js";import"./Palette-BbL1PNN-.js";import"./Play-DWeLA7lK.js";import"./Plus-DEP38EYY.js";import"./SearchLg-BO_-rqE7.js";import"./SearchMd-B7xHuJq4.js";import"./Shield01-BUK8VCxJ.js";import"./Stars01-C5onyQkg.js";import"./Trash01-CiqyPob_.js";import"./Upload01-CWR5PH57.js";import"./User01-S_RGxi2I.js";import"./Users01-OC7kfFvk.js";import"./XClose-DbkY8wiR.js";import"./Zap-uo4AxzhY.js";import"./select-DwECBvqm.js";import"./chat-context-BaV72O1g.js";import"./use-panel-navigate-DSXuFDWh.js";import"./dialog-v9lm8kV3.js";import"./use-destination-route-DwR5EZdM.js";import"./constants-dLUUoWH7.js";import"./session-runtime-wVXsCwcJ.js";import"./hooks-ndMd0rOE.js";import"./use-mcp-client-C2WpJqGp.js";import"./auth-Ck-CYI0s.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-RJKXQFNl.js";import"./task-board-d9aI3xON.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-C1lgXcOb.js";import"./use-ai-providers-D-DLX2r-.js";import"./use-decopilot-events-DQphD5G3.js";import"./use-organization-settings-BqyTxtql.js";import"./automation-runs-DJXgmGit.js";import"./useInfiniteQuery-PqMaSXlJ.js";import"./use-infinite-scroll-xFY_A5TW.js";import"./use-connection-DN4iufew.js";import"./table-CNWQQ1ny.js";import"./empty-state-DGfgLPT9.js";import"./use-members-D3qbSIYx.js";import"./use-org-auth-client-6ydcGnsW.js";import"./use-automations-DCQErfJY.js";import"./useSuspenseInfiniteQuery-BO55lV73.js";import"./avatar-BGhjOwGM.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BrNQw893.js";import"./monaco-editor-C37CkGWQ.js";import"./spinner-Ba0CkhBN.js";import"./types-BR-rJmTQ.js";import"./shell-layout-Btlvd1G3.js";import"./required-auth-layout-CPEZLxXW.js";import"./use-org-sso-DMKUn11x.js";import"./integration-icon-Db_3_1Xt.js";import"./use-navigate-to-agent-BnGGkvww.js";import"./chart-CsLoGKFV.js";import"./index-BMtomEba.js";import"./form-KfWVSNEC.js";import"./input-CoA1YEYW.js";import"./file-type-icon-Cp2yVzTz.js";import"./drawer-DBmJy2OH.js";import"./collection-search-CiPLUXMb.js";import"./tabs---ylShNh.js";import"./toggle-group-9H7MENld.js";import"./super-agent-icon-f5MMUEZI.js";import"./self-tool-result-BWeTClq7.js";import"./alert-dialog-EuQzy5n4.js";import"./extract-connection-data-BPW_Djea.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-CMPWtdMv.js";import"./use-debounced-value-w4-tTzSs.js";import"./authenticate-and-persist-oauth-Bnxs7yjQ.js";import"./mcp-oauth-KDpSMvkd.js";import"./track-rDKtvIJ6.js";import"./popover-B0YbN5z6.js";import"./toolbar-CFGjTZKp.js";import"./github-repo-picker-BgSzUzWL.js";import"./use-mcp-tools-D2jDyaSa.js";import"./agent-capabilities-B52k7xCe.js";import"./connection-card-CaXPkEtx.js";import"./use-registry-connections-owrgLOps.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-CvXIGUrZ.js";import"./connection-form-helpers-CAJu7GAu.js";import"./collection-tabs-B32iAo6N.js";import"./badge-Db5xIffE.js";import"./select-model-D3_B27r5.js";import"./checkbox-YMTFrO1r.js";import"./ai-providers-logos-DD3qZ33J.js";import"./cards-DjdS8mnO.js";import"./dropdown-menu-kAhQsmIq.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-BxmwD3Ts.js";import"./use-file-configs-BQA5pT_r.js";import"./pt-BR-CLy76QW2.js";import"./use-debounced-autosave-C96mZ7FL.js";import"./search-input-BupwGxLP.js";import"./use-mcp-auth-status-g4f-5p6M.js";import"./use-secrets-D8LOTarp.js";import"./AreaChart-k1GdGLk3.js";import"./config-sObTbFZQ.js";import"./breadcrumb-yuTxiBYX.js";import"./command-DOfXQ3iQ.js";import"./index-Cvq1ebr1.js";import"./get-initials-D-f_fDFw.js";import"./use-tags-CsnYBdZ3.js";import"./automation-list-row-CbU006h8.js";import"./site-error--i37Vnuw.js";import"./use-org-repo-syncs-ioAfxmUp.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 Yn(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{Yn 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-kc-p0Tho.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-kc-p0Tho.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
|
@@ -1451,7 +1451,7 @@ Usage: deco services <up|down|status>`),process.exit(1)}}var fp1=L(()=>{mf()});f
|
|
|
1451
1451
|
`.execute($);if(Number(W.rows[0]?.cnt)===0){console.warn(`Failed to migrate ${J}/${K}, keeping in old table`);continue}}await Ly`
|
|
1452
1452
|
DELETE FROM kysely_migration WHERE name = ${Q}
|
|
1453
1453
|
`.execute($)}}async function Ra1($){await Ys8($),await Gs8($);let Z=new Aa1({db:$,provider:{getMigrations:()=>Promise.resolve(gp0)}}),{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 Js8($){let{keepOpen:Z=!1,database:Q,skipBetterAuth:X=!1}=$??{},Y="skipped";if(!X&&!Q)Y=await gl0();let G=Q??H8(),J=async()=>{if(!Z&&!Q)await sB(G).catch((K)=>{console.warn("Warning: Error closing database:",K)})};try{let K=await Ra1(G.db);return await J(),{betterAuth:Y,kysely:K}}catch(K){throw await J(),K}}async function Ks8(){let $=H8(),Z=new Aa1({db:$.db,provider:{getMigrations:()=>Promise.resolve(gp0)}}),{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 qa1=L(()=>{Pa1();hl0();QQ()});async function O70($){let Z={...process.env},Q=H80($,Z);console.log(yw1(Q.settings.encryptionKey));let X=Q.settings.betterAuthSecret||(Q.settings.localMode?Ut1(Q.settings.dataDir):""),{ensureServices:Y}=await Promise.resolve().then(() => (PZ0(),zZ0)),{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(() => (hl0(),Ot1));await W(G.databaseUrl);let{createDatabase:H}=await Promise.resolve().then(() => (QQ(),Sn1)),{migrateToLatest:F}=await Promise.resolve().then(() => (qa1(),Ia1)),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 bp1(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 hp0=L(()=>{mf();Bt1();R$()});var Sa1={};Q0(Sa1,{updateService:()=>uE,subscribeCliState:()=>lp0,setTuiConsoleIntercepted:()=>L70,setServerUrl:()=>wp,setMigrationsDone:()=>Dp,setDevMode:()=>Hs8,resetCliStateForTests:()=>Ws8,isTuiConsoleIntercepted:()=>D70,getCliState:()=>cp0,addLogEntry:()=>GO});function Ma1(){return[{name:"Postgres",status:"pending",port:0},{name:"NATS",status:"pending",port:0}]}function Va1(){return{services:Ma1(),migrationsStatus:"pending",serverUrl:null,logs:[]}}function Ws8(){lX=Va1()}function Lp(){for(let $ of up0)$()}function cp0(){return lX}function lp0($){return up0.add($),()=>up0.delete($)}function uE($){lX={...lX,services:lX.services.map((Z)=>Z.name===$.name?$:Z)},Lp()}function Dp(){lX={...lX,migrationsStatus:"done"},Lp()}function wp($){lX={...lX,serverUrl:$},Lp()}function GO($){let Z=[...lX.logs,$];lX={...lX,logs:Z.length>500?Z.slice(-500):Z},Lp()}function Hs8(){lX={...lX,services:[...Ma1(),{name:"API",status:"pending",port:0},{name:"Vite",status:"pending",port:0}]},Lp()}function L70($){ka1=$}function D70(){return ka1}var lX,up0,ka1=!1;var cE=L(()=>{lX=Va1();up0=new Set});import{createServer as Ca1}from"net";function Fs8($){return new Promise((Z)=>{let Q=Ca1();Q.once("error",()=>Z(!1)),Q.listen($,"0.0.0.0",()=>{Q.close(()=>Z(!0))})})}async function Ep($){if(await Fs8($))return $;let Z=await new Promise((Q,X)=>{let Y=Ca1();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 mp0=()=>{};var ip0={};Q0(ip0,{startDevServer:()=>Us8,pipeToLogStore:()=>dp0});import{join as Ns8}from"path";function dp0($){let Z=$.getReader(),Q=new TextDecoder,X="";function Y(){let G=X.split(`
|
|
1454
|
-
`);X=G.pop()??"";for(let J of G){let K=Bun.stripANSI(J).replace(/^\[\d+\]\s*/,"").trim();if(!K)continue;GO({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)GO({method:"",path:"",status:0,duration:0,timestamp:new Date,rawLine:G})}})()}async function Us8($){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 Ep(Number(Y)+1):await Ep(Number($.port)),{settings:K,services:W,managedServiceNames:H}=await O70({port:String(J),home:$.home,baseUrl:$.baseUrl,localMode:$.localMode,skipMigrations:$.skipMigrations,noTui:$.noTui,vitePort:$.vitePort});for(let D of W)uE({name:D.name,status:"ready",port:D.port});Dp();let F=Ns8(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)dp0(U.stdout),dp0(U.stderr);wp(G),uE({name:"Vite",status:"ready",port:Number(Y)}),uE({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(() => (PZ0(),zZ0));await w(K.dataDir)}};return process.on("SIGINT",()=>O("SIGINT")),process.on("SIGTERM",()=>O("SIGTERM")),{port:Number(Y),process:U}}var pp0=L(()=>{hp0();cE();mp0()});var w70;var np0=L(()=>{w70={name:"decocms",version:"4.294.2",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 Os8,Text as _a1}from"ink";import{jsx as Ls8,jsxs as va1}from"react/jsx-runtime";function xa1({version:$}){return va1(Os8,{flexDirection:"column",marginTop:1,children:[dZ0.map((Z,Q)=>Ls8(_a1,{color:iZ0[Q],children:Z},Q)),va1(_a1,{dimColor:!0,children:[" v",$]})]})}var fa1=L(()=>{Yp()});import{Box as lE,Text as JO}from"ink";import{Spinner as Ds8}from"@inkjs/ui";import{jsx as ZG,jsxs as Dy}from"react/jsx-runtime";function ba1({status:$}){if($==="pending")return ZG(Ds8,{label:""});return ZG(JO,{color:"green",children:"\u2713"})}function ws8($){return`${$.name}: ${$.port||"...."}`}function ya1({services:$,migrationsStatus:Z,home:Q,serverUrl:X}){return Dy(lE,{flexDirection:"column",paddingBottom:1,children:[ZG(xa1,{version:w70.version}),ZG(lE,{marginBottom:1,children:ZG(JO,{dimColor:!0,children:"\u2500".repeat(80)})}),ZG(lE,{children:Dy(JO,{dimColor:!0,children:["Home: ",Q]})}),Dy(lE,{gap:2,children:[$.map((Y)=>Dy(lE,{gap:1,children:[ZG(JO,{children:ws8(Y)}),ZG(ba1,{status:Y.status})]},Y.name)),Dy(lE,{gap:1,children:[ZG(JO,{children:"Migrations"}),ZG(ba1,{status:Z})]})]}),ZG(lE,{children:X?Dy(JO,{children:["Open in browser: ",ZG(JO,{color:"cyan",children:X})]}):ZG(JO,{dimColor:!0,children:"Starting..."})})]})}var ga1=L(()=>{np0();fa1()});import{Box as Es8,Text as jp}from"ink";import{jsx as tp0,jsxs as op0}from"react/jsx-runtime";function js8($){if($>=500)return"red";if($>=400)return"yellow";if($>=300)return"cyan";return"green"}function ha1({logs:$}){return tp0(Es8,{flexDirection:"column",children:$.map((Z,Q)=>{if(Z.rawLine)return tp0(jp,{dimColor:!0,children:Z.rawLine},Q);let X=Z.duration<1000?`${Z.duration}ms`:`${(Z.duration/1000).toFixed(1)}s`;return op0(jp,{children:[op0(jp,{dimColor:!0,children:[Z.method.padEnd(6)," ",Z.path.padEnd(30)," "]}),tp0(jp,{color:js8(Z.status),children:Z.status}),op0(jp,{dimColor:!0,children:[" ",X.padStart(8)]})]},Q)})})}var ua1=()=>{};var rp0={};Q0(rp0,{App:()=>As8});import{Box as zs8}from"ink";import{useSyncExternalStore as Ps8}from"react";import{jsx as ca1,jsxs as Ts8}from"react/jsx-runtime";function As8({home:$}){let Z=Ps8(lp0,cp0);return Ts8(zs8,{flexDirection:"column",children:[ca1(ya1,{services:Z.services,migrationsStatus:Z.migrationsStatus,home:$,serverUrl:Z.serverUrl}),ca1(ha1,{logs:Z.logs})]})}var ap0=L(()=>{ga1();ua1();cE()});var l3="thread-gate",FN="decopilot-hosted-harness",NN="decopilot-hosted-harness-sandboxed",DJ="automations",KO="background-tools",mE="task-board-github-reads",dE="jira-push";var la1="9";function ma1($){return{name:"decocms",systemDatabaseUrl:$.systemDatabaseUrl,systemDatabaseSchemaName:"dbos",systemDatabasePoolSize:$.poolSize,runAdminServer:!1,executorID:$.executorID,applicationVersion:la1,...$.listenQueues!==void 0?{listenQueues:$.listenQueues}:{}}}var da1=()=>{};import Rs8 from"pg";async function pa1($,Z){let{databaseUrl:Q,lockTimeoutMs:X=Is8}=$,Y=$.log??((W)=>console.log(W)),G=new Rs8.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",[ia1.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$(qs8)}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)",[ia1.toString()])}catch{}await G.end().catch(()=>{})}}var ia1=8314027461559302n,Is8=600000,qs8=500;var na1=L(()=>{J4()});function Ms8(){let $=(process.env.BUN_OPTIONS??"").split(/\s+/).filter(Boolean);return[...process.argv.slice(1),...$]}function sp0($,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 ta1(){let $=Ms8();if($.includes("--cpu-prof")){console.log(JSON.stringify({msg:"cpu-profiling-active",dir:sp0($,"--cpu-prof-dir")??process.cwd(),name:sp0($,"--cpu-prof-name"),markdown:$.includes("--cpu-prof-md"),intervalUs:Number(sp0($,"--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 oa1(){if(process.env.HEAP_WATCH!=="1")return()=>{};let $=Number(process.env.HEAP_WATCH_INTERVAL_MS??60000),Z=async()=>{let Q=bE();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(()=>{}),E70=setInterval(()=>void Z().catch(()=>{}),$),E70.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(E70)clearInterval(E70)}}var E70;var ra1=()=>{};import*as Vs8 from"bun:jsc";function aa1(){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{ks8()}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=Ss8()?.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 ks8,Ss8;var sa1=L(()=>{({startSamplingProfiler:ks8,samplingProfilerStackTraces:Ss8}=Vs8)});function ea1(){ta1();let $=[oa1(),An1(),aa1()];return()=>{for(let Z of $)Z()}}var $s1=L(()=>{kl0();ra1();sa1()});var iE=v((Zs1)=>{Object.defineProperty(Zs1,"__esModule",{value:!0});Zs1.RepublishHeaders=Zs1.DirectMsgHeaders=Zs1.JsHeaders=Zs1.AdvisoryKind=void 0;Zs1.isOrderedPushConsumerOptions=Cs8;Zs1.isPullConsumer=_s8;Zs1.isPushConsumer=vs8;Zs1.isBoundPushConsumerOptions=xs8;function Cs8($){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 _s8($){return $.isPullConsumer()}function vs8($){return $.isPushConsumer()}function xs8($){if($&&typeof $==="object")return"deliver_subject"in $||"deliver_group"in $||"idle_heartbeat"in $;return!1}Zs1.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"};Zs1.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"};Zs1.DirectMsgHeaders={Stream:"Nats-Stream",Sequence:"Nats-Sequence",TimeStamp:"Nats-Time-Stamp",Subject:"Nats-Subject",LastSequence:"Nats-Last-Sequence",NumPending:"Nats-Num-Pending"};Zs1.RepublishHeaders={Stream:"Nats-Stream",Subject:"Nats-Subject",Sequence:"Nats-Sequence",LastSequence:"Nats-Last-Sequence",Size:"Nats-Msg-Size"}});var QG=v((Xs1)=>{Object.defineProperty(Xs1,"__esModule",{value:!0});Xs1.TD=Xs1.TE=Xs1.Empty=void 0;Xs1.encode=ms8;Xs1.decode=ds8;Xs1.Empty=new Uint8Array(0);Xs1.TE=new TextEncoder;Xs1.TD=new TextDecoder;function ls8(...$){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 ms8(...$){let Z=[];for(let Q=0;Q<$.length;Q++)Z.push(Xs1.TE.encode($[Q]));if(Z.length===0)return Xs1.Empty;if(Z.length===1)return Z[0];return ls8(...Z)}function ds8($){if(!$||$.length===0)return"";return Xs1.TD.decode($)}});var XG=v((Js1)=>{Object.defineProperty(Js1,"__esModule",{value:!0});Js1.errors=Js1.PermissionViolationError=Js1.NoRespondersError=Js1.TimeoutError=Js1.RequestError=Js1.ProtocolError=Js1.ConnectionError=Js1.DrainingConnectionError=Js1.ClosedConnectionError=Js1.AuthorizationError=Js1.UserAuthenticationExpiredError=Js1.InvalidOperationError=Js1.InvalidArgumentError=Js1.InvalidSubjectError=void 0;class $n0 extends Error{constructor($,Z){super(`illegal subject: '${$}'`,Z);this.name="InvalidSubjectError"}}Js1.InvalidSubjectError=$n0;class j70 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 j70(`${$} ${Z}`,Q)}}Js1.InvalidArgumentError=j70;class Zn0 extends Error{constructor($,Z){super($,Z);this.name="InvalidOperationError"}}Js1.InvalidOperationError=Zn0;class z70 extends Error{constructor($,Z){super($,Z);this.name="UserAuthenticationExpiredError"}static parse($){if($.toLowerCase().indexOf("user authentication expired")!==-1)return new z70($);return null}}Js1.UserAuthenticationExpiredError=z70;class P70 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 P70($);return null}}Js1.AuthorizationError=P70;class Qn0 extends Error{constructor(){super("closed connection");this.name="ClosedConnectionError"}}Js1.ClosedConnectionError=Qn0;class Xn0 extends Error{constructor(){super("connection draining");this.name="DrainingConnectionError"}}Js1.DrainingConnectionError=Xn0;class Yn0 extends Error{constructor($,Z){super($,Z);this.name="ConnectionError"}}Js1.ConnectionError=Yn0;class Gn0 extends Error{constructor($,Z){super($,Z);this.name="ProtocolError"}}Js1.ProtocolError=Gn0;class Jn0 extends Error{constructor($="",Z){super($,Z);this.name="RequestError"}isNoResponders(){return this.cause instanceof A70}}Js1.RequestError=Jn0;class Kn0 extends Error{constructor($){super("timeout",$);this.name="TimeoutError"}}Js1.TimeoutError=Kn0;class A70 extends Error{subject;constructor($,Z){super(`no responders: '${$}'`,Z);this.subject=$,this.name="NoResponders"}}Js1.NoRespondersError=A70;class T70 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 T70($,Q,X,Y)}}Js1.PermissionViolationError=T70;Js1.errors={AuthorizationError:P70,ClosedConnectionError:Qn0,ConnectionError:Yn0,DrainingConnectionError:Xn0,InvalidArgumentError:j70,InvalidOperationError:Zn0,InvalidSubjectError:$n0,NoRespondersError:A70,PermissionViolationError:T70,ProtocolError:Gn0,RequestError:Jn0,TimeoutError:Kn0,UserAuthenticationExpiredError:z70}});var m3=v((Ns1)=>{Object.defineProperty(Ns1,"__esModule",{value:!0});Ns1.SimpleMutex=Ns1.Perf=void 0;Ns1.extend=Ke8;Ns1.render=We8;Ns1.timeout=He8;Ns1.delay=Fe8;Ns1.deadline=Ne8;Ns1.deferred=Hn0;Ns1.debugDeferred=Ue8;Ns1.shuffle=Be8;Ns1.collect=Oe8;Ns1.jitter=Fs1;Ns1.backoff=Le8;Ns1.nanos=De8;Ns1.millis=we8;Ns1.randomToken=ze8;var Je8=QG(),Wn0=XG();function Ke8($,...Z){for(let Q=0;Q<Z.length;Q++){let X=Z[Q];Object.keys(X).forEach(function(Y){$[Y]=X[Y]})}return $}function We8($){return Je8.TD.decode($).replace(/\n/g,"\u240A").replace(/\r/g,"\u240D")}function He8($,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 Fe8($=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 Ne8($,Z=1000){let Q=Hn0(),X=setTimeout(()=>{Q.reject(new Wn0.TimeoutError)},Z);try{return await Promise.race([$,Q])}finally{clearTimeout(X)}}function Hn0(){let $={},Z=new Promise((Q,X)=>{$={resolve:Q,reject:X}});return Object.assign(Z,$)}function Ue8(){let $={},Z=new Promise((Q,X)=>{$={resolve:(Y)=>{console.trace("resolve",Y),Q(Y)},reject:(Y)=>{console.trace("reject"),X(Y)}}});return Object.assign(Z,$)}function Be8($){for(let Z=$.length-1;Z>0;Z--){let Q=Math.floor(Math.random()*(Z+1));[$[Z],$[Q]]=[$[Q],$[Z]]}return $}async function Oe8($){let Z=[];for await(let Q of $)Z.push(Q);return Z}class Ws1{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})}),$}}Ns1.Perf=Ws1;class Hs1{max;current;waiting;constructor($=1){this.max=$,this.current=0,this.waiting=[]}lock(){if(this.current++,this.current<=this.max)return Promise.resolve();let $=Hn0();return this.waiting.push($),$}unlock(){this.current--,this.waiting.pop()?.resolve()}}Ns1.SimpleMutex=Hs1;function Fs1($){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 Fs1(Q>Z?$[Z]:$[Q])}}}function De8($){return $*1e6}function we8($){return Math.floor($/1e6)}var Ee8="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",UN=new Uint8Array(62);for(let $=0;$<62;$++)UN[$]=Ee8.charCodeAt($);var je8=218340105584896;function ze8(){let $=Math.floor(Math.random()*je8),Z=$%62,Q=UN[Z];$=($-Z)/62,Z=$%62;let X=UN[Z];$=($-Z)/62,Z=$%62;let Y=UN[Z];$=($-Z)/62,Z=$%62;let G=UN[Z];$=($-Z)/62,Z=$%62;let J=UN[Z];$=($-Z)/62,Z=$%62;let K=UN[Z];$=($-Z)/62,Z=$%62;let W=UN[Z];$=($-Z)/62;let H=UN[$];return String.fromCharCode(Q,X,Y,G,J,K,W,H)}});var js1=v((ws1)=>{Object.defineProperty(ws1,"__esModule",{value:!0});ws1.nuid=ws1.NuidImpl=void 0;var be8="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",WO=62,I70=12,Ls1=10,Bs1=33,ye8=333,Os1=I70+Ls1,Nn0=new Uint8Array(WO);for(let $=0;$<WO;$++)Nn0[$]=be8.charCodeAt($);var R70=4294967296,Ds1=BigInt(WO)**BigInt(Ls1),zp=Number(Ds1/(1n<<32n)),Fn0=Number(Ds1%(1n<<32n));function ge8($){for(let Z=0;Z<$.length;Z++)$[Z]=Math.floor(Math.random()*256)}function he8($){if(globalThis?.crypto?.getRandomValues)globalThis.crypto.getRandomValues($);else ge8($)}class Un0{buf;cbuf;seqHi;seqLo;inc;inited;constructor(){this.buf=new Uint8Array(Os1),this.cbuf=new Uint8Array(I70),this.inited=!1}init(){this.inited=!0,this.setPre(),this.initSeqAndInc(),this.fillSeq()}initSeqAndInc(){let $=0;do this.seqHi=Math.floor(Math.random()*(zp+1)),this.seqLo=Math.floor(Math.random()*R70);while($++<8&&this.seqHi===zp&&this.seqLo>=Fn0);if(this.seqHi===zp&&this.seqLo>=Fn0)this.seqLo=0;this.inc=Math.random()*(ye8-Bs1)+Bs1|0}setPre(){he8(this.cbuf);for(let $=0;$<I70;$++)this.buf[$]=Nn0[this.cbuf[$]%WO]}fillSeq(){let $=this.seqHi,Z=this.seqLo;for(let Q=Os1-1;Q>=I70;Q--){let X=Math.floor($/WO),G=($-X*WO)*R70+Z,J=Math.floor(G/WO),K=G-J*WO;this.buf[Q]=Nn0[K],$=X,Z=J}}next(){if(!this.inited)this.init();if(this.seqLo+=this.inc,this.seqLo>=R70)this.seqLo-=R70,this.seqHi+=1;if(this.seqHi>zp||this.seqHi===zp&&this.seqLo>=Fn0)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()}}ws1.NuidImpl=Un0;ws1.nuid=new Un0});var Ts1=v((Ps1)=>{Object.defineProperty(Ps1,"__esModule",{value:!0});Ps1.nuid=Ps1.Nuid=void 0;var zs1=js1();Ps1.Nuid=zs1.NuidImpl;Ps1.nuid=zs1.nuid});var M70=v((q70)=>{Object.defineProperty(q70,"__esModule",{value:!0});q70.nuid=q70.Nuid=void 0;var Rs1=Ts1();Object.defineProperty(q70,"Nuid",{enumerable:!0,get:function(){return Rs1.Nuid}});Object.defineProperty(q70,"nuid",{enumerable:!0,get:function(){return Rs1.nuid}})});var HO=v((Is1)=>{Object.defineProperty(Is1,"__esModule",{value:!0});Is1.DEFAULT_HOST=Is1.DEFAULT_PORT=Is1.Match=void 0;Is1.syncIterator=ie8;Is1.createInbox=pe8;var me8=M70(),de8=XG();Is1.Match={Exact:"exact",CanonicalMIME:"canonical",IgnoreCase:"insensitive"};function ie8($){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 pe8($=""){if($=$||"_INBOX",typeof $!=="string")throw TypeError("prefix must be a string");return $.split(".").forEach((Z)=>{if(Z==="*"||Z===">")throw de8.InvalidArgumentError.format("prefix",`cannot have wildcards ('${$}')`)}),`${$}.${me8.nuid.next()}`}Is1.DEFAULT_PORT=4222;Is1.DEFAULT_HOST="127.0.0.1"});var Pp=v((ks1)=>{Object.defineProperty(ks1,"__esModule",{value:!0});ks1.DataBuffer=void 0;var Ms1=QG();class Vs1{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 Ms1.TE.encode($)}static toAscii($){return Ms1.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}}ks1.DataBuffer=Vs1});var pE=v((_s1)=>{Object.defineProperty(_s1,"__esModule",{value:!0});_s1.LF=_s1.CR=_s1.CRLF=_s1.CR_LF_LEN=_s1.CR_LF=void 0;_s1.setTransportFactory=$04;_s1.defaultPort=Z04;_s1.getUrlParseFn=Q04;_s1.newTransport=X04;_s1.getResolveFn=Y04;_s1.protoLen=Cs1;_s1.extractProtocolMessage=G04;var ae8=QG(),se8=HO(),ee8=Pp(),YG;function $04($){YG=$}function Z04(){return YG!==void 0&&YG.defaultPort!==void 0?YG.defaultPort:se8.DEFAULT_PORT}function Q04(){return YG!==void 0&&YG.urlParseFn?YG.urlParseFn:void 0}function X04(){if(!YG||typeof YG.factory!=="function")throw Error("transport fn is not set");return YG.factory()}function Y04(){return YG!==void 0&&YG.dnsResolveFn?YG.dnsResolveFn:void 0}_s1.CR_LF=`\r
|
|
1454
|
+
`);X=G.pop()??"";for(let J of G){let K=Bun.stripANSI(J).replace(/^\[\d+\]\s*/,"").trim();if(!K)continue;GO({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)GO({method:"",path:"",status:0,duration:0,timestamp:new Date,rawLine:G})}})()}async function Us8($){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 Ep(Number(Y)+1):await Ep(Number($.port)),{settings:K,services:W,managedServiceNames:H}=await O70({port:String(J),home:$.home,baseUrl:$.baseUrl,localMode:$.localMode,skipMigrations:$.skipMigrations,noTui:$.noTui,vitePort:$.vitePort});for(let D of W)uE({name:D.name,status:"ready",port:D.port});Dp();let F=Ns8(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)dp0(U.stdout),dp0(U.stderr);wp(G),uE({name:"Vite",status:"ready",port:Number(Y)}),uE({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(() => (PZ0(),zZ0));await w(K.dataDir)}};return process.on("SIGINT",()=>O("SIGINT")),process.on("SIGTERM",()=>O("SIGTERM")),{port:Number(Y),process:U}}var pp0=L(()=>{hp0();cE();mp0()});var w70;var np0=L(()=>{w70={name:"decocms",version:"4.294.4",description:"Deco CMS \u2014 Self-hostable MCP Gateway for managing AI connections and tools",author:"Deco team",repository:{type:"git",url:"git+https://github.com/decocms/studio.git",directory:"apps/api"},bugs:{url:"https://github.com/decocms/studio/issues"},type:"module",bin:{deco:"./dist/server/cli.js"},files:["dist/**/*"],scripts:{dev:"bun run migrate && bun run dev:server","dev:server":"bun run --cwd=../../packages/sandbox build && NODE_ENV=development bun --env-file=.env --hot run src/index.ts",build:"bun run build:server","build:server":"bun run scripts/bundle-server-script.ts --dist ./dist/server","generate:tool-contracts":"bun run scripts/generate-tool-contracts.ts","db:migrate":"bun run ./dist/server/migrate.js","db:migrate:dbos":"bun run ./dist/server/migrate-dbos.js",check:"tsc --noEmit",start:"bun run ./dist/server/server.js",migrate:"bun run src/database/migrate.ts","migrate:dbos":"bun run src/database/migrate-dbos.ts",test:"bun test src","better-auth:migrate":"bunx --bun @better-auth/cli migrate -y --config src/auth/index.ts",prepublishOnly:"bun run --cwd=../.. build:studio"},optionalDependencies:{"@duckdb/node-api":"^1.5.0-r.1"},dependencies:{"@ai-sdk/anthropic":"^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 Os8,Text as _a1}from"ink";import{jsx as Ls8,jsxs as va1}from"react/jsx-runtime";function xa1({version:$}){return va1(Os8,{flexDirection:"column",marginTop:1,children:[dZ0.map((Z,Q)=>Ls8(_a1,{color:iZ0[Q],children:Z},Q)),va1(_a1,{dimColor:!0,children:[" v",$]})]})}var fa1=L(()=>{Yp()});import{Box as lE,Text as JO}from"ink";import{Spinner as Ds8}from"@inkjs/ui";import{jsx as ZG,jsxs as Dy}from"react/jsx-runtime";function ba1({status:$}){if($==="pending")return ZG(Ds8,{label:""});return ZG(JO,{color:"green",children:"\u2713"})}function ws8($){return`${$.name}: ${$.port||"...."}`}function ya1({services:$,migrationsStatus:Z,home:Q,serverUrl:X}){return Dy(lE,{flexDirection:"column",paddingBottom:1,children:[ZG(xa1,{version:w70.version}),ZG(lE,{marginBottom:1,children:ZG(JO,{dimColor:!0,children:"\u2500".repeat(80)})}),ZG(lE,{children:Dy(JO,{dimColor:!0,children:["Home: ",Q]})}),Dy(lE,{gap:2,children:[$.map((Y)=>Dy(lE,{gap:1,children:[ZG(JO,{children:ws8(Y)}),ZG(ba1,{status:Y.status})]},Y.name)),Dy(lE,{gap:1,children:[ZG(JO,{children:"Migrations"}),ZG(ba1,{status:Z})]})]}),ZG(lE,{children:X?Dy(JO,{children:["Open in browser: ",ZG(JO,{color:"cyan",children:X})]}):ZG(JO,{dimColor:!0,children:"Starting..."})})]})}var ga1=L(()=>{np0();fa1()});import{Box as Es8,Text as jp}from"ink";import{jsx as tp0,jsxs as op0}from"react/jsx-runtime";function js8($){if($>=500)return"red";if($>=400)return"yellow";if($>=300)return"cyan";return"green"}function ha1({logs:$}){return tp0(Es8,{flexDirection:"column",children:$.map((Z,Q)=>{if(Z.rawLine)return tp0(jp,{dimColor:!0,children:Z.rawLine},Q);let X=Z.duration<1000?`${Z.duration}ms`:`${(Z.duration/1000).toFixed(1)}s`;return op0(jp,{children:[op0(jp,{dimColor:!0,children:[Z.method.padEnd(6)," ",Z.path.padEnd(30)," "]}),tp0(jp,{color:js8(Z.status),children:Z.status}),op0(jp,{dimColor:!0,children:[" ",X.padStart(8)]})]},Q)})})}var ua1=()=>{};var rp0={};Q0(rp0,{App:()=>As8});import{Box as zs8}from"ink";import{useSyncExternalStore as Ps8}from"react";import{jsx as ca1,jsxs as Ts8}from"react/jsx-runtime";function As8({home:$}){let Z=Ps8(lp0,cp0);return Ts8(zs8,{flexDirection:"column",children:[ca1(ya1,{services:Z.services,migrationsStatus:Z.migrationsStatus,home:$,serverUrl:Z.serverUrl}),ca1(ha1,{logs:Z.logs})]})}var ap0=L(()=>{ga1();ua1();cE()});var l3="thread-gate",FN="decopilot-hosted-harness",NN="decopilot-hosted-harness-sandboxed",DJ="automations",KO="background-tools",mE="task-board-github-reads",dE="jira-push";var la1="9";function ma1($){return{name:"decocms",systemDatabaseUrl:$.systemDatabaseUrl,systemDatabaseSchemaName:"dbos",systemDatabasePoolSize:$.poolSize,runAdminServer:!1,executorID:$.executorID,applicationVersion:la1,...$.listenQueues!==void 0?{listenQueues:$.listenQueues}:{}}}var da1=()=>{};import Rs8 from"pg";async function pa1($,Z){let{databaseUrl:Q,lockTimeoutMs:X=Is8}=$,Y=$.log??((W)=>console.log(W)),G=new Rs8.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",[ia1.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$(qs8)}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)",[ia1.toString()])}catch{}await G.end().catch(()=>{})}}var ia1=8314027461559302n,Is8=600000,qs8=500;var na1=L(()=>{J4()});function Ms8(){let $=(process.env.BUN_OPTIONS??"").split(/\s+/).filter(Boolean);return[...process.argv.slice(1),...$]}function sp0($,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 ta1(){let $=Ms8();if($.includes("--cpu-prof")){console.log(JSON.stringify({msg:"cpu-profiling-active",dir:sp0($,"--cpu-prof-dir")??process.cwd(),name:sp0($,"--cpu-prof-name"),markdown:$.includes("--cpu-prof-md"),intervalUs:Number(sp0($,"--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 oa1(){if(process.env.HEAP_WATCH!=="1")return()=>{};let $=Number(process.env.HEAP_WATCH_INTERVAL_MS??60000),Z=async()=>{let Q=bE();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(()=>{}),E70=setInterval(()=>void Z().catch(()=>{}),$),E70.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(E70)clearInterval(E70)}}var E70;var ra1=()=>{};import*as Vs8 from"bun:jsc";function aa1(){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{ks8()}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=Ss8()?.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 ks8,Ss8;var sa1=L(()=>{({startSamplingProfiler:ks8,samplingProfilerStackTraces:Ss8}=Vs8)});function ea1(){ta1();let $=[oa1(),An1(),aa1()];return()=>{for(let Z of $)Z()}}var $s1=L(()=>{kl0();ra1();sa1()});var iE=v((Zs1)=>{Object.defineProperty(Zs1,"__esModule",{value:!0});Zs1.RepublishHeaders=Zs1.DirectMsgHeaders=Zs1.JsHeaders=Zs1.AdvisoryKind=void 0;Zs1.isOrderedPushConsumerOptions=Cs8;Zs1.isPullConsumer=_s8;Zs1.isPushConsumer=vs8;Zs1.isBoundPushConsumerOptions=xs8;function Cs8($){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 _s8($){return $.isPullConsumer()}function vs8($){return $.isPushConsumer()}function xs8($){if($&&typeof $==="object")return"deliver_subject"in $||"deliver_group"in $||"idle_heartbeat"in $;return!1}Zs1.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"};Zs1.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"};Zs1.DirectMsgHeaders={Stream:"Nats-Stream",Sequence:"Nats-Sequence",TimeStamp:"Nats-Time-Stamp",Subject:"Nats-Subject",LastSequence:"Nats-Last-Sequence",NumPending:"Nats-Num-Pending"};Zs1.RepublishHeaders={Stream:"Nats-Stream",Subject:"Nats-Subject",Sequence:"Nats-Sequence",LastSequence:"Nats-Last-Sequence",Size:"Nats-Msg-Size"}});var QG=v((Xs1)=>{Object.defineProperty(Xs1,"__esModule",{value:!0});Xs1.TD=Xs1.TE=Xs1.Empty=void 0;Xs1.encode=ms8;Xs1.decode=ds8;Xs1.Empty=new Uint8Array(0);Xs1.TE=new TextEncoder;Xs1.TD=new TextDecoder;function ls8(...$){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 ms8(...$){let Z=[];for(let Q=0;Q<$.length;Q++)Z.push(Xs1.TE.encode($[Q]));if(Z.length===0)return Xs1.Empty;if(Z.length===1)return Z[0];return ls8(...Z)}function ds8($){if(!$||$.length===0)return"";return Xs1.TD.decode($)}});var XG=v((Js1)=>{Object.defineProperty(Js1,"__esModule",{value:!0});Js1.errors=Js1.PermissionViolationError=Js1.NoRespondersError=Js1.TimeoutError=Js1.RequestError=Js1.ProtocolError=Js1.ConnectionError=Js1.DrainingConnectionError=Js1.ClosedConnectionError=Js1.AuthorizationError=Js1.UserAuthenticationExpiredError=Js1.InvalidOperationError=Js1.InvalidArgumentError=Js1.InvalidSubjectError=void 0;class $n0 extends Error{constructor($,Z){super(`illegal subject: '${$}'`,Z);this.name="InvalidSubjectError"}}Js1.InvalidSubjectError=$n0;class j70 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 j70(`${$} ${Z}`,Q)}}Js1.InvalidArgumentError=j70;class Zn0 extends Error{constructor($,Z){super($,Z);this.name="InvalidOperationError"}}Js1.InvalidOperationError=Zn0;class z70 extends Error{constructor($,Z){super($,Z);this.name="UserAuthenticationExpiredError"}static parse($){if($.toLowerCase().indexOf("user authentication expired")!==-1)return new z70($);return null}}Js1.UserAuthenticationExpiredError=z70;class P70 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 P70($);return null}}Js1.AuthorizationError=P70;class Qn0 extends Error{constructor(){super("closed connection");this.name="ClosedConnectionError"}}Js1.ClosedConnectionError=Qn0;class Xn0 extends Error{constructor(){super("connection draining");this.name="DrainingConnectionError"}}Js1.DrainingConnectionError=Xn0;class Yn0 extends Error{constructor($,Z){super($,Z);this.name="ConnectionError"}}Js1.ConnectionError=Yn0;class Gn0 extends Error{constructor($,Z){super($,Z);this.name="ProtocolError"}}Js1.ProtocolError=Gn0;class Jn0 extends Error{constructor($="",Z){super($,Z);this.name="RequestError"}isNoResponders(){return this.cause instanceof A70}}Js1.RequestError=Jn0;class Kn0 extends Error{constructor($){super("timeout",$);this.name="TimeoutError"}}Js1.TimeoutError=Kn0;class A70 extends Error{subject;constructor($,Z){super(`no responders: '${$}'`,Z);this.subject=$,this.name="NoResponders"}}Js1.NoRespondersError=A70;class T70 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 T70($,Q,X,Y)}}Js1.PermissionViolationError=T70;Js1.errors={AuthorizationError:P70,ClosedConnectionError:Qn0,ConnectionError:Yn0,DrainingConnectionError:Xn0,InvalidArgumentError:j70,InvalidOperationError:Zn0,InvalidSubjectError:$n0,NoRespondersError:A70,PermissionViolationError:T70,ProtocolError:Gn0,RequestError:Jn0,TimeoutError:Kn0,UserAuthenticationExpiredError:z70}});var m3=v((Ns1)=>{Object.defineProperty(Ns1,"__esModule",{value:!0});Ns1.SimpleMutex=Ns1.Perf=void 0;Ns1.extend=Ke8;Ns1.render=We8;Ns1.timeout=He8;Ns1.delay=Fe8;Ns1.deadline=Ne8;Ns1.deferred=Hn0;Ns1.debugDeferred=Ue8;Ns1.shuffle=Be8;Ns1.collect=Oe8;Ns1.jitter=Fs1;Ns1.backoff=Le8;Ns1.nanos=De8;Ns1.millis=we8;Ns1.randomToken=ze8;var Je8=QG(),Wn0=XG();function Ke8($,...Z){for(let Q=0;Q<Z.length;Q++){let X=Z[Q];Object.keys(X).forEach(function(Y){$[Y]=X[Y]})}return $}function We8($){return Je8.TD.decode($).replace(/\n/g,"\u240A").replace(/\r/g,"\u240D")}function He8($,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 Fe8($=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 Ne8($,Z=1000){let Q=Hn0(),X=setTimeout(()=>{Q.reject(new Wn0.TimeoutError)},Z);try{return await Promise.race([$,Q])}finally{clearTimeout(X)}}function Hn0(){let $={},Z=new Promise((Q,X)=>{$={resolve:Q,reject:X}});return Object.assign(Z,$)}function Ue8(){let $={},Z=new Promise((Q,X)=>{$={resolve:(Y)=>{console.trace("resolve",Y),Q(Y)},reject:(Y)=>{console.trace("reject"),X(Y)}}});return Object.assign(Z,$)}function Be8($){for(let Z=$.length-1;Z>0;Z--){let Q=Math.floor(Math.random()*(Z+1));[$[Z],$[Q]]=[$[Q],$[Z]]}return $}async function Oe8($){let Z=[];for await(let Q of $)Z.push(Q);return Z}class Ws1{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})}),$}}Ns1.Perf=Ws1;class Hs1{max;current;waiting;constructor($=1){this.max=$,this.current=0,this.waiting=[]}lock(){if(this.current++,this.current<=this.max)return Promise.resolve();let $=Hn0();return this.waiting.push($),$}unlock(){this.current--,this.waiting.pop()?.resolve()}}Ns1.SimpleMutex=Hs1;function Fs1($){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 Fs1(Q>Z?$[Z]:$[Q])}}}function De8($){return $*1e6}function we8($){return Math.floor($/1e6)}var Ee8="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",UN=new Uint8Array(62);for(let $=0;$<62;$++)UN[$]=Ee8.charCodeAt($);var je8=218340105584896;function ze8(){let $=Math.floor(Math.random()*je8),Z=$%62,Q=UN[Z];$=($-Z)/62,Z=$%62;let X=UN[Z];$=($-Z)/62,Z=$%62;let Y=UN[Z];$=($-Z)/62,Z=$%62;let G=UN[Z];$=($-Z)/62,Z=$%62;let J=UN[Z];$=($-Z)/62,Z=$%62;let K=UN[Z];$=($-Z)/62,Z=$%62;let W=UN[Z];$=($-Z)/62;let H=UN[$];return String.fromCharCode(Q,X,Y,G,J,K,W,H)}});var js1=v((ws1)=>{Object.defineProperty(ws1,"__esModule",{value:!0});ws1.nuid=ws1.NuidImpl=void 0;var be8="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",WO=62,I70=12,Ls1=10,Bs1=33,ye8=333,Os1=I70+Ls1,Nn0=new Uint8Array(WO);for(let $=0;$<WO;$++)Nn0[$]=be8.charCodeAt($);var R70=4294967296,Ds1=BigInt(WO)**BigInt(Ls1),zp=Number(Ds1/(1n<<32n)),Fn0=Number(Ds1%(1n<<32n));function ge8($){for(let Z=0;Z<$.length;Z++)$[Z]=Math.floor(Math.random()*256)}function he8($){if(globalThis?.crypto?.getRandomValues)globalThis.crypto.getRandomValues($);else ge8($)}class Un0{buf;cbuf;seqHi;seqLo;inc;inited;constructor(){this.buf=new Uint8Array(Os1),this.cbuf=new Uint8Array(I70),this.inited=!1}init(){this.inited=!0,this.setPre(),this.initSeqAndInc(),this.fillSeq()}initSeqAndInc(){let $=0;do this.seqHi=Math.floor(Math.random()*(zp+1)),this.seqLo=Math.floor(Math.random()*R70);while($++<8&&this.seqHi===zp&&this.seqLo>=Fn0);if(this.seqHi===zp&&this.seqLo>=Fn0)this.seqLo=0;this.inc=Math.random()*(ye8-Bs1)+Bs1|0}setPre(){he8(this.cbuf);for(let $=0;$<I70;$++)this.buf[$]=Nn0[this.cbuf[$]%WO]}fillSeq(){let $=this.seqHi,Z=this.seqLo;for(let Q=Os1-1;Q>=I70;Q--){let X=Math.floor($/WO),G=($-X*WO)*R70+Z,J=Math.floor(G/WO),K=G-J*WO;this.buf[Q]=Nn0[K],$=X,Z=J}}next(){if(!this.inited)this.init();if(this.seqLo+=this.inc,this.seqLo>=R70)this.seqLo-=R70,this.seqHi+=1;if(this.seqHi>zp||this.seqHi===zp&&this.seqLo>=Fn0)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()}}ws1.NuidImpl=Un0;ws1.nuid=new Un0});var Ts1=v((Ps1)=>{Object.defineProperty(Ps1,"__esModule",{value:!0});Ps1.nuid=Ps1.Nuid=void 0;var zs1=js1();Ps1.Nuid=zs1.NuidImpl;Ps1.nuid=zs1.nuid});var M70=v((q70)=>{Object.defineProperty(q70,"__esModule",{value:!0});q70.nuid=q70.Nuid=void 0;var Rs1=Ts1();Object.defineProperty(q70,"Nuid",{enumerable:!0,get:function(){return Rs1.Nuid}});Object.defineProperty(q70,"nuid",{enumerable:!0,get:function(){return Rs1.nuid}})});var HO=v((Is1)=>{Object.defineProperty(Is1,"__esModule",{value:!0});Is1.DEFAULT_HOST=Is1.DEFAULT_PORT=Is1.Match=void 0;Is1.syncIterator=ie8;Is1.createInbox=pe8;var me8=M70(),de8=XG();Is1.Match={Exact:"exact",CanonicalMIME:"canonical",IgnoreCase:"insensitive"};function ie8($){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 pe8($=""){if($=$||"_INBOX",typeof $!=="string")throw TypeError("prefix must be a string");return $.split(".").forEach((Z)=>{if(Z==="*"||Z===">")throw de8.InvalidArgumentError.format("prefix",`cannot have wildcards ('${$}')`)}),`${$}.${me8.nuid.next()}`}Is1.DEFAULT_PORT=4222;Is1.DEFAULT_HOST="127.0.0.1"});var Pp=v((ks1)=>{Object.defineProperty(ks1,"__esModule",{value:!0});ks1.DataBuffer=void 0;var Ms1=QG();class Vs1{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 Ms1.TE.encode($)}static toAscii($){return Ms1.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}}ks1.DataBuffer=Vs1});var pE=v((_s1)=>{Object.defineProperty(_s1,"__esModule",{value:!0});_s1.LF=_s1.CR=_s1.CRLF=_s1.CR_LF_LEN=_s1.CR_LF=void 0;_s1.setTransportFactory=$04;_s1.defaultPort=Z04;_s1.getUrlParseFn=Q04;_s1.newTransport=X04;_s1.getResolveFn=Y04;_s1.protoLen=Cs1;_s1.extractProtocolMessage=G04;var ae8=QG(),se8=HO(),ee8=Pp(),YG;function $04($){YG=$}function Z04(){return YG!==void 0&&YG.defaultPort!==void 0?YG.defaultPort:se8.DEFAULT_PORT}function Q04(){return YG!==void 0&&YG.urlParseFn?YG.urlParseFn:void 0}function X04(){if(!YG||typeof YG.factory!=="function")throw Error("transport fn is not set");return YG.factory()}function Y04(){return YG!==void 0&&YG.dnsResolveFn?YG.dnsResolveFn:void 0}_s1.CR_LF=`\r
|
|
1455
1455
|
`;_s1.CR_LF_LEN=_s1.CR_LF.length;_s1.CRLF=ee8.DataBuffer.fromAscii(_s1.CR_LF);_s1.CR=new Uint8Array(_s1.CRLF)[0];_s1.LF=new Uint8Array(_s1.CRLF)[1];function Cs1($){for(let Z=0;Z<$.length;Z++){let Q=Z+1;if($.byteLength>Q&&$[Z]===_s1.CR&&$[Q]===_s1.LF)return Q+1}return 0}function G04($){let Z=Cs1($);if(Z>0){let X=new Uint8Array($).slice(0,Z);return ae8.TD.decode(X)}return""}});var wn0=v((us1)=>{Object.defineProperty(us1,"__esModule",{value:!0});us1.ipV4=ys1;us1.isIP=D04;us1.parseIP=gs1;var Ap=4,nE=16,V70=48,bs1=57,xs1=65,O04=70,fs1=97,L04=102,Dn0=16777215;function ys1($,Z,Q,X){let Y=new Uint8Array(nE);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 D04($){return gs1($)!==void 0}function gs1($){for(let Z=0;Z<$.length;Z++)switch($[Z]){case".":return hs1($);case":":return w04($)}return}function hs1($){let Z=new Uint8Array(Ap);for(let Q=0;Q<Ap;Q++){if($.length===0)return;if(Q>0){if($[0]!==".")return;$=$.substring(1)}let{n:X,c:Y,ok:G}=E04($);if(!G||X>255)return;$=$.substring(Y),Z[Q]=X}return ys1(Z[0],Z[1],Z[2],Z[3])}function w04($){let Z=new Uint8Array(nE),Q=-1;if($.length>=2&&$[0]===":"&&$[1]===":"){if(Q=0,$=$.substring(2),$.length===0)return Z}let X=0;while(X<nE){let{n:Y,c:G,ok:J}=j04($);if(!J||Y>65535)return;if(G<$.length&&$[G]==="."){if(Q<0&&X!=nE-Ap)return;if(X+Ap>nE)return;let K=hs1($);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+=Ap;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<nE){if(Q<0)return;let Y=nE-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 E04($){let Z=0,Q=0;for(Z=0;Z<$.length&&V70<=$.charCodeAt(Z)&&$.charCodeAt(Z)<=bs1;Z++)if(Q=Q*10+($.charCodeAt(Z)-V70),Q>=Dn0)return{n:Dn0,c:Z,ok:!1};if(Z===0)return{n:0,c:0,ok:!1};return{n:Q,c:Z,ok:!0}}function j04($){let Z=0,Q=0;for(Q=0;Q<$.length;Q++){if(V70<=$.charCodeAt(Q)&&$.charCodeAt(Q)<=bs1)Z*=16,Z+=$.charCodeAt(Q)-V70;else if(fs1<=$.charCodeAt(Q)&&$.charCodeAt(Q)<=L04)Z*=16,Z+=$.charCodeAt(Q)-fs1+10;else if(xs1<=$.charCodeAt(Q)&&$.charCodeAt(Q)<=O04)Z*=16,Z+=$.charCodeAt(Q)-xs1+10;else break;if(Z>=Dn0)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 Tn0=v((ls1)=>{Object.defineProperty(ls1,"__esModule",{value:!0});ls1.Servers=ls1.ServerImpl=void 0;ls1.isIPV4OrHostname=cs1;ls1.hostPort=An0;var En0=pE(),jn0=m3(),zn0=wn0(),T04=HO(),R04=XG();function cs1($){if($.indexOf("[")!==-1||$.indexOf("::")!==-1)return!1;if($.indexOf(".")!==-1)return!0;if($.split(":").length<=2)return!0;return!1}function Pn0($){return!cs1($)}function I04($){let Q=$.toUpperCase().indexOf("::FFFF:");if(Q!==-1&&$.indexOf(".")!==-1){let X=$.substring(Q+7);return X=X.replace("[",""),X.replace("]","")}return $}function An0($){if($=$.trim(),$.match(/^(.*:\/\/)(.*)/m))$=$.replace(/^(.*:\/\/)(.*)/gm,"$2");if($=I04($),Pn0($)&&$.indexOf("[")===-1)$=`[${$}]`;let Z=Pn0($)?$.match(/(]:)(\d+)/):$.match(/(:)(\d+)/),Q=Z&&Z.length===3&&Z[1]&&Z[2]?parseInt(Z[2]):T04.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 wy{src;listen;hostname;port;didConnect;reconnects;lastConnect;gossiped;tlsName;resolves;constructor($,Z=!1){this.src=$,this.tlsName="";let Q=An0($);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,zn0.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}://${Pn0(X)?"["+X+"]":X}`);G.port=`${this.port}`;let J=new wy(G.host,!1);J.tlsName=this.hostname,Z.push(J)}}if($.randomize)(0,jn0.shuffle)(Z);return this.resolves=Z,Z}}ls1.ServerImpl=wy;class k70{firstSelect;servers;currentServer;tlsName;randomize;constructor($={}){this.firstSelect=!0,this.servers=[],this.tlsName="",this.randomize=$.randomize||!1}setServers($){if(!Array.isArray($)||$.length===0)throw R04.InvalidArgumentError.format("servers","cannot be empty");let Z=(0,En0.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}=An0(Y),J=Q.get(G);if(J)J.gossiped=!1,X.push(J);else X.push(new wy(Y))}if(this.randomize)(0,jn0.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,zn0.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,En0.getUrlParseFn)();$=Q?Q($):$;let X=new wy($,Z);if((0,zn0.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 k70.freezeAll(this.servers)}snapshotForHandler(){let $=this.currentServer;if(!$)return this.snapshot();let Z=this.servers.indexOf($);if(Z<=0)return this.snapshot();return k70.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,En0.getUrlParseFn)(),G=new Map;if($.connect_urls&&$.connect_urls.length>0)$.connect_urls.forEach((K)=>{K=Y?Y(K,Z):K;let W=new wy(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,jn0.shuffle)(W),this.servers=K?[K,...W]:W}return{added:Q,deleted:X}}}ls1.Servers=k70});var S70=v((ps1)=>{Object.defineProperty(ps1,"__esModule",{value:!0});ps1.QueuedIteratorImpl=void 0;var Rn0=m3(),ds1=XG();class is1{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,Rn0.deferred)(),this.yields=[],this.iterClosed=(0,Rn0.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 ds1.InvalidOperationError("iterator cannot be used when a callback is registered");if(this.yielding)throw new ds1.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,Rn0.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}}ps1.QueuedIteratorImpl=is1});var In0=v((rs1)=>{Object.defineProperty(rs1,"__esModule",{value:!0});rs1.MuxSubscription=void 0;var k04=HO(),ts1=XG();class os1{baseInbox;reqs;constructor(){this.reqs=new Map}size(){return this.reqs.size}init($){return this.baseInbox=`${(0,k04.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 ts1.NoRespondersError(X.requestSubject):null;X.resolver($,Z)}}}}close(){let $=new ts1.RequestError("connection closed");this.reqs.forEach((Z)=>{Z.resolver($,{})})}}rs1.MuxSubscription=os1});var qn0=v((es1)=>{Object.defineProperty(es1,"__esModule",{value:!0});es1.Heartbeat=void 0;var S04=m3();class ss1{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,S04.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})}}es1.Heartbeat=ss1});var kn0=v((Ye1)=>{Object.defineProperty(Ye1,"__esModule",{value:!0});Ye1.DenoBuffer=Ye1.MAX_SIZE=Ye1.AssertionError=void 0;Ye1.assert=Qe1;Ye1.concat=Xe1;Ye1.append=_04;Ye1.readAll=v04;Ye1.writeAll=x04;var C04=QG();class Mn0 extends Error{constructor($){super($);this.name="AssertionError"}}Ye1.AssertionError=Mn0;function Qe1($,Z="Assertion failed."){if(!$)throw new Mn0(Z)}var Ze1=32768;Ye1.MAX_SIZE=4294967294;function C70($,Z,Q=0){let X=Z.byteLength-Q;if($.byteLength>X)$=$.subarray(0,X);return Z.set($,Q),$.byteLength}function Xe1($,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 _04($,Z){return Xe1($,Uint8Array.of(Z))}class Vn0{_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($){Qe1($<=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=C70(this._buf.subarray(this._off),$);return this._off+=Z,Z}writeByte($){return this.write(Uint8Array.of($))}writeString($){return this.write(C04.TE.encode($))}write($){let Z=this._grow($.byteLength);return C70($,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)C70(this._buf.subarray(this._off),this._buf);else if(X+$>Ye1.MAX_SIZE)throw Error("The buffer cannot be grown beyond the maximum size.");else{let Y=new Uint8Array(Math.min(2*X+$,Ye1.MAX_SIZE));C70(this._buf.subarray(this._off),Y),this._buf=Y}return this._off=0,this._reslice(Math.min(Z+$,Ye1.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(Ze1);while(!0){let X=this.capacity-this.length<Ze1,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}}}Ye1.DenoBuffer=Vn0;function v04($){let Z=new Vn0;return Z.readFrom($),Z.bytes()}function x04($,Z){let Q=0;while(Q<Z.length)Q+=$.write(Z.subarray(Q))}});var _n0=v((He1)=>{Object.defineProperty(He1,"__esModule",{value:!0});He1.cc=He1.State=He1.Parser=He1.Kind=void 0;He1.describe=c04;var Sn0=kn0(),Cn0=QG();He1.Kind={OK:0,ERR:1,MSG:2,INFO:3,PING:4,PONG:5};function c04($){let Z,Q="";switch($.kind){case He1.Kind.MSG:Z="MSG";break;case He1.Kind.OK:Z="OK";break;case He1.Kind.ERR:Z="ERR",Q=Cn0.TD.decode($.data);break;case He1.Kind.PING:Z="PING";break;case He1.Kind.PONG:Z="PONG";break;case He1.Kind.INFO:Z="INFO",Q=Cn0.TD.decode($.data)}return`${Z}: ${Q}`}function Je1(){let $={};return $.sid=-1,$.hdr=-1,$.size=-1,$}var Ke1=48,l04=57,Ey=67108864;class We1{dispatcher;state;as;drop;hdr;ma;argBuf;msgBuf;constructor($){this.dispatcher=$,this.state=He1.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 He1.State.OP_START:switch(Q){case He1.cc.M:case He1.cc.m:this.state=He1.State.OP_M,this.hdr=-1,this.ma=Je1();break;case He1.cc.H:case He1.cc.h:this.state=He1.State.OP_H,this.hdr=0,this.ma=Je1();break;case He1.cc.P:case He1.cc.p:this.state=He1.State.OP_P;break;case He1.cc.PLUS:this.state=He1.State.OP_PLUS;break;case He1.cc.MINUS:this.state=He1.State.OP_MINUS;break;case He1.cc.I:case He1.cc.i:this.state=He1.State.OP_I;break;default:throw this.fail($.subarray(Z))}break;case He1.State.OP_H:switch(Q){case He1.cc.M:case He1.cc.m:this.state=He1.State.OP_M;break;default:throw this.fail($.subarray(Z))}break;case He1.State.OP_M:switch(Q){case He1.cc.S:case He1.cc.s:this.state=He1.State.OP_MS;break;default:throw this.fail($.subarray(Z))}break;case He1.State.OP_MS:switch(Q){case He1.cc.G:case He1.cc.g:this.state=He1.State.OP_MSG;break;default:throw this.fail($.subarray(Z))}break;case He1.State.OP_MSG:switch(Q){case He1.cc.SPACE:case He1.cc.TAB:this.state=He1.State.OP_MSG_SPC;break;default:throw this.fail($.subarray(Z))}break;case He1.State.OP_MSG_SPC:switch(Q){case He1.cc.SPACE:case He1.cc.TAB:continue;default:this.state=He1.State.MSG_ARG,this.as=Z}break;case He1.State.MSG_ARG:switch(Q){case He1.cc.CR:this.drop=1;break;case He1.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=He1.State.MSG_PAYLOAD,Z=this.as+this.ma.size-1;break}default:if(this.argBuf)this.argBuf.writeByte(Q)}break;case He1.State.MSG_PAYLOAD:if(this.msgBuf)if(this.msgBuf.length>=this.ma.size){let X=this.msgBuf.bytes({copy:!1});this.dispatcher.push({kind:He1.Kind.MSG,msg:this.ma,data:X}),this.argBuf=void 0,this.msgBuf=void 0,this.state=He1.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:He1.Kind.MSG,msg:this.ma,data:$.subarray(this.as,Z)}),this.argBuf=void 0,this.msgBuf=void 0,this.state=He1.State.MSG_END;break;case He1.State.MSG_END:switch(Q){case He1.cc.NL:this.drop=0,this.as=Z+1,this.state=He1.State.OP_START;break;default:continue}break;case He1.State.OP_PLUS:switch(Q){case He1.cc.O:case He1.cc.o:this.state=He1.State.OP_PLUS_O;break;default:throw this.fail($.subarray(Z))}break;case He1.State.OP_PLUS_O:switch(Q){case He1.cc.K:case He1.cc.k:this.state=He1.State.OP_PLUS_OK;break;default:throw this.fail($.subarray(Z))}break;case He1.State.OP_PLUS_OK:switch(Q){case He1.cc.NL:this.dispatcher.push({kind:He1.Kind.OK}),this.drop=0,this.state=He1.State.OP_START;break}break;case He1.State.OP_MINUS:switch(Q){case He1.cc.E:case He1.cc.e:this.state=He1.State.OP_MINUS_E;break;default:throw this.fail($.subarray(Z))}break;case He1.State.OP_MINUS_E:switch(Q){case He1.cc.R:case He1.cc.r:this.state=He1.State.OP_MINUS_ER;break;default:throw this.fail($.subarray(Z))}break;case He1.State.OP_MINUS_ER:switch(Q){case He1.cc.R:case He1.cc.r:this.state=He1.State.OP_MINUS_ERR;break;default:throw this.fail($.subarray(Z))}break;case He1.State.OP_MINUS_ERR:switch(Q){case He1.cc.SPACE:case He1.cc.TAB:this.state=He1.State.OP_MINUS_ERR_SPC;break;default:throw this.fail($.subarray(Z))}break;case He1.State.OP_MINUS_ERR_SPC:switch(Q){case He1.cc.SPACE:case He1.cc.TAB:continue;default:this.state=He1.State.MINUS_ERR_ARG,this.as=Z}break;case He1.State.MINUS_ERR_ARG:switch(Q){case He1.cc.CR:this.drop=1;break;case He1.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:He1.Kind.ERR,data:X}),this.drop=0,this.as=Z+1,this.state=He1.State.OP_START;break}default:if(this.argBuf)this.argBuf.write(Uint8Array.of(Q))}break;case He1.State.OP_P:switch(Q){case He1.cc.I:case He1.cc.i:this.state=He1.State.OP_PI;break;case He1.cc.O:case He1.cc.o:this.state=He1.State.OP_PO;break;default:throw this.fail($.subarray(Z))}break;case He1.State.OP_PO:switch(Q){case He1.cc.N:case He1.cc.n:this.state=He1.State.OP_PON;break;default:throw this.fail($.subarray(Z))}break;case He1.State.OP_PON:switch(Q){case He1.cc.G:case He1.cc.g:this.state=He1.State.OP_PONG;break;default:throw this.fail($.subarray(Z))}break;case He1.State.OP_PONG:switch(Q){case He1.cc.NL:this.dispatcher.push({kind:He1.Kind.PONG}),this.drop=0,this.state=He1.State.OP_START;break}break;case He1.State.OP_PI:switch(Q){case He1.cc.N:case He1.cc.n:this.state=He1.State.OP_PIN;break;default:throw this.fail($.subarray(Z))}break;case He1.State.OP_PIN:switch(Q){case He1.cc.G:case He1.cc.g:this.state=He1.State.OP_PING;break;default:throw this.fail($.subarray(Z))}break;case He1.State.OP_PING:switch(Q){case He1.cc.NL:this.dispatcher.push({kind:He1.Kind.PING}),this.drop=0,this.state=He1.State.OP_START;break}break;case He1.State.OP_I:switch(Q){case He1.cc.N:case He1.cc.n:this.state=He1.State.OP_IN;break;default:throw this.fail($.subarray(Z))}break;case He1.State.OP_IN:switch(Q){case He1.cc.F:case He1.cc.f:this.state=He1.State.OP_INF;break;default:throw this.fail($.subarray(Z))}break;case He1.State.OP_INF:switch(Q){case He1.cc.O:case He1.cc.o:this.state=He1.State.OP_INFO;break;default:throw this.fail($.subarray(Z))}break;case He1.State.OP_INFO:switch(Q){case He1.cc.SPACE:case He1.cc.TAB:this.state=He1.State.OP_INFO_SPC;break;default:throw this.fail($.subarray(Z))}break;case He1.State.OP_INFO_SPC:switch(Q){case He1.cc.SPACE:case He1.cc.TAB:continue;default:this.state=He1.State.INFO_ARG,this.as=Z}break;case He1.State.INFO_ARG:switch(Q){case He1.cc.CR:this.drop=1;break;case He1.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:He1.Kind.INFO,data:X}),this.drop=0,this.as=Z+1,this.state=He1.State.OP_START;break}default:if(this.argBuf)this.argBuf.writeByte(Q)}break;default:throw this.fail($.subarray(Z))}}if((this.state===He1.State.MSG_ARG||this.state===He1.State.MINUS_ERR_ARG||this.state===He1.State.INFO_ARG)&&!this.argBuf)this.argBuf=new Sn0.DenoBuffer($.subarray(this.as,Z-this.drop));if(this.state===He1.State.MSG_PAYLOAD&&!this.msgBuf){if(!this.argBuf)this.cloneMsgArg();this.msgBuf=new Sn0.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 Sn0.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 He1.cc.SPACE:case He1.cc.TAB:case He1.cc.CR:case He1.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],Ey);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],Ey);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}: ${Cn0.TD.decode($)}`)}processHeaderMsgArgs($){let Z=[],Q=-1;for(let X=0;X<$.length;X++)switch($[X]){case He1.cc.SPACE:case He1.cc.TAB:case He1.cc.CR:case He1.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],Ey),this.ma.size=this.protoParseInt(Z[3],Ey);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],Ey),this.ma.size=this.protoParseInt(Z[4],Ey);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]<Ke1||$[X]>l04)return-1;Q=Q*10+($[X]-Ke1)}return Z!==void 0&&Q>Z?-1:Q}}He1.Parser=We1;He1.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};He1.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 x70=v((Ne1)=>{Object.defineProperty(Ne1,"__esModule",{value:!0});Ne1.MsgHdrsImpl=void 0;Ne1.canonicalMIMEHeaderKey=xn0;Ne1.headers=i04;var Fe1=QG(),d3=HO(),v70=XG();function xn0($){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 v70.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 i04($=0,Z=""){if($===0&&Z!=="")throw v70.InvalidArgumentError.format("code","is required");else if($>0&&Z==="")throw v70.InvalidArgumentError.format("description","is required");return new jy($,Z)}var vn0="NATS/1.0";class jy{_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 jy,X=Fe1.TD.decode($).split(`\r
|
|
1456
1456
|
`),Y=X[0];if(Y!==vn0){let G=Y.replace(vn0,"").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 $=vn0;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
|
|
1457
1457
|
${Z}: ${Q[X]}`;return`${$}\r
|
|
@@ -2384,9 +2384,9 @@ Repositories imported into this organization:
|
|
|
2384
2384
|
${Q}
|
|
2385
2385
|
|
|
2386
2386
|
Pass the connectionId of the repo to load.`}async function RV$($){let{ctx:Z,orgId:Q,virtualMcpId:X,userId:Y,threadId:G,writer:J,rebindFs:K}=$;if(!IJ(X))return null;let W=await Em4(Z,Q);if(W.length===0)return null;let H=new Map(W.map((F)=>[F.connectionId,F]));return k$({description:zm4(W),inputSchema:Z0(PV$.object({connectionId:PV$.string().describe("connectionId of the imported repository to load (see the list in this tool's description).")})),execute:async({connectionId:F})=>{let N=H.get(F);if(!N)return{success:!1,error:`No imported repository found for connectionId "${F}". Available: ${W.map((M)=>M.connectionId).join(", ")||"none"}.`};let U=eN(G,N.connectionId),B={url:`https://github.com/${N.owner}/${N.repo}`,owner:N.owner,name:N.repo,installationId:N.installationId,connectionId:N.connectionId},O=await Z.storage.threads.get(G);await Z.storage.threads.update(G,{metadata:{...O?.metadata??{},githubRepo:B},branch:U,updated_by:Y});let D=await vu({virtualMcpId:X,branch:U},Z),w=ir(b9(O?.metadata),Y,U,D);J.write({type:"data-open-preview",id:G,data:{previewUrl:D.previewUrl??null,branch:U,githubRepo:B,sandboxMap:w}});let E=await xu(Z,{virtualMcpId:X,branch:U,userId:Y,threadId:G}),j=Date.now()+AV$,z="",A=!1,P=0,I=null;while(Date.now()<j){let M=await E.onBash("if git -C /app/repo rev-parse HEAD >/dev/null 2>&1; then echo __CLONED__; fi; ls -A /app/repo 2>/dev/null").then((m)=>({ok:!0,stdout:m.stdout})).catch(()=>({ok:!1,stdout:""}));if(!M.ok){if(++P>=wm4)break;await H$(TV$);continue}P=0;let S=jm4(M.stdout);if(S.cloned&&S.listing===I){A=!0,z=S.listing;break}I=S.cloned?S.listing:null,await H$(TV$)}let q=!1;if(A&&K)try{await K(U),q=!0}catch(M){console.warn("[load_repo] live fs rebind failed",M)}return{success:!0,repo:`${N.owner}/${N.repo}`,previewUrl:D.previewUrl??null,cloned:A,files:z,message:!A?`Loaded ${N.owner}/${N.repo} and opened the Preview, but the clone did not finish within ${Math.round(AV$/1000)}s. It may still be in progress \u2014 your file tools will use it next message.`:q?`Loaded ${N.owner}/${N.repo} and opened the Preview. The repo is cloned and its dev server is booting. Your file tools (read/write/edit/bash/grep/glob) now operate on it \u2014 you can use it right away.`:`Loaded ${N.owner}/${N.repo} and opened the Preview. The repo is cloned and its dev server is booting. Your file tools operate on it from your next message.`}}})}var AV$=120000,TV$=1500,wm4=5;var $A0=L(()=>{J4();j4();GY();g8();EY();ka();CK();eP0()});import{AsyncLocalStorage as Pm4}from"async_hooks";function ZA0(){let $=FU.getStore();if(!$)throw Error("This tool is only available on a task run's MCP endpoint (/api/<org>/mcp/task-run/<threadId>).");return $}function qV$($){return jH.some((Q)=>zz($,Q))?b91:IV$}var FU,IV$,b91;var jD=L(()=>{h6();FU=new Pm4;IV$=["TASK_ADD_REPO","TASK_BOARD_ITEM_LIST","TASK_BOARD_ITEM_UPDATE","TASK_BOARD_ITEM_PRS_GET","TASK_BOARD_ITEM_PR_LINK","TASK_BOARD_ACTIVITY_LIST","TASK_BOARD_COMMENT_LIST","TASK_BOARD_COMMENT_CREATE","TASK_BOARD_COMMENT_UPDATE"],b91=[...IV$,"TASK_BOARD_REVIEW_DECISION"]});import{z as nJ}from"zod";async function Im4($,Z,Q,X){return j6(async()=>{let Y=VH(await HK0($,Z),Q,X);if(!Y)throw Error("sandbox record not written yet");return Y},{maxAttempts:Am4,minTimeout:Tm4,maxTimeout:Rm4,jitter:0}).catch(()=>null)}function Mm4($,Z,Q=CV$){let X=(G)=>`${G.owner}/${G.name}`.toLowerCase(),Y=X(Z);if($.some((G)=>X(G)===Y))return!1;return $.length>=Q}async function kV$($,Z,Q,X){let Y=await $.proxyDaemonRequest(Z,"/_sandbox/bash",{method:"POST",headers:new Headers({"content-type":"application/json","x-thread-id":Q}),body:JSON.stringify({command:X})});if(!Y.ok)throw Error(`sandbox bash failed (${Y.status} ${Y.statusText})`);let G=await Y.json();return{stdout:G.stdout??"",exitCode:G.exitCode??0}}function Vm4($){let Z=$.split(`
|
|
2387
|
-
`).map((
|
|
2387
|
+
`).map((Y)=>Y.trim()),Q=Z.includes("__CLONED__"),X=Z.filter((Y)=>Y&&Y!==".git"&&Y!=="__CLONED__");return{cloned:Q,listing:X.join(`
|
|
2388
2388
|
`)}}async function Sm4($,Z){let{items:Q}=await $.storage.connections.list(Z,{slug:"mcp-github"});return fu(Q)}async function Cm4($,Z){let Q=or(Z);return(await Promise.all(Z.map(async(Y,G)=>{if(!Y.connectionId)return null;try{let{cloneUrl:J}=await kH(Y.connectionId,Y.owner,Y.name,$.db,$.vault,{bufferMs:SV$});return{cloneUrl:J,repoName:Q[G],submoduleCredentials:[]}}catch(J){return console.warn(`[TASK_ADD_REPO] skipping secondary ${Y.owner}/${Y.name}:`,J instanceof Error?J.message:J),null}}))).filter((Y)=>Y!==null)}var SV$=3300000,Am4=4,Tm4=250,Rm4=2000,MV$=45000,VV$=1500,qm4=5,CV$=20,km4,y91;var _V$=L(()=>{k0();$A0();aP0();bK();Ou();EY();CK();J4();jD();km4=['token=$(git remote get-url origin | sed -n "s|.*x-access-token:\\([^@]*\\)@.*|\\1|p")','[ -n "$token" ] || exit 0','mkdir -p "${HOME:-/root}/.config/gh"',"umask 077",'printf "github.com:\\n oauth_token: %s\\n git_protocol: https\\n" "$token" > "${HOME:-/root}/.config/gh/hosts.yml"'].join(`
|
|
2389
|
-
`);y91=c({name:"TASK_ADD_REPO",description:"Clone one of this organization's repositories into your working directory. "+"Your working directory is EMPTY until you call this \u2014 do not look for "+"files, and do not run git, before it returns. Call it once, with the repository the task is about; it waits for the checkout and returns the repository root listing, so you can start reading files immediately after. `git` and `gh` are authenticated once it returns. Call TASK_ADD_REPO with no arguments to list the repositories available.",annotations:{title:"Add Repository",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!0},inputSchema:nJ.object({connectionId:nJ.string().optional().describe("connectionId of the repository to clone. Omit to list the available repositories.")}),outputSchema:nJ.object({success:nJ.boolean(),repositories:nJ.array(nJ.object({connectionId:nJ.string(),repo:nJ.string()})).optional(),repo:nJ.string().optional(),cloned:nJ.boolean().optional(),files:nJ.string().optional(),message:nJ.string()}),handler:async($,Z)=>{s(Z),await Z.access.check();let Q=a(Z),X=a0(Z);if(!X)throw Error("User ID required");let{threadId:Y}=ZA0(),G=await Sm4(Z,Q.id),J=$.connectionId?G.find((l)=>l.connectionId===$.connectionId):void 0;if(!J){let l=G.map((y)=>({connectionId:y.connectionId,repo:`${y.owner}/${y.repo}`}));return{success:!1,repositories:l,message:$.connectionId?`No imported repository for connectionId "${$.connectionId}". Pick one of the repositories listed.`:l.length===0?"This organization has no repositories imported, so none can be cloned.":"Pick a repository and call TASK_ADD_REPO again with its connectionId."}}let K=await Z.storage.threads.get(Y);if(!K)throw Error(`Thread not found: ${Y}`);let W=await WK0(Z,{threadId:Y,runBranch:K.branch}),H=await bz(Z,W,X),F=await AX(Z),N=await Im4(Z,Y,H,W);if(!N)throw Error(`No sandbox is registered for this run (thread ${Y}), so there is nowhere to clone into.`);let U=K.metadata?.githubRepo?.owner,B=K.metadata?.githubRepos??[];if(U&&Mm4(B,{owner:J.owner,name:J.repo}))return{success:!1,repo:`${J.owner}/${J.repo}`,cloned:!1,message:`This run already has ${CV$} additional repositories checked out, which is the limit. Work with what's already checked out instead of adding another.`};await JD({ctx:Z,connectionId:J.connectionId,organizationId:Q.id,forceRefresh:!0,onLegacyMintError:(l)=>console.error("[TASK_ADD_REPO] legacy repo-scoped mint failed",{connectionId:J.connectionId,error:l.message})});let{cloneUrl:O,gitUserName:D,gitUserEmail:w}=await kH(J.connectionId,J.owner,J.repo,Z.db,Z.vault,{bufferMs:SV$}),E={url:`https://github.com/${J.owner}/${J.repo}`,owner:J.owner,name:J.repo,installationId:J.installationId,connectionId:J.connectionId},j=!U,z=j?[]:await Z.storage.threads.appendThreadGithubRepo(Y,E);if(j)await Z.storage.threads.update(Y,{metadata:{...K.metadata??{},githubRepo:E},updated_by:X});let A=rP0({branch:W,derivedRef:$U(W),recordedHeadRef:null,sticky:!1}),P=await F.proxyDaemonRequest(N.sandboxHandle,"/_sandbox/config",{method:"PUT",headers:new Headers({"content-type":"application/json"}),body:JSON.stringify({git:{...j?{repository:{cloneUrl:O,branch:A,repoName:`${J.owner}/${J.repo}`}}:{repositories:await Cm4(Z,z)},identity:{userName:D,userEmail:w}}})});if(!P.ok)throw Error(`the sandbox rejected the repository (${P.status} ${P.statusText})`);await F.proxyDaemonRequest(N.sandboxHandle,"/_sandbox/setup/clone",{method:"POST",headers:new Headers({"content-type":"application/json"}),body:"{}"}).catch((l)=>{console.warn("[TASK_ADD_REPO] explicit clone kick failed",l)});let I=j?null:LP$(z,{owner:J.owner,name:J.repo}),q=j||!I?".":`"$(dirname "$PWD")/repos/${I}"`,M=Date.now()+MV$,S=!1,m="",f=0,b=null;while(Date.now()<M){let l=await kV$(F,N.sandboxHandle,Y,`cd ${q} 2>/dev/null || exit 1; if git rev-parse HEAD >/dev/null 2>&1; then echo __CLONED__; fi; ls -A 2>/dev/null`).catch(()=>null);if(!l){if(++f>=qm4)break;await H$(VV$);continue}f=0;let y=Vm4(l.stdout);if(y.cloned&&y.listing===b){S=!0,m=y.listing;break}b=y.cloned?y.listing:null,await H$(VV$)}if(S)await kV$(F,N.sandboxHandle,Y,km4).catch((l)=>console.warn("[TASK_ADD_REPO] gh auth setup failed",l));return{success:S,repo:`${J.owner}/${J.repo}`,cloned:S,files:m,message:S?j?`${J.owner}/${J.repo} is checked out at your working directory on branch ${A}. \`git\` and \`gh\` are authenticated. Start working.`:`${J.owner}/${J.repo} is checked out at ../repos/${I}, beside your working directory, on its default branch. \`git\` and \`gh\` are authenticated there too. Your first checkout is untouched \u2014 commit and open a pull request in each repository you change.`:`The clone of ${J.owner}/${J.repo} did not finish within ${Math.round(MV$/1000)}s. It may still be in progress \u2014 check your working directory before calling this again.`}}})});function fV$($){return typeof $==="string"&&g91.includes($)}function xV$($){if(!$.startsAt)return null;let Z=Date.parse($.startsAt);return Number.isNaN(Z)?null:Z}function bV$($,Z){let Q=vV$[$.state]-vV$[Z.state];if(Q!==0)return Q;let X=xV$($),Y=xV$(Z);if(X===null||Y===null){if(X!==Y)return X===null?1:-1}else if(X!==Y)return $.state==="closed"?Y-X:X-Y;return $.name.localeCompare(Z.name)||$.id.localeCompare(Z.id)}var g91,vV$;var QA0=L(()=>{g91=["active","future","closed"];vV$={active:0,future:1,closed:2}});import{z as I1}from"zod";var XA0=50000,YA0=500,GA0=200,yK,yV$,Sa,Dv,_m4,vm4,xm4,gV$,bu,fm4,bm4,hV$;var gK=L(()=>{QA0();h6();h6();yK=I1.enum(["triage","todo","in_progress","in_review","approved","merged","post_deploy_validation","done","archived"]),yV$=I1.object({id:I1.string(),name:I1.string(),state:I1.enum(g91),startsAt:I1.string().nullable(),endsAt:I1.string().nullable()}),Sa=I1.enum(["bug","feature","chore","spike","security"]),Dv=I1.enum(["none","low","medium","high","urgent"]),_m4=I1.object({threadId:I1.string(),virtualMcpId:I1.string().nullable(),status:I1.enum(["in_progress","requires_action","failed","completed","expired"]).nullable(),title:I1.string().nullable(),lastMessage:I1.string().nullable(),hasPreview:I1.boolean(),failureKind:I1.string().nullable(),hasMessages:I1.boolean(),costUsd:I1.number().nullable(),costProvider:I1.string().nullable(),createdAt:I1.string(),lastActiveAt:I1.string()}),vm4=I1.object({reviewer:I1.enum(jH),verdict:I1.enum(["approved","changes_requested"]),verified:I1.boolean()}),xm4=I1.object({id:I1.string(),name:I1.string(),color:I1.string().nullable().describe('Hex color, e.g. "#3b82f6"'),createdBy:I1.string(),createdAt:I1.string().datetime()}),gV$=I1.object({url:I1.string(),number:I1.number(),repoOwner:I1.string(),repoName:I1.string(),createdAt:I1.string(),title:I1.string().nullable(),body:I1.string().nullable(),state:I1.enum(["open","closed"]).nullable(),draft:I1.boolean().nullable(),merged:I1.boolean().nullable(),mergeable:I1.boolean().nullable(),checksStatus:I1.enum(["pending","passing","failing"]).nullable(),checks:I1.array(I1.object({name:I1.string(),status:I1.string(),conclusion:I1.string().nullable(),detailsUrl:I1.string().nullable(),summary:I1.string().nullable()})),previewUrl:I1.string().nullable()}),bu=I1.object({id:I1.string(),organizationId:I1.string(),title:I1.string(),description:I1.string().nullable(),status:yK,priority:Dv,type:Sa,assigneeId:I1.string().nullable(),assignedBy:I1.string().nullable(),repo:I1.string().nullable(),dueDate:I1.string().datetime().nullable(),sprintId:I1.string().nullable(),sortOrder:I1.number(),keySeq:I1.number().nullable(),jiraIssueKey:I1.string().nullable(),retryAttempts:I1.number(),threads:I1.array(_m4),tags:I1.array(xm4),reviewVerdicts:I1.array(vm4),createdBy:I1.string(),createdAt:I1.string().datetime(),updatedBy:I1.string(),updatedAt:I1.string().datetime()}),fm4=["created","status_changed","assignee_changed","priority_changed","due_date_changed","title_changed","description_changed","tags_changed","review_requested","review_approved","review_changes_requested","merge_conflict_resolution","merge_failed","type_changed"],bm4=I1.enum(fm4),hV$=I1.object({id:I1.string(),taskBoardItemId:I1.string(),action:bm4,actorId:I1.string().nullable(),data:I1.record(I1.string(),I1.unknown()),occurredAt:I1.string().datetime()})});async function JA0($,Z,Q){if(Q===F8)return;let{members:X}=await $.boundAuth.organization.listMembers({organizationId:Z,filterField:"userId",filterValue:Q});if(!X.some((Y)=>Y.userId===Q))throw Error("assigneeId is not a member of the organization")}var h91=L(()=>{gK()});function lV$($){let Z={};for(let[Q,X]of Object.entries($)){if(Q.startsWith(ym4))continue;Z[Q]=X}return Z}function KA0($){return{taskBoardItemId:$.id,...HY($)&&{[uV$]:cV$}}}function gm4($){return $?.[uV$]===cV$}function hm4($){if(/[:\s]/.test($))throw Error("organization id unsuitable for the subsidy key scheme");return`subsidy:${$}`}async function um4($,Z){let Q=y0();try{let X=await $.storage.subsidizedGatewayKeys.get(Z);if(X)return X;let Y=$.auth?.user?.id;if(Y&&Q.aiGatewayEnabled&&Q.studioProvisionSecretKey&&RL.provisionKey){let G=await uW(Y,$.auth?.user?.email),J=await RL.provisionKey(G,hm4(Z));return await $.storage.subsidizedGatewayKeys.put(Z,J),J}}catch(X){console.error("[subsidized-runs] subsidy key unavailable \u2014 run stays on the org's key:",X)}return}async function mV$($,Z,Q){if(!y0().taskQuotaEnforced)return;if(!gm4(Q))return;let X=Q?.taskBoardItemId;if(!X)return;let Y=await $.storage.taskBoard.getById(X,Z);if(!Y||!HY(Y))return;if(!await DL$($,X))return;return await um4($,Z)}function dV$($,Z){if(!Z)return $;if($.providerId!=="deco")return $;return{...$,apiKey:Z}}var ym4="srv.",uV$="srv.billing",cV$="subscription";var Ca=L(()=>{qJ0();EO();R$();hJ()});function WA0($){let Z=$?.runClass;return Z&&Z in u91?u91[Z]:u91.interactive}var u91,yu="runClass";var gu=L(()=>{u91={interactive:10,reviewer:20,retry:30,new_task:40}});async function c91($,Z,Q){let X;try{return await Promise.race([$.aiProviders.listModels(Z,Q),new Promise((G,J)=>{X=setTimeout(()=>J(Error("listModels timeout")),cm4)})])}finally{if(X)clearTimeout(X)}}function lm4($,Z){switch($){case"fast":return Z.chat.fast;case"smart":return Z.chat.smart;case"thinking":return Z.chat.thinking;case"image":return Z.image;case"web_search":return Z.webSearch;case"deep_research":return Z.deepResearch}}function l91($,Z,Q){let X=$.find((Y)=>Y.modelId===Z);return{title:X?.title??Q??Z,providerId:X?.providerId,capabilities:X?.capabilities,limits:X?.limits??null}}async function Z7($,Z,Q){let X=$.organization?.id;if(!X)throw Error("resolveTier called without an organization");let G=(await $.storage.organizationSettings.get(X))?.simple_mode?.tiers?.[Z]??null,J=$.auth?.user?.id,K=yL.safeParse(Z),W=Q?.applyUserPrefs&&K.success&&J?(await $.storage.userModelPreferences.get(J,X))?.tiers?.[K.data]??null:null,H=(await $.storage.aiProviderKeys.list({organizationId:X})).filter((O)=>Kj(O.providerId));for(let O of[W,G])if(O&&H.some((D)=>D.id===O.keyId)){let D=await c91($,O.keyId,X).catch(()=>[]);return{credentialId:O.keyId,modelId:O.modelId,modelMeta:l91(D,O.modelId,O.title)}}if(H.length===0)throw new hu(Z);let F={};await Promise.all(H.map(async(O)=>{F[O.id]=await c91($,O.id,X).catch(()=>[])}));let N=H.map((O)=>({id:O.id,providerId:O.providerId,label:O.label,presetId:O.presetId,createdBy:O.createdBy,createdAt:O.createdAt})),U=q7$(N,F),B=lm4(Z,U);if(!B)throw new hu(Z);return{credentialId:B.keyId,modelId:B.modelId,modelMeta:l91(F[B.keyId]??[],B.modelId,B.title)}}async function iV$($,Z,Q){let X=$.organization?.id;if(!X)throw Error("resolveSpecificModel called without an organization");let Y=await $.storage.aiProviderKeys.findById(Z,X).catch((J)=>{if(J instanceof Error&&J.message==="Provider key not found")throw new _a(`AI provider credential "${Z}" was not found`,{cause:J});throw J});if(!Kj(Y.providerId))throw new _a(`AI provider credential "${Z}" uses native-only provider "${Y.providerId}" and cannot run a hosted model`);let G=await c91($,Z,X).catch(()=>[]);return{credentialId:Z,modelId:Q,modelMeta:l91(G,Q)}}async function tJ($,Z){try{return await Z7($,Z)}catch(Q){if(Q instanceof hu)return null;return console.warn(`[resolveTier] tier "${Z}" resolution failed:`,Q),null}}var hu,_a,cm4=5000;var NU=L(()=>{rZ();g8();hu=class hu extends Error{tier;constructor($){super(`No model available for tier "${$}". Connect a provider or configure the tier in organization settings.`);this.tier=$;this.name="TierUnavailableError"}};_a=class _a extends Error{constructor($,Z){super($,Z);this.name="SpecificModelCredentialUnavailableError"}}});function pV$($){return $ instanceof fH||typeof $==="object"&&$!==null&&$.permanent===!0}var fH;var m91=L(()=>{fH=class fH extends Error{permanent=!0;code;constructor($,Z){super(Z);this.name="PermanentRunError",this.code=$}}});function tV$($){return $==="reviewer"?"reviewer":"default"}function rV$($,Z="default"){let{providerId:Q,apiKey:X,baseUrl:Y}=$,G=dm4[Z],J={CLAUDE_CODE_MAX_OUTPUT_TOKENS:`${mm4}`,CLAUDE_CODE_MAX_TURNS:G===null?null:`${G}`};if(Q==="anthropic")return{...J,CLAUDE_CODE_MODEL:d91.anthropic[Z],ANTHROPIC_API_KEY:X,ANTHROPIC_AUTH_TOKEN:null,CLAUDE_CODE_OAUTH_TOKEN:null,ANTHROPIC_BASE_URL:Y??null};if(Q==="claude-subscription")return{...J,CLAUDE_CODE_MODEL:d91.anthropic[Z],CLAUDE_CODE_OAUTH_TOKEN:X,ANTHROPIC_API_KEY:null,ANTHROPIC_AUTH_TOKEN:null,ANTHROPIC_BASE_URL:null};if(Q==="openrouter"||Q==="deco")return{...J,CLAUDE_CODE_MODEL:d91.openrouter[Z],ANTHROPIC_API_KEY:"",ANTHROPIC_AUTH_TOKEN:X,CLAUDE_CODE_OAUTH_TOKEN:null,ANTHROPIC_BASE_URL:Y??"https://openrouter.ai/api"};throw new oV$(Q)}var nV$="claude-subscription",d91,HA0="claudeCodeModelClass",mm4=32000,dm4,oV$;var FA0=L(()=>{d91={anthropic:{default:"claude-opus-5",reviewer:"claude-sonnet-5"},openrouter:{default:"anthropic/claude-opus-5",reviewer:"anthropic/claude-sonnet-5"}};dm4={default:null,reviewer:60};oV$=class oV$ extends Error{constructor($){super(`the claude-code harness needs an Anthropic, OpenRouter or Deco model credential; this run's model resolves to "${$}". Point the agent's thinking model at one of those, or run it with Decopilot.`);this.name="UnsupportedClaudeCodeProviderError"}}});import{z as p1}from"zod";var aV$,im4,va,pm4,nm4,pZZ;var sV$=L(()=>{aV$=p1.object({chunks:p1.array(p1.unknown()),done:p1.boolean().nullish().transform(($)=>$??!1),error:p1.object({code:p1.string(),message:p1.string()}).nullish().transform(($)=>$??null)}),im4=p1.record(p1.string(),p1.unknown()),va=p1.object({id:p1.string(),title:p1.string().optional(),provider:p1.string().nullable().optional(),credentialId:p1.string(),limits:p1.object({contextWindow:p1.number().int().positive().optional(),maxOutputTokens:p1.number().int().positive().optional()}).optional(),capabilities:p1.object({vision:p1.boolean().optional(),text:p1.boolean().optional(),reasoning:p1.boolean().optional()}).optional()}).strict(),pm4=p1.object({thinking:va.extend({title:p1.string()}),fast:va.optional(),smart:va.optional(),image:va.optional(),deepResearch:va.optional()}).strict(),nm4=p1.discriminatedUnion("cwd",[p1.object({cwd:p1.literal("/repo"),repo:p1.object({owner:p1.string(),name:p1.string(),connectedGithub:p1.boolean()}).strict().optional(),branch:p1.string().nullable()}).strict(),p1.object({cwd:p1.null()}).strict()]),pZZ=p1.object({threadId:p1.string(),userMessage:im4,harness:p1.object({sessionId:p1.string().optional()}).strict(),workspace:nm4,models:pm4,mcp:p1.object({url:p1.string().url(),headers:p1.record(p1.string(),p1.string()),expiresAt:p1.number().int().positive()}).strict(),orgMcps:p1.array(p1.object({name:p1.string(),url:p1.string().url(),headers:p1.record(p1.string(),p1.string())}).strict()).optional(),mode:p1.enum(["default","plan","web-search","gen-image"]),temperature:p1.number(),toolApprovalLevel:p1.enum(["auto","readonly"]),toolAllowlist:p1.array(p1.string()).nullable().optional(),maxAgentSteps:p1.number().int().optional(),user:p1.object({id:p1.string(),email:p1.string()}).strict(),organizationId:p1.string(),agent:p1.object({id:p1.string(),instructions:p1.string().optional(),disallowedTools:p1.array(p1.string()).optional()}).strict(),currentThreadTitle:p1.string().optional(),resume:p1.object({reason:p1.string()}).strict().optional()}).strict()});var eV$="sandbox_gone",NA0="[SANDBOX_UNREACHABLE]";function tm4($){let Z=[$.contentType??"file"];if($.size!=null)Z.push(`${$.size} bytes`);return Z.join(", ")}function om4($){let Z=($??[]).filter((X)=>X.kind!=="skill");if(Z.length===0)return null;return["<knowledge>","The following files are attached to you as reference knowledge. They are mounted in your sandbox at the paths below; read them with your file tools when relevant to the task, and treat them as authoritative reference material.","","Attached files:",Z.map((X)=>`- ${X.name} (${tm4(X)}), read it at \`${KD(X.volume,X.path)}\``).join(`
|
|
2389
|
+
`);y91=c({name:"TASK_ADD_REPO",description:"Clone one of this organization's repositories into your working directory. "+"Your working directory is EMPTY until you call this \u2014 do not look for "+"files, and do not run git, before it returns. Call it once, with the repository the task is about; it waits for the checkout and returns the repository root listing, so you can start reading files immediately after. `git` and `gh` are authenticated once it returns. Call TASK_ADD_REPO with no arguments to list the repositories available.",annotations:{title:"Add Repository",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!0},inputSchema:nJ.object({connectionId:nJ.string().optional().describe("connectionId of the repository to clone. Omit to list the available repositories.")}),outputSchema:nJ.object({success:nJ.boolean(),repositories:nJ.array(nJ.object({connectionId:nJ.string(),repo:nJ.string()})).optional(),repo:nJ.string().optional(),cloned:nJ.boolean().optional(),files:nJ.string().optional(),message:nJ.string()}),handler:async($,Z)=>{s(Z),await Z.access.check();let Q=a(Z),X=a0(Z);if(!X)throw Error("User ID required");let{threadId:Y}=ZA0(),G=await Sm4(Z,Q.id),J=$.connectionId?G.find((l)=>l.connectionId===$.connectionId):void 0;if(!J){let l=G.map((y)=>({connectionId:y.connectionId,repo:`${y.owner}/${y.repo}`}));return{success:!1,repositories:l,message:$.connectionId?`No imported repository for connectionId "${$.connectionId}". Pick one of the repositories listed.`:l.length===0?"This organization has no repositories imported, so none can be cloned.":"Pick a repository and call TASK_ADD_REPO again with its connectionId."}}let K=await Z.storage.threads.get(Y);if(!K)throw Error(`Thread not found: ${Y}`);let W=await WK0(Z,{threadId:Y,runBranch:K.branch}),H=await bz(Z,W,X),F=await AX(Z),N=await Im4(Z,Y,H,W);if(!N)throw Error(`No sandbox is registered for this run (thread ${Y}), so there is nowhere to clone into.`);let U=K.metadata?.githubRepo?.owner,B=K.metadata?.githubRepos??[];if(U&&Mm4(B,{owner:J.owner,name:J.repo}))return{success:!1,repo:`${J.owner}/${J.repo}`,cloned:!1,message:`This run already has ${CV$} additional repositories checked out, which is the limit. Work with what's already checked out instead of adding another.`};await JD({ctx:Z,connectionId:J.connectionId,organizationId:Q.id,forceRefresh:!0,onLegacyMintError:(l)=>console.error("[TASK_ADD_REPO] legacy repo-scoped mint failed",{connectionId:J.connectionId,error:l.message})});let{cloneUrl:O,gitUserName:D,gitUserEmail:w}=await kH(J.connectionId,J.owner,J.repo,Z.db,Z.vault,{bufferMs:SV$}),E={url:`https://github.com/${J.owner}/${J.repo}`,owner:J.owner,name:J.repo,installationId:J.installationId,connectionId:J.connectionId},j=!U,z=j?[]:await Z.storage.threads.appendThreadGithubRepo(Y,E);if(j)await Z.storage.threads.update(Y,{metadata:{...K.metadata??{},githubRepo:E},updated_by:X});let A=rP0({branch:W,derivedRef:$U(W),recordedHeadRef:null,sticky:!1}),P=await F.proxyDaemonRequest(N.sandboxHandle,"/_sandbox/config",{method:"PUT",headers:new Headers({"content-type":"application/json"}),body:JSON.stringify({git:{...j?{repository:{cloneUrl:O,branch:A,repoName:`${J.owner}/${J.repo}`}}:{repositories:await Cm4(Z,z)},identity:{userName:D,userEmail:w}}})});if(!P.ok)throw Error(`the sandbox rejected the repository (${P.status} ${P.statusText})`);await F.proxyDaemonRequest(N.sandboxHandle,"/_sandbox/setup/clone",{method:"POST",headers:new Headers({"content-type":"application/json"}),body:"{}"}).catch((l)=>{console.warn("[TASK_ADD_REPO] explicit clone kick failed",l)});let I=j?null:LP$(z,{owner:J.owner,name:J.repo}),q=j||!I?".":`"$(dirname "$PWD")/repos/${I}"`,M=Date.now()+MV$,S=!1,m="",f=0,b=null;while(Date.now()<M){let l=await kV$(F,N.sandboxHandle,Y,`cd ${q} 2>/dev/null || exit 1; if [ -n "$(git ls-files 2>/dev/null | head -1)" ]; then echo __CLONED__; fi; ls -A 2>/dev/null`).catch(()=>null);if(!l){if(++f>=qm4)break;await H$(VV$);continue}f=0;let y=Vm4(l.stdout);if(y.cloned&&y.listing===b){S=!0,m=y.listing;break}b=y.cloned?y.listing:null,await H$(VV$)}if(S)await kV$(F,N.sandboxHandle,Y,km4).catch((l)=>console.warn("[TASK_ADD_REPO] gh auth setup failed",l));return{success:S,repo:`${J.owner}/${J.repo}`,cloned:S,files:m,message:S?j?`${J.owner}/${J.repo} is checked out at your working directory on branch ${A}. \`git\` and \`gh\` are authenticated. Start working.`:`${J.owner}/${J.repo} is checked out at ../repos/${I}, beside your working directory, on its default branch. \`git\` and \`gh\` are authenticated there too. Your first checkout is untouched \u2014 commit and open a pull request in each repository you change.`:`The clone of ${J.owner}/${J.repo} did not finish within ${Math.round(MV$/1000)}s. It may still be in progress \u2014 check your working directory before calling this again.`}}})});function fV$($){return typeof $==="string"&&g91.includes($)}function xV$($){if(!$.startsAt)return null;let Z=Date.parse($.startsAt);return Number.isNaN(Z)?null:Z}function bV$($,Z){let Q=vV$[$.state]-vV$[Z.state];if(Q!==0)return Q;let X=xV$($),Y=xV$(Z);if(X===null||Y===null){if(X!==Y)return X===null?1:-1}else if(X!==Y)return $.state==="closed"?Y-X:X-Y;return $.name.localeCompare(Z.name)||$.id.localeCompare(Z.id)}var g91,vV$;var QA0=L(()=>{g91=["active","future","closed"];vV$={active:0,future:1,closed:2}});import{z as I1}from"zod";var XA0=50000,YA0=500,GA0=200,yK,yV$,Sa,Dv,_m4,vm4,xm4,gV$,bu,fm4,bm4,hV$;var gK=L(()=>{QA0();h6();h6();yK=I1.enum(["triage","todo","in_progress","in_review","approved","merged","post_deploy_validation","done","archived"]),yV$=I1.object({id:I1.string(),name:I1.string(),state:I1.enum(g91),startsAt:I1.string().nullable(),endsAt:I1.string().nullable()}),Sa=I1.enum(["bug","feature","chore","spike","security"]),Dv=I1.enum(["none","low","medium","high","urgent"]),_m4=I1.object({threadId:I1.string(),virtualMcpId:I1.string().nullable(),status:I1.enum(["in_progress","requires_action","failed","completed","expired"]).nullable(),title:I1.string().nullable(),lastMessage:I1.string().nullable(),hasPreview:I1.boolean(),failureKind:I1.string().nullable(),hasMessages:I1.boolean(),costUsd:I1.number().nullable(),costProvider:I1.string().nullable(),createdAt:I1.string(),lastActiveAt:I1.string()}),vm4=I1.object({reviewer:I1.enum(jH),verdict:I1.enum(["approved","changes_requested"]),verified:I1.boolean()}),xm4=I1.object({id:I1.string(),name:I1.string(),color:I1.string().nullable().describe('Hex color, e.g. "#3b82f6"'),createdBy:I1.string(),createdAt:I1.string().datetime()}),gV$=I1.object({url:I1.string(),number:I1.number(),repoOwner:I1.string(),repoName:I1.string(),createdAt:I1.string(),title:I1.string().nullable(),body:I1.string().nullable(),state:I1.enum(["open","closed"]).nullable(),draft:I1.boolean().nullable(),merged:I1.boolean().nullable(),mergeable:I1.boolean().nullable(),checksStatus:I1.enum(["pending","passing","failing"]).nullable(),checks:I1.array(I1.object({name:I1.string(),status:I1.string(),conclusion:I1.string().nullable(),detailsUrl:I1.string().nullable(),summary:I1.string().nullable()})),previewUrl:I1.string().nullable()}),bu=I1.object({id:I1.string(),organizationId:I1.string(),title:I1.string(),description:I1.string().nullable(),status:yK,priority:Dv,type:Sa,assigneeId:I1.string().nullable(),assignedBy:I1.string().nullable(),repo:I1.string().nullable(),dueDate:I1.string().datetime().nullable(),sprintId:I1.string().nullable(),sortOrder:I1.number(),keySeq:I1.number().nullable(),jiraIssueKey:I1.string().nullable(),retryAttempts:I1.number(),threads:I1.array(_m4),tags:I1.array(xm4),reviewVerdicts:I1.array(vm4),createdBy:I1.string(),createdAt:I1.string().datetime(),updatedBy:I1.string(),updatedAt:I1.string().datetime()}),fm4=["created","status_changed","assignee_changed","priority_changed","due_date_changed","title_changed","description_changed","tags_changed","review_requested","review_approved","review_changes_requested","merge_conflict_resolution","merge_failed","type_changed"],bm4=I1.enum(fm4),hV$=I1.object({id:I1.string(),taskBoardItemId:I1.string(),action:bm4,actorId:I1.string().nullable(),data:I1.record(I1.string(),I1.unknown()),occurredAt:I1.string().datetime()})});async function JA0($,Z,Q){if(Q===F8)return;let{members:X}=await $.boundAuth.organization.listMembers({organizationId:Z,filterField:"userId",filterValue:Q});if(!X.some((Y)=>Y.userId===Q))throw Error("assigneeId is not a member of the organization")}var h91=L(()=>{gK()});function lV$($){let Z={};for(let[Q,X]of Object.entries($)){if(Q.startsWith(ym4))continue;Z[Q]=X}return Z}function KA0($){return{taskBoardItemId:$.id,...HY($)&&{[uV$]:cV$}}}function gm4($){return $?.[uV$]===cV$}function hm4($){if(/[:\s]/.test($))throw Error("organization id unsuitable for the subsidy key scheme");return`subsidy:${$}`}async function um4($,Z){let Q=y0();try{let X=await $.storage.subsidizedGatewayKeys.get(Z);if(X)return X;let Y=$.auth?.user?.id;if(Y&&Q.aiGatewayEnabled&&Q.studioProvisionSecretKey&&RL.provisionKey){let G=await uW(Y,$.auth?.user?.email),J=await RL.provisionKey(G,hm4(Z));return await $.storage.subsidizedGatewayKeys.put(Z,J),J}}catch(X){console.error("[subsidized-runs] subsidy key unavailable \u2014 run stays on the org's key:",X)}return}async function mV$($,Z,Q){if(!y0().taskQuotaEnforced)return;if(!gm4(Q))return;let X=Q?.taskBoardItemId;if(!X)return;let Y=await $.storage.taskBoard.getById(X,Z);if(!Y||!HY(Y))return;if(!await DL$($,X))return;return await um4($,Z)}function dV$($,Z){if(!Z)return $;if($.providerId!=="deco")return $;return{...$,apiKey:Z}}var ym4="srv.",uV$="srv.billing",cV$="subscription";var Ca=L(()=>{qJ0();EO();R$();hJ()});function WA0($){let Z=$?.runClass;return Z&&Z in u91?u91[Z]:u91.interactive}var u91,yu="runClass";var gu=L(()=>{u91={interactive:10,reviewer:20,retry:30,new_task:40}});async function c91($,Z,Q){let X;try{return await Promise.race([$.aiProviders.listModels(Z,Q),new Promise((G,J)=>{X=setTimeout(()=>J(Error("listModels timeout")),cm4)})])}finally{if(X)clearTimeout(X)}}function lm4($,Z){switch($){case"fast":return Z.chat.fast;case"smart":return Z.chat.smart;case"thinking":return Z.chat.thinking;case"image":return Z.image;case"web_search":return Z.webSearch;case"deep_research":return Z.deepResearch}}function l91($,Z,Q){let X=$.find((Y)=>Y.modelId===Z);return{title:X?.title??Q??Z,providerId:X?.providerId,capabilities:X?.capabilities,limits:X?.limits??null}}async function Z7($,Z,Q){let X=$.organization?.id;if(!X)throw Error("resolveTier called without an organization");let G=(await $.storage.organizationSettings.get(X))?.simple_mode?.tiers?.[Z]??null,J=$.auth?.user?.id,K=yL.safeParse(Z),W=Q?.applyUserPrefs&&K.success&&J?(await $.storage.userModelPreferences.get(J,X))?.tiers?.[K.data]??null:null,H=(await $.storage.aiProviderKeys.list({organizationId:X})).filter((O)=>Kj(O.providerId));for(let O of[W,G])if(O&&H.some((D)=>D.id===O.keyId)){let D=await c91($,O.keyId,X).catch(()=>[]);return{credentialId:O.keyId,modelId:O.modelId,modelMeta:l91(D,O.modelId,O.title)}}if(H.length===0)throw new hu(Z);let F={};await Promise.all(H.map(async(O)=>{F[O.id]=await c91($,O.id,X).catch(()=>[])}));let N=H.map((O)=>({id:O.id,providerId:O.providerId,label:O.label,presetId:O.presetId,createdBy:O.createdBy,createdAt:O.createdAt})),U=q7$(N,F),B=lm4(Z,U);if(!B)throw new hu(Z);return{credentialId:B.keyId,modelId:B.modelId,modelMeta:l91(F[B.keyId]??[],B.modelId,B.title)}}async function iV$($,Z,Q){let X=$.organization?.id;if(!X)throw Error("resolveSpecificModel called without an organization");let Y=await $.storage.aiProviderKeys.findById(Z,X).catch((J)=>{if(J instanceof Error&&J.message==="Provider key not found")throw new _a(`AI provider credential "${Z}" was not found`,{cause:J});throw J});if(!Kj(Y.providerId))throw new _a(`AI provider credential "${Z}" uses native-only provider "${Y.providerId}" and cannot run a hosted model`);let G=await c91($,Z,X).catch(()=>[]);return{credentialId:Z,modelId:Q,modelMeta:l91(G,Q)}}async function tJ($,Z){try{return await Z7($,Z)}catch(Q){if(Q instanceof hu)return null;return console.warn(`[resolveTier] tier "${Z}" resolution failed:`,Q),null}}var hu,_a,cm4=5000;var NU=L(()=>{rZ();g8();hu=class hu extends Error{tier;constructor($){super(`No model available for tier "${$}". Connect a provider or configure the tier in organization settings.`);this.tier=$;this.name="TierUnavailableError"}};_a=class _a extends Error{constructor($,Z){super($,Z);this.name="SpecificModelCredentialUnavailableError"}}});function pV$($){return $ instanceof fH||typeof $==="object"&&$!==null&&$.permanent===!0}var fH;var m91=L(()=>{fH=class fH extends Error{permanent=!0;code;constructor($,Z){super(Z);this.name="PermanentRunError",this.code=$}}});function tV$($){return $==="reviewer"?"reviewer":"default"}function rV$($,Z="default"){let{providerId:Q,apiKey:X,baseUrl:Y}=$,G=dm4[Z],J={CLAUDE_CODE_MAX_OUTPUT_TOKENS:`${mm4}`,CLAUDE_CODE_MAX_TURNS:G===null?null:`${G}`};if(Q==="anthropic")return{...J,CLAUDE_CODE_MODEL:d91.anthropic[Z],ANTHROPIC_API_KEY:X,ANTHROPIC_AUTH_TOKEN:null,CLAUDE_CODE_OAUTH_TOKEN:null,ANTHROPIC_BASE_URL:Y??null};if(Q==="claude-subscription")return{...J,CLAUDE_CODE_MODEL:d91.anthropic[Z],CLAUDE_CODE_OAUTH_TOKEN:X,ANTHROPIC_API_KEY:null,ANTHROPIC_AUTH_TOKEN:null,ANTHROPIC_BASE_URL:null};if(Q==="openrouter"||Q==="deco")return{...J,CLAUDE_CODE_MODEL:d91.openrouter[Z],ANTHROPIC_API_KEY:"",ANTHROPIC_AUTH_TOKEN:X,CLAUDE_CODE_OAUTH_TOKEN:null,ANTHROPIC_BASE_URL:Y??"https://openrouter.ai/api"};throw new oV$(Q)}var nV$="claude-subscription",d91,HA0="claudeCodeModelClass",mm4=32000,dm4,oV$;var FA0=L(()=>{d91={anthropic:{default:"claude-opus-5",reviewer:"claude-sonnet-5"},openrouter:{default:"anthropic/claude-opus-5",reviewer:"anthropic/claude-sonnet-5"}};dm4={default:null,reviewer:60};oV$=class oV$ extends Error{constructor($){super(`the claude-code harness needs an Anthropic, OpenRouter or Deco model credential; this run's model resolves to "${$}". Point the agent's thinking model at one of those, or run it with Decopilot.`);this.name="UnsupportedClaudeCodeProviderError"}}});import{z as p1}from"zod";var aV$,im4,va,pm4,nm4,pZZ;var sV$=L(()=>{aV$=p1.object({chunks:p1.array(p1.unknown()),done:p1.boolean().nullish().transform(($)=>$??!1),error:p1.object({code:p1.string(),message:p1.string()}).nullish().transform(($)=>$??null)}),im4=p1.record(p1.string(),p1.unknown()),va=p1.object({id:p1.string(),title:p1.string().optional(),provider:p1.string().nullable().optional(),credentialId:p1.string(),limits:p1.object({contextWindow:p1.number().int().positive().optional(),maxOutputTokens:p1.number().int().positive().optional()}).optional(),capabilities:p1.object({vision:p1.boolean().optional(),text:p1.boolean().optional(),reasoning:p1.boolean().optional()}).optional()}).strict(),pm4=p1.object({thinking:va.extend({title:p1.string()}),fast:va.optional(),smart:va.optional(),image:va.optional(),deepResearch:va.optional()}).strict(),nm4=p1.discriminatedUnion("cwd",[p1.object({cwd:p1.literal("/repo"),repo:p1.object({owner:p1.string(),name:p1.string(),connectedGithub:p1.boolean()}).strict().optional(),branch:p1.string().nullable()}).strict(),p1.object({cwd:p1.null()}).strict()]),pZZ=p1.object({threadId:p1.string(),userMessage:im4,harness:p1.object({sessionId:p1.string().optional()}).strict(),workspace:nm4,models:pm4,mcp:p1.object({url:p1.string().url(),headers:p1.record(p1.string(),p1.string()),expiresAt:p1.number().int().positive()}).strict(),orgMcps:p1.array(p1.object({name:p1.string(),url:p1.string().url(),headers:p1.record(p1.string(),p1.string())}).strict()).optional(),mode:p1.enum(["default","plan","web-search","gen-image"]),temperature:p1.number(),toolApprovalLevel:p1.enum(["auto","readonly"]),toolAllowlist:p1.array(p1.string()).nullable().optional(),maxAgentSteps:p1.number().int().optional(),user:p1.object({id:p1.string(),email:p1.string()}).strict(),organizationId:p1.string(),agent:p1.object({id:p1.string(),instructions:p1.string().optional(),disallowedTools:p1.array(p1.string()).optional()}).strict(),currentThreadTitle:p1.string().optional(),resume:p1.object({reason:p1.string()}).strict().optional()}).strict()});var eV$="sandbox_gone",NA0="[SANDBOX_UNREACHABLE]";function tm4($){let Z=[$.contentType??"file"];if($.size!=null)Z.push(`${$.size} bytes`);return Z.join(", ")}function om4($){let Z=($??[]).filter((X)=>X.kind!=="skill");if(Z.length===0)return null;return["<knowledge>","The following files are attached to you as reference knowledge. They are mounted in your sandbox at the paths below; read them with your file tools when relevant to the task, and treat them as authoritative reference material.","","Attached files:",Z.map((X)=>`- ${X.name} (${tm4(X)}), read it at \`${KD(X.volume,X.path)}\``).join(`
|
|
2390
2390
|
`),"</knowledge>"].join(`
|
|
2391
2391
|
`)}function $k$($,Z){let Q=om4(Z);if(!Q)return $;return $?`${$}
|
|
2392
2392
|
|