@p4code/cli 0.9.25 → 0.9.26
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/{TraceDiagnostics-BHUn_HS7.mjs → TraceDiagnostics-D1Qz3qce.mjs} +3 -3
- package/dist/bin.mjs +1 -1
- package/dist/{binCli-DzJr0M8f.mjs → binCli-CcEaWLAR.mjs} +6 -6
- package/dist/client/.vite/manifest.json +2130 -2130
- package/dist/client/assets/{2NI2N5EU-DU0Cg_Lb.js → 2NI2N5EU--LXjbTE-.js} +2 -2
- package/dist/client/assets/{4UO7MD6I-B38qXGVF.js → 4UO7MD6I-D_jr6_IV.js} +2 -2
- package/dist/client/assets/{5B3SVYGG-FTIXhvjJ.js → 5B3SVYGG-tThUTA_S.js} +2 -2
- package/dist/client/assets/{5GK6JWQ2-H3C8D_6P.js → 5GK6JWQ2-BCuuAhKJ.js} +2 -2
- package/dist/client/assets/{5N7A7DKN-CozSLHAy.js → 5N7A7DKN-rdPMRoZL.js} +2 -2
- package/dist/client/assets/{5OC2THR4-CEpIVrtv.js → 5OC2THR4-gvpm3IL0.js} +2 -2
- package/dist/client/assets/{5S6HY5KT-BJiBcrC3.js → 5S6HY5KT-CWanNmdR.js} +2 -2
- package/dist/client/assets/{6IMQ5BUJ-Bc6nCKkc.js → 6IMQ5BUJ-1sguTKZ9.js} +2 -2
- package/dist/client/assets/{6OLKWJ4F-BQObFAo6.js → 6OLKWJ4F-9loy41nw.js} +2 -2
- package/dist/client/assets/{74OO7NKP-Bf7mJdAJ.js → 74OO7NKP-ukQR6jKi.js} +2 -2
- package/dist/client/assets/{75O6YZUN-CW0D2fdL.js → 75O6YZUN-BjBd5LQ0.js} +2 -2
- package/dist/client/assets/{77XECAW3-DYpoU6GE.js → 77XECAW3-Ccw2Y7VD.js} +2 -2
- package/dist/client/assets/{ABYRPUBD-DspDYvjC.js → ABYRPUBD-CvqVJLPf.js} +2 -2
- package/dist/client/assets/AlertDialogRoot-CimqRgXh.js +2 -0
- package/dist/client/assets/{AnimatedHeight-baWnHH74.js → AnimatedHeight-Dwarin_V.js} +2 -2
- package/dist/client/assets/{AuthSurfaceShell-DpXUdirf.js → AuthSurfaceShell-BvGaTutU.js} +2 -2
- package/dist/client/assets/{BB2UYUI2-DBvVdzXq.js → BB2UYUI2-Drnmium_.js} +2 -2
- package/dist/client/assets/{BUM34MOA-DD8_qVgf.js → BUM34MOA-AkPmeijf.js} +2 -2
- package/dist/client/assets/{CEQABKGZ-CVQF1BSd.js → CEQABKGZ-BNUlDSIK.js} +2 -2
- package/dist/client/assets/{CXAC5362-D-ErUdji.js → CXAC5362-Bmar3Iii.js} +2 -2
- package/dist/client/assets/{ChatGptUsageButton-CQGToDEF.js → ChatGptUsageButton-D6Iy8SVv.js} +2 -2
- package/dist/client/assets/{ChatMarkdown-LJASbkfc.js → ChatMarkdown-DHhJpg3q.js} +7 -7
- package/dist/client/assets/{CheckboxIndicator-C1r4pplS.js → CheckboxIndicator-DbA95VlZ.js} +2 -2
- package/dist/client/assets/{ClippedText-DfXsEQeG.js → ClippedText-UM8CaEu4.js} +2 -2
- package/dist/client/assets/{CodexSetupSection.logic-Bc4DfjCh.js → CodexSetupSection.logic-kKJPABQZ.js} +2 -2
- package/dist/client/assets/{CollapsiblePanel-BXH3rQRh.js → CollapsiblePanel-C1iRr4kZ.js} +2 -2
- package/dist/client/assets/{ComboboxClear-CVernRAh.js → ComboboxClear-DaifQLU5.js} +2 -2
- package/dist/client/assets/{ComboboxGroupLabel-DvjyoFJL.js → ComboboxGroupLabel-C03JGZRD.js} +2 -2
- package/dist/client/assets/{CommandBlock-WsIIEStK.js → CommandBlock-DH_L_Tgo.js} +2 -2
- package/dist/client/assets/{CompositeRoot-ByiP4GnC.js → CompositeRoot-B1DTZCNU.js} +2 -2
- package/dist/client/assets/{ConnectAgentSurface-DvJ8PBIx.js → ConnectAgentSurface-C5bZc2ZR.js} +2 -2
- package/dist/client/assets/{ConnectionStatusDot-K3y7Ct8v.js → ConnectionStatusDot-CCTiSlHA.js} +2 -2
- package/dist/client/assets/{DRLTVNUE-31JTQ6nY.js → DRLTVNUE-BqWUfmRf.js} +2 -2
- package/dist/client/assets/{DYY6UVD2-D_ZDUMtR.js → DYY6UVD2-CyRsghfa.js} +2 -2
- package/dist/client/assets/{DevicePanel-DZK0y5Ap.js → DevicePanel-DocID7hH.js} +2 -2
- package/dist/client/assets/{DeviceSetup-D3E85Zrd.js → DeviceSetup-CX2OWVB9.js} +2 -2
- package/dist/client/assets/{DialogRoot-CNtnfAJy.js → DialogRoot-D64NsaiW.js} +2 -2
- package/dist/client/assets/{DialogTitle-DV_YdpJC.js → DialogTitle-CYefNdHm.js} +2 -2
- package/dist/client/assets/{DiffCommentAnnotation-BOVXuQGc.js → DiffCommentAnnotation-ChKqFxt5.js} +2 -2
- package/dist/client/assets/{DiffFileTree-B5NHhHgk.js → DiffFileTree-B6AgzOXX.js} +2 -2
- package/dist/client/assets/{DiffPanel-Iu14e7z4.js → DiffPanel-DKAHtq5x.js} +2 -2
- package/dist/client/assets/{DiffWorkerPoolProvider-Dwi-pu0V.js → DiffWorkerPoolProvider-CK3y5UA1.js} +2 -2
- package/dist/client/assets/{EmbeddedDesign-B7W3XrYS.js → EmbeddedDesign-Bj-kkArq.js} +5 -5
- package/dist/client/assets/{EnvironmentMachineIcon-CXBfI2NX.js → EnvironmentMachineIcon-CJ30kzSK.js} +2 -2
- package/dist/client/assets/{ExpandableText-DfUAVk6K.js → ExpandableText-CBPvhWvZ.js} +2 -2
- package/dist/client/assets/{FNOVOB4O-uinkA45N.js → FNOVOB4O-DYXYw-b1.js} +2 -2
- package/dist/client/assets/{FieldControl-CIowDCcv.js → FieldControl-CkgERQaU.js} +2 -2
- package/dist/client/assets/{FileDiff-BmQX_G3I.js → FileDiff-BLuBewdN.js} +2 -2
- package/dist/client/assets/{FilePreviewPanel-X0C-_bsa.js → FilePreviewPanel-DWNimHTU.js} +5 -5
- package/dist/client/assets/{FoldedSettingsSection-veJCJBGN.js → FoldedSettingsSection-C3cuD_W9.js} +2 -2
- package/dist/client/assets/{HDGCDEEZ-C-FshFnT.js → HDGCDEEZ-7WPyPcLr.js} +2 -2
- package/dist/client/assets/{HSJLKHB7-DkWuWTFm.js → HSJLKHB7-t8_OkffK.js} +2 -2
- package/dist/client/assets/{Icons-CzUirT4o.js → Icons-BUrn1Fzo.js} +2 -2
- package/dist/client/assets/Input-Gb8KV9DV.js +2 -0
- package/dist/client/assets/{IntervalSecondsField-jhisp3XJ.js → IntervalSecondsField-D9JXVV-s.js} +2 -2
- package/dist/client/assets/JZOYTAAL-BzA5Kg5m.js +1 -0
- package/dist/client/assets/{K3MD6TGW-a8yr5Ewj.js → K3MD6TGW-DoqPvoaq.js} +2 -2
- package/dist/client/assets/{K7RP3OMA-B0CXNed1.js → K7RP3OMA--ZFOkyEG.js} +2 -2
- package/dist/client/assets/{KeybindingsSettings.logic-BJLp2hK6.js → KeybindingsSettings.logic-CMs7OPcH.js} +2 -2
- package/dist/client/assets/{LHDIQX7Q-CkhjJ70Y.js → LHDIQX7Q-hUqw2I9B.js} +2 -2
- package/dist/client/assets/{LUXOKEGN-DhYrChjL.js → LUXOKEGN-Dvu_mp-q.js} +2 -2
- package/dist/client/assets/{LinkMachineSelect-rWCX7r86.js → LinkMachineSelect-SHXPDP_g.js} +2 -2
- package/dist/client/assets/{MathTypeset-C9x0hMF0.js → MathTypeset-TM-3r0WA.js} +2 -2
- package/dist/client/assets/{ModelLiveLayer-Dv_jCIXj.js → ModelLiveLayer-Bb-7OhJ9.js} +3 -3
- package/dist/client/assets/{N3JZAHOW-B97FAWso.js → N3JZAHOW-LjhhJ-00.js} +2 -2
- package/dist/client/assets/{NUIALGQ3-Dq5lVW3w.js → NUIALGQ3-Dg1KXz02.js} +2 -2
- package/dist/client/assets/{NoProjectsHero-BsinbzdV.js → NoProjectsHero-D0OPZtzO.js} +2 -2
- package/dist/client/assets/{O65XPQGZ-D4-546m0.js → O65XPQGZ-BxaJR80d.js} +2 -2
- package/dist/client/assets/{O7XIQ6OM-BPEf7K4J.js → O7XIQ6OM-CCXPxMuU.js} +2 -2
- package/dist/client/assets/{OFQON5FD-ANLB_eks.js → OFQON5FD-WUMBXQkX.js} +2 -2
- package/dist/client/assets/{P4ConnectAccountPages-BkUG1cNj.js → P4ConnectAccountPages-BNK6s-RS.js} +2 -2
- package/dist/client/assets/{P4ConnectSidebarSignIn-Bd8SD-N2.js → P4ConnectSidebarSignIn-CWW40SMl.js} +2 -2
- package/dist/client/assets/{PJQHF43J-U5Qjv9uU.js → PJQHF43J-BrNjCaLl.js} +2 -2
- package/dist/client/assets/{PanelLayoutControls-BiOzQEUj.js → PanelLayoutControls-DiXjRWIw.js} +7 -7
- package/dist/client/assets/{PierreEntryIcon-C3yCp-3j.js → PierreEntryIcon-D29_Ylm_.js} +2 -2
- package/dist/client/assets/{PopoverHandle-BOG8GZW9.js → PopoverHandle-BgggGdpn.js} +2 -2
- package/dist/client/assets/PreviewPanel-DutKwWE7.js +2 -0
- package/dist/client/assets/{ProjectDefaultsSettings-BNoHUxLB.js → ProjectDefaultsSettings-DMfJN66D.js} +2 -2
- package/dist/client/assets/{ProjectFavicon-DJihy670.js → ProjectFavicon-DFI1NI3D.js} +3 -3
- package/dist/client/assets/{ProjectIconPickerDialog-B64NU333.js → ProjectIconPickerDialog-BqGWzrTc.js} +2 -2
- package/dist/client/assets/{ProjectMonogram-Bm8g4eoe.js → ProjectMonogram-D4xxVtw8.js} +2 -2
- package/dist/client/assets/{ProviderAuthTerminal-ep_3vQXs.js → ProviderAuthTerminal-CRSvI-Og.js} +2 -2
- package/dist/client/assets/ProviderModelPicker-D73G0AKf.js +2 -0
- package/dist/client/assets/{ProviderSettingsForm-DdzTiAwr.js → ProviderSettingsForm-DchD8HSN.js} +2 -2
- package/dist/client/assets/{PullRequestCodeTab-DxIVyifS.js → PullRequestCodeTab-BdXdTg-d.js} +3 -3
- package/dist/client/assets/{RHNBAITX-Ca700xaA.js → RHNBAITX-PsYrngSs.js} +2 -2
- package/dist/client/assets/{ReadOnlySourcePreview-DwbQjZ6S.js → ReadOnlySourcePreview-8jLKmc3M.js} +2 -2
- package/dist/client/assets/{RedactedSensitiveText-CKBxO8RE.js → RedactedSensitiveText-DhV2Jdu8.js} +2 -2
- package/dist/client/assets/{RenderErrorBoundary-Ds0CLe6f.js → RenderErrorBoundary-56lc2IQ3.js} +2 -2
- package/dist/client/assets/{RightPanelResizeHandle-kgBW_OmO.js → RightPanelResizeHandle-ClzdYxWw.js} +2 -2
- package/dist/client/assets/{SLD4V6NK-DHgBQG4y.js → SLD4V6NK-CxidvPXU.js} +2 -2
- package/dist/client/assets/{ScheduledTasksSettings-G10yO5DO.js → ScheduledTasksSettings-BdMCgBm5.js} +5 -5
- package/dist/client/assets/{ScopedSwitch-DGi7EZuF.js → ScopedSwitch-CwnjCta_.js} +2 -2
- package/dist/client/assets/{ScrollAreaCorner-sEIv5sN-.js → ScrollAreaCorner-CfTQYjCW.js} +2 -2
- package/dist/client/assets/{SecretInput-C8mfkoqW.js → SecretInput-BYfVbTLh.js} +2 -2
- package/dist/client/assets/{SelectScrollUpArrow-BBy8ExJB.js → SelectScrollUpArrow-BE0-tVtP.js} +2 -2
- package/dist/client/assets/{SelfImproveSettingsSection-CJpzoxZq.js → SelfImproveSettingsSection-DsqFeICK.js} +2 -2
- package/dist/client/assets/{SettingsPanels-CKuvIEcT.js → SettingsPanels-D_rJsyjt.js} +7 -7
- package/dist/client/assets/{SettingsPanels.logic-mWhM0JKq.js → SettingsPanels.logic-BTJUBh-T.js} +2 -2
- package/dist/client/assets/{SettingsScopeNotice-CYlVOS9U.js → SettingsScopeNotice-CAVvn3pQ.js} +2 -2
- package/dist/client/assets/{SidebarStageBackdrop-CcJgZb4i.js → SidebarStageBackdrop-DdxWuxIk.js} +2 -2
- package/dist/client/assets/{T3PCR2KE-sETS2BfN.js → T3PCR2KE-BtQsKjM5.js} +2 -2
- package/dist/client/assets/{TKWO2OVW-DOxrph0T.js → TKWO2OVW-CeYF-suq.js} +2 -2
- package/dist/client/assets/{TSHNXIZL-LkLzenBL.js → TSHNXIZL-FQ7ZWHEn.js} +2 -2
- package/dist/client/assets/{ThemeEditorPanel-BSPkdhmj.js → ThemeEditorPanel-BJucNhy-.js} +2 -2
- package/dist/client/assets/{ThreadDetailsItemsMenu-8anoK4Or.js → ThreadDetailsItemsMenu-CRBBIuc7.js} +8 -8
- package/dist/client/assets/{ThreadTerminalDrawer-Wd-He1GI.js → ThreadTerminalDrawer-Ci0mbLzJ.js} +4 -4
- package/dist/client/assets/{TooltipProvider-DMrkN3Xd.js → TooltipProvider-BH5ni_Lo.js} +2 -2
- package/dist/client/assets/{UQJE5E4I-DbEWChzq.js → UQJE5E4I-CeqBk-r6.js} +2 -2
- package/dist/client/assets/{USNYFO5S-D2NfvkZx.js → USNYFO5S-_1m41tJt.js} +2 -2
- package/dist/client/assets/{Virtualizer-C2gQRrRy.js → Virtualizer-DLB0FYm-.js} +2 -2
- package/dist/client/assets/{WEVWDWVA-CWLLvNnc.js → WEVWDWVA-DmSV8HLL.js} +2 -2
- package/dist/client/assets/{WorkspaceBreadcrumb-DDBBo54L.js → WorkspaceBreadcrumb-DQkeBQUl.js} +2 -2
- package/dist/client/assets/{WorkspacePageContainer-D-b_7VnU.js → WorkspacePageContainer-D2rx9iDg.js} +2 -2
- package/dist/client/assets/{WorkspacePageHeader-C8bAlMLy.js → WorkspacePageHeader-D8-RIRjQ.js} +2 -2
- package/dist/client/assets/{X5RFHQXM-B_4xBer1.js → X5RFHQXM-BUdDYXox.js} +2 -2
- package/dist/client/assets/{X62E3GBT-DH4DDJbS.js → X62E3GBT-BbQ7FmNB.js} +2 -2
- package/dist/client/assets/{XBNEOJTC-CH0FX2u2.js → XBNEOJTC-BLEZA-vx.js} +2 -2
- package/dist/client/assets/{YHV2MVVZ-vkFosclt.js → YHV2MVVZ-DM2RTtkR.js} +2 -2
- package/dist/client/assets/{YURCZMG2-CflztzI6.js → YURCZMG2-D5w6cPMY.js} +2 -2
- package/dist/client/assets/{YVG2LODB-BU5mIo0f.js → YVG2LODB-BkLbsaCo.js} +2 -2
- package/dist/client/assets/{_chat-rr4Pa6Jr.js → _chat-CKMs-ajx.js} +19 -19
- package/dist/client/assets/{_chat.design-DcTokS2n.js → _chat.design-CpqXODBn.js} +2 -2
- package/dist/client/assets/{_chat.index-Cx2rD23U.js → _chat.index-B0eOfZAf.js} +2 -2
- package/dist/client/assets/{_chat.new-Bef-dZPa.js → _chat.new-CqLuDynd.js} +2 -2
- package/dist/client/assets/{_chat.pull-requests-CEwED8fj.js → _chat.pull-requests-C4Eo8GDQ.js} +2 -2
- package/dist/client/assets/{alert-iNR43-xr.js → alert-D1O9oex3.js} +2 -2
- package/dist/client/assets/{alert-dialog-B7VzBOev.js → alert-dialog-3XDceRWv.js} +2 -2
- package/dist/client/assets/{assetUrls-BMHkXryh.js → assetUrls-Dq0gsqWs.js} +2 -2
- package/dist/client/assets/{assets-C96oF_eX.js → assets-C3_UZib9.js} +2 -2
- package/dist/client/assets/{browserHistoryStore-DcyxHvEZ.js → browserHistoryStore-CVCo7qfb.js} +2 -2
- package/dist/client/assets/{browserLinkTarget-5NDfBwMZ.js → browserLinkTarget-CopcRHna.js} +2 -2
- package/dist/client/assets/{checkbox-BnoBa5Yw.js → checkbox-CxRqp4sO.js} +2 -2
- package/dist/client/assets/{color-picker-DGBwf4df.js → color-picker-CvbP7BS3.js} +2 -2
- package/dist/client/assets/{combobox-BViCCYpe.js → combobox-CuyUAuiC.js} +2 -2
- package/dist/client/assets/{command-DD9AbES_.js → command-4bqVdX0m.js} +2 -2
- package/dist/client/assets/{connect-B3_KXIyQ.js → connect-DFGquf-O.js} +2 -2
- package/dist/client/assets/connect-agent-Db5rxxY1.js +2 -0
- package/dist/client/assets/{design-BwQ33zDs.js → design-DzoN9JgQ.js} +2 -2
- package/dist/client/assets/{device-CAueNfph.js → device-H2MyT_kA.js} +2 -2
- package/dist/client/assets/{dialog-DvBVJIw1.js → dialog-CrLVN_m6.js} +2 -2
- package/dist/client/assets/{diffPanelStore-B43kjSer.js → diffPanelStore-CxnPNigi.js} +2 -2
- package/dist/client/assets/{diffRendering-DwbgLJaq.js → diffRendering-cyTQV5bk.js} +2 -2
- package/dist/client/assets/{dist-B-8eHEk-.js → dist-J7s-H61h.js} +3 -3
- package/dist/client/assets/{draft-input-CBmbOI5j.js → draft-input-UuEBPJE8.js} +2 -2
- package/dist/client/assets/{duoViewer-Dml9fvvm.js → duoViewer-C3DQnADY.js} +2 -2
- package/dist/client/assets/{dynamic-C2hTfNo4.js → dynamic-PDa6LTqb.js} +2 -2
- package/dist/client/assets/{embeddedScripts-DmobRpxc.js → embeddedScripts-BDzRNXSL.js} +2 -2
- package/dist/client/assets/{empty-CGA6iTo1.js → empty-YMXgQbNI.js} +2 -2
- package/dist/client/assets/{entities-ygRGujH7.js → entities-HOBDIiHK.js} +2 -2
- package/dist/client/assets/{fileLinks-COT45KrB.js → fileLinks-BlT4My6t.js} +2 -2
- package/dist/client/assets/{fileTreeExpansion-t42YM2NT.js → fileTreeExpansion-D5nN-Oqd.js} +2 -2
- package/dist/client/assets/{getDiffFileInput-BRoo9f7T.js → getDiffFileInput-4gToQuSl.js} +2 -2
- package/dist/client/assets/{htmlRender-w5A35V7p.js → htmlRender-CUGVJXGf.js} +2 -2
- package/dist/client/assets/{index-BfU6cQrF.js → index-C04a0SKq.js} +3 -3
- package/dist/client/assets/{input-L7UBCORX.js → input-DxHa9qj5.js} +2 -2
- package/dist/client/assets/{input-group-B4A2yaVX.js → input-group-_rAbDbys.js} +2 -2
- package/dist/client/assets/{kbd-CNvVBYtE.js → kbd-DjUfNaix.js} +2 -2
- package/dist/client/assets/{keybindings-DoiXiZn5.js → keybindings-8_1sqf8s.js} +2 -2
- package/dist/client/assets/{lazy-BYuTmsKJ.js → lazy-C1dqAep6.js} +4 -4
- package/dist/client/assets/{lazyRouteComponent-DlaI8YOu.js → lazyRouteComponent-DLamKhHF.js} +2 -2
- package/dist/client/assets/{link-Vg2garcH.js → link-D1nkgCv7.js} +2 -2
- package/dist/client/assets/{linkedPrompt-Bg0S0srn.js → linkedPrompt-Quysf0mk.js} +2 -2
- package/dist/client/assets/main-BFdCLmkY.js +39 -0
- package/dist/client/assets/{mediaReference-BGHvhhnE.js → mediaReference-D19Dzoh3.js} +2 -2
- package/dist/client/assets/{mediaSource-CeGNee1z.js → mediaSource-DfsR3T70.js} +2 -2
- package/dist/client/assets/{modelScene-DtBAQ8-k.js → modelScene-CcF-Uii-.js} +2 -2
- package/dist/client/assets/{number-field-BRlzUJEB.js → number-field-CALZZPio.js} +2 -2
- package/dist/client/assets/{observeResize-CNiPL-bo.js → observeResize-DLmefMqO.js} +2 -2
- package/dist/client/assets/{onboarding-9Isl06ny.js → onboarding-plATuZco.js} +2 -2
- package/dist/client/assets/{openFileInPreview-CgNdFzHq.js → openFileInPreview-BCGQQ_Ia.js} +2 -2
- package/dist/client/assets/{p4ProjectFile-kzawDum5.js → p4ProjectFile-DCNJ4pTp.js} +2 -2
- package/dist/client/assets/{pair-ClGrg_fl.js → pair-umv6-haX.js} +2 -2
- package/dist/client/assets/{pendingSendStore-Kz-cNs4v.js → pendingSendStore-CgfQk4GV.js} +2 -2
- package/dist/client/assets/{phoneViewer-B5Ue7Mj_.js → phoneViewer-DJWjzgFc.js} +2 -2
- package/dist/client/assets/{pierre-icons-cxD685IX.js → pierre-icons-fv1goMS6.js} +2 -2
- package/dist/client/assets/{popover-DYDa4qjy.js → popover-DxCAIK62.js} +2 -2
- package/dist/client/assets/{preview-BypB2j7r.js → preview-Ce5ECOHv.js} +2 -2
- package/dist/client/assets/{preview-BPJ2QBFC.js → preview-x1tmlUez.js} +2 -2
- package/dist/client/assets/{previewMiniPlayerStore-C_zTFBAY.js → previewMiniPlayerStore-CEd7VI6J.js} +2 -2
- package/dist/client/assets/{primary-BP9P8Pte.js → primary-DcnaBKM0.js} +2 -2
- package/dist/client/assets/{primaryCloudLinkState-DRbP1pee.js → primaryCloudLinkState-TS0IW37f.js} +2 -2
- package/dist/client/assets/{projectFilesQueryState-DodSPNTI.js → projectFilesQueryState-DKw9S3nn.js} +2 -2
- package/dist/client/assets/{projectScriptEditor-DxYgPh8M.js → projectScriptEditor-DT7-Ivvb.js} +2 -2
- package/dist/client/assets/{providerSkills-DA9qtjVM.js → providerSkills-G8ld9nNp.js} +2 -2
- package/dist/client/assets/{pullRequestDetail.logic-Car0C0YH.js → pullRequestDetail.logic-Dm3mx1US.js} +2 -2
- package/dist/client/assets/{pullRequestIcons-CJzQ9q45.js → pullRequestIcons-D8rnFTkk.js} +2 -2
- package/dist/client/assets/{pullRequestReviewStore-CWrDaNh_.js → pullRequestReviewStore-C45fih_P.js} +2 -2
- package/dist/client/assets/{pullRequests-Dx8h1wyx.js → pullRequests-euX1Ch2G.js} +2 -2
- package/dist/client/assets/{queries-DY1lhLYl.js → queries-DNRXml7d.js} +2 -2
- package/dist/client/assets/{query-C-5C8CaD.js → query-Bw8YoCbO.js} +2 -2
- package/dist/client/assets/{radio-group-DpsCw8_-.js → radio-group-DpD3XHAp.js} +2 -2
- package/dist/client/assets/{relay-Bjm0weca.js → relay-YiJpGyaO.js} +2 -2
- package/dist/client/assets/{relayFailureReason-1tQ1xfnE.js → relayFailureReason-Baxcpnas.js} +2 -2
- package/dist/client/assets/{renderScheduler-Bza_olpQ.js → renderScheduler-BuGbk7RK.js} +2 -2
- package/dist/client/assets/{rightPanelStore-BNvdVe0q.js → rightPanelStore-BF1zmmXM.js} +2 -2
- package/dist/client/assets/{runtime-DGtwOpiP.js → runtime-DIAcbMTc.js} +5 -5
- package/dist/client/assets/{runtimeModeConfig-DicWhVdl.js → runtimeModeConfig-4g_-_dE2.js} +2 -2
- package/dist/client/assets/{scheduledTasksSettings.logic-u5XriP_U.js → scheduledTasksSettings.logic-BOrkdeD3.js} +2 -2
- package/dist/client/assets/{scroll-area-Ct6TrgZr.js → scroll-area-CokPD3-i.js} +2 -2
- package/dist/client/assets/{select-B3jSTp6e.js → select-CxYi0YMi.js} +2 -2
- package/dist/client/assets/{selfImproveFindings-Bw954UOu.js → selfImproveFindings-CE-lxRTw.js} +2 -2
- package/dist/client/assets/{server-BjY-vKW2.js → server-BNjk2K1j.js} +2 -2
- package/dist/client/assets/{session-CkASndp1.js → session-DMNo4Bh3.js} +2 -2
- package/dist/client/assets/{session-logic-C3HuEav7.js → session-logic-CELyWJ1v.js} +2 -2
- package/dist/client/assets/{settings-DpDhgaUs.js → settings-Bt6o5coA.js} +2 -2
- package/dist/client/assets/{settings.appearance-BMBe1DlC.js → settings.appearance-pkRxkhgs.js} +2 -2
- package/dist/client/assets/settings.archived-OjOh5b0A.js +2 -0
- package/dist/client/assets/{settings.computer-use-dlKT7XFQ.js → settings.computer-use-Dh6Z2-Jg.js} +2 -2
- package/dist/client/assets/{settings.connections-BaU6DQRh.js → settings.connections-F3LWiK8-.js} +2 -2
- package/dist/client/assets/{settings.data-controls-DrInQbPq.js → settings.data-controls-DgOo9a4b.js} +2 -2
- package/dist/client/assets/{settings.decisions-Dibz4qNv.js → settings.decisions-lQFEkC9t.js} +2 -2
- package/dist/client/assets/{settings.designs-BGdZiNGp.js → settings.designs-C1tyiETD.js} +2 -2
- package/dist/client/assets/settings.diagnostics-kp_wJw6e.js +2 -0
- package/dist/client/assets/{settings.general-rsdZzWCJ.js → settings.general-B5Kke4t3.js} +2 -2
- package/dist/client/assets/{settings.integrations-DK-S9Pa1.js → settings.integrations-CjiKCDy_.js} +2 -2
- package/dist/client/assets/{settings.keybindings-Coe8Ydce.js → settings.keybindings-CouYSmxE.js} +2 -2
- package/dist/client/assets/{settings.open-source-licenses--xUZ68RR.js → settings.open-source-licenses-CHFTLx1q.js} +2 -2
- package/dist/client/assets/{settings.plugins-DXoF7IBB.js → settings.plugins-StUBBho3.js} +3 -3
- package/dist/client/assets/{settings.projects-ChEJ7uSA.js → settings.projects-B_SxK9Cl.js} +3 -3
- package/dist/client/assets/{settings.providers-BYwf6_Ds.js → settings.providers-Ch16WkgV.js} +3 -3
- package/dist/client/assets/{settings.scheduled-tasks-Cu69dh_-.js → settings.scheduled-tasks-KNcUc94O.js} +2 -2
- package/dist/client/assets/{settings.secrets-CdyzqqJR.js → settings.secrets-2aMmfgKR.js} +2 -2
- package/dist/client/assets/{settings.snap-shot-DdYHf8Q5.js → settings.snap-shot-B5cEBXZD.js} +2 -2
- package/dist/client/assets/settings.source-control-G_TX95re.js +2 -0
- package/dist/client/assets/{settings.storage-CuUZoWfT.js → settings.storage-BdNNKm9m.js} +2 -2
- package/dist/client/assets/{settingsLayout-DbyBB8ZI.js → settingsLayout-CzGbLP4v.js} +2 -2
- package/dist/client/assets/{sidebar-Do4Myy34.js → sidebar-ovj9EiR4.js} +2 -2
- package/dist/client/assets/{sidebarProjectGrouping-Ks0H3W1r.js → sidebarProjectGrouping-DT6LCDEX.js} +2 -2
- package/dist/client/assets/{skeleton-M5MIqTy6.js → skeleton-0IEb3e4e.js} +2 -2
- package/dist/client/assets/{sourceControl-gpSCT1i6.js → sourceControl-CPobWWHq.js} +2 -2
- package/dist/client/assets/{sourceControlClients-YDf1HZkJ.js → sourceControlClients-4PlkytxQ.js} +2 -2
- package/dist/client/assets/{spinner-89SWutMk.js → spinner-7CSKKESP.js} +2 -2
- package/dist/client/assets/{src-upZEL2qH.js → src-BVovWpja.js} +2 -2
- package/dist/client/assets/{terminal-links-ztYtKVge.js → terminal-links-BTdovUFa.js} +2 -2
- package/dist/client/assets/{terminalSessions-DuQL-Su5.js → terminalSessions-EUiRWJti.js} +2 -2
- package/dist/client/assets/{textarea-Dk6r4lQ8.js → textarea-DMmmmGA1.js} +2 -2
- package/dist/client/assets/{themePalette-CwTOEe8R.js → themePalette-C7ZOgucT.js} +2 -2
- package/dist/client/assets/{threadCheckpoints-BBbnkFJd.js → threadCheckpoints-DjIk4Kvg.js} +2 -2
- package/dist/client/assets/{toggle-CzhtG7Ix.js → toggle-4vFx94TS.js} +2 -2
- package/dist/client/assets/{toggle-group-DVojM2PG.js → toggle-group-d6H735Xi.js} +2 -2
- package/dist/client/assets/{tooltip-CZBiwhnV.js → tooltip-CGvxq8k3.js} +2 -2
- package/dist/client/assets/{uiStateStore-DbqU-t2g.js → uiStateStore-MbQdhAPp.js} +2 -2
- package/dist/client/assets/{usage-CvKBHOpJ.js → usage-Da_tm2dn.js} +2 -2
- package/dist/client/assets/{usageAccess-12EW-JWb.js → usageAccess-B-HGPPkp.js} +2 -2
- package/dist/client/assets/{usageFormat-Bpgdmf94.js → usageFormat-DcON9Kz_.js} +2 -2
- package/dist/client/assets/{usageShortcuts-BK6jQ69t.js → usageShortcuts-B_o9XxKX.js} +2 -2
- package/dist/client/assets/{use-atom-command-Dv8zTjOp.js → use-atom-command-C4Tyb1VL.js} +2 -2
- package/dist/client/assets/{useAriaLabelledBy-CLMjXrdj.js → useAriaLabelledBy-CcwjH1QH.js} +2 -2
- package/dist/client/assets/useHandleNewThread-Qb_yy6KY.js +2 -0
- package/dist/client/assets/{useLocation-DsTBGqgr.js → useLocation-CIvcNoeU.js} +2 -2
- package/dist/client/assets/{useNavigate-DeDarx0_.js → useNavigate-DVrOlf8m.js} +2 -2
- package/dist/client/assets/{useNavigateBack-nU9Xh3KX.js → useNavigateBack-Dmf0SIc3.js} +2 -2
- package/dist/client/assets/{useP4ConnectAuthPrompt-wImG3qls.js → useP4ConnectAuthPrompt-BPXqJdyY.js} +2 -2
- package/dist/client/assets/{useParams-D8m5ONq0.js → useParams-BeJIRxxE.js} +2 -2
- package/dist/client/assets/{usePermissionStatus-DPEHxlfG.js → usePermissionStatus-Cx1Wuwk0.js} +2 -2
- package/dist/client/assets/{usePopupViewport-DDPbext7.js → usePopupViewport-OR_PF2s-.js} +2 -2
- package/dist/client/assets/{usePullRequestActions-Bk-wSv5o.js → usePullRequestActions-B_Nrg846.js} +2 -2
- package/dist/client/assets/{useRegisterFieldControl-By1bF-jd.js → useRegisterFieldControl-B72Afmil.js} +2 -2
- package/dist/client/assets/{useScopedModelAvailability-CTzd1AsV.js → useScopedModelAvailability-DVQ42jT4.js} +2 -2
- package/dist/client/assets/{useSettings-DwDYuiOf.js → useSettings-BWMcQzC-.js} +2 -2
- package/dist/client/assets/{utils-sVhLpEl6.js → utils-DFNDxNZi.js} +2 -2
- package/dist/client/assets/{vcsRefInvalidation-9bbPf9DL.js → vcsRefInvalidation-CV8dYgi0.js} +2 -2
- package/dist/client/assets/{welcome-D36q57wJ.js → welcome-BxhPM21H.js} +2 -2
- package/dist/client/index.html +1 -1
- package/dist/{preview-D0Bi2g4U.mjs → preview-BGylKXB6.mjs} +5 -3
- package/dist/{renderer-Cq4PzLVY.mjs → renderer-CQkeNW9b.mjs} +2 -2
- package/dist/{runtime-Cy8_QlEa.mjs → runtime-O5AWAEzD.mjs} +2 -2
- package/dist/{runtimeLayer-DUru7wpz.mjs → runtimeLayer-C-Fo4HWH.mjs} +1 -1
- package/dist/{runtimeLayer-DZa24xtO.mjs → runtimeLayer-ChPBglJB.mjs} +535 -481
- package/dist/{server-BK48ByhE.mjs → server-CsS0d2BE.mjs} +116 -15
- package/dist/{sha2-D9ocDAIA.mjs → sha2-BjjJcoUu.mjs} +4 -1
- package/package.json +1 -1
- package/dist/client/assets/AlertDialogRoot-3k-2cSKF.js +0 -2
- package/dist/client/assets/Input-DRxcOIy1.js +0 -2
- package/dist/client/assets/JZOYTAAL-CaZB6S8Y.js +0 -1
- package/dist/client/assets/PreviewPanel-DzlmHQZw.js +0 -2
- package/dist/client/assets/ProviderModelPicker-Dj26-4yu.js +0 -2
- package/dist/client/assets/connect-agent-CX7YZ3cf.js +0 -2
- package/dist/client/assets/main-CNs583QD.js +0 -39
- package/dist/client/assets/settings.archived-UyT8Vo2k.js +0 -2
- package/dist/client/assets/settings.diagnostics-30yarj2c.js +0 -2
- package/dist/client/assets/settings.source-control-x5yuK078.js +0 -2
- package/dist/client/assets/useHandleNewThread-Do-y1VVt.js +0 -2
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{$c as i,$l as a,Hu as o,Jo as s,Ju as c,Ou as l,Tu as u,hr as d,md as f,ml as p,mr as m,nu as h,ru as g,t as _,tl as v}from"./utils-sVhLpEl6.js";import{Qi as y,Tg as b,Vm as x,Xi as S,_g as ee,ju as C,ra as w,ug as T,vg as te,xg as ne}from"./src-upZEL2qH.js";import{Ar as re,Tr as ie}from"./runtime-DGtwOpiP.js";import{m as E,p as D,u as O}from"./TooltipProvider-DMrkN3Xd.js";import{a as k,m as A}from"./relay-Bjm0weca.js";import{O as j,q as ae}from"./useSettings-DwDYuiOf.js";import{f as M}from"./server-BjY-vKW2.js";import{i as oe,n as N,t as P}from"./session-CkASndp1.js";import{n as F}from"./query-C-5C8CaD.js";import{t as se}from"./use-atom-command-Dv8zTjOp.js";import{a as ce,o as le,u as ue}from"./timestampFormat-Dq7sHZpd.js";import{a as I,n as L,t as R}from"./tooltip-CZBiwhnV.js";import{n as de,t as fe}from"./toggle-group-DVojM2PG.js";import{t as pe}from"./input-L7UBCORX.js";import{t as z}from"./scroll-area-Ct6TrgZr.js";import{L as me,U as he,i as ge,s as B,u as _e}from"./settingsLayout-DbyBB8ZI.js";import{t as ve}from"./ConnectionStatusDot-K3y7Ct8v.js";import{Go as V,Ho as ye,gn as H,ha as be}from"./main-CNs583QD.js";import{t as xe}from"./usageAccess-12EW-JWb.js";import{t as Se}from"./ExpandableText-DfUAVk6K.js";import{t as Ce}from"./SettingsScopeNotice-CYlVOS9U.js";var U=n(),W=e(r(),1);function we(e){let t=(0,U.c)(19),{disabled:n,onSignal:r}=e,i;t[0]===r?i=t[1]:(i=()=>r(`SIGINT`),t[0]=r,t[1]=i);let a;t[2]!==n||t[3]!==i?(a=(0,W.jsx)(I,{render:(0,W.jsx)(d,{disabled:n,"aria-label":`Send SIGINT`,tone:`muted`,onClick:i,children:`INT`})}),t[2]=n,t[3]=i,t[4]=a):a=t[4];let o;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,W.jsx)(L,{side:`top`,children:`Send SIGINT`}),t[5]=o):o=t[5];let s;t[6]===a?s=t[7]:(s=(0,W.jsxs)(R,{children:[a,o]}),t[6]=a,t[7]=s);let c;t[8]===r?c=t[9]:(c=()=>r(`SIGKILL`),t[8]=r,t[9]=c);let l;t[10]!==n||t[11]!==c?(l=(0,W.jsx)(I,{render:(0,W.jsx)(d,{disabled:n,"aria-label":`Send SIGKILL`,tone:`destructive`,onClick:c,children:`KILL`})}),t[10]=n,t[11]=c,t[12]=l):l=t[12];let u;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,W.jsx)(L,{side:`top`,children:`Send SIGKILL`}),t[13]=u):u=t[13];let f;t[14]===l?f=t[15]:(f=(0,W.jsxs)(R,{children:[l,u]}),t[14]=l,t[15]=f);let p;return t[16]!==s||t[17]!==f?(p=(0,W.jsxs)(`div`,{className:`flex items-center justify-end gap-1.5`,children:[s,f]}),t[16]=s,t[17]=f,t[18]=p):p=t[18],p}var G=e(t(),1);function Te(e){let t=j(),n=e===void 0?t?.environmentId??null:e,r=oe(n,S),i=F(n===null||!r?null:M.resourceTelemetry({environmentId:n,input:{}})),a=se(M.retryResourceTelemetry,{reportFailure:!1}),o=(0,G.useCallback)(async()=>{if(n===null)throw Error(`No environment is selected.`);if(!N(n,`environment:maintain`)||!N(n,`diagnostics:read`))throw Error(`This connection cannot restart the resource monitor.`);let e=await a({environmentId:n,input:{}});if(e._tag===`Failure`)throw x(e.cause);return i.refresh(),e.value.snapshot},[n,a]);return{...i,retry:o}}function Ee(e,t){let n=(0,U.c)(4),r=j(),i=t===void 0?r?.environmentId??null:t,a=oe(i,S),o;return n[0]!==a||n[1]!==i||n[2]!==e?(o=i===null||!a?null:M.resourceTelemetryHistory({environmentId:i,input:e}),n[0]=a,n[1]=i,n[2]=e,n[3]=o):o=n[3],F(o)}function De(e){return`${e.identity.pid}:${e.identity.startTimeMs}`}function Oe(e,t){let n=new Map;for(let t of e){let e=n.get(t.ppid)??[];e.push(t),n.set(t.ppid,e)}let r=new Set,i=e=>{for(let t of n.get(e)??[]){let e=De(t);r.has(e)||(r.add(e),i(t.identity.pid))}};for(let n of e)t.has(De(n))&&i(n.identity.pid);return e.filter(e=>!r.has(De(e)))}function ke(e){return e.nativeStatus===null&&e.error!==null||e.nativeStatus===`degraded`||e.nativeStatus===`unavailable`||e.nativeStatus===`stopped`}function K(e){return e.value<=0?0:Math.max(e.minimumVisiblePercent,e.value/Math.max(1,e.max)*100)}function Ae(e){return Math.max(1,...e.map(e=>e.avgCpuPercent))}var q=[{label:`5m`,windowMs:3e5,bucketMs:15e3},{label:`15m`,windowMs:9e5,bucketMs:3e4},{label:`30m`,windowMs:18e5,bucketMs:6e4},{label:`1h`,windowMs:36e5,bucketMs:12e4}];function J(e){return`${H(e)}/s`}function je(e){let t=e/1e3;if(t<60)return`${t.toFixed(t>=10?1:2).replace(/\.0+$/,``)}s`;let n=t/60;return n<60?`${n.toFixed(n>=10?1:2).replace(/\.0+$/,``)}m`:`${(n/60).toFixed(2).replace(/\.0+$/,``)}h`}function Me(e){return e<1e3?`${Math.round(e)} µs`:e<1e6?`${(e/1e3).toFixed(2).replace(/\.0+$/,``)} ms`:`${(e/1e6).toFixed(2).replace(/\.0+$/,``)} s`}function Ne(e){if(e<1e3)return`${Math.max(0,Math.round(e))} ms`;let t=e/1e3;return`${t.toLocaleString(void 0,{maximumFractionDigits:1})} ${t===1?`second`:`seconds`}`}function Pe(e){return`${e.identity.pid}:${e.identity.startTimeMs}`}function Fe(e){return`${e.identity.pid}:${e.identity.startTimeMs}`}function Ie(e){if(e.name.trim())return e.name;let t=(e.command.trim().split(/\s+/)[0]??e.command).replace(/^['"]|['"]$/g,``);return t.split(/[\\/]/).findLast(e=>e.length>0)??t}function Le(e){switch(e){case`server`:return`Server`;case`server-child`:return`Backend child`;case`provider-root`:return`Provider`;case`terminal-root`:return`Terminal`;case`electron-main`:return`Electron main`;case`electron-renderer`:return`Renderer`;case`electron-gpu`:return`GPU`;case`electron-utility`:return`Electron utility`;case`resource-monitor`:return`Monitor`;case`unknown-p4`:return`P4 process`}}function Re(e){return e===`resource-monitor`?`bg-warning`:e.startsWith(`electron-`)?`bg-info`:e===`server`?`bg-violet-500`:`bg-success`}function ze(e){switch(e){case`storage`:return`Storage bytes`;case`logical`:return`Logical bytes`;case`all-io`:return`All I/O bytes`;case`unavailable`:return`Unavailable`}}function Be(e,t){return e===`true`?t.true:e===`false`?t.false:`Unknown`}function Ve(e){return e===`healthy`?`default`:e===`starting`||e===`degraded`?`warning`:`danger`}function He(e){let t=(0,U.c)(20),{label:n,status:r,presentation:i}=e,a;t[0]!==i?.tone||t[1]!==r?(a=i?.tone??Ve(r),t[0]=i?.tone,t[1]=r,t[2]=a):a=t[2];let o=a,s=o===`neutral`&&`border-border/70 bg-muted/45 text-muted-foreground`,c=o==="default"&&`border-success/25 bg-success/10 text-success-foreground`,l=o===`warning`&&`border-warning/30 bg-warning/10 text-warning-foreground`,u=o===`danger`&&`border-destructive/30 bg-destructive/10 text-destructive`,d;t[3]!==s||t[4]!==c||t[5]!==l||t[6]!==u?(d=_(`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-3xs font-semibold uppercase tracking-widest`,s,c,l,u),t[3]=s,t[4]=c,t[5]=l,t[6]=u,t[7]=d):d=t[7];let f=o===`neutral`&&`bg-muted-foreground/55`,p=o==="default"&&`bg-success`,m=o===`warning`&&`bg-warning`,h=o===`danger`&&`bg-destructive`,g;t[8]!==h||t[9]!==f||t[10]!==p||t[11]!==m?(g=_(`size-1.5 rounded-full`,f,p,m,h),t[8]=h,t[9]=f,t[10]=p,t[11]=m,t[12]=g):g=t[12];let v;t[13]===g?v=t[14]:(v=(0,W.jsx)(`span`,{className:g}),t[13]=g,t[14]=v);let y=i?.label??r,b;return t[15]!==n||t[16]!==v||t[17]!==y||t[18]!==d?(b=(0,W.jsxs)(`span`,{className:d,children:[v,n,` `,y]}),t[15]=n,t[16]=v,t[17]=y,t[18]=d,t[19]=b):b=t[19],b}function Ue(e){let t=(0,U.c)(9),{sampledAt:n}=e;if(_e(),!n){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,W.jsx)(`span`,{className:`text-2xs text-muted-foreground/55`,children:`Waiting for sample`}),t[0]=e):e=t[0],e}let r;t[1]===n?r=t[2]:(r=ce(C(n)),t[1]=n,t[2]=r);let i=r;if(!i){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,W.jsx)(`span`,{className:`text-2xs text-muted-foreground/55`,children:`Waiting for sample`}),t[3]=e):e=t[3],e}let a;t[4]===i.value?a=t[5]:(a=(0,W.jsx)(`span`,{className:`font-mono tabular-nums`,children:i.value}),t[4]=i.value,t[5]=a);let o=i.suffix?` ${i.suffix}`:``,s;return t[6]!==a||t[7]!==o?(s=(0,W.jsxs)(`span`,{className:`text-2xs text-muted-foreground/60`,children:[`Updated `,a,o]}),t[6]=a,t[7]=o,t[8]=s):s=t[8],s}function Y(e){let t=(0,U.c)(19),{icon:n,label:r,value:i,detail:a,tone:o}=e,s=o===void 0?`default`:o,c;t[0]===n?c=t[1]:(c=(0,W.jsx)(`span`,{className:`text-muted-foreground/55 transition-colors group-hover:text-foreground/65`,children:n}),t[0]=n,t[1]=c);let l;t[2]===r?l=t[3]:(l=(0,W.jsx)(`span`,{className:`truncate`,children:r}),t[2]=r,t[3]=l);let u;t[4]!==c||t[5]!==l?(u=(0,W.jsxs)(`div`,{className:`flex items-center gap-2 text-3xs font-semibold uppercase tracking-widest text-muted-foreground/70`,children:[c,l]}),t[4]=c,t[5]=l,t[6]=u):u=t[6];let d=s===`warning`&&`text-warning-foreground`,f=s===`danger`&&`text-destructive`,p;t[7]!==d||t[8]!==f?(p=_(`mt-2.5 truncate font-mono text-2xl font-semibold tracking-tighter tabular-nums text-foreground`,d,f),t[7]=d,t[8]=f,t[9]=p):p=t[9];let m;t[10]!==p||t[11]!==i?(m=(0,W.jsx)(`div`,{className:p,children:i}),t[10]=p,t[11]=i,t[12]=m):m=t[12];let h;t[13]===a?h=t[14]:(h=a?(0,W.jsx)(`div`,{className:`mt-1.5 truncate text-3xs text-muted-foreground/60`,children:a}):null,t[13]=a,t[14]=h);let g;return t[15]!==u||t[16]!==m||t[17]!==h?(g=(0,W.jsxs)(`div`,{className:`group min-w-0 px-4 py-4 sm:px-5`,children:[u,m,h]}),t[15]=u,t[16]=m,t[17]=h,t[18]=g):g=t[18],g}function We(e){let t=(0,U.c)(37),{label:n,accentClass:r,aggregate:i}=e,a;t[0]===r?a=t[1]:(a=_(`absolute inset-x-5 top-0 h-0.5 rounded-full opacity-75`,r),t[0]=r,t[1]=a);let o;t[2]===a?o=t[3]:(o=(0,W.jsx)(`span`,{className:a}),t[2]=a,t[3]=o);let s;t[4]===n?s=t[5]:(s=(0,W.jsx)(`div`,{className:`text-3xs font-semibold uppercase tracking-widest text-muted-foreground/75`,children:n}),t[4]=n,t[5]=s);let c=i.processCount===1?`process`:`processes`,l;t[6]!==i.processCount||t[7]!==c?(l=(0,W.jsxs)(`div`,{className:`rounded-md bg-muted/55 px-1.5 py-0.5 font-mono text-3xs tabular-nums text-muted-foreground/70`,children:[i.processCount,` `,c]}),t[6]=i.processCount,t[7]=c,t[8]=l):l=t[8];let u;t[9]!==s||t[10]!==l?(u=(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[s,l]}),t[9]=s,t[10]=l,t[11]=u):u=t[11];let d;t[12]===i.currentCpuPercent?d=t[13]:(d=i.currentCpuPercent.toFixed(1),t[12]=i.currentCpuPercent,t[13]=d);let f=`${d}%`,p;t[14]===f?p=t[15]:(p=(0,W.jsx)(Ge,{label:`CPU`,value:f}),t[14]=f,t[15]=p);let m;t[16]===i.currentRssBytes?m=t[17]:(m=H(i.currentRssBytes),t[16]=i.currentRssBytes,t[17]=m);let h;t[18]===m?h=t[19]:(h=(0,W.jsx)(Ge,{label:`Memory`,value:m}),t[18]=m,t[19]=h);let g;t[20]===i.ioReadBytesPerSecond?g=t[21]:(g=J(i.ioReadBytesPerSecond),t[20]=i.ioReadBytesPerSecond,t[21]=g);let v;t[22]===g?v=t[23]:(v=(0,W.jsx)(Ge,{label:`Read`,value:g}),t[22]=g,t[23]=v);let y;t[24]===i.ioWriteBytesPerSecond?y=t[25]:(y=J(i.ioWriteBytesPerSecond),t[24]=i.ioWriteBytesPerSecond,t[25]=y);let b;t[26]===y?b=t[27]:(b=(0,W.jsx)(Ge,{label:`Write`,value:y}),t[26]=y,t[27]=b);let x;t[28]!==h||t[29]!==v||t[30]!==b||t[31]!==p?(x=(0,W.jsxs)(`div`,{className:`mt-3.5 grid grid-cols-2 gap-x-4 gap-y-2.5`,children:[p,h,v,b]}),t[28]=h,t[29]=v,t[30]=b,t[31]=p,t[32]=x):x=t[32];let S;return t[33]!==x||t[34]!==o||t[35]!==u?(S=(0,W.jsxs)(`div`,{className:`relative overflow-hidden border-t border-border/60 px-4 py-4 first:border-t-0 md:border-t-0 md:border-l md:first:border-l-0 sm:px-5`,children:[o,u,x]}),t[33]=x,t[34]=o,t[35]=u,t[36]=S):S=t[36],S}function Ge(e){let t=(0,U.c)(7),{label:n,value:r}=e,i;t[0]===n?i=t[1]:(i=(0,W.jsx)(`div`,{className:`text-3xs font-semibold uppercase tracking-widest text-muted-foreground/45`,children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=(0,W.jsx)(`div`,{className:`truncate font-mono text-xs font-medium tabular-nums text-foreground/90`,children:r}),t[2]=r,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,W.jsxs)(`div`,{className:`min-w-0`,children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function Ke(e){let t=(0,U.c)(21),{label:n,health:r}=e,i;t[0]!==r.lastError||t[1]!==r.status?(i=r.status===`unavailable`&&T(r.lastError,Ye),t[0]=r.lastError,t[1]=r.status,t[2]=i):i=t[2];let a=i,o;t[3]===n?o=t[4]:(o=(0,W.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:n}),t[3]=n,t[4]=o);let s;t[5]!==a||t[6]!==r.lastError?(s=a?`Available when this page runs inside the desktop app.`:b(r.lastError,{onNone:Je,onSome:qe}),t[5]=a,t[6]=r.lastError,t[7]=s):s=t[7];let c;t[8]===s?c=t[9]:(c=(0,W.jsx)(`div`,{className:`mt-1 text-2xs leading-relaxed text-muted-foreground/65`,children:s}),t[8]=s,t[9]=c);let l;t[10]!==o||t[11]!==c?(l=(0,W.jsxs)(`div`,{className:`min-w-0`,children:[o,c]}),t[10]=o,t[11]=c,t[12]=l):l=t[12];let u;t[13]===a?u=t[14]:(u=a?{label:`Desktop only`,tone:`neutral`}:void 0,t[13]=a,t[14]=u);let d;t[15]!==r.status||t[16]!==u?(d=(0,W.jsx)(He,{label:``,status:r.status,presentation:u}),t[15]=r.status,t[16]=u,t[17]=d):d=t[17];let f;return t[18]!==l||t[19]!==d?(f=(0,W.jsxs)(`div`,{className:`flex items-start justify-between gap-4 border-t border-border/50 py-3 first:border-t-0`,children:[l,d]}),t[18]=l,t[19]=d,t[20]=f):f=t[20],f}function qe(e){return e}function Je(){return`No reported errors`}function Ye(e){return e.includes(`'web' mode`)}function X(e){let t=(0,U.c)(10),{label:n,value:r,valueClassName:i}=e,a;t[0]===n?a=t[1]:(a=(0,W.jsx)(`span`,{className:`text-2xs text-muted-foreground/75`,children:n}),t[0]=n,t[1]=a);let o;t[2]===i?o=t[3]:(o=_(`min-w-0 truncate text-right font-mono text-2xs tabular-nums text-foreground/85`,i),t[2]=i,t[3]=o);let s;t[4]!==o||t[5]!==r?(s=(0,W.jsx)(`span`,{className:o,children:r}),t[4]=o,t[5]=r,t[6]=s):s=t[6];let c;return t[7]!==a||t[8]!==s?(c=(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-4 border-t border-border/50 py-2.5 first:border-t-0`,children:[a,s]}),t[7]=a,t[8]=s,t[9]=c):c=t[9],c}function Xe(e){let t=(0,U.c)(8),{selectedWindowMs:n,onSelect:r}=e,i=String(n),a;t[0]===i?a=t[1]:(a=[i],t[0]=i,t[1]=a);let o;t[2]===r?o=t[3]:(o=e=>{let t=q.find(t=>String(t.windowMs)===e[0]);t&&r(t.windowMs)},t[2]=r,t[3]=o);let s;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(s=q.map(Ze),t[4]=s):s=t[4];let c;return t[5]!==a||t[6]!==o?(c=(0,W.jsx)(de,{"aria-label":`Resource history period`,variant:`segmented`,value:a,onValueChange:o,children:s}),t[5]=a,t[6]=o,t[7]=c):c=t[7],c}function Ze(e){return(0,W.jsx)(fe,{value:String(e.windowMs),children:e.label},e.windowMs)}function Qe(e){let t=(0,U.c)(15),{buckets:n}=e,r,i,a,o;if(t[0]!==n){let e=Ae(n),s=Math.max(1,...n.map($e));a=`border-t border-border/60 px-4 py-4 sm:px-5`;let c;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,W.jsx)(`span`,{className:`h-1.5 w-3 rounded-full bg-foreground/70`}),` CPU average`]}),t[5]=c):c=t[5];let l;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,W.jsx)(`span`,{className:`h-1.5 w-3 rounded-full bg-info/70`}),` I/O reads`]}),t[6]=l):l=t[6],t[7]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,W.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center gap-x-4 gap-y-1 text-3xs text-muted-foreground/65`,children:[c,l,(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,W.jsx)(`span`,{className:`h-1.5 w-3 rounded-full bg-warning/80`}),` I/O writes`]})]}),t[7]=o):o=t[7],r=`flex h-32 items-end gap-1 overflow-hidden rounded-lg border border-border/40 bg-muted/8 px-2 pt-3 pb-2`,i=n.map(t=>{let n=K({value:t.avgCpuPercent,max:e,minimumVisiblePercent:2}),r=K({value:t.ioReadBytes,max:s,minimumVisiblePercent:1}),i=K({value:t.ioWriteBytes,max:s,minimumVisiblePercent:1});return(0,W.jsxs)(R,{children:[(0,W.jsx)(I,{render:(0,W.jsxs)(`div`,{className:`grid h-full min-w-1 flex-1 grid-cols-3 items-end gap-px`,children:[(0,W.jsx)(`span`,{className:`block rounded-t-sm bg-foreground/65`,style:{height:`${n}%`}}),(0,W.jsx)(`span`,{className:`block rounded-t-sm bg-info/70`,style:{height:`${r}%`}}),(0,W.jsx)(`span`,{className:`block rounded-t-sm bg-warning/80`,style:{height:`${i}%`}})]})}),(0,W.jsx)(L,{side:`top`,className:`text-left`,children:(0,W.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,W.jsxs)(`div`,{children:[`CPU avg `,t.avgCpuPercent.toFixed(1),`%`]}),(0,W.jsxs)(`div`,{children:[`CPU peak `,t.maxCpuPercent.toFixed(1),`%`]}),(0,W.jsxs)(`div`,{children:[`Read `,H(t.ioReadBytes)]}),(0,W.jsxs)(`div`,{children:[`Write `,H(t.ioWriteBytes)]})]})})]},C(t.startedAt))}),t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o}else r=t[1],i=t[2],a=t[3],o=t[4];let s;t[8]!==r||t[9]!==i?(s=(0,W.jsx)(`div`,{className:r,children:i}),t[8]=r,t[9]=i,t[10]=s):s=t[10];let c;return t[11]!==a||t[12]!==o||t[13]!==s?(c=(0,W.jsxs)(`div`,{className:a,children:[o,s]}),t[11]=a,t[12]=o,t[13]=s,t[14]=c):c=t[14],c}function $e(e){return e.ioReadBytes+e.ioWriteBytes}function et(e){let t=(0,U.c)(26),{process:n,collapsed:r,onToggle:i}=e,a;t[0]===n?a=t[1]:(a=Ie(n),t[0]=n,t[1]=a);let o=a,s=n.childPids.length>0,c=`${Math.min(n.depth,7)*10}px`,l;t[2]===c?l=t[3]:(l={paddingLeft:c},t[2]=c,t[3]=l);let u;t[4]!==r||t[5]!==s||t[6]!==o||t[7]!==i||t[8]!==n?(u=s?(0,W.jsx)(m,{size:`icon-micro`,variant:`ghost-muted`,onClick:()=>i(n),"aria-label":r?`Expand ${o}`:`Collapse ${o}`,children:(0,W.jsx)(O,{className:`size-3.5`,icon:r?E:D})}):(0,W.jsx)(`span`,{className:`size-5`,"aria-hidden":!0}),t[4]=r,t[5]=s,t[6]=o,t[7]=i,t[8]=n,t[9]=u):u=t[9];let d;t[10]===n.category?d=t[11]:(d=_(`size-1.5 rounded-full`,Re(n.category)),t[10]=n.category,t[11]=d);let f;t[12]===d?f=t[13]:(f=(0,W.jsx)(`span`,{className:d}),t[12]=d,t[13]=f);let p;t[14]===o?p=t[15]:(p=(0,W.jsx)(I,{render:(0,W.jsx)(`span`,{className:`min-w-0 truncate font-medium text-foreground`,children:o})}),t[14]=o,t[15]=p);let h=n.command||n.name,g;t[16]===h?g=t[17]:(g=(0,W.jsx)(L,{side:`top`,variant:`code`,children:h}),t[16]=h,t[17]=g);let v;t[18]!==p||t[19]!==g?(v=(0,W.jsxs)(R,{children:[p,g]}),t[18]=p,t[19]=g,t[20]=v):v=t[20];let y;return t[21]!==v||t[22]!==l||t[23]!==u||t[24]!==f?(y=(0,W.jsxs)(`div`,{className:`grid min-w-0 grid-cols-[1.25rem_0.375rem_minmax(0,1fr)] items-center gap-2`,style:l,children:[u,f,v]}),t[21]=v,t[22]=l,t[23]=u,t[24]=f,t[25]=y):y=t[25],y}function tt(e){return e.category===`server-child`||e.category===`provider-root`||e.category===`terminal-root`}function nt(e){let t=(0,U.c)(10),{process:n,canMaintainEnvironment:r,signalingKeys:i,onSignal:a}=e;if(!tt(n)){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,W.jsx)(`span`,{className:`text-3xs text-muted-foreground/35`,children:`—`}),t[0]=e):e=t[0],e}let o;t[1]!==n||t[2]!==i?(o=i.has(Pe(n)),t[1]=n,t[2]=i,t[3]=o):o=t[3];let s=!r||o,c;t[4]!==a||t[5]!==n?(c=e=>a(n,e),t[4]=a,t[5]=n,t[6]=c):c=t[6];let l;return t[7]!==s||t[8]!==c?(l=(0,W.jsx)(we,{disabled:s,onSignal:c}),t[7]=s,t[8]=c,t[9]=l):l=t[9],l}function rt(e){let t=(0,U.c)(22),{processes:n,canMaintainEnvironment:r,signalingKeys:i,onSignal:a}=e,[o,s]=(0,G.useState)(it),c;t[0]!==o||t[1]!==n?(c=Oe(n,o),t[0]=o,t[1]=n,t[2]=c):c=t[2];let l=c,u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=e=>{let t=Pe(e);s(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})},t[3]=u):u=t[3];let d=u,f;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,W.jsxs)(`colgroup`,{children:[(0,W.jsx)(`col`,{className:`w-[20%]`}),(0,W.jsx)(`col`,{className:`w-[10%]`}),(0,W.jsx)(`col`,{className:`w-[7%]`}),(0,W.jsx)(`col`,{className:`w-[8%]`}),(0,W.jsx)(`col`,{className:`w-[9%]`}),(0,W.jsx)(`col`,{className:`w-[9%]`}),(0,W.jsx)(`col`,{className:`w-[9%]`}),(0,W.jsx)(`col`,{className:`w-[10%]`}),(0,W.jsx)(`col`,{className:`w-[8%]`}),(0,W.jsx)(`col`,{className:`w-[6%]`}),(0,W.jsx)(`col`,{className:`w-[4%]`})]}),t[4]=f):f=t[4];let p;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,W.jsx)(`thead`,{className:`sticky top-0 z-10 border-b border-border/60 bg-card text-3xs uppercase tracking-widest text-muted-foreground/65`,children:(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Process`}),(0,W.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Category`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU Time`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Memory`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Read/s`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Write/s`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Read Total`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Write Total`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`PID`}),(0,W.jsx)(`th`,{className:`px-2 py-2 text-right font-semibold sm:pr-4`,children:`Kill`})]})}),t[5]=p):p=t[5];let m;t[6]===l.length?m=t[7]:(m=l.length===0?(0,W.jsx)(`tr`,{children:(0,W.jsx)(`td`,{colSpan:11,className:`px-4 py-5 text-xs text-muted-foreground sm:px-5`,children:`Waiting for the native process monitor.`})}):null,t[6]=l.length,t[7]=m);let h;if(t[8]!==r||t[9]!==o||t[10]!==a||t[11]!==i||t[12]!==l){let e;t[14]!==r||t[15]!==o||t[16]!==a||t[17]!==i?(e=e=>(0,W.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,W.jsx)(`td`,{className:`px-4 py-2 sm:pl-5`,children:(0,W.jsx)(et,{process:e,collapsed:o.has(Pe(e)),onToggle:d})}),(0,W.jsx)(`td`,{className:`truncate px-3 py-2 text-2xs text-muted-foreground`,children:Le(e.category)}),(0,W.jsxs)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:[e.cpuPercent.toFixed(1),`%`]}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:je(e.cpuTimeMs)}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:H(e.residentBytes)}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-info-foreground`,children:J(e.ioReadBytesPerSecond)}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-warning-foreground`,children:J(e.ioWriteBytesPerSecond)}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground`,children:H(e.ioReadBytes)}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground`,children:(0,W.jsxs)(R,{children:[(0,W.jsx)(I,{render:(0,W.jsx)(`span`,{children:H(e.ioWriteBytes)})}),(0,W.jsx)(L,{side:`top`,children:ze(e.ioSemantics)})]})}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground`,children:e.identity.pid}),(0,W.jsx)(`td`,{className:`px-2 py-2 text-right sm:pr-4`,children:(0,W.jsx)(nt,{process:e,canMaintainEnvironment:r,signalingKeys:i,onSignal:a})})]},Pe(e)),t[14]=r,t[15]=o,t[16]=a,t[17]=i,t[18]=e):e=t[18],h=l.map(e),t[8]=r,t[9]=o,t[10]=a,t[11]=i,t[12]=l,t[13]=h}else h=t[13];let g;return t[19]!==m||t[20]!==h?(g=(0,W.jsx)(`div`,{className:`border-t border-border/60`,children:(0,W.jsx)(z,{chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`max-h-[min(68vh,48rem)] w-full max-w-full`,children:(0,W.jsxs)(`table`,{className:`w-full min-w-[1320px] table-fixed text-left text-xs`,children:[f,p,(0,W.jsxs)(`tbody`,{className:`divide-y divide-border/50`,children:[m,h]})]})})}),t[19]=m,t[20]=h,t[21]=g):g=t[21],g}function it(){return new Set}function at(e){let t=(0,U.c)(9),{processes:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,W.jsxs)(`colgroup`,{children:[(0,W.jsx)(`col`,{className:`w-[24%]`}),(0,W.jsx)(`col`,{className:`w-[11%]`}),(0,W.jsx)(`col`,{className:`w-[10%]`}),(0,W.jsx)(`col`,{className:`w-[10%]`}),(0,W.jsx)(`col`,{className:`w-[11%]`}),(0,W.jsx)(`col`,{className:`w-[11%]`}),(0,W.jsx)(`col`,{className:`w-[11%]`}),(0,W.jsx)(`col`,{className:`w-[7%]`}),(0,W.jsx)(`col`,{className:`w-[5%]`})]}),t[0]=r):r=t[0];let i;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,W.jsx)(`thead`,{className:`sticky top-0 z-10 border-b border-border/60 bg-card text-3xs uppercase tracking-widest text-muted-foreground/65`,children:(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Process`}),(0,W.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Category`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU Time`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Peak CPU`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Peak Mem`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Read`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Write`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Samples`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold sm:pr-5`,children:`PID`})]})}),t[1]=i):i=t[1];let a;t[2]===n.length?a=t[3]:(a=n.length===0?(0,W.jsx)(`tr`,{children:(0,W.jsx)(`td`,{colSpan:9,className:`px-4 py-5 text-xs text-muted-foreground sm:px-5`,children:`No retained process samples in this window.`})}):null,t[2]=n.length,t[3]=a);let o;t[4]===n?o=t[5]:(o=n.map(ot),t[4]=n,t[5]=o);let s;return t[6]!==a||t[7]!==o?(s=(0,W.jsx)(`div`,{className:`border-t border-border/60`,children:(0,W.jsx)(z,{chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`max-h-[28rem] w-full max-w-full`,children:(0,W.jsxs)(`table`,{className:`w-full min-w-[1020px] table-fixed text-left text-xs`,children:[r,i,(0,W.jsxs)(`tbody`,{className:`divide-y divide-border/50`,children:[a,o]})]})})}),t[6]=a,t[7]=o,t[8]=s):s=t[8],s}function ot(e){return(0,W.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,W.jsx)(`td`,{className:`px-4 py-2 sm:pl-5`,children:(0,W.jsxs)(R,{children:[(0,W.jsx)(I,{render:(0,W.jsx)(`span`,{className:`block truncate font-medium text-foreground`,children:e.name||e.command})}),(0,W.jsx)(L,{side:`top`,variant:`code`,children:e.command||e.name})]})}),(0,W.jsx)(`td`,{className:`truncate px-3 py-2 text-2xs text-muted-foreground`,children:Le(e.category)}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:je(e.cpuTimeMs)}),(0,W.jsxs)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:[e.maxCpuPercent.toFixed(1),`%`]}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:H(e.peakRssBytes)}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-info-foreground`,children:H(e.ioReadBytes)}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-warning-foreground`,children:H(e.ioWriteBytes)}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground`,children:e.sampleCount}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground sm:pr-5`,children:e.identity.pid})]},Fe(e))}function st(e){let t=(0,U.c)(9),{entries:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,W.jsxs)(`colgroup`,{children:[(0,W.jsx)(`col`,{className:`w-[22%]`}),(0,W.jsx)(`col`,{className:`w-[28%]`}),(0,W.jsx)(`col`,{className:`w-[14%]`}),(0,W.jsx)(`col`,{className:`w-[14%]`}),(0,W.jsx)(`col`,{className:`w-[10%]`}),(0,W.jsx)(`col`,{className:`w-[12%]`})]}),t[0]=r):r=t[0];let i;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,W.jsx)(`thead`,{className:`border-b border-border/60 text-3xs uppercase tracking-widest text-muted-foreground/65`,children:(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Component`}),(0,W.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Operation`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Logical Read`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Logical Write`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Count`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold sm:pr-5`,children:`Time`})]})}),t[1]=i):i=t[1];let a;t[2]===n.length?a=t[3]:(a=n.length===0?(0,W.jsx)(`tr`,{children:(0,W.jsx)(`td`,{colSpan:6,className:`px-4 py-5 text-xs text-muted-foreground sm:px-5`,children:`No instrumented application I/O has been recorded yet.`})}):null,t[2]=n.length,t[3]=a);let o;t[4]===n?o=t[5]:(o=n.map(ct),t[4]=n,t[5]=o);let s;return t[6]!==a||t[7]!==o?(s=(0,W.jsx)(`div`,{className:`overflow-x-auto border-t border-border/60`,children:(0,W.jsxs)(`table`,{className:`w-full min-w-[720px] table-fixed text-left text-xs`,children:[r,i,(0,W.jsxs)(`tbody`,{className:`divide-y divide-border/50`,children:[a,o]})]})}),t[6]=a,t[7]=o,t[8]=s):s=t[8],s}function ct(e){return(0,W.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,W.jsx)(`td`,{className:`truncate px-4 py-2 font-medium text-foreground sm:pl-5`,children:e.component}),(0,W.jsx)(`td`,{className:`truncate px-3 py-2 text-muted-foreground`,children:e.operation}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-info-foreground`,children:H(e.logicalReadBytes)}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-warning-foreground`,children:H(e.logicalWriteBytes)}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:e.count}),(0,W.jsxs)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground sm:pr-5`,children:[(e.durationMs/1e3).toFixed(2).replace(/\.0+$/,``),`s`]})]},`${e.component}:${e.operation}`)}function lt({environmentId:e}){let[t,n]=(0,G.useState)(9e5),r=q.find(e=>e.windowMs===t)??q[1],a=oe(e,y),s=Te(e),c=s.retry,u=Ee({windowMs:r.windowMs,bucketMs:r.bucketMs},e),d=u.refresh,_=(0,G.useRef)({environmentId:e,windowMs:t,refreshHistory:d});(0,G.useEffect)(()=>{_.current={environmentId:e,windowMs:t,refreshHistory:d}},[e,t,d]);let x=se(M.signalProcess,{reportFailure:!1}),[S,C]=(0,G.useState)(()=>new Set),w=(0,G.useRef)(new Set),T=(0,G.useRef)(e);(0,G.useEffect)(()=>(T.current=e,()=>{T.current=null}),[e]);let[ne,E]=(0,G.useState)(!1),D=s.data,O=D?.groups.allP4,A=(0,G.useCallback)(async(e,t)=>{let n=T.current;if(n===null||!N(n,`environment:maintain`))return;let r=Pe(e);if(w.current.has(r))return;let i=new Set(w.current).add(r);w.current=i,C(i);let a=()=>{let e=new Set(w.current);e.delete(r),w.current=e,C(e)};if(t===`SIGKILL`){let n=!1;try{n=await ae().dialogs.confirm(`Send SIGKILL to process ${e.identity.pid}? This cannot be handled by the process.`,{variant:`destructive`})}catch(e){a(),k.add({type:`error`,title:`Could not confirm signal`,description:e instanceof Error?e.message:`Failed to send ${t}.`});return}if(!n){a();return}}T.current!==n||!N(n,`environment:maintain`)?a():x({environmentId:n,input:{pid:e.identity.pid,startTimeMs:e.identity.startTimeMs,signal:t}}).then(n=>{if(n._tag===`Failure`){if(ie(n))return;throw re(n)}n.value.signaled||k.add({type:`error`,title:`Could not send ${t}`,description:ee(n.value.message,()=>`Failed to send ${t} to process ${e.identity.pid}.`)})}).catch(e=>{k.add({type:`error`,title:`Could not send ${t}`,description:e instanceof Error?e.message:`Failed to send ${t}.`})}).finally(()=>{a()})},[x]),j=(0,G.useCallback)(()=>{let e=T.current;e!==null&&N(e,`environment:maintain`)&&(E(!0),c().then(()=>{d();let n=_.current;T.current===e&&n.environmentId===e&&n.windowMs!==t&&n.refreshHistory()}).catch(e=>{k.add({type:`error`,title:`Could not restart resource monitor`,description:e instanceof Error?e.message:`The resource monitor retry failed.`})}).finally(()=>{E(!1)}))},[c]),P=D?te(D.speedLimitPercent):null,F=ke({nativeStatus:D?.health.native.status??null,error:s.error}),ce=D!==null&&(D.power.onBattery!==`unknown`||D.power.lowPowerMode!==`unknown`||D.power.idle!==`unknown`||D.power.locked!==`unknown`||D.power.thermalState!==`unknown`);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(B,{title:`Resource monitor`,icon:(0,W.jsx)(i,{className:`size-4 text-muted-foreground`}),headerAction:(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[D?(0,W.jsx)(He,{label:`Native`,status:D.health.native.status}):null,(0,W.jsx)(Ue,{sampledAt:D?.readAt??null}),(0,W.jsxs)(R,{children:[(0,W.jsx)(I,{render:(0,W.jsx)(m,{size:`icon-micro`,variant:`ghost`,disabled:s.isPending,onClick:s.refresh,"aria-label":`Refresh resource telemetry`,children:(0,W.jsx)(V,{size:`xs`,refreshing:s.isPending})})}),(0,W.jsx)(L,{side:`top`,children:`Refresh telemetry snapshot`})]})]}),children:(0,W.jsxs)(`div`,{className:`overflow-hidden rounded-[inherit]`,children:[(0,W.jsxs)(`div`,{className:`flex flex-col gap-3 border-b border-border/60 bg-linear-to-r from-muted/45 via-muted/20 to-transparent px-4 py-4 sm:flex-row sm:items-center sm:justify-between sm:px-5`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`text-3xs font-semibold uppercase tracking-widest text-muted-foreground/70`,children:`P4 system footprint`}),(0,W.jsx)(`p`,{className:`mt-1 max-w-xl text-xs leading-relaxed text-muted-foreground`,children:`Live native counters for the server, providers, terminals, desktop processes, and the monitor itself.`})]}),(0,W.jsxs)(`div`,{className:`flex items-center gap-2 text-3xs text-muted-foreground/65`,children:[(0,W.jsx)(`span`,{className:`size-1.5 rounded-full bg-success`}),`Sampling every `,D?Ne(D.sampleIntervalMs):`...`]})]}),(0,W.jsxs)(`div`,{className:`grid grid-cols-2 divide-x divide-y divide-border/55 md:grid-cols-3`,children:[(0,W.jsx)(Y,{icon:(0,W.jsx)(h,{className:`size-3.5`}),label:`Current CPU`,value:O?`${O.currentCpuPercent.toFixed(1)}%`:`...`,detail:O?`${je(O.cpuTimeMs)} observed CPU time`:void 0}),(0,W.jsx)(Y,{icon:(0,W.jsx)(f,{className:`size-3.5`}),label:`Resident memory`,value:O?H(O.currentRssBytes):`...`,detail:O?`${H(O.peakRssBytes)} combined process peaks`:void 0}),(0,W.jsx)(Y,{icon:(0,W.jsx)(i,{className:`size-3.5`}),label:`Process count`,value:O?String(O.processCount):`...`,detail:O?`${O.processStarts} starts · ${O.processExits} exits`:void 0}),(0,W.jsx)(Y,{icon:(0,W.jsx)(o,{className:`size-3.5`}),label:`Read throughput`,value:O?J(O.ioReadBytesPerSecond):`...`,detail:O?`${H(O.ioReadBytes)} observed`:void 0}),(0,W.jsx)(Y,{icon:(0,W.jsx)(g,{className:`size-3.5`}),label:`Write throughput`,value:O?J(O.ioWriteBytesPerSecond):`...`,detail:O?`${H(O.ioWriteBytes)} observed`:void 0,tone:O&&O.ioWriteBytesPerSecond>=10485760?`danger`:O&&O.ioWriteBytesPerSecond>=1048576?`warning`:`default`}),(0,W.jsx)(Y,{icon:(0,W.jsx)(l,{className:`size-3.5`}),label:`CPU speed limit`,value:D?P===null?`Unknown`:`${P.toFixed(0)}%`:`...`,detail:D?`${D.power.thermalState} thermal state`:void 0,tone:P!==null&&P<80?`warning`:`default`})]}),s.error?(0,W.jsxs)(`div`,{className:`flex items-start gap-2 border-t border-destructive/20 bg-destructive/5 px-4 py-3 text-xs text-destructive sm:px-5`,children:[(0,W.jsx)(v,{className:`mt-0.5 size-3.5 shrink-0`}),(0,W.jsx)(`span`,{children:s.error})]}):null,D?(0,W.jsxs)(`div`,{className:`grid border-t border-border/60 bg-muted/10 md:grid-cols-3`,children:[(0,W.jsx)(We,{label:`Backend + agents`,accentClass:`bg-success/80`,aggregate:D.groups.backend}),(0,W.jsx)(We,{label:`Desktop`,accentClass:`bg-info/80`,aggregate:D.groups.electron}),(0,W.jsx)(We,{label:`Monitor overhead`,accentClass:`bg-warning/80`,aggregate:D.groups.monitor})]}):null]})}),(0,W.jsx)(B,{title:`Host & collection`,icon:(0,W.jsx)(l,{className:`size-4 text-muted-foreground`}),headerAction:F?(0,W.jsxs)(m,{size:`xs`,variant:`outline`,disabled:ne,onClick:j,children:[(0,W.jsx)(V,{size:`xs`,refreshing:ne}),`Retry monitor`]}):null,children:(0,W.jsxs)(`div`,{className:`grid overflow-hidden rounded-[inherit] md:grid-cols-2 md:divide-x md:divide-border/60`,children:[(0,W.jsxs)(`div`,{className:`px-4 py-4 sm:px-5`,children:[(0,W.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-3xs font-semibold uppercase tracking-widest text-muted-foreground/70`,children:[(0,W.jsx)(`span`,{className:`flex size-6 items-center justify-center rounded-md bg-muted/60`,children:(0,W.jsx)(p,{className:`size-3.5`})}),`Host state`]}),ce&&D?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(X,{label:`Power source`,value:Be(D.power.onBattery,{true:`Battery`,false:`External power`})}),(0,W.jsx)(X,{label:`Low power mode`,value:Be(D.power.lowPowerMode,{true:`Enabled`,false:`Disabled`})}),(0,W.jsx)(X,{label:`Idle`,value:`${Be(D.power.idle,{true:`Idle`,false:`Active`})}${D.power.idleSeconds===null?``:` · ${Math.round(D.power.idleSeconds)}s`}`}),(0,W.jsx)(X,{label:`Session`,value:D.power.suspended?`Suspended`:Be(D.power.locked,{true:`Locked`,false:`Unlocked`})}),(0,W.jsx)(X,{label:`Thermal`,value:D.power.thermalState,valueClassName:D.power.thermalState===`serious`||D.power.thermalState===`critical`?`text-destructive`:void 0})]}):(0,W.jsxs)(`div`,{className:`rounded-xl border border-dashed border-border/70 bg-muted/20 px-4 py-5`,children:[(0,W.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:`Desktop host signals not connected`}),(0,W.jsx)(`p`,{className:`mt-1.5 max-w-sm text-2xs leading-relaxed text-muted-foreground/70`,children:`Power, idle, lock, and thermal state are supplied by the desktop host. Process telemetry remains fully active in this browser session.`})]})]}),(0,W.jsxs)(`div`,{className:`border-t border-border/60 px-4 py-4 md:border-t-0 sm:px-5`,children:[(0,W.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-3xs font-semibold uppercase tracking-widest text-muted-foreground/70`,children:[(0,W.jsx)(`span`,{className:`flex size-6 items-center justify-center rounded-md bg-muted/60`,children:(0,W.jsx)(l,{className:`size-3.5`})}),`Collection health`]}),D?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Ke,{label:`Native process monitor`,health:D.health.native}),(0,W.jsx)(Ke,{label:`Electron main process`,health:D.health.desktop}),(0,W.jsx)(X,{label:`Collection time`,value:Me(D.health.collectionDurationMicros)}),(0,W.jsx)(X,{label:`Process scan`,value:`${D.health.retainedProcessCount}/${D.health.scannedProcessCount} retained`}),(0,W.jsx)(X,{label:`Inaccessible`,value:String(D.health.inaccessibleProcessCount),valueClassName:D.health.inaccessibleProcessCount>0?`text-warning-foreground`:void 0}),(0,W.jsx)(X,{label:`Sidecar`,value:b(D.health.sidecarVersion,{onNone:()=>`Unavailable`,onSome:e=>`${e}${b(D.health.sidecarPid,{onNone:()=>``,onSome:e=>` · PID ${e}`})}`})}),(0,W.jsx)(X,{label:`Restarts`,value:String(D.health.restartCount)})]}):(0,W.jsx)(`div`,{className:`py-4 text-xs text-muted-foreground`,children:`Waiting for collector health.`})]})]})}),(0,W.jsx)(B,{title:`Resource timeline`,icon:(0,W.jsx)(o,{className:`size-4 text-muted-foreground`}),headerAction:(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(Xe,{selectedWindowMs:t,onSelect:n}),(0,W.jsx)(m,{size:`icon-micro`,variant:`ghost`,disabled:u.isPending,onClick:u.refresh,"aria-label":`Refresh resource history`,children:(0,W.jsx)(V,{size:`xs`,refreshing:u.isPending})})]}),children:(0,W.jsxs)(`div`,{className:`overflow-hidden rounded-[inherit]`,children:[u.error?(0,W.jsxs)(`div`,{className:`flex items-start gap-2 border-b border-destructive/20 bg-destructive/5 px-4 py-3 text-xs text-destructive sm:px-5`,children:[(0,W.jsx)(v,{className:`mt-0.5 size-3.5 shrink-0`}),(0,W.jsx)(`span`,{children:u.error})]}):null,(0,W.jsx)(Qe,{buckets:u.data?.buckets??[]}),(0,W.jsx)(at,{processes:u.data?.topProcesses??[]})]})}),(0,W.jsx)(B,{title:`Live process tree`,icon:(0,W.jsx)(h,{className:`size-4 text-muted-foreground`}),headerAction:D?(0,W.jsxs)(`span`,{className:`text-3xs text-muted-foreground/55`,children:[`Identity: `,(0,W.jsx)(`span`,{className:`font-mono`,children:`PID + start time`})]}):null,children:(0,W.jsx)(`div`,{className:`overflow-hidden rounded-[inherit]`,children:(0,W.jsx)(rt,{processes:D?.processes??[],canMaintainEnvironment:a,signalingKeys:S,onSignal:A})})}),(0,W.jsx)(B,{title:`Instrumented application I/O`,icon:(0,W.jsx)(g,{className:`size-4 text-muted-foreground`}),headerAction:(0,W.jsx)(`span`,{className:`text-3xs text-muted-foreground/55`,children:`Logical bytes by operation`}),children:(0,W.jsxs)(`div`,{className:`overflow-hidden rounded-[inherit]`,children:[(0,W.jsx)(`div`,{className:`bg-muted/15 px-4 py-3 text-2xs leading-relaxed text-muted-foreground sm:px-5`,children:`Native counters identify which process is reading or writing. These application-level counters identify known P4 Code operations so process spikes can be correlated with specific persistence and logging paths.`}),(0,W.jsx)(st,{entries:D?.attribution.entries??[]})]})})]})}var ut=[{key:`otlpTracesUrl`,label:`Traces`,signal:`traces`},{key:`otlpMetricsUrl`,label:`Metrics`,signal:`metrics`},{key:`otlpLogsUrl`,label:`Logs`,signal:`logs`}],dt=e=>/^https?:\/\/./i.test(e);function ft(e,t){if(e===``)return{label:`Off`,dot:`bg-muted-foreground/40`};if(t?.url!==e)return{label:`Not checked`,dot:`bg-muted-foreground/40`};let{result:n}=t;if(n===null)return{label:`Checking…`,dot:`bg-warning`};switch(n._tag){case`Accepted`:return{label:`Connected · ${Math.round(n.latencyMs)} ms`,dot:`bg-success`};case`Rejected`:return{label:`Rejected · HTTP ${n.status}`,dot:`bg-destructive`};case`Unreachable`:return{label:n.timedOut?`Timed out`:`Unreachable`,dot:`bg-destructive`}}}function pt(){let e=(0,U.c)(3),{environment:t,scope:n}=he();if(n.kind!==`environment`||!t){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,W.jsx)(B,{title:`OpenTelemetry export`,id:`telemetry-export`,children:(0,W.jsx)(Ce,{target:`environment`,children:`Choose one environment to configure its telemetry exports.`})}),e[0]=t):t=e[0],t}let r;return e[1]===t.environmentId?r=e[2]:(r=(0,W.jsx)(mt,{},t.environmentId),e[1]=t.environmentId,e[2]=r),r}function mt(){let{environment:e}=he(),t=me(e=>e.observability),[n,r]=(0,G.useState)({}),[i,a]=(0,G.useState)(!1),[o,c]=(0,G.useState)(null),l=e?.environmentId,u=s(M.checkOtlpEndpoint.permissionAtom(l??null)),d=u&&e?.serverConfig?.environment.capabilities.otlpEndpointCheck===!0,[f,p]=(0,G.useState)(()=>Object.fromEntries(ut.filter(({key:e})=>dt(t[e])).map(({key:e})=>[e,{url:t[e],result:null}]))),h=se(M.updateSettings,{reportFailure:!0}),g=se(M.checkOtlpEndpoint),_={...t,...n},v=ut.filter(({key:e})=>_[e].trim()!==t[e]),y=v.length>0,b=e?.serverConfig?.observability,x=async(e,t,n)=>{if(!l)return;let r=await g({environmentId:l,input:{signal:t,url:n}});p(t=>{if(t[e]?.url!==n||t[e].result!==null)return t;let i={...t};return r._tag===`Success`?i[e]={url:n,result:r.value}:delete i[e],i})},S=(e,t,n)=>{dt(n)&&(p(t=>({...t,[e]:{url:n,result:null}})),x(e,t,n))},ee=(0,G.useEffectEvent)(()=>{for(let{key:e,signal:t}of ut){let n=f[e];n?.result===null&&x(e,t,n.url)}});return(0,G.useEffect)(()=>{d&&ee()},[d]),(0,W.jsx)(B,{title:`OpenTelemetry export`,id:`telemetry-export`,children:(0,W.jsxs)(`form`,{className:`grid gap-4 px-4 py-4 sm:px-5`,onSubmit:async t=>{if(t.preventDefault(),e&&!i){a(!0),c(null);try{(await h({environmentId:e.environmentId,input:{patch:{observability:Object.fromEntries(v.map(({key:e})=>[e,_[e]]))}}}))._tag===`Success`&&(r({}),c(`Saved. Restart the server to apply.`))}finally{a(!1)}}},children:[(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Send traces, metrics, and logs to an OTLP HTTP receiver. Restart the server to apply. Environment variables override these settings.`}),!u&&(0,W.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`This connection lacks permission to change settings on`,` `,e?.label??`the selected environment`,`.`]}),ut.map(({key:e,label:n,signal:a})=>{let o=_[e].trim(),s=d?ft(o,f[e]):null;return(0,W.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[s&&(0,W.jsx)(ve,{dotClassName:s.dot}),(0,W.jsxs)(be,{htmlFor:e,children:[n,` endpoint`]})]}),s&&(0,W.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:s.label})]}),(0,W.jsxs)(`div`,{className:`flex gap-2`,children:[(0,W.jsx)(pe,{id:e,size:`sm`,type:`url`,pattern:`[Hh][Tt][Tt][Pp][Ss]?://.*`,title:`Enter an HTTP or HTTPS endpoint, or leave empty to disable export.`,placeholder:`http://localhost:4318/v1/${a}`,value:_[e],disabled:i||!u,onChange:n=>{let i=n.target.value;r(n=>{let r={...n,[e]:i};return i.trim()===t[e]&&delete r[e],r}),c(null)}}),d&&(0,W.jsx)(m,{type:`button`,size:`sm`,variant:`outline`,disabled:!dt(o)||f[e]?.result===null,onClick:()=>void S(e,a,o),children:`Test`})]}),t[e]!==(b?.[e]??``)&&(0,W.jsxs)(`p`,{className:`break-all text-xs text-muted-foreground`,children:[`Running: `,b?.[e]||`Disabled`]})]},e)}),(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,W.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:o}),(0,W.jsxs)(`div`,{className:`flex shrink-0 gap-2`,children:[(0,W.jsx)(m,{type:`button`,size:`xs`,variant:`outline`,disabled:!y||i||!u,onClick:()=>{if(r({}),c(null),d)for(let{key:e,signal:n}of ut)f[e]?.url!==t[e]&&S(e,n,t[e])},children:`Discard`}),(0,W.jsx)(m,{type:`submit`,size:`xs`,disabled:!y||i||!u,children:i?`Saving…`:`Save`})]})]})]})})}var ht=new Intl.NumberFormat;function Z(e){return ht.format(e)}function Q(e){return e<1e3?`${Math.round(e)} ms`:`${(e/1e3).toFixed(e>=1e4?1:2).replace(/\.0+$/,``)} s`}function gt(e){return e?le(C(e)):`No trace records`}function _t(e){return gt(e).replaceAll(` `,`\xA0`)}function vt(e){return e.length<=32?e:`${e.slice(0,18)}...${e.slice(-10)}`}function yt(e){return e?.includes(`not a live descendant`)??!1}function $(e){let t=(0,U.c)(17),{label:n,value:r,tooltip:i,tone:a}=e,o=a===void 0?`default`:a,s;t[0]===n?s=t[1]:(s=(0,W.jsx)(`span`,{className:`min-w-0 truncate`,children:n}),t[0]=n,t[1]=s);let l;t[2]!==n||t[3]!==i?(l=i?(0,W.jsxs)(R,{children:[(0,W.jsx)(I,{render:(0,W.jsx)(`button`,{type:`button`,className:`cursor-pointer inline-flex size-3.5 shrink-0 items-center justify-center rounded-sm text-muted-foreground/60 hover:text-foreground`,"aria-label":`${n} details`,children:(0,W.jsx)(c,{className:`size-3`})})}),(0,W.jsx)(L,{side:`top`,children:i})]}):null,t[2]=n,t[3]=i,t[4]=l):l=t[4];let u;t[5]!==s||t[6]!==l?(u=(0,W.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5 text-2xs font-medium uppercase tracking-widest text-muted-foreground/70`,children:[s,l]}),t[5]=s,t[6]=l,t[7]=u):u=t[7];let d=o===`warning`&&`text-warning-foreground`,f=o===`danger`&&`text-destructive`,p;t[8]!==d||t[9]!==f?(p=_(`mt-1 truncate font-mono text-lg font-semibold tabular-nums text-foreground`,d,f),t[8]=d,t[9]=f,t[10]=p):p=t[10];let m;t[11]!==p||t[12]!==r?(m=(0,W.jsx)(`div`,{className:p,children:r}),t[11]=p,t[12]=r,t[13]=m):m=t[13];let h;return t[14]!==u||t[15]!==m?(h=(0,W.jsxs)(`div`,{className:`min-w-0 border-border/60 px-4 py-3 sm:px-5`,children:[u,m]}),t[14]=u,t[15]=m,t[16]=h):h=t[16],h}function bt(e){let t=(0,U.c)(6),{children:n}=e,r,i,a,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,W.jsx)(`span`,{className:`pointer-events-none absolute inset-y-0 left-1/2 w-px bg-border/60`,"aria-hidden":!0}),i=(0,W.jsx)(`span`,{className:`pointer-events-none absolute inset-x-0 top-1/2 h-px bg-border/60 sm:hidden`,"aria-hidden":!0}),a=(0,W.jsx)(`span`,{className:`pointer-events-none absolute inset-y-0 left-1/4 hidden w-px bg-border/60 sm:block`,"aria-hidden":!0}),o=(0,W.jsx)(`span`,{className:`pointer-events-none absolute inset-y-0 left-3/4 hidden w-px bg-border/60 sm:block`,"aria-hidden":!0}),t[0]=r,t[1]=i,t[2]=a,t[3]=o):(r=t[0],i=t[1],a=t[2],o=t[3]);let s;return t[4]===n?s=t[5]:(s=(0,W.jsxs)(`div`,{className:`relative grid grid-cols-2 sm:grid-cols-4`,children:[r,i,a,o,n]}),t[4]=n,t[5]=s),s}function xt(e){let t=(0,U.c)(2),{label:n}=e,r;return t[0]===n?r=t[1]:(r=(0,W.jsx)(`div`,{className:`px-4 py-4 text-xs text-muted-foreground sm:px-5`,children:n}),t[0]=n,t[1]=r),r}function St(e){let t=(0,U.c)(21),{headers:n,children:r,minTableWidth:i,columnWidths:a}=e,o=i===void 0?`min-w-[640px]`:i,s=a&&`table-fixed`,c;t[0]!==o||t[1]!==s?(c=_(`w-full text-left text-xs`,o,s),t[0]=o,t[1]=s,t[2]=c):c=t[2];let l;t[3]!==a||t[4]!==n?(l=a?(0,W.jsx)(`colgroup`,{children:n.map((e,t)=>(0,W.jsx)(`col`,{className:a[t]},e))}):null,t[3]=a,t[4]=n,t[5]=l):l=t[5];let u;if(t[6]!==a||t[7]!==n){let e;t[9]!==a||t[10]!==n.length?(e=(e,t)=>(0,W.jsx)(`th`,{className:_(`whitespace-nowrap px-4 py-2.5 font-semibold first:sm:pl-5 last:sm:pr-5`,!a&&t===n.length-1&&`w-px`),children:e.replaceAll(` `,`\xA0`)},e),t[9]=a,t[10]=n.length,t[11]=e):e=t[11],u=n.map(e),t[6]=a,t[7]=n,t[8]=u}else u=t[8];let d;t[12]===u?d=t[13]:(d=(0,W.jsx)(`thead`,{className:`border-b border-border/60 text-2xs uppercase tracking-widest text-muted-foreground/70`,children:(0,W.jsx)(`tr`,{children:u})}),t[12]=u,t[13]=d);let f;t[14]===r?f=t[15]:(f=(0,W.jsx)(`tbody`,{className:`divide-y divide-border/60`,children:r}),t[14]=r,t[15]=f);let p;return t[16]!==c||t[17]!==l||t[18]!==d||t[19]!==f?(p=(0,W.jsx)(z,{radius:`none`,chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`w-full max-w-full`,children:(0,W.jsxs)(`table`,{className:c,children:[l,d,f]})}),t[16]=c,t[17]=l,t[18]=d,t[19]=f,t[20]=p):p=t[20],p}function Ct(e){let t=(0,U.c)(25),{traceId:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={target:`trace ID`,timeout:1200},t[0]=r):r=t[0];let{copyToClipboard:i,isCopied:o}=A(r),s;t[1]===n?s=t[2]:(s=vt(n),t[1]=n,t[2]=s);let c;t[3]===s?c=t[4]:(c=(0,W.jsx)(I,{render:(0,W.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-2xs`,children:s})}),t[3]=s,t[4]=c);let l;t[5]===n?l=t[6]:(l=(0,W.jsx)(L,{side:`top`,variant:`code`,children:n}),t[5]=n,t[6]=l);let u;t[7]!==c||t[8]!==l?(u=(0,W.jsxs)(R,{children:[c,l]}),t[7]=c,t[8]=l,t[9]=u):u=t[9];let d=o?`Copied trace ID`:`Copy trace ID`,f;t[10]!==i||t[11]!==n?(f=()=>i(n),t[10]=i,t[11]=n,t[12]=f):f=t[12];let p;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,W.jsx)(a,{className:`size-3`}),t[13]=p):p=t[13];let h;t[14]!==d||t[15]!==f?(h=(0,W.jsx)(I,{render:(0,W.jsx)(m,{size:`icon-micro`,variant:`ghost-muted`,"aria-label":d,onClick:f,children:p})}),t[14]=d,t[15]=f,t[16]=h):h=t[16];let g=o?`Copied`:`Copy full trace ID`,_;t[17]===g?_=t[18]:(_=(0,W.jsx)(L,{side:`top`,children:g}),t[17]=g,t[18]=_);let v;t[19]!==_||t[20]!==h?(v=(0,W.jsxs)(R,{children:[h,_]}),t[19]=_,t[20]=h,t[21]=v):v=t[21];let y;return t[22]!==v||t[23]!==u?(y=(0,W.jsxs)(`div`,{className:`flex w-full min-w-0 max-w-full items-center gap-2`,children:[u,v]}),t[22]=v,t[23]=u,t[24]=y):y=t[24],y}function wt(e){let t=e.trim().split(/\s+/)[0];if(!t)return e;let n=t.replace(/^['"]|['"]$/g,``);return n.split(/[\\/]/).filter(Boolean).at(-1)??n}function Tt(e){return e.depth>0?`Subprocess`:/\b(codex|claude|opencode|cursor)\b/i.test(e.command)?`Agent`:`Process`}function Et(e){let t=(0,U.c)(22),{process:n,isExpanded:r,onToggle:i}=e,a;t[0]===n.command?a=t[1]:(a=wt(n.command),t[0]=n.command,t[1]=a);let o=a,s=n.childPids.length>0,c=`${Math.min(n.depth,6)*10}px`,l;t[2]===c?l=t[3]:(l={paddingLeft:c},t[2]=c,t[3]=l);let u;t[4]!==s||t[5]!==r||t[6]!==o||t[7]!==i||t[8]!==n.pid?(u=s?(0,W.jsx)(m,{size:`icon-micro`,variant:`ghost-muted`,"aria-label":r?`Collapse ${o}`:`Expand ${o}`,onClick:()=>i(n.pid),children:(0,W.jsx)(O,{className:`size-3.5`,icon:r?D:E})}):(0,W.jsx)(`span`,{className:`size-5 shrink-0`,"aria-hidden":`true`}),t[4]=s,t[5]=r,t[6]=o,t[7]=i,t[8]=n.pid,t[9]=u):u=t[9];let d;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,W.jsx)(`span`,{className:`size-1.5 shrink-0 rounded-full bg-success/80`}),t[10]=d):d=t[10];let f;t[11]===o?f=t[12]:(f=(0,W.jsx)(I,{render:(0,W.jsx)(`span`,{className:`min-w-0 truncate font-medium text-foreground`,children:o})}),t[11]=o,t[12]=f);let p;t[13]===n.command?p=t[14]:(p=(0,W.jsx)(L,{side:`top`,variant:`code`,children:n.command}),t[13]=n.command,t[14]=p);let h;t[15]!==f||t[16]!==p?(h=(0,W.jsxs)(R,{children:[f,p]}),t[15]=f,t[16]=p,t[17]=h):h=t[17];let g;return t[18]!==l||t[19]!==u||t[20]!==h?(g=(0,W.jsxs)(`div`,{className:`grid min-w-0 grid-cols-[1.25rem_0.375rem_minmax(0,1fr)] items-center gap-2`,style:l,children:[u,d,h]}),t[18]=l,t[19]=u,t[20]=h,t[21]=g):g=t[21],g}function Dt(e){let t=(0,U.c)(18),{processes:n,canMaintainEnvironment:r,signalingPid:i,onSignal:a,emptyLabel:o}=e,[s,c]=(0,G.useState)(Ot),l;if(t[0]!==s||t[1]!==n){l=[];let e=null;for(let t of n){if(e!==null){if(t.depth>e)continue;e=null}l.push(t),s.has(t.pid)&&(e=t.depth)}t[0]=s,t[1]=n,t[2]=l}else l=t[2];let u=l,d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=e=>{c(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},t[3]=d):d=t[3];let f=d,p;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,W.jsxs)(`colgroup`,{children:[(0,W.jsx)(`col`,{className:`w-[24%]`}),(0,W.jsx)(`col`,{className:`w-[8%]`}),(0,W.jsx)(`col`,{className:`w-[10%]`}),(0,W.jsx)(`col`,{className:`w-[33%]`}),(0,W.jsx)(`col`,{className:`w-[8%]`}),(0,W.jsx)(`col`,{className:`w-[11%]`}),(0,W.jsx)(`col`,{className:`w-[6%]`})]}),t[4]=p):p=t[4];let m;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,W.jsx)(`thead`,{className:`sticky top-0 z-10 border-b border-border/60 bg-card text-2xs uppercase tracking-widest text-muted-foreground/70`,children:(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Name`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Memory`}),(0,W.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Command`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`PID`}),(0,W.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Type`}),(0,W.jsx)(`th`,{className:`p-2 text-right font-semibold sm:pr-4`,children:`Kill`})]})}),t[5]=m):m=t[5];let h;t[6]!==o||t[7]!==u.length?(h=u.length===0?(0,W.jsx)(`tr`,{children:(0,W.jsx)(`td`,{colSpan:7,className:`px-4 py-4 text-xs text-muted-foreground sm:px-5`,children:o??`No live descendant processes found.`})}):null,t[6]=o,t[7]=u.length,t[8]=h):h=t[8];let g;t[9]!==r||t[10]!==s||t[11]!==a||t[12]!==i||t[13]!==u?(g=u.map(e=>(0,W.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,W.jsx)(`td`,{className:`px-4 py-2 align-middle sm:pl-5`,children:(0,W.jsx)(Et,{process:e,isExpanded:!s.has(e.pid),onToggle:f})}),(0,W.jsxs)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:[e.cpuPercent.toFixed(1),`%`]}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:H(e.rssBytes)}),(0,W.jsx)(`td`,{className:`px-3 py-2 align-middle text-muted-foreground`,children:(0,W.jsxs)(R,{children:[(0,W.jsx)(I,{render:(0,W.jsx)(`span`,{className:`block truncate`,children:e.command})}),(0,W.jsx)(L,{side:`top`,variant:`code`,children:e.command})]})}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums text-muted-foreground`,children:e.pid}),(0,W.jsx)(`td`,{className:`truncate px-3 py-2 align-middle text-muted-foreground`,children:Tt(e)}),(0,W.jsx)(`td`,{className:`p-2 align-middle sm:pr-4`,children:(0,W.jsx)(we,{disabled:!r||i===e.pid,onSignal:t=>a(e.pid,t)})})]},e.pid)),t[9]=r,t[10]=s,t[11]=a,t[12]=i,t[13]=u,t[14]=g):g=t[14];let _;return t[15]!==h||t[16]!==g?(_=(0,W.jsx)(`div`,{className:`border-t border-border/60`,children:(0,W.jsx)(z,{radius:`none`,chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`max-h-[min(64vh,44rem)] w-full max-w-full`,children:(0,W.jsxs)(`table`,{className:`w-full min-w-[1040px] table-fixed text-left text-xs`,children:[p,m,(0,W.jsxs)(`tbody`,{className:`divide-y divide-border/50`,children:[h,g]})]})})}),t[15]=h,t[16]=g,t[17]=_):_=t[17],_}function Ot(){return new Set}var kt=[{label:`5m`,windowMs:3e5,bucketMs:3e4},{label:`15m`,windowMs:9e5,bucketMs:6e4},{label:`30m`,windowMs:18e5,bucketMs:12e4},{label:`1h`,windowMs:36e5,bucketMs:3e5}];function At(e){if(e<60)return`${e.toFixed(e>=10?1:2).replace(/\.0+$/,``)}s`;let t=e/60;return t<60?`${t.toFixed(t>=10?1:2).replace(/\.0+$/,``)}m`:`${(t/60).toFixed(2).replace(/\.0+$/,``)}h`}function jt(e){let t=wt(e);return t.length>42?`${t.slice(0,39)}...`:t}function Mt(e){let t=(0,U.c)(21),{process:n,visualDepth:r}=e,i;t[0]===n.command?i=t[1]:(i=jt(n.command),t[0]=n.command,t[1]=i);let a=i,o=`${Math.min(r,6)*10}px`,s;t[2]===o?s=t[3]:(s={paddingLeft:o},t[2]=o,t[3]=s);let c=`${n.isServerRoot?`Root`:`Child`} process ${a}`,l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,W.jsx)(`span`,{className:`size-5 shrink-0`,"aria-hidden":`true`}),t[4]=l):l=t[4];let u=n.isServerRoot?`bg-warning/90`:`bg-success/80`,d;t[5]===u?d=t[6]:(d=_(`size-1.5 shrink-0 rounded-full`,u),t[5]=u,t[6]=d);let f;t[7]===d?f=t[8]:(f=(0,W.jsx)(`span`,{className:d}),t[7]=d,t[8]=f);let p;t[9]===a?p=t[10]:(p=(0,W.jsx)(I,{render:(0,W.jsx)(`span`,{className:`min-w-0 truncate font-medium text-foreground`,children:a})}),t[9]=a,t[10]=p);let m;t[11]===n.command?m=t[12]:(m=(0,W.jsx)(L,{side:`top`,variant:`code`,children:n.command}),t[11]=n.command,t[12]=m);let h;t[13]!==m||t[14]!==p?(h=(0,W.jsxs)(R,{children:[p,m]}),t[13]=m,t[14]=p,t[15]=h):h=t[15];let g;return t[16]!==h||t[17]!==s||t[18]!==c||t[19]!==f?(g=(0,W.jsxs)(`div`,{className:`grid min-w-0 grid-cols-[1.25rem_0.375rem_minmax(0,1fr)] items-center gap-2`,style:s,"aria-label":c,children:[l,f,h]}),t[16]=h,t[17]=s,t[18]=c,t[19]=f,t[20]=g):g=t[20],g}function Nt(e){let t=(0,U.c)(9),{buckets:n}=e,r;t[0]===n?r=t[1]:(r=Math.max(1,...n.map(Pt)),t[0]=n,t[1]=r);let i=r,a;if(t[2]!==n||t[3]!==i){let e;t[5]===i?e=t[6]:(e=e=>{let t=Math.max(2,e.maxCpuPercent/i*100),n=Math.max(2,e.avgCpuPercent/i*100);return(0,W.jsxs)(R,{children:[(0,W.jsx)(I,{render:(0,W.jsx)(`div`,{className:`flex h-full min-w-1 flex-1 items-end`,children:(0,W.jsxs)(`div`,{className:`relative h-full w-full`,"aria-label":`Average CPU ${e.avgCpuPercent.toFixed(1)}%, peak CPU ${e.maxCpuPercent.toFixed(1)}%`,children:[(0,W.jsx)(`div`,{className:`absolute inset-x-0 bottom-0 rounded-t-sm bg-foreground/15 transition-colors`,style:{height:`${t}%`}}),(0,W.jsx)(`div`,{className:`absolute inset-x-0 bottom-0 rounded-t-sm bg-foreground/60 transition-colors`,style:{height:`${n}%`}})]})})}),(0,W.jsxs)(L,{side:`top`,children:[`Avg `,e.avgCpuPercent.toFixed(1),`%, peak `,e.maxCpuPercent.toFixed(1),`%`]})]},C(e.startedAt))},t[5]=i,t[6]=e),a=n.map(e),t[2]=n,t[3]=i,t[4]=a}else a=t[4];let o;return t[7]===a?o=t[8]:(o=(0,W.jsx)(`div`,{className:`border-t border-border/60 px-4 py-3 sm:px-5`,children:(0,W.jsx)(`div`,{className:`flex h-28 items-end gap-1 overflow-hidden rounded-sm bg-muted/10 p-2`,children:a})}),t[7]=a,t[8]=o),o}function Pt(e){return e.maxCpuPercent}function Ft(e){let t=(0,U.c)(8),{selectedWindowMs:n,onSelect:r}=e,i=String(n),a;t[0]===i?a=t[1]:(a=[i],t[0]=i,t[1]=a);let o;t[2]===r?o=t[3]:(o=e=>{let t=kt.find(t=>String(t.windowMs)===e[0]);t&&r(t.windowMs)},t[2]=r,t[3]=o);let s;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(s=kt.map(It),t[4]=s):s=t[4];let c;return t[5]!==a||t[6]!==o?(c=(0,W.jsx)(de,{"aria-label":`Process history period`,variant:`segmented`,value:a,onValueChange:o,children:s}),t[5]=a,t[6]=o,t[7]=c):c=t[7],c}function It(e){return(0,W.jsx)(fe,{value:String(e.windowMs),children:e.label},e.windowMs)}function Lt(e){let t=(0,U.c)(13),{processes:n,emptyLabel:r}=e,i=n.reduce(Rt,null),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,W.jsxs)(`colgroup`,{children:[(0,W.jsx)(`col`,{className:`w-[24%]`}),(0,W.jsx)(`col`,{className:`w-[10%]`}),(0,W.jsx)(`col`,{className:`w-[10%]`}),(0,W.jsx)(`col`,{className:`w-[10%]`}),(0,W.jsx)(`col`,{className:`w-[10%]`}),(0,W.jsx)(`col`,{className:`w-[10%]`}),(0,W.jsx)(`col`,{className:`w-[16%]`}),(0,W.jsx)(`col`,{className:`w-[10%]`})]}),t[0]=a):a=t[0];let o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,W.jsx)(`thead`,{className:`sticky top-0 z-10 border-b border-border/60 bg-card text-2xs uppercase tracking-widest text-muted-foreground/70`,children:(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Process`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU Time`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Current`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Average`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Peak`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Max Mem`}),(0,W.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Command`}),(0,W.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold sm:pr-5`,children:`PID`})]})}),t[1]=o):o=t[1];let s;t[2]!==r||t[3]!==n.length?(s=n.length===0?(0,W.jsx)(`tr`,{children:(0,W.jsx)(`td`,{colSpan:8,className:`px-4 py-4 text-xs text-muted-foreground sm:px-5`,children:r})}):null,t[2]=r,t[3]=n.length,t[4]=s):s=t[4];let c;if(t[5]!==n||t[6]!==i){let e;t[8]===i?e=t[9]:(e=e=>(0,W.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,W.jsx)(`td`,{className:`px-4 py-2 align-middle sm:pl-5`,children:(0,W.jsx)(Mt,{process:e,visualDepth:e.isServerRoot||i===null?0:Math.max(1,e.depth-i+1)})}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:At(e.cpuSecondsApprox)}),(0,W.jsxs)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:[e.currentCpuPercent.toFixed(1),`%`]}),(0,W.jsxs)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:[e.avgCpuPercent.toFixed(1),`%`]}),(0,W.jsxs)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:[e.maxCpuPercent.toFixed(1),`%`]}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:H(e.maxRssBytes)}),(0,W.jsx)(`td`,{className:`px-3 py-2 align-middle text-muted-foreground`,children:(0,W.jsxs)(R,{children:[(0,W.jsx)(I,{render:(0,W.jsx)(`span`,{className:`block truncate`,children:e.command})}),(0,W.jsx)(L,{side:`top`,variant:`code`,children:e.command})]})}),(0,W.jsx)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums text-muted-foreground sm:pr-5`,children:e.pid})]},e.processKey),t[8]=i,t[9]=e),c=n.map(e),t[5]=n,t[6]=i,t[7]=c}else c=t[7];let l;return t[10]!==s||t[11]!==c?(l=(0,W.jsx)(`div`,{className:`border-t border-border/60`,children:(0,W.jsx)(z,{chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`max-h-[min(64vh,44rem)] w-full max-w-full`,children:(0,W.jsxs)(`table`,{className:`w-full min-w-[980px] table-fixed text-left text-xs`,children:[a,o,(0,W.jsxs)(`tbody`,{className:`divide-y divide-border/50`,children:[s,c]})]})})}),t[10]=s,t[11]=c,t[12]=l):l=t[12],l}function Rt(e,t){return t.isServerRoot?e:e===null?t.depth:Math.min(e,t.depth)}function zt(e){let t=(0,U.c)(7),{checkedAt:n}=e;_e();let r;t[0]===n?r=t[1]:(r=ue(n?C(n):null),t[0]=n,t[1]=r);let i=r;if(i.status===`missing`){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,W.jsx)(`span`,{className:`text-2xs text-muted-foreground/50`,children:`Checking`}),t[2]=e):e=t[2],e}if(i.status===`invalid`){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,W.jsx)(`span`,{className:`text-2xs text-muted-foreground/50`,children:`Checked unavailable`}),t[3]=e):e=t[3],e}let a;return t[4]!==i.suffix||t[5]!==i.value?(a=(0,W.jsx)(`span`,{className:`text-2xs text-muted-foreground/60`,children:i.suffix?(0,W.jsxs)(W.Fragment,{children:[`Checked `,(0,W.jsx)(`span`,{className:`font-mono tabular-nums`,children:i.value}),` `,i.suffix]}):(0,W.jsxs)(W.Fragment,{children:[`Checked `,i.value]})}),t[4]=i.suffix,t[5]=i.value,t[6]=a):a=t[6],a}function Bt(e){let t=(0,U.c)(12),{isPending:n,label:r,onClick:i}=e,a;t[0]===n?a=t[1]:(a=(0,W.jsx)(V,{refreshing:n}),t[0]=n,t[1]=a);let o;t[2]!==n||t[3]!==r||t[4]!==i||t[5]!==a?(o=(0,W.jsx)(I,{render:(0,W.jsx)(m,{size:`icon-xs`,variant:`ghost-muted`,disabled:n,onClick:i,"aria-label":r,children:a})}),t[2]=n,t[3]=r,t[4]=i,t[5]=a,t[6]=o):o=t[6];let s;t[7]===r?s=t[8]:(s=(0,W.jsx)(L,{side:`top`,children:r}),t[7]=r,t[8]=s);let c;return t[9]!==o||t[10]!==s?(c=(0,W.jsxs)(R,{children:[o,s]}),t[9]=o,t[10]=s,t[11]=c):c=t[11],c}function Vt(){let{environment:e}=he(),t=e?.environmentId??null,n=oe(t,y),r=e?.serverConfig?.observability,i=e?.serverConfig?.availableEditors,a=oe(t,w),o=F(t===null?null:P.sessionStateAtom(t)),s=xe({connectionPhase:e?.connection.phase??`available`,session:o.data,hasSessionError:o.error!==null}),c=s.canReadDiagnostics,l=se(M.signalProcess,{reportFailure:!1}),d=ye(t,i??[]),[f,p]=(0,G.useState)(9e5),h=kt.find(e=>e.windowMs===f)??kt[1],{data:g,error:b,isPending:x,refresh:S}=F(t===null||!c?null:M.traceDiagnostics({environmentId:t,input:{}})),{data:T,error:E,isPending:D,refresh:O}=F(t===null||!c?null:M.processDiagnostics({environmentId:t,input:{}})),{data:A,error:j,isPending:ce,refresh:le}=F(t===null||!c?null:M.processResourceHistory({environmentId:t,input:{windowMs:h.windowMs,bucketMs:h.bucketMs}})),[ue,de]=(0,G.useState)(!1),[fe,pe]=(0,G.useState)(null),[me,_e]=(0,G.useState)(null),ve=(0,G.useRef)(null),V=(0,G.useRef)(t),be=(0,G.useRef)(T);(0,G.useEffect)(()=>{be.current=T},[T]),(0,G.useEffect)(()=>(V.current=t,()=>{V.current=null}),[t]);let Ce=(0,G.useCallback)(()=>{let e=r?.logsDirectoryPath??null;e&&t!==null&&N(t,`orchestration:operate`)&&(de(!0),pe(null),(async()=>{let t=await d(e);if(de(!1),t._tag===`Failure`&&!ie(t)){let e=re(t);pe(e instanceof Error?e.message:`Unable to open logs folder.`)}})())},[t,r?.logsDirectoryPath,d]),U=x&&g===null,we=D&&T===null,Te=ce&&A===null,[Ee,De]=(0,G.useState)(null);Ee!==t&&c&&!U&&!we&&!Te&&De(t);let Oe=(0,G.useCallback)(async(e,t)=>{let n=V.current,r=be.current?.processes.find(t=>t.pid===e);if(n===null||r===void 0||!N(n,`environment:maintain`)||ve.current!==null)return;ve.current=e,_e(e);let i=()=>{ve.current=null,_e(null)};if(t===`SIGKILL`){let n=!1;try{n=await ae().dialogs.confirm(`Send SIGKILL to process ${e}? This cannot be handled by the process.`,{variant:`destructive`})}catch(e){i(),k.add({type:`error`,title:`Could not confirm signal`,description:e instanceof Error?e.message:`Failed to send ${t}.`});return}if(!n){i();return}}let a=V.current;if(a===null||a!==n||!N(a,`environment:maintain`))i();else if(be.current?.processes.find(t=>t.pid===e)?.startTimeMs!==r.startTimeMs)i();else try{let i=await l({environmentId:n,input:{pid:e,startTimeMs:r.startTimeMs,signal:t}});if(i._tag===`Failure`){if(!ie(i)){let e=re(i);k.add({type:`error`,title:`Could not send ${t}`,description:e instanceof Error?e.message:`Failed to send ${t}.`})}return}if(!i.value.signaled){let e=ne(i.value.message);if(O(),yt(e)){k.add({type:`info`,title:`Process already exited`,description:`The process is not a child of the P4 Code server. It might already have exited.`});return}k.add({type:`error`,title:`Could not send ${t}`,description:e??`Failed to send ${t}.`});return}O()}finally{i()}},[O,l]),ke=T?te(T.error):null,K=A?te(A.error):null,Ae=g?te(g.error):null,q=g?ee(g.partialFailure,()=>!1):!1;return c?(0,W.jsxs)(ge,{width:`expanded`,className:`gap-10`,children:[(0,W.jsx)(lt,{environmentId:t}),(0,W.jsxs)(B,{title:`Live Processes`,headerAction:(0,W.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,W.jsx)(zt,{checkedAt:T?.readAt??null}),(0,W.jsx)(Bt,{isPending:D,label:`Refresh process diagnostics`,onClick:O})]}),children:[(0,W.jsxs)(bt,{children:[(0,W.jsx)($,{label:`Child Processes`,value:T?Z(T.processCount):`...`}),(0,W.jsx)($,{label:`CPU`,value:T?`${T.totalCpuPercent.toFixed(1)}%`:`...`,tooltip:`Total CPU across live child processes of the current server process. The desktop shell and other parent processes are not included.`}),(0,W.jsx)($,{label:`Memory`,value:T?H(T.totalRssBytes):`...`,tooltip:`Total resident memory across live child processes of the current server process. The desktop shell and other parent processes are not included.`}),(0,W.jsx)($,{label:`Server PID`,value:T?String(T.serverPid):`...`})]}),ke||E?(0,W.jsxs)(`div`,{className:`space-y-2 border-t border-border/60 px-4 py-3 text-xs text-muted-foreground sm:px-5`,children:[ke?(0,W.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,W.jsx)(v,{className:`mt-0.5 size-3.5 shrink-0`}),(0,W.jsx)(`span`,{children:ke.message})]}):null,E?(0,W.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,W.jsx)(v,{className:`mt-0.5 size-3.5 shrink-0`}),(0,W.jsx)(`span`,{children:E})]}):null]}):null,(0,W.jsx)(Dt,{processes:T?.processes??[],canMaintainEnvironment:n,signalingPid:me,onSignal:Oe,emptyLabel:we?`Loading live processes...`:`No live descendant processes found.`})]}),(0,W.jsxs)(B,{title:`Resource History`,headerAction:(0,W.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,W.jsx)(Ft,{selectedWindowMs:f,onSelect:p}),(0,W.jsx)(zt,{checkedAt:A?.readAt??null}),(0,W.jsx)(Bt,{isPending:ce,label:`Refresh resource history`,onClick:le})]}),children:[(0,W.jsxs)(bt,{children:[(0,W.jsx)($,{label:`CPU Time`,value:A?At(A.totalCpuSecondsApprox):`...`,tooltip:`Approximate active CPU time for the P4 Code server root process and its descendants during the selected window. It grows only while sampled processes use CPU and older samples leave as the window moves.`}),(0,W.jsx)($,{label:`Samples`,value:A?Z(A.retainedSampleCount):`...`,tooltip:`In-memory process samples retained by the server. The server samples only while diagnostics is open, and this resets when the server restarts.`}),(0,W.jsx)($,{label:`Interval`,value:A?A.sampleIntervalMs===0?`On demand`:Q(A.sampleIntervalMs):`...`}),(0,W.jsx)($,{label:`Processes`,value:A?Z(A.topProcesses.length):`...`})]}),K||j?(0,W.jsxs)(`div`,{className:`space-y-2 border-t border-border/60 px-4 py-3 text-xs text-muted-foreground sm:px-5`,children:[K?(0,W.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,W.jsx)(v,{className:`mt-0.5 size-3.5 shrink-0`}),(0,W.jsx)(`span`,{children:K.message})]}):null,j?(0,W.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,W.jsx)(v,{className:`mt-0.5 size-3.5 shrink-0`}),(0,W.jsx)(`span`,{children:j})]}):null]}):null,(0,W.jsx)(Nt,{buckets:A?.buckets??[]}),(0,W.jsx)(Lt,{processes:A?.topProcesses??[],emptyLabel:Te?`Collecting process resource samples...`:`No process resource samples found for this window.`})]}),(0,W.jsxs)(B,{title:`Trace Diagnostics`,headerAction:(0,W.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,W.jsx)(zt,{checkedAt:g?.readAt??null}),(0,W.jsxs)(R,{children:[(0,W.jsx)(I,{render:(0,W.jsx)(m,{size:`icon-xs`,variant:`ghost-muted`,disabled:!a||!r?.logsDirectoryPath||ue,onClick:Ce,"aria-label":`Open logs folder`,children:(0,W.jsx)(u,{})})}),(0,W.jsx)(L,{side:`top`,children:`Open logs folder`})]}),(0,W.jsx)(Bt,{isPending:x,label:`Refresh trace diagnostics`,onClick:S})]}),children:[(0,W.jsxs)(bt,{children:[(0,W.jsx)($,{label:`Spans`,value:g?Z(g.recordCount):`...`}),(0,W.jsx)($,{label:`Failures`,value:g?Z(g.failureCount):`...`,tone:g&&g.failureCount>0?`danger`:`default`}),(0,W.jsx)($,{label:`Slow Spans`,value:g?Z(g.slowSpanCount):`...`,tooltip:g?`Spans with a duration of ${Q(g.slowSpanThresholdMs)} or longer.`:`Spans at or above the configured slow-span threshold.`,tone:g&&g.slowSpanCount>0?`warning`:`default`}),(0,W.jsx)($,{label:`Parse Errors`,value:g?Z(g.parseErrorCount):`...`,tone:g&&g.parseErrorCount>0?`warning`:`default`})]}),fe||Ae||b?(0,W.jsxs)(`div`,{className:`space-y-2 border-t border-border/60 px-4 py-3 text-xs text-muted-foreground sm:px-5`,children:[fe?(0,W.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,W.jsx)(v,{className:`mt-0.5 size-3.5 shrink-0`}),(0,W.jsx)(`span`,{children:fe})]}):null,Ae?(0,W.jsxs)(`div`,{className:_(`flex items-start gap-2`,q?`text-warning-foreground`:`text-destructive`),children:[(0,W.jsx)(v,{className:`mt-0.5 size-3.5 shrink-0`}),(0,W.jsx)(`span`,{children:q?`Some trace files could not be read, so diagnostics may be incomplete. ${Ae.message}`:Ae.message})]}):null,b?(0,W.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,W.jsx)(v,{className:`mt-0.5 size-3.5 shrink-0`}),(0,W.jsx)(`span`,{children:b})]}):null]}):null]}),(0,W.jsx)(B,{title:`Latest Failures`,children:g&&g.latestFailures.length>0?(0,W.jsx)(St,{headers:[`Span`,`Cause`,`Duration`,`Ended`],children:g.latestFailures.map(e=>(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`td`,{className:`px-4 py-3 align-top text-xs font-medium text-foreground first:sm:pl-5`,children:e.name}),(0,W.jsx)(`td`,{className:`max-w-[360px] px-4 py-3 align-top text-muted-foreground`,children:(0,W.jsx)(Se,{text:e.cause})}),(0,W.jsx)(`td`,{className:`px-4 py-3 align-top font-mono tabular-nums`,children:Q(e.durationMs)}),(0,W.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums text-muted-foreground last:sm:pr-5`,children:_t(e.endedAt)})]},`${e.traceId}:${e.spanId}`))}):(0,W.jsx)(xt,{label:U?`Loading failures...`:`No failed spans found.`})}),(0,W.jsx)(B,{title:`Most Common Failures`,children:g&&g.commonFailures.length>0?(0,W.jsx)(St,{headers:[`Span`,`Count`,`Cause`,`Last Seen`],minTableWidth:`min-w-[760px]`,children:g.commonFailures.map(e=>(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`td`,{className:`px-4 py-3 align-top text-xs font-medium text-foreground first:sm:pl-5`,children:e.name}),(0,W.jsx)(`td`,{className:`px-4 py-3 align-top font-mono tabular-nums`,children:Z(e.count)}),(0,W.jsx)(`td`,{className:`max-w-[360px] px-4 py-3 align-top text-muted-foreground`,children:(0,W.jsx)(Se,{text:e.cause})}),(0,W.jsx)(`td`,{className:`w-px whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums text-muted-foreground last:sm:pr-5`,children:_t(e.lastSeenAt)})]},`${e.name}:${e.cause}`))}):(0,W.jsx)(xt,{label:U?`Loading failure groups...`:`No repeated failures found.`})}),(0,W.jsx)(B,{title:`Slowest Spans`,children:g&&g.slowestSpans.length>0?(0,W.jsx)(St,{headers:[`Span`,`Duration`,`Ended`,`Trace`],minTableWidth:`min-w-[900px]`,columnWidths:[`w-[44%]`,`w-[14%]`,`w-[12%]`,`w-[30%]`],children:g.slowestSpans.map(e=>(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`td`,{className:`px-4 py-3 align-top text-xs font-medium text-foreground first:sm:pl-5`,children:e.name}),(0,W.jsx)(`td`,{className:`px-4 py-3 align-top font-mono tabular-nums`,children:Q(e.durationMs)}),(0,W.jsx)(`td`,{className:`w-px whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums text-muted-foreground`,children:_t(e.endedAt)}),(0,W.jsx)(`td`,{className:`min-w-0 whitespace-nowrap px-4 py-3 align-top text-muted-foreground last:sm:pr-5`,children:(0,W.jsx)(Ct,{traceId:e.traceId})})]},`${e.traceId}:${e.spanId}`))}):(0,W.jsx)(xt,{label:U?`Loading slow spans...`:`No spans found.`})}),(0,W.jsx)(B,{title:`Span Logs`,children:g&&g.latestWarningAndErrorLogs.length>0?(0,W.jsx)(z,{radius:`none`,chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`w-full max-w-full`,children:(0,W.jsxs)(`table`,{className:`w-full min-w-[920px] table-fixed text-left text-xs`,children:[(0,W.jsxs)(`colgroup`,{children:[(0,W.jsx)(`col`,{className:`w-[11%]`}),(0,W.jsx)(`col`,{className:`w-[9%]`}),(0,W.jsx)(`col`,{className:`w-[24%]`}),(0,W.jsx)(`col`,{className:`w-[26%]`}),(0,W.jsx)(`col`,{className:`w-[30%]`})]}),(0,W.jsx)(`thead`,{className:`border-b border-border/60 text-2xs uppercase tracking-widest text-muted-foreground/70`,children:(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold sm:pl-5`,children:`Time`}),(0,W.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold`,children:`Level`}),(0,W.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold`,children:`Span`}),(0,W.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold`,children:`Message`}),(0,W.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold sm:pr-5`,children:`Trace`})]})}),(0,W.jsx)(`tbody`,{className:`divide-y divide-border/60`,children:g.latestWarningAndErrorLogs.map(e=>(0,W.jsxs)(`tr`,{className:`hover:bg-muted/15`,children:[(0,W.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums text-muted-foreground sm:pl-5`,children:_t(e.seenAt)}),(0,W.jsx)(`td`,{className:`px-4 py-3 align-top`,children:(0,W.jsx)(`span`,{className:`inline-flex rounded bg-muted px-1.5 py-0.5 font-mono text-2xs font-medium uppercase text-foreground/80`,children:e.level})}),(0,W.jsx)(`td`,{className:`px-4 py-3 align-top`,children:(0,W.jsx)(`div`,{className:`truncate font-medium text-foreground`,children:e.spanName})}),(0,W.jsx)(`td`,{className:`px-4 py-3 align-top text-muted-foreground`,children:(0,W.jsx)(Se,{collapsedClassName:`line-clamp-2`,expandLabel:`Show full message`,text:e.message})}),(0,W.jsx)(`td`,{className:`min-w-0 whitespace-nowrap px-4 py-3 align-top text-muted-foreground sm:pr-5`,children:(0,W.jsx)(Ct,{traceId:e.traceId})})]},`${e.traceId}:${e.spanId}:${C(e.seenAt)}:${e.message}`))})]})}):(0,W.jsx)(xt,{label:U?`Loading recent logs...`:`No warnings or errors found.`})}),(0,W.jsx)(B,{title:`Top Span Names`,children:g&&g.topSpansByCount.length>0?(0,W.jsx)(St,{headers:[`Span`,`Count`,`Failures`,`Average`,`Max`],minTableWidth:`min-w-[760px]`,columnWidths:[`w-[48%]`,`w-[13%]`,`w-[13%]`,`w-[13%]`,`w-[13%]`],children:g.topSpansByCount.map(e=>(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`td`,{className:`px-4 py-3 align-top text-xs font-medium text-foreground first:sm:pl-5`,children:e.name}),(0,W.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums`,children:Z(e.count)}),(0,W.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums`,children:Z(e.failureCount)}),(0,W.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums`,children:Q(e.averageDurationMs)}),(0,W.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums last:sm:pr-5`,children:Q(e.maxDurationMs)})]},e.name))}):(0,W.jsx)(xt,{label:U?`Loading span names...`:`No spans found.`})}),Ee===t&&(0,W.jsx)(pt,{})]}):(0,W.jsx)(ge,{children:(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t===null?`Connect an environment to see diagnostics.`:s.isPending?`Checking diagnostics access…`:s.error})})}var Ht=Vt;export{Ht as component};
|
|
2
|
-
//# sourceMappingURL=settings.diagnostics-30yarj2c.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Ft as i,Lt as a,Rt as o,Ut as s,Wt as c,Xn as l,Xt as u,an as d,cu as f,hr as p,js as m,kl as h,mr as g,ou as _,su as v,t as y}from"./utils-sVhLpEl6.js";import{Cn as b,Ln as x,Oh as S,Rn as C,Th as w,vg as T}from"./src-upZEL2qH.js";import{a as E,i as D,n as O,r as k,t as A}from"./number-field-BRlzUJEB.js";import{a as j,c as M,o as N,s as P,t as F}from"./select-B3jSTp6e.js";import{t as ee}from"./useNavigate-DeDarx0_.js";import{a as te}from"./relay-Bjm0weca.js";import{F as ne,I as re,N as ie,P as ae,f as oe,z as se}from"./useSettings-DwDYuiOf.js";import{f as ce,t as le}from"./server-BjY-vKW2.js";import{n as ue}from"./query-C-5C8CaD.js";import{t as de}from"./use-atom-command-Dv8zTjOp.js";import{a as fe,n as pe,t as me}from"./tooltip-CZBiwhnV.js";import{t as I}from"./skeleton-M5MIqTy6.js";import{t as he}from"./textarea-Dk6r4lQ8.js";import{t as ge}from"./input-L7UBCORX.js";import{a as _e,i as ve,n as L,o as ye,r as be,t as xe}from"./empty-CGA6iTo1.js";import{t as R}from"./sourceControl-gpSCT1i6.js";import{g as Se,m as Ce}from"./Icons-CzUirT4o.js";import{n as we,t as Te}from"./sourceControlClients-YDf1HZkJ.js";import{n as z}from"./pullRequestIcons-CJzQ9q45.js";import{n as Ee,t as De}from"./RedactedSensitiveText-CKBxO8RE.js";import{B as Oe,L as ke,R as Ae,U as je,a as B,f as Me,i as Ne,n as Pe,o as Fe,r as Ie,s as Le,t as V}from"./settingsLayout-DbyBB8ZI.js";import{Fo as Re,Go as ze,Lr as H,Mo as Be,No as Ve,Rr as U,ha as He,kn as Ue}from"./main-CNs583QD.js";import{t as We}from"./ProviderModelPicker-Dj26-4yu.js";import{t as Ge}from"./useScopedModelAvailability-CTzd1AsV.js";import{t as Ke}from"./ProjectDefaultsSettings-BNoHUxLB.js";import{t as qe}from"./SecretInput-C8mfkoqW.js";import{t as Je}from"./ProviderSettingsForm-DdzTiAwr.js";var W=n(),G=e(t(),1),K=e(r(),1);function Ye({environmentId:e,definition:t,onSaved:n}){let r=oe(e,e=>e.sourceControlHosts[t.kind]),i=de(ce.updateSettings,{label:`save ${t.label} settings`}),[a,o]=(0,G.useState)(!1),s={settingsSchema:t.settings},c=Object.values(r??{}).some(e=>e!==``),l=async r=>{o(!0);try{(await i({environmentId:e,input:{patch:{sourceControlHosts:{[t.kind]:r}}}}))._tag===`Success`&&n()}finally{o(!1)}};return(0,K.jsxs)(`fieldset`,{disabled:a,className:`contents`,children:[(0,K.jsx)(Je,{definition:s,value:r??{},idPrefix:`source-control-${t.kind}-${e}`,variant:`settings`,onChange:e=>{let t=e??{},n=Object.fromEntries(Object.entries(t).filter(([e,t])=>r?.[e]!==t)),i=Object.keys(r??{}).filter(e=>!(e in t));l({...n,...Object.fromEntries(i.map(e=>[e,``]))})}}),c?(0,K.jsx)(`div`,{className:`flex justify-end pt-2`,children:(0,K.jsx)(g,{size:`xs`,variant:`outline`,onClick:()=>void l(Object.fromEntries(Object.keys(r??{}).map(e=>[e,``]))),children:`Remove`})}):null]})}function Xe(e){return[...new Set(e.map(e=>e.host))].map(t=>{let n=e.filter(e=>e.host===t),r=n.filter(e=>e.environmentVariable===void 0),i=r.filter(e=>e.authenticated);return{host:t,activeAccount:(i.find(e=>e.active)??i[0])?.account??null,selectable:i.map(e=>e.account),broken:r.filter(e=>!e.authenticated),environmentVariable:n.find(e=>e.environmentVariable)?.environmentVariable??null}})}function Ze(e,t,n){let r=e[t],i=n.enabled??r?.enabled??!0,a=n.account===void 0?r?.account:n.account??void 0,{[t]:o,...s}=e;return i&&a===void 0?s:{...s,[t]:{enabled:i,...a===void 0?{}:{account:a}}}}var q=`active gh account`;function J(e){let t=(0,W.c)(4),n;return t[0]!==e.account||t[1]!==e.label||t[2]!==e.revealed?(n=e.revealed?(0,K.jsx)(`span`,{className:`min-w-0 truncate font-mono text-2xs`,children:e.account}):(0,K.jsxs)(`span`,{className:`min-w-0 truncate font-mono text-2xs`,children:[(0,K.jsx)(`span`,{className:`select-none blur-xs`,"aria-hidden":!0,children:Ee(e.account)}),(0,K.jsx)(`span`,{className:`sr-only`,children:e.label??`Hidden account`})]}),t[0]=e.account,t[1]=e.label,t[2]=e.revealed,t[3]=n):n=t[3],n}function Qe({environmentId:e,auth:t,onSaved:n}){let r=oe(e,Te).hosts,i=de(ce.updateSettings,{label:`save GitHub account settings`}),[a,o]=(0,G.useState)(!1),[s,c]=(0,G.useState)(!1),l=Xe(t.accounts??[]),u=async(t,a)=>{o(!0);try{(await i({environmentId:e,input:{patch:{sourceControlHosts:{github:{hosts:Ze(r,t,a)}}}}}))._tag===`Success`&&n()}finally{o(!1)}};return l.length===0?(0,K.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Sign in with `,(0,K.jsx)(`code`,{className:`rounded bg-muted px-1 py-px text-2xs`,children:`gh auth login`}),` on the server host, then rescan to choose accounts here.`]}):(0,K.jsxs)(`div`,{className:`grid gap-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsxs)(`p`,{className:`max-w-2xl text-xs leading-relaxed text-muted-foreground`,children:[`Choose which `,(0,K.jsx)(`code`,{className:`rounded bg-muted px-1 py-px text-2xs`,children:`gh`}),` login each GitHub host uses, or turn a host off.`]}),(0,K.jsx)(g,{size:`icon-xs`,variant:`ghost-muted`,onClick:()=>c(e=>!e),"aria-label":s?`Hide GitHub accounts`:`Reveal GitHub accounts`,"aria-pressed":s,children:s?(0,K.jsx)(f,{}):(0,K.jsx)(v,{})})]}),l.map(e=>{let t=r[e.host],n=t?.enabled??!0,i=t?.account!==void 0&&!e.selectable.includes(t.account),o=t?.account!==void 0&&!i?t.account:q;return(0,K.jsxs)(`div`,{className:`grid gap-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{className:`min-w-0 space-y-0.5`,children:[(0,K.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:e.host}),e.selectable.length===1&&e.selectable[0]!==void 0?(0,K.jsxs)(`p`,{className:`flex min-w-0 items-center gap-1 text-xs text-muted-foreground`,children:[(0,K.jsx)(`span`,{children:`Signed in as`}),(0,K.jsx)(J,{revealed:s,account:e.selectable[0]})]}):null]}),(0,K.jsx)(Re,{checked:n,disabled:a,"aria-label":`Use GitHub on ${e.host}`,onCheckedChange:t=>void u(e.host,{enabled:t})})]}),e.selectable.length>1?(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Account`}),(0,K.jsx)(`div`,{className:`w-64 max-w-full`,children:(0,K.jsxs)(F,{value:o,disabled:a||!n,onValueChange:t=>{typeof t==`string`&&u(e.host,{account:t===q?null:t})},children:[(0,K.jsx)(P,{size:`sm`,"aria-label":`GitHub account for ${e.host}`,children:(0,K.jsx)(M,{children:t=>t===q?(0,K.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,children:[`Active gh account`,e.activeAccount?(0,K.jsxs)(K.Fragment,{children:[`(`,(0,K.jsx)(J,{revealed:s,account:e.activeAccount}),`)`]}):null]}):(0,K.jsx)(J,{revealed:s,account:t})})}),(0,K.jsxs)(N,{align:`end`,alignItemWithTrigger:!1,children:[(0,K.jsx)(j,{value:q,children:(0,K.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,children:[`Active gh account`,e.activeAccount?(0,K.jsxs)(K.Fragment,{children:[`(`,(0,K.jsx)(J,{revealed:s,account:e.activeAccount}),`)`]}):null]})}),e.selectable.map((e,t)=>(0,K.jsx)(j,{value:e,children:(0,K.jsx)(J,{revealed:s,account:e,label:`Account ${t+1}`})},e))]})]})})]}):null,i?(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsx)(`p`,{className:`text-xs text-warning`,children:`The chosen login is no longer signed in, so the active gh login is used.`}),(0,K.jsx)(g,{size:`xs`,variant:`outline`,disabled:a,onClick:()=>void u(e.host,{account:null}),children:`Use active login`})]}):null,e.broken.map(e=>(0,K.jsxs)(`p`,{className:`flex min-w-0 flex-wrap items-center gap-1 text-xs text-muted-foreground/70`,children:[(0,K.jsx)(J,{revealed:s,account:e.account}),(0,K.jsxs)(`span`,{children:[`can't be used: `,e.error??`gh reports this login as invalid.`]})]},e.account)),e.environmentVariable?(0,K.jsxs)(`p`,{className:`text-xs text-warning`,children:[e.environmentVariable,` is set on the server, so it overrides the account chosen here until it is unset.`]}):null]},e.host)})]})}var Y=`github.com`;function $e(e){return`https://${e}/settings/personal-access-tokens/new`}function et({environmentId:e,onSaved:t}){let{tokens:n}=oe(e,Te),r=de(ce.updateSettings,{label:`save GitHub token`}),[i,a]=(0,G.useState)(Y),[o,s]=(0,G.useState)(``),[c,l]=(0,G.useState)(!1),u=i.trim().toLowerCase(),d=(n[u]??``).length>0,f=Object.entries(n).filter(([,e])=>e.length>0).map(([e])=>e),m=async(i,a)=>{l(!0);try{(await r({environmentId:e,input:{patch:{sourceControlHosts:{github:{tokens:{...n,[i]:a}}}}}}))._tag===`Success`&&(s(``),t())}finally{l(!1)}};return(0,K.jsx)(`form`,{className:`grid gap-3`,onSubmit:e=>{e.preventDefault(),u&&o.trim()&&m(u,o.trim())},children:(0,K.jsxs)(`fieldset`,{disabled:c,className:`contents`,children:[(0,K.jsxs)(`p`,{className:`max-w-2xl text-xs leading-relaxed text-muted-foreground`,children:[`A token saved here is used before`,` `,(0,K.jsx)(`code`,{className:`rounded bg-muted px-1 py-px text-2xs`,children:`GH_TOKEN`}),` and the`,` `,(0,K.jsx)(`code`,{className:`rounded bg-muted px-1 py-px text-2xs`,children:`gh`}),` login, so GitHub works without the GitHub CLI. Give it read and write access to pull requests and contents.`,` `,(0,K.jsxs)(p,{render:(0,K.jsx)(`a`,{href:$e(u||Y),target:`_blank`,rel:`noreferrer noopener`}),children:[`Create a token`,(0,K.jsx)(_,{"aria-hidden":!0,className:`size-3`})]})]}),(0,K.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-[12rem_1fr]`,children:[(0,K.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,K.jsx)(He,{htmlFor:`github-token-host-${e}`,children:`Host`}),(0,K.jsx)(ge,{id:`github-token-host-${e}`,autoComplete:`off`,size:`sm`,placeholder:Y,value:i,onChange:e=>a(e.target.value)})]}),(0,K.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,K.jsx)(He,{htmlFor:`github-token-${e}`,children:`Token`}),(0,K.jsx)(qe,{id:`github-token-${e}`,size:`sm`,configured:d,value:o,onChange:e=>s(e.target.value)})]})]}),(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:f.length===0?`No token saved; the server uses GH_TOKEN or the gh login.`:`Saved for ${f.join(`, `)}.`}),(0,K.jsxs)(`div`,{className:`flex shrink-0 gap-2`,children:[d?(0,K.jsx)(g,{size:`xs`,variant:`outline`,disabled:c,onClick:()=>void m(u,``),children:`Remove`}):null,(0,K.jsx)(g,{type:`submit`,size:`xs`,disabled:!u||!o.trim()||c,children:`Save`})]})]})]})})}var X={static:`Static prefix`,semantic:`Semantic prefix`,custom:`Custom instructions`};function tt(){let e=(0,W.c)(40),t=ke(),{targets:n}=je(),r;e[0]===n?r=e[1]:(r=n.map(it).join(`,`),e[0]=n,e[1]=r);let i=r,a=(0,G.useRef)(!1),o=(0,G.useRef)(!1),s=Oe(),c;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=[`branchNamingMode`],e[2]=c):c=e[2];let l=Ae(c),u;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=[`branchNamePrefix`],e[3]=u):u=e[3];let d=Ae(u),f;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=[`branchNameInstructions`],e[4]=f):f=e[4];let p=Ae(f),m,h;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(m=[`branchNamingMode`],h=H(`worktree-branch-naming`),e[5]=m,e[6]=h):(m=e[5],h=e[6]);let g=!l&&t.branchNamingMode===`semantic`?`The model chooses a prefix that describes the work, such as feat/add-search, fix/login-timeout, or refactor/auth.`:void 0,_;e[7]!==l||e[8]!==t.branchNamingMode||e[9]!==s?(_=t.branchNamingMode!==x.branchNamingMode||l?(0,K.jsx)(Ie,{label:`branch naming`,onClick:()=>s({branchNamingMode:x.branchNamingMode})}):null,e[7]=l,e[8]=t.branchNamingMode,e[9]=s,e[10]=_):_=e[10];let v=l?null:t.branchNamingMode,y;e[11]===s?y=e[12]:(y=e=>{b.literals.includes(e)&&s({branchNamingMode:e})},e[11]=s,e[12]=y);let S;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,K.jsx)(P,{size:`sm`,"aria-label":`Worktree branch naming`,children:(0,K.jsx)(M,{children:rt})}),e[13]=S):S=e[13];let C;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,K.jsx)(N,{align:`end`,alignItemWithTrigger:!1,children:b.literals.map(nt)}),e[14]=C):C=e[14];let w;e[15]!==v||e[16]!==y?(w=(0,K.jsxs)(F,{value:v,onValueChange:y,children:[S,C]}),e[15]=v,e[16]=y,e[17]=w):w=e[17];let T;e[18]!==w||e[19]!==g||e[20]!==_?(T=(0,K.jsx)(B,{serverScoped:!0,settingKeys:m,...h,description:`Choose how new worktree branches are named from your first message.`,status:g,resetAction:_,control:w}),e[18]=w,e[19]=g,e[20]=_,e[21]=T):T=e[21];let E;e[22]!==l||e[23]!==d||e[24]!==i||e[25]!==t.branchNamePrefix||e[26]!==t.branchNamingMode||e[27]!==s?(E=!l&&t.branchNamingMode===`static`?(0,K.jsx)(B,{serverScoped:!0,settingKeys:[`branchNamePrefix`],title:`Branch prefix`,description:`For example, p4 or p4/ produces p4/add-search. Leave empty for no prefix.`,resetAction:d||t.branchNamePrefix!==x.branchNamePrefix?(0,K.jsx)(Ie,{label:`branch prefix`,onClick:()=>s({branchNamePrefix:x.branchNamePrefix})}):null,control:(0,K.jsx)(ge,{"aria-label":`Branch prefix`,autoCapitalize:`none`,spellCheck:!1,onChange:()=>{a.current=!0},placeholder:d?`Mixed`:`No prefix`,defaultValue:d?``:t.branchNamePrefix,onBlur:e=>{let n=e.target.value.trim();a.current&&(d||n!==t.branchNamePrefix)&&s({branchNamePrefix:n}),a.current=!1}},`${i}:${d}:${t.branchNamePrefix}`)}):null,e[22]=l,e[23]=d,e[24]=i,e[25]=t.branchNamePrefix,e[26]=t.branchNamingMode,e[27]=s,e[28]=E):E=e[28];let D;e[29]!==p||e[30]!==l||e[31]!==i||e[32]!==t.branchNameInstructions||e[33]!==t.branchNamingMode||e[34]!==s?(D=!l&&t.branchNamingMode===`custom`?(0,K.jsx)(B,{serverScoped:!0,settingKeys:[`branchNameInstructions`],title:`Branch naming instructions`,description:`Appended to the naming prompt. The model returns the complete branch name; no prefix or suffix is added.`,resetAction:p||t.branchNameInstructions!==``?(0,K.jsx)(Ie,{label:`branch naming instructions`,onClick:()=>s({branchNameInstructions:``})}):null,children:(0,K.jsx)(`div`,{className:`mt-3 max-w-2xl pb-3.5`,children:(0,K.jsx)(he,{"aria-label":`Branch naming instructions`,onChange:()=>{o.current=!0},rows:4,defaultValue:p?``:t.branchNameInstructions,placeholder:p?`Mixed. Enter instructions to apply to all selected targets.`:`Use julius/ followed by the issue ID and a short description.`,onBlur:e=>{let n=e.target.value.trim();o.current&&(p||n!==t.branchNameInstructions)&&s({branchNameInstructions:n}),o.current=!1}},`${i}:${p}:${t.branchNameInstructions}`)})}):null,e[29]=p,e[30]=l,e[31]=i,e[32]=t.branchNameInstructions,e[33]=t.branchNamingMode,e[34]=s,e[35]=D):D=e[35];let O;return e[36]!==T||e[37]!==E||e[38]!==D?(O=(0,K.jsxs)(K.Fragment,{children:[T,E,D]}),e[36]=T,e[37]=E,e[38]=D,e[39]=O):O=e[39],O}function nt(e){return(0,K.jsx)(j,{value:e,children:X[e]},e)}function rt(e){return e===null?`Mixed`:X[e]}function it(e){return`${e.environmentId}:${e.projectId}`}var at={repo_conventions:{label:`Repository conventions`,description:`Commit messages and pull request titles and descriptions match each project's history.`},conventional_commits:{label:`Conventional Commits`,description:`Conventional Commit prefixes, with short pull request titles and descriptions.`},custom:{label:`Custom instructions`,description:`Your instructions shape commit messages and pull request titles and descriptions.`}};function ot(){let e=(0,W.c)(80),t=ke(),n=Oe(),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=[`reviewGuidesEnabled`],e[0]=r):r=e[0];let l=Ae(r),f=ee(),{environment:p,connectedEnvironments:h,targets:_,target:v}=je(),y=p?.environmentId??null,b=h.length>0,x=p?.serverConfig?.providers??le,S;e[1]===_?S=e[2]:(S=e=>{let t=_[0];return t!==void 0&&_.some(n=>n.settings.sourceControlWritingStyle[e]!==t.settings.sourceControlWritingStyle[e])},e[1]=_,e[2]=S);let w=S,T;e[3]===w?T=e[4]:(T=w(`mode`),e[3]=w,e[4]=T);let E=T,D;e[5]===w?D=e[6]:(D=w(`customInstructions`),e[5]=w,e[6]=D);let O=D,k;e[7]===w?k=e[8]:(k=w(`followChangeRequestTemplates`),e[7]=w,e[8]=k);let A=k,j=E||O,ne;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(ne=[`sourceControlWriterModelSelection`],e[9]=ne):ne=e[9];let re=Ae(ne),oe;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(oe=[`reviewGuideModelSelection`],e[10]=oe):oe=e[10];let se=Ae(oe),ce;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(ce=[`reviewGuideInstructions`],e[11]=ce):ce=e[11];let ue=Ae(ce),de=(0,G.useRef)(!1),fe;e[12]===_?fe=e[13]:(fe=_.map(ft).join(`,`),e[12]=_,e[13]=fe);let pe=fe,me=(0,G.useRef)(null),[I,ge]=(0,G.useState)(!1),[_e,ve]=(0,G.useState)(null),L=t.sourceControlWritingStyle,ye=C.sourceControlWritingStyle,be=j||L.mode!==ye.mode||L.customInstructions!==ye.customInstructions,xe=x.filter(dt),R=u(s(c(xe),t,v?.projectId??null)),Se=new Set(R.filter(ut).map(lt)),Ce=xe.filter(e=>Se.has(e.instanceId)),we=a(t,Ce),Te=t.sourceControlWriterModelSelection!==null,z=a({...t,textGenerationModelSelection:ae(t,Ce,v?.projectId??null)},Ce),Ee=R.some(e=>e.instanceId===we.instanceId&&e.enabled&&e.isAvailable),De=i(t,Ce,z.instanceId,z.model),Me=Ge(t,R),Ne=R.find(e=>e.instanceId===z.instanceId),Fe=t.reviewGuideModelSelection!==null,V=a({...t,textGenerationModelSelection:ie(t,xe,v?.projectId??null)},xe),ze=i(t,xe,V.instanceId,V.model),Be=R.find(e=>e.instanceId===V.instanceId),Ve=Le,U;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,K.jsx)(tt,{}),e[14]=U):U=e[14];let He;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(He=[`sourceControlWritingStyle`],e[15]=He):He=e[15];let Ue;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(Ue=H(`source-control-writing-style`),e[16]=Ue):Ue=e[16];let Ke=at[L.mode],qe;e[17]!==be||e[18]!==n?(qe=be?(0,K.jsx)(Ie,{label:`commit and pull request writing`,onClick:()=>n({sourceControlWritingStyle:{mode:ye.mode,customInstructions:ye.customInstructions}})}):null,e[17]=be,e[18]=n,e[19]=qe):qe=e[19];let Je=E?null:L.mode,Ye;e[20]===n?Ye=e[21]:(Ye=e=>{let t=me.current?.value.trim();n({sourceControlWritingStyle:{mode:e,...t===void 0?{}:{customInstructions:t}}})},e[20]=n,e[21]=Ye);let Xe;e[22]===Symbol.for(`react.memo_cache_sentinel`)?(Xe=(0,K.jsx)(P,{size:`sm`,className:`w-full sm:w-56`,"aria-label":`Commit and pull request writing`,children:(0,K.jsx)(M,{children:ct})}),e[22]=Xe):Xe=e[22];let Ze;e[23]===Symbol.for(`react.memo_cache_sentinel`)?(Ze=Object.keys(at),e[23]=Ze):Ze=e[23];let q;e[24]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,K.jsx)(N,{align:`end`,alignItemWithTrigger:!1,children:Ze.map(st)}),e[24]=q):q=e[24];let J;e[25]!==Je||e[26]!==Ye?(J=(0,K.jsxs)(F,{value:Je,onValueChange:Ye,children:[Xe,q]}),e[25]=Je,e[26]=Ye,e[27]=J):J=e[27];let Qe;e[28]!==_e||e[29]!==I||e[30]!==L.customInstructions||e[31]!==L.mode||e[32]!==n||e[33]!==j?(Qe=j?(0,K.jsx)(`div`,{className:`mt-3 max-w-2xl space-y-2 pb-3.5`,children:I?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(he,{value:_e??``,onChange:e=>ve(e.target.value),rows:4,"aria-label":`Custom commit and pull request instructions for all selected environments`,placeholder:`Write the instructions each selected environment should use.`}),(0,K.jsx)(g,{size:`sm`,variant:`outline`,disabled:_e===null,onClick:()=>{_e!==null&&(n({sourceControlWritingStyle:{mode:`custom`,customInstructions:_e.trim()}}),ge(!1))},children:`Apply instructions to all`})]}):(0,K.jsx)(g,{size:`sm`,variant:`outline`,onClick:()=>{ve(null),ge(!0)},children:`Write custom instructions for all`})}):L.mode===`custom`?(0,K.jsx)(`div`,{className:`mt-3 max-w-2xl pb-3.5`,children:(0,K.jsx)(he,{ref:me,defaultValue:L.customInstructions,onBlur:e=>{let t=e.target.value.trim();t!==L.customInstructions&&n({sourceControlWritingStyle:{customInstructions:t}})},rows:4,placeholder:`Keep commit subjects under 60 characters. Keep pull request descriptions short and plain.`,"aria-label":`Custom commit and pull request instructions`},L.customInstructions)}):null,e[28]=_e,e[29]=I,e[30]=L.customInstructions,e[31]=L.mode,e[32]=n,e[33]=j,e[34]=Qe):Qe=e[34];let Y;e[35]!==Ke.description||e[36]!==qe||e[37]!==J||e[38]!==Qe||e[39]!==j?(Y=(0,K.jsx)(B,{serverScoped:!0,settingKeys:He,mixed:j,...Ue,description:Ke.description,resetAction:qe,control:J,children:Qe}),e[35]=Ke.description,e[36]=qe,e[37]=J,e[38]=Qe,e[39]=j,e[40]=Y):Y=e[40];let $e;e[41]===Symbol.for(`react.memo_cache_sentinel`)?($e=[`sourceControlWritingStyle`],e[41]=$e):$e=e[41];let et;e[42]===Symbol.for(`react.memo_cache_sentinel`)?(et=H(`follow-change-request-templates`),e[42]=et):et=e[42];let X;e[43]!==L.followChangeRequestTemplates||e[44]!==A||e[45]!==n?(X=A||L.followChangeRequestTemplates!==ye.followChangeRequestTemplates?(0,K.jsx)(Ie,{label:`pull request templates`,onClick:()=>n({sourceControlWritingStyle:{followChangeRequestTemplates:ye.followChangeRequestTemplates}})}):null,e[43]=L.followChangeRequestTemplates,e[44]=A,e[45]=n,e[46]=X):X=e[46];let nt=!A&&L.followChangeRequestTemplates,rt;e[47]===n?rt=e[48]:(rt=e=>n({sourceControlWritingStyle:{followChangeRequestTemplates:!!e}}),e[47]=n,e[48]=rt);let it;e[49]!==nt||e[50]!==rt||e[51]!==A?(it=(0,K.jsx)(Re,{mixed:A,checked:nt,onCheckedChange:rt,"aria-label":`Follow pull request templates`}),e[49]=nt,e[50]=rt,e[51]=A,e[52]=it):it=e[52];let ot;e[53]!==X||e[54]!==it||e[55]!==A?(ot=(0,K.jsx)(B,{serverScoped:!0,settingKeys:$e,mixed:A,...et,description:`Use the repository's pull request template when it has one.`,resetAction:X,control:it}),e[53]=X,e[54]=it,e[55]=A,e[56]=ot):ot=e[56];let pt,mt;e[57]===Symbol.for(`react.memo_cache_sentinel`)?(pt=[`sourceControlWriterModelSelection`],mt=H(`source-control-writer-model`),e[57]=pt,e[58]=mt):(pt=e[57],mt=e[58]);let ht=b?(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:[Te&&!Ee?(0,K.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`No text generation providers available.`}):null,Te&&Ee?(0,K.jsx)(We,{environmentId:y,activeInstanceId:z.instanceId,model:z.model,lockedProvider:null,instanceEntries:R,modelOptionsByInstance:De,triggerClassName:Pe,triggerAriaLabel:`Source control writer model`,...re?{triggerLabel:`Mixed`}:{},...y?{onOpenProviderSetup:e=>{f({to:`/settings/providers`,search:{environmentId:y,instanceId:e}})}}:{},getModelDisabledReason:Me,onInstanceModelChange:(e,t)=>{let r=Me(e,t);r?te.add({type:`error`,title:`Source control writer model not saved`,description:r}):n({sourceControlWriterModelSelection:m(e,t)})}}):null,Te&&Ee&&!re&&Ne?(0,K.jsx)(d,{provider:Ne.driverKind,models:Ne.models,model:z.model,modelOptions:z.options??[],allowPromptInjectedEffort:!1,planModeEnabled:t.planModeEnabled||o(z.options),triggerClassName:Pe,onModelOptionsChange:e=>n({sourceControlWriterModelSelection:m(z.instanceId,z.model,e)})}):null,(0,K.jsx)(Re,{checked:Te,disabled:!Te&&!Ee,onCheckedChange:e=>n({sourceControlWriterModelSelection:e?m(we.instanceId,we.model,we.options):null}),"aria-label":`Use a separate source control writer model`})]}):(0,K.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Connect an environment to choose its source control writer model.`}),gt;e[59]===ht?gt=e[60]:(gt=(0,K.jsx)(B,{serverScoped:!0,settingKeys:pt,...mt,description:`Model for commit messages, pull request text, and branch or bookmark names. When disabled, use the text generation model configured for this environment.`,control:ht}),e[59]=ht,e[60]=gt);let _t;e[61]===Symbol.for(`react.memo_cache_sentinel`)?(_t=[`reviewGuidesEnabled`],e[61]=_t):_t=e[61];let vt;e[62]===Symbol.for(`react.memo_cache_sentinel`)?(vt=H(`review-guides`),e[62]=vt):vt=e[62];let yt=!l&&t.reviewGuidesEnabled,Z;e[63]===n?Z=e[64]:(Z=e=>n({reviewGuidesEnabled:!!e}),e[63]=n,e[64]=Z);let Q;e[65]!==l||e[66]!==yt||e[67]!==Z?(Q=(0,K.jsx)(Re,{mixed:l,checked:yt,onCheckedChange:Z,"aria-label":`Review guides`}),e[65]=l,e[66]=yt,e[67]=Z,e[68]=Q):Q=e[68];let $;e[69]!==l||e[70]!==Q?($=(0,K.jsx)(B,{serverScoped:!0,settingKeys:_t,mixed:l,...vt,description:`Add a Guide tab to pull requests. An agent explains the changes and points out decisions that need review.`,control:Q}),e[69]=l,e[70]=Q,e[71]=$):$=e[71];let bt=t.reviewGuidesEnabled||l?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(B,{serverScoped:!0,settingKeys:[`reviewGuideModelSelection`],...H(`review-guide-model`),description:`Model that reads a pull request to write its review guide. It reads the change itself over many steps, so a stronger model helps. Off uses the source control writer model.`,control:b?(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:[(Fe||se)&&Ee?(0,K.jsx)(We,{environmentId:y,activeInstanceId:V.instanceId,model:V.model,lockedProvider:null,instanceEntries:R,modelOptionsByInstance:ze,triggerClassName:Pe,triggerAriaLabel:`Review guide model`,...se?{triggerLabel:`Mixed`}:{},getModelDisabledReason:Me,onInstanceModelChange:(e,t)=>{let r=Me(e,t);r?te.add({type:`error`,title:`Review guide model not saved`,description:r}):n({reviewGuideModelSelection:m(e,t)})}}):null,Fe&&Ee&&!se&&Be?(0,K.jsx)(d,{provider:Be.driverKind,models:Be.models,model:V.model,modelOptions:V.options??[],allowPromptInjectedEffort:!1,planModeEnabled:t.planModeEnabled||o(V.options),triggerClassName:Pe,onModelOptionsChange:e=>n({reviewGuideModelSelection:m(V.instanceId,V.model,e)})}):null,(0,K.jsx)(Re,{mixed:se,checked:!se&&Fe,disabled:!Fe&&!Ee,onCheckedChange:e=>{if(!e){n({reviewGuideModelSelection:null});return}let t=Me(z.instanceId,z.model);t?te.add({type:`error`,title:`Review guide model not saved`,description:t}):n({reviewGuideModelSelection:m(z.instanceId,z.model,z.options)})},"aria-label":`Use a separate review guide model`})]}):(0,K.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Connect an environment to choose its review guide model.`})}),(0,K.jsx)(B,{serverScoped:!0,settingKeys:[`reviewGuideInstructions`],...H(`review-guide-instructions`),description:`Your preferences for review guides: what to show first, dwell on, or skip. The guide's format and coverage stay the same.`,resetAction:ue||t.reviewGuideInstructions!==``?(0,K.jsx)(Ie,{label:`review guide instructions`,onClick:()=>n({reviewGuideInstructions:``})}):null,children:(0,K.jsx)(`div`,{className:`mt-3 max-w-2xl pb-3.5`,children:(0,K.jsx)(he,{"aria-label":`Review guide instructions`,onChange:()=>{de.current=!0},rows:4,defaultValue:ue?``:t.reviewGuideInstructions,placeholder:ue?`Mixed. Enter instructions to apply to all selected targets.`:`Show service interfaces before implementations. Skip test files unless they change behavior. Keep summaries to two sentences.`,onBlur:e=>{let r=e.target.value.trim();de.current&&(ue||r!==t.reviewGuideInstructions)&&n({reviewGuideInstructions:r}),de.current=!1}},`${pe}:${ue}:${t.reviewGuideInstructions}`)})})]}):null,xt;return e[72]!==Ve||e[73]!==U||e[74]!==Y||e[75]!==ot||e[76]!==gt||e[77]!==$||e[78]!==bt?(xt=(0,K.jsxs)(Ve,{id:`source-control-text-generation`,title:`Text generation`,children:[U,Y,ot,gt,$,bt]}),e[72]=Ve,e[73]=U,e[74]=Y,e[75]=ot,e[76]=gt,e[77]=$,e[78]=bt,e[79]=xt):xt=e[79],xt}function st(e){return(0,K.jsx)(j,{hideIndicator:!0,value:e,children:at[e].label},e)}function ct(e){return e===null?`Mixed`:at[e].label}function lt(e){return e.instanceId}function ut(e){return e.enabled&&e.isAvailable}function dt(e){return e.supportsTextGeneration!==!1}function ft(e){return`${e.environmentId}:${e.projectId}`}var pt={versionControlSystems:[],sourceControlProviders:[]},mt={git:Ce,jj:Se},ht=[`primary`,`secondary`],gt=5;function _t(e){return Math.round(S(e)/1e3)}function vt(e){return e===null||!Number.isFinite(e)?0:Math.max(0,Math.round(e))}function yt(e,t){let n={...e.overrides,...t};for(let[e,t]of Object.entries(n))t===void 0&&delete n[e];return{backgroundActivity:{schemaVersion:1,profile:`custom`,baseProfile:ne(e),overrides:n}}}function Z(e){return T(e)}function Q(e){return`auth`in e}function $(e){return!Q(e)&&!e.implemented}function bt(e){return e.status===`authenticated`?{label:`Authenticated`,badge:null}:e.status===`unauthenticated`?{label:`Not authenticated`,badge:`secondary`}:{label:`Status unknown`,badge:null}}function xt(e){let t=(0,W.c)(2),n;return t[0]===e.account?n=t[1]:(n=(0,K.jsx)(De,{value:e.account,ariaLabel:`Toggle source control account visibility`,revealTooltip:`Click to reveal account`,hideTooltip:`Click to hide account`}),t[0]=e.account,t[1]=n),n}function St(e){return $(e)?`bg-muted-foreground/35`:Q(e)?e.status===`available`&&e.auth.status===`authenticated`?`bg-success`:`bg-muted-foreground/35`:e.status===`available`?`bg-success`:`bg-warning`}function Ct(e){let t=(0,W.c)(13),{item:n}=e,r,i,a,o;if(t[0]!==n){o=Symbol.for(`react.early_return_sentinel`);bb0:{let e=St(n),s=Q(n)?we.find(n.kind):void 0,c=Q(n)?s&&Ue(s):mt[n.kind];if(!c){o=(0,K.jsx)(`span`,{className:y(`size-2 shrink-0 rounded-full`,e),"aria-hidden":!0});break bb0}i=`relative inline-flex size-5 shrink-0 items-center justify-center`,t[5]===c?a=t[6]:(a=(0,K.jsx)(c,{className:`size-4.5 text-foreground/80`,"aria-hidden":!0}),t[5]=c,t[6]=a),r=y(`pointer-events-none absolute -left-0.5 -top-0.5 size-2 rounded-full ring-2 ring-background`,e)}t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o}else r=t[1],i=t[2],a=t[3],o=t[4];if(o!==Symbol.for(`react.early_return_sentinel`))return o;let s;t[7]===r?s=t[8]:(s=(0,K.jsx)(`span`,{className:r,"aria-hidden":!0}),t[7]=r,t[8]=s);let c;return t[9]!==i||t[10]!==a||t[11]!==s?(c=(0,K.jsxs)(`span`,{className:i,children:[a,s]}),t[9]=i,t[10]=a,t[11]=s,t[12]=c):c=t[12],c}function wt({item:e,auth:t,authAccount:n}){if($(e))return(0,K.jsxs)(`span`,{children:[`Support for `,e.label,` is coming soon.`]});if(e.status!==`available`)return(0,K.jsxs)(`span`,{children:[`Not available on this server: `,e.installHint]});if(t){if(t.status===`authenticated`){let e=Z(t.detail);return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{children:`Authenticated`}),n?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{"aria-hidden":!0,children:`as`}),(0,K.jsx)(xt,{account:n})]}):null,e?(0,K.jsxs)(`span`,{children:[`· `,e]}):null]})}if(!e.executable&&t.status===`unauthenticated`)return(0,K.jsxs)(`span`,{children:[`Available. `,e.installHint]});if(t.status===`unauthenticated`&&t.accounts?.some(e=>e.authenticated))return(0,K.jsx)(`span`,{children:Z(t.detail)??`Every ${e.label} host is turned off.`});if(t.status===`unauthenticated`)return(0,K.jsxs)(`span`,{children:[e.label,` is not authenticated on this server. Sign in or configure credentials using the `,(0,K.jsx)(`code`,{className:`rounded bg-muted px-1 py-px text-2xs`,children:e.executable}),` tool on the server host to enable change request features.`]});let r=Z(t.detail);return(0,K.jsxs)(`span`,{children:[`Could not verify `,e.label,`. `,r??e.installHint]})}return(0,K.jsx)(`span`,{children:`Available`})}function Tt(e){let t=(0,W.c)(57),{item:n,children:r}=e,i;t[0]===n.version?i=t[1]:(i=Z(n.version),t[0]=n.version,t[1]=i);let a=i,o=Q(n)?n.status===`available`&&n.auth.status===`authenticated`:n.status===`available`&&n.implemented,s=Q(n)?n.auth:null,c;t[2]===s?c=t[3]:(c=s?bt(s):null,t[2]=s,t[3]=c);let u=c,d=s?Z(s.account):null,[f,p]=(0,G.useState)(!1),m=r!==void 0,_=Me(),v;t[4]!==n.kind||t[5]!==_||t[6]!==p?(v=()=>{(n.kind===`git`&&_===H(`git-fetch-interval`).id||_===U(n.kind)||n.kind===`github`&&_===H(`github-accounts`).id)&&p(!0)},t[4]=n.kind,t[5]=_,t[6]=p,t[7]=v):v=t[7];let b;t[8]!==n.kind||t[9]!==_?(b=[n.kind,_],t[8]=n.kind,t[9]=_,t[10]=b):b=t[10],(0,G.useEffect)(v,b);let x;t[11]===n?x=t[12]:(x=y(`first:rounded-t-xl last:rounded-b-xl transition-colors hover:bg-muted/20`,$(n)&&`opacity-80`),t[11]=n,t[12]=x);let S;t[13]===n?S=t[14]:(S=(0,K.jsx)(Ct,{item:n}),t[13]=n,t[14]=S);let C;t[15]===n.label?C=t[16]:(C=(0,K.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,children:n.label}),t[15]=n.label,t[16]=C);let w;t[17]===a?w=t[18]:(w=a?(0,K.jsx)(`code`,{className:`text-xs text-muted-foreground`,children:a}):null,t[17]=a,t[18]=w);let T;t[19]===n?T=t[20]:(T=$(n)?(0,K.jsx)(l,{variant:`warning`,size:`sm`,children:`Coming Soon`}):null,t[19]=n,t[20]=T);let E;t[21]===u?E=t[22]:(E=u?.badge?(0,K.jsx)(l,{variant:u.badge,size:`sm`,children:u.label}):null,t[21]=u,t[22]=E);let D;t[23]!==C||t[24]!==w||t[25]!==T||t[26]!==E||t[27]!==S?(D=(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[S,C,w,T,E]}),t[23]=C,t[24]=w,t[25]=T,t[26]=E,t[27]=S,t[28]=D):D=t[28];let O=wt({item:n,auth:s,authAccount:d}),k;t[29]===O?k=t[30]:(k=(0,K.jsx)(`p`,{className:`flex min-w-0 flex-wrap items-center gap-x-1 text-xs leading-normal text-muted-foreground/80`,children:O}),t[29]=O,t[30]=k);let A;t[31]!==D||t[32]!==k?(A=(0,K.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[D,k]}),t[31]=D,t[32]=k,t[33]=A):A=t[33];let j;t[34]!==m||t[35]!==f||t[36]!==n.label||t[37]!==p?(j=m?(0,K.jsx)(g,{size:`icon-xs`,variant:`ghost-muted`,onClick:()=>p(Et),"aria-expanded":f,"aria-label":`Toggle ${n.label} details`,children:(0,K.jsx)(h,{className:y(`size-3.5 transition-transform`,f&&`rotate-180`)})}):null,t[34]=m,t[35]=f,t[36]=n.label,t[37]=p,t[38]=j):j=t[38];let M;t[39]!==o||t[40]!==n?(M=$(n)?null:(0,K.jsx)(Re,{checked:o,disabled:!0,"aria-label":`${n.label} availability`}),t[39]=o,t[40]=n,t[41]=M):M=t[41];let N;t[42]!==j||t[43]!==M?(N=(0,K.jsxs)(`div`,{className:`flex w-full shrink-0 items-center gap-2 sm:w-auto sm:justify-end`,children:[j,M]}),t[42]=j,t[43]=M,t[44]=N):N=t[44];let P;t[45]!==A||t[46]!==N?(P=(0,K.jsx)(`div`,{className:`px-3 py-3 sm:px-4`,children:(0,K.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[A,N]})}),t[45]=A,t[46]=N,t[47]=P):P=t[47];let F;t[48]!==r||t[49]!==m||t[50]!==f||t[51]!==p?(F=m?(0,K.jsx)(Be,{open:f,onOpenChange:p,children:(0,K.jsx)(Ve,{children:(0,K.jsx)(`div`,{className:`px-3 pb-4 pt-1 sm:px-4`,children:r})})}):null,t[48]=r,t[49]=m,t[50]=f,t[51]=p,t[52]=F):F=t[52];let ee;return t[53]!==P||t[54]!==F||t[55]!==x?(ee=(0,K.jsxs)(`div`,{className:x,children:[P,F]}),t[53]=P,t[54]=F,t[55]=x,t[56]=ee):ee=t[56],ee}function Et(e){return!e}function Dt(){let e=(0,W.c)(33),t=ke(),n=Oe(),r;e[0]===t?r=e[1]:(r=_t(se(t).automaticGitFetchInterval),e[0]=t,e[1]=r);let i=r,a;e[2]===t.backgroundActivity?a=e[3]:(a=_t(re(ne(t.backgroundActivity)).automaticGitFetchInterval),e[2]=t.backgroundActivity,e[3]=a);let o=i!==a,s;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(s=H(`git-fetch-interval`),e[4]=s):s=e[4];let c=s,l=c.id,u,d;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,K.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:c.title}),d=(0,K.jsx)(V,{children:`This interval is configured for Git only. The shared Background activity policy still decides whether Git refreshes may run when the timer fires. Custom intervals appear as Advanced in General settings.`}),e[5]=u,e[6]=d):(u=e[5],d=e[6]);let f=o?`opacity-100`:`pointer-events-none opacity-0`,p;e[7]===f?p=e[8]:(p=y(`inline-flex size-5 shrink-0 items-center justify-center transition-opacity`,f),e[7]=f,e[8]=p);let m=!o,h;e[9]!==o||e[10]!==t.backgroundActivity||e[11]!==n?(h=o?(0,K.jsx)(Ie,{label:`fetch interval`,onClick:()=>n(yt(t.backgroundActivity,{automaticGitFetchInterval:void 0}))}):null,e[9]=o,e[10]=t.backgroundActivity,e[11]=n,e[12]=h):h=e[12];let g;e[13]!==p||e[14]!==m||e[15]!==h?(g=(0,K.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[u,d,(0,K.jsx)(`span`,{className:p,"aria-hidden":m,children:h})]}),e[13]=p,e[14]=m,e[15]=h,e[16]=g):g=e[16];let _;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,K.jsx)(`p`,{className:`max-w-2xl text-xs leading-relaxed text-muted-foreground`,children:`Refresh remote branches in the background. Set to 0 to avoid automatic Git prompts.`}),e[17]=_):_=e[17];let v;e[18]===g?v=e[19]:(v=(0,K.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[g,_]}),e[18]=g,e[19]=v);let b;e[20]!==t.backgroundActivity||e[21]!==n?(b=e=>n(yt(t.backgroundActivity,{automaticGitFetchInterval:w(vt(e))})),e[20]=t.backgroundActivity,e[21]=n,e[22]=b):b=e[22];let x;e[23]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,K.jsxs)(k,{children:[(0,K.jsx)(O,{"aria-label":`Decrease fetch interval`}),(0,K.jsx)(E,{"aria-label":`Automatic Git fetch interval in seconds`}),(0,K.jsx)(D,{"aria-label":`Increase fetch interval`})]}),e[23]=x):x=e[23];let S;e[24]!==i||e[25]!==b?(S=(0,K.jsx)(A,{value:i,min:0,step:gt,size:`sm`,className:`w-32`,onValueChange:b,children:x}),e[24]=i,e[25]=b,e[26]=S):S=e[26];let C;e[27]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,K.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`seconds`}),e[27]=C):C=e[27];let T;e[28]===S?T=e[29]:(T=(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[S,C]}),e[28]=S,e[29]=T);let j;return e[30]!==v||e[31]!==T?(j=(0,K.jsx)(Fe,{id:l,className:`grid gap-3`,children:(0,K.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[v,T]})}),e[30]=v,e[31]=T,e[32]=j):j=e[32],j}function Ot(e){let t=(0,W.c)(4),{title:n,headerAction:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=ht.map(kt),t[0]=i):i=t[0];let a;return t[1]!==r||t[2]!==n?(a=(0,K.jsx)(Le,{title:n,headerAction:r,children:i}),t[1]=r,t[2]=n,t[3]=a):a=t[3],a}function kt(e){return(0,K.jsx)(`div`,{className:`first:rounded-t-xl last:rounded-b-xl px-3 py-3 sm:px-4`,children:(0,K.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,K.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsxs)(`span`,{className:`relative inline-flex size-5 shrink-0 items-center justify-center`,children:[(0,K.jsx)(I,{className:`size-4.5`}),(0,K.jsx)(I,{shape:`pill`,className:`pointer-events-none absolute -left-0.5 -top-0.5 size-2`,"aria-hidden":!0})]}),(0,K.jsx)(I,{shape:`pill`,className:`h-4 w-28`}),(0,K.jsx)(I,{shape:`pill`,className:`h-5 w-14`})]}),(0,K.jsx)(I,{shape:`pill`,className:`h-3 w-full max-w-xs`})]}),(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,K.jsx)(I,{className:`size-7`}),(0,K.jsx)(I,{shape:`pill`,className:`h-5 w-9`})]})]})},e)}function At(e){let t=(0,W.c)(18),{error:n,isPending:r,onScan:i}=e,a=n!==null,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=H(`source-control`),t[0]=o):o=t[0];let s;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,K.jsx)(_e,{variant:`icon`,children:(0,K.jsx)(z.pullRequest,{})}),t[1]=s):s=t[1];let c=a?`Could not scan the server environment`:`Nothing detected yet`,l;t[2]===c?l=t[3]:(l=(0,K.jsx)(ye,{children:c}),t[2]=c,t[3]=l);let u=a?n:`Install Git on the server, add optional hosting integrations or credentials your workspace needs, then rescan.`,d;t[4]===u?d=t[5]:(d=(0,K.jsx)(be,{children:u}),t[4]=u,t[5]=d);let f;t[6]!==l||t[7]!==d?(f=(0,K.jsxs)(ve,{children:[l,d]}),t[6]=l,t[7]=d,t[8]=f):f=t[8];let p;t[9]===r?p=t[10]:(p=(0,K.jsx)(ze,{size:`sm`,refreshing:r}),t[9]=r,t[10]=p);let m;t[11]!==r||t[12]!==i||t[13]!==p?(m=(0,K.jsx)(L,{children:(0,K.jsxs)(g,{size:`sm`,variant:`outline`,onClick:i,disabled:r,children:[p,`Scan`]})}),t[11]=r,t[12]=i,t[13]=p,t[14]=m):m=t[14];let h;return t[15]!==f||t[16]!==m?(h=(0,K.jsx)(Le,{id:o.id,title:`Server environment`,children:(0,K.jsxs)(xe,{children:[s,f,m]})}),t[15]=f,t[16]=m,t[17]=h):h=t[17],h}function jt(){let e=(0,W.c)(33),{scope:t,environment:n,connectedEnvironments:r}=je(),i=n?.connection.phase===`connected`?n.environmentId:null,a=t.environmentIds.length!==1&&r.length>1&&n?` · ${n.label}`:``,o;e[0]===i?o=e[1]:(o=i===null?null:R.discovery({environmentId:i,input:{}}),e[0]=i,e[1]=o);let s=ue(o),c=s.data??pt,l=c.versionControlSystems.length>0,u=l||c.sourceControlProviders.length>0,d=s.isPending&&s.data===null,f;e[2]===s?f=e[3]:(f=()=>{s.refresh()},e[2]=s,e[3]=f);let p=f,m;e[4]!==i||e[5]!==p?(m=e=>{let t=we.find(e);if(t?.settings&&i!==null)return(0,K.jsx)(Fe,{id:U(e),children:(0,K.jsx)(Ye,{environmentId:i,definition:{...t,settings:t.settings},onSaved:p},i)})},e[4]=i,e[5]=p,e[6]=m):m=e[6];let h=m,_;e[7]===s.isPending?_=e[8]:(_=(0,K.jsx)(ze,{refreshing:s.isPending}),e[7]=s.isPending,e[8]=_);let v;e[9]!==s.isPending||e[10]!==p||e[11]!==_?(v=(0,K.jsx)(fe,{render:(0,K.jsx)(g,{size:`icon-xs`,variant:`ghost-muted`,onClick:p,disabled:s.isPending,"aria-label":`Rescan server environment`,children:_})}),e[9]=s.isPending,e[10]=p,e[11]=_,e[12]=v):v=e[12];let y;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,K.jsx)(pe,{side:`top`,children:`Rescan Git and hosting integrations`}),e[13]=y):y=e[13];let b;e[14]===v?b=e[15]:(b=(0,K.jsxs)(me,{children:[v,y]}),e[14]=v,e[15]=b);let x=b,S;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,K.jsx)(Ke,{category:`source-control`}),e[16]=S):S=e[16];let C;e[17]!==s.error||e[18]!==s.isPending||e[19]!==i||e[20]!==a||e[21]!==p||e[22]!==u||e[23]!==l||e[24]!==h||e[25]!==d||e[26]!==c.sourceControlProviders||e[27]!==c.versionControlSystems||e[28]!==x?(C=i===null?(0,K.jsx)(Le,{id:H(`source-control`).id,title:`Server environment`,children:(0,K.jsx)(`p`,{className:`px-4 py-3 text-sm text-muted-foreground`,children:`Connect an environment to inspect its version control tools and hosting integrations.`})}):d?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Ot,{title:`Version Control${a}`,headerAction:x}),(0,K.jsx)(Ot,{title:`Source Control Providers`})]}):u?(0,K.jsxs)(K.Fragment,{children:[l?(0,K.jsx)(Le,{id:H(`source-control`).id,title:`Version Control${a}`,headerAction:x,children:c.versionControlSystems.map(Mt)}):null,c.sourceControlProviders.length>0?(0,K.jsx)(Le,{id:l?void 0:H(`source-control`).id,title:l?`Source Control Providers`:`Source Control Providers${a}`,headerAction:l?null:x,children:c.sourceControlProviders.map(e=>(0,K.jsx)(Tt,{item:e,children:e.kind===`github`?(0,K.jsx)(Fe,{id:H(`github-accounts`).id,children:(0,K.jsxs)(`div`,{className:`grid gap-6`,children:[(0,K.jsx)(et,{environmentId:i,onSaved:p},`token-${i}`),e.status===`available`?(0,K.jsx)(Qe,{environmentId:i,auth:e.auth,onSaved:p},i):null]})}):h(e.kind)},`provider:${e.kind}`))}):null]}):(0,K.jsx)(At,{error:s.error,isPending:s.isPending,onScan:p}),e[17]=s.error,e[18]=s.isPending,e[19]=i,e[20]=a,e[21]=p,e[22]=u,e[23]=l,e[24]=h,e[25]=d,e[26]=c.sourceControlProviders,e[27]=c.versionControlSystems,e[28]=x,e[29]=C):C=e[29];let w;e[30]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,K.jsx)(ot,{}),e[30]=w):w=e[30];let T;return e[31]===C?T=e[32]:(T=(0,K.jsxs)(Ne,{children:[S,C,w]}),e[31]=C,e[32]=T),T}function Mt(e){return(0,K.jsx)(Tt,{item:e,children:e.kind===`git`?(0,K.jsx)(Dt,{}):void 0},`vcs:${e.kind}`)}var Nt=jt;export{Nt as component};
|
|
2
|
-
//# sourceMappingURL=settings.source-control-x5yuK078.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as e,t}from"./react-BUfh6y28.js";import{n}from"./jsx-runtime-DJeoFXNw.js";import{C as r,D as i,Jo as a,Js as o,Wo as s,Xs as c,Ys as l,c as u,g as d,i as f,s as p}from"./utils-sVhLpEl6.js";import{Fu as m,Ln as h,Lu as g,S as _}from"./src-upZEL2qH.js";import{Fn as v,Tr as ee,Wn as y,bt as b,pt as x,wr as S}from"./runtime-DGtwOpiP.js";import{C as te,O as ne,d as C,f as re,l as ie,u as ae}from"./entities-ygRGujH7.js";import{a as w,t as T}from"./useParams-D8m5ONq0.js";import{f as E}from"./relay-Bjm0weca.js";import{s as D}from"./useSettings-DwDYuiOf.js";import{n as O}from"./server-BjY-vKW2.js";import{p as oe}from"./session-logic-C3HuEav7.js";import{a as k,i as A,n as j,o as M}from"./threadSort-Bd2rijEy.js";import{c as N,r as P}from"./projectFilesQueryState-DodSPNTI.js";import{d as F,f as I,i as se,r as ce,s as le,t as L}from"./p4ProjectFile-kzawDum5.js";import{i as R,n as ue}from"./uiStateStore-DbqU-t2g.js";var z=e(t(),1),B=n();function V(e,t){if(e.runtime?.status===`preparing`||e.runtime?.status===`queued`||e.runtime?.status===`starting`)return!0;if(e.latestUserMessageAt==null||e.session?.status===`error`)return!1;let n=Date.parse(e.latestUserMessageAt);if(Number.isNaN(n))return!1;let r=Date.parse(t.now);if(Number.isNaN(r)||Math.abs(r-n)>12e4)return!1;let i=e.latestRun??e.latestTurn??null;return i===null||[i.requestedAt,i.startedAt,i.completedAt].every(e=>e==null||Date.parse(e)<n)}function H(e){if(e.hasPendingApprovals||e.hasPendingUserInput&&(e.snoozedAt==null||e.pendingUserInputAt==null||!(Date.parse(e.pendingUserInputAt)<=Date.parse(e.snoozedAt)))||e.pendingSubagentRequest!=null)return!0;let t=e.runtime??e.session??null,n=e.latestRun??e.latestTurn??null;return(t?.status===`error`||t?.status===`failed`)&&(e.snoozedAt==null||t.updatedAt!=null&&Date.parse(t.updatedAt)>Date.parse(e.snoozedAt))||e.snoozedAt!=null&&(n?.state===`completed`||n?.status===`completed`)&&n.completedAt!=null&&Date.parse(n.completedAt)>Date.parse(e.snoozedAt)}function U(e,t){return!(e.hasPendingApprovals||e.pendingSubagentRequest!=null||V(e,t))}function W(e,t){if(e.snoozedUntil==null)return!1;let n=Date.parse(e.snoozedUntil);return Number.isNaN(n)||n<=Date.parse(t.now)?!1:!H(e)}function G(e,t){if(e.snoozedUntil==null)return null;let n=Date.parse(e.snoozedUntil);if(Number.isNaN(n))return null;if(H(e)){let t=e.latestRun??e.latestTurn??null,n=e.runtime??e.session??null;if(e.snoozedAt!=null&&(t?.state===`completed`||t?.status===`completed`)&&t.completedAt!=null&&Date.parse(t.completedAt)>Date.parse(e.snoozedAt))return t.completedAt;let r=e.pendingUserInputAt??null,i=n?.status===`error`||n?.status===`failed`?n.updatedAt??null:null;return r!=null&&e.snoozedAt!=null&&Date.parse(r)>Date.parse(e.snoozedAt)&&(i==null||Date.parse(i)<Date.parse(r))?r:n?.updatedAt??e.snoozedAt??null}return n<=Date.parse(t.now)?e.snoozedUntil:null}var K=36e5,q=18,J=9;function Y(e){return e.toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`})}function X(e,t){let n=g(m(e));return n.setHours(t,0,0,0),n}function de(e,t){let n=g(m(e));return n.setDate(n.getDate()+t),n}function fe(e){let t=g(m(e.getTime()+K)),n=g(m(e.getTime()+3*K)),r=[{id:`hour`,label:`In 1 hour`,whenLabel:Y(t),snoozedUntil:t.toISOString()},{id:`three-hours`,label:`In 3 hours`,whenLabel:Y(n),snoozedUntil:n.toISOString()}],i=X(e,q);i.getTime()-e.getTime()>K&&r.push({id:`evening`,label:`This evening`,whenLabel:Y(i),snoozedUntil:i.toISOString()});let a=X(de(e,1),J);r.push({id:`tomorrow`,label:`Tomorrow`,whenLabel:Y(a),snoozedUntil:a.toISOString()});let o=X(de(e,(1-e.getDay()+7)%7||7),J);return o.getTime()!==a.getTime()&&r.push({id:`next-week`,label:`Next week`,whenLabel:`${o.toLocaleDateString(void 0,{weekday:`short`})} ${Y(o)}`,snoozedUntil:o.toISOString()}),r}function pe(e,t){let n;if(e.mode===`duration`){let r=Number(e.amount);if(!Number.isFinite(r)||r<=0)return null;let i={minutes:6e4,hours:K,days:24*K}[e.unit];n=new Date(t.getTime()+r*i)}else if(!/^\d{4}-\d{2}-\d{2}$/.test(e.date)||!/^\d{2}:\d{2}$/.test(e.time)||(n=new Date(`${e.date}T${e.time}:00`),me(n)!==e.date||he(n)!==e.time))return null;return Number.isFinite(n.getTime())&&n.getTime()>t.getTime()?n.toISOString():null}function me(e){return`${String(e.getFullYear()).padStart(4,`0`)}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`}function he(e){return`${String(e.getHours()).padStart(2,`0`)}:${String(e.getMinutes()).padStart(2,`0`)}`}var ge=`[data-thread-item], [data-thread-selection-safe]`,_e=3,ve=160;function ye(e){let t=(0,B.c)(6),[n,r]=z.useState(null),[i,a]=z.useState(e),o,s;t[0]!==e||t[1]!==n?(o=()=>{if(e){a(!0);return}if(n===null)return;if(typeof IntersectionObserver>`u`){a(!0);return}let t=n.closest(`[data-slot="scroll-area-viewport"]`),r=new IntersectionObserver(e=>{let[t]=e;return a(t?.isIntersecting===!0)},{root:t,rootMargin:`${ve}px 0px`});return r.observe(n),()=>r.disconnect()},s=[e,n],t[0]=e,t[1]=n,t[2]=o,t[3]=s):(o=t[2],s=t[3]),z.useEffect(o,s);let c=e||i,l;return t[4]===c?l=t[5]:(l={leaseLiveStatus:c,rowRef:r},t[4]=c,t[5]=l),l}function be(e,t){let n=z.useRef(null);return e!==null&&t!==null&&(n.current={key:e,value:t}),t===null?e!==null&&n.current?.key===e?n.current.value:null:t}function xe(e,t,n,r){let i=e.indexOf(t),a=e.indexOf(n);return i===-1||a===-1?[]:e.slice(Math.min(i,a),Math.max(i,a)+1).filter(r)}async function Se(e){let t=new Set,n=null;for(let r of e.entries){let i=await e.delete(r,t);if(i!==null){if(i._tag===`Failure`){if(ee(i))break;n??=i}else t.add(r.threadKey)}}return{deletedThreadKeys:t,firstFailure:n}}async function Ce(e){let t=[],n=[];for(let r of e.entries){let i=!1,a=await e.archive(r,()=>{i=!0});if((i||a._tag===`Success`)&&t.push(r.threadKey),a._tag===`Success`)continue;let o=a;if(i)n.push(o);else return{archivedThreadKeys:t,mutationFailure:o,followupFailures:n}}return{archivedThreadKeys:t,mutationFailure:null,followupFailures:n}}function we(e){return[{id:`mark-unread`,label:`Mark unread (${e.count})`},{id:`archive`,label:`Archive (${e.count})`,disabled:e.hasRunningThread},{id:`delete`,label:`Delete (${e.count})`,destructive:!0}]}function Te(e){return e.lineage.relationshipToParent===`subagent`}function Ee(e,t,n){let r=b(e);return e.filter(e=>e.archivedAt===null&&!x({environmentId:e.environmentId,threadId:e.id},e.lineage,n)&&r(e)&&(t===null||t.has(`${e.environmentId}:${e.projectId}`)))}var De={"Pending Approval":5,"Awaiting Input":4,Working:3,Connecting:3,Waiting:2.5,"Plan Ready":2,Completed:1};function Oe(e){let t=e.setTimeoutFn??globalThis.setTimeout,n=e.clearTimeoutFn??globalThis.clearTimeout,r=!1,i=null,a=()=>{i!==null&&(n(i),i=null)};return{sync:n=>{n?r||i!==null||(i=t(()=>{i=null,r=!0,e.onVisibilityChange(!0)},e.delayMs)):(a(),r&&(r=!1,e.onVisibilityChange(!1)))},dispose:()=>{a()}}}function ke(){let e=(0,B.c)(5),[t,n]=z.useState(!1),r=z.useRef(null),i,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{let e=Oe({delayMs:200,onVisibilityChange:e=>{n(e)},setTimeoutFn:window.setTimeout.bind(window),clearTimeoutFn:window.clearTimeout.bind(window)});return r.current=e,()=>{e.dispose(),r.current=null}},a=[],e[0]=i,e[1]=a):(i=e[0],a=e[1]),z.useEffect(i,a);let o;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=e=>{r.current?.sync(e)},e[2]=o):o=e[2];let s=o,c;return e[3]===t?c=e[4]:(c={showThreadJumpHints:t,updateThreadJumpHintsVisibility:s},e[3]=t,e[4]=c),c}function Ae(e,t){return e===void 0?t:e??void 0}function je(e){if(!e.latestRun?.completedAt)return!1;let t=Date.parse(e.latestRun.completedAt);if(Number.isNaN(t)||!e.lastVisitedAt)return!1;let n=Date.parse(e.lastVisitedAt);return Number.isNaN(n)?!0:t>n}function Me(e){return e===null||!e.closest(ge)}function Ne(e){return e>1}function Pe(e,t){return e===null||!(`closest`in e)||typeof e.closest!=`function`?null:e.closest(t)}function Fe(e){return typeof e!=`object`||!e?!1:Pe(e,`a[href]`)!==null||Pe(`parentElement`in e&&e.parentElement!==null&&typeof e.parentElement==`object`?e.parentElement:null,`a[href]`)!==null}function Ie(e){let{getId:t,getPreferenceIds:n,items:r,preferredIds:i}=e;if(i.length===0)return[...r];let a=new Map;for(let[e,i]of r.entries()){let r=n?.(i)??[t(i)];for(let t of new Set(r)){let n=a.get(t);n?n.push(e):a.set(t,[e])}}let o=new Set,s=i.flatMap(e=>{let t=a.get(e)?.find(e=>!o.has(e));return t===void 0?[]:(o.add(t),[r[t]])}),c=r.filter((e,t)=>!o.has(t));return[...s,...c]}function Le(e,t=_e){return e.slice(0,Math.max(0,t))}function Re(e){let{currentThreadId:t,direction:n,threadIds:r}=e;if(r.length===0)return null;if(t===null)return n===`previous`?r.at(-1)??null:r[0]??null;let i=r.indexOf(t);return i===-1?null:n===`previous`?i>0?r[i-1]??null:null:i<r.length-1?r[i+1]??null:null}function ze(e){return e.button===2||e.isMac&&e.button===0&&e.ctrlKey}function Be(e){return e.hasPendingApprovals||e.pendingSubagentRequest===`approval`?`approval`:e.hasPendingUserInput||e.pendingSubagentRequest===`user_input`?`input`:e.runtime!==null&&[`preparing`,`queued`,`starting`,`running`,`waiting`].includes(e.runtime.status)?`working`:e.runtime?.status===`idle`?`waiting`:e.runtime?.status===`failed`?e.runtime.lastErrorClass===`usage_limit`?`limited`:`failed`:`ready`}function Ve(e,t){let n=k(e,t),r=n.filter(e=>e.pinnedAt!=null);return r.length===0?n:[...A(r),...n.filter(e=>e.pinnedAt==null)]}function He(e,t){let n=u(t);if(n.length===0)return!1;let r=u(y(e).join(` `));return n.split(` `).every(e=>r.includes(e))}function Ue(e){let{thread:t}=e;return t.hasPendingApprovals||t.pendingSubagentRequest===`approval`?{label:`Pending Approval`,colorClass:`text-amber-600 dark:text-amber-300/90`,dotClass:`bg-amber-500 dark:bg-amber-300/90`,pulse:!1}:t.hasPendingUserInput||t.pendingSubagentRequest===`user_input`?{label:`Awaiting Input`,colorClass:`text-indigo-600 dark:text-indigo-300/90`,dotClass:`bg-indigo-500 dark:bg-indigo-300/90`,pulse:!1}:t.runtime?.status===`running`||t.runtime?.status===`waiting`?{label:`Working`,colorClass:`text-sky-600 dark:text-sky-300/80`,dotClass:`bg-sky-500 dark:bg-sky-300/80`,pulse:!0}:t.runtime?.status===`preparing`||t.runtime?.status===`starting`||t.runtime?.status===`queued`?{label:`Connecting`,colorClass:`text-sky-600 dark:text-sky-300/80`,dotClass:`bg-sky-500 dark:bg-sky-300/80`,pulse:!0}:v(t.pendingBackgroundTasks??[])?{label:`Waiting`,colorClass:`text-sidebar-muted-foreground`,dotClass:`bg-sidebar-muted-foreground`,pulse:!1}:!t.hasPendingUserInput&&t.interactionMode===`plan`&&oe(t.latestRun,t.runtime)&&t.hasActionableProposedPlan?{label:`Plan Ready`,colorClass:`text-violet-600 dark:text-violet-300/90`,dotClass:`bg-violet-500 dark:bg-violet-300/90`,pulse:!1}:je(t)?{label:`Completed`,colorClass:`text-emerald-600 dark:text-emerald-300/90`,dotClass:`bg-emerald-500 dark:bg-emerald-300/90`,pulse:!1}:null}function We(e){let t=null;for(let n of e)n!==null&&(t===null||De[n.label]>De[t.label])&&(t=n);return t}function Ge(e){let t=t=>e.items.filter(e=>e.status===t).length,n=e.items.length,r=t(`merged`),i=t(`skipped`),a=t(`running`),o=e.status===`running`?e.items.filter(e=>e.status===`needs_input`):[],s=`${r} of ${n} merged`;return{merged:r,total:n,waiting:o,label:o.length===1?`${o[0].key} is waiting for you`:o.length>1?`${o.length} tickets are waiting for you`:e.status===`stopped`?`Stopped, ${s}`:e.status===`finished`?i>0?`${s}, ${i} skipped`:s:a>0?`${s}, ${a} running`:s}}function Ke(e,t,n){let r=new Map,i=new Map;for(let n of e)r.set(t(n),n),n.pinnedAt===null&&i.set(t(n),n);let a=e=>{let r=new Set([t(e)]),a=e;for(;;){if(a.sweep!=null)return t(a);let e=n(a);if(e===null)return t(a);let o=i.get(e);if(o===void 0||r.has(e))return e;r.add(e),a=o}},o=new Map,s=new Map;for(let e of i.values()){let n=a(e);o.set(t(e),n);let r=s.get(n);r?r.push(e):s.set(n,[e])}let c=[],l=new Set;for(let n of e){let e=o.get(t(n)),i=e===void 0?void 0:s.get(e);if(e===void 0||i===void 0||i.length<2&&r.get(e)?.sweep==null){c.push({kind:`thread`,thread:n});continue}if(l.has(e))continue;l.add(e);let a=i.find(n=>t(n)===e)??null;c.push({kind:`sweep`,group:{key:e,launcher:a,leader:r.get(e)??null,members:i.filter(e=>e!==a)}})}return c}function qe(e,t,n){let r=e.launcher===null?[...e.members]:[e.launcher,...e.members];return t?r.filter(n):r}function Je(e,t){if(!t.projectExpanded)return{entries:[],overflowing:!1};let n=[],r=0;for(let i of e){if(n.length>0&&r>=t.previewCount)break;n.push(i),r+=t.rowCount(i)}let i=n.length<e.length;return{entries:t.isThreadListExpanded?e:n,overflowing:i}}function Ye(e,t){let n=e=>t.keyOf(e)===t.activeThreadKey,r=e=>e.kind===`thread`?[e.thread]:qe(e.group,t.collapsedGroupKeys.includes(e.group.key),n),i=Je(Ke(e,t.keyOf,t.launcherKeyOf),{projectExpanded:t.projectExpanded,isThreadListExpanded:t.isThreadListExpanded,previewCount:t.previewCount,rowCount:e=>Math.max(1,r(e).length)}),a=new Set(i.entries.flatMap(e=>e.kind===`thread`?[e.thread]:e.group.launcher===null?e.group.members:[e.group.launcher,...e.group.members]));return{entries:i.entries,overflowing:i.overflowing,rows:i.entries.flatMap(r),hiddenThreads:e.filter(e=>!a.has(e))}}function Xe(e,t){let n=0;for(let t=0;t<e.length;t+=1)n=n*31+e.charCodeAt(t)>>>0;return n%t}function Ze(e){let{deletedThreadId:t,deletedThreadIds:n,sortOrder:r,now:i,threads:a}=e,o=a.find(e=>e.id===t);return o?k(a.filter(e=>e.projectId===o.projectId&&e.id!==t&&!n?.has(e.id)&&e.settledOverride!==`settled`&&!W(e,{now:i})&&!Te(e)&&e.sideChat!==!0),r)[0]?.id??null:null}function Qe(e,t,n){return t.length>0?t.reduce((e,t)=>Math.max(e,j(t,n)),-1/0):n===`created_at`?M(e.createdAt)??-1/0:M(e.updatedAt??e.createdAt)??-1/0}function Z(e,t,n,r){return t===`manual`?[...e]:e.map(e=>({project:e,timestamp:Qe(e,n(e),t)})).sort((e,t)=>(t.timestamp===e.timestamp?0:t.timestamp>e.timestamp?1:-1)||r(e.project,t.project)).map(({project:e})=>e)}function $e(e,t,n){let r=new Map;for(let e of t){let t=r.get(e.projectId)??[];t.push(e),r.set(e.projectId,t)}return Z(e,n,e=>r.get(e.id)??[],(e,t)=>e.title.localeCompare(t.title)||e.id.localeCompare(t.id))}function et(e,t,n){let r=new Map(e.flatMap(e=>e.memberProjectRefs.map(t=>[`${t.environmentId}\0${t.projectId}`,e.projectKey]))),i=new Map;for(let e of t){if(e.archivedAt!==null)continue;let t=r.get(`${e.environmentId}\0${e.projectId}`);if(!t)continue;let n=i.get(t);n?n.push(e):i.set(t,[e])}return Z(e,n,e=>i.get(e.projectKey)??[],(e,t)=>e.title.localeCompare(t.title)||e.projectKey.localeCompare(t.projectKey))}function tt(e,t,n,r){return et(e,Ee(t,null,r),n)}function nt(e,t,n){let r=(e,t)=>`${e}\u0000${t}`,i=new Map;for(let e of t){if(e.archivedAt!==null)continue;let t=r(e.environmentId,e.projectId),n=i.get(t)??[];n.push(e),i.set(t,n)}return Z(e,n,e=>i.get(r(e.environmentId,e.id))??[],(e,t)=>e.title.localeCompare(t.title)||e.environmentId.localeCompare(t.environmentId)||e.id.localeCompare(t.id))}function Q(e){return e.envMode!==`local`&&e.newWorktreesStartFromOrigin}function rt(e){return e.projectDefaultSelection??(e.carrySourceDraftId===e.destinationDraftId?null:e.carrySelection)}function it(e){let t=e?.activeProvider;return e?.modelSelectionExplicit===!0&&t!=null&&e.modelSelectionByProvider[t]!==void 0}function at(e){return e.activeThread?o(e.activeThread.environmentId,e.activeThread.projectId):e.activeDraftThread?o(e.activeDraftThread.environmentId,e.activeDraftThread.projectId):e.defaultProjectRef}async function ot(e){let t=at(e);return t?(await e.handleNewThread(t),!0):!1}async function st(e,t){let n=await S(s,P(e,t,_),{reportDefect:!1,reportFailure:!1}),r=N(e,t,_,N(e,t,n._tag===`Success`?n.value.relativePath:_,n._tag===`Success`?n.value:null));return r===null||r.truncated?null:L(r.contents)}function $(e){return{...e?.branch===void 0?{}:{branch:e.branch},...e?.worktreePath===void 0?{}:{worktreePath:e.worktreePath},...e?.envMode===void 0?{}:{envMode:e.envMode},...e?.startFromOrigin===void 0?{}:{startFromOrigin:e.startFromOrigin}}}function ct(){let e=(0,B.c)(7),t=a(O),n=D(I),o=w(),s;e[0]===o.state.matches?s=e[1]:(s=()=>{let e=o.state.matches[o.state.matches.length-1]?.params??{};return E(e)},e[0]=o.state.matches,e[1]=s);let u=s,m;return e[2]!==t||e[3]!==u||e[4]!==n||e[5]!==o?(m=(e,a)=>{let s=ae(),m=t.get(e.environmentId)?.settings??h,{getComposerDraft:g,getDraftSessionByLogicalProjectKey:_,getDraftSession:v,getDraftThread:ee,applyStickyState:y,setDraftThreadContext:b,setLogicalProjectDraftThreadId:x,setModelSelection:S}=i.getState(),te=o.state.location.href,ne=()=>o.state.location.href!==te,w=u(),T=w?.kind===`server`?C(w.threadRef):null,E=w?.kind===`draft`?v(w.draftId):null,D=w?g(w.kind===`server`?w.threadRef:w.draftId):null,O=D?.activeProvider??null,oe=(O?D?.modelSelectionByProvider[O]??null:null)??T?.modelSelection??null,k=D?.interactionMode??T?.interactionMode??E?.interactionMode??null,A=s.find(t=>t.id===e.projectId&&t.environmentId===e.environmentId),j=()=>ne()||A!==void 0&&ie(e)===null,M=se(m,A?.id??null,A),N=M.settings.defaultModelSelection,P=M.settings.defaultRuntimeMode,F=e=>rt({projectDefaultSelection:N??null,carrySelection:oe,carrySourceDraftId:w?.kind===`draft`?w.draftId:null,destinationDraftId:e}),I=async()=>{let n=A!==void 0&&M.settings.defaultThreadEnvMode===null?await st(A.environmentId,A.workspaceRoot):null;return ce({projectSettings:se(m,A?.id??null,A,n),workspaceRoot:A?.workspaceRoot??null,newProjectsRoot:t.get(e.environmentId)?.newProjectsRoot,projectHasThreads:re().some(t=>t.environmentId===e.environmentId&&t.projectId===e.projectId)})},L=A?le(A,n):c(e),R=a?.branch!==void 0,ue=a?.worktreePath!==void 0,z=a?.envMode!==void 0,B=a?.startFromOrigin!==void 0,V=_(L),H=V?l(V.environmentId,V.threadId):null,U=V!==null&&V.promotedTo==null&&H!==null&&C(H)===null?V:null;H&&U===null&&r(H);let W=U&&!d(g(U.draftId))?U:null,G=w?w.kind===`server`?ee(w.threadRef):v(w.draftId):null;if(W)return(async()=>{let t=w?.kind===`draft`&&w.draftId===W.draftId,n=R||ue||z||B,r=null;if(n)r=$(a);else if(!t){let e=await I();if(j())return null;let t=u(),n=t?.kind===`draft`&&t.draftId===W.draftId,i=H!==null&&C(H)!==null,a=_(L)?.draftId!==W.draftId,o=d(g(W.draftId));if(n||i||a||o)return null;r={branch:null,worktreePath:null,envMode:e,startFromOrigin:Q({envMode:e,newWorktreesStartFromOrigin:M.settings.newWorktreesStartFromOrigin})}}if(r&&b(W.draftId,{...r,...t?{}:{runtimeMode:P},...k?{interactionMode:k}:{}}),!it(g(W.draftId))){y(W.draftId);let e=F(W.draftId);e&&S(W.draftId,e,{replaceOptions:!0})}x(L,e,W.draftId,{threadId:W.threadId,...r,...t?{}:{runtimeMode:P},...k?{interactionMode:k}:{}});let i={draftId:W.draftId,threadId:W.threadId},s=u();return s?.kind===`draft`&&s.draftId===W.draftId||await o.navigate({to:`/draft/$draftId`,params:{draftId:W.draftId},replace:a?.replace??!1}),i})();if(G&&w?.kind===`draft`&&G.logicalProjectKey===L&&G.promotedTo==null&&!d(g(w.draftId)))return(R||ue||z||B)&&b(w.draftId,$(a)),x(L,e,w.draftId,{threadId:G.threadId,createdAt:G.createdAt,runtimeMode:G.runtimeMode,interactionMode:G.interactionMode,...$(a)}),Promise.resolve({draftId:w.draftId,threadId:G.threadId});let K=f(),q=p(),J=new Date().toISOString();return(async()=>{let t=a?.envMode??await I();if(j())return null;let n=_(L);if(n&&n.draftId!==V?.draftId&&C(l(n.environmentId,n.threadId))===null)return x(L,e,n.draftId,{threadId:n.threadId,createdAt:n.createdAt,runtimeMode:n.runtimeMode,interactionMode:n.interactionMode,...$(a)}),await o.navigate({to:`/draft/$draftId`,params:{draftId:n.draftId},replace:a?.replace??!1}),{draftId:n.draftId,threadId:n.threadId};x(L,e,K,{threadId:q,createdAt:J,branch:a?.branch??null,worktreePath:a?.worktreePath??null,envMode:t,startFromOrigin:a?.startFromOrigin??Q({envMode:t,newWorktreesStartFromOrigin:M.settings.newWorktreesStartFromOrigin}),runtimeMode:P,...k?{interactionMode:k}:{}}),y(K);let r=F(K);return r&&S(K,r,{replaceOptions:!0}),await o.navigate({to:`/draft/$draftId`,params:{draftId:K},replace:a?.replace??!1}),{draftId:K,threadId:q}})()},e[2]=t,e[3]=u,e[4]=n,e[5]=o,e[6]=m):m=e[6],m}function lt(){let e=(0,B.c)(16),t=R(pt),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={strict:!1,select:ft},e[0]=n):n=e[0];let r=T(n),a=r?.kind===`server`?r.threadRef:null,s=r?.kind===`draft`?r.draftId:null,c=ne(a),l=i(dt),u;e[1]!==l||e[2]!==r?(u=()=>r?r.kind===`server`?l(r.threadRef):i.getState().getDraftSession(r.draftId):null,e[1]=l,e[2]=r,e[3]=u):u=e[3];let d=i(u),f=te(),p;e[4]!==t||e[5]!==f?(p=Ie({items:f,preferredIds:t,getId:F,getPreferenceIds:ut}),e[4]=t,e[5]=f,e[6]=p):p=e[6];let m=p,h=ct(),g;e[7]===m[0]?g=e[8]:(g=m[0]?o(m[0].environmentId,m[0].id):null,e[7]=m[0],e[8]=g);let _;return e[9]!==d||e[10]!==c||e[11]!==h||e[12]!==s||e[13]!==a||e[14]!==g?(_={activeDraftThread:d,activeThread:c,defaultProjectRef:g,handleNewThread:h,routeDraftId:s,routeThreadRef:a},e[9]=d,e[10]=c,e[11]=h,e[12]=s,e[13]=a,e[14]=g,e[15]=_):_=e[15],_}function ut(e){return[F(e),ue(e.workspaceRoot)]}function dt(e){return e.getDraftThread}function ft(e){return E(e)}function pt(e){return e.projectOrder}export{tt as A,pe as B,Be as C,et as D,Me as E,ke as F,G as H,U as I,W as L,Ge as M,be as N,$e as O,ye as P,me as R,xe as S,Ue as T,fe as V,Ye as _,at as a,Re as b,we as c,Ze as d,Le as f,Ne as g,Te as h,Q as i,Ve as j,nt as k,Xe as l,Fe as m,ct as n,ot as o,ze as p,it as r,Ce as s,lt as t,Se as u,Ie as v,Ae as w,We as x,He as y,he as z};
|
|
2
|
-
//# sourceMappingURL=useHandleNewThread-Do-y1VVt.js.map
|