decocms 2.302.0 → 2.302.2
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-Ckdo-RmI.js → AlertCircle-BkX4HzbS.js} +1 -1
- package/dist/client/assets/{ArrowNarrowLeft-Di3ykEwz.js → ArrowNarrowLeft-BebHkn1X.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-DMSP1Bv9.js → ArrowUpRight-uszsF274.js} +1 -1
- package/dist/client/assets/{CheckCircle-C208sPuy.js → CheckCircle-Boq6G01L.js} +1 -1
- package/dist/client/assets/{ChevronDown-BrUt0Alw.js → ChevronDown-ByP-e484.js} +1 -1
- package/dist/client/assets/{ChevronRight-CGM8153k.js → ChevronRight-BUfZMnd9.js} +1 -1
- package/dist/client/assets/{ChevronUp-CaGbgeVw.js → ChevronUp-TwiYbtUW.js} +1 -1
- package/dist/client/assets/{Container-4Wg94L7I.js → Container-DzkLD13G.js} +1 -1
- package/dist/client/assets/{DotsVertical-DvRrSQFB.js → DotsVertical-BrUfBHwt.js} +1 -1
- package/dist/client/assets/{LinkExternal01-Y0gD7h2D.js → LinkExternal01-gfL-Fk4b.js} +1 -1
- package/dist/client/assets/{Lock01-Dch0eKvp.js → Lock01-CI-miN4g.js} +1 -1
- package/dist/client/assets/{Palette-CgqIrvg1.js → Palette-1HvN4NnC.js} +1 -1
- package/dist/client/assets/{Play-CtLPh-DP.js → Play-O7ldNAxa.js} +1 -1
- package/dist/client/assets/{Plus-Bz8pOCrF.js → Plus-Bihyskqy.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-KEgE6miP.js → RefreshCcw01-BzT-xyrO.js} +1 -1
- package/dist/client/assets/{SearchMd-CVG2gI0e.js → SearchMd-vBRV-l3E.js} +1 -1
- package/dist/client/assets/{Settings02-BaHlQiS7.js → Settings02-eiwWD3s7.js} +1 -1
- package/dist/client/assets/{Shield01-CCtHgQuh.js → Shield01-D7ml37xT.js} +1 -1
- package/dist/client/assets/{Star01-C90LkDZI.js → Star01-ByzmPd4J.js} +1 -1
- package/dist/client/assets/{Sun-BxF03d45.js → Sun-xA_CdWAJ.js} +1 -1
- package/dist/client/assets/{Tool01-DA28S3sH.js → Tool01-Dqyo2VjJ.js} +1 -1
- package/dist/client/assets/{Trash01-DR27iFf1.js → Trash01-f4CvhuWB.js} +1 -1
- package/dist/client/assets/{User01-BujZcMbB.js → User01-lDhxACAV.js} +1 -1
- package/dist/client/assets/{Users03-CDTGNBm2.js → Users03-IortA-KV.js} +1 -1
- package/dist/client/assets/{X-DoHhdWpr.js → X-BiphajNJ.js} +1 -1
- package/dist/client/assets/{XCircle-Ds5a6kuE.js → XCircle-Dp1Lqd1t.js} +1 -1
- package/dist/client/assets/{XClose-C9Qfd8kZ.js → XClose-lRlzG-cb.js} +1 -1
- package/dist/client/assets/{Zap-BtQ-TzwR.js → Zap-ebWdIwXf.js} +1 -1
- package/dist/client/assets/{ZapSquare-DKBv2Oh1.js → ZapSquare-_fsDSSOX.js} +1 -1
- package/dist/client/assets/{accordion-isIiC_Tx.js → accordion-D3c87Mh0.js} +1 -1
- package/dist/client/assets/{agent-icon-DyZrsMHV.js → agent-icon-Be_PnRh0.js} +1 -1
- package/dist/client/assets/{agents-list-BsLb9TAC.js → agents-list-45a0yQhW.js} +1 -1
- package/dist/client/assets/ai-providers-BzCSRpkV.js +1 -0
- package/dist/client/assets/{alert-dialog-Cm675fIp.js → alert-dialog-BUApN05b.js} +1 -1
- package/dist/client/assets/{auth-catchall-CS4MwL4l.js → auth-catchall-DH0bWyBT.js} +1 -1
- package/dist/client/assets/{automation-list-row-BZZkY79g.js → automation-list-row-DETQBuFK.js} +1 -1
- package/dist/client/assets/{automations-EJo_cmjx.js → automations-DvIFzGM7.js} +1 -1
- package/dist/client/assets/{avatar-ejiIeuvT.js → avatar-BBnvw18x.js} +1 -1
- package/dist/client/assets/{badge-BCkY0osU.js → badge-CRHmlYav.js} +1 -1
- package/dist/client/assets/{brand-context-B-WDg8W9.js → brand-context-CH2SSDlY.js} +1 -1
- package/dist/client/assets/{card-KrDyjT9B.js → card-DoqftRz7.js} +1 -1
- package/dist/client/assets/{chat-context-D2ImJV4_.js → chat-context-JbYHex_O.js} +1 -1
- package/dist/client/assets/{checkbox-DdEbgSXy.js → checkbox-CHYA_sQZ.js} +1 -1
- package/dist/client/assets/{collection-detail-C1_S4Wby.js → collection-detail-Bb5ojn6D.js} +1 -1
- package/dist/client/assets/{collection-display-button-E32kWSQs.js → collection-display-button-C2ECPv0_.js} +1 -1
- package/dist/client/assets/{collection-search-CZ45K7il.js → collection-search-B8mdZm7u.js} +1 -1
- package/dist/client/assets/{collection-search-CjRFx7RJ.js → collection-search-C-2UZGyD.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-D1SV8oPy.js → collection-table-wrapper-pDRU_Alr.js} +1 -1
- package/dist/client/assets/{collection-tabs-Ds23HSH3.js → collection-tabs-Bj7BShdC.js} +1 -1
- package/dist/client/assets/{collections-ClBK8Wc7.js → collections-CjrHbdtT.js} +1 -1
- package/dist/client/assets/{command-s8ocnxUp.js → command-CZWy1buB.js} +1 -1
- package/dist/client/assets/{connection-card-BOvFz0Xe.js → connection-card-HM9ImVMm.js} +1 -1
- package/dist/client/assets/{connection-detail-C9dHwvHg.js → connection-detail-CWdb5LvI.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-CaMgKEzX.js → connection-form-helpers-Cr0s3TXQ.js} +1 -1
- package/dist/client/assets/{connections-D4jzt08s.js → connections-CpsKPW6X.js} +1 -1
- package/dist/client/assets/{constants-CVSLlYnf.js → constants-Cj0U39_n.js} +1 -1
- package/dist/client/assets/{constants-Bj37EyXz.js → constants-DE2tzNng.js} +1 -1
- package/dist/client/assets/{dialog-B9mCJ9u4.js → dialog-BdVY7mqq.js} +1 -1
- package/dist/client/assets/{domain-settings-E-eT2C2j.js → domain-settings-DALXcXKA.js} +1 -1
- package/dist/client/assets/{drawer-ChRbi3da.js → drawer-0C4xllAB.js} +1 -1
- package/dist/client/assets/{dropdown-menu-BACFhEWG.js → dropdown-menu-Bq-aRZ_r.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-3-VjJB_9.js → dynamic-plugin-layout-CXa5_dk-.js} +1 -1
- package/dist/client/assets/{empty-state-Cd5nlZi8.js → empty-state-Cw5GxS3i.js} +1 -1
- package/dist/client/assets/{empty-state-CZHe0KuE.js → empty-state-S_EjXlZP.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DWwyWigS.js → extract-connection-data-DN-EBamj.js} +1 -1
- package/dist/client/assets/{features-CeatQ7gW.js → features-CZe-SpPx.js} +1 -1
- package/dist/client/assets/{form-Ouizhyq3.js → form-Stkhqjoi.js} +1 -1
- package/dist/client/assets/{general-DzoGsnH3.js → general-aMP5BKAQ.js} +1 -1
- package/dist/client/assets/{index-Dax7JqXc.js → index-B7sUvMqz.js} +1 -1
- package/dist/client/assets/{index-BSVWgf11.js → index-BP0vNLKa.js} +1 -1
- package/dist/client/assets/{index-CAaoqFy7.js → index-BY8F27EB.js} +1 -1
- package/dist/client/assets/{index-D2mful5a.js → index-BZhxvvXQ.js} +1 -1
- package/dist/client/assets/{index-Da_yXMmn.js → index-C--avMTn.js} +1 -1
- package/dist/client/assets/{index-6mSFDvZg.js → index-CAum6J1D.js} +1 -1
- package/dist/client/assets/{index-By6SCvFJ.js → index-ClNUcJ8s.js} +1 -1
- package/dist/client/assets/{index-2Scfn4rN.js → index-Crkc58Yb.js} +1 -1
- package/dist/client/assets/index-D2fHFr2F.js +1 -0
- package/dist/client/assets/{index-BS2wRqRL.js → index-D58bzP3p.js} +1 -1
- package/dist/client/assets/{index-D_jFKVK5.js → index-DCOURowK.js} +1 -1
- package/dist/client/assets/{index-RbRZk6ng.js → index-DhThG5rF.js} +3 -3
- package/dist/client/assets/{index-af7Ms30x.js → index-ZmvI6xf3.js} +1 -1
- package/dist/client/assets/{index-RBXYZ0o1.js → index-b_n-uXmh.js} +2 -2
- package/dist/client/assets/{index-fNW0SHRb.js → index-pdnGjAa-.js} +1 -1
- package/dist/client/assets/{index-D-Rzrt74.js → index-y9YjpvN-.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver--3YinOmX.js → infiniteQueryObserver-DMFjl81X.js} +1 -1
- package/dist/client/assets/{input-CbOPFA2Y.js → input-C80VzPpQ.js} +1 -1
- package/dist/client/assets/{integration-icon-BUk_AQZb.js → integration-icon-LX1nChXa.js} +1 -1
- package/dist/client/assets/{label-BSzDqn8Z.js → label-2a4WSF52.js} +1 -1
- package/dist/client/assets/{layout-Cbq9XvLR.js → layout-BAy6nHY2.js} +1 -1
- package/dist/client/assets/{lean-canvas-recruit-modal-C1G1_2au.js → lean-canvas-recruit-modal-C1vNRy0q.js} +1 -1
- package/dist/client/assets/{login-DCSomhku.js → login-BwOZspJc.js} +1 -1
- package/dist/client/assets/{members-DCjU7uUX.js → members-BxmUMFwY.js} +1 -1
- package/dist/client/assets/{monaco-editor-9MzrlDzJ.js → monaco-editor-BY6pRUNM.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-DLYFByVX.js → monitoring-stats-row-BPKt_N1O.js} +1 -1
- package/dist/client/assets/{oauth-callback-CRR_q1-_.js → oauth-callback-Dkjb5tCM.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-BcbJ_xLj.js → oauth-callback-ai-provider-mujJmFGt.js} +1 -1
- package/dist/client/assets/{onboarding-CSHiENj3.js → onboarding-C1DRaGue.js} +1 -1
- package/dist/client/assets/{org-layout-BQC1siIb.js → org-layout-DioVArtE.js} +1 -1
- package/dist/client/assets/{org-plugin-layout-Cq_aAA1I.js → org-plugin-layout-BZoT2SIg.js} +1 -1
- package/dist/client/assets/{pair-C1Euf0mI.js → pair-CBvrXYZC.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-DXXmUyFw.js → plugin-empty-state-DRAuC0gx.js} +1 -1
- package/dist/client/assets/{plugin-header-C-jLY3z-.js → plugin-header-Y35bsPBd.js} +1 -1
- package/dist/client/assets/{plugin-layout-oOgBG5IP.js → plugin-layout-BM2m7Nsv.js} +1 -1
- package/dist/client/assets/{popover-DC-xnLvX.js → popover-CALdcEX7.js} +1 -1
- package/dist/client/assets/{profile-DDufPRp2.js → profile-Cz2Ymv3u.js} +1 -1
- package/dist/client/assets/{project-app-view-CFJH3_Mb.js → project-app-view-BJIaTnR2.js} +1 -1
- package/dist/client/assets/registry-Bm6dPwQv.js +2 -0
- package/dist/client/assets/{registry-layout-Bt8B6WZA.js → registry-layout-Bg8yl9if.js} +1 -1
- package/dist/client/assets/{required-auth-layout-DxzQFSub.js → required-auth-layout-CnSE-XLF.js} +1 -1
- package/dist/client/assets/{reset-password-MIshTkTR.js → reset-password-BEfzUzVH.js} +1 -1
- package/dist/client/assets/{roles-Cvj_YJQC.js → roles-CFSaKkJP.js} +1 -1
- package/dist/client/assets/{scroll-area-DwYUYaC4.js → scroll-area-18YOEnqD.js} +1 -1
- package/dist/client/assets/{search-input-CDHPjad4.js → search-input-6INcGAwd.js} +1 -1
- package/dist/client/assets/{select-8rqyX4yY.js → select-CaDZpVbI.js} +1 -1
- package/dist/client/assets/{select-model-D8dh5nJb.js → select-model-S5cFobu5.js} +1 -1
- package/dist/client/assets/{settings-layout-BgvnZybr.js → settings-layout-jEkhhHU3.js} +1 -1
- package/dist/client/assets/{settings-section-HtqNxJHw.js → settings-section-e84UGEbx.js} +1 -1
- package/dist/client/assets/{shell-layout-A5EcvKv7.js → shell-layout-Cdsgdqci.js} +1 -1
- package/dist/client/assets/{skeleton-DMH6jOOd.js → skeleton-DCXc9Mjl.js} +1 -1
- package/dist/client/assets/{sso-DNkuSn5z.js → sso-DTC2FHjx.js} +1 -1
- package/dist/client/assets/{store-CLctbbGQ.js → store-pc-wftmt.js} +1 -1
- package/dist/client/assets/store-registry-BCuueIrr.js +2 -0
- package/dist/client/assets/{switch-ClAJkK47.js → switch-BUxRExf5.js} +1 -1
- package/dist/client/assets/{table-Cwoyxo1t.js → table-CT5HWSPV.js} +1 -1
- package/dist/client/assets/{tabs-Bw1wvZLY.js → tabs-Cge-9ZTd.js} +1 -1
- package/dist/client/assets/{task-status-BwNSpCPo.js → task-status-tGA8S8H-.js} +1 -1
- package/dist/client/assets/{textarea-grS6dvzw.js → textarea-Dx8hdqfA.js} +1 -1
- package/dist/client/assets/{toggle-group-CrcMNw0M.js → toggle-group-psHBbDPI.js} +1 -1
- package/dist/client/assets/{tools-list-B0HLMLQ4.js → tools-list-tDufGw9O.js} +1 -1
- package/dist/client/assets/{tooltip-l5gvSkP4.js → tooltip-B-nRvfy-.js} +1 -1
- package/dist/client/assets/{types-sSi2ZBaJ.js → types-hw9no7At.js} +1 -1
- package/dist/client/assets/{use-ai-providers-NGnYqkjZ.js → use-ai-providers-Bc_Jl0e6.js} +1 -1
- package/dist/client/assets/{use-collections-XPoz4bQ4.js → use-collections-CqIGWKSp.js} +1 -1
- package/dist/client/assets/{use-connection-KIdOMYYB.js → use-connection-DuXPSqwF.js} +1 -1
- package/dist/client/assets/{use-copy-BEHVkdeL.js → use-copy-CJlR4d5Y.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-B7_E4z0n.js → use-create-virtual-mcp-B-gULvH7.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-BB7Ade2O.js → use-decopilot-events-CWIgEPKA.js} +1 -1
- package/dist/client/assets/{use-delete-connection-ClDFtLys.js → use-delete-connection-mOKpqJ4Z.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BDQxIw_a.js → use-infinite-scroll-HGu4x7ZU.js} +1 -1
- package/dist/client/assets/{use-list-state-C-KeL9mx.js → use-list-state-Dlljnhsv.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CvCxJUq7.js → use-mcp-tools-BkDSNv3W.js} +1 -1
- package/dist/client/assets/{use-members-CkSy6C1r.js → use-members-8sha4K9R.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-h3H44Uqx.js → use-navigate-to-agent-B5j-9-p3.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-C4jj13SA.js → use-org-auth-client-Ev284uyK.js} +1 -1
- package/dist/client/assets/{use-org-sso-CzzIybhJ.js → use-org-sso-CD6laYaL.js} +1 -1
- package/dist/client/assets/{use-organization-roles-BFtXNMrL.js → use-organization-roles-CN53ZUes.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DQaAYRBc.js → use-organization-settings-DFNDQvXK.js} +1 -1
- package/dist/client/assets/{use-registry-connections-Bw9vDyMz.js → use-registry-connections-D1xCWobU.js} +1 -1
- package/dist/client/assets/{use-status-sounds-Cb3X5ULl.js → use-status-sounds-ojr3d2EQ.js} +1 -1
- package/dist/client/assets/{use-tasks-CU4nRSG8.js → use-tasks-DFEEn9nC.js} +1 -1
- package/dist/client/assets/{use-view-mode-dkizD-HG.js → use-view-mode-BjLGHFfJ.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-D1lThWcu.js → use-virtual-mcp-Qy5dDA1Q.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-B82zG1fE.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-4BiVmPoE.js +1 -0
- package/dist/client/assets/{user-BuZ7YF8y.js → user-ysfLNnXi.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-CV8uckCG.js → view-mode-toggle-C5L447if.js} +1 -1
- package/dist/client/assets/{workflow-YqAcYHT8.js → workflow-CWouU_7K.js} +1 -1
- package/dist/client/assets/workflow-detail-rg2LspQv.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +45 -13
- package/dist/server/node_modules/ansi-regex/index.d.ts +33 -0
- package/dist/server/node_modules/ansi-regex/index.js +14 -0
- package/dist/server/node_modules/ansi-regex/package.json +61 -0
- package/dist/server/node_modules/ansi-regex/readme.md +66 -0
- package/dist/server/node_modules/emoji-regex/LICENSE-MIT.txt +20 -0
- package/dist/server/node_modules/emoji-regex/README.md +107 -0
- package/dist/server/node_modules/emoji-regex/index.d.ts +3 -0
- package/dist/server/node_modules/emoji-regex/index.js +4 -0
- package/dist/server/node_modules/emoji-regex/index.mjs +4 -0
- package/dist/server/node_modules/emoji-regex/package.json +45 -0
- package/dist/server/node_modules/environment/index.d.ts +74 -0
- package/dist/server/node_modules/environment/index.js +47 -0
- package/dist/server/node_modules/{slice-ansi → environment}/license +0 -1
- package/dist/server/node_modules/environment/package.json +74 -0
- package/dist/server/node_modules/environment/readme.md +94 -0
- package/dist/server/node_modules/escape-string-regexp/index.d.ts +18 -0
- package/dist/server/node_modules/escape-string-regexp/index.js +11 -0
- package/dist/server/node_modules/escape-string-regexp/license +9 -0
- package/dist/server/node_modules/escape-string-regexp/package.json +43 -0
- package/dist/server/node_modules/escape-string-regexp/readme.md +29 -0
- package/dist/server/node_modules/is-unicode-supported/index.d.ts +12 -0
- package/dist/server/node_modules/is-unicode-supported/index.js +21 -0
- package/dist/server/node_modules/is-unicode-supported/license +9 -0
- package/dist/server/node_modules/is-unicode-supported/package.json +47 -0
- package/dist/server/node_modules/is-unicode-supported/readme.md +35 -0
- package/dist/server/node_modules/restore-cursor/index.d.ts +11 -0
- package/dist/server/node_modules/restore-cursor/index.js +11 -0
- package/dist/server/node_modules/restore-cursor/license +9 -0
- package/dist/server/node_modules/restore-cursor/package.json +55 -0
- package/dist/server/node_modules/restore-cursor/readme.md +31 -0
- package/dist/server/node_modules/string-width/index.d.ts +39 -0
- package/dist/server/node_modules/string-width/index.js +82 -0
- package/dist/server/node_modules/string-width/license +9 -0
- package/dist/server/node_modules/string-width/package.json +64 -0
- package/dist/server/node_modules/string-width/readme.md +66 -0
- package/dist/server/server.js +44 -12
- package/package.json +1 -1
- package/dist/client/assets/ai-providers-kn1jtlDC.js +0 -1
- package/dist/client/assets/index-YEyIkTha.js +0 -1
- package/dist/client/assets/registry-DtbT4EGB.js +0 -2
- package/dist/client/assets/store-registry-9hOokAwZ.js +0 -2
- package/dist/client/assets/useInfiniteQuery-PRD417UA.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-j6nsOPAl.js +0 -1
- package/dist/client/assets/workflow-detail-BNKITpZa.js +0 -1
- package/dist/server/node_modules/get-east-asian-width/index.d.ts +0 -60
- package/dist/server/node_modules/get-east-asian-width/index.js +0 -30
- package/dist/server/node_modules/get-east-asian-width/lookup-data.js +0 -18
- package/dist/server/node_modules/get-east-asian-width/lookup.js +0 -135
- package/dist/server/node_modules/get-east-asian-width/package.json +0 -71
- package/dist/server/node_modules/get-east-asian-width/readme.md +0 -65
- package/dist/server/node_modules/get-east-asian-width/utilities.js +0 -24
- package/dist/server/node_modules/pg/LICENSE +0 -21
- package/dist/server/node_modules/pg/README.md +0 -95
- package/dist/server/node_modules/pg/esm/index.mjs +0 -20
- package/dist/server/node_modules/pg/lib/client.js +0 -743
- package/dist/server/node_modules/pg/lib/connection-parameters.js +0 -171
- package/dist/server/node_modules/pg/lib/connection.js +0 -221
- package/dist/server/node_modules/pg/lib/crypto/cert-signatures.js +0 -122
- package/dist/server/node_modules/pg/lib/crypto/sasl.js +0 -212
- package/dist/server/node_modules/pg/lib/crypto/utils-legacy.js +0 -43
- package/dist/server/node_modules/pg/lib/crypto/utils-webcrypto.js +0 -89
- package/dist/server/node_modules/pg/lib/crypto/utils.js +0 -9
- package/dist/server/node_modules/pg/lib/defaults.js +0 -91
- package/dist/server/node_modules/pg/lib/index.js +0 -73
- package/dist/server/node_modules/pg/lib/native/client.js +0 -323
- package/dist/server/node_modules/pg/lib/native/index.js +0 -2
- package/dist/server/node_modules/pg/lib/native/query.js +0 -165
- package/dist/server/node_modules/pg/lib/query.js +0 -252
- package/dist/server/node_modules/pg/lib/result.js +0 -109
- package/dist/server/node_modules/pg/lib/stream.js +0 -83
- package/dist/server/node_modules/pg/lib/type-overrides.js +0 -35
- package/dist/server/node_modules/pg/lib/utils.js +0 -217
- package/dist/server/node_modules/pg/package.json +0 -76
- package/dist/server/node_modules/slice-ansi/index.d.ts +0 -19
- package/dist/server/node_modules/slice-ansi/index.js +0 -260
- package/dist/server/node_modules/slice-ansi/package.json +0 -59
- package/dist/server/node_modules/slice-ansi/readme.md +0 -54
- package/dist/server/node_modules/slice-ansi/tokenize-ansi.js +0 -752
- /package/dist/server/node_modules/{get-east-asian-width → ansi-regex}/license +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as oe,j as t,B as Ce,f as Be,b as ct,s as ze,r as dt,x as Le,o as ut,a as mt,K as Fe,Y as Ke,Z as pt}from"./index-RBXYZ0o1.js";import{u as Ve,S as qe}from"./constants-CVSLlYnf.js";import{B as ft,g as Me}from"./constants-Bj37EyXz.js";import{C as Qe}from"./collection-display-button-E32kWSQs.js";import{C as ht}from"./collection-search-CZ45K7il.js";import{C as gt}from"./card-KrDyjT9B.js";import{I as Ge}from"./integration-icon-BUk_AQZb.js";import{D as He,a as Ye,b as Je,c as O}from"./dropdown-menu-BACFhEWG.js";import{c as Ze}from"./XCircle-Ds5a6kuE.js";import{i as Xe}from"./DotsVertical-DvRrSQFB.js";import{y as et,H as Ue}from"./agent-icon-DyZrsMHV.js";import{s as tt}from"./RefreshCcw01-KEgE6miP.js";import{s as st}from"./Trash01-DR27iFf1.js";import{C as xt}from"./collection-table-wrapper-D1SV8oPy.js";import{E as We}from"./empty-state-Cd5nlZi8.js";import{U as jt}from"./user-BuZ7YF8y.js";import{E as it}from"./empty-state-CZHe0KuE.js";import{u as Ct}from"./use-list-state-C-KeL9mx.js";import{g as bt}from"./connection-slug-eyAPH6o3.js";import{f as vt,g as yt,c as Nt,b as wt,d as St,e as Pt,a as _t,A as Dt}from"./alert-dialog-Cm675fIp.js";import{a as It,c as At}from"./use-collections-XPoz4bQ4.js";import{a as Tt}from"./use-connection-KIdOMYYB.js";import{s as Et}from"./Plus-Bz8pOCrF.js";import{a as Ot}from"./layout-Cbq9XvLR.js";import{P as je}from"./index-D2mful5a.js";import"./collections-ClBK8Wc7.js";import"./XClose-C9Qfd8kZ.js";import"./ChevronDown-BrUt0Alw.js";import"./tooltip-l5gvSkP4.js";import"./view-mode-toggle-CV8uckCG.js";import"./badge-BCkY0osU.js";import"./SearchMd-CVG2gI0e.js";import"./Container-4Wg94L7I.js";import"./ChevronRight-CGM8153k.js";import"./AlertCircle-Ckdo-RmI.js";import"./Tool01-DA28S3sH.js";import"./ArrowNarrowLeft-Di3ykEwz.js";import"./ArrowUpRight-DMSP1Bv9.js";import"./ZapSquare-DKBv2Oh1.js";import"./Users03-CDTGNBm2.js";import"./CheckCircle-C208sPuy.js";import"./ChevronUp-CaGbgeVw.js";import"./Star01-C90LkDZI.js";import"./Palette-CgqIrvg1.js";import"./LinkExternal01-Y0gD7h2D.js";import"./Lock01-Dch0eKvp.js";import"./Sun-BxF03d45.js";import"./Play-CtLPh-DP.js";import"./Settings02-BaHlQiS7.js";import"./Shield01-CCtHgQuh.js";import"./User01-BujZcMbB.js";import"./X-DoHhdWpr.js";import"./Zap-BtQ-TzwR.js";import"./table-Cwoyxo1t.js";import"./avatar-ejiIeuvT.js";import"./use-view-mode-dkizD-HG.js";function $t(i,e){const s=i.properties||{};for(const n in s){const c=s[n];if(c&&c.type==="string"&&(c.format==="url"||c.format==="uri")&&e&&typeof e=="object"&&n in e&&e[n])return e[n]}const r=["image","img","avatar","icon","logo","thumbnail","cover"];for(const n of r)if(e&&typeof e=="object"&&n in e&&typeof e[n]=="string")return e[n]}function kt(i){const e=oe.c(25),{item:s,schema:r,actions:n}=i;let c;e[0]!==s||e[1]!==r?(c=$t(r,s),e[0]=s,e[1]=r,e[2]=c):c=e[2];const l=c,p=s&&typeof s=="object"&&"description"in s&&typeof s.description=="string"?s.description:void 0;let d;e[3]!==n?(d=n&&Object.keys(n).length>0,e[3]=n,e[4]=d):d=e[4];const o=d;let m;e[5]!==l||e[6]!==s.title?(m=t.jsx(Ge,{icon:l,name:s.title,size:"md",className:"shrink-0 shadow-sm"}),e[5]=l,e[6]=s.title,e[7]=m):m=e[7];let u;e[8]!==s.title?(u=t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:s.title}),e[8]=s.title,e[9]=u):u=e[9];const f=p||"No description";let a;e[10]!==f?(a=t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:f}),e[10]=f,e[11]=a):a=e[11];let v;e[12]!==u||e[13]!==a?(v=t.jsxs("div",{className:"flex flex-col gap-0 flex-1",children:[u,a]}),e[12]=u,e[13]=a,e[14]=v):v=e[14];let y;e[15]!==m||e[16]!==v?(y=t.jsxs("div",{className:"flex flex-col gap-4 p-6 flex-1",children:[m,v]}),e[15]=m,e[16]=v,e[17]=y):y=e[17];let b;e[18]!==n||e[19]!==o||e[20]!==s?(b=o&&t.jsx("div",{className:"absolute top-6 right-6 sm:opacity-0 sm:group-hover:opacity-100 transition-opacity",onClick:Kt,onMouseDown:Ft,children:t.jsxs(He,{children:[t.jsx(Ye,{asChild:!0,children:t.jsx(Ce,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:Lt,children:t.jsx(Xe,{size:20})})}),t.jsxs(Je,{align:"end",onClick:zt,children:[n.open&&t.jsxs(O,{onClick:g=>{g.stopPropagation(),n.open?.(s)},children:[t.jsx(tt,{size:16}),"Open"]}),n.edit&&t.jsxs(O,{onClick:g=>{g.stopPropagation(),n.edit?.(s)},children:[t.jsx(et,{size:16}),"Edit"]}),n.duplicate&&t.jsxs(O,{onClick:g=>{g.stopPropagation(),n.duplicate?.(s)},children:[t.jsx(Ze,{size:16}),"Duplicate"]}),n.delete&&t.jsxs(O,{variant:"destructive",onClick:g=>{g.stopPropagation(),n.delete?.(s)},children:[t.jsx(st,{size:16}),"Delete"]})]})]})}),e[18]=n,e[19]=o,e[20]=s,e[21]=b):b=e[21];let x;return e[22]!==y||e[23]!==b?(x=t.jsxs(gt,{className:"cursor-pointer transition-colors hover:bg-accent/50 h-full flex flex-col group relative",children:[y,b]}),e[22]=y,e[23]=b,e[24]=x):x=e[24],x}function zt(i){return i.stopPropagation()}function Lt(i){return i.stopPropagation()}function Ft(i){return i.stopPropagation()}function Kt(i){return i.stopPropagation()}const Mt=["icon","avatar","logo"],Re=["created_at","created_by","id"];function Ut(i){return Object.keys(i).find(e=>Mt.includes(e.toLowerCase()))}function ot(i,e){return Object.keys(i.properties||{}).filter(s=>["id","created_at","updated_at","created_by","updated_by"].includes(s)?!1:e?e.includes(s):!0).map(s=>({id:s,label:s.charAt(0).toUpperCase()+s.slice(1).replace(/_/g," ")}))}function Wt(i){const e=oe.c(30),{data:s,schema:r,viewMode:n,search:c,sortKey:l,sortDirection:p,onSort:d,actions:o,onItemClick:m,headerActions:u,emptyState:f,readOnly:a,columns:v,hideToolbar:y,sortableFields:b}=i,x=p===void 0?"asc":p,g=d===void 0?qt:d;let $;e[0]!==o?($=o===void 0?{}:o,e[0]=o,e[1]=$):$=e[1];const h=$,T=m===void 0?Vt:m,E=u===void 0?null:u,N=f===void 0?null:f,k=a===void 0?!1:a,j=v===void 0?void 0:v,z=y===void 0?!1:y,P=b===void 0?void 0:b;let D;e[2]!==j||e[3]!==r||e[4]!==P?(D=j?j.filter(Bt).filter(A=>!P||P.includes(A.id)).map(Rt):ot(r,P),e[2]=j,e[3]=r,e[4]=P,e[5]=D):D=e[5];const w=D;let S;e[6]!==E||e[7]!==z||e[8]!==g||e[9]!==x||e[10]!==l||e[11]!==w?(S=!z&&t.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:t.jsxs("div",{className:"flex items-center gap-3 h-12 px-4",children:[t.jsx("div",{className:"flex items-center gap-2 flex-1",children:E}),t.jsx("div",{className:"flex items-center gap-2 shrink-0",children:t.jsx(Qe,{sortKey:l,sortDirection:x,onSort:g,sortOptions:w})})]})}),e[6]=E,e[7]=z,e[8]=g,e[9]=x,e[10]=l,e[11]=w,e[12]=S):S=e[12];let _;e[13]!==h||e[14]!==j||e[15]!==s||e[16]!==N||e[17]!==T||e[18]!==g||e[19]!==k||e[20]!==r||e[21]!==c||e[22]!==x||e[23]!==l||e[24]!==P||e[25]!==n?(_=n==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:s.length===0?t.jsx("div",{className:"flex items-center justify-center h-full",children:N||t.jsx(We,{icon:t.jsx(Ue,{size:36,className:"text-muted-foreground"}),title:"No items found",description:c?"Try adjusting your search":"No items to display"})}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:s.map(A=>t.jsx("div",{onClick:()=>T?.(A),className:"cursor-pointer h-full",children:t.jsx(kt,{item:A,schema:r,readOnly:k,actions:h})},A.id))})}):t.jsx(xt,{columns:Ht(j,r,P,h),data:s,sortKey:l,sortDirection:x,onSort:g,onRowClick:T,emptyState:N||t.jsx(We,{icon:t.jsx(Ue,{size:36,className:"text-muted-foreground"}),title:"No items found",description:c?"Try adjusting your search":"No items to display"})}),e[13]=h,e[14]=j,e[15]=s,e[16]=N,e[17]=T,e[18]=g,e[19]=k,e[20]=r,e[21]=c,e[22]=x,e[23]=l,e[24]=P,e[25]=n,e[26]=_):_=e[26];let I;return e[27]!==S||e[28]!==_?(I=t.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[S,_]}),e[27]=S,e[28]=_,e[29]=I):I=e[29],I}function Rt(i){return{id:i.id,label:typeof i.header=="string"?i.header:i.id}}function Bt(i){return i.sortable!==!1}function Vt(){}function qt(){}function Qt(i){return{id:"actions",header:"",render:e=>t.jsxs(He,{children:[t.jsx(Ye,{asChild:!0,children:t.jsx(Ce,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:t.jsx(Xe,{size:20})})}),t.jsxs(Je,{align:"end",onClick:s=>s.stopPropagation(),children:[i.open&&t.jsxs(O,{onClick:s=>{s.stopPropagation(),i.open?.(e)},children:[t.jsx(tt,{size:16}),"Open"]}),i.edit&&t.jsxs(O,{onClick:s=>{s.stopPropagation(),i.edit?.(e)},children:[t.jsx(et,{size:16}),"Edit"]}),i.duplicate&&t.jsxs(O,{onClick:s=>{s.stopPropagation(),i.duplicate?.(e)},children:[t.jsx(Ze,{size:16}),"Duplicate"]}),i.delete&&t.jsxs(O,{variant:"destructive",onClick:s=>{s.stopPropagation(),i.delete?.(e)},children:[t.jsx(st,{size:16}),"Delete"]})]})]}),cellClassName:"w-[60px]",sortable:!1}}function nt(i){const e=i.type;return Array.isArray(e)?e.every(s=>nt({type:s})):e==="string"||e==="number"||e==="integer"||e==="boolean"||e==="null"}function Gt(i,e){const s=i.properties||{},r=Object.keys(s).filter(o=>{const m=s[o];return m&&nt(m)}),n=Ut(s),c=[],l=new Set;n&&r.includes(n)&&(c.push(n),l.add(n));const p=["title","description","updated_at","updated_by"];for(const o of p)r.includes(o)&&!l.has(o)&&(c.push(o),l.add(o));const d=r.filter(o=>!l.has(o)&&!Re.includes(o)).sort((o,m)=>o.localeCompare(m));for(const o of d)c.push(o),l.add(o);for(const o of Re)r.includes(o)&&!l.has(o)&&(c.push(o),l.add(o));return c.map(o=>{const m=s[o],u=e?e.includes(o):!["id"].includes(o);return o===n?{id:o,header:"",render:f=>{const a=f[o];return t.jsx(Ge,{icon:a,name:f.title,size:"sm",className:"shrink-0 shadow-sm"})},sortable:!1,cellClassName:"w-16 shrink-0",wrap:!0}:o==="description"?{id:o,header:"Description",render:f=>{const a=f[o];return a==null?"—":t.jsx("span",{className:"block truncate max-w-[50ch]",children:String(a)})},sortable:u,cellClassName:"max-w-[50ch]"}:o==="created_by"||o==="updated_by"?{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:f=>{const a=f[o];return a?t.jsx(jt,{id:String(a),size:"xs"}):"—"},sortable:u,cellClassName:"max-w-[250px]"}:m?.format==="date-time"||o.endsWith("_at")?{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:f=>{const a=f[o];return a?t.jsx("span",{className:"block truncate max-w-full",children:new Date(a).toLocaleDateString()}):"—"},sortable:u,cellClassName:"max-w-[200px]"}:{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:f=>{const a=f[o];return a==null?"—":t.jsx("span",{className:"block truncate max-w-full",children:String(a)})},sortable:u,cellClassName:"max-w-[200px]"}})}function Ht(i,e,s,r){const n=i||Gt(e,s);return n.some(p=>p.id==="actions")?n:Object.keys(r).length>0?[...n,Qt(r)]:n}function Yt(i){const e=oe.c(119),{connectionId:s,org:r,activeCollection:n,onItemClick:c}=i,l=n.name,p=n.schema??ft,d=n.hasCreateTool,o=n.hasUpdateTool,m=n.hasDeleteTool,u=Be(),{data:f}=ct.useSession(),a=f?.user?.id||"unknown",v=Tt(s);let y;e[0]!==v||e[1]!==s?(y=v?bt(v):s,e[0]=v,e[1]=s,e[2]=y):y=e[2];const b=y,{org:x}=ze();let g;e[3]!==s||e[4]!==x.id||e[5]!==x.slug?(g={connectionId:s,orgId:x.id,orgSlug:x.slug},e[3]=s,e[4]=x.id,e[5]=x.slug,e[6]=g):g=e[6];const $=Ve(g),h=It(s,l,$),T=`${s}-${l}`;let E;e[7]!==r||e[8]!==T?(E={namespace:r,resource:T,defaultSortKey:"updated_at"},e[7]=r,e[8]=T,e[9]=E):E=e[9];const{search:N,searchTerm:k,setSearch:j,viewMode:z,setViewMode:P,sortKey:D,sortDirection:w,handleSort:S}=Ct(E);let _;e[10]!==k||e[11]!==w||e[12]!==D?(_={searchTerm:k,sortKey:D,sortDirection:w},e[10]=k,e[11]=w,e[12]=D,e[13]=_):_=e[13];const I=At(s,l,$,_),A=!d&&!o&&!m;let ne;e[14]!==b||e[15]!==l||e[16]!==u||e[17]!==c||e[18]!==r?(ne=C=>{if(c){c(C);return}u({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:r,appSlug:b,collectionName:l,itemId:C.id}})},e[14]=b,e[15]=l,e[16]=u,e[17]=c,e[18]=r,e[19]=ne):ne=e[19];const L=ne;let le;e[20]!==h.create||e[21]!==a?(le=async C=>{const xe=new Date().toISOString();await h.create.mutateAsync({...C,id:Me("conn"),title:`${C.title} (Copy)`,created_at:xe,updated_at:xe,created_by:a,updated_by:a})},e[20]=h.create,e[21]=a,e[22]=le):le=e[22];const be=le,[F,ve]=dt.useState(null);let re;e[23]===Symbol.for("react.memo_cache_sentinel")?(re=C=>{ve(C)},e[23]=re):re=e[23];const lt=re;let K;e[24]!==L||e[25]!==o?(K=o&&{edit:L},e[24]=L,e[25]=o,e[26]=K):K=e[26];let M;e[27]!==be||e[28]!==d?(M=d&&{duplicate:be},e[27]=be,e[28]=d,e[29]=M):M=e[29];let U;e[30]!==m?(U=m&&{delete:lt},e[30]=m,e[31]=U):U=e[31];let ae;e[32]!==M||e[33]!==U||e[34]!==K?(ae={...K,...M,...U},e[32]=M,e[33]=U,e[34]=K,e[35]=ae):ae=e[35];const ye=ae;let ce;e[36]!==h.delete||e[37]!==F?(ce=async()=>{F&&(await h.delete.mutateAsync(F.id),ve(null))},e[36]=h.delete,e[37]=F,e[38]=ce):ce=e[38];const Ne=ce;let de;e[39]!==h.create||e[40]!==b||e[41]!==l||e[42]!==d||e[43]!==u||e[44]!==r||e[45]!==a?(de=async()=>{if(!d){Le.error("Create operation is not available for this collection");return}const C=new Date().toISOString(),xe={id:Me("conn"),title:"New Item",description:"A brief description of the item",created_at:C,updated_at:C,created_by:a,updated_by:a};try{const ke=await h.create.mutateAsync(xe);u({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:r,appSlug:b,collectionName:l,itemId:ke.id}})}catch(ke){console.error("Failed to create item:",ke)}},e[39]=h.create,e[40]=b,e[41]=l,e[42]=d,e[43]=u,e[44]=r,e[45]=a,e[46]=de):de=e[46];const we=de;let ue;e[47]!==p?(ue=ot(p),e[47]=p,e[48]=ue):ue=e[48];const Se=ue,rt=(I?.length??0)>0,at=d&&!rt&&!N;let me;e[49]!==h.create||e[50]!==we||e[51]!==d?(me=d?t.jsxs(Ce,{onClick:we,size:"sm",disabled:h.create.isPending,className:"h-7",children:[t.jsx(Et,{className:"mr-2 h-4 w-4"}),h.create.isPending?"Creating...":"Create"]}):null,e[49]=h.create,e[50]=we,e[51]=d,e[52]=me):me=e[52];const pe=me,Pe=D;let W;e[53]!==S||e[54]!==w||e[55]!==Se||e[56]!==Pe?(W=t.jsx(Ot,{children:t.jsx(Qe,{sortKey:Pe,sortDirection:w,onSort:S,sortOptions:Se})}),e[53]=S,e[54]=w,e[55]=Se,e[56]=Pe,e[57]=W):W=e[57];const _e=`Search ${l}...`;let R;e[58]!==j?(R=C=>{C.key==="Escape"&&(j(""),C.target.blur())},e[58]=j,e[59]=R):R=e[59];let B;e[60]!==N||e[61]!==j||e[62]!==_e||e[63]!==R?(B=t.jsx("div",{className:"flex-1",children:t.jsx(ht,{value:N,onChange:j,placeholder:_e,onKeyDown:R})}),e[60]=N,e[61]=j,e[62]=_e,e[63]=R,e[64]=B):B=e[64];let V;e[65]!==pe||e[66]!==d?(V=d&&t.jsx("div",{className:"pr-3",children:pe}),e[65]=pe,e[66]=d,e[67]=V):V=e[67];let q;e[68]!==B||e[69]!==V?(q=t.jsxs("div",{className:"flex items-center gap-2",children:[B,V]}),e[68]=B,e[69]=V,e[70]=q):q=e[70];let Q;e[71]!==I?(Q=I??[],e[71]=I,e[72]=Q):Q=e[72];const De=D;let G;e[73]!==L?(G=C=>L(C),e[73]=L,e[74]=G):G=e[74];const Ie="No items found",Ae=N?"Try adjusting your search terms":"This collection doesn't have any items yet.",Te=at?pe:void 0;let H;e[75]!==Ie||e[76]!==Ae||e[77]!==Te?(H=t.jsx(it,{image:null,title:Ie,description:Ae,actions:Te}),e[75]=Ie,e[76]=Ae,e[77]=Te,e[78]=H):H=e[78];let Y;e[79]!==S||e[80]!==A||e[81]!==ye||e[82]!==p||e[83]!==N||e[84]!==j||e[85]!==P||e[86]!==w||e[87]!==Q||e[88]!==De||e[89]!==G||e[90]!==H||e[91]!==z?(Y=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(Wt,{hideToolbar:!0,data:Q,schema:p,viewMode:z,onViewModeChange:P,search:N,onSearchChange:j,sortKey:De,sortDirection:w,onSort:S,actions:ye,onItemClick:G,readOnly:A,emptyState:H})}),e[79]=S,e[80]=A,e[81]=ye,e[82]=p,e[83]=N,e[84]=j,e[85]=P,e[86]=w,e[87]=Q,e[88]=De,e[89]=G,e[90]=H,e[91]=z,e[92]=Y):Y=e[92];let J;e[93]!==q||e[94]!==Y?(J=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[q,Y]}),e[93]=q,e[94]=Y,e[95]=J):J=e[95];const Ee=!!F;let fe;e[96]===Symbol.for("react.memo_cache_sentinel")?(fe=C=>{C||ve(null)},e[96]=fe):fe=e[96];let he;e[97]===Symbol.for("react.memo_cache_sentinel")?(he=t.jsx(Nt,{children:"Delete item?"}),e[97]=he):he=e[97];const Oe=F?.title;let Z;e[98]!==Oe?(Z=t.jsxs(wt,{children:[he,t.jsxs(St,{children:['Are you sure you want to delete "',Oe,'"? This action cannot be undone.']})]}),e[98]=Oe,e[99]=Z):Z=e[99];let X;e[100]!==h.delete.isPending?(X=t.jsx(vt,{disabled:h.delete.isPending,children:"Cancel"}),e[100]=h.delete.isPending,e[101]=X):X=e[101];const $e=h.delete.isPending?"Deleting...":"Delete";let ee;e[102]!==h.delete.isPending||e[103]!==Ne||e[104]!==$e?(ee=t.jsx(yt,{onClick:Ne,disabled:h.delete.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:$e}),e[102]=h.delete.isPending,e[103]=Ne,e[104]=$e,e[105]=ee):ee=e[105];let te;e[106]!==X||e[107]!==ee?(te=t.jsxs(Pt,{children:[X,ee]}),e[106]=X,e[107]=ee,e[108]=te):te=e[108];let se;e[109]!==Z||e[110]!==te?(se=t.jsxs(_t,{children:[Z,te]}),e[109]=Z,e[110]=te,e[111]=se):se=e[111];let ie;e[112]!==Ee||e[113]!==se?(ie=t.jsx(Dt,{open:Ee,onOpenChange:fe,children:se}),e[112]=Ee,e[113]=se,e[114]=ie):ie=e[114];let ge;return e[115]!==W||e[116]!==J||e[117]!==ie?(ge=t.jsxs(t.Fragment,{children:[W,J,ie]}),e[115]=W,e[116]=J,e[117]=ie,e[118]=ge):ge=e[118],ge}function Jt(){const i=oe.c(13),{org:e,project:s}=ze(),r=ut();let n;i[0]!==e.id||i[1]!==e.slug?(n={connectionId:qe,orgId:e.id,orgSlug:e.slug},i[0]=e.id,i[1]=e.slug,i[2]=n):n=i[2];const c=Ve(n);let l;i[3]!==c||i[4]!==s?(l=async m=>{const u=s.enabledPlugins??[];if(u.includes(m))return;const f=[...u,m],a=await c.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:s.id,data:{metadata:{enabled_plugins:f}}}});return a.structuredContent??a},i[3]=c,i[4]=s,i[5]=l):l=i[5];let p;i[6]!==e.id||i[7]!==s||i[8]!==r?(p=()=>{r.invalidateQueries({queryKey:Fe.project(e.id,s.slug)}),r.invalidateQueries({queryKey:Fe.projects(e.id)})},i[6]=e.id,i[7]=s,i[8]=r,i[9]=p):p=i[9];let d;return i[10]!==l||i[11]!==p?(d={mutationFn:l,onSuccess:p,onError:Zt},i[10]=l,i[11]=p,i[12]=d):d=i[12],mt(d)}function Zt(i){Le.error("Failed to enable plugin: "+(i instanceof Error?i.message:"Unknown error"))}function Xt(i){const e=oe.c(12),{pluginId:s,title:r,description:n,icon:c}=i,l=Jt();let p;e[0]!==l||e[1]!==s?(p=async()=>{try{await l.mutateAsync(s),Le.success("Plugin enabled!")}catch{}},e[0]=l,e[1]=s,e[2]=p):p=e[2];const d=p,o=c??null,m=l.isPending?"Enabling…":"Enable plugin";let u;e[3]!==l.isPending||e[4]!==d||e[5]!==m?(u=t.jsx(Ce,{onClick:d,disabled:l.isPending,children:m}),e[3]=l.isPending,e[4]=d,e[5]=m,e[6]=u):u=e[6];let f;return e[7]!==n||e[8]!==o||e[9]!==u||e[10]!==r?(f=t.jsx(it,{image:o,title:r,description:n,actions:u}),e[7]=n,e[8]=o,e[9]=u,e[10]=r,e[11]=f):f=e[11],f}const es={name:"WORKFLOW",displayName:"Workflow",hasCreateTool:!0,hasUpdateTool:!0,hasDeleteTool:!0};function oi(){const{project:i,org:e}=ze();if(!(i.enabledPlugins??[]).includes(Ke))return t.jsx(je,{children:t.jsx(je.Content,{children:t.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:t.jsx(Xt,{pluginId:Ke,title:"Enable Workflows",description:"Automate multi-step processes by enabling the Workflows plugin. Once enabled you can create, run, and monitor workflows.",icon:t.jsx("div",{className:"bg-muted p-4 rounded-full",children:t.jsx(pt,{className:"size-8 text-muted-foreground"})})})})})});const n=Be();return t.jsx(je,{children:t.jsx(je.Content,{children:t.jsx(Yt,{connectionId:qe,org:e.slug,activeCollection:es,onItemClick:c=>n({to:"/$org/settings/workflows/$itemId",params:{org:e.slug,itemId:c.id}})})})})}export{oi as default};
|
|
1
|
+
import{e as oe,j as t,B as Ce,f as Be,b as ct,s as ze,r as dt,x as Le,o as ut,a as mt,K as Fe,Y as Ke,Z as pt}from"./index-b_n-uXmh.js";import{u as Ve,S as qe}from"./constants-Cj0U39_n.js";import{B as ft,g as Me}from"./constants-DE2tzNng.js";import{C as Qe}from"./collection-display-button-C2ECPv0_.js";import{C as ht}from"./collection-search-B8mdZm7u.js";import{C as gt}from"./card-DoqftRz7.js";import{I as Ge}from"./integration-icon-LX1nChXa.js";import{D as He,a as Ye,b as Je,c as O}from"./dropdown-menu-Bq-aRZ_r.js";import{c as Ze}from"./XCircle-Dp1Lqd1t.js";import{i as Xe}from"./DotsVertical-BrUfBHwt.js";import{y as et,H as Ue}from"./agent-icon-Be_PnRh0.js";import{s as tt}from"./RefreshCcw01-BzT-xyrO.js";import{s as st}from"./Trash01-f4CvhuWB.js";import{C as xt}from"./collection-table-wrapper-pDRU_Alr.js";import{E as We}from"./empty-state-Cw5GxS3i.js";import{U as jt}from"./user-ysfLNnXi.js";import{E as it}from"./empty-state-S_EjXlZP.js";import{u as Ct}from"./use-list-state-Dlljnhsv.js";import{g as bt}from"./connection-slug-eyAPH6o3.js";import{f as vt,g as yt,c as Nt,b as wt,d as St,e as Pt,a as _t,A as Dt}from"./alert-dialog-BUApN05b.js";import{a as It,c as At}from"./use-collections-CqIGWKSp.js";import{a as Tt}from"./use-connection-DuXPSqwF.js";import{s as Et}from"./Plus-Bihyskqy.js";import{a as Ot}from"./layout-BAy6nHY2.js";import{P as je}from"./index-BZhxvvXQ.js";import"./collections-CjrHbdtT.js";import"./XClose-lRlzG-cb.js";import"./ChevronDown-ByP-e484.js";import"./tooltip-B-nRvfy-.js";import"./view-mode-toggle-C5L447if.js";import"./badge-CRHmlYav.js";import"./SearchMd-vBRV-l3E.js";import"./Container-DzkLD13G.js";import"./ChevronRight-BUfZMnd9.js";import"./AlertCircle-BkX4HzbS.js";import"./Tool01-Dqyo2VjJ.js";import"./ArrowNarrowLeft-BebHkn1X.js";import"./ArrowUpRight-uszsF274.js";import"./ZapSquare-_fsDSSOX.js";import"./Users03-IortA-KV.js";import"./CheckCircle-Boq6G01L.js";import"./ChevronUp-TwiYbtUW.js";import"./Star01-ByzmPd4J.js";import"./Palette-1HvN4NnC.js";import"./LinkExternal01-gfL-Fk4b.js";import"./Lock01-CI-miN4g.js";import"./Sun-xA_CdWAJ.js";import"./Play-O7ldNAxa.js";import"./Settings02-eiwWD3s7.js";import"./Shield01-D7ml37xT.js";import"./User01-lDhxACAV.js";import"./X-BiphajNJ.js";import"./Zap-ebWdIwXf.js";import"./table-CT5HWSPV.js";import"./avatar-BBnvw18x.js";import"./use-view-mode-BjLGHFfJ.js";function $t(i,e){const s=i.properties||{};for(const n in s){const c=s[n];if(c&&c.type==="string"&&(c.format==="url"||c.format==="uri")&&e&&typeof e=="object"&&n in e&&e[n])return e[n]}const r=["image","img","avatar","icon","logo","thumbnail","cover"];for(const n of r)if(e&&typeof e=="object"&&n in e&&typeof e[n]=="string")return e[n]}function kt(i){const e=oe.c(25),{item:s,schema:r,actions:n}=i;let c;e[0]!==s||e[1]!==r?(c=$t(r,s),e[0]=s,e[1]=r,e[2]=c):c=e[2];const l=c,p=s&&typeof s=="object"&&"description"in s&&typeof s.description=="string"?s.description:void 0;let d;e[3]!==n?(d=n&&Object.keys(n).length>0,e[3]=n,e[4]=d):d=e[4];const o=d;let m;e[5]!==l||e[6]!==s.title?(m=t.jsx(Ge,{icon:l,name:s.title,size:"md",className:"shrink-0 shadow-sm"}),e[5]=l,e[6]=s.title,e[7]=m):m=e[7];let u;e[8]!==s.title?(u=t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:s.title}),e[8]=s.title,e[9]=u):u=e[9];const f=p||"No description";let a;e[10]!==f?(a=t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:f}),e[10]=f,e[11]=a):a=e[11];let v;e[12]!==u||e[13]!==a?(v=t.jsxs("div",{className:"flex flex-col gap-0 flex-1",children:[u,a]}),e[12]=u,e[13]=a,e[14]=v):v=e[14];let y;e[15]!==m||e[16]!==v?(y=t.jsxs("div",{className:"flex flex-col gap-4 p-6 flex-1",children:[m,v]}),e[15]=m,e[16]=v,e[17]=y):y=e[17];let b;e[18]!==n||e[19]!==o||e[20]!==s?(b=o&&t.jsx("div",{className:"absolute top-6 right-6 sm:opacity-0 sm:group-hover:opacity-100 transition-opacity",onClick:Kt,onMouseDown:Ft,children:t.jsxs(He,{children:[t.jsx(Ye,{asChild:!0,children:t.jsx(Ce,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:Lt,children:t.jsx(Xe,{size:20})})}),t.jsxs(Je,{align:"end",onClick:zt,children:[n.open&&t.jsxs(O,{onClick:g=>{g.stopPropagation(),n.open?.(s)},children:[t.jsx(tt,{size:16}),"Open"]}),n.edit&&t.jsxs(O,{onClick:g=>{g.stopPropagation(),n.edit?.(s)},children:[t.jsx(et,{size:16}),"Edit"]}),n.duplicate&&t.jsxs(O,{onClick:g=>{g.stopPropagation(),n.duplicate?.(s)},children:[t.jsx(Ze,{size:16}),"Duplicate"]}),n.delete&&t.jsxs(O,{variant:"destructive",onClick:g=>{g.stopPropagation(),n.delete?.(s)},children:[t.jsx(st,{size:16}),"Delete"]})]})]})}),e[18]=n,e[19]=o,e[20]=s,e[21]=b):b=e[21];let x;return e[22]!==y||e[23]!==b?(x=t.jsxs(gt,{className:"cursor-pointer transition-colors hover:bg-accent/50 h-full flex flex-col group relative",children:[y,b]}),e[22]=y,e[23]=b,e[24]=x):x=e[24],x}function zt(i){return i.stopPropagation()}function Lt(i){return i.stopPropagation()}function Ft(i){return i.stopPropagation()}function Kt(i){return i.stopPropagation()}const Mt=["icon","avatar","logo"],Re=["created_at","created_by","id"];function Ut(i){return Object.keys(i).find(e=>Mt.includes(e.toLowerCase()))}function ot(i,e){return Object.keys(i.properties||{}).filter(s=>["id","created_at","updated_at","created_by","updated_by"].includes(s)?!1:e?e.includes(s):!0).map(s=>({id:s,label:s.charAt(0).toUpperCase()+s.slice(1).replace(/_/g," ")}))}function Wt(i){const e=oe.c(30),{data:s,schema:r,viewMode:n,search:c,sortKey:l,sortDirection:p,onSort:d,actions:o,onItemClick:m,headerActions:u,emptyState:f,readOnly:a,columns:v,hideToolbar:y,sortableFields:b}=i,x=p===void 0?"asc":p,g=d===void 0?qt:d;let $;e[0]!==o?($=o===void 0?{}:o,e[0]=o,e[1]=$):$=e[1];const h=$,T=m===void 0?Vt:m,E=u===void 0?null:u,N=f===void 0?null:f,k=a===void 0?!1:a,j=v===void 0?void 0:v,z=y===void 0?!1:y,P=b===void 0?void 0:b;let D;e[2]!==j||e[3]!==r||e[4]!==P?(D=j?j.filter(Bt).filter(A=>!P||P.includes(A.id)).map(Rt):ot(r,P),e[2]=j,e[3]=r,e[4]=P,e[5]=D):D=e[5];const w=D;let S;e[6]!==E||e[7]!==z||e[8]!==g||e[9]!==x||e[10]!==l||e[11]!==w?(S=!z&&t.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:t.jsxs("div",{className:"flex items-center gap-3 h-12 px-4",children:[t.jsx("div",{className:"flex items-center gap-2 flex-1",children:E}),t.jsx("div",{className:"flex items-center gap-2 shrink-0",children:t.jsx(Qe,{sortKey:l,sortDirection:x,onSort:g,sortOptions:w})})]})}),e[6]=E,e[7]=z,e[8]=g,e[9]=x,e[10]=l,e[11]=w,e[12]=S):S=e[12];let _;e[13]!==h||e[14]!==j||e[15]!==s||e[16]!==N||e[17]!==T||e[18]!==g||e[19]!==k||e[20]!==r||e[21]!==c||e[22]!==x||e[23]!==l||e[24]!==P||e[25]!==n?(_=n==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:s.length===0?t.jsx("div",{className:"flex items-center justify-center h-full",children:N||t.jsx(We,{icon:t.jsx(Ue,{size:36,className:"text-muted-foreground"}),title:"No items found",description:c?"Try adjusting your search":"No items to display"})}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:s.map(A=>t.jsx("div",{onClick:()=>T?.(A),className:"cursor-pointer h-full",children:t.jsx(kt,{item:A,schema:r,readOnly:k,actions:h})},A.id))})}):t.jsx(xt,{columns:Ht(j,r,P,h),data:s,sortKey:l,sortDirection:x,onSort:g,onRowClick:T,emptyState:N||t.jsx(We,{icon:t.jsx(Ue,{size:36,className:"text-muted-foreground"}),title:"No items found",description:c?"Try adjusting your search":"No items to display"})}),e[13]=h,e[14]=j,e[15]=s,e[16]=N,e[17]=T,e[18]=g,e[19]=k,e[20]=r,e[21]=c,e[22]=x,e[23]=l,e[24]=P,e[25]=n,e[26]=_):_=e[26];let I;return e[27]!==S||e[28]!==_?(I=t.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[S,_]}),e[27]=S,e[28]=_,e[29]=I):I=e[29],I}function Rt(i){return{id:i.id,label:typeof i.header=="string"?i.header:i.id}}function Bt(i){return i.sortable!==!1}function Vt(){}function qt(){}function Qt(i){return{id:"actions",header:"",render:e=>t.jsxs(He,{children:[t.jsx(Ye,{asChild:!0,children:t.jsx(Ce,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:t.jsx(Xe,{size:20})})}),t.jsxs(Je,{align:"end",onClick:s=>s.stopPropagation(),children:[i.open&&t.jsxs(O,{onClick:s=>{s.stopPropagation(),i.open?.(e)},children:[t.jsx(tt,{size:16}),"Open"]}),i.edit&&t.jsxs(O,{onClick:s=>{s.stopPropagation(),i.edit?.(e)},children:[t.jsx(et,{size:16}),"Edit"]}),i.duplicate&&t.jsxs(O,{onClick:s=>{s.stopPropagation(),i.duplicate?.(e)},children:[t.jsx(Ze,{size:16}),"Duplicate"]}),i.delete&&t.jsxs(O,{variant:"destructive",onClick:s=>{s.stopPropagation(),i.delete?.(e)},children:[t.jsx(st,{size:16}),"Delete"]})]})]}),cellClassName:"w-[60px]",sortable:!1}}function nt(i){const e=i.type;return Array.isArray(e)?e.every(s=>nt({type:s})):e==="string"||e==="number"||e==="integer"||e==="boolean"||e==="null"}function Gt(i,e){const s=i.properties||{},r=Object.keys(s).filter(o=>{const m=s[o];return m&&nt(m)}),n=Ut(s),c=[],l=new Set;n&&r.includes(n)&&(c.push(n),l.add(n));const p=["title","description","updated_at","updated_by"];for(const o of p)r.includes(o)&&!l.has(o)&&(c.push(o),l.add(o));const d=r.filter(o=>!l.has(o)&&!Re.includes(o)).sort((o,m)=>o.localeCompare(m));for(const o of d)c.push(o),l.add(o);for(const o of Re)r.includes(o)&&!l.has(o)&&(c.push(o),l.add(o));return c.map(o=>{const m=s[o],u=e?e.includes(o):!["id"].includes(o);return o===n?{id:o,header:"",render:f=>{const a=f[o];return t.jsx(Ge,{icon:a,name:f.title,size:"sm",className:"shrink-0 shadow-sm"})},sortable:!1,cellClassName:"w-16 shrink-0",wrap:!0}:o==="description"?{id:o,header:"Description",render:f=>{const a=f[o];return a==null?"—":t.jsx("span",{className:"block truncate max-w-[50ch]",children:String(a)})},sortable:u,cellClassName:"max-w-[50ch]"}:o==="created_by"||o==="updated_by"?{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:f=>{const a=f[o];return a?t.jsx(jt,{id:String(a),size:"xs"}):"—"},sortable:u,cellClassName:"max-w-[250px]"}:m?.format==="date-time"||o.endsWith("_at")?{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:f=>{const a=f[o];return a?t.jsx("span",{className:"block truncate max-w-full",children:new Date(a).toLocaleDateString()}):"—"},sortable:u,cellClassName:"max-w-[200px]"}:{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:f=>{const a=f[o];return a==null?"—":t.jsx("span",{className:"block truncate max-w-full",children:String(a)})},sortable:u,cellClassName:"max-w-[200px]"}})}function Ht(i,e,s,r){const n=i||Gt(e,s);return n.some(p=>p.id==="actions")?n:Object.keys(r).length>0?[...n,Qt(r)]:n}function Yt(i){const e=oe.c(119),{connectionId:s,org:r,activeCollection:n,onItemClick:c}=i,l=n.name,p=n.schema??ft,d=n.hasCreateTool,o=n.hasUpdateTool,m=n.hasDeleteTool,u=Be(),{data:f}=ct.useSession(),a=f?.user?.id||"unknown",v=Tt(s);let y;e[0]!==v||e[1]!==s?(y=v?bt(v):s,e[0]=v,e[1]=s,e[2]=y):y=e[2];const b=y,{org:x}=ze();let g;e[3]!==s||e[4]!==x.id||e[5]!==x.slug?(g={connectionId:s,orgId:x.id,orgSlug:x.slug},e[3]=s,e[4]=x.id,e[5]=x.slug,e[6]=g):g=e[6];const $=Ve(g),h=It(s,l,$),T=`${s}-${l}`;let E;e[7]!==r||e[8]!==T?(E={namespace:r,resource:T,defaultSortKey:"updated_at"},e[7]=r,e[8]=T,e[9]=E):E=e[9];const{search:N,searchTerm:k,setSearch:j,viewMode:z,setViewMode:P,sortKey:D,sortDirection:w,handleSort:S}=Ct(E);let _;e[10]!==k||e[11]!==w||e[12]!==D?(_={searchTerm:k,sortKey:D,sortDirection:w},e[10]=k,e[11]=w,e[12]=D,e[13]=_):_=e[13];const I=At(s,l,$,_),A=!d&&!o&&!m;let ne;e[14]!==b||e[15]!==l||e[16]!==u||e[17]!==c||e[18]!==r?(ne=C=>{if(c){c(C);return}u({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:r,appSlug:b,collectionName:l,itemId:C.id}})},e[14]=b,e[15]=l,e[16]=u,e[17]=c,e[18]=r,e[19]=ne):ne=e[19];const L=ne;let le;e[20]!==h.create||e[21]!==a?(le=async C=>{const xe=new Date().toISOString();await h.create.mutateAsync({...C,id:Me("conn"),title:`${C.title} (Copy)`,created_at:xe,updated_at:xe,created_by:a,updated_by:a})},e[20]=h.create,e[21]=a,e[22]=le):le=e[22];const be=le,[F,ve]=dt.useState(null);let re;e[23]===Symbol.for("react.memo_cache_sentinel")?(re=C=>{ve(C)},e[23]=re):re=e[23];const lt=re;let K;e[24]!==L||e[25]!==o?(K=o&&{edit:L},e[24]=L,e[25]=o,e[26]=K):K=e[26];let M;e[27]!==be||e[28]!==d?(M=d&&{duplicate:be},e[27]=be,e[28]=d,e[29]=M):M=e[29];let U;e[30]!==m?(U=m&&{delete:lt},e[30]=m,e[31]=U):U=e[31];let ae;e[32]!==M||e[33]!==U||e[34]!==K?(ae={...K,...M,...U},e[32]=M,e[33]=U,e[34]=K,e[35]=ae):ae=e[35];const ye=ae;let ce;e[36]!==h.delete||e[37]!==F?(ce=async()=>{F&&(await h.delete.mutateAsync(F.id),ve(null))},e[36]=h.delete,e[37]=F,e[38]=ce):ce=e[38];const Ne=ce;let de;e[39]!==h.create||e[40]!==b||e[41]!==l||e[42]!==d||e[43]!==u||e[44]!==r||e[45]!==a?(de=async()=>{if(!d){Le.error("Create operation is not available for this collection");return}const C=new Date().toISOString(),xe={id:Me("conn"),title:"New Item",description:"A brief description of the item",created_at:C,updated_at:C,created_by:a,updated_by:a};try{const ke=await h.create.mutateAsync(xe);u({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:r,appSlug:b,collectionName:l,itemId:ke.id}})}catch(ke){console.error("Failed to create item:",ke)}},e[39]=h.create,e[40]=b,e[41]=l,e[42]=d,e[43]=u,e[44]=r,e[45]=a,e[46]=de):de=e[46];const we=de;let ue;e[47]!==p?(ue=ot(p),e[47]=p,e[48]=ue):ue=e[48];const Se=ue,rt=(I?.length??0)>0,at=d&&!rt&&!N;let me;e[49]!==h.create||e[50]!==we||e[51]!==d?(me=d?t.jsxs(Ce,{onClick:we,size:"sm",disabled:h.create.isPending,className:"h-7",children:[t.jsx(Et,{className:"mr-2 h-4 w-4"}),h.create.isPending?"Creating...":"Create"]}):null,e[49]=h.create,e[50]=we,e[51]=d,e[52]=me):me=e[52];const pe=me,Pe=D;let W;e[53]!==S||e[54]!==w||e[55]!==Se||e[56]!==Pe?(W=t.jsx(Ot,{children:t.jsx(Qe,{sortKey:Pe,sortDirection:w,onSort:S,sortOptions:Se})}),e[53]=S,e[54]=w,e[55]=Se,e[56]=Pe,e[57]=W):W=e[57];const _e=`Search ${l}...`;let R;e[58]!==j?(R=C=>{C.key==="Escape"&&(j(""),C.target.blur())},e[58]=j,e[59]=R):R=e[59];let B;e[60]!==N||e[61]!==j||e[62]!==_e||e[63]!==R?(B=t.jsx("div",{className:"flex-1",children:t.jsx(ht,{value:N,onChange:j,placeholder:_e,onKeyDown:R})}),e[60]=N,e[61]=j,e[62]=_e,e[63]=R,e[64]=B):B=e[64];let V;e[65]!==pe||e[66]!==d?(V=d&&t.jsx("div",{className:"pr-3",children:pe}),e[65]=pe,e[66]=d,e[67]=V):V=e[67];let q;e[68]!==B||e[69]!==V?(q=t.jsxs("div",{className:"flex items-center gap-2",children:[B,V]}),e[68]=B,e[69]=V,e[70]=q):q=e[70];let Q;e[71]!==I?(Q=I??[],e[71]=I,e[72]=Q):Q=e[72];const De=D;let G;e[73]!==L?(G=C=>L(C),e[73]=L,e[74]=G):G=e[74];const Ie="No items found",Ae=N?"Try adjusting your search terms":"This collection doesn't have any items yet.",Te=at?pe:void 0;let H;e[75]!==Ie||e[76]!==Ae||e[77]!==Te?(H=t.jsx(it,{image:null,title:Ie,description:Ae,actions:Te}),e[75]=Ie,e[76]=Ae,e[77]=Te,e[78]=H):H=e[78];let Y;e[79]!==S||e[80]!==A||e[81]!==ye||e[82]!==p||e[83]!==N||e[84]!==j||e[85]!==P||e[86]!==w||e[87]!==Q||e[88]!==De||e[89]!==G||e[90]!==H||e[91]!==z?(Y=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(Wt,{hideToolbar:!0,data:Q,schema:p,viewMode:z,onViewModeChange:P,search:N,onSearchChange:j,sortKey:De,sortDirection:w,onSort:S,actions:ye,onItemClick:G,readOnly:A,emptyState:H})}),e[79]=S,e[80]=A,e[81]=ye,e[82]=p,e[83]=N,e[84]=j,e[85]=P,e[86]=w,e[87]=Q,e[88]=De,e[89]=G,e[90]=H,e[91]=z,e[92]=Y):Y=e[92];let J;e[93]!==q||e[94]!==Y?(J=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[q,Y]}),e[93]=q,e[94]=Y,e[95]=J):J=e[95];const Ee=!!F;let fe;e[96]===Symbol.for("react.memo_cache_sentinel")?(fe=C=>{C||ve(null)},e[96]=fe):fe=e[96];let he;e[97]===Symbol.for("react.memo_cache_sentinel")?(he=t.jsx(Nt,{children:"Delete item?"}),e[97]=he):he=e[97];const Oe=F?.title;let Z;e[98]!==Oe?(Z=t.jsxs(wt,{children:[he,t.jsxs(St,{children:['Are you sure you want to delete "',Oe,'"? This action cannot be undone.']})]}),e[98]=Oe,e[99]=Z):Z=e[99];let X;e[100]!==h.delete.isPending?(X=t.jsx(vt,{disabled:h.delete.isPending,children:"Cancel"}),e[100]=h.delete.isPending,e[101]=X):X=e[101];const $e=h.delete.isPending?"Deleting...":"Delete";let ee;e[102]!==h.delete.isPending||e[103]!==Ne||e[104]!==$e?(ee=t.jsx(yt,{onClick:Ne,disabled:h.delete.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:$e}),e[102]=h.delete.isPending,e[103]=Ne,e[104]=$e,e[105]=ee):ee=e[105];let te;e[106]!==X||e[107]!==ee?(te=t.jsxs(Pt,{children:[X,ee]}),e[106]=X,e[107]=ee,e[108]=te):te=e[108];let se;e[109]!==Z||e[110]!==te?(se=t.jsxs(_t,{children:[Z,te]}),e[109]=Z,e[110]=te,e[111]=se):se=e[111];let ie;e[112]!==Ee||e[113]!==se?(ie=t.jsx(Dt,{open:Ee,onOpenChange:fe,children:se}),e[112]=Ee,e[113]=se,e[114]=ie):ie=e[114];let ge;return e[115]!==W||e[116]!==J||e[117]!==ie?(ge=t.jsxs(t.Fragment,{children:[W,J,ie]}),e[115]=W,e[116]=J,e[117]=ie,e[118]=ge):ge=e[118],ge}function Jt(){const i=oe.c(13),{org:e,project:s}=ze(),r=ut();let n;i[0]!==e.id||i[1]!==e.slug?(n={connectionId:qe,orgId:e.id,orgSlug:e.slug},i[0]=e.id,i[1]=e.slug,i[2]=n):n=i[2];const c=Ve(n);let l;i[3]!==c||i[4]!==s?(l=async m=>{const u=s.enabledPlugins??[];if(u.includes(m))return;const f=[...u,m],a=await c.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:s.id,data:{metadata:{enabled_plugins:f}}}});return a.structuredContent??a},i[3]=c,i[4]=s,i[5]=l):l=i[5];let p;i[6]!==e.id||i[7]!==s||i[8]!==r?(p=()=>{r.invalidateQueries({queryKey:Fe.project(e.id,s.slug)}),r.invalidateQueries({queryKey:Fe.projects(e.id)})},i[6]=e.id,i[7]=s,i[8]=r,i[9]=p):p=i[9];let d;return i[10]!==l||i[11]!==p?(d={mutationFn:l,onSuccess:p,onError:Zt},i[10]=l,i[11]=p,i[12]=d):d=i[12],mt(d)}function Zt(i){Le.error("Failed to enable plugin: "+(i instanceof Error?i.message:"Unknown error"))}function Xt(i){const e=oe.c(12),{pluginId:s,title:r,description:n,icon:c}=i,l=Jt();let p;e[0]!==l||e[1]!==s?(p=async()=>{try{await l.mutateAsync(s),Le.success("Plugin enabled!")}catch{}},e[0]=l,e[1]=s,e[2]=p):p=e[2];const d=p,o=c??null,m=l.isPending?"Enabling…":"Enable plugin";let u;e[3]!==l.isPending||e[4]!==d||e[5]!==m?(u=t.jsx(Ce,{onClick:d,disabled:l.isPending,children:m}),e[3]=l.isPending,e[4]=d,e[5]=m,e[6]=u):u=e[6];let f;return e[7]!==n||e[8]!==o||e[9]!==u||e[10]!==r?(f=t.jsx(it,{image:o,title:r,description:n,actions:u}),e[7]=n,e[8]=o,e[9]=u,e[10]=r,e[11]=f):f=e[11],f}const es={name:"WORKFLOW",displayName:"Workflow",hasCreateTool:!0,hasUpdateTool:!0,hasDeleteTool:!0};function oi(){const{project:i,org:e}=ze();if(!(i.enabledPlugins??[]).includes(Ke))return t.jsx(je,{children:t.jsx(je.Content,{children:t.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:t.jsx(Xt,{pluginId:Ke,title:"Enable Workflows",description:"Automate multi-step processes by enabling the Workflows plugin. Once enabled you can create, run, and monitor workflows.",icon:t.jsx("div",{className:"bg-muted p-4 rounded-full",children:t.jsx(pt,{className:"size-8 text-muted-foreground"})})})})})});const n=Be();return t.jsx(je,{children:t.jsx(je.Content,{children:t.jsx(Yt,{connectionId:qe,org:e.slug,activeCollection:es,onItemClick:c=>n({to:"/$org/settings/workflows/$itemId",params:{org:e.slug,itemId:c.id}})})})})}export{oi as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as s,g as l,j as o,l as a,E as n,r as c}from"./index-b_n-uXmh.js";import{a as f}from"./index-C--avMTn.js";import"./index-DCOURowK.js";import"./constants-Cj0U39_n.js";import"./collections-CjrHbdtT.js";import"./index-ClNUcJ8s.js";import"./use-virtual-mcp-Qy5dDA1Q.js";import"./use-collections-CqIGWKSp.js";import"./monaco-editor-BY6pRUNM.js";import"./index-pdnGjAa-.js";import"./accordion-D3c87Mh0.js";import"./agent-icon-Be_PnRh0.js";import"./AlertCircle-BkX4HzbS.js";import"./Tool01-Dqyo2VjJ.js";import"./XClose-lRlzG-cb.js";import"./RefreshCcw01-BzT-xyrO.js";import"./ArrowNarrowLeft-BebHkn1X.js";import"./XCircle-Dp1Lqd1t.js";import"./ArrowUpRight-uszsF274.js";import"./ZapSquare-_fsDSSOX.js";import"./Users03-IortA-KV.js";import"./CheckCircle-Boq6G01L.js";import"./ChevronDown-ByP-e484.js";import"./ChevronRight-BUfZMnd9.js";import"./ChevronUp-TwiYbtUW.js";import"./DotsVertical-BrUfBHwt.js";import"./Container-DzkLD13G.js";import"./Star01-ByzmPd4J.js";import"./Palette-1HvN4NnC.js";import"./SearchMd-vBRV-l3E.js";import"./index-BZhxvvXQ.js";import"./tooltip-B-nRvfy-.js";import"./X-BiphajNJ.js";import"./LinkExternal01-gfL-Fk4b.js";import"./Lock01-CI-miN4g.js";import"./Sun-xA_CdWAJ.js";import"./Play-O7ldNAxa.js";import"./Plus-Bihyskqy.js";import"./Settings02-eiwWD3s7.js";import"./Shield01-D7ml37xT.js";import"./Trash01-f4CvhuWB.js";import"./User01-lDhxACAV.js";import"./Zap-ebWdIwXf.js";import"./badge-CRHmlYav.js";import"./select-CaDZpVbI.js";import"./view-mode-toggle-C5L447if.js";import"./layout-BAy6nHY2.js";import"./use-connection-DuXPSqwF.js";import"./use-mcp-tools-BkDSNv3W.js";import"./dialog-BdVY7mqq.js";import"./index-ZmvI6xf3.js";import"./dropdown-menu-Bq-aRZ_r.js";import"./integration-icon-LX1nChXa.js";import"./scroll-area-18YOEnqD.js";import"./index-y9YjpvN-.js";import"./empty-state-Cw5GxS3i.js";import"./create-sse-subscription-CxkOgzKf.js";import"./input-C80VzPpQ.js";function ht(){const t=s.c(4);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org/settings/workflows/$itemId"},t[0]=r):r=t[0];const{itemId:e}=l(r);let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(a,{size:32,className:"animate-spin text-muted-foreground"})}),t[1]=i):i=t[1];const p=decodeURIComponent(e);let m;return t[2]!==p?(m=o.jsx(n,{children:o.jsx(c.Suspense,{fallback:i,children:o.jsx(f,{itemId:p})})}),t[2]=p,t[3]=m):m=t[3],m}export{ht as default};
|
package/dist/client/index.html
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
28
28
|
<link rel="manifest" href="/manifest.webmanifest" />
|
|
29
29
|
<meta name="theme-color" content="#D0EC1A" />
|
|
30
|
-
<script type="module" crossorigin src="/assets/index-
|
|
30
|
+
<script type="module" crossorigin src="/assets/index-b_n-uXmh.js"></script>
|
|
31
31
|
<link rel="stylesheet" crossorigin href="/assets/index-B4J1yAvl.css">
|
|
32
32
|
</head>
|
|
33
33
|
<body>
|
package/dist/server/cli.js
CHANGED
|
@@ -1623,7 +1623,7 @@ AS SELECT
|
|
|
1623
1623
|
FROM monitoring_metrics
|
|
1624
1624
|
GROUP BY organization_id, name, bucket, connection_id, tool_name, status
|
|
1625
1625
|
`}),console.log("[clickhouse-schema] monitoring_metrics_rollup_1m_mv view ready")}finally{await G.close()}}catch(Y){console.error("[clickhouse-schema] Failed to create rollup DDL (queries will fall back to raw table):",Y)}}async function qA1(X){let Y={...process.env},G=S$1(X,Y),Q=G.settings.encryptionKey;console.log(`[settings] ENCRYPTION_KEY = ${JSON.stringify(Q)} (${Q.length} chars)`);let{ensureServices:J}=await Promise.resolve().then(() => (T$1(),A$1)),{outputs:W,services:Z}=await J({home:G.settings.dataDir,externalDatabaseUrl:G.externalDatabaseUrl,externalNatsUrl:G.externalNatsUrl});if(!G.skipMigrations){let{migrateBetterAuth:K}=await Promise.resolve().then(() => (w30(),gx4));await K(W.databaseUrl);let{createDatabase:H}=await Promise.resolve().then(() => (QU(),hx4)),{migrateToLatest:U}=await Promise.resolve().then(() => (ir4(),cr4)),B=H(W.databaseUrl);await U({keepOpen:!0,database:B,skipBetterAuth:!0})}if(G.settings.clickhouseUrl){let{ensureClickHouseRollup:K}=await Promise.resolve().then(() => ps4);await K(G.settings.clickhouseUrl)}let $={...G.settings,databaseUrl:W.databaseUrl,natsUrls:W.natsUrls};return Xt1($),{settings:$,services:Z.map((K)=>({name:K.name==="PostgreSQL"?"Postgres":K.name,port:K.port})),managedServiceNames:Z.filter((K)=>K.owner==="managed").map((K)=>K.name)}}var iB0=D(()=>{en1();l9()});var IA1={};j0(IA1,{updateService:()=>rt,toggleViewMode:()=>nB0,toggleVibeState:()=>aB0,toggleLogFlow:()=>tB0,subscribeCliState:()=>qX1,setVibe:()=>Pp5,setTuiConsoleIntercepted:()=>AA1,setServerUrl:()=>TX1,setMigrationsDone:()=>AX1,setEnv:()=>IX1,setDevMode:()=>Lp5,setDataDir:()=>Ep5,isTuiConsoleIntercepted:()=>TA1,getCliState:()=>PX1,addLogEntry:()=>$z});function qU(){for(let X of pB0)X()}function PX1(){return X7}function qX1(X){return pB0.add(X),()=>pB0.delete(X)}function rt(X){X7={...X7,services:X7.services.map((Y)=>Y.name===X.name?X:Y)},qU()}function AX1(){X7={...X7,migrationsStatus:"done"},qU()}function TX1(X){X7={...X7,serverUrl:X},qU()}function IX1(X){X7={...X7,env:X},qU()}function $z(X){let Y=[...X7.logs,X];X7={...X7,logs:Y.length>500?Y.slice(-500):Y},qU()}function Lp5(){X7={...X7,services:[...X7.services,{name:"Vite",status:"pending",port:0}]},qU()}function nB0(){X7={...X7,viewMode:X7.viewMode==="requests"?"config":"requests"},qU()}function tB0(){X7={...X7,logFlow:!X7.logFlow},qU()}function Ep5(X){X7={...X7,dataDir:X},qU()}function Pp5(X){X7={...X7,vibe:X},qU()}function aB0(){X7={...X7,vibe:!X7.vibe},qU()}function AA1(X){ns4=X}function TA1(){return ns4}var X7,pB0,ns4=!1;var Kz=D(()=>{X7={services:[{name:"Postgres",status:"pending",port:0},{name:"NATS",status:"pending",port:0}],migrationsStatus:"pending",serverUrl:null,env:null,logs:[],viewMode:"requests",logFlow:!1,vibe:!1,dataDir:null},pB0=new Set});import{createServer as ts4}from"net";function qp5(X){return new Promise((Y)=>{let G=ts4();G.once("error",()=>Y(!1)),G.listen(X,"0.0.0.0",()=>{G.close(()=>Y(!0))})})}async function VA1(X){if(await qp5(X))return X;let Y=await new Promise((G,Q)=>{let J=ts4();J.once("error",Q),J.listen(0,"0.0.0.0",()=>{let W=J.address(),Z=typeof W==="object"&&W?W.port:0;J.close(()=>G(Z))})});return console.warn(`Port ${X} is in use, using port ${Y} instead.`),Y}var rB0=()=>{};var oB0={};j0(oB0,{startDevServer:()=>Tp5});import{join as Ap5}from"path";function as4(X){return X.replace(/\x1b\[[0-9;]*m/g,"")}function rs4(X){let Y=X.getReader(),G=new TextDecoder,Q="";function J(){let W=Q.split(`
|
|
1626
|
-
`);Q=W.pop()??"";for(let Z of W){let $=as4(Z).replace(/^\[\d+\]\s*/,"").trim();if(!$)continue;$z({method:"",path:"",status:0,duration:0,timestamp:new Date,rawLine:$})}}(async()=>{for(;;){let{done:W,value:Z}=await Y.read();if(W)break;Q+=G.decode(Z,{stream:!0}),J()}if(Q.trim()){let W=as4(Q).replace(/^\[\d+\]\s*/,"").trim();if(W)$z({method:"",path:"",status:0,duration:0,timestamp:new Date,rawLine:W})}})()}async function Tp5(X){let{vitePort:Y,baseUrl:G,noTui:Q}=X,J=await VA1(Number(X.port)),{settings:W,services:Z,managedServiceNames:$}=await qA1({port:String(J),home:X.home,baseUrl:X.baseUrl,localMode:X.localMode,skipMigrations:X.skipMigrations,noTui:X.noTui,vitePort:X.vitePort});for(let z of Z)rt({name:z.name,status:"ready",port:z.port});IX1(W),AX1();let K=Ap5(import.meta.dir,"..","..","..","..",".."),H=Q===!0,U=Bun.spawn(["bun","run","--cwd=apps/mesh","dev:servers"],{cwd:K,env:{...process.env,PORT:String(W.port),VITE_PORT:String(Y),DATABASE_URL:W.databaseUrl,NATS_URL:W.natsUrls.join(","),NODE_ENV:W.nodeEnv,DECOCMS_LOCAL_MODE:String(W.localMode),DECOCMS_HOME:W.dataDir,DATA_DIR:W.dataDir,DECO_CLI:"1",...W.baseUrl?{BASE_URL:W.baseUrl}:{}},stdio:["inherit",H?"inherit":"pipe",H?"inherit":"pipe"]});if(!H)rs4(U.stdout),rs4(U.stderr);let B=G||`http://localhost:${W.port}`;TX1(B),rt({name:"Vite",status:"ready",port:Number(Y)});let N=async(z)=>{if(U.kill(z),$.length>0){let{stopServices:O}=await Promise.resolve().then(() => (T$1(),A$1));await O(W.dataDir)}};return process.on("SIGINT",()=>N("SIGINT")),process.on("SIGTERM",()=>N("SIGTERM")),{port:Number(W.port),process:U}}var sB0=D(()=>{iB0();Kz();rB0()});import{Box as eB0,Text as XN0}from"ink";import{jsx as ss4,jsxs as jA1}from"react/jsx-runtime";function os4(X){if(!X)return"not set";try{let Y=new URL(X);if(Y.password)Y.password="***";if(Y.username&&Y.username.length>3)Y.username=Y.username.slice(0,3)+"***";return Y.pathname="/",Y.search="",Y.hash="",Y.toString()}catch{if(X.length<=10)return X;return X.slice(0,6)+"***"+X.slice(-4)}}function jp5(X,Y){if(Ip5.has(X))return Y?{text:"\u25CF\u25CF\u25CF\u25CF\u25CF\u25CF",dimColor:!0}:{text:"not set",dimColor:!0};if(Vp5.has(X)){if(Array.isArray(Y)){if(Y.length===0)return{text:"not set",dimColor:!0};return{text:Y.map((W)=>os4(W)).join(", "),color:"cyan"}}let Q=os4(Y);return Q==="not set"?{text:Q,dimColor:!0}:{text:Q,color:"cyan"}}if(Y===void 0||Y===null||Y==="")return{text:"not set",dimColor:!0};let G=String(Y);if(G==="true")return{text:G,color:"green"};if(G==="false")return{text:G,color:"yellow"};try{return new URL(G),{text:G,color:"cyan"}}catch{return{text:G}}}function Mp5(X){return[{title:"Core",entries:[{key:"NODE_ENV",value:X.nodeEnv},{key:"PORT",value:X.port},{key:"BASE_URL",value:X.baseUrl??`http://localhost:${X.port}`},{key:"DATA_DIR",value:X.dataDir}]},{title:"Database",entries:[{key:"DATABASE_URL",value:X.databaseUrl},{key:"DATABASE_PG_SSL",value:X.databasePgSsl}]},{title:"Auth & Secrets",entries:[{key:"BETTER_AUTH_SECRET",value:X.betterAuthSecret},{key:"ENCRYPTION_KEY",value:X.encryptionKey},{key:"MESH_JWT_SECRET",value:X.meshJwtSecret},{key:"STUDIO_PROVISION_SECRET_KEY",value:X.studioProvisionSecretKey},{key:"DISABLE_RATE_LIMIT",value:X.disableRateLimit}]},{title:"Auth Providers",entries:[{key:"AUTH_EMAIL_PASSWORD_ENABLED",value:process.env.AUTH_EMAIL_PASSWORD_ENABLED??"true"},{key:"AUTH_GOOGLE_CLIENT_ID",value:!!process.env.AUTH_GOOGLE_CLIENT_ID},{key:"AUTH_GITHUB_CLIENT_ID",value:!!process.env.AUTH_GITHUB_CLIENT_ID},{key:"AUTH_RESEND_API_KEY",value:!!process.env.AUTH_RESEND_API_KEY},{key:"AUTH_SENDGRID_API_KEY",value:!!process.env.AUTH_SENDGRID_API_KEY},{key:"AUTH_SSO_MS_CLIENT_ID",value:!!process.env.AUTH_SSO_MS_CLIENT_ID},{key:"AUTH_MAGIC_LINK_ENABLED",value:process.env.AUTH_MAGIC_LINK_ENABLED==="true"},{key:"AUTH_EMAIL_OTP_ENABLED",value:process.env.AUTH_EMAIL_OTP_ENABLED==="true"}]},{title:"Observability",entries:[{key:"CLICKHOUSE_URL",value:X.clickhouseUrl},{key:"OTEL_SERVICE_NAME",value:X.otelServiceName}]},{title:"Event Bus & Networking",entries:[{key:"NATS_URL",value:X.natsUrls}]},{title:"Config Files",entries:[{key:"CONFIG_PATH",value:X.configPath}]},{title:"AI Gateway",entries:[{key:"DECO_AI_GATEWAY_ENABLED",value:X.aiGatewayEnabled},{key:"DECO_AI_GATEWAY_URL",value:X.aiGatewayUrl}]}]}function es4({env:X}){let Y=Mp5(X);return ss4(eB0,{flexDirection:"column",children:Y.map((G)=>jA1(eB0,{flexDirection:"column",marginTop:1,children:[jA1(XN0,{dimColor:!0,children:[" ","\u2500\u2500 ",G.title," ","\u2500".repeat(Math.max(0,38-G.title.length))]}),G.entries.map(({key:Q,value:J})=>{let W=jp5(Q,J);return jA1(eB0,{children:[jA1(XN0,{dimColor:!0,children:[" ",Q.padEnd(36)]}),ss4(XN0,{color:W.color,dimColor:W.dimColor,children:W.text})]},Q)})]},G.title))})}var Ip5,Vp5;var Xe4=D(()=>{Ip5=new Set(["BETTER_AUTH_SECRET","ENCRYPTION_KEY","MESH_JWT_SECRET","STUDIO_PROVISION_SECRET_KEY"]),Vp5=new Set(["DATABASE_URL","CLICKHOUSE_URL","NATS_URL"])});var YN0;var Ye4=D(()=>{YN0={name:"decocms",version:"2.302.0",description:"Deco CMS \u2014 Self-hostable MCP Gateway for managing AI connections and tools",author:"Deco team",repository:{type:"git",url:"git+https://github.com/decocms/studio.git",directory:"apps/mesh"},bugs:{url:"https://github.com/decocms/studio/issues"},type:"module",bin:{deco:"./dist/server/cli.js"},files:["dist/**/*"],scripts:{dev:'bun run migrate && concurrently "bun run dev:client" "bun run dev:server"',"dev:servers":'concurrently "bun run dev:client" "bun run dev:server"',"dev:client":"bun --bun vite dev","dev:server":"bun run --cwd=../../packages/sandbox build && NODE_ENV=development bun --env-file=.env --hot run src/index.ts","build:client":"bun --bun vite build","build:server":"bun run scripts/bundle-server-script.ts --dist ./dist/server","db:migrate":"bun run ./dist/server/migrate.js",check:"tsc --noEmit",start:"bun run ./dist/server/server.js",migrate:"bun run src/database/migrate.ts",test:"bun test","test:e2e":"playwright test","test:e2e:ui":"playwright test --ui","better-auth:migrate":"bunx --bun @better-auth/cli migrate -y --config src/auth/index.ts",prepublishOnly:"bun run build:client && bun run build:server"},optionalDependencies:{"@duckdb/node-api":"^1.5.0-r.1","@freestyle-sh/with-bun":"^0.2.12","@freestyle-sh/with-deno":"^0.0.4","@freestyle-sh/with-nodejs":"^0.2.9","freestyle-sandboxes":"^0.1.46"},dependencies:{"@ai-sdk/anthropic":"^3.0.58","@ai-sdk/google":"^3.0.60","@ai-sdk/openai":"^3.0.50","@anthropic-ai/sdk":"^0.79.0","@aws-sdk/client-s3":"^3.1013.0","@aws-sdk/s3-request-presigner":"^3.1013.0","@clickhouse/client":"^1.8.1","@dnd-kit/core":"^6.3.1","@dnd-kit/sortable":"^10.0.0","@dnd-kit/utilities":"^3.2.2","@inkjs/ui":"^2.0.0","@modelcontextprotocol/ext-apps":"^1.2.2","@openrouter/ai-sdk-provider":"^2.2.5","@opentelemetry/core":"^2.6.0","@tanstack/react-virtual":"^3.13.21","@xterm/addon-fit":"^0.11.0","@xterm/xterm":"^6.0.0","ai-sdk-provider-claude-code":"^3.4.4","ai-sdk-provider-codex-cli":"^1.1.0","embedded-postgres":"^18.3.0-beta.16",ink:"^6.8.0",kysely:"^0.28.12",nats:"^2.29.3","node-pty":"^1.0.0","posthog-js":"^1.371.1","posthog-node":"^5.0.0",react:"^19.2.0","react-dom":"^19.2.0"},devDependencies:{"@ai-sdk/provider":"^3.0.8","@ai-sdk/react":"^3.0.118","@anthropic-ai/claude-agent-sdk":"^0.2.80","@better-auth/sso":"1.4.1","@daveyplate/better-auth-ui":"^3.2.7","@deco/ui":"workspace:*","@decocms/better-auth":"1.5.17","@decocms/bindings":"workspace:*","@decocms/mcp-utils":"workspace:*","@decocms/mesh-sdk":"workspace:*","@decocms/runtime":"workspace:*","@decocms/vite-plugin":"workspace:*","@electric-sql/pglite":"^0.3.15","@floating-ui/react":"^0.27.16","@hookform/resolvers":"^5.2.2","@jitl/quickjs-wasmfile-release-sync":"0.31.0","@modelcontextprotocol/sdk":"1.27.1","@monaco-editor/react":"^4.7.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/sdk-logs":"^0.211.0","@opentelemetry/sdk-metrics":"^2.2.0","@opentelemetry/sdk-node":"^0.207.0","@opentelemetry/sdk-trace-base":"^2.5.0","@playwright/test":"^1.58.2","@radix-ui/react-avatar":"^1.1.10","@radix-ui/react-checkbox":"^1.3.3","@radix-ui/react-dialog":"^1.1.15","@radix-ui/react-dropdown-menu":"^2.1.16","@radix-ui/react-label":"^2.1.7","@radix-ui/react-select":"^2.2.6","@radix-ui/react-separator":"^1.1.7","@radix-ui/react-slot":"^1.2.3","@radix-ui/react-tabs":"^1.1.13","@rjsf/core":"^6.1.2","@rjsf/shadcn":"^6.1.2","@rjsf/utils":"^6.1.2","@rjsf/validator-ajv8":"^6.1.2","@tailwindcss/vite":"^4.1.17","@tanstack/react-query":"5.90.11","@tanstack/react-router":"^1.139.7","@tiptap/core":"3.20.2","@tiptap/extension-mention":"3.20.2","@tiptap/extension-placeholder":"3.20.2","@tiptap/pm":"3.20.2","@tiptap/react":"3.20.2","@tiptap/starter-kit":"3.20.2","@tiptap/suggestion":"3.20.2","@types/bun":"^1.3.1","@types/pg":"^8.15.6","@types/react-syntax-highlighter":"^15.5.13","@untitledui/icons":"^0.0.19","@vercel/nft":"^1.1.1","@vitejs/plugin-react":"^5.1.0",ai:"^6.0.116","babel-plugin-react-compiler":"^1.0.0","better-auth":"1.4.5","class-variance-authority":"^0.7.1",clsx:"^2.1.1",concurrently:"^9.2.1",croner:"^9.1.0","date-fns":"^4.1.0",degit:"^2.8.4",hono:"^4.10.7","input-otp":"^1.4.2",jose:"^6.0.11","kysely-pglite":"^0.6.1","lucide-react":"^0.468.0",marked:"^15.0.6","@decocms/sandbox":"workspace:*","mesh-plugin-workflows":"workspace:*",nanoid:"^5.1.6",pg:"^8.16.3",prettier:"^3.4.2","react-hook-form":"^7.66.0","react-markdown":"^10.1.0","react-resizable-panels":"^2.1.7","react-syntax-highlighter":"^15.6.1",recharts:"^3.6.0","rehype-raw":"^7.0.0","remark-gfm":"^4.0.0","sass-embedded":"^1.97.2",sonner:"^2.0.7","tailwind-merge":"^3.3.1",tailwindcss:"^4.1.17",typescript:"^5.9.3",vite:"^7.2.1","vite-tsconfig-paths":"^5.1.4",zod:"^4.0.0",zustand:"^5.0.9"},homepage:"https://github.com/decocms/studio",keywords:["mcp","model-context-protocol","ai","gateway","self-hosted","mesh","tools"],license:"MIT",publishConfig:{access:"public"}}});import{Box as AU,Text as RX}from"ink";import{Spinner as Sp5}from"@inkjs/ui";import{useSyncExternalStore as Ge4}from"react";import{jsx as AY,jsxs as sQ}from"react/jsx-runtime";function fp5(X,Y){if(!X||!_p5.has(X))return X;let G=GN0[Y]??GN0[GN0.length-1];return X==="#875f00"?G[0]:G[1]}function Qe4({status:X}){if(X==="pending")return AY(Sp5,{label:""});return AY(RX,{color:"green",children:"\u2713"})}function Je4({services:X,migrationsStatus:Y,home:G,serverUrl:Q,vibe:J}){let W=Ge4(Vl0,Il0),Z=Ge4(Cl0,kl0);return sQ(AU,{flexDirection:"column",paddingBottom:1,children:[J?sQ(AU,{flexDirection:"column",children:[W.map(($,K)=>{let H=Z[K],U=$.reduce((N,z)=>N+z.text.length,0),B=Math.max(0,vp5-U);return sQ(AU,{flexDirection:"row",children:[$.map((N,z)=>{let O=fp5(N.color,K);return O?AY(RX,{color:O,children:N.text},z):AY(RX,{children:N.text},z)}),AY(RX,{children:" ".repeat(B+2)}),H?.map((N,z)=>N.color?AY(RX,{color:N.color,children:N.char},z):AY(RX,{children:N.char},z))]},K)}),sQ(RX,{dimColor:!0,children:[" v",YN0.version]})]}):sQ(AU,{flexDirection:"column",marginTop:1,children:[kp5.map(($,K)=>AY(RX,{color:Cp5[K],children:$},K)),sQ(RX,{dimColor:!0,children:[" v",YN0.version]})]}),AY(AU,{marginBottom:1,children:AY(RX,{dimColor:!0,children:"\u2500".repeat(80)})}),AY(AU,{children:sQ(RX,{dimColor:!0,children:["Home: ",G]})}),sQ(AU,{gap:2,children:[X.map(($)=>sQ(AU,{gap:1,children:[sQ(RX,{children:[$.name," :",$.port||"...."]}),AY(Qe4,{status:$.status})]},$.name)),sQ(AU,{gap:1,children:[AY(RX,{children:"Migrations"}),AY(Qe4,{status:Y})]})]}),AY(AU,{children:Q?sQ(RX,{children:["Open in browser: ",AY(RX,{color:"cyan",children:Q})]}):AY(RX,{dimColor:!0,children:"Starting..."})}),sQ(AU,{gap:2,children:[sQ(RX,{dimColor:!0,children:[AY(RX,{bold:!0,dimColor:!0,children:"K"})," ","toggle config"]}),sQ(RX,{dimColor:!0,children:[AY(RX,{bold:!0,dimColor:!0,children:"L"})," ","toggle log flow"]}),sQ(RX,{dimColor:!0,children:[AY(RX,{bold:!0,dimColor:!0,children:"V"})," ","toggle vibe ",J?"\u266A Nihilore \xB7 CC BY 4.0":""]}),J&&sQ(RX,{dimColor:!0,children:[AY(RX,{bold:!0,dimColor:!0,children:"N"})," ","skip song"]})]})]})}var kp5,Cp5,GN0,vp5=30,_p5;var Ze4=D(()=>{Ye4();mn1();tn1();kp5=[" \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588 ","\u2591\u2591\u2588\u2588\u2588\u2591\u2591\u2591\u2591\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588\u2591\u2591\u2591\u2591\u2591\u2588 \u2588\u2588\u2588\u2591\u2591\u2591\u2591\u2591\u2588\u2588\u2588 \u2588\u2588\u2588\u2591\u2591\u2591\u2591\u2591\u2588\u2588\u2588 "," \u2591\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2588 \u2591 \u2588\u2588\u2588 \u2591\u2591\u2591 \u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588"," \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588"," \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588\u2591\u2591\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588"," \u2591\u2588\u2588\u2588 \u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591 \u2588\u2591\u2591\u2588\u2588\u2588 \u2588\u2588\u2588\u2591\u2591\u2588\u2588\u2588 \u2588\u2588\u2588 "," \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2591\u2591\u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2591 ","\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591\u2591\u2591 "],Cp5=["#00ff64","#00ee5e","#00dc56","#00c84e","#00b444","#00a03c","#008832","#006e28"],GN0=[["#00ff64","#00cc50"],["#00f060","#00c04c"],["#00e05c","#00b448"],["#00d058","#00a844"],["#00c054","#009c40"],["#00b050","#00903c"],["#00a04c","#008438"],["#009048","#007834"],["#008044","#006c30"],["#007040","#00602c"],["#00603c","#005428"]],_p5=new Set(["#875f00","#5f3800"])});import{useSyncExternalStore as bp5}from"react";function yp5(){let X=process.stdout.rows||24,Y=process.stdout.columns||80;if(X!==MA1.rows||Y!==MA1.columns)MA1={rows:X,columns:Y};return MA1}function xp5(X){return process.stdout.on("resize",X),()=>{process.stdout.off("resize",X)}}function We4(){return bp5(xp5,yp5)}var MA1;var $e4=D(()=>{MA1={rows:process.stdout.rows||24,columns:process.stdout.columns||80}});import{Box as hp5,Text as VX1}from"ink";import{useSyncExternalStore as gp5}from"react";import{jsx as QN0,jsxs as JN0}from"react/jsx-runtime";function up5(X){if(X>=500)return"red";if(X>=400)return"yellow";if(X>=300)return"cyan";return"green"}function Ke4({logs:X,headerHeight:Y}){let{rows:G}=We4(),{logFlow:Q}=gp5(qX1,PX1),J=Math.max(1,G-Y-1),W=Q?X:X.slice(-J);return QN0(hp5,{flexDirection:"column",children:W.map((Z,$)=>{if(Z.rawLine)return QN0(VX1,{dimColor:!0,children:Z.rawLine},$);let K=Z.duration<1000?`${Z.duration}ms`:`${(Z.duration/1000).toFixed(1)}s`;return JN0(VX1,{children:[JN0(VX1,{dimColor:!0,children:[Z.method.padEnd(6)," ",Z.path.padEnd(30)," "]}),QN0(VX1,{color:up5(Z.status),children:Z.status}),JN0(VX1,{dimColor:!0,children:[" ",K.padStart(8)]})]},$)})})}var He4=D(()=>{Kz();$e4()});var ZN0={};j0(ZN0,{App:()=>np5});import{Box as lp5,Text as mp5,useInput as dp5}from"ink";import{useSyncExternalStore as cp5}from"react";import{jsx as RA1,jsxs as tp5}from"react/jsx-runtime";function np5({home:X}){let Y=cp5(qX1,PX1);return dp5((G)=>{if(G==="k"||G==="K")nB0();if(G==="l"||G==="L")tB0();if((G==="v"||G==="V")&&Y.dataDir)sn1(Y.dataDir),aB0();if((G==="n"||G==="N")&&Y.vibe)on1()}),tp5(lp5,{flexDirection:"column",children:[RA1(Je4,{services:Y.services,migrationsStatus:Y.migrationsStatus,home:X,serverUrl:Y.serverUrl,vibe:Y.vibe}),Y.viewMode==="config"?Y.env?RA1(es4,{env:Y.env}):RA1(mp5,{dimColor:!0,children:"Loading configuration..."}):RA1(Ke4,{logs:Y.logs,headerHeight:Y.vibe?pp5:ip5})]})}var ip5=15,pp5=19;var WN0=D(()=>{Xe4();Ze4();He4();Kz();Sd()});function Fe4(X,Y={}){return{PORT:String(X.port),NODE_ENV:X.nodeEnv,BASE_URL:X.baseUrl,DATA_DIR:X.dataDir,DECOCMS_HOME:X.dataDir,DATABASE_URL:X.databaseUrl,DATABASE_PG_SSL:String(X.databasePgSsl),DATABASE_POOL_MAX:String(X.databasePoolMax),NATS_URL:X.natsUrls.join(","),BETTER_AUTH_SECRET:X.betterAuthSecret,ENCRYPTION_KEY:X.encryptionKey,MESH_JWT_SECRET:X.meshJwtSecret,DECOCMS_LOCAL_MODE:String(X.localMode),DISABLE_RATE_LIMIT:String(X.disableRateLimit),STUDIO_PROVISION_SECRET_KEY:X.studioProvisionSecretKey,CONFIG_PATH:X.configPath,...Object.fromEntries(Object.entries(process.env).filter(([G])=>G.startsWith("AUTH_"))),DECO_AI_GATEWAY_ENABLED:String(X.aiGatewayEnabled),DECO_AI_GATEWAY_URL:X.aiGatewayUrl,ENABLE_DECO_IMPORT:String(X.enableDecoImport),S3_ENDPOINT:X.s3Endpoint,S3_BUCKET:X.s3Bucket,S3_REGION:X.s3Region,S3_ACCESS_KEY_ID:X.s3AccessKeyId,S3_SECRET_ACCESS_KEY:X.s3SecretAccessKey,S3_FORCE_PATH_STYLE:String(X.s3ForcePathStyle),OTEL_SERVICE_NAME:X.otelServiceName,CLICKHOUSE_URL:X.clickhouseUrl,DECO_SUPABASE_URL:X.decoSupabaseUrl,DECO_SUPABASE_SERVICE_KEY:X.decoSupabaseServiceKey,FIRECRAWL_API_KEY:X.firecrawlApiKey,STUDIO_SANDBOX_RUNNER:process.env.STUDIO_SANDBOX_RUNNER,STUDIO_SANDBOX_TEMPLATE_NAME:process.env.STUDIO_SANDBOX_TEMPLATE_NAME,STUDIO_ENV:process.env.STUDIO_ENV,STUDIO_SANDBOX_PREVIEW_URL_PATTERN:process.env.STUDIO_SANDBOX_PREVIEW_URL_PATTERN,STUDIO_SANDBOX_PREVIEW_GATEWAY_NAME:process.env.STUDIO_SANDBOX_PREVIEW_GATEWAY_NAME,STUDIO_SANDBOX_PREVIEW_GATEWAY_NAMESPACE:process.env.STUDIO_SANDBOX_PREVIEW_GATEWAY_NAMESPACE,STUDIO_SANDBOX_SENTINEL_TOKEN:process.env.STUDIO_SANDBOX_SENTINEL_TOKEN,KUBERNETES_SERVICE_HOST:process.env.KUBERNETES_SERVICE_HOST,KUBERNETES_SERVICE_PORT:process.env.KUBERNETES_SERVICE_PORT,FREESTYLE_API_KEY:process.env.FREESTYLE_API_KEY,BROWSERLESS_TOKEN:process.env.BROWSERLESS_TOKEN,NODE_EXTRA_CA_CERTS:process.env.NODE_EXTRA_CA_CERTS,DECO_CLI:"1",DECO_NO_TUI:"true",...Y}}var vj=k((Xn5)=>{Xn5.HttpAuthLocation=void 0;(function(X){X.HEADER="header",X.QUERY="query"})(Xn5.HttpAuthLocation||(Xn5.HttpAuthLocation={}));Xn5.HttpApiKeyAuthLocation=void 0;(function(X){X.HEADER="header",X.QUERY="query"})(Xn5.HttpApiKeyAuthLocation||(Xn5.HttpApiKeyAuthLocation={}));Xn5.EndpointURLScheme=void 0;(function(X){X.HTTP="http",X.HTTPS="https"})(Xn5.EndpointURLScheme||(Xn5.EndpointURLScheme={}));Xn5.AlgorithmId=void 0;(function(X){X.MD5="md5",X.CRC32="crc32",X.CRC32C="crc32c",X.SHA1="sha1",X.SHA256="sha256"})(Xn5.AlgorithmId||(Xn5.AlgorithmId={}));var ap5=(X)=>{let Y=[];if(X.sha256!==void 0)Y.push({algorithmId:()=>Xn5.AlgorithmId.SHA256,checksumConstructor:()=>X.sha256});if(X.md5!=null)Y.push({algorithmId:()=>Xn5.AlgorithmId.MD5,checksumConstructor:()=>X.md5});return{addChecksumAlgorithm(G){Y.push(G)},checksumAlgorithms(){return Y}}},rp5=(X)=>{let Y={};return X.checksumAlgorithms().forEach((G)=>{Y[G.algorithmId()]=G.checksumConstructor()}),Y},op5=(X)=>{return ap5(X)},sp5=(X)=>{return rp5(X)};Xn5.FieldPosition=void 0;(function(X){X[X.HEADER=0]="HEADER",X[X.TRAILER=1]="TRAILER"})(Xn5.FieldPosition||(Xn5.FieldPosition={}));var ep5="__smithy_context";Xn5.IniSectionType=void 0;(function(X){X.PROFILE="profile",X.SSO_SESSION="sso-session",X.SERVICES="services"})(Xn5.IniSectionType||(Xn5.IniSectionType={}));Xn5.RequestHandlerProtocol=void 0;(function(X){X.HTTP_0_9="http/0.9",X.HTTP_1_0="http/1.0",X.TDS_8_0="tds/8.0"})(Xn5.RequestHandlerProtocol||(Xn5.RequestHandlerProtocol={}));Xn5.SMITHY_CONTEXT_KEY=ep5;Xn5.getDefaultClientConfiguration=op5;Xn5.resolveDefaultRuntimeConfig=sp5});var u7=k((Hn5)=>{var Jn5=vj(),Zn5=(X)=>{return{setHttpHandler(Y){X.httpHandler=Y},httpHandler(){return X.httpHandler},updateHttpClientConfig(Y,G){X.httpHandler?.updateHttpClientConfig(Y,G)},httpHandlerConfigs(){return X.httpHandler.httpHandlerConfigs()}}},Wn5=(X)=>{return{httpHandler:X.httpHandler()}};class Ue4{name;kind;values;constructor({name:X,kind:Y=Jn5.FieldPosition.HEADER,values:G=[]}){this.name=X,this.kind=Y,this.values=G}add(X){this.values.push(X)}set(X){this.values=X}remove(X){this.values=this.values.filter((Y)=>Y!==X)}toString(){return this.values.map((X)=>X.includes(",")||X.includes(" ")?`"${X}"`:X).join(", ")}get(){return this.values}}class Be4{entries={};encoding;constructor({fields:X=[],encoding:Y="utf-8"}){X.forEach(this.setField.bind(this)),this.encoding=Y}setField(X){this.entries[X.name.toLowerCase()]=X}getField(X){return this.entries[X.toLowerCase()]}removeField(X){delete this.entries[X.toLowerCase()]}getByType(X){return Object.values(this.entries).filter((Y)=>Y.kind===X)}}class SA1{method;protocol;hostname;port;path;query;headers;username;password;fragment;body;constructor(X){this.method=X.method||"GET",this.hostname=X.hostname||"localhost",this.port=X.port,this.query=X.query||{},this.headers=X.headers||{},this.body=X.body,this.protocol=X.protocol?X.protocol.slice(-1)!==":"?`${X.protocol}:`:X.protocol:"https:",this.path=X.path?X.path.charAt(0)!=="/"?`/${X.path}`:X.path:"/",this.username=X.username,this.password=X.password,this.fragment=X.fragment}static clone(X){let Y=new SA1({...X,headers:{...X.headers}});if(Y.query)Y.query=$n5(Y.query);return Y}static isInstance(X){if(!X)return!1;let Y=X;return"method"in Y&&"protocol"in Y&&"hostname"in Y&&"path"in Y&&typeof Y.query==="object"&&typeof Y.headers==="object"}clone(){return SA1.clone(this)}}function $n5(X){return Object.keys(X).reduce((Y,G)=>{let Q=X[G];return{...Y,[G]:Array.isArray(Q)?[...Q]:Q}},{})}class Ne4{statusCode;reason;headers;body;constructor(X){this.statusCode=X.statusCode,this.reason=X.reason,this.headers=X.headers||{},this.body=X.body}static isInstance(X){if(!X)return!1;let Y=X;return typeof Y.statusCode==="number"&&typeof Y.headers==="object"}}function Kn5(X){return/^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/.test(X)}Hn5.Field=Ue4;Hn5.Fields=Be4;Hn5.HttpRequest=SA1;Hn5.HttpResponse=Ne4;Hn5.getHttpHandlerExtensionConfiguration=Zn5;Hn5.isValidHostname=Kn5;Hn5.resolveHttpHandlerRuntimeConfig=Wn5});function wn5(X){return(Y)=>async(G)=>{let{request:Q}=G;if(X.expectContinueHeader!==!1&&ze4.HttpRequest.isInstance(Q)&&Q.body&&X.runtime==="node"&&X.requestHandler?.constructor?.name!=="FetchHttpHandler"){let J=!0;if(typeof X.expectContinueHeader==="number")try{J=(Number(Q.headers?.["content-length"])??X.bodyLengthChecker?.(Q.body)??1/0)>=X.expectContinueHeader}catch(W){}else J=!!X.expectContinueHeader;if(J)Q.headers.Expect="100-continue"}return Y({...G,request:Q})}}var ze4,Ln5,Oe4=(X)=>({applyToStack:(Y)=>{Y.add(wn5(X),Ln5)}});var De4=D(()=>{ze4=Y1(u7(),1);Ln5={step:"build",tags:["SET_EXPECT_HEADER","EXPECT_HEADER"],name:"addExpectContinueMiddleware",override:!0}});var wH,kA1,_j,CA1,E9,we4,MX1;var LH=D(()=>{wH={WHEN_SUPPORTED:"WHEN_SUPPORTED",WHEN_REQUIRED:"WHEN_REQUIRED"},kA1=wH.WHEN_SUPPORTED,_j={WHEN_SUPPORTED:"WHEN_SUPPORTED",WHEN_REQUIRED:"WHEN_REQUIRED"},CA1=wH.WHEN_SUPPORTED;(function(X){X.MD5="MD5",X.CRC32="CRC32",X.CRC32C="CRC32C",X.CRC64NVME="CRC64NVME",X.SHA1="SHA1",X.SHA256="SHA256"})(E9||(E9={}));(function(X){X.HEADER="header",X.TRAILER="trailer"})(we4||(we4={}));MX1=E9.CRC32});var Rq,ot=(X,Y,G,Q)=>{if(!(Y in X))return;let J=X[Y].toUpperCase();if(!Object.values(G).includes(J))throw TypeError(`Cannot load ${Q} '${Y}'. Expected one of ${Object.values(G)}, got '${X[Y]}'.`);return J};var NN0=D(()=>{(function(X){X.ENV="env",X.CONFIG="shared config entry"})(Rq||(Rq={}))});var En5="AWS_REQUEST_CHECKSUM_CALCULATION",Pn5="request_checksum_calculation",Le4;var Ee4=D(()=>{LH();NN0();Le4={environmentVariableSelector:(X)=>ot(X,En5,wH,Rq.ENV),configFileSelector:(X)=>ot(X,Pn5,wH,Rq.CONFIG),default:kA1}});var qn5="AWS_RESPONSE_CHECKSUM_VALIDATION",An5="response_checksum_validation",Pe4;var qe4=D(()=>{LH();NN0();Pe4={environmentVariableSelector:(X)=>ot(X,qn5,_j,Rq.ENV),configFileSelector:(X)=>ot(X,An5,_j,Rq.CONFIG),default:CA1}});var ON0=k((vn5)=>{var Tn5=["AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch"],In5=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],Vn5=["TimeoutError","RequestTimeout","RequestTimeoutException"],jn5=[500,502,503,504],Mn5=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],Rn5=["EHOSTUNREACH","ENETUNREACH","ENOTFOUND"],Ae4=(X)=>X?.$retryable!==void 0,Sn5=(X)=>Tn5.includes(X.name),Te4=(X)=>X.$metadata?.clockSkewCorrected,Ie4=(X)=>{let Y=new Set(["Failed to fetch","NetworkError when attempting to fetch resource","The Internet connection appears to be offline","Load failed","Network request failed"]);if(!(X&&X instanceof TypeError))return!1;return Y.has(X.message)},kn5=(X)=>X.$metadata?.httpStatusCode===429||In5.includes(X.name)||X.$retryable?.throttling==!0,zN0=(X,Y=0)=>Ae4(X)||Te4(X)||X.name==="InvalidSignatureException"&&X.message?.includes("Signature expired")||Vn5.includes(X.name)||Mn5.includes(X?.code||"")||Rn5.includes(X?.code||"")||jn5.includes(X.$metadata?.httpStatusCode||0)||Ie4(X)||Ve4(X)||X.cause!==void 0&&Y<=10&&zN0(X.cause,Y+1),Cn5=(X)=>{if(X.$metadata?.httpStatusCode!==void 0){let Y=X.$metadata.httpStatusCode;if(500<=Y&&Y<=599&&!zN0(X))return!0;return!1}return!1};function Ve4(X){return X.code==="ERR_HTTP2_STREAM_ERROR"&&X.message.includes("NGHTTP2_REFUSED_STREAM")}vn5.isBrowserNetworkError=Ie4;vn5.isClockSkewCorrectedError=Te4;vn5.isClockSkewError=Sn5;vn5.isNodeJsHttp2TransientError=Ve4;vn5.isRetryableByTrait=Ae4;vn5.isServerError=Cn5;vn5.isThrottlingError=kn5;vn5.isTransientError=zN0});var Dw=k((an5)=>{var ln5=ON0();an5.RETRY_MODES=void 0;(function(X){X.STANDARD="standard",X.ADAPTIVE="adaptive"})(an5.RETRY_MODES||(an5.RETRY_MODES={}));var _A1=3,mn5=an5.RETRY_MODES.STANDARD;class fA1{static setTimeoutFn=setTimeout;beta;minCapacity;minFillRate;scaleConstant;smooth;enabled=!1;availableTokens=0;lastMaxRate=0;measuredTxRate=0;requestCount=0;fillRate;lastThrottleTime;lastTimestamp=0;lastTxRateBucket;maxCapacity;timeWindow=0;constructor(X){this.beta=X?.beta??0.7,this.minCapacity=X?.minCapacity??1,this.minFillRate=X?.minFillRate??0.5,this.scaleConstant=X?.scaleConstant??0.4,this.smooth=X?.smooth??0.8,this.lastThrottleTime=this.getCurrentTimeInSeconds(),this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}async getSendToken(){return this.acquireTokenBucket(1)}updateClientSendingRate(X){let Y;this.updateMeasuredRate();let G=X;if(G?.errorType==="THROTTLING"||ln5.isThrottlingError(G?.error??X)){let W=!this.enabled?this.measuredTxRate:Math.min(this.measuredTxRate,this.fillRate);this.lastMaxRate=W,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),Y=this.cubicThrottle(W),this.enableTokenBucket()}else this.calculateTimeWindow(),Y=this.cubicSuccess(this.getCurrentTimeInSeconds());let J=Math.min(Y,2*this.measuredTxRate);this.updateTokenBucketRate(J)}getCurrentTimeInSeconds(){return Date.now()/1000}async acquireTokenBucket(X){if(!this.enabled)return;if(this.refillTokenBucket(),X>this.availableTokens){let Y=(X-this.availableTokens)/this.fillRate*1000;await new Promise((G)=>fA1.setTimeoutFn(G,Y))}this.availableTokens=this.availableTokens-X}refillTokenBucket(){let X=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=X;return}let Y=(X-this.lastTimestamp)*this.fillRate;this.availableTokens=Math.min(this.maxCapacity,this.availableTokens+Y),this.lastTimestamp=X}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,0.3333333333333333))}cubicThrottle(X){return this.getPrecise(X*this.beta)}cubicSuccess(X){return this.getPrecise(this.scaleConstant*Math.pow(X-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(X){this.refillTokenBucket(),this.fillRate=Math.max(X,this.minFillRate),this.maxCapacity=Math.max(X,this.minCapacity),this.availableTokens=Math.min(this.availableTokens,this.maxCapacity)}updateMeasuredRate(){let X=this.getCurrentTimeInSeconds(),Y=Math.floor(X*2)/2;if(this.requestCount++,Y>this.lastTxRateBucket){let G=this.requestCount/(Y-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(G*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=Y}}getPrecise(X){return parseFloat(X.toFixed(8))}}var dn5=100,LN0=20000,cn5=500,DN0=500,in5=5,pn5=10,je4=1,nn5="amz-sdk-invocation-id",tn5="amz-sdk-request";class eQ{static v2026=typeof process<"u"&&process.env?.SMITHY_NEW_RETRIES_2026==="true";static delay(){return eQ.v2026?50:100}static throttlingDelay(){return eQ.v2026?1000:500}static cost(){return eQ.v2026?14:5}static throttlingCost(){return eQ.v2026?5:10}static modifiedCostType(){return eQ.v2026?"THROTTLING":"TRANSIENT"}}class Me4{x=eQ.delay();computeNextBackoffDelay(X){let Y=Math.random(),G=2,Q=Y*Math.min(this.x*2**X,LN0);return Math.floor(Q)}setDelayBase(X){this.x=X}}class wN0{delay;count;cost;longPoll;constructor(X,Y,G,Q){this.delay=X,this.count=Y,this.cost=G,this.longPoll=Q}getRetryCount(){return this.count}getRetryDelay(){return Math.min(LN0,this.delay)}getRetryCost(){return this.cost}isLongPoll(){return this.longPoll}}var vA1={incompatible:1,attempts:2,capacity:3};class RX1{mode=an5.RETRY_MODES.STANDARD;capacity=DN0;retryBackoffStrategy;maxAttemptsProvider;baseDelay;constructor(X){if(typeof X==="number")this.maxAttemptsProvider=async()=>X;else if(typeof X==="function")this.maxAttemptsProvider=X;else if(X&&typeof X==="object")this.maxAttemptsProvider=async()=>X.maxAttempts,this.baseDelay=X.baseDelay,this.retryBackoffStrategy=X.backoff;this.maxAttemptsProvider??=async()=>_A1,this.baseDelay??=eQ.delay(),this.retryBackoffStrategy??=new Me4}async acquireInitialRetryToken(X){return new wN0(eQ.delay(),0,void 0,eQ.v2026&&X.includes(":longpoll"))}async refreshRetryTokenForRetry(X,Y){let G=await this.getMaxAttempts(),Q=this.retryCode(X,Y,G),J=Q===0,W=X.isLongPoll?.();if(J||W){let Z=Y.errorType;this.retryBackoffStrategy.setDelayBase(Z==="THROTTLING"?eQ.throttlingDelay():this.baseDelay);let $=this.retryBackoffStrategy.computeNextBackoffDelay(X.getRetryCount()),K=$;if(Y.retryAfterHint instanceof Date)K=Math.max($,Math.min(Y.retryAfterHint.getTime()-Date.now(),$+5000));if(!J)throw Object.assign(Error("No retry token available"),{$backoff:eQ.v2026&&Q===vA1.capacity&&W?K:0});else{let H=this.getCapacityCost(Z);return this.capacity-=H,new wN0(K,X.getRetryCount()+1,H,X.isLongPoll?.()??!1)}}throw Error("No retry token available")}recordSuccess(X){this.capacity=Math.min(DN0,this.capacity+(X.getRetryCost()??je4))}getCapacity(){return this.capacity}async maxAttempts(){return this.maxAttemptsProvider()}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch(X){return console.warn(`Max attempts provider could not resolve. Using default of ${_A1}`),_A1}}retryCode(X,Y,G){let Q=X.getRetryCount()+1,J=this.isRetryableError(Y.errorType)?0:vA1.incompatible,W=Q<G?0:vA1.attempts,Z=this.capacity>=this.getCapacityCost(Y.errorType)?0:vA1.capacity;return J||W||Z}getCapacityCost(X){return X===eQ.modifiedCostType()?eQ.throttlingCost():eQ.cost()}isRetryableError(X){return X==="THROTTLING"||X==="TRANSIENT"}}class Re4{mode=an5.RETRY_MODES.ADAPTIVE;rateLimiter;standardRetryStrategy;constructor(X,Y){let{rateLimiter:G}=Y??{};this.rateLimiter=G??new fA1,this.standardRetryStrategy=Y?new RX1({maxAttempts:typeof X==="number"?X:3,...Y}):new RX1(X)}async acquireInitialRetryToken(X){return await this.rateLimiter.getSendToken(),this.standardRetryStrategy.acquireInitialRetryToken(X)}async refreshRetryTokenForRetry(X,Y){return this.rateLimiter.updateClientSendingRate(Y),this.standardRetryStrategy.refreshRetryTokenForRetry(X,Y)}recordSuccess(X){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(X)}async maxAttemptsProvider(){return this.standardRetryStrategy.maxAttempts()}}class Se4 extends RX1{computeNextBackoffDelay;constructor(X,Y=eQ.delay()){super(typeof X==="function"?X:async()=>X);if(typeof Y==="number")this.computeNextBackoffDelay=()=>Y;else this.computeNextBackoffDelay=Y}async refreshRetryTokenForRetry(X,Y){let G=await super.refreshRetryTokenForRetry(X,Y);return G.getRetryDelay=()=>this.computeNextBackoffDelay(G.getRetryCount()),G}}an5.AdaptiveRetryStrategy=Re4;an5.ConfiguredRetryStrategy=Se4;an5.DEFAULT_MAX_ATTEMPTS=_A1;an5.DEFAULT_RETRY_DELAY_BASE=dn5;an5.DEFAULT_RETRY_MODE=mn5;an5.DefaultRateLimiter=fA1;an5.INITIAL_RETRY_TOKENS=DN0;an5.INVOCATION_ID_HEADER=nn5;an5.MAXIMUM_RETRY_DELAY=LN0;an5.NO_RETRY_INCREMENT=je4;an5.REQUEST_HEADER=tn5;an5.RETRY_COST=in5;an5.Retry=eQ;an5.StandardRetryStrategy=RX1;an5.THROTTLING_RETRY_DELAY_BASE=cn5;an5.TIMEOUT_RETRY_COST=pn5});var WX=k((Pt5)=>{var Bt5=Dw(),EN0={warningEmitted:!1},Nt5=(X)=>{if(X&&!EN0.warningEmitted&&parseInt(X.substring(1,X.indexOf(".")))<20)EN0.warningEmitted=!0,process.emitWarning(`NodeDeprecationWarning: The AWS SDK for JavaScript (v3) will
|
|
1626
|
+
`);Q=W.pop()??"";for(let Z of W){let $=as4(Z).replace(/^\[\d+\]\s*/,"").trim();if(!$)continue;$z({method:"",path:"",status:0,duration:0,timestamp:new Date,rawLine:$})}}(async()=>{for(;;){let{done:W,value:Z}=await Y.read();if(W)break;Q+=G.decode(Z,{stream:!0}),J()}if(Q.trim()){let W=as4(Q).replace(/^\[\d+\]\s*/,"").trim();if(W)$z({method:"",path:"",status:0,duration:0,timestamp:new Date,rawLine:W})}})()}async function Tp5(X){let{vitePort:Y,baseUrl:G,noTui:Q}=X,J=await VA1(Number(X.port)),{settings:W,services:Z,managedServiceNames:$}=await qA1({port:String(J),home:X.home,baseUrl:X.baseUrl,localMode:X.localMode,skipMigrations:X.skipMigrations,noTui:X.noTui,vitePort:X.vitePort});for(let z of Z)rt({name:z.name,status:"ready",port:z.port});IX1(W),AX1();let K=Ap5(import.meta.dir,"..","..","..","..",".."),H=Q===!0,U=Bun.spawn(["bun","run","--cwd=apps/mesh","dev:servers"],{cwd:K,env:{...process.env,PORT:String(W.port),VITE_PORT:String(Y),DATABASE_URL:W.databaseUrl,NATS_URL:W.natsUrls.join(","),NODE_ENV:W.nodeEnv,DECOCMS_LOCAL_MODE:String(W.localMode),DECOCMS_HOME:W.dataDir,DATA_DIR:W.dataDir,DECO_CLI:"1",...W.baseUrl?{BASE_URL:W.baseUrl}:{}},stdio:["inherit",H?"inherit":"pipe",H?"inherit":"pipe"]});if(!H)rs4(U.stdout),rs4(U.stderr);let B=G||`http://localhost:${W.port}`;TX1(B),rt({name:"Vite",status:"ready",port:Number(Y)});let N=async(z)=>{if(U.kill(z),$.length>0){let{stopServices:O}=await Promise.resolve().then(() => (T$1(),A$1));await O(W.dataDir)}};return process.on("SIGINT",()=>N("SIGINT")),process.on("SIGTERM",()=>N("SIGTERM")),{port:Number(W.port),process:U}}var sB0=D(()=>{iB0();Kz();rB0()});import{Box as eB0,Text as XN0}from"ink";import{jsx as ss4,jsxs as jA1}from"react/jsx-runtime";function os4(X){if(!X)return"not set";try{let Y=new URL(X);if(Y.password)Y.password="***";if(Y.username&&Y.username.length>3)Y.username=Y.username.slice(0,3)+"***";return Y.pathname="/",Y.search="",Y.hash="",Y.toString()}catch{if(X.length<=10)return X;return X.slice(0,6)+"***"+X.slice(-4)}}function jp5(X,Y){if(Ip5.has(X))return Y?{text:"\u25CF\u25CF\u25CF\u25CF\u25CF\u25CF",dimColor:!0}:{text:"not set",dimColor:!0};if(Vp5.has(X)){if(Array.isArray(Y)){if(Y.length===0)return{text:"not set",dimColor:!0};return{text:Y.map((W)=>os4(W)).join(", "),color:"cyan"}}let Q=os4(Y);return Q==="not set"?{text:Q,dimColor:!0}:{text:Q,color:"cyan"}}if(Y===void 0||Y===null||Y==="")return{text:"not set",dimColor:!0};let G=String(Y);if(G==="true")return{text:G,color:"green"};if(G==="false")return{text:G,color:"yellow"};try{return new URL(G),{text:G,color:"cyan"}}catch{return{text:G}}}function Mp5(X){return[{title:"Core",entries:[{key:"NODE_ENV",value:X.nodeEnv},{key:"PORT",value:X.port},{key:"BASE_URL",value:X.baseUrl??`http://localhost:${X.port}`},{key:"DATA_DIR",value:X.dataDir}]},{title:"Database",entries:[{key:"DATABASE_URL",value:X.databaseUrl},{key:"DATABASE_PG_SSL",value:X.databasePgSsl}]},{title:"Auth & Secrets",entries:[{key:"BETTER_AUTH_SECRET",value:X.betterAuthSecret},{key:"ENCRYPTION_KEY",value:X.encryptionKey},{key:"MESH_JWT_SECRET",value:X.meshJwtSecret},{key:"STUDIO_PROVISION_SECRET_KEY",value:X.studioProvisionSecretKey},{key:"DISABLE_RATE_LIMIT",value:X.disableRateLimit}]},{title:"Auth Providers",entries:[{key:"AUTH_EMAIL_PASSWORD_ENABLED",value:process.env.AUTH_EMAIL_PASSWORD_ENABLED??"true"},{key:"AUTH_GOOGLE_CLIENT_ID",value:!!process.env.AUTH_GOOGLE_CLIENT_ID},{key:"AUTH_GITHUB_CLIENT_ID",value:!!process.env.AUTH_GITHUB_CLIENT_ID},{key:"AUTH_RESEND_API_KEY",value:!!process.env.AUTH_RESEND_API_KEY},{key:"AUTH_SENDGRID_API_KEY",value:!!process.env.AUTH_SENDGRID_API_KEY},{key:"AUTH_SSO_MS_CLIENT_ID",value:!!process.env.AUTH_SSO_MS_CLIENT_ID},{key:"AUTH_MAGIC_LINK_ENABLED",value:process.env.AUTH_MAGIC_LINK_ENABLED==="true"},{key:"AUTH_EMAIL_OTP_ENABLED",value:process.env.AUTH_EMAIL_OTP_ENABLED==="true"}]},{title:"Observability",entries:[{key:"CLICKHOUSE_URL",value:X.clickhouseUrl},{key:"OTEL_SERVICE_NAME",value:X.otelServiceName}]},{title:"Event Bus & Networking",entries:[{key:"NATS_URL",value:X.natsUrls}]},{title:"Config Files",entries:[{key:"CONFIG_PATH",value:X.configPath}]},{title:"AI Gateway",entries:[{key:"DECO_AI_GATEWAY_ENABLED",value:X.aiGatewayEnabled},{key:"DECO_AI_GATEWAY_URL",value:X.aiGatewayUrl}]}]}function es4({env:X}){let Y=Mp5(X);return ss4(eB0,{flexDirection:"column",children:Y.map((G)=>jA1(eB0,{flexDirection:"column",marginTop:1,children:[jA1(XN0,{dimColor:!0,children:[" ","\u2500\u2500 ",G.title," ","\u2500".repeat(Math.max(0,38-G.title.length))]}),G.entries.map(({key:Q,value:J})=>{let W=jp5(Q,J);return jA1(eB0,{children:[jA1(XN0,{dimColor:!0,children:[" ",Q.padEnd(36)]}),ss4(XN0,{color:W.color,dimColor:W.dimColor,children:W.text})]},Q)})]},G.title))})}var Ip5,Vp5;var Xe4=D(()=>{Ip5=new Set(["BETTER_AUTH_SECRET","ENCRYPTION_KEY","MESH_JWT_SECRET","STUDIO_PROVISION_SECRET_KEY"]),Vp5=new Set(["DATABASE_URL","CLICKHOUSE_URL","NATS_URL"])});var YN0;var Ye4=D(()=>{YN0={name:"decocms",version:"2.302.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/mesh"},bugs:{url:"https://github.com/decocms/studio/issues"},type:"module",bin:{deco:"./dist/server/cli.js"},files:["dist/**/*"],scripts:{dev:'bun run migrate && concurrently "bun run dev:client" "bun run dev:server"',"dev:servers":'concurrently "bun run dev:client" "bun run dev:server"',"dev:client":"bun --bun vite dev","dev:server":"bun run --cwd=../../packages/sandbox build && NODE_ENV=development bun --env-file=.env --hot run src/index.ts","build:client":"bun --bun vite build","build:server":"bun run scripts/bundle-server-script.ts --dist ./dist/server","db:migrate":"bun run ./dist/server/migrate.js",check:"tsc --noEmit",start:"bun run ./dist/server/server.js",migrate:"bun run src/database/migrate.ts",test:"bun test","test:e2e":"playwright test","test:e2e:ui":"playwright test --ui","better-auth:migrate":"bunx --bun @better-auth/cli migrate -y --config src/auth/index.ts",prepublishOnly:"bun run build:client && bun run build:server"},optionalDependencies:{"@duckdb/node-api":"^1.5.0-r.1","@freestyle-sh/with-bun":"^0.2.12","@freestyle-sh/with-deno":"^0.0.4","@freestyle-sh/with-nodejs":"^0.2.9","freestyle-sandboxes":"^0.1.46"},dependencies:{"@ai-sdk/anthropic":"^3.0.58","@ai-sdk/google":"^3.0.60","@ai-sdk/openai":"^3.0.50","@anthropic-ai/sdk":"^0.79.0","@aws-sdk/client-s3":"^3.1013.0","@aws-sdk/s3-request-presigner":"^3.1013.0","@clickhouse/client":"^1.8.1","@dnd-kit/core":"^6.3.1","@dnd-kit/sortable":"^10.0.0","@dnd-kit/utilities":"^3.2.2","@inkjs/ui":"^2.0.0","@modelcontextprotocol/ext-apps":"^1.2.2","@openrouter/ai-sdk-provider":"^2.2.5","@opentelemetry/core":"^2.6.0","@tanstack/react-virtual":"^3.13.21","@xterm/addon-fit":"^0.11.0","@xterm/xterm":"^6.0.0","ai-sdk-provider-claude-code":"^3.4.4","ai-sdk-provider-codex-cli":"^1.1.0","embedded-postgres":"^18.3.0-beta.16",ink:"^6.8.0",kysely:"^0.28.12",nats:"^2.29.3","node-pty":"^1.0.0","posthog-js":"^1.371.1","posthog-node":"^5.0.0",react:"^19.2.0","react-dom":"^19.2.0"},devDependencies:{"@ai-sdk/provider":"^3.0.8","@ai-sdk/react":"^3.0.118","@anthropic-ai/claude-agent-sdk":"^0.2.80","@better-auth/sso":"1.4.1","@daveyplate/better-auth-ui":"^3.2.7","@deco/ui":"workspace:*","@decocms/better-auth":"1.5.17","@decocms/bindings":"workspace:*","@decocms/mcp-utils":"workspace:*","@decocms/mesh-sdk":"workspace:*","@decocms/runtime":"workspace:*","@decocms/vite-plugin":"workspace:*","@electric-sql/pglite":"^0.3.15","@floating-ui/react":"^0.27.16","@hookform/resolvers":"^5.2.2","@jitl/quickjs-wasmfile-release-sync":"0.31.0","@modelcontextprotocol/sdk":"1.27.1","@monaco-editor/react":"^4.7.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/sdk-logs":"^0.211.0","@opentelemetry/sdk-metrics":"^2.2.0","@opentelemetry/sdk-node":"^0.207.0","@opentelemetry/sdk-trace-base":"^2.5.0","@playwright/test":"^1.58.2","@radix-ui/react-avatar":"^1.1.10","@radix-ui/react-checkbox":"^1.3.3","@radix-ui/react-dialog":"^1.1.15","@radix-ui/react-dropdown-menu":"^2.1.16","@radix-ui/react-label":"^2.1.7","@radix-ui/react-select":"^2.2.6","@radix-ui/react-separator":"^1.1.7","@radix-ui/react-slot":"^1.2.3","@radix-ui/react-tabs":"^1.1.13","@rjsf/core":"^6.1.2","@rjsf/shadcn":"^6.1.2","@rjsf/utils":"^6.1.2","@rjsf/validator-ajv8":"^6.1.2","@tailwindcss/vite":"^4.1.17","@tanstack/react-query":"5.90.11","@tanstack/react-router":"^1.139.7","@tiptap/core":"3.20.2","@tiptap/extension-mention":"3.20.2","@tiptap/extension-placeholder":"3.20.2","@tiptap/pm":"3.20.2","@tiptap/react":"3.20.2","@tiptap/starter-kit":"3.20.2","@tiptap/suggestion":"3.20.2","@types/bun":"^1.3.1","@types/pg":"^8.15.6","@types/react-syntax-highlighter":"^15.5.13","@untitledui/icons":"^0.0.19","@vercel/nft":"^1.1.1","@vitejs/plugin-react":"^5.1.0",ai:"^6.0.116","babel-plugin-react-compiler":"^1.0.0","better-auth":"1.4.5","class-variance-authority":"^0.7.1",clsx:"^2.1.1",concurrently:"^9.2.1",croner:"^9.1.0","date-fns":"^4.1.0",degit:"^2.8.4",hono:"^4.10.7","input-otp":"^1.4.2",jose:"^6.0.11","kysely-pglite":"^0.6.1","lucide-react":"^0.468.0",marked:"^15.0.6","@decocms/sandbox":"workspace:*","mesh-plugin-workflows":"workspace:*",nanoid:"^5.1.6",pg:"^8.16.3",prettier:"^3.4.2","react-hook-form":"^7.66.0","react-markdown":"^10.1.0","react-resizable-panels":"^2.1.7","react-syntax-highlighter":"^15.6.1",recharts:"^3.6.0","rehype-raw":"^7.0.0","remark-gfm":"^4.0.0","sass-embedded":"^1.97.2",sonner:"^2.0.7","tailwind-merge":"^3.3.1",tailwindcss:"^4.1.17",typescript:"^5.9.3",vite:"^7.2.1","vite-tsconfig-paths":"^5.1.4",zod:"^4.0.0",zustand:"^5.0.9"},homepage:"https://github.com/decocms/studio",keywords:["mcp","model-context-protocol","ai","gateway","self-hosted","mesh","tools"],license:"MIT",publishConfig:{access:"public"}}});import{Box as AU,Text as RX}from"ink";import{Spinner as Sp5}from"@inkjs/ui";import{useSyncExternalStore as Ge4}from"react";import{jsx as AY,jsxs as sQ}from"react/jsx-runtime";function fp5(X,Y){if(!X||!_p5.has(X))return X;let G=GN0[Y]??GN0[GN0.length-1];return X==="#875f00"?G[0]:G[1]}function Qe4({status:X}){if(X==="pending")return AY(Sp5,{label:""});return AY(RX,{color:"green",children:"\u2713"})}function Je4({services:X,migrationsStatus:Y,home:G,serverUrl:Q,vibe:J}){let W=Ge4(Vl0,Il0),Z=Ge4(Cl0,kl0);return sQ(AU,{flexDirection:"column",paddingBottom:1,children:[J?sQ(AU,{flexDirection:"column",children:[W.map(($,K)=>{let H=Z[K],U=$.reduce((N,z)=>N+z.text.length,0),B=Math.max(0,vp5-U);return sQ(AU,{flexDirection:"row",children:[$.map((N,z)=>{let O=fp5(N.color,K);return O?AY(RX,{color:O,children:N.text},z):AY(RX,{children:N.text},z)}),AY(RX,{children:" ".repeat(B+2)}),H?.map((N,z)=>N.color?AY(RX,{color:N.color,children:N.char},z):AY(RX,{children:N.char},z))]},K)}),sQ(RX,{dimColor:!0,children:[" v",YN0.version]})]}):sQ(AU,{flexDirection:"column",marginTop:1,children:[kp5.map(($,K)=>AY(RX,{color:Cp5[K],children:$},K)),sQ(RX,{dimColor:!0,children:[" v",YN0.version]})]}),AY(AU,{marginBottom:1,children:AY(RX,{dimColor:!0,children:"\u2500".repeat(80)})}),AY(AU,{children:sQ(RX,{dimColor:!0,children:["Home: ",G]})}),sQ(AU,{gap:2,children:[X.map(($)=>sQ(AU,{gap:1,children:[sQ(RX,{children:[$.name," :",$.port||"...."]}),AY(Qe4,{status:$.status})]},$.name)),sQ(AU,{gap:1,children:[AY(RX,{children:"Migrations"}),AY(Qe4,{status:Y})]})]}),AY(AU,{children:Q?sQ(RX,{children:["Open in browser: ",AY(RX,{color:"cyan",children:Q})]}):AY(RX,{dimColor:!0,children:"Starting..."})}),sQ(AU,{gap:2,children:[sQ(RX,{dimColor:!0,children:[AY(RX,{bold:!0,dimColor:!0,children:"K"})," ","toggle config"]}),sQ(RX,{dimColor:!0,children:[AY(RX,{bold:!0,dimColor:!0,children:"L"})," ","toggle log flow"]}),sQ(RX,{dimColor:!0,children:[AY(RX,{bold:!0,dimColor:!0,children:"V"})," ","toggle vibe ",J?"\u266A Nihilore \xB7 CC BY 4.0":""]}),J&&sQ(RX,{dimColor:!0,children:[AY(RX,{bold:!0,dimColor:!0,children:"N"})," ","skip song"]})]})]})}var kp5,Cp5,GN0,vp5=30,_p5;var Ze4=D(()=>{Ye4();mn1();tn1();kp5=[" \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588 ","\u2591\u2591\u2588\u2588\u2588\u2591\u2591\u2591\u2591\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588\u2591\u2591\u2591\u2591\u2591\u2588 \u2588\u2588\u2588\u2591\u2591\u2591\u2591\u2591\u2588\u2588\u2588 \u2588\u2588\u2588\u2591\u2591\u2591\u2591\u2591\u2588\u2588\u2588 "," \u2591\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2588 \u2591 \u2588\u2588\u2588 \u2591\u2591\u2591 \u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588"," \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588"," \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588\u2591\u2591\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591\u2588\u2588\u2588"," \u2591\u2588\u2588\u2588 \u2588\u2588\u2588 \u2591\u2588\u2588\u2588 \u2591 \u2588\u2591\u2591\u2588\u2588\u2588 \u2588\u2588\u2588\u2591\u2591\u2588\u2588\u2588 \u2588\u2588\u2588 "," \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2591\u2591\u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2591 ","\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591\u2591\u2591 "],Cp5=["#00ff64","#00ee5e","#00dc56","#00c84e","#00b444","#00a03c","#008832","#006e28"],GN0=[["#00ff64","#00cc50"],["#00f060","#00c04c"],["#00e05c","#00b448"],["#00d058","#00a844"],["#00c054","#009c40"],["#00b050","#00903c"],["#00a04c","#008438"],["#009048","#007834"],["#008044","#006c30"],["#007040","#00602c"],["#00603c","#005428"]],_p5=new Set(["#875f00","#5f3800"])});import{useSyncExternalStore as bp5}from"react";function yp5(){let X=process.stdout.rows||24,Y=process.stdout.columns||80;if(X!==MA1.rows||Y!==MA1.columns)MA1={rows:X,columns:Y};return MA1}function xp5(X){return process.stdout.on("resize",X),()=>{process.stdout.off("resize",X)}}function We4(){return bp5(xp5,yp5)}var MA1;var $e4=D(()=>{MA1={rows:process.stdout.rows||24,columns:process.stdout.columns||80}});import{Box as hp5,Text as VX1}from"ink";import{useSyncExternalStore as gp5}from"react";import{jsx as QN0,jsxs as JN0}from"react/jsx-runtime";function up5(X){if(X>=500)return"red";if(X>=400)return"yellow";if(X>=300)return"cyan";return"green"}function Ke4({logs:X,headerHeight:Y}){let{rows:G}=We4(),{logFlow:Q}=gp5(qX1,PX1),J=Math.max(1,G-Y-1),W=Q?X:X.slice(-J);return QN0(hp5,{flexDirection:"column",children:W.map((Z,$)=>{if(Z.rawLine)return QN0(VX1,{dimColor:!0,children:Z.rawLine},$);let K=Z.duration<1000?`${Z.duration}ms`:`${(Z.duration/1000).toFixed(1)}s`;return JN0(VX1,{children:[JN0(VX1,{dimColor:!0,children:[Z.method.padEnd(6)," ",Z.path.padEnd(30)," "]}),QN0(VX1,{color:up5(Z.status),children:Z.status}),JN0(VX1,{dimColor:!0,children:[" ",K.padStart(8)]})]},$)})})}var He4=D(()=>{Kz();$e4()});var ZN0={};j0(ZN0,{App:()=>np5});import{Box as lp5,Text as mp5,useInput as dp5}from"ink";import{useSyncExternalStore as cp5}from"react";import{jsx as RA1,jsxs as tp5}from"react/jsx-runtime";function np5({home:X}){let Y=cp5(qX1,PX1);return dp5((G)=>{if(G==="k"||G==="K")nB0();if(G==="l"||G==="L")tB0();if((G==="v"||G==="V")&&Y.dataDir)sn1(Y.dataDir),aB0();if((G==="n"||G==="N")&&Y.vibe)on1()}),tp5(lp5,{flexDirection:"column",children:[RA1(Je4,{services:Y.services,migrationsStatus:Y.migrationsStatus,home:X,serverUrl:Y.serverUrl,vibe:Y.vibe}),Y.viewMode==="config"?Y.env?RA1(es4,{env:Y.env}):RA1(mp5,{dimColor:!0,children:"Loading configuration..."}):RA1(Ke4,{logs:Y.logs,headerHeight:Y.vibe?pp5:ip5})]})}var ip5=15,pp5=19;var WN0=D(()=>{Xe4();Ze4();He4();Kz();Sd()});function Fe4(X,Y={}){return{PORT:String(X.port),NODE_ENV:X.nodeEnv,BASE_URL:X.baseUrl,DATA_DIR:X.dataDir,DECOCMS_HOME:X.dataDir,DATABASE_URL:X.databaseUrl,DATABASE_PG_SSL:String(X.databasePgSsl),DATABASE_POOL_MAX:String(X.databasePoolMax),NATS_URL:X.natsUrls.join(","),BETTER_AUTH_SECRET:X.betterAuthSecret,ENCRYPTION_KEY:X.encryptionKey,MESH_JWT_SECRET:X.meshJwtSecret,DECOCMS_LOCAL_MODE:String(X.localMode),DISABLE_RATE_LIMIT:String(X.disableRateLimit),STUDIO_PROVISION_SECRET_KEY:X.studioProvisionSecretKey,CONFIG_PATH:X.configPath,...Object.fromEntries(Object.entries(process.env).filter(([G])=>G.startsWith("AUTH_"))),DECO_AI_GATEWAY_ENABLED:String(X.aiGatewayEnabled),DECO_AI_GATEWAY_URL:X.aiGatewayUrl,ENABLE_DECO_IMPORT:String(X.enableDecoImport),S3_ENDPOINT:X.s3Endpoint,S3_BUCKET:X.s3Bucket,S3_REGION:X.s3Region,S3_ACCESS_KEY_ID:X.s3AccessKeyId,S3_SECRET_ACCESS_KEY:X.s3SecretAccessKey,S3_FORCE_PATH_STYLE:String(X.s3ForcePathStyle),OTEL_SERVICE_NAME:X.otelServiceName,CLICKHOUSE_URL:X.clickhouseUrl,DECO_SUPABASE_URL:X.decoSupabaseUrl,DECO_SUPABASE_SERVICE_KEY:X.decoSupabaseServiceKey,FIRECRAWL_API_KEY:X.firecrawlApiKey,STUDIO_SANDBOX_RUNNER:process.env.STUDIO_SANDBOX_RUNNER,STUDIO_SANDBOX_TEMPLATE_NAME:process.env.STUDIO_SANDBOX_TEMPLATE_NAME,STUDIO_ENV:process.env.STUDIO_ENV,STUDIO_SANDBOX_PREVIEW_URL_PATTERN:process.env.STUDIO_SANDBOX_PREVIEW_URL_PATTERN,STUDIO_SANDBOX_PREVIEW_GATEWAY_NAME:process.env.STUDIO_SANDBOX_PREVIEW_GATEWAY_NAME,STUDIO_SANDBOX_PREVIEW_GATEWAY_NAMESPACE:process.env.STUDIO_SANDBOX_PREVIEW_GATEWAY_NAMESPACE,STUDIO_SANDBOX_SENTINEL_TOKEN:process.env.STUDIO_SANDBOX_SENTINEL_TOKEN,KUBERNETES_SERVICE_HOST:process.env.KUBERNETES_SERVICE_HOST,KUBERNETES_SERVICE_PORT:process.env.KUBERNETES_SERVICE_PORT,FREESTYLE_API_KEY:process.env.FREESTYLE_API_KEY,BROWSERLESS_TOKEN:process.env.BROWSERLESS_TOKEN,NODE_EXTRA_CA_CERTS:process.env.NODE_EXTRA_CA_CERTS,DECO_CLI:"1",DECO_NO_TUI:"true",...Y}}var vj=k((Xn5)=>{Xn5.HttpAuthLocation=void 0;(function(X){X.HEADER="header",X.QUERY="query"})(Xn5.HttpAuthLocation||(Xn5.HttpAuthLocation={}));Xn5.HttpApiKeyAuthLocation=void 0;(function(X){X.HEADER="header",X.QUERY="query"})(Xn5.HttpApiKeyAuthLocation||(Xn5.HttpApiKeyAuthLocation={}));Xn5.EndpointURLScheme=void 0;(function(X){X.HTTP="http",X.HTTPS="https"})(Xn5.EndpointURLScheme||(Xn5.EndpointURLScheme={}));Xn5.AlgorithmId=void 0;(function(X){X.MD5="md5",X.CRC32="crc32",X.CRC32C="crc32c",X.SHA1="sha1",X.SHA256="sha256"})(Xn5.AlgorithmId||(Xn5.AlgorithmId={}));var ap5=(X)=>{let Y=[];if(X.sha256!==void 0)Y.push({algorithmId:()=>Xn5.AlgorithmId.SHA256,checksumConstructor:()=>X.sha256});if(X.md5!=null)Y.push({algorithmId:()=>Xn5.AlgorithmId.MD5,checksumConstructor:()=>X.md5});return{addChecksumAlgorithm(G){Y.push(G)},checksumAlgorithms(){return Y}}},rp5=(X)=>{let Y={};return X.checksumAlgorithms().forEach((G)=>{Y[G.algorithmId()]=G.checksumConstructor()}),Y},op5=(X)=>{return ap5(X)},sp5=(X)=>{return rp5(X)};Xn5.FieldPosition=void 0;(function(X){X[X.HEADER=0]="HEADER",X[X.TRAILER=1]="TRAILER"})(Xn5.FieldPosition||(Xn5.FieldPosition={}));var ep5="__smithy_context";Xn5.IniSectionType=void 0;(function(X){X.PROFILE="profile",X.SSO_SESSION="sso-session",X.SERVICES="services"})(Xn5.IniSectionType||(Xn5.IniSectionType={}));Xn5.RequestHandlerProtocol=void 0;(function(X){X.HTTP_0_9="http/0.9",X.HTTP_1_0="http/1.0",X.TDS_8_0="tds/8.0"})(Xn5.RequestHandlerProtocol||(Xn5.RequestHandlerProtocol={}));Xn5.SMITHY_CONTEXT_KEY=ep5;Xn5.getDefaultClientConfiguration=op5;Xn5.resolveDefaultRuntimeConfig=sp5});var u7=k((Hn5)=>{var Jn5=vj(),Zn5=(X)=>{return{setHttpHandler(Y){X.httpHandler=Y},httpHandler(){return X.httpHandler},updateHttpClientConfig(Y,G){X.httpHandler?.updateHttpClientConfig(Y,G)},httpHandlerConfigs(){return X.httpHandler.httpHandlerConfigs()}}},Wn5=(X)=>{return{httpHandler:X.httpHandler()}};class Ue4{name;kind;values;constructor({name:X,kind:Y=Jn5.FieldPosition.HEADER,values:G=[]}){this.name=X,this.kind=Y,this.values=G}add(X){this.values.push(X)}set(X){this.values=X}remove(X){this.values=this.values.filter((Y)=>Y!==X)}toString(){return this.values.map((X)=>X.includes(",")||X.includes(" ")?`"${X}"`:X).join(", ")}get(){return this.values}}class Be4{entries={};encoding;constructor({fields:X=[],encoding:Y="utf-8"}){X.forEach(this.setField.bind(this)),this.encoding=Y}setField(X){this.entries[X.name.toLowerCase()]=X}getField(X){return this.entries[X.toLowerCase()]}removeField(X){delete this.entries[X.toLowerCase()]}getByType(X){return Object.values(this.entries).filter((Y)=>Y.kind===X)}}class SA1{method;protocol;hostname;port;path;query;headers;username;password;fragment;body;constructor(X){this.method=X.method||"GET",this.hostname=X.hostname||"localhost",this.port=X.port,this.query=X.query||{},this.headers=X.headers||{},this.body=X.body,this.protocol=X.protocol?X.protocol.slice(-1)!==":"?`${X.protocol}:`:X.protocol:"https:",this.path=X.path?X.path.charAt(0)!=="/"?`/${X.path}`:X.path:"/",this.username=X.username,this.password=X.password,this.fragment=X.fragment}static clone(X){let Y=new SA1({...X,headers:{...X.headers}});if(Y.query)Y.query=$n5(Y.query);return Y}static isInstance(X){if(!X)return!1;let Y=X;return"method"in Y&&"protocol"in Y&&"hostname"in Y&&"path"in Y&&typeof Y.query==="object"&&typeof Y.headers==="object"}clone(){return SA1.clone(this)}}function $n5(X){return Object.keys(X).reduce((Y,G)=>{let Q=X[G];return{...Y,[G]:Array.isArray(Q)?[...Q]:Q}},{})}class Ne4{statusCode;reason;headers;body;constructor(X){this.statusCode=X.statusCode,this.reason=X.reason,this.headers=X.headers||{},this.body=X.body}static isInstance(X){if(!X)return!1;let Y=X;return typeof Y.statusCode==="number"&&typeof Y.headers==="object"}}function Kn5(X){return/^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/.test(X)}Hn5.Field=Ue4;Hn5.Fields=Be4;Hn5.HttpRequest=SA1;Hn5.HttpResponse=Ne4;Hn5.getHttpHandlerExtensionConfiguration=Zn5;Hn5.isValidHostname=Kn5;Hn5.resolveHttpHandlerRuntimeConfig=Wn5});function wn5(X){return(Y)=>async(G)=>{let{request:Q}=G;if(X.expectContinueHeader!==!1&&ze4.HttpRequest.isInstance(Q)&&Q.body&&X.runtime==="node"&&X.requestHandler?.constructor?.name!=="FetchHttpHandler"){let J=!0;if(typeof X.expectContinueHeader==="number")try{J=(Number(Q.headers?.["content-length"])??X.bodyLengthChecker?.(Q.body)??1/0)>=X.expectContinueHeader}catch(W){}else J=!!X.expectContinueHeader;if(J)Q.headers.Expect="100-continue"}return Y({...G,request:Q})}}var ze4,Ln5,Oe4=(X)=>({applyToStack:(Y)=>{Y.add(wn5(X),Ln5)}});var De4=D(()=>{ze4=Y1(u7(),1);Ln5={step:"build",tags:["SET_EXPECT_HEADER","EXPECT_HEADER"],name:"addExpectContinueMiddleware",override:!0}});var wH,kA1,_j,CA1,E9,we4,MX1;var LH=D(()=>{wH={WHEN_SUPPORTED:"WHEN_SUPPORTED",WHEN_REQUIRED:"WHEN_REQUIRED"},kA1=wH.WHEN_SUPPORTED,_j={WHEN_SUPPORTED:"WHEN_SUPPORTED",WHEN_REQUIRED:"WHEN_REQUIRED"},CA1=wH.WHEN_SUPPORTED;(function(X){X.MD5="MD5",X.CRC32="CRC32",X.CRC32C="CRC32C",X.CRC64NVME="CRC64NVME",X.SHA1="SHA1",X.SHA256="SHA256"})(E9||(E9={}));(function(X){X.HEADER="header",X.TRAILER="trailer"})(we4||(we4={}));MX1=E9.CRC32});var Rq,ot=(X,Y,G,Q)=>{if(!(Y in X))return;let J=X[Y].toUpperCase();if(!Object.values(G).includes(J))throw TypeError(`Cannot load ${Q} '${Y}'. Expected one of ${Object.values(G)}, got '${X[Y]}'.`);return J};var NN0=D(()=>{(function(X){X.ENV="env",X.CONFIG="shared config entry"})(Rq||(Rq={}))});var En5="AWS_REQUEST_CHECKSUM_CALCULATION",Pn5="request_checksum_calculation",Le4;var Ee4=D(()=>{LH();NN0();Le4={environmentVariableSelector:(X)=>ot(X,En5,wH,Rq.ENV),configFileSelector:(X)=>ot(X,Pn5,wH,Rq.CONFIG),default:kA1}});var qn5="AWS_RESPONSE_CHECKSUM_VALIDATION",An5="response_checksum_validation",Pe4;var qe4=D(()=>{LH();NN0();Pe4={environmentVariableSelector:(X)=>ot(X,qn5,_j,Rq.ENV),configFileSelector:(X)=>ot(X,An5,_j,Rq.CONFIG),default:CA1}});var ON0=k((vn5)=>{var Tn5=["AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch"],In5=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],Vn5=["TimeoutError","RequestTimeout","RequestTimeoutException"],jn5=[500,502,503,504],Mn5=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],Rn5=["EHOSTUNREACH","ENETUNREACH","ENOTFOUND"],Ae4=(X)=>X?.$retryable!==void 0,Sn5=(X)=>Tn5.includes(X.name),Te4=(X)=>X.$metadata?.clockSkewCorrected,Ie4=(X)=>{let Y=new Set(["Failed to fetch","NetworkError when attempting to fetch resource","The Internet connection appears to be offline","Load failed","Network request failed"]);if(!(X&&X instanceof TypeError))return!1;return Y.has(X.message)},kn5=(X)=>X.$metadata?.httpStatusCode===429||In5.includes(X.name)||X.$retryable?.throttling==!0,zN0=(X,Y=0)=>Ae4(X)||Te4(X)||X.name==="InvalidSignatureException"&&X.message?.includes("Signature expired")||Vn5.includes(X.name)||Mn5.includes(X?.code||"")||Rn5.includes(X?.code||"")||jn5.includes(X.$metadata?.httpStatusCode||0)||Ie4(X)||Ve4(X)||X.cause!==void 0&&Y<=10&&zN0(X.cause,Y+1),Cn5=(X)=>{if(X.$metadata?.httpStatusCode!==void 0){let Y=X.$metadata.httpStatusCode;if(500<=Y&&Y<=599&&!zN0(X))return!0;return!1}return!1};function Ve4(X){return X.code==="ERR_HTTP2_STREAM_ERROR"&&X.message.includes("NGHTTP2_REFUSED_STREAM")}vn5.isBrowserNetworkError=Ie4;vn5.isClockSkewCorrectedError=Te4;vn5.isClockSkewError=Sn5;vn5.isNodeJsHttp2TransientError=Ve4;vn5.isRetryableByTrait=Ae4;vn5.isServerError=Cn5;vn5.isThrottlingError=kn5;vn5.isTransientError=zN0});var Dw=k((an5)=>{var ln5=ON0();an5.RETRY_MODES=void 0;(function(X){X.STANDARD="standard",X.ADAPTIVE="adaptive"})(an5.RETRY_MODES||(an5.RETRY_MODES={}));var _A1=3,mn5=an5.RETRY_MODES.STANDARD;class fA1{static setTimeoutFn=setTimeout;beta;minCapacity;minFillRate;scaleConstant;smooth;enabled=!1;availableTokens=0;lastMaxRate=0;measuredTxRate=0;requestCount=0;fillRate;lastThrottleTime;lastTimestamp=0;lastTxRateBucket;maxCapacity;timeWindow=0;constructor(X){this.beta=X?.beta??0.7,this.minCapacity=X?.minCapacity??1,this.minFillRate=X?.minFillRate??0.5,this.scaleConstant=X?.scaleConstant??0.4,this.smooth=X?.smooth??0.8,this.lastThrottleTime=this.getCurrentTimeInSeconds(),this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}async getSendToken(){return this.acquireTokenBucket(1)}updateClientSendingRate(X){let Y;this.updateMeasuredRate();let G=X;if(G?.errorType==="THROTTLING"||ln5.isThrottlingError(G?.error??X)){let W=!this.enabled?this.measuredTxRate:Math.min(this.measuredTxRate,this.fillRate);this.lastMaxRate=W,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),Y=this.cubicThrottle(W),this.enableTokenBucket()}else this.calculateTimeWindow(),Y=this.cubicSuccess(this.getCurrentTimeInSeconds());let J=Math.min(Y,2*this.measuredTxRate);this.updateTokenBucketRate(J)}getCurrentTimeInSeconds(){return Date.now()/1000}async acquireTokenBucket(X){if(!this.enabled)return;if(this.refillTokenBucket(),X>this.availableTokens){let Y=(X-this.availableTokens)/this.fillRate*1000;await new Promise((G)=>fA1.setTimeoutFn(G,Y))}this.availableTokens=this.availableTokens-X}refillTokenBucket(){let X=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=X;return}let Y=(X-this.lastTimestamp)*this.fillRate;this.availableTokens=Math.min(this.maxCapacity,this.availableTokens+Y),this.lastTimestamp=X}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,0.3333333333333333))}cubicThrottle(X){return this.getPrecise(X*this.beta)}cubicSuccess(X){return this.getPrecise(this.scaleConstant*Math.pow(X-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(X){this.refillTokenBucket(),this.fillRate=Math.max(X,this.minFillRate),this.maxCapacity=Math.max(X,this.minCapacity),this.availableTokens=Math.min(this.availableTokens,this.maxCapacity)}updateMeasuredRate(){let X=this.getCurrentTimeInSeconds(),Y=Math.floor(X*2)/2;if(this.requestCount++,Y>this.lastTxRateBucket){let G=this.requestCount/(Y-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(G*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=Y}}getPrecise(X){return parseFloat(X.toFixed(8))}}var dn5=100,LN0=20000,cn5=500,DN0=500,in5=5,pn5=10,je4=1,nn5="amz-sdk-invocation-id",tn5="amz-sdk-request";class eQ{static v2026=typeof process<"u"&&process.env?.SMITHY_NEW_RETRIES_2026==="true";static delay(){return eQ.v2026?50:100}static throttlingDelay(){return eQ.v2026?1000:500}static cost(){return eQ.v2026?14:5}static throttlingCost(){return eQ.v2026?5:10}static modifiedCostType(){return eQ.v2026?"THROTTLING":"TRANSIENT"}}class Me4{x=eQ.delay();computeNextBackoffDelay(X){let Y=Math.random(),G=2,Q=Y*Math.min(this.x*2**X,LN0);return Math.floor(Q)}setDelayBase(X){this.x=X}}class wN0{delay;count;cost;longPoll;constructor(X,Y,G,Q){this.delay=X,this.count=Y,this.cost=G,this.longPoll=Q}getRetryCount(){return this.count}getRetryDelay(){return Math.min(LN0,this.delay)}getRetryCost(){return this.cost}isLongPoll(){return this.longPoll}}var vA1={incompatible:1,attempts:2,capacity:3};class RX1{mode=an5.RETRY_MODES.STANDARD;capacity=DN0;retryBackoffStrategy;maxAttemptsProvider;baseDelay;constructor(X){if(typeof X==="number")this.maxAttemptsProvider=async()=>X;else if(typeof X==="function")this.maxAttemptsProvider=X;else if(X&&typeof X==="object")this.maxAttemptsProvider=async()=>X.maxAttempts,this.baseDelay=X.baseDelay,this.retryBackoffStrategy=X.backoff;this.maxAttemptsProvider??=async()=>_A1,this.baseDelay??=eQ.delay(),this.retryBackoffStrategy??=new Me4}async acquireInitialRetryToken(X){return new wN0(eQ.delay(),0,void 0,eQ.v2026&&X.includes(":longpoll"))}async refreshRetryTokenForRetry(X,Y){let G=await this.getMaxAttempts(),Q=this.retryCode(X,Y,G),J=Q===0,W=X.isLongPoll?.();if(J||W){let Z=Y.errorType;this.retryBackoffStrategy.setDelayBase(Z==="THROTTLING"?eQ.throttlingDelay():this.baseDelay);let $=this.retryBackoffStrategy.computeNextBackoffDelay(X.getRetryCount()),K=$;if(Y.retryAfterHint instanceof Date)K=Math.max($,Math.min(Y.retryAfterHint.getTime()-Date.now(),$+5000));if(!J)throw Object.assign(Error("No retry token available"),{$backoff:eQ.v2026&&Q===vA1.capacity&&W?K:0});else{let H=this.getCapacityCost(Z);return this.capacity-=H,new wN0(K,X.getRetryCount()+1,H,X.isLongPoll?.()??!1)}}throw Error("No retry token available")}recordSuccess(X){this.capacity=Math.min(DN0,this.capacity+(X.getRetryCost()??je4))}getCapacity(){return this.capacity}async maxAttempts(){return this.maxAttemptsProvider()}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch(X){return console.warn(`Max attempts provider could not resolve. Using default of ${_A1}`),_A1}}retryCode(X,Y,G){let Q=X.getRetryCount()+1,J=this.isRetryableError(Y.errorType)?0:vA1.incompatible,W=Q<G?0:vA1.attempts,Z=this.capacity>=this.getCapacityCost(Y.errorType)?0:vA1.capacity;return J||W||Z}getCapacityCost(X){return X===eQ.modifiedCostType()?eQ.throttlingCost():eQ.cost()}isRetryableError(X){return X==="THROTTLING"||X==="TRANSIENT"}}class Re4{mode=an5.RETRY_MODES.ADAPTIVE;rateLimiter;standardRetryStrategy;constructor(X,Y){let{rateLimiter:G}=Y??{};this.rateLimiter=G??new fA1,this.standardRetryStrategy=Y?new RX1({maxAttempts:typeof X==="number"?X:3,...Y}):new RX1(X)}async acquireInitialRetryToken(X){return await this.rateLimiter.getSendToken(),this.standardRetryStrategy.acquireInitialRetryToken(X)}async refreshRetryTokenForRetry(X,Y){return this.rateLimiter.updateClientSendingRate(Y),this.standardRetryStrategy.refreshRetryTokenForRetry(X,Y)}recordSuccess(X){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(X)}async maxAttemptsProvider(){return this.standardRetryStrategy.maxAttempts()}}class Se4 extends RX1{computeNextBackoffDelay;constructor(X,Y=eQ.delay()){super(typeof X==="function"?X:async()=>X);if(typeof Y==="number")this.computeNextBackoffDelay=()=>Y;else this.computeNextBackoffDelay=Y}async refreshRetryTokenForRetry(X,Y){let G=await super.refreshRetryTokenForRetry(X,Y);return G.getRetryDelay=()=>this.computeNextBackoffDelay(G.getRetryCount()),G}}an5.AdaptiveRetryStrategy=Re4;an5.ConfiguredRetryStrategy=Se4;an5.DEFAULT_MAX_ATTEMPTS=_A1;an5.DEFAULT_RETRY_DELAY_BASE=dn5;an5.DEFAULT_RETRY_MODE=mn5;an5.DefaultRateLimiter=fA1;an5.INITIAL_RETRY_TOKENS=DN0;an5.INVOCATION_ID_HEADER=nn5;an5.MAXIMUM_RETRY_DELAY=LN0;an5.NO_RETRY_INCREMENT=je4;an5.REQUEST_HEADER=tn5;an5.RETRY_COST=in5;an5.Retry=eQ;an5.StandardRetryStrategy=RX1;an5.THROTTLING_RETRY_DELAY_BASE=cn5;an5.TIMEOUT_RETRY_COST=pn5});var WX=k((Pt5)=>{var Bt5=Dw(),EN0={warningEmitted:!1},Nt5=(X)=>{if(X&&!EN0.warningEmitted&&parseInt(X.substring(1,X.indexOf(".")))<20)EN0.warningEmitted=!0,process.emitWarning(`NodeDeprecationWarning: The AWS SDK for JavaScript (v3) will
|
|
1627
1627
|
no longer support Node.js ${X} in January 2026.
|
|
1628
1628
|
|
|
1629
1629
|
To continue receiving updates to AWS services, bug fixes, and security
|
|
@@ -3362,8 +3362,8 @@ ${N}`)},K=(U)=>{W=Buffer.concat([W,U]);let B=W.indexOf(Q47);if(B===-1){if(W.leng
|
|
|
3362
3362
|
`)});async function b_0(X={}){let Y=globalThis;if(Y[zn6])return;Y[zn6]=!0;try{let Q=await new ZB(X).sweepOrphans();if(Q>0)console.log(`[sandbox] Boot sweep: stopped ${Q} stale container(s).`)}catch(G){console.warn("[sandbox] Boot sweep failed (continuing without it):",G instanceof Error?G.message:G)}}async function y_0(X){if(!X)return;console.log("[shutdown] Sweeping docker sandbox containers...");try{let Y=await X.sweepOrphans();if(Y>0)console.log(`[shutdown] Swept ${Y} sandbox container(s).`)}catch(Y){console.error("[shutdown] Sandbox sweep error:",Y)}}var zn6;var On6=D(()=>{__0();zn6=Symbol.for("mesh.sandbox.bootSweepDone")});var T31=D(()=>{__0();Nn6();On6()});var Tk1=`// @bun
|
|
3363
3363
|
// daemon/entry.ts
|
|
3364
3364
|
import { randomUUID } from "crypto";
|
|
3365
|
-
import { existsSync as existsSync4, mkdirSync as
|
|
3366
|
-
import { join as
|
|
3365
|
+
import { existsSync as existsSync4, mkdirSync as mkdirSync4, unlinkSync as unlinkSync4 } from "fs";
|
|
3366
|
+
import { join as join5 } from "path";
|
|
3367
3367
|
|
|
3368
3368
|
// shared.ts
|
|
3369
3369
|
var IFRAME_BOOTSTRAP_SCRIPT = \`<script>(function(){try{var W=window.WebSocket;if(W){var m=location.pathname.match(/^(\\\\/api\\\\/sandbox\\\\/[^\\\\/]+(?:\\\\/thread\\\\/[^\\\\/]+)?\\\\/preview(?:\\\\/\\\\d+)?)/);var p=m?m[1]:"";function r(u){try{var x=new URL(String(u),location.href);var lb=x.hostname==="localhost"||x.hostname==="127.0.0.1"||x.hostname==="0.0.0.0";var pm=x.hostname===location.hostname&&x.port!==location.port&&x.port!=="";if(!lb&&!pm)return String(u);x.protocol=location.protocol==="https:"?"wss:":"ws:";x.host=location.host;if(p&&!x.pathname.startsWith(p))x.pathname=p+x.pathname;return x.toString();}catch(_){return String(u);}}class P extends W{constructor(u,pr){super(r(u),pr);}}window.WebSocket=P;}}catch(_){}window.addEventListener("message",function(e){if(e.data&&e.data.type==="visual-editor::activate"&&e.data.script){try{new Function(e.data.script)();}catch(err){console.error("[visual-editor] injection failed",err);}}});})();</script>\`;
|
|
@@ -4200,7 +4200,7 @@ class TenantConfigStore {
|
|
|
4200
4200
|
break;
|
|
4201
4201
|
try {
|
|
4202
4202
|
entry.resolve(await this.runOne(entry.patch));
|
|
4203
|
-
} catch
|
|
4203
|
+
} catch {
|
|
4204
4204
|
entry.resolve({
|
|
4205
4205
|
kind: "rejected",
|
|
4206
4206
|
reason: REJECTION_REASONS.APPLY_FAILED
|
|
@@ -4236,7 +4236,7 @@ class TenantConfigStore {
|
|
|
4236
4236
|
}
|
|
4237
4237
|
try {
|
|
4238
4238
|
writeConfig(merged, this.deps.storageDir);
|
|
4239
|
-
} catch
|
|
4239
|
+
} catch {
|
|
4240
4240
|
return {
|
|
4241
4241
|
kind: "rejected",
|
|
4242
4242
|
reason: REJECTION_REASONS.PERSISTENCE_FAILED
|
|
@@ -6308,7 +6308,7 @@ function makeScriptsHandler(getScripts) {
|
|
|
6308
6308
|
|
|
6309
6309
|
// daemon/setup/orchestrator.ts
|
|
6310
6310
|
import { existsSync as existsSync3, unlinkSync as unlinkSync3 } from "fs";
|
|
6311
|
-
import { join as
|
|
6311
|
+
import { join as join4 } from "path";
|
|
6312
6312
|
|
|
6313
6313
|
// daemon/setup/spawn-step.ts
|
|
6314
6314
|
function spawnSetupStep(cmd, onChunk, dropPrivileges) {
|
|
@@ -6389,6 +6389,29 @@ $ \${pmConfig.install}\\r
|
|
|
6389
6389
|
return spawnSetupStep(cmd, deps.onChunk, deps.dropPrivileges);
|
|
6390
6390
|
}
|
|
6391
6391
|
|
|
6392
|
+
// daemon/git/protect-branch.ts
|
|
6393
|
+
import { chmodSync, mkdirSync as mkdirSync3, writeFileSync } from "fs";
|
|
6394
|
+
import { join as join3 } from "path";
|
|
6395
|
+
var HOOK = \`#!/bin/sh
|
|
6396
|
+
while IFS=' ' read -r _local_ref _local_sha remote_ref _remote_sha; do
|
|
6397
|
+
branch="\\\${remote_ref#refs/heads/}"
|
|
6398
|
+
case "$branch" in
|
|
6399
|
+
main|master)
|
|
6400
|
+
echo "error: pushing to '$branch' is not allowed from a sandbox" >&2
|
|
6401
|
+
exit 1
|
|
6402
|
+
;;
|
|
6403
|
+
esac
|
|
6404
|
+
done
|
|
6405
|
+
exit 0
|
|
6406
|
+
\`;
|
|
6407
|
+
function installProtectedBranchHook(repoDir) {
|
|
6408
|
+
const hooksDir = join3(repoDir, ".git", "hooks");
|
|
6409
|
+
mkdirSync3(hooksDir, { recursive: true });
|
|
6410
|
+
const hookPath = join3(hooksDir, "pre-push");
|
|
6411
|
+
writeFileSync(hookPath, HOOK, { encoding: "utf-8" });
|
|
6412
|
+
chmodSync(hookPath, 493);
|
|
6413
|
+
}
|
|
6414
|
+
|
|
6392
6415
|
// daemon/setup/resume.ts
|
|
6393
6416
|
function isResume(repoDir) {
|
|
6394
6417
|
return hasGitRepo(repoDir);
|
|
@@ -6645,7 +6668,7 @@ class SetupOrchestrator {
|
|
|
6645
6668
|
const cwd = resolvePmRoot(config.repoDir, config.application?.packageManager?.path);
|
|
6646
6669
|
const scripts = discoverScripts(cwd, pm);
|
|
6647
6670
|
if (scripts.length === 0) {
|
|
6648
|
-
const hasManifest = pmConf?.manifests.some((f) => existsSync3(
|
|
6671
|
+
const hasManifest = pmConf?.manifests.some((f) => existsSync3(join4(cwd, f)));
|
|
6649
6672
|
if (!hasManifest) {
|
|
6650
6673
|
return \`\\r
|
|
6651
6674
|
[orchestrator] skipping start: no package manifest (\${pmConf?.manifests.join(" or ")}) found at \${cwd} \\u2014 update the VM config if a dev server should run\\r
|
|
@@ -6732,6 +6755,15 @@ class SetupOrchestrator {
|
|
|
6732
6755
|
[orchestrator] warning: git identity setup failed: \${e.message}\\r
|
|
6733
6756
|
\`);
|
|
6734
6757
|
}
|
|
6758
|
+
if (config.repoDir) {
|
|
6759
|
+
try {
|
|
6760
|
+
installProtectedBranchHook(config.repoDir);
|
|
6761
|
+
} catch (e) {
|
|
6762
|
+
this.chunk(\`\\r
|
|
6763
|
+
[orchestrator] warning: could not install protected-branch hook: \${e.message}\\r
|
|
6764
|
+
\`);
|
|
6765
|
+
}
|
|
6766
|
+
}
|
|
6735
6767
|
if (config.git?.repository?.branch) {
|
|
6736
6768
|
this.chunk(\`[orchestrator] checking out branch: \${config.git.repository.branch}\\r
|
|
6737
6769
|
\`);
|
|
@@ -6890,12 +6922,12 @@ var bootConfig = {
|
|
|
6890
6922
|
daemonToken: process.env.DAEMON_TOKEN ?? "",
|
|
6891
6923
|
daemonBootId: process.env.DAEMON_BOOT_ID ?? "",
|
|
6892
6924
|
appRoot: APP_ROOT,
|
|
6893
|
-
repoDir:
|
|
6925
|
+
repoDir: join5(APP_ROOT, "repo"),
|
|
6894
6926
|
proxyPort: parseInt(process.env.DAEMON_PORT ?? process.env.PROXY_PORT ?? "9000", 10)
|
|
6895
6927
|
};
|
|
6896
|
-
|
|
6928
|
+
mkdirSync4(bootConfig.repoDir, { recursive: true });
|
|
6897
6929
|
var CONFIG_DIR = process.env.DAEMON_CONFIG_DIR ?? APP_ROOT;
|
|
6898
|
-
var TMP_DIR =
|
|
6930
|
+
var TMP_DIR = join5(APP_ROOT, "tmp");
|
|
6899
6931
|
var broadcaster = new Broadcaster(REPLAY_BYTES);
|
|
6900
6932
|
var store = new TenantConfigStore({ storageDir: CONFIG_DIR });
|
|
6901
6933
|
var installState = new InstallState;
|
|
@@ -7204,8 +7236,8 @@ process.on("SIGTERM", () => {
|
|
|
7204
7236
|
taskManager.shutdown();
|
|
7205
7237
|
appService.shutdown();
|
|
7206
7238
|
try {
|
|
7207
|
-
if (existsSync4(
|
|
7208
|
-
unlinkSync4(
|
|
7239
|
+
if (existsSync4(join5(CONFIG_DIR, CONFIG_FILENAME))) {}
|
|
7240
|
+
unlinkSync4(join5(CONFIG_DIR, "config.json.tmp"));
|
|
7209
7241
|
} catch {}
|
|
7210
7242
|
process.exit(0);
|
|
7211
7243
|
});
|
|
@@ -7446,7 +7478,7 @@ Guidelines:
|
|
|
7446
7478
|
|
|
7447
7479
|
return { consoleLogs, errors, evaluateResult };
|
|
7448
7480
|
}
|
|
7449
|
-
`}function SW8(X,Y){let{ctx:G,toolOutputMap:Q}=Y;return G8({description:"Inspect a web page's client-side runtime state. Navigates to a URL and collects browser console logs, JavaScript errors, and optionally evaluates a JS expression (e.g. window.dataLayer, document.title). Use this for debugging client-side issues, checking analytics setup, or inspecting runtime state. "+"For very large results the output may be truncated \u2014 use read_tool_output to access the full content.",inputSchema:p1(NW7),execute:async(J,W)=>{let Z=performance.now();try{let $=process.env.BROWSERLESS_TOKEN;if(!$)return{success:!1,error:"BROWSERLESS_TOKEN is not configured."};let K=zW7(J.url,{evaluate:J.evaluate,waitUntil:J.waitUntil}),H=await fetch(`${rs}/function?token=${encodeURIComponent($)}`,{method:"POST",headers:{"Content-Type":"application/javascript"},body:K});if(!H.ok){let z=await H.text().catch(()=>"Unknown error");return{success:!1,error:`Browserless function call failed (${H.status}): ${z}`,url:J.url}}let U;try{U=await H.json()}catch{return{success:!1,error:`Browserless returned non-JSON response: ${(await H.text().catch(()=>"")).slice(0,200)}`,url:J.url}}let B=JSON.stringify(U,null,2);Q.set(W.toolCallId,B);let N=tW(B);if(N>os&&G.objectStorage){let z=`inspect-pages/${crypto.randomUUID()}.json`,O=new TextEncoder().encode(B);try{await G.objectStorage.put(z,O,{contentType:"application/json"});let w=EZ(B);return{success:!0,uri:OK(z),preview:w,url:J.url,tokenCount:N,consoleLogCount:U.consoleLogs?.length??0,errorCount:U.errors?.length??0,hasEvaluateResult:U.evaluateResult!=null}}catch(w){console.error("[inspect-page] Failed to upload to storage, returning inline",w)}}return{success:!0,consoleLogs:U.consoleLogs,errors:U.errors,evaluateResult:U.evaluateResult,url:J.url,tokenCount:N}}finally{let $=performance.now()-Z;X.write({type:"data-tool-metadata",id:W.toolCallId,data:{latencyMs:$}})}}})}var NW7;var kW8=D(()=>{HX();F0();CL();NW7=F.object({url:F.string().url().describe("The URL of the web page to inspect."),evaluate:F.string().optional().describe(`Optional JavaScript expression to evaluate in the page context after load. Examples: 'window.dataLayer', 'document.querySelectorAll("script").length', 'performance.getEntriesByType("resource").map(e => ({name: e.name, duration: e.duration}))'`),waitUntil:F.enum(["load","domcontentloaded","networkidle0","networkidle2"]).optional().describe("When to consider navigation complete. Defaults to 'networkidle2'.")})});async function DW7(X,Y,G){let{provider:Q,organization:J,models:W,toolApprovalLevel:Z="auto",isPlanMode:$=!1,toolOutputMap:K,pendingImages:H,passthroughClient:U,vmContext:B,taskId:N}=Y,z={isPlanMode:$},O={user_ask:DW8,propose_plan:LW8,agent_search:x38(X,{organization:J,needsApproval:$W1(Z,!0,z)!==!1},G),read_tool_output:k38({toolOutputMap:K}),read_resource:m38({passthroughClient:U,toolOutputMap:K,ctx:G}),read_prompt:u38({passthroughClient:U,toolOutputMap:K})},w=$W1(Z,!1,z)!==!1;if(B){let E=await cm(G),P=null;Object.assign(O,NW8({runner:E,ensureHandle:()=>{if(!P)P=DZ8({virtualMcpId:B.virtualMcpId,branch:B.branch},G).then((M)=>M.vmId),P.catch(()=>{P=null});return P},toolOutputMap:K,needsApproval:w,pendingImages:H,ctx:G,threadId:B.threadId,virtualMcpId:B.virtualMcpId}))}if(Q)O.subtask=zW8(X,{provider:Q,organization:J,models:W,needsApproval:$W1(Z,!1,z)!==!1},G);if(Q&&W.image)O.generate_image=qW8(X,{provider:Q,imageModelInfo:W.image,ctx:G});if(Q&&W.deepResearch)O.web_search=TW8(X,{provider:Q,deepResearchModelInfo:W.deepResearch,ctx:G,toolOutputMap:K,taskId:N});if(process.env.BROWSERLESS_TOKEN)O.take_screenshot=VW8(X,{ctx:G,toolOutputMap:K,pendingImages:H}),O.scrape_url=MW8(X,{ctx:G,toolOutputMap:K}),O.inspect_page=SW8(X,{ctx:G,toolOutputMap:K});return O}function wW7(X,Y,G){let Q=Y.organization.id,J=G.auth?.user?.id,W={};for(let[Z,$]of Object.entries(X)){let K=$,H=K.execute;if(typeof H!=="function"){W[Z]=$;continue}let U=OW7[Z]
|
|
7481
|
+
`}function SW8(X,Y){let{ctx:G,toolOutputMap:Q}=Y;return G8({description:"Inspect a web page's client-side runtime state. Navigates to a URL and collects browser console logs, JavaScript errors, and optionally evaluates a JS expression (e.g. window.dataLayer, document.title). Use this for debugging client-side issues, checking analytics setup, or inspecting runtime state. "+"For very large results the output may be truncated \u2014 use read_tool_output to access the full content.",inputSchema:p1(NW7),execute:async(J,W)=>{let Z=performance.now();try{let $=process.env.BROWSERLESS_TOKEN;if(!$)return{success:!1,error:"BROWSERLESS_TOKEN is not configured."};let K=zW7(J.url,{evaluate:J.evaluate,waitUntil:J.waitUntil}),H=await fetch(`${rs}/function?token=${encodeURIComponent($)}`,{method:"POST",headers:{"Content-Type":"application/javascript"},body:K});if(!H.ok){let z=await H.text().catch(()=>"Unknown error");return{success:!1,error:`Browserless function call failed (${H.status}): ${z}`,url:J.url}}let U;try{U=await H.json()}catch{return{success:!1,error:`Browserless returned non-JSON response: ${(await H.text().catch(()=>"")).slice(0,200)}`,url:J.url}}let B=JSON.stringify(U,null,2);Q.set(W.toolCallId,B);let N=tW(B);if(N>os&&G.objectStorage){let z=`inspect-pages/${crypto.randomUUID()}.json`,O=new TextEncoder().encode(B);try{await G.objectStorage.put(z,O,{contentType:"application/json"});let w=EZ(B);return{success:!0,uri:OK(z),preview:w,url:J.url,tokenCount:N,consoleLogCount:U.consoleLogs?.length??0,errorCount:U.errors?.length??0,hasEvaluateResult:U.evaluateResult!=null}}catch(w){console.error("[inspect-page] Failed to upload to storage, returning inline",w)}}return{success:!0,consoleLogs:U.consoleLogs,errors:U.errors,evaluateResult:U.evaluateResult,url:J.url,tokenCount:N}}finally{let $=performance.now()-Z;X.write({type:"data-tool-metadata",id:W.toolCallId,data:{latencyMs:$}})}}})}var NW7;var kW8=D(()=>{HX();F0();CL();NW7=F.object({url:F.string().url().describe("The URL of the web page to inspect."),evaluate:F.string().optional().describe(`Optional JavaScript expression to evaluate in the page context after load. Examples: 'window.dataLayer', 'document.querySelectorAll("script").length', 'performance.getEntriesByType("resource").map(e => ({name: e.name, duration: e.duration}))'`),waitUntil:F.enum(["load","domcontentloaded","networkidle0","networkidle2"]).optional().describe("When to consider navigation complete. Defaults to 'networkidle2'.")})});async function DW7(X,Y,G){let{provider:Q,organization:J,models:W,toolApprovalLevel:Z="auto",isPlanMode:$=!1,toolOutputMap:K,pendingImages:H,passthroughClient:U,vmContext:B,taskId:N}=Y,z={isPlanMode:$},O={user_ask:DW8,propose_plan:LW8,agent_search:x38(X,{organization:J,needsApproval:$W1(Z,!0,z)!==!1},G),read_tool_output:k38({toolOutputMap:K}),read_resource:m38({passthroughClient:U,toolOutputMap:K,ctx:G}),read_prompt:u38({passthroughClient:U,toolOutputMap:K})},w=$W1(Z,!1,z)!==!1;if(B){let E=await cm(G),P=null;Object.assign(O,NW8({runner:E,ensureHandle:()=>{if(!P)P=DZ8({virtualMcpId:B.virtualMcpId,branch:B.branch},G).then((M)=>M.vmId),P.catch(()=>{P=null});return P},toolOutputMap:K,needsApproval:w,pendingImages:H,ctx:G,threadId:B.threadId,virtualMcpId:B.virtualMcpId}))}if(Q)O.subtask=zW8(X,{provider:Q,organization:J,models:W,needsApproval:$W1(Z,!1,z)!==!1},G);if(Q&&W.image)O.generate_image=qW8(X,{provider:Q,imageModelInfo:W.image,ctx:G});if(Q&&W.deepResearch)O.web_search=TW8(X,{provider:Q,deepResearchModelInfo:W.deepResearch,ctx:G,toolOutputMap:K,taskId:N});if(process.env.BROWSERLESS_TOKEN)O.take_screenshot=VW8(X,{ctx:G,toolOutputMap:K,pendingImages:H}),O.scrape_url=MW8(X,{ctx:G,toolOutputMap:K}),O.inspect_page=SW8(X,{ctx:G,toolOutputMap:K});return O}function wW7(X,Y,G){let Q=Y.organization.id,J=G.auth?.user?.id,W={};for(let[Z,$]of Object.entries(X)){let K=$,H=K.execute;if(typeof H!=="function"){W[Z]=$;continue}let U=OW7[Z],B=H.constructor?.name==="AsyncGeneratorFunction",N=(O,w)=>{if(!Q||!J)return;M6.capture({distinctId:J,event:"tool_called",groups:{organization:Q},properties:{organization_id:Q,tool_source:"builtin",tool_name:Z,tool_safe_name:Z,read_only:U?.readOnly??null,destructive:U?.destructive??null,idempotent:null,open_world:null,latency_ms:Math.round(O),is_error:w}})},z=B?async function*(O,w){let E=performance.now(),P=!1;try{yield*H.call(K,O,w)}catch(q){throw P=!0,q}finally{N(performance.now()-E,P)}}:async(O,w)=>{let E=performance.now(),P=!1;try{return await H.call(K,O,w)}catch(q){throw P=!0,q}finally{N(performance.now()-E,P)}};W[Z]={...K,execute:z}}return W}async function CW8(X,Y,G){let Q=await DW7(X,Y,G),J=wW7(Q,Y,G);if(!Y.isPlanMode){let{propose_plan:W,...Z}=J;return Z}return J}var OW7;var vW8=D(()=>{vX();KW1();h38();CL();l38();d38();Ax0();BB();hy0();OW8();wW8();EW8();AW8();IW8();jW8();RW8();kW8();OW7={agent_search:{readOnly:!0,destructive:!1},read_tool_output:{readOnly:!0,destructive:!1},read_resource:{readOnly:!0,destructive:!1},read_prompt:{readOnly:!0,destructive:!1},web_search:{readOnly:!0,destructive:!1},generate_image:{readOnly:!1,destructive:!1},open_in_agent:{readOnly:!1,destructive:!1},subtask:{readOnly:!1,destructive:!1},user_ask:{readOnly:!0,destructive:!1},propose_plan:{readOnly:!0,destructive:!1},enable_tools:{readOnly:!0,destructive:!1}}});function _W8(X,Y,G){return G8({description:`Enable tools from the available tools catalog so they can be called in subsequent steps. Call this before using any tool listed in <available-connections>.
|
|
7450
7482
|
|
|
7451
7483
|
Usage notes:
|
|
7452
7484
|
- Batch related tools in a single call to minimize round-trips.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export type Options = {
|
|
2
|
+
/**
|
|
3
|
+
Match only the first ANSI escape.
|
|
4
|
+
|
|
5
|
+
@default false
|
|
6
|
+
*/
|
|
7
|
+
readonly onlyFirst: boolean;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
Regular expression for matching ANSI escape codes.
|
|
12
|
+
|
|
13
|
+
@example
|
|
14
|
+
```
|
|
15
|
+
import ansiRegex from 'ansi-regex';
|
|
16
|
+
|
|
17
|
+
ansiRegex().test('\u001B[4mcake\u001B[0m');
|
|
18
|
+
//=> true
|
|
19
|
+
|
|
20
|
+
ansiRegex().test('cake');
|
|
21
|
+
//=> false
|
|
22
|
+
|
|
23
|
+
'\u001B[4mcake\u001B[0m'.match(ansiRegex());
|
|
24
|
+
//=> ['\u001B[4m', '\u001B[0m']
|
|
25
|
+
|
|
26
|
+
'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true}));
|
|
27
|
+
//=> ['\u001B[4m']
|
|
28
|
+
|
|
29
|
+
'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex());
|
|
30
|
+
//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007']
|
|
31
|
+
```
|
|
32
|
+
*/
|
|
33
|
+
export default function ansiRegex(options?: Options): RegExp;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export default function ansiRegex({onlyFirst = false} = {}) {
|
|
2
|
+
// Valid string terminator sequences are BEL, ESC\, and 0x9c
|
|
3
|
+
const ST = '(?:\\u0007|\\u001B\\u005C|\\u009C)';
|
|
4
|
+
|
|
5
|
+
// OSC sequences only: ESC ] ... ST (non-greedy until the first ST)
|
|
6
|
+
const osc = `(?:\\u001B\\][\\s\\S]*?${ST})`;
|
|
7
|
+
|
|
8
|
+
// CSI and related: ESC/C1, optional intermediates, optional params (supports ; and :) then final byte
|
|
9
|
+
const csi = '[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]';
|
|
10
|
+
|
|
11
|
+
const pattern = `${osc}|${csi}`;
|
|
12
|
+
|
|
13
|
+
return new RegExp(pattern, onlyFirst ? undefined : 'g');
|
|
14
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ansi-regex",
|
|
3
|
+
"version": "6.2.2",
|
|
4
|
+
"description": "Regular expression for matching ANSI escape codes",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": "chalk/ansi-regex",
|
|
7
|
+
"funding": "https://github.com/chalk/ansi-regex?sponsor=1",
|
|
8
|
+
"author": {
|
|
9
|
+
"name": "Sindre Sorhus",
|
|
10
|
+
"email": "sindresorhus@gmail.com",
|
|
11
|
+
"url": "https://sindresorhus.com"
|
|
12
|
+
},
|
|
13
|
+
"type": "module",
|
|
14
|
+
"exports": "./index.js",
|
|
15
|
+
"types": "./index.d.ts",
|
|
16
|
+
"sideEffects": false,
|
|
17
|
+
"engines": {
|
|
18
|
+
"node": ">=12"
|
|
19
|
+
},
|
|
20
|
+
"scripts": {
|
|
21
|
+
"test": "xo && ava && tsd",
|
|
22
|
+
"view-supported": "node fixtures/view-codes.js"
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"index.js",
|
|
26
|
+
"index.d.ts"
|
|
27
|
+
],
|
|
28
|
+
"keywords": [
|
|
29
|
+
"ansi",
|
|
30
|
+
"styles",
|
|
31
|
+
"color",
|
|
32
|
+
"colour",
|
|
33
|
+
"colors",
|
|
34
|
+
"terminal",
|
|
35
|
+
"console",
|
|
36
|
+
"cli",
|
|
37
|
+
"string",
|
|
38
|
+
"tty",
|
|
39
|
+
"escape",
|
|
40
|
+
"formatting",
|
|
41
|
+
"rgb",
|
|
42
|
+
"256",
|
|
43
|
+
"shell",
|
|
44
|
+
"xterm",
|
|
45
|
+
"command-line",
|
|
46
|
+
"text",
|
|
47
|
+
"regex",
|
|
48
|
+
"regexp",
|
|
49
|
+
"re",
|
|
50
|
+
"match",
|
|
51
|
+
"test",
|
|
52
|
+
"find",
|
|
53
|
+
"pattern"
|
|
54
|
+
],
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"ansi-escapes": "^5.0.0",
|
|
57
|
+
"ava": "^3.15.0",
|
|
58
|
+
"tsd": "^0.21.0",
|
|
59
|
+
"xo": "^0.54.2"
|
|
60
|
+
}
|
|
61
|
+
}
|