@p4code/cli 0.9.5 → 0.9.7
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/bin.mjs +1 -1
- package/dist/{binCli-CVJEJMnj.mjs → binCli-BDhIHi_h.mjs} +64792 -61582
- package/dist/client/.vite/manifest.json +1999 -1999
- package/dist/client/assets/{2NI2N5EU-B7VyxMN2.js → 2NI2N5EU-sFO2CLlt.js} +2 -2
- package/dist/client/assets/{4UO7MD6I-_i-iLqe4.js → 4UO7MD6I-CcT8Zfhc.js} +2 -2
- package/dist/client/assets/{5B3SVYGG-CARRzQXp.js → 5B3SVYGG-Bd_wcJLx.js} +2 -2
- package/dist/client/assets/{5GK6JWQ2-Bmp0940o.js → 5GK6JWQ2-Cp0eFbVE.js} +2 -2
- package/dist/client/assets/{5N7A7DKN-Vb8SXW7T.js → 5N7A7DKN-Czpp-hnK.js} +2 -2
- package/dist/client/assets/{5OC2THR4-y3jeEKWa.js → 5OC2THR4-C6OEDFC6.js} +2 -2
- package/dist/client/assets/{5S6HY5KT-Bfbcbcrn.js → 5S6HY5KT-DUo-T0Pv.js} +2 -2
- package/dist/client/assets/{6IMQ5BUJ-DALpMJ8I.js → 6IMQ5BUJ-ZY7dYS3y.js} +2 -2
- package/dist/client/assets/{6OLKWJ4F-yeoADL6U.js → 6OLKWJ4F-KMXuFNsu.js} +2 -2
- package/dist/client/assets/{74OO7NKP-BSRT49ed.js → 74OO7NKP-aJ6kvSey.js} +2 -2
- package/dist/client/assets/{75O6YZUN-DMpxNGcI.js → 75O6YZUN-DIHv8J29.js} +2 -2
- package/dist/client/assets/{77XECAW3-Cn248Dt-.js → 77XECAW3-JuMUaReb.js} +2 -2
- package/dist/client/assets/{ABYRPUBD-Cv-xq6SK.js → ABYRPUBD-2Yn9PEzm.js} +2 -2
- package/dist/client/assets/AlertDialogRoot-CW_9Mq9o.js +2 -0
- package/dist/client/assets/{AnimatedHeight-CqEEdPxS.js → AnimatedHeight-Cd_V66Dq.js} +2 -2
- package/dist/client/assets/{AuthSurfaceShell-8r4Oh4o8.js → AuthSurfaceShell-z6JhHCp1.js} +2 -2
- package/dist/client/assets/{BB2UYUI2-CI5XHuPZ.js → BB2UYUI2-D5xDmPxh.js} +2 -2
- package/dist/client/assets/{BUM34MOA-BfLbkDc3.js → BUM34MOA-B9FvXzqk.js} +2 -2
- package/dist/client/assets/{CEQABKGZ-DpqVSfdQ.js → CEQABKGZ-Dx_FGvDv.js} +2 -2
- package/dist/client/assets/{CXAC5362-C31Wqp-g.js → CXAC5362-DGpvh6KQ.js} +2 -2
- package/dist/client/assets/ChatGptUsageButton-hgahwAd8.js +2 -0
- package/dist/client/assets/{ChatMarkdown-DWX9SN0I.js → ChatMarkdown-DzBQ6o2z.js} +7 -7
- package/dist/client/assets/{CheckboxIndicator-COjg4Es5.js → CheckboxIndicator-mFuXoA30.js} +2 -2
- package/dist/client/assets/{ClippedText-DpqkIszs.js → ClippedText-3QYVxO0t.js} +2 -2
- package/dist/client/assets/{CodexSetupSection.logic-C8_mcFTG.js → CodexSetupSection.logic-BBoRdk5p.js} +2 -2
- package/dist/client/assets/{ComboboxClear-xR2R2-pv.js → ComboboxClear-BNtFgSHF.js} +2 -2
- package/dist/client/assets/{ComboboxGroupLabel-H2tPGIr6.js → ComboboxGroupLabel-sq7Mhle4.js} +2 -2
- package/dist/client/assets/{CommandBlock-BU2CuIfo.js → CommandBlock-DHXlU5C7.js} +2 -2
- package/dist/client/assets/{ComposerPromptEditor-T4veXUFB.js → ComposerPromptEditor-qOyyjScc.js} +4 -4
- package/dist/client/assets/{CompositeRoot-BIHvyYsZ.js → CompositeRoot-DY7iUA_s.js} +2 -2
- package/dist/client/assets/{ConnectionDiagnosisDetails-Blx3b1Io.js → ConnectionDiagnosisDetails-xhfXplsX.js} +2 -2
- package/dist/client/assets/{ConnectionStatusDot-VMSwkMx4.js → ConnectionStatusDot-BBmbajLh.js} +2 -2
- package/dist/client/assets/{DRLTVNUE-CgTmY7aZ.js → DRLTVNUE-v1NbOvdX.js} +2 -2
- package/dist/client/assets/{DYY6UVD2-CHyCh3iy.js → DYY6UVD2-Dgv-rkDR.js} +2 -2
- package/dist/client/assets/{DevicePanel-Du9xpjah.js → DevicePanel-Cyg1Yk9F.js} +2 -2
- package/dist/client/assets/{DeviceSetup-3I8BZ0G5.js → DeviceSetup-C2Zve35j.js} +2 -2
- package/dist/client/assets/{DialogTitle-ueL4fmrv.js → DialogTitle-9BKGozK3.js} +2 -2
- package/dist/client/assets/{DiffCommentAnnotation-Cb3p3y9X.js → DiffCommentAnnotation-shKWlLXb.js} +2 -2
- package/dist/client/assets/{DiffFileTree-CDCTH6OS.js → DiffFileTree-Cw3IoBPF.js} +2 -2
- package/dist/client/assets/{DiffPanel-vcZG1S2-.js → DiffPanel-DhYILwt4.js} +2 -2
- package/dist/client/assets/{DiffWorkerPoolProvider-WP0Muna6.js → DiffWorkerPoolProvider-DwAxcJ_J.js} +2 -2
- package/dist/client/assets/{EmbeddedDesign-CpBO6uA7.js → EmbeddedDesign-BwBy_4w8.js} +2 -2
- package/dist/client/assets/{EnvironmentMachineIcon-CAhjzBdd.js → EnvironmentMachineIcon-KqncPHh8.js} +2 -2
- package/dist/client/assets/{ExpandableText-BOZbK7rv.js → ExpandableText-CEDcsLah.js} +2 -2
- package/dist/client/assets/{FNOVOB4O-BOUHvPNW.js → FNOVOB4O-D_GK0hHx.js} +2 -2
- package/dist/client/assets/{FieldControl-CtZ34LP0.js → FieldControl-CVCCrg1T.js} +2 -2
- package/dist/client/assets/{FileDiff-DU2VaZza.js → FileDiff-CkTyrHs_.js} +2 -2
- package/dist/client/assets/{FilePreviewPanel-BT7yD1Je.js → FilePreviewPanel-pD3XdWFT.js} +6 -6
- package/dist/client/assets/{FoldedSettingsSection-DyeK8ENP.js → FoldedSettingsSection-VcaJg5wH.js} +2 -2
- package/dist/client/assets/{FormContext-0ymX4Zdq.js → FormContext-CbLQYizu.js} +2 -2
- package/dist/client/assets/{HDGCDEEZ-DhgkYpl1.js → HDGCDEEZ-B_87CdVQ.js} +2 -2
- package/dist/client/assets/{HSJLKHB7-LRZ0mZom.js → HSJLKHB7-BWrZ2oua.js} +2 -2
- package/dist/client/assets/{Icons-DtaiKNi8.js → Icons-CQY6Z_tn.js} +2 -2
- package/dist/client/assets/Input-Bple6iXe.js +2 -0
- package/dist/client/assets/JZOYTAAL-BMx5dMBx.js +1 -0
- package/dist/client/assets/{K3MD6TGW-Bms96D04.js → K3MD6TGW-Dl_xvRh8.js} +2 -2
- package/dist/client/assets/{K7RP3OMA-C4yeqngm.js → K7RP3OMA-CMEWK15T.js} +2 -2
- package/dist/client/assets/{KeybindingsSettings.logic-Z0gn-b9C.js → KeybindingsSettings.logic-6SIFjdPx.js} +2 -2
- package/dist/client/assets/{LHDIQX7Q-D-iPFOmd.js → LHDIQX7Q-BYodQH-L.js} +2 -2
- package/dist/client/assets/{LUXOKEGN-CJld9Vod.js → LUXOKEGN-qRQxfpo6.js} +2 -2
- package/dist/client/assets/{MathTypeset-DVrs3WeR.js → MathTypeset-DEu7ewh2.js} +2 -2
- package/dist/client/assets/{N3JZAHOW-DHlQszLH.js → N3JZAHOW-D39dZXbh.js} +2 -2
- package/dist/client/assets/{NUIALGQ3-BZrVZkDz.js → NUIALGQ3-DesFcM7Z.js} +2 -2
- package/dist/client/assets/{NoProjectsHero-DvT0SZTY.js → NoProjectsHero-DR2kWrZ4.js} +2 -2
- package/dist/client/assets/{O65XPQGZ-1Tib5Wm-.js → O65XPQGZ-xGzNLFO_.js} +2 -2
- package/dist/client/assets/{O7XIQ6OM-B-jqX1ax.js → O7XIQ6OM-D_A5CSzR.js} +2 -2
- package/dist/client/assets/{OFQON5FD-Z7ov13yL.js → OFQON5FD-wUDkF0Vl.js} +2 -2
- package/dist/client/assets/{P4ConnectAccountPages-CLjGS23g.js → P4ConnectAccountPages-CCDq5J6P.js} +2 -2
- package/dist/client/assets/{P4ConnectSidebarSignIn-Bqoai3_p.js → P4ConnectSidebarSignIn-CX9WTYV1.js} +2 -2
- package/dist/client/assets/{PJQHF43J-BxO9Ed7Y.js → PJQHF43J-CDUmALBZ.js} +2 -2
- package/dist/client/assets/{PanelLayoutControls-CikZjTVk.js → PanelLayoutControls-C34I_7ba.js} +6 -6
- package/dist/client/assets/{PierreEntryIcon-8lVXHvon.js → PierreEntryIcon-Cuq8Bvxz.js} +2 -2
- package/dist/client/assets/{PopoverHandle-CY48vabI.js → PopoverHandle-CaIeAISC.js} +2 -2
- package/dist/client/assets/{PreviewPanel-BsOxA7PG.js → PreviewPanel-CG-MeUjw.js} +2 -2
- package/dist/client/assets/{ProjectDefaultsSettings-B6A-veuE.js → ProjectDefaultsSettings-Bxz5MdOY.js} +2 -2
- package/dist/client/assets/{ProjectFavicon-CYE59XXq.js → ProjectFavicon-DCKipqYA.js} +3 -3
- package/dist/client/assets/{ProjectIconPickerDialog-B29JEJpT.js → ProjectIconPickerDialog-DqEEBoMA.js} +2 -2
- package/dist/client/assets/{ProjectMonogram-DglZOJVY.js → ProjectMonogram-CjI4Va2u.js} +2 -2
- package/dist/client/assets/{ProviderAuthTerminal-Du0soMRt.js → ProviderAuthTerminal-UctA57cb.js} +2 -2
- package/dist/client/assets/{ProviderModelPicker-DSQrIw5c.js → ProviderModelPicker-QRPUsruj.js} +2 -2
- package/dist/client/assets/{ProviderSettingsForm-BDstI6TK.js → ProviderSettingsForm-BEq2pSXW.js} +2 -2
- package/dist/client/assets/{PullRequestCodeTab-D5rLVyxt.js → PullRequestCodeTab-DQDQ2-AY.js} +2 -2
- package/dist/client/assets/{RHNBAITX-CFRd4LdH.js → RHNBAITX-C7xWa0v8.js} +2 -2
- package/dist/client/assets/{ReadOnlySourcePreview-DumpnOnX.js → ReadOnlySourcePreview-BzoQdNnt.js} +2 -2
- package/dist/client/assets/{RenderErrorBoundary-BfOIzAFb.js → RenderErrorBoundary-BQJlFG3C.js} +2 -2
- package/dist/client/assets/{SLD4V6NK-BzuDe7TY.js → SLD4V6NK-DmuNvRiU.js} +2 -2
- package/dist/client/assets/{ScheduledTasksSettings-BZDLn8vh.js → ScheduledTasksSettings-BslOTNM_.js} +2 -2
- package/dist/client/assets/{ScopedSwitch-BDRueGC0.js → ScopedSwitch-B93s5VHZ.js} +2 -2
- package/dist/client/assets/{ScrollAreaCorner-CiDeFRJG.js → ScrollAreaCorner-Dhc-TjWb.js} +2 -2
- package/dist/client/assets/{SecretInput-Bpz_flBS.js → SecretInput-B2ihrOsq.js} +2 -2
- package/dist/client/assets/{SelectScrollUpArrow-UhJfY29a.js → SelectScrollUpArrow-krk2Fk-_.js} +2 -2
- package/dist/client/assets/{SettingsPanels-D9i_jn8e.js → SettingsPanels-DxAtLrQJ.js} +4 -4
- package/dist/client/assets/{SettingsPanels.logic-BO_7fD50.js → SettingsPanels.logic-Bl4RFuAy.js} +2 -2
- package/dist/client/assets/{SettingsScopeNotice-DYhbVTKo.js → SettingsScopeNotice-LfKqlEQx.js} +2 -2
- package/dist/client/assets/{SidebarStageBackdrop-CXA-VL7f.js → SidebarStageBackdrop-6e7hvpNA.js} +2 -2
- package/dist/client/assets/{T3PCR2KE-Iz8AFoGq.js → T3PCR2KE-CiK8lMNJ.js} +2 -2
- package/dist/client/assets/{TKWO2OVW-BiMX9mgc.js → TKWO2OVW-BdJsjYHm.js} +2 -2
- package/dist/client/assets/{TSHNXIZL-T9Jpa5Rz.js → TSHNXIZL-CRJjDWez.js} +2 -2
- package/dist/client/assets/{ThemeEditorPanel-DFn3Yrn1.js → ThemeEditorPanel-D8zwe2Nv.js} +2 -2
- package/dist/client/assets/{ThreadTerminalDrawer-C1eykNJF.js → ThreadTerminalDrawer-Dscicgos.js} +2 -2
- package/dist/client/assets/{TooltipViewport-DOp3kVQY.js → TooltipViewport-MMBPNW3u.js} +2 -2
- package/dist/client/assets/{UQJE5E4I-yF2s3czF.js → UQJE5E4I-V8ZBwQ4s.js} +2 -2
- package/dist/client/assets/{USNYFO5S-DyMrZB5n.js → USNYFO5S-B5nY9-j7.js} +2 -2
- package/dist/client/assets/{Virtualizer-VNN198aV.js → Virtualizer-CzVPu6W0.js} +2 -2
- package/dist/client/assets/{WEVWDWVA-BbR-bYXa.js → WEVWDWVA-roZxnVYX.js} +2 -2
- package/dist/client/assets/{WorkspaceBreadcrumb-Bp8cxbFz.js → WorkspaceBreadcrumb-DHwNjJoP.js} +2 -2
- package/dist/client/assets/{WorkspacePageContainer-CZSuBU6k.js → WorkspacePageContainer-BEL6F4GP.js} +2 -2
- package/dist/client/assets/{WorkspacePageHeader-CTjYrqv6.js → WorkspacePageHeader-eTadd7tx.js} +2 -2
- package/dist/client/assets/{X5RFHQXM-CMXzdpa6.js → X5RFHQXM-3waZyk5u.js} +2 -2
- package/dist/client/assets/{X62E3GBT-C88V1WXc.js → X62E3GBT-B2f7sUz7.js} +2 -2
- package/dist/client/assets/{XBNEOJTC-ZXo4ara-.js → XBNEOJTC-C4ImOubv.js} +2 -2
- package/dist/client/assets/{YHV2MVVZ-Ddw8TiKv.js → YHV2MVVZ-D1HZySVT.js} +2 -2
- package/dist/client/assets/{YURCZMG2-CRwbbhO8.js → YURCZMG2-B95ZHwnq.js} +2 -2
- package/dist/client/assets/{YVG2LODB-yVeDUCXO.js → YVG2LODB-Ba9ElJXR.js} +2 -2
- package/dist/client/assets/_chat-CAKiqq8Z.js +45 -0
- package/dist/client/assets/{_chat.design-T6D4XSc2.js → _chat.design-xDdLq2Pm.js} +2 -2
- package/dist/client/assets/{_chat.index-BrgyAe9a.js → _chat.index-DZFF0AGm.js} +2 -2
- package/dist/client/assets/{_chat.new-C7fjsbGq.js → _chat.new-UcQULkDl.js} +2 -2
- package/dist/client/assets/{_chat.pull-requests-CToI_h67.js → _chat.pull-requests-wqTxTIsj.js} +2 -2
- package/dist/client/assets/{alert-kMZL9jzU.js → alert-BeaSxmEt.js} +2 -2
- package/dist/client/assets/{assetUrls-CDYiJSSP.js → assetUrls-DSRw9lrZ.js} +2 -2
- package/dist/client/assets/{assets-DnrC_hwl.js → assets-DhuueFtK.js} +2 -2
- package/dist/client/assets/{browserHistoryStore-CPBdgvvO.js → browserHistoryStore-Cb-pQxvb.js} +2 -2
- package/dist/client/assets/{browserLinkTarget-oPTgFwDG.js → browserLinkTarget-DnEgq1JN.js} +2 -2
- package/dist/client/assets/{checkbox-CP-w8eOU.js → checkbox-BwnKO_BU.js} +2 -2
- package/dist/client/assets/{color-picker-CZcpcrrS.js → color-picker-D8AK_9SM.js} +2 -2
- package/dist/client/assets/{combobox-BHK8wQLo.js → combobox-CXEo8oot.js} +2 -2
- package/dist/client/assets/{command-Bps-UDxp.js → command-BAykm7lf.js} +2 -2
- package/dist/client/assets/{connect-CvkwK1ES.js → connect-DsnzdYd-.js} +2 -2
- package/dist/client/assets/{connect-agent-B9W36itu.js → connect-agent-BHUM9uJ5.js} +2 -2
- package/dist/client/assets/{design-BPvd5t1p.js → design-BugojS6P.js} +2 -2
- package/dist/client/assets/{device-D5HNJpEC.js → device-CH53vde0.js} +2 -2
- package/dist/client/assets/{dialog-BGBsXIS2.js → dialog-CsGXTrQp.js} +2 -2
- package/dist/client/assets/{diffRendering-UyG_CIdR.js → diffRendering-WBaaL1Hw.js} +2 -2
- package/dist/client/assets/{dist-BsVTiAl1.js → dist-CEhsFKQt.js} +3 -3
- package/dist/client/assets/{draft-input-DDmbM6Qp.js → draft-input-DSO1M98X.js} +2 -2
- package/dist/client/assets/{duoViewer-C6sIXAmx.js → duoViewer-DWTF6ZzH.js} +2 -2
- package/dist/client/assets/{dynamic-CeJgJNu6.js → dynamic-cm3g4l5C.js} +2 -2
- package/dist/client/assets/{embeddedScripts-CSKss0de.js → embeddedScripts-CCEJSzbY.js} +2 -2
- package/dist/client/assets/{empty-BchIQtwZ.js → empty-D39LEkAH.js} +2 -2
- package/dist/client/assets/{entities-Ba3s4XOS.js → entities-BjGK6yEY.js} +2 -2
- package/dist/client/assets/{fileLinks-wfxpV-Qo.js → fileLinks-BGiaZuCI.js} +2 -2
- package/dist/client/assets/{fileTreeExpansion-G-ylmE2I.js → fileTreeExpansion-B5-rhZPf.js} +2 -2
- package/dist/client/assets/{getDiffFileInput-3SvhMdx2.js → getDiffFileInput-BVsGumGL.js} +2 -2
- package/dist/client/assets/{guideRunStore-DzJc7VAu.js → guideRunStore-CIC0I9tc.js} +2 -2
- package/dist/client/assets/{htmlRender-B2qNV9TA.js → htmlRender-CuZDEfr_.js} +2 -2
- package/dist/client/assets/{index-DYSmz54X.js → index-DFvDwgHR.js} +3 -3
- package/dist/client/assets/{input-gXGwC11t.js → input-DTnuNfU_.js} +2 -2
- package/dist/client/assets/{input-group-BqTFWskf.js → input-group-ZnG52HFh.js} +2 -2
- package/dist/client/assets/{kbd-C2W9UqaC.js → kbd-NONAAU_c.js} +2 -2
- package/dist/client/assets/{keybindings-D8lOCt7z.js → keybindings-CCgj9REF.js} +2 -2
- package/dist/client/assets/{lazy-3fGMvttY.js → lazy-BGLv0LoM.js} +4 -4
- package/dist/client/assets/{lazyRouteComponent-7R-i6XT2.js → lazyRouteComponent-D02c00C-.js} +2 -2
- package/dist/client/assets/{link-CrHFGDcA.js → link-oQzJ7nu3.js} +2 -2
- package/dist/client/assets/{linkedPrompt-VMNYJ9GO.js → linkedPrompt-C_XIR4Xr.js} +2 -2
- package/dist/client/assets/{main-BsbTTyDp.js → main-BqFaDMNs.js} +17 -17
- package/dist/client/assets/main-DsXJbQH-.css +2 -0
- package/dist/client/assets/{mediaReference-BDgCdUPv.js → mediaReference-DKoeCSSJ.js} +2 -2
- package/dist/client/assets/mediaSource-CENz-NYA.js +2 -0
- package/dist/client/assets/{number-field-Dhe9aDDa.js → number-field-D1mdZQVp.js} +2 -2
- package/dist/client/assets/{observeResize-D2-UGRv1.js → observeResize-BNf0FASw.js} +2 -2
- package/dist/client/assets/{onboarding-r9FLYQ-W.js → onboarding-B-b2hpCr.js} +2 -2
- package/dist/client/assets/{openFileInPreview-Bw1jIEqk.js → openFileInPreview-CLTNM-qs.js} +2 -2
- package/dist/client/assets/{p4ProjectFile-BpTD1cMi.js → p4ProjectFile-BQUacEue.js} +2 -2
- package/dist/client/assets/{pair-ho4TSbex.js → pair-DTrJC971.js} +2 -2
- package/dist/client/assets/{pendingSendStore-CuJffLFW.js → pendingSendStore-BsAQrtOv.js} +2 -2
- package/dist/client/assets/{phoneViewer-D2TwG0d-.js → phoneViewer-D64KFma1.js} +2 -2
- package/dist/client/assets/{pierre-icons-DbovR9oY.js → pierre-icons-CtTUePAY.js} +2 -2
- package/dist/client/assets/{popover-C7uUfSpb.js → popover-Cr0R7gdF.js} +2 -2
- package/dist/client/assets/{preview-CQ-dmagT.js → preview-BuuE-gMP.js} +2 -2
- package/dist/client/assets/{preview-DjnkVD4h.js → preview-C1PD_g9k.js} +2 -2
- package/dist/client/assets/{previewMiniPlayerStore-B9M2YCIo.js → previewMiniPlayerStore-v5xBLM6_.js} +2 -2
- package/dist/client/assets/{primary-DpIL5Bs7.js → primary-BMTtrcja.js} +2 -2
- package/dist/client/assets/{primaryCloudLinkState-BsLCUljE.js → primaryCloudLinkState-CJaRG6QK.js} +2 -2
- package/dist/client/assets/{projectFilesQueryState-Dk3vmsg5.js → projectFilesQueryState-CZkTtV37.js} +2 -2
- package/dist/client/assets/{projectScriptEditor-0BJmIRyM.js → projectScriptEditor-BApTdMa4.js} +2 -2
- package/dist/client/assets/{providerSkills-DTnO9Kdf.js → providerSkills-CK0_chtE.js} +2 -2
- package/dist/client/assets/{pullRequestDetail.logic-DtuOiGEk.js → pullRequestDetail.logic-BmPSn0PA.js} +2 -2
- package/dist/client/assets/{pullRequestIcons-Dlewxywr.js → pullRequestIcons-CfKXhDuO.js} +2 -2
- package/dist/client/assets/{pullRequestReviewStore-gMxEUIkY.js → pullRequestReviewStore-CrDUhUKX.js} +2 -2
- package/dist/client/assets/{pullRequests-B0XzWwD9.js → pullRequests-D-lKKR28.js} +2 -2
- package/dist/client/assets/{queries-OL_Htq8-.js → queries-CEdylITb.js} +2 -2
- package/dist/client/assets/{query-D2ZruPOT.js → query-DM1uxcKV.js} +2 -2
- package/dist/client/assets/{radio-group-B3QH_8sP.js → radio-group-CkR7fabD.js} +2 -2
- package/dist/client/assets/{renderScheduler-Dm1z2lUO.js → renderScheduler-BJowI8SS.js} +2 -2
- package/dist/client/assets/{rightPanelStore-8Ds3qezY.js → rightPanelStore-DUtuG_mq.js} +2 -2
- package/dist/client/assets/{runtime-CzKn37Ie.js → runtime-Du_4upLP.js} +3 -3
- package/dist/client/assets/{runtime-BdUzhUUM.js → runtime-mXszmljC.js} +3 -3
- package/dist/client/assets/{runtimeModeConfig-CkMiiAL3.js → runtimeModeConfig-CZ3ZrCmY.js} +2 -2
- package/dist/client/assets/{scheduledTasksSettings.logic-DQ-I14gW.js → scheduledTasksSettings.logic-YVexB6ub.js} +2 -2
- package/dist/client/assets/{scroll-area-YeND7YEE.js → scroll-area-D1ITiKsD.js} +2 -2
- package/dist/client/assets/{select-Vs0PFHo8.js → select-CT4O76xq.js} +2 -2
- package/dist/client/assets/{selfImproveFindings-Dr0Xv5Cv.js → selfImproveFindings-wLxnhAIe.js} +2 -2
- package/dist/client/assets/{server-BWUPVzyQ.js → server-BRIc5okw.js} +2 -2
- package/dist/client/assets/session-logic-BiU6P8DR.js +26 -0
- package/dist/client/assets/{session-DO9vnR62.js → session-wmJod3Hf.js} +2 -2
- package/dist/client/assets/{settings-C4A95qyS.js → settings-NLDl4Bmy.js} +2 -2
- package/dist/client/assets/{settings.appearance-BJlptNKw.js → settings.appearance-CJCZI-Xj.js} +2 -2
- package/dist/client/assets/settings.archived-CLWZylu3.js +2 -0
- package/dist/client/assets/{settings.computer-use-DgrTOJNC.js → settings.computer-use-CijjzsIQ.js} +2 -2
- package/dist/client/assets/settings.connections-Cf7-ZN_h.js +2 -0
- package/dist/client/assets/{settings.data-controls-BSwYGvBW.js → settings.data-controls-DkLkW74X.js} +2 -2
- package/dist/client/assets/{settings.decisions-DUMCyTuZ.js → settings.decisions-JeevVBZt.js} +2 -2
- package/dist/client/assets/{settings.designs-BBZMrfcr.js → settings.designs-DS1WBGjv.js} +2 -2
- package/dist/client/assets/{settings.diagnostics-CIZDT4cV.js → settings.diagnostics-lQ8O62tl.js} +2 -2
- package/dist/client/assets/{settings.general-bSnpL1hJ.js → settings.general-BWHDfXfO.js} +2 -2
- package/dist/client/assets/{settings.integrations-X7_if4hO.js → settings.integrations-DEdu9gwQ.js} +2 -2
- package/dist/client/assets/{settings.keybindings-Zqqy5SpG.js → settings.keybindings-tc_MLaPn.js} +2 -2
- package/dist/client/assets/{settings.open-source-licenses-B78rCdLj.js → settings.open-source-licenses-ucPvq0ML.js} +2 -2
- package/dist/client/assets/{settings.plugins-BBBQ-lLl.js → settings.plugins-M2Rc23zw.js} +2 -2
- package/dist/client/assets/{settings.projects-DB2aOKVF.js → settings.projects-tykSh6-D.js} +3 -3
- package/dist/client/assets/settings.providers--RJFEbkT.js +3 -0
- package/dist/client/assets/{settings.scheduled-tasks-DWtqoBGX.js → settings.scheduled-tasks-BTioGx2i.js} +2 -2
- package/dist/client/assets/{settings.snap-shot-5aoNTQNE.js → settings.snap-shot-BUehYnKo.js} +2 -2
- package/dist/client/assets/{settings.source-control-DrKsCyRy.js → settings.source-control-Dxm6Jir5.js} +2 -2
- package/dist/client/assets/{settings.storage-Bd2pVP1J.js → settings.storage-CrdP11yD.js} +2 -2
- package/dist/client/assets/{settingsLayout-B5eZBFxv.js → settingsLayout-7rl00kQL.js} +2 -2
- package/dist/client/assets/{sidebar-DXusvEJa.js → sidebar-DRWJdn3r.js} +2 -2
- package/dist/client/assets/{sidebarProjectGrouping-Bkwz22MS.js → sidebarProjectGrouping-BRZt_Xqk.js} +2 -2
- package/dist/client/assets/{skeleton-CQczLiXo.js → skeleton-DOfA4sjN.js} +2 -2
- package/dist/client/assets/{sourceControl-iC7SBPhY.js → sourceControl-CKZL-8Mu.js} +2 -2
- package/dist/client/assets/{sourceControlClients-8HF20R-d.js → sourceControlClients-D-frc1l_.js} +2 -2
- package/dist/client/assets/{spinner-CkQHTBh8.js → spinner-DMCmqCAh.js} +2 -2
- package/dist/client/assets/{terminal-links-BwPSFkUp.js → terminal-links-Cdw7HYhQ.js} +2 -2
- package/dist/client/assets/{terminalSessions-Vl5lzDOp.js → terminalSessions-DGp0Zt7-.js} +2 -2
- package/dist/client/assets/{textarea-C3yif1uk.js → textarea-B2ogIlGU.js} +2 -2
- package/dist/client/assets/{themePalette-kU5foqa6.js → themePalette-CiLEjm0l.js} +2 -2
- package/dist/client/assets/{toast-DJ2-4imd.js → toast-NSvYVPhH.js} +2 -2
- package/dist/client/assets/{toggle-BwVfYVI5.js → toggle-BrZqohX5.js} +2 -2
- package/dist/client/assets/{toggle-group-CUE2cE-r.js → toggle-group-DpO88ac2.js} +2 -2
- package/dist/client/assets/{tooltip-DctjVJ7F.js → tooltip-QdplMyeY.js} +2 -2
- package/dist/client/assets/{uiStateStore-D4coYv1J.js → uiStateStore-vt_JyvTj.js} +2 -2
- package/dist/client/assets/{usage-DnLLaKaF.js → usage-CHD3cyvN.js} +2 -2
- package/dist/client/assets/{usageAccess-BifB1Sam.js → usageAccess-DVnjHuB7.js} +2 -2
- package/dist/client/assets/{usageFormat-DgseLcCP.js → usageFormat-tjRl8Hbq.js} +2 -2
- package/dist/client/assets/{usageShortcuts-C0xlzVwU.js → usageShortcuts-DMKWst47.js} +2 -2
- package/dist/client/assets/{use-atom-command-D7oRayrc.js → use-atom-command-BfhNaUIU.js} +2 -2
- package/dist/client/assets/{useAriaLabelledBy-ChgWEu_a.js → useAriaLabelledBy-BlIdXeWO.js} +2 -2
- package/dist/client/assets/useHandleNewThread-Bv9hl6Vv.js +2 -0
- package/dist/client/assets/{useLocation-DctIJsoW.js → useLocation-jsSq4KCV.js} +2 -2
- package/dist/client/assets/{useNavigate-C-nl3R9B.js → useNavigate-ut7tie8O.js} +2 -2
- package/dist/client/assets/{useNavigateBack-BVWPYJko.js → useNavigateBack-DQAO81KK.js} +2 -2
- package/dist/client/assets/{useP4ConnectAuthPrompt-Ds5beo6Y.js → useP4ConnectAuthPrompt-IuajGXvV.js} +2 -2
- package/dist/client/assets/{useParams-BEj3muN1.js → useParams-2ErCyxxB.js} +2 -2
- package/dist/client/assets/{usePermissionStatus-BpCHJG9L.js → usePermissionStatus-BlueIAuh.js} +2 -2
- package/dist/client/assets/{usePullRequestActions-BjCrAcbO.js → usePullRequestActions-VZpGy8dq.js} +2 -2
- package/dist/client/assets/{useRegisterFieldControl-DxvlOVA9.js → useRegisterFieldControl-BTyFUE5E.js} +2 -2
- package/dist/client/assets/{useScopedModelAvailability-CgXMs_Zc.js → useScopedModelAvailability-CH6hfrU_.js} +2 -2
- package/dist/client/assets/useSettings-FRbaNpbg.js +3 -0
- package/dist/client/assets/utils-CxCThU1r.js +37 -0
- package/dist/client/assets/{vcsRefInvalidation-D4Oei7uu.js → vcsRefInvalidation-CiJ0pwCz.js} +2 -2
- package/dist/client/assets/{welcome-Bmf6_fLo.js → welcome-CBJlRbzG.js} +2 -2
- package/dist/client/index.html +1 -1
- package/dist/{renderer-DXsHnrqP.mjs → renderer-DKZZL6cd.mjs} +2 -2
- package/dist/{runtime-Sw1S5Uy7.mjs → runtime-Bbjyj8bt.mjs} +135 -49
- package/package.json +1 -1
- package/dist/client/assets/AlertDialogRoot-Cb4z5Mk4.js +0 -2
- package/dist/client/assets/ChatGptUsageButton-Dkq13hxI.js +0 -2
- package/dist/client/assets/Input-YAwDiPhc.js +0 -2
- package/dist/client/assets/JZOYTAAL-DrWLTUgY.js +0 -1
- package/dist/client/assets/_chat-unmRpcW-.js +0 -45
- package/dist/client/assets/main-DAlZJX1g.css +0 -2
- package/dist/client/assets/mediaSource-Cjbr6BqZ.js +0 -2
- package/dist/client/assets/session-logic-DEPJvR2T.js +0 -26
- package/dist/client/assets/settings.archived-rIHiy1vU.js +0 -2
- package/dist/client/assets/settings.connections-CANgvtpc.js +0 -2
- package/dist/client/assets/settings.providers-CK3hv5-I.js +0 -3
- package/dist/client/assets/useHandleNewThread-BcOvatr7.js +0 -2
- package/dist/client/assets/useSettings-BzfsGrZk.js +0 -3
- package/dist/client/assets/utils-DBdIFVCj.js +0 -37
package/dist/client/assets/{settings.diagnostics-CIZDT4cV.js → settings.diagnostics-lQ8O62tl.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Hf as i,Jf as a,K_ as o,Of as s,QT as c,Tf as l,W_ as u,Z_ as d,aE as f,dE as p,dr as m,ed as h,ef as g,fr as _,hd as v,hx as y,iE as b,if as x,nT as S,nd as C,pp as ee,rf as te,sE as w,t as T,ts as E}from"./utils-DBdIFVCj.js";import{R as ne,W as re}from"./runtime-CzKn37Ie.js";import{f as D,l as O,p as k}from"./TooltipViewport-DOp3kVQY.js";import{i as A,p as j}from"./toast-DJ2-4imd.js";import{E as M,K as ie}from"./useSettings-BzfsGrZk.js";import{f as N}from"./server-BWUPVzyQ.js";import{i as P,n as F,t as ae}from"./session-DO9vnR62.js";import{n as I}from"./query-D2ZruPOT.js";import{t as oe}from"./use-atom-command-D7oRayrc.js";import{a as se,o as ce,u as le}from"./timestampFormat-wac2e_Jz.js";import{a as L,n as R,t as z}from"./tooltip-DctjVJ7F.js";import{n as ue,t as de}from"./toggle-group-CUE2cE-r.js";import{t as fe}from"./input-gXGwC11t.js";import{t as B}from"./scroll-area-YeND7YEE.js";import{F as pe,V as me,i as he,s as V,u as ge}from"./settingsLayout-B5eZBFxv.js";import{t as _e}from"./ConnectionStatusDot-VMSwkMx4.js";import{fn as H,sa as ve,vo as ye,xo as be}from"./main-BsbTTyDp.js";import{t as xe}from"./usageAccess-BifB1Sam.js";import{t as Se}from"./ExpandableText-BOZbK7rv.js";import{t as U}from"./SettingsScopeNotice-DYhbVTKo.js";var W=n(),G=e(r(),1);function Ce(e){let t=(0,W.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,G.jsx)(L,{render:(0,G.jsx)(_,{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,G.jsx)(R,{side:`top`,children:`Send SIGINT`}),t[5]=o):o=t[5];let s;t[6]===a?s=t[7]:(s=(0,G.jsxs)(z,{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,G.jsx)(L,{render:(0,G.jsx)(_,{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,G.jsx)(R,{side:`top`,children:`Send SIGKILL`}),t[13]=u):u=t[13];let d;t[14]===l?d=t[15]:(d=(0,G.jsxs)(z,{children:[l,u]}),t[14]=l,t[15]=d);let f;return t[16]!==s||t[17]!==d?(f=(0,G.jsxs)(`div`,{className:`flex items-center justify-end gap-1.5`,children:[s,d]}),t[16]=s,t[17]=d,t[18]=f):f=t[18],f}var K=e(t(),1);function we(e){let t=M(),n=e===void 0?t?.environmentId??null:e,r=P(n,u),i=I(n===null||!r?null:N.resourceTelemetry({environmentId:n,input:{}})),a=oe(N.retryResourceTelemetry,{reportFailure:!1}),o=(0,K.useCallback)(async()=>{if(n===null)throw Error(`No environment is selected.`);if(!F(n,`environment:maintain`)||!F(n,`diagnostics:read`))throw Error(`This connection cannot restart the resource monitor.`);let e=await a({environmentId:n,input:{}});if(e._tag===`Failure`)throw S(e.cause);return i.refresh(),e.value.snapshot},[n,a]);return{...i,retry:o}}function Te(e,t){let n=(0,W.c)(4),r=M(),i=t===void 0?r?.environmentId??null:t,a=P(i,u),o;return n[0]!==a||n[1]!==i||n[2]!==e?(o=i===null||!a?null:N.resourceTelemetryHistory({environmentId:i,input:e}),n[0]=a,n[1]=i,n[2]=e,n[3]=o):o=n[3],I(o)}function Ee(e){return`${e.identity.pid}:${e.identity.startTimeMs}`}function De(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=Ee(t);r.has(e)||(r.add(e),i(t.identity.pid))}};for(let n of e)t.has(Ee(n))&&i(n.identity.pid);return e.filter(e=>!r.has(Ee(e)))}function Oe(e){return e.nativeStatus===null&&e.error!==null||e.nativeStatus===`degraded`||e.nativeStatus===`unavailable`||e.nativeStatus===`stopped`}function q(e){return e.value<=0?0:Math.max(e.minimumVisiblePercent,e.value/Math.max(1,e.max)*100)}function ke(e){return Math.max(1,...e.map(e=>e.avgCpuPercent))}var Ae=[{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)}s`;let n=t/60;return n<60?`${n.toFixed(n>=10?1:2)}m`:`${(n/60).toFixed(2)}h`}function Me(e){return e<1e3?`${Math.round(e)} µs`:e<1e6?`${(e/1e3).toFixed(2)} ms`:`${(e/1e6).toFixed(2)} 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,W.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=T(`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=T(`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 _;t[13]===g?_=t[14]:(_=(0,G.jsx)(`span`,{className:g}),t[13]=g,t[14]=_);let v=i?.label??r,y;return t[15]!==n||t[16]!==_||t[17]!==v||t[18]!==d?(y=(0,G.jsxs)(`span`,{className:d,children:[_,n,` `,v]}),t[15]=n,t[16]=_,t[17]=v,t[18]=d,t[19]=y):y=t[19],y}function Ue(e){let t=(0,W.c)(9),{sampledAt:n}=e;if(ge(),!n){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,G.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=se(y(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,G.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,G.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,G.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,W.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,G.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,G.jsx)(`span`,{className:`truncate`,children:r}),t[2]=r,t[3]=l);let u;t[4]!==c||t[5]!==l?(u=(0,G.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=T(`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,G.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,G.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,G.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,W.c)(37),{label:n,accentClass:r,aggregate:i}=e,a;t[0]===r?a=t[1]:(a=T(`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,G.jsx)(`span`,{className:a}),t[2]=a,t[3]=o);let s;t[4]===n?s=t[5]:(s=(0,G.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,G.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,G.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,G.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,G.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 _;t[22]===g?_=t[23]:(_=(0,G.jsx)(Ge,{label:`Read`,value:g}),t[22]=g,t[23]=_);let v;t[24]===i.ioWriteBytesPerSecond?v=t[25]:(v=J(i.ioWriteBytesPerSecond),t[24]=i.ioWriteBytesPerSecond,t[25]=v);let y;t[26]===v?y=t[27]:(y=(0,G.jsx)(Ge,{label:`Write`,value:v}),t[26]=v,t[27]=y);let b;t[28]!==h||t[29]!==_||t[30]!==y||t[31]!==p?(b=(0,G.jsxs)(`div`,{className:`mt-3.5 grid grid-cols-2 gap-x-4 gap-y-2.5`,children:[p,h,_,y]}),t[28]=h,t[29]=_,t[30]=y,t[31]=p,t[32]=b):b=t[32];let x;return t[33]!==b||t[34]!==o||t[35]!==u?(x=(0,G.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,b]}),t[33]=b,t[34]=o,t[35]=u,t[36]=x):x=t[36],x}function Ge(e){let t=(0,W.c)(7),{label:n,value:r}=e,i;t[0]===n?i=t[1]:(i=(0,G.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,G.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,G.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,W.c)(21),{label:n,health:r}=e,i;t[0]!==r.lastError||t[1]!==r.status?(i=r.status===`unavailable`&&c(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,G.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.`:p(r.lastError,{onNone:Je,onSome:qe}),t[5]=a,t[6]=r.lastError,t[7]=s):s=t[7];let l;t[8]===s?l=t[9]:(l=(0,G.jsx)(`div`,{className:`mt-1 text-2xs leading-relaxed text-muted-foreground/65`,children:s}),t[8]=s,t[9]=l);let u;t[10]!==o||t[11]!==l?(u=(0,G.jsxs)(`div`,{className:`min-w-0`,children:[o,l]}),t[10]=o,t[11]=l,t[12]=u):u=t[12];let d;t[13]===a?d=t[14]:(d=a?{label:`Desktop only`,tone:`neutral`}:void 0,t[13]=a,t[14]=d);let f;t[15]!==r.status||t[16]!==d?(f=(0,G.jsx)(He,{label:``,status:r.status,presentation:d}),t[15]=r.status,t[16]=d,t[17]=f):f=t[17];let m;return t[18]!==u||t[19]!==f?(m=(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4 border-t border-border/50 py-3 first:border-t-0`,children:[u,f]}),t[18]=u,t[19]=f,t[20]=m):m=t[20],m}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,W.c)(10),{label:n,value:r,valueClassName:i}=e,a;t[0]===n?a=t[1]:(a=(0,G.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=T(`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,G.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,G.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,W.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=Ae.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=Ae.map(Ze),t[4]=s):s=t[4];let c;return t[5]!==a||t[6]!==o?(c=(0,G.jsx)(ue,{"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,G.jsx)(de,{value:String(e.windowMs),children:e.label},e.windowMs)}function Qe(e){let t=(0,W.c)(15),{buckets:n}=e,r,i,a,o;if(t[0]!==n){let e=ke(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,G.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,G.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,G.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,G.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,G.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,G.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,G.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=q({value:t.avgCpuPercent,max:e,minimumVisiblePercent:2}),r=q({value:t.ioReadBytes,max:s,minimumVisiblePercent:1}),i=q({value:t.ioWriteBytes,max:s,minimumVisiblePercent:1});return(0,G.jsxs)(z,{children:[(0,G.jsx)(L,{render:(0,G.jsxs)(`div`,{className:`grid h-full min-w-1 flex-1 grid-cols-3 items-end gap-px`,children:[(0,G.jsx)(`span`,{className:`block rounded-t-sm bg-foreground/65`,style:{height:`${n}%`}}),(0,G.jsx)(`span`,{className:`block rounded-t-sm bg-info/70`,style:{height:`${r}%`}}),(0,G.jsx)(`span`,{className:`block rounded-t-sm bg-warning/80`,style:{height:`${i}%`}})]})}),(0,G.jsx)(R,{side:`top`,className:`text-left`,children:(0,G.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,G.jsxs)(`div`,{children:[`CPU avg `,t.avgCpuPercent.toFixed(1),`%`]}),(0,G.jsxs)(`div`,{children:[`CPU peak `,t.maxCpuPercent.toFixed(1),`%`]}),(0,G.jsxs)(`div`,{children:[`Read `,H(t.ioReadBytes)]}),(0,G.jsxs)(`div`,{children:[`Write `,H(t.ioWriteBytes)]})]})})]},y(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,G.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,G.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,W.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,G.jsx)(m,{size:`icon-micro`,variant:`ghost-muted`,onClick:()=>i(n),"aria-label":r?`Expand ${o}`:`Collapse ${o}`,children:(0,G.jsx)(O,{className:`size-3.5`,icon:r?k:D})}):(0,G.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=T(`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,G.jsx)(`span`,{className:d}),t[12]=d,t[13]=f);let p;t[14]===o?p=t[15]:(p=(0,G.jsx)(L,{render:(0,G.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,G.jsx)(R,{side:`top`,variant:`code`,children:h}),t[16]=h,t[17]=g);let _;t[18]!==p||t[19]!==g?(_=(0,G.jsxs)(z,{children:[p,g]}),t[18]=p,t[19]=g,t[20]=_):_=t[20];let v;return t[21]!==_||t[22]!==l||t[23]!==u||t[24]!==f?(v=(0,G.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,_]}),t[21]=_,t[22]=l,t[23]=u,t[24]=f,t[25]=v):v=t[25],v}function tt(e){return e.category===`server-child`||e.category===`provider-root`||e.category===`terminal-root`}function nt(e){let t=(0,W.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,G.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,G.jsx)(Ce,{disabled:s,onSignal:c}),t[7]=s,t[8]=c,t[9]=l):l=t[9],l}function rt(e){let t=(0,W.c)(22),{processes:n,canMaintainEnvironment:r,signalingKeys:i,onSignal:a}=e,[o,s]=(0,K.useState)(it),c;t[0]!==o||t[1]!==n?(c=De(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,G.jsxs)(`colgroup`,{children:[(0,G.jsx)(`col`,{className:`w-[20%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[7%]`}),(0,G.jsx)(`col`,{className:`w-[8%]`}),(0,G.jsx)(`col`,{className:`w-[9%]`}),(0,G.jsx)(`col`,{className:`w-[9%]`}),(0,G.jsx)(`col`,{className:`w-[9%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[8%]`}),(0,G.jsx)(`col`,{className:`w-[6%]`}),(0,G.jsx)(`col`,{className:`w-[4%]`})]}),t[4]=f):f=t[4];let p;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,G.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,G.jsxs)(`tr`,{children:[(0,G.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Process`}),(0,G.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Category`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU Time`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Memory`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Read/s`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Write/s`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Read Total`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Write Total`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`PID`}),(0,G.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,G.jsx)(`tr`,{children:(0,G.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,G.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,G.jsx)(`td`,{className:`px-4 py-2 sm:pl-5`,children:(0,G.jsx)(et,{process:e,collapsed:o.has(Pe(e)),onToggle:d})}),(0,G.jsx)(`td`,{className:`truncate px-3 py-2 text-2xs text-muted-foreground`,children:Le(e.category)}),(0,G.jsxs)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:[e.cpuPercent.toFixed(1),`%`]}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:je(e.cpuTimeMs)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:H(e.residentBytes)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-info-foreground`,children:J(e.ioReadBytesPerSecond)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-warning-foreground`,children:J(e.ioWriteBytesPerSecond)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground`,children:H(e.ioReadBytes)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground`,children:(0,G.jsxs)(z,{children:[(0,G.jsx)(L,{render:(0,G.jsx)(`span`,{children:H(e.ioWriteBytes)})}),(0,G.jsx)(R,{side:`top`,children:ze(e.ioSemantics)})]})}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground`,children:e.identity.pid}),(0,G.jsx)(`td`,{className:`px-2 py-2 text-right sm:pr-4`,children:(0,G.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,G.jsx)(`div`,{className:`border-t border-border/60`,children:(0,G.jsx)(B,{chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`max-h-[min(68vh,48rem)] w-full max-w-full`,children:(0,G.jsxs)(`table`,{className:`w-full min-w-[1320px] table-fixed text-left text-xs`,children:[f,p,(0,G.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,W.c)(9),{processes:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,G.jsxs)(`colgroup`,{children:[(0,G.jsx)(`col`,{className:`w-[24%]`}),(0,G.jsx)(`col`,{className:`w-[11%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[11%]`}),(0,G.jsx)(`col`,{className:`w-[11%]`}),(0,G.jsx)(`col`,{className:`w-[11%]`}),(0,G.jsx)(`col`,{className:`w-[7%]`}),(0,G.jsx)(`col`,{className:`w-[5%]`})]}),t[0]=r):r=t[0];let i;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,G.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,G.jsxs)(`tr`,{children:[(0,G.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Process`}),(0,G.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Category`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU Time`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Peak CPU`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Peak Mem`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Read`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Write`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Samples`}),(0,G.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,G.jsx)(`tr`,{children:(0,G.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,G.jsx)(`div`,{className:`border-t border-border/60`,children:(0,G.jsx)(B,{chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`max-h-[28rem] w-full max-w-full`,children:(0,G.jsxs)(`table`,{className:`w-full min-w-[1020px] table-fixed text-left text-xs`,children:[r,i,(0,G.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,G.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,G.jsx)(`td`,{className:`px-4 py-2 sm:pl-5`,children:(0,G.jsxs)(z,{children:[(0,G.jsx)(L,{render:(0,G.jsx)(`span`,{className:`block truncate font-medium text-foreground`,children:e.name||e.command})}),(0,G.jsx)(R,{side:`top`,variant:`code`,children:e.command||e.name})]})}),(0,G.jsx)(`td`,{className:`truncate px-3 py-2 text-2xs text-muted-foreground`,children:Le(e.category)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:je(e.cpuTimeMs)}),(0,G.jsxs)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:[e.maxCpuPercent.toFixed(1),`%`]}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:H(e.peakRssBytes)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-info-foreground`,children:H(e.ioReadBytes)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-warning-foreground`,children:H(e.ioWriteBytes)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground`,children:e.sampleCount}),(0,G.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,W.c)(9),{entries:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,G.jsxs)(`colgroup`,{children:[(0,G.jsx)(`col`,{className:`w-[22%]`}),(0,G.jsx)(`col`,{className:`w-[28%]`}),(0,G.jsx)(`col`,{className:`w-[14%]`}),(0,G.jsx)(`col`,{className:`w-[14%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[12%]`})]}),t[0]=r):r=t[0];let i;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,G.jsx)(`thead`,{className:`border-b border-border/60 text-3xs uppercase tracking-widest text-muted-foreground/65`,children:(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Component`}),(0,G.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Operation`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Logical Read`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Logical Write`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Count`}),(0,G.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,G.jsx)(`tr`,{children:(0,G.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,G.jsx)(`div`,{className:`overflow-x-auto border-t border-border/60`,children:(0,G.jsxs)(`table`,{className:`w-full min-w-[720px] table-fixed text-left text-xs`,children:[r,i,(0,G.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,G.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,G.jsx)(`td`,{className:`truncate px-4 py-2 font-medium text-foreground sm:pl-5`,children:e.component}),(0,G.jsx)(`td`,{className:`truncate px-3 py-2 text-muted-foreground`,children:e.operation}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-info-foreground`,children:H(e.logicalReadBytes)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-warning-foreground`,children:H(e.logicalWriteBytes)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:e.count}),(0,G.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),`s`]})]},`${e.component}:${e.operation}`)}function lt({environmentId:e}){let[t,n]=(0,K.useState)(9e5),r=Ae.find(e=>e.windowMs===t)??Ae[1],a=P(e,o),c=we(e),l=c.retry,u=Te({windowMs:r.windowMs,bucketMs:r.bucketMs},e),d=u.refresh,g=(0,K.useRef)({environmentId:e,windowMs:t,refreshHistory:d});(0,K.useEffect)(()=>{g.current={environmentId:e,windowMs:t,refreshHistory:d}},[e,t,d]);let _=oe(N.signalProcess,{reportFailure:!1}),[y,S]=(0,K.useState)(()=>new Set),w=(0,K.useRef)(new Set),T=(0,K.useRef)(e);(0,K.useEffect)(()=>(T.current=e,()=>{T.current=null}),[e]);let[E,D]=(0,K.useState)(!1),O=c.data,k=O?.groups.allP4,j=(0,K.useCallback)(async(e,t)=>{let n=T.current;if(n===null||!F(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,S(i);let a=()=>{let e=new Set(w.current);e.delete(r),w.current=e,S(e)};if(t===`SIGKILL`){let n=!1;try{n=await ie().dialogs.confirm(`Send SIGKILL to process ${e.identity.pid}? This cannot be handled by the process.`,{variant:`destructive`})}catch(e){a(),A.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||!F(n,`environment:maintain`)?a():_({environmentId:n,input:{pid:e.identity.pid,startTimeMs:e.identity.startTimeMs,signal:t}}).then(n=>{if(n._tag===`Failure`){if(ne(n))return;throw re(n)}n.value.signaled||A.add({type:`error`,title:`Could not send ${t}`,description:b(n.value.message,()=>`Failed to send ${t} to process ${e.identity.pid}.`)})}).catch(e=>{A.add({type:`error`,title:`Could not send ${t}`,description:e instanceof Error?e.message:`Failed to send ${t}.`})}).finally(()=>{a()})},[_]),M=(0,K.useCallback)(()=>{let e=T.current;e!==null&&F(e,`environment:maintain`)&&(D(!0),l().then(()=>{d();let n=g.current;T.current===e&&n.environmentId===e&&n.windowMs!==t&&n.refreshHistory()}).catch(e=>{A.add({type:`error`,title:`Could not restart resource monitor`,description:e instanceof Error?e.message:`The resource monitor retry failed.`})}).finally(()=>{D(!1)}))},[l]),ae=O?f(O.speedLimitPercent):null,I=Oe({nativeStatus:O?.health.native.status??null,error:c.error}),se=O!==null&&(O.power.onBattery!==`unknown`||O.power.lowPowerMode!==`unknown`||O.power.idle!==`unknown`||O.power.locked!==`unknown`||O.power.thermalState!==`unknown`);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(V,{title:`Resource monitor`,icon:(0,G.jsx)(h,{className:`size-4 text-muted-foreground`}),headerAction:(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[O?(0,G.jsx)(He,{label:`Native`,status:O.health.native.status}):null,(0,G.jsx)(Ue,{sampledAt:O?.readAt??null}),(0,G.jsxs)(z,{children:[(0,G.jsx)(L,{render:(0,G.jsx)(m,{size:`icon-micro`,variant:`ghost`,disabled:c.isPending,onClick:c.refresh,"aria-label":`Refresh resource telemetry`,children:(0,G.jsx)(be,{size:`xs`,refreshing:c.isPending})})}),(0,G.jsx)(R,{side:`top`,children:`Refresh telemetry snapshot`})]})]}),children:(0,G.jsxs)(`div`,{className:`overflow-hidden rounded-2xl border border-border/70 bg-card shadow-sm/5`,children:[(0,G.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,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-3xs font-semibold uppercase tracking-widest text-muted-foreground/70`,children:`P4 system footprint`}),(0,G.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,G.jsxs)(`div`,{className:`flex items-center gap-2 text-3xs text-muted-foreground/65`,children:[(0,G.jsx)(`span`,{className:`size-1.5 rounded-full bg-success`}),`Sampling every `,O?Ne(O.sampleIntervalMs):`...`]})]}),(0,G.jsxs)(`div`,{className:`grid grid-cols-2 divide-x divide-y divide-border/55 md:grid-cols-3`,children:[(0,G.jsx)(Y,{icon:(0,G.jsx)(te,{className:`size-3.5`}),label:`Current CPU`,value:k?`${k.currentCpuPercent.toFixed(1)}%`:`...`,detail:k?`${je(k.cpuTimeMs)} observed CPU time`:void 0}),(0,G.jsx)(Y,{icon:(0,G.jsx)(ee,{className:`size-3.5`}),label:`Resident memory`,value:k?H(k.currentRssBytes):`...`,detail:k?`${H(k.peakRssBytes)} combined process peaks`:void 0}),(0,G.jsx)(Y,{icon:(0,G.jsx)(h,{className:`size-3.5`}),label:`Process count`,value:k?String(k.processCount):`...`,detail:k?`${k.processStarts} starts · ${k.processExits} exits`:void 0}),(0,G.jsx)(Y,{icon:(0,G.jsx)(i,{className:`size-3.5`}),label:`Read throughput`,value:k?J(k.ioReadBytesPerSecond):`...`,detail:k?`${H(k.ioReadBytes)} observed`:void 0}),(0,G.jsx)(Y,{icon:(0,G.jsx)(x,{className:`size-3.5`}),label:`Write throughput`,value:k?J(k.ioWriteBytesPerSecond):`...`,detail:k?`${H(k.ioWriteBytes)} observed`:void 0,tone:k&&k.ioWriteBytesPerSecond>=10485760?`danger`:k&&k.ioWriteBytesPerSecond>=1048576?`warning`:`default`}),(0,G.jsx)(Y,{icon:(0,G.jsx)(s,{className:`size-3.5`}),label:`CPU speed limit`,value:O?ae===null?`Unknown`:`${ae.toFixed(0)}%`:`...`,detail:O?`${O.power.thermalState} thermal state`:void 0,tone:ae!==null&&ae<80?`warning`:`default`})]}),c.error?(0,G.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,G.jsx)(C,{className:`mt-0.5 size-3.5 shrink-0`}),(0,G.jsx)(`span`,{children:c.error})]}):null,O?(0,G.jsxs)(`div`,{className:`grid border-t border-border/60 bg-muted/10 md:grid-cols-3`,children:[(0,G.jsx)(We,{label:`Backend + agents`,accentClass:`bg-success/80`,aggregate:O.groups.backend}),(0,G.jsx)(We,{label:`Desktop`,accentClass:`bg-info/80`,aggregate:O.groups.electron}),(0,G.jsx)(We,{label:`Monitor overhead`,accentClass:`bg-warning/80`,aggregate:O.groups.monitor})]}):null]})}),(0,G.jsx)(V,{title:`Host & collection`,icon:(0,G.jsx)(s,{className:`size-4 text-muted-foreground`}),headerAction:I?(0,G.jsxs)(m,{size:`xs`,variant:`outline`,disabled:E,onClick:M,children:[(0,G.jsx)(be,{size:`xs`,refreshing:E}),`Retry monitor`]}):null,children:(0,G.jsxs)(`div`,{className:`grid overflow-hidden rounded-2xl border border-border/70 bg-card shadow-xs/5 md:grid-cols-2 md:divide-x md:divide-border/60`,children:[(0,G.jsxs)(`div`,{className:`px-4 py-4 sm:px-5`,children:[(0,G.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-3xs font-semibold uppercase tracking-widest text-muted-foreground/70`,children:[(0,G.jsx)(`span`,{className:`flex size-6 items-center justify-center rounded-md bg-muted/60`,children:(0,G.jsx)(v,{className:`size-3.5`})}),`Host state`]}),se&&O?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(X,{label:`Power source`,value:Be(O.power.onBattery,{true:`Battery`,false:`External power`})}),(0,G.jsx)(X,{label:`Low power mode`,value:Be(O.power.lowPowerMode,{true:`Enabled`,false:`Disabled`})}),(0,G.jsx)(X,{label:`Idle`,value:`${Be(O.power.idle,{true:`Idle`,false:`Active`})}${O.power.idleSeconds===null?``:` · ${Math.round(O.power.idleSeconds)}s`}`}),(0,G.jsx)(X,{label:`Session`,value:O.power.suspended?`Suspended`:Be(O.power.locked,{true:`Locked`,false:`Unlocked`})}),(0,G.jsx)(X,{label:`Thermal`,value:O.power.thermalState,valueClassName:O.power.thermalState===`serious`||O.power.thermalState===`critical`?`text-destructive`:void 0})]}):(0,G.jsxs)(`div`,{className:`rounded-xl border border-dashed border-border/70 bg-muted/20 px-4 py-5`,children:[(0,G.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:`Desktop host signals not connected`}),(0,G.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,G.jsxs)(`div`,{className:`border-t border-border/60 px-4 py-4 md:border-t-0 sm:px-5`,children:[(0,G.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-3xs font-semibold uppercase tracking-widest text-muted-foreground/70`,children:[(0,G.jsx)(`span`,{className:`flex size-6 items-center justify-center rounded-md bg-muted/60`,children:(0,G.jsx)(s,{className:`size-3.5`})}),`Collection health`]}),O?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Ke,{label:`Native process monitor`,health:O.health.native}),(0,G.jsx)(Ke,{label:`Electron main process`,health:O.health.desktop}),(0,G.jsx)(X,{label:`Collection time`,value:Me(O.health.collectionDurationMicros)}),(0,G.jsx)(X,{label:`Process scan`,value:`${O.health.retainedProcessCount}/${O.health.scannedProcessCount} retained`}),(0,G.jsx)(X,{label:`Inaccessible`,value:String(O.health.inaccessibleProcessCount),valueClassName:O.health.inaccessibleProcessCount>0?`text-warning-foreground`:void 0}),(0,G.jsx)(X,{label:`Sidecar`,value:p(O.health.sidecarVersion,{onNone:()=>`Unavailable`,onSome:e=>`${e}${p(O.health.sidecarPid,{onNone:()=>``,onSome:e=>` · PID ${e}`})}`})}),(0,G.jsx)(X,{label:`Restarts`,value:String(O.health.restartCount)})]}):(0,G.jsx)(`div`,{className:`py-4 text-xs text-muted-foreground`,children:`Waiting for collector health.`})]})]})}),(0,G.jsx)(V,{title:`Resource timeline`,icon:(0,G.jsx)(i,{className:`size-4 text-muted-foreground`}),headerAction:(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(Xe,{selectedWindowMs:t,onSelect:n}),(0,G.jsx)(m,{size:`icon-micro`,variant:`ghost`,disabled:u.isPending,onClick:u.refresh,"aria-label":`Refresh resource history`,children:(0,G.jsx)(be,{size:`xs`,refreshing:u.isPending})})]}),children:(0,G.jsxs)(`div`,{className:`overflow-hidden rounded-2xl border border-border/70 bg-card shadow-xs/5`,children:[u.error?(0,G.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,G.jsx)(C,{className:`mt-0.5 size-3.5 shrink-0`}),(0,G.jsx)(`span`,{children:u.error})]}):null,(0,G.jsx)(Qe,{buckets:u.data?.buckets??[]}),(0,G.jsx)(at,{processes:u.data?.topProcesses??[]})]})}),(0,G.jsx)(V,{title:`Live process tree`,icon:(0,G.jsx)(te,{className:`size-4 text-muted-foreground`}),headerAction:O?(0,G.jsxs)(`span`,{className:`text-3xs text-muted-foreground/55`,children:[`Identity: `,(0,G.jsx)(`span`,{className:`font-mono`,children:`PID + start time`})]}):null,children:(0,G.jsx)(`div`,{className:`overflow-hidden rounded-2xl border border-border/70 bg-card shadow-xs/5`,children:(0,G.jsx)(rt,{processes:O?.processes??[],canMaintainEnvironment:a,signalingKeys:y,onSignal:j})})}),(0,G.jsx)(V,{title:`Instrumented application I/O`,icon:(0,G.jsx)(x,{className:`size-4 text-muted-foreground`}),headerAction:(0,G.jsx)(`span`,{className:`text-3xs text-muted-foreground/55`,children:`Logical bytes by operation`}),children:(0,G.jsxs)(`div`,{className:`overflow-hidden rounded-2xl border border-border/70 bg-card shadow-xs/5`,children:[(0,G.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,G.jsx)(st,{entries:O?.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,W.c)(3),{environment:t,scope:n}=me();if(n.kind!==`environment`||!t){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,G.jsx)(V,{title:`OpenTelemetry export`,id:`telemetry-export`,children:(0,G.jsx)(U,{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,G.jsx)(mt,{},t.environmentId),e[1]=t.environmentId,e[2]=r),r}function mt(){let{environment:e}=me(),t=pe(e=>e.observability),[n,r]=(0,K.useState)({}),[i,a]=(0,K.useState)(!1),[o,s]=(0,K.useState)(null),c=e?.environmentId,l=E(N.checkOtlpEndpoint.permissionAtom(c??null)),u=l&&e?.serverConfig?.environment.capabilities.otlpEndpointCheck===!0,[d,f]=(0,K.useState)(()=>Object.fromEntries(ut.filter(({key:e})=>dt(t[e])).map(({key:e})=>[e,{url:t[e],result:null}]))),p=oe(N.updateSettings,{reportFailure:!0}),h=oe(N.checkOtlpEndpoint),g={...t,...n},_=ut.filter(({key:e})=>g[e].trim()!==t[e]),v=_.length>0,y=e?.serverConfig?.observability,b=async(e,t,n)=>{if(!c)return;let r=await h({environmentId:c,input:{signal:t,url:n}});f(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})},x=(e,t,n)=>{dt(n)&&(f(t=>({...t,[e]:{url:n,result:null}})),b(e,t,n))},S=(0,K.useEffectEvent)(()=>{for(let{key:e,signal:t}of ut){let n=d[e];n?.result===null&&b(e,t,n.url)}});return(0,K.useEffect)(()=>{u&&S()},[u]),(0,G.jsx)(V,{title:`OpenTelemetry export`,id:`telemetry-export`,children:(0,G.jsxs)(`form`,{className:`grid gap-4 px-4 py-4 sm:px-5`,onSubmit:async t=>{if(t.preventDefault(),e&&!i){a(!0),s(null);try{(await p({environmentId:e.environmentId,input:{patch:{observability:Object.fromEntries(_.map(({key:e})=>[e,g[e]]))}}}))._tag===`Success`&&(r({}),s(`Saved. Restart the server to apply.`))}finally{a(!1)}}},children:[(0,G.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.`}),!l&&(0,G.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=g[e].trim(),c=u?ft(o,d[e]):null;return(0,G.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[c&&(0,G.jsx)(_e,{dotClassName:c.dot}),(0,G.jsxs)(ve,{htmlFor:e,children:[n,` endpoint`]})]}),c&&(0,G.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:c.label})]}),(0,G.jsxs)(`div`,{className:`flex gap-2`,children:[(0,G.jsx)(fe,{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:g[e],disabled:i||!l,onChange:n=>{let i=n.target.value;r(n=>{let r={...n,[e]:i};return i.trim()===t[e]&&delete r[e],r}),s(null)}}),u&&(0,G.jsx)(m,{type:`button`,size:`sm`,variant:`outline`,disabled:!dt(o)||d[e]?.result===null,onClick:()=>void x(e,a,o),children:`Test`})]}),t[e]!==(y?.[e]??``)&&(0,G.jsxs)(`p`,{className:`break-all text-xs text-muted-foreground`,children:[`Running: `,y?.[e]||`Disabled`]})]},e)}),(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,G.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:o}),(0,G.jsxs)(`div`,{className:`flex shrink-0 gap-2`,children:[(0,G.jsx)(m,{type:`button`,size:`xs`,variant:`outline`,disabled:!v||i||!l,onClick:()=>{if(r({}),s(null),u)for(let{key:e,signal:n}of ut)d[e]?.url!==t[e]&&x(e,n,t[e])},children:`Discard`}),(0,G.jsx)(m,{type:`submit`,size:`xs`,disabled:!v||i||!l,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)} s`}function gt(e){if(e<1024)return`${e} B`;let t=[`KB`,`MB`,`GB`],n=-1,r=e;do r/=1024,n+=1;while(r>=1024&&n<t.length-1);return`${r.toFixed(r>=10?1:2)} ${t[n]}`}function _t(e){return e?ce(y(e)):`No trace records`}function vt(e){return _t(e).replaceAll(` `,`\xA0`)}function yt(e){return e.length<=32?e:`${e.slice(0,18)}...${e.slice(-10)}`}function bt(e){return e?.includes(`not a live descendant`)??!1}function $(e){let t=(0,W.c)(17),{label:n,value:r,tooltip:i,tone:o}=e,s=o===void 0?`default`:o,c;t[0]===n?c=t[1]:(c=(0,G.jsx)(`span`,{className:`min-w-0 truncate`,children:n}),t[0]=n,t[1]=c);let l;t[2]!==n||t[3]!==i?(l=i?(0,G.jsxs)(z,{children:[(0,G.jsx)(L,{render:(0,G.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,G.jsx)(a,{className:`size-3`})})}),(0,G.jsx)(R,{side:`top`,children:i})]}):null,t[2]=n,t[3]=i,t[4]=l):l=t[4];let u;t[5]!==c||t[6]!==l?(u=(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5 text-2xs font-medium uppercase tracking-widest text-muted-foreground/70`,children:[c,l]}),t[5]=c,t[6]=l,t[7]=u):u=t[7];let d=s===`warning`&&`text-warning-foreground`,f=s===`danger`&&`text-destructive`,p;t[8]!==d||t[9]!==f?(p=T(`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,G.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,G.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 xt(e){let t=(0,W.c)(6),{children:n}=e,r,i,a,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,G.jsx)(`span`,{className:`pointer-events-none absolute inset-y-0 left-1/2 w-px bg-border/60`,"aria-hidden":!0}),i=(0,G.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,G.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,G.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,G.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 St(e){let t=(0,W.c)(2),{label:n}=e,r;return t[0]===n?r=t[1]:(r=(0,G.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 Ct(e){let t=(0,W.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=T(`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,G.jsx)(`colgroup`,{children:n.map((e,t)=>(0,G.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,G.jsx)(`th`,{className:T(`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,G.jsx)(`thead`,{className:`border-b border-border/60 text-2xs uppercase tracking-widest text-muted-foreground/70`,children:(0,G.jsx)(`tr`,{children:u})}),t[12]=u,t[13]=d);let f;t[14]===r?f=t[15]:(f=(0,G.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,G.jsx)(B,{radius:`none`,chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`w-full max-w-full`,children:(0,G.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 wt(e){let t=(0,W.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:a}=j(r),o;t[1]===n?o=t[2]:(o=yt(n),t[1]=n,t[2]=o);let s;t[3]===o?s=t[4]:(s=(0,G.jsx)(L,{render:(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-2xs`,children:o})}),t[3]=o,t[4]=s);let c;t[5]===n?c=t[6]:(c=(0,G.jsx)(R,{side:`top`,variant:`code`,children:n}),t[5]=n,t[6]=c);let l;t[7]!==s||t[8]!==c?(l=(0,G.jsxs)(z,{children:[s,c]}),t[7]=s,t[8]=c,t[9]=l):l=t[9];let u=a?`Copied trace ID`:`Copy trace ID`,d;t[10]!==i||t[11]!==n?(d=()=>i(n),t[10]=i,t[11]=n,t[12]=d):d=t[12];let f;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,G.jsx)(g,{className:`size-3`}),t[13]=f):f=t[13];let p;t[14]!==u||t[15]!==d?(p=(0,G.jsx)(L,{render:(0,G.jsx)(m,{size:`icon-micro`,variant:`ghost-muted`,"aria-label":u,onClick:d,children:f})}),t[14]=u,t[15]=d,t[16]=p):p=t[16];let h=a?`Copied`:`Copy full trace ID`,_;t[17]===h?_=t[18]:(_=(0,G.jsx)(R,{side:`top`,children:h}),t[17]=h,t[18]=_);let v;t[19]!==_||t[20]!==p?(v=(0,G.jsxs)(z,{children:[p,_]}),t[19]=_,t[20]=p,t[21]=v):v=t[21];let y;return t[22]!==v||t[23]!==l?(y=(0,G.jsxs)(`div`,{className:`flex w-full min-w-0 max-w-full items-center gap-2`,children:[l,v]}),t[22]=v,t[23]=l,t[24]=y):y=t[24],y}function Tt(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 Et(e){return e.depth>0?`Subprocess`:/\b(codex|claude|opencode|cursor)\b/i.test(e.command)?`Agent`:`Process`}function Dt(e){let t=(0,W.c)(22),{process:n,isExpanded:r,onToggle:i}=e,a;t[0]===n.command?a=t[1]:(a=Tt(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,G.jsx)(m,{size:`icon-micro`,variant:`ghost-muted`,"aria-label":r?`Collapse ${o}`:`Expand ${o}`,onClick:()=>i(n.pid),children:(0,G.jsx)(O,{className:`size-3.5`,icon:r?D:k})}):(0,G.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,G.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,G.jsx)(L,{render:(0,G.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,G.jsx)(R,{side:`top`,variant:`code`,children:n.command}),t[13]=n.command,t[14]=p);let h;t[15]!==f||t[16]!==p?(h=(0,G.jsxs)(z,{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,G.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 Ot(e){let t=(0,W.c)(18),{processes:n,canMaintainEnvironment:r,signalingPid:i,onSignal:a,emptyLabel:o}=e,[s,c]=(0,K.useState)(kt),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,G.jsxs)(`colgroup`,{children:[(0,G.jsx)(`col`,{className:`w-[24%]`}),(0,G.jsx)(`col`,{className:`w-[8%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[33%]`}),(0,G.jsx)(`col`,{className:`w-[8%]`}),(0,G.jsx)(`col`,{className:`w-[11%]`}),(0,G.jsx)(`col`,{className:`w-[6%]`})]}),t[4]=p):p=t[4];let m;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,G.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,G.jsxs)(`tr`,{children:[(0,G.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Name`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Memory`}),(0,G.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Command`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`PID`}),(0,G.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Type`}),(0,G.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,G.jsx)(`tr`,{children:(0,G.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,G.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,G.jsx)(`td`,{className:`px-4 py-2 align-middle sm:pl-5`,children:(0,G.jsx)(Dt,{process:e,isExpanded:!s.has(e.pid),onToggle:f})}),(0,G.jsxs)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:[e.cpuPercent.toFixed(1),`%`]}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:gt(e.rssBytes)}),(0,G.jsx)(`td`,{className:`px-3 py-2 align-middle text-muted-foreground`,children:(0,G.jsxs)(z,{children:[(0,G.jsx)(L,{render:(0,G.jsx)(`span`,{className:`block truncate`,children:e.command})}),(0,G.jsx)(R,{side:`top`,variant:`code`,children:e.command})]})}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums text-muted-foreground`,children:e.pid}),(0,G.jsx)(`td`,{className:`truncate px-3 py-2 align-middle text-muted-foreground`,children:Et(e)}),(0,G.jsx)(`td`,{className:`p-2 align-middle sm:pr-4`,children:(0,G.jsx)(Ce,{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,G.jsx)(`div`,{className:`border-t border-border/60`,children:(0,G.jsx)(B,{radius:`none`,chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`max-h-[min(64vh,44rem)] w-full max-w-full`,children:(0,G.jsxs)(`table`,{className:`w-full min-w-[1040px] table-fixed text-left text-xs`,children:[p,m,(0,G.jsxs)(`tbody`,{className:`divide-y divide-border/50`,children:[h,g]})]})})}),t[15]=h,t[16]=g,t[17]=_):_=t[17],_}function kt(){return new Set}var At=[{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 jt(e){if(e<60)return`${e.toFixed(e>=10?1:2)}s`;let t=e/60;return t<60?`${t.toFixed(t>=10?1:2)}m`:`${(t/60).toFixed(2)}h`}function Mt(e){let t=Tt(e);return t.length>42?`${t.slice(0,39)}...`:t}function Nt(e){let t=(0,W.c)(21),{process:n,visualDepth:r}=e,i;t[0]===n.command?i=t[1]:(i=Mt(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,G.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=T(`size-1.5 shrink-0 rounded-full`,u),t[5]=u,t[6]=d);let f;t[7]===d?f=t[8]:(f=(0,G.jsx)(`span`,{className:d}),t[7]=d,t[8]=f);let p;t[9]===a?p=t[10]:(p=(0,G.jsx)(L,{render:(0,G.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,G.jsx)(R,{side:`top`,variant:`code`,children:n.command}),t[11]=n.command,t[12]=m);let h;t[13]!==m||t[14]!==p?(h=(0,G.jsxs)(z,{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,G.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 Pt(e){let t=(0,W.c)(9),{buckets:n}=e,r;t[0]===n?r=t[1]:(r=Math.max(1,...n.map(Ft)),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,G.jsxs)(z,{children:[(0,G.jsx)(L,{render:(0,G.jsx)(`div`,{className:`flex h-full min-w-1 flex-1 items-end`,children:(0,G.jsxs)(`div`,{className:`relative h-full w-full`,"aria-label":`Average CPU ${e.avgCpuPercent.toFixed(1)}%, peak CPU ${e.maxCpuPercent.toFixed(1)}%`,children:[(0,G.jsx)(`div`,{className:`absolute inset-x-0 bottom-0 rounded-t-sm bg-foreground/15 transition-colors`,style:{height:`${t}%`}}),(0,G.jsx)(`div`,{className:`absolute inset-x-0 bottom-0 rounded-t-sm bg-foreground/60 transition-colors`,style:{height:`${n}%`}})]})})}),(0,G.jsxs)(R,{side:`top`,children:[`Avg `,e.avgCpuPercent.toFixed(1),`%, peak `,e.maxCpuPercent.toFixed(1),`%`]})]},y(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,G.jsx)(`div`,{className:`border-t border-border/60 px-4 py-3 sm:px-5`,children:(0,G.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 Ft(e){return e.maxCpuPercent}function It(e){let t=(0,W.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=At.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=At.map(Lt),t[4]=s):s=t[4];let c;return t[5]!==a||t[6]!==o?(c=(0,G.jsx)(ue,{"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 Lt(e){return(0,G.jsx)(de,{value:String(e.windowMs),children:e.label},e.windowMs)}function Rt(e){let t=(0,W.c)(13),{processes:n,emptyLabel:r}=e,i=n.reduce(zt,null),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,G.jsxs)(`colgroup`,{children:[(0,G.jsx)(`col`,{className:`w-[24%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[16%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`})]}),t[0]=a):a=t[0];let o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,G.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,G.jsxs)(`tr`,{children:[(0,G.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Process`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU Time`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Current`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Average`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Peak`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Max Mem`}),(0,G.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Command`}),(0,G.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,G.jsx)(`tr`,{children:(0,G.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,G.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,G.jsx)(`td`,{className:`px-4 py-2 align-middle sm:pl-5`,children:(0,G.jsx)(Nt,{process:e,visualDepth:e.isServerRoot||i===null?0:Math.max(1,e.depth-i+1)})}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:jt(e.cpuSecondsApprox)}),(0,G.jsxs)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:[e.currentCpuPercent.toFixed(1),`%`]}),(0,G.jsxs)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:[e.avgCpuPercent.toFixed(1),`%`]}),(0,G.jsxs)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:[e.maxCpuPercent.toFixed(1),`%`]}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:gt(e.maxRssBytes)}),(0,G.jsx)(`td`,{className:`px-3 py-2 align-middle text-muted-foreground`,children:(0,G.jsxs)(z,{children:[(0,G.jsx)(L,{render:(0,G.jsx)(`span`,{className:`block truncate`,children:e.command})}),(0,G.jsx)(R,{side:`top`,variant:`code`,children:e.command})]})}),(0,G.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,G.jsx)(`div`,{className:`border-t border-border/60`,children:(0,G.jsx)(B,{chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`max-h-[min(64vh,44rem)] w-full max-w-full`,children:(0,G.jsxs)(`table`,{className:`w-full min-w-[980px] table-fixed text-left text-xs`,children:[a,o,(0,G.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 zt(e,t){return t.isServerRoot?e:e===null?t.depth:Math.min(e,t.depth)}function Bt(e){let t=(0,W.c)(7),{checkedAt:n}=e;ge();let r;t[0]===n?r=t[1]:(r=le(n?y(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,G.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,G.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,G.jsx)(`span`,{className:`text-2xs text-muted-foreground/60`,children:i.suffix?(0,G.jsxs)(G.Fragment,{children:[`Checked `,(0,G.jsx)(`span`,{className:`font-mono tabular-nums`,children:i.value}),` `,i.suffix]}):(0,G.jsxs)(G.Fragment,{children:[`Checked `,i.value]})}),t[4]=i.suffix,t[5]=i.value,t[6]=a):a=t[6],a}function Vt(e){let t=(0,W.c)(12),{isPending:n,label:r,onClick:i}=e,a;t[0]===n?a=t[1]:(a=(0,G.jsx)(be,{refreshing:n}),t[0]=n,t[1]=a);let o;t[2]!==n||t[3]!==r||t[4]!==i||t[5]!==a?(o=(0,G.jsx)(L,{render:(0,G.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,G.jsx)(R,{side:`top`,children:r}),t[7]=r,t[8]=s);let c;return t[9]!==o||t[10]!==s?(c=(0,G.jsxs)(z,{children:[o,s]}),t[9]=o,t[10]=s,t[11]=c):c=t[11],c}function Ht(){let{environment:e}=me(),t=e?.environmentId??null,n=P(t,o),r=e?.serverConfig?.observability,i=e?.serverConfig?.availableEditors,a=P(t,d),s=I(t===null?null:ae.sessionStateAtom(t)),c=xe({connectionPhase:e?.connection.phase??`available`,session:s.data,hasSessionError:s.error!==null}),u=c.canReadDiagnostics,p=oe(N.signalProcess,{reportFailure:!1}),h=ye(t,i??[]),[g,_]=(0,K.useState)(9e5),v=At.find(e=>e.windowMs===g)??At[1],{data:x,error:S,isPending:ee,refresh:te}=I(t===null||!u?null:N.traceDiagnostics({environmentId:t,input:{}})),{data:E,error:D,isPending:O,refresh:k}=I(t===null||!u?null:N.processDiagnostics({environmentId:t,input:{}})),{data:j,error:M,isPending:se,refresh:ce}=I(t===null||!u?null:N.processResourceHistory({environmentId:t,input:{windowMs:v.windowMs,bucketMs:v.bucketMs}})),[le,ue]=(0,K.useState)(!1),[de,fe]=(0,K.useState)(null),[pe,ge]=(0,K.useState)(null),_e=(0,K.useRef)(null),H=(0,K.useRef)(t),ve=(0,K.useRef)(E);(0,K.useEffect)(()=>{ve.current=E},[E]),(0,K.useEffect)(()=>(H.current=t,()=>{H.current=null}),[t]);let be=(0,K.useCallback)(()=>{let e=r?.logsDirectoryPath??null;e&&t!==null&&F(t,`orchestration:operate`)&&(ue(!0),fe(null),(async()=>{let t=await h(e);if(ue(!1),t._tag===`Failure`&&!ne(t)){let e=re(t);fe(e instanceof Error?e.message:`Unable to open logs folder.`)}})())},[t,r?.logsDirectoryPath,h]),U=ee&&x===null,W=O&&E===null,Ce=se&&j===null,[we,Te]=(0,K.useState)(null);we!==t&&u&&!U&&!W&&!Ce&&Te(t);let Ee=(0,K.useCallback)(async(e,t)=>{let n=H.current,r=ve.current?.processes.find(t=>t.pid===e);if(n===null||r===void 0||!F(n,`environment:maintain`)||_e.current!==null)return;_e.current=e,ge(e);let i=()=>{_e.current=null,ge(null)};if(t===`SIGKILL`){let n=!1;try{n=await ie().dialogs.confirm(`Send SIGKILL to process ${e}? This cannot be handled by the process.`,{variant:`destructive`})}catch(e){i(),A.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=H.current;if(a===null||a!==n||!F(a,`environment:maintain`))i();else if(ve.current?.processes.find(t=>t.pid===e)?.startTimeMs!==r.startTimeMs)i();else try{let i=await p({environmentId:n,input:{pid:e,startTimeMs:r.startTimeMs,signal:t}});if(i._tag===`Failure`){if(!ne(i)){let e=re(i);A.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=w(i.value.message);if(k(),bt(e)){A.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}A.add({type:`error`,title:`Could not send ${t}`,description:e??`Failed to send ${t}.`});return}k()}finally{i()}},[k,p]),De=E?f(E.error):null,Oe=j?f(j.error):null,q=x?f(x.error):null,ke=x?b(x.partialFailure,()=>!1):!1;return u?(0,G.jsxs)(he,{width:`expanded`,className:`gap-10`,children:[(0,G.jsx)(lt,{environmentId:t}),(0,G.jsxs)(V,{title:`Live Processes`,headerAction:(0,G.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,G.jsx)(Bt,{checkedAt:E?.readAt??null}),(0,G.jsx)(Vt,{isPending:O,label:`Refresh process diagnostics`,onClick:k})]}),children:[(0,G.jsxs)(xt,{children:[(0,G.jsx)($,{label:`Child Processes`,value:E?Z(E.processCount):`...`}),(0,G.jsx)($,{label:`CPU`,value:E?`${E.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,G.jsx)($,{label:`Memory`,value:E?gt(E.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,G.jsx)($,{label:`Server PID`,value:E?String(E.serverPid):`...`})]}),De||D?(0,G.jsxs)(`div`,{className:`space-y-2 border-t border-border/60 px-4 py-3 text-xs text-muted-foreground sm:px-5`,children:[De?(0,G.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,G.jsx)(C,{className:`mt-0.5 size-3.5 shrink-0`}),(0,G.jsx)(`span`,{children:De.message})]}):null,D?(0,G.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,G.jsx)(C,{className:`mt-0.5 size-3.5 shrink-0`}),(0,G.jsx)(`span`,{children:D})]}):null]}):null,(0,G.jsx)(Ot,{processes:E?.processes??[],canMaintainEnvironment:n,signalingPid:pe,onSignal:Ee,emptyLabel:W?`Loading live processes...`:`No live descendant processes found.`})]}),(0,G.jsxs)(V,{title:`Resource History`,headerAction:(0,G.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,G.jsx)(It,{selectedWindowMs:g,onSelect:_}),(0,G.jsx)(Bt,{checkedAt:j?.readAt??null}),(0,G.jsx)(Vt,{isPending:se,label:`Refresh resource history`,onClick:ce})]}),children:[(0,G.jsxs)(xt,{children:[(0,G.jsx)($,{label:`CPU Time`,value:j?jt(j.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,G.jsx)($,{label:`Samples`,value:j?Z(j.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,G.jsx)($,{label:`Interval`,value:j?j.sampleIntervalMs===0?`On demand`:Q(j.sampleIntervalMs):`...`}),(0,G.jsx)($,{label:`Processes`,value:j?Z(j.topProcesses.length):`...`})]}),Oe||M?(0,G.jsxs)(`div`,{className:`space-y-2 border-t border-border/60 px-4 py-3 text-xs text-muted-foreground sm:px-5`,children:[Oe?(0,G.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,G.jsx)(C,{className:`mt-0.5 size-3.5 shrink-0`}),(0,G.jsx)(`span`,{children:Oe.message})]}):null,M?(0,G.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,G.jsx)(C,{className:`mt-0.5 size-3.5 shrink-0`}),(0,G.jsx)(`span`,{children:M})]}):null]}):null,(0,G.jsx)(Pt,{buckets:j?.buckets??[]}),(0,G.jsx)(Rt,{processes:j?.topProcesses??[],emptyLabel:Ce?`Collecting process resource samples...`:`No process resource samples found for this window.`})]}),(0,G.jsxs)(V,{title:`Trace Diagnostics`,headerAction:(0,G.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,G.jsx)(Bt,{checkedAt:x?.readAt??null}),(0,G.jsxs)(z,{children:[(0,G.jsx)(L,{render:(0,G.jsx)(m,{size:`icon-xs`,variant:`ghost-muted`,disabled:!a||!r?.logsDirectoryPath||le,onClick:be,"aria-label":`Open logs folder`,children:(0,G.jsx)(l,{})})}),(0,G.jsx)(R,{side:`top`,children:`Open logs folder`})]}),(0,G.jsx)(Vt,{isPending:ee,label:`Refresh trace diagnostics`,onClick:te})]}),children:[(0,G.jsxs)(xt,{children:[(0,G.jsx)($,{label:`Spans`,value:x?Z(x.recordCount):`...`}),(0,G.jsx)($,{label:`Failures`,value:x?Z(x.failureCount):`...`,tone:x&&x.failureCount>0?`danger`:`default`}),(0,G.jsx)($,{label:`Slow Spans`,value:x?Z(x.slowSpanCount):`...`,tooltip:x?`Spans with a duration of ${Q(x.slowSpanThresholdMs)} or longer.`:`Spans at or above the configured slow-span threshold.`,tone:x&&x.slowSpanCount>0?`warning`:`default`}),(0,G.jsx)($,{label:`Parse Errors`,value:x?Z(x.parseErrorCount):`...`,tone:x&&x.parseErrorCount>0?`warning`:`default`})]}),de||q||S?(0,G.jsxs)(`div`,{className:`space-y-2 border-t border-border/60 px-4 py-3 text-xs text-muted-foreground sm:px-5`,children:[de?(0,G.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,G.jsx)(C,{className:`mt-0.5 size-3.5 shrink-0`}),(0,G.jsx)(`span`,{children:de})]}):null,q?(0,G.jsxs)(`div`,{className:T(`flex items-start gap-2`,ke?`text-warning-foreground`:`text-destructive`),children:[(0,G.jsx)(C,{className:`mt-0.5 size-3.5 shrink-0`}),(0,G.jsx)(`span`,{children:ke?`Some trace files could not be read, so diagnostics may be incomplete. ${q.message}`:q.message})]}):null,S?(0,G.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,G.jsx)(C,{className:`mt-0.5 size-3.5 shrink-0`}),(0,G.jsx)(`span`,{children:S})]}):null]}):null]}),(0,G.jsx)(V,{title:`Latest Failures`,children:x&&x.latestFailures.length>0?(0,G.jsx)(Ct,{headers:[`Span`,`Cause`,`Duration`,`Ended`],children:x.latestFailures.map(e=>(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`td`,{className:`px-4 py-3 align-top text-xs font-medium text-foreground first:sm:pl-5`,children:e.name}),(0,G.jsx)(`td`,{className:`max-w-[360px] px-4 py-3 align-top text-muted-foreground`,children:(0,G.jsx)(Se,{text:e.cause})}),(0,G.jsx)(`td`,{className:`px-4 py-3 align-top font-mono tabular-nums`,children:Q(e.durationMs)}),(0,G.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums text-muted-foreground last:sm:pr-5`,children:vt(e.endedAt)})]},`${e.traceId}:${e.spanId}`))}):(0,G.jsx)(St,{label:U?`Loading failures...`:`No failed spans found.`})}),(0,G.jsx)(V,{title:`Most Common Failures`,children:x&&x.commonFailures.length>0?(0,G.jsx)(Ct,{headers:[`Span`,`Count`,`Cause`,`Last Seen`],minTableWidth:`min-w-[760px]`,children:x.commonFailures.map(e=>(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`td`,{className:`px-4 py-3 align-top text-xs font-medium text-foreground first:sm:pl-5`,children:e.name}),(0,G.jsx)(`td`,{className:`px-4 py-3 align-top font-mono tabular-nums`,children:Z(e.count)}),(0,G.jsx)(`td`,{className:`max-w-[360px] px-4 py-3 align-top text-muted-foreground`,children:(0,G.jsx)(Se,{text:e.cause})}),(0,G.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:vt(e.lastSeenAt)})]},`${e.name}:${e.cause}`))}):(0,G.jsx)(St,{label:U?`Loading failure groups...`:`No repeated failures found.`})}),(0,G.jsx)(V,{title:`Slowest Spans`,children:x&&x.slowestSpans.length>0?(0,G.jsx)(Ct,{headers:[`Span`,`Duration`,`Ended`,`Trace`],minTableWidth:`min-w-[900px]`,columnWidths:[`w-[44%]`,`w-[14%]`,`w-[12%]`,`w-[30%]`],children:x.slowestSpans.map(e=>(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`td`,{className:`px-4 py-3 align-top text-xs font-medium text-foreground first:sm:pl-5`,children:e.name}),(0,G.jsx)(`td`,{className:`px-4 py-3 align-top font-mono tabular-nums`,children:Q(e.durationMs)}),(0,G.jsx)(`td`,{className:`w-px whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums text-muted-foreground`,children:vt(e.endedAt)}),(0,G.jsx)(`td`,{className:`min-w-0 whitespace-nowrap px-4 py-3 align-top text-muted-foreground last:sm:pr-5`,children:(0,G.jsx)(wt,{traceId:e.traceId})})]},`${e.traceId}:${e.spanId}`))}):(0,G.jsx)(St,{label:U?`Loading slow spans...`:`No spans found.`})}),(0,G.jsx)(V,{title:`Span Logs`,children:x&&x.latestWarningAndErrorLogs.length>0?(0,G.jsx)(B,{radius:`none`,chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`w-full max-w-full`,children:(0,G.jsxs)(`table`,{className:`w-full min-w-[920px] table-fixed text-left text-xs`,children:[(0,G.jsxs)(`colgroup`,{children:[(0,G.jsx)(`col`,{className:`w-[11%]`}),(0,G.jsx)(`col`,{className:`w-[9%]`}),(0,G.jsx)(`col`,{className:`w-[24%]`}),(0,G.jsx)(`col`,{className:`w-[26%]`}),(0,G.jsx)(`col`,{className:`w-[30%]`})]}),(0,G.jsx)(`thead`,{className:`border-b border-border/60 text-2xs uppercase tracking-widest text-muted-foreground/70`,children:(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold sm:pl-5`,children:`Time`}),(0,G.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold`,children:`Level`}),(0,G.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold`,children:`Span`}),(0,G.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold`,children:`Message`}),(0,G.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold sm:pr-5`,children:`Trace`})]})}),(0,G.jsx)(`tbody`,{className:`divide-y divide-border/60`,children:x.latestWarningAndErrorLogs.map(e=>(0,G.jsxs)(`tr`,{className:`hover:bg-muted/15`,children:[(0,G.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums text-muted-foreground sm:pl-5`,children:vt(e.seenAt)}),(0,G.jsx)(`td`,{className:`px-4 py-3 align-top`,children:(0,G.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,G.jsx)(`td`,{className:`px-4 py-3 align-top`,children:(0,G.jsx)(`div`,{className:`truncate font-medium text-foreground`,children:e.spanName})}),(0,G.jsx)(`td`,{className:`px-4 py-3 align-top text-muted-foreground`,children:(0,G.jsx)(Se,{collapsedClassName:`line-clamp-2`,expandLabel:`Show full message`,text:e.message})}),(0,G.jsx)(`td`,{className:`min-w-0 whitespace-nowrap px-4 py-3 align-top text-muted-foreground sm:pr-5`,children:(0,G.jsx)(wt,{traceId:e.traceId})})]},`${e.traceId}:${e.spanId}:${y(e.seenAt)}:${e.message}`))})]})}):(0,G.jsx)(St,{label:U?`Loading recent logs...`:`No warnings or errors found.`})}),(0,G.jsx)(V,{title:`Top Span Names`,children:x&&x.topSpansByCount.length>0?(0,G.jsx)(Ct,{headers:[`Span`,`Count`,`Failures`,`Average`,`Max`],minTableWidth:`min-w-[760px]`,columnWidths:[`w-[48%]`,`w-[13%]`,`w-[13%]`,`w-[13%]`,`w-[13%]`],children:x.topSpansByCount.map(e=>(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`td`,{className:`px-4 py-3 align-top text-xs font-medium text-foreground first:sm:pl-5`,children:e.name}),(0,G.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums`,children:Z(e.count)}),(0,G.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums`,children:Z(e.failureCount)}),(0,G.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums`,children:Q(e.averageDurationMs)}),(0,G.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,G.jsx)(St,{label:U?`Loading span names...`:`No spans found.`})}),we===t&&(0,G.jsx)(pt,{})]}):(0,G.jsx)(he,{children:(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t===null?`Connect an environment to see diagnostics.`:c.isPending?`Checking diagnostics access…`:c.error})})}var Ut=Ht;export{Ut as component};
|
|
2
|
-
//# sourceMappingURL=settings.diagnostics-
|
|
1
|
+
import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Hf as i,Jf as a,K_ as o,Of as s,QT as c,Tf as l,W_ as u,Z_ as d,aE as f,dE as p,dr as m,ed as h,ef as g,fr as _,hd as v,hx as y,iE as b,if as x,nT as S,nd as C,pp as ee,rf as te,sE as w,t as T,ts as E}from"./utils-CxCThU1r.js";import{R as ne,W as re}from"./runtime-Du_4upLP.js";import{f as D,l as O,p as k}from"./TooltipViewport-MMBPNW3u.js";import{i as A,p as j}from"./toast-NSvYVPhH.js";import{E as M,K as ie}from"./useSettings-FRbaNpbg.js";import{f as N}from"./server-BRIc5okw.js";import{i as P,n as F,t as ae}from"./session-wmJod3Hf.js";import{n as I}from"./query-DM1uxcKV.js";import{t as oe}from"./use-atom-command-BfhNaUIU.js";import{a as se,o as ce,u as le}from"./timestampFormat-wac2e_Jz.js";import{a as L,n as R,t as z}from"./tooltip-QdplMyeY.js";import{n as ue,t as de}from"./toggle-group-DpO88ac2.js";import{t as fe}from"./input-DTnuNfU_.js";import{t as B}from"./scroll-area-D1ITiKsD.js";import{F as pe,V as me,i as he,s as V,u as ge}from"./settingsLayout-7rl00kQL.js";import{t as _e}from"./ConnectionStatusDot-BBmbajLh.js";import{fn as H,sa as ve,vo as ye,xo as be}from"./main-BqFaDMNs.js";import{t as xe}from"./usageAccess-DVnjHuB7.js";import{t as Se}from"./ExpandableText-CEDcsLah.js";import{t as U}from"./SettingsScopeNotice-LfKqlEQx.js";var W=n(),G=e(r(),1);function Ce(e){let t=(0,W.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,G.jsx)(L,{render:(0,G.jsx)(_,{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,G.jsx)(R,{side:`top`,children:`Send SIGINT`}),t[5]=o):o=t[5];let s;t[6]===a?s=t[7]:(s=(0,G.jsxs)(z,{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,G.jsx)(L,{render:(0,G.jsx)(_,{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,G.jsx)(R,{side:`top`,children:`Send SIGKILL`}),t[13]=u):u=t[13];let d;t[14]===l?d=t[15]:(d=(0,G.jsxs)(z,{children:[l,u]}),t[14]=l,t[15]=d);let f;return t[16]!==s||t[17]!==d?(f=(0,G.jsxs)(`div`,{className:`flex items-center justify-end gap-1.5`,children:[s,d]}),t[16]=s,t[17]=d,t[18]=f):f=t[18],f}var K=e(t(),1);function we(e){let t=M(),n=e===void 0?t?.environmentId??null:e,r=P(n,u),i=I(n===null||!r?null:N.resourceTelemetry({environmentId:n,input:{}})),a=oe(N.retryResourceTelemetry,{reportFailure:!1}),o=(0,K.useCallback)(async()=>{if(n===null)throw Error(`No environment is selected.`);if(!F(n,`environment:maintain`)||!F(n,`diagnostics:read`))throw Error(`This connection cannot restart the resource monitor.`);let e=await a({environmentId:n,input:{}});if(e._tag===`Failure`)throw S(e.cause);return i.refresh(),e.value.snapshot},[n,a]);return{...i,retry:o}}function Te(e,t){let n=(0,W.c)(4),r=M(),i=t===void 0?r?.environmentId??null:t,a=P(i,u),o;return n[0]!==a||n[1]!==i||n[2]!==e?(o=i===null||!a?null:N.resourceTelemetryHistory({environmentId:i,input:e}),n[0]=a,n[1]=i,n[2]=e,n[3]=o):o=n[3],I(o)}function Ee(e){return`${e.identity.pid}:${e.identity.startTimeMs}`}function De(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=Ee(t);r.has(e)||(r.add(e),i(t.identity.pid))}};for(let n of e)t.has(Ee(n))&&i(n.identity.pid);return e.filter(e=>!r.has(Ee(e)))}function Oe(e){return e.nativeStatus===null&&e.error!==null||e.nativeStatus===`degraded`||e.nativeStatus===`unavailable`||e.nativeStatus===`stopped`}function q(e){return e.value<=0?0:Math.max(e.minimumVisiblePercent,e.value/Math.max(1,e.max)*100)}function ke(e){return Math.max(1,...e.map(e=>e.avgCpuPercent))}var Ae=[{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)}s`;let n=t/60;return n<60?`${n.toFixed(n>=10?1:2)}m`:`${(n/60).toFixed(2)}h`}function Me(e){return e<1e3?`${Math.round(e)} µs`:e<1e6?`${(e/1e3).toFixed(2)} ms`:`${(e/1e6).toFixed(2)} 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,W.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=T(`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=T(`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 _;t[13]===g?_=t[14]:(_=(0,G.jsx)(`span`,{className:g}),t[13]=g,t[14]=_);let v=i?.label??r,y;return t[15]!==n||t[16]!==_||t[17]!==v||t[18]!==d?(y=(0,G.jsxs)(`span`,{className:d,children:[_,n,` `,v]}),t[15]=n,t[16]=_,t[17]=v,t[18]=d,t[19]=y):y=t[19],y}function Ue(e){let t=(0,W.c)(9),{sampledAt:n}=e;if(ge(),!n){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,G.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=se(y(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,G.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,G.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,G.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,W.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,G.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,G.jsx)(`span`,{className:`truncate`,children:r}),t[2]=r,t[3]=l);let u;t[4]!==c||t[5]!==l?(u=(0,G.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=T(`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,G.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,G.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,G.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,W.c)(37),{label:n,accentClass:r,aggregate:i}=e,a;t[0]===r?a=t[1]:(a=T(`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,G.jsx)(`span`,{className:a}),t[2]=a,t[3]=o);let s;t[4]===n?s=t[5]:(s=(0,G.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,G.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,G.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,G.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,G.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 _;t[22]===g?_=t[23]:(_=(0,G.jsx)(Ge,{label:`Read`,value:g}),t[22]=g,t[23]=_);let v;t[24]===i.ioWriteBytesPerSecond?v=t[25]:(v=J(i.ioWriteBytesPerSecond),t[24]=i.ioWriteBytesPerSecond,t[25]=v);let y;t[26]===v?y=t[27]:(y=(0,G.jsx)(Ge,{label:`Write`,value:v}),t[26]=v,t[27]=y);let b;t[28]!==h||t[29]!==_||t[30]!==y||t[31]!==p?(b=(0,G.jsxs)(`div`,{className:`mt-3.5 grid grid-cols-2 gap-x-4 gap-y-2.5`,children:[p,h,_,y]}),t[28]=h,t[29]=_,t[30]=y,t[31]=p,t[32]=b):b=t[32];let x;return t[33]!==b||t[34]!==o||t[35]!==u?(x=(0,G.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,b]}),t[33]=b,t[34]=o,t[35]=u,t[36]=x):x=t[36],x}function Ge(e){let t=(0,W.c)(7),{label:n,value:r}=e,i;t[0]===n?i=t[1]:(i=(0,G.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,G.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,G.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,W.c)(21),{label:n,health:r}=e,i;t[0]!==r.lastError||t[1]!==r.status?(i=r.status===`unavailable`&&c(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,G.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.`:p(r.lastError,{onNone:Je,onSome:qe}),t[5]=a,t[6]=r.lastError,t[7]=s):s=t[7];let l;t[8]===s?l=t[9]:(l=(0,G.jsx)(`div`,{className:`mt-1 text-2xs leading-relaxed text-muted-foreground/65`,children:s}),t[8]=s,t[9]=l);let u;t[10]!==o||t[11]!==l?(u=(0,G.jsxs)(`div`,{className:`min-w-0`,children:[o,l]}),t[10]=o,t[11]=l,t[12]=u):u=t[12];let d;t[13]===a?d=t[14]:(d=a?{label:`Desktop only`,tone:`neutral`}:void 0,t[13]=a,t[14]=d);let f;t[15]!==r.status||t[16]!==d?(f=(0,G.jsx)(He,{label:``,status:r.status,presentation:d}),t[15]=r.status,t[16]=d,t[17]=f):f=t[17];let m;return t[18]!==u||t[19]!==f?(m=(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4 border-t border-border/50 py-3 first:border-t-0`,children:[u,f]}),t[18]=u,t[19]=f,t[20]=m):m=t[20],m}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,W.c)(10),{label:n,value:r,valueClassName:i}=e,a;t[0]===n?a=t[1]:(a=(0,G.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=T(`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,G.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,G.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,W.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=Ae.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=Ae.map(Ze),t[4]=s):s=t[4];let c;return t[5]!==a||t[6]!==o?(c=(0,G.jsx)(ue,{"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,G.jsx)(de,{value:String(e.windowMs),children:e.label},e.windowMs)}function Qe(e){let t=(0,W.c)(15),{buckets:n}=e,r,i,a,o;if(t[0]!==n){let e=ke(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,G.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,G.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,G.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,G.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,G.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,G.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,G.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=q({value:t.avgCpuPercent,max:e,minimumVisiblePercent:2}),r=q({value:t.ioReadBytes,max:s,minimumVisiblePercent:1}),i=q({value:t.ioWriteBytes,max:s,minimumVisiblePercent:1});return(0,G.jsxs)(z,{children:[(0,G.jsx)(L,{render:(0,G.jsxs)(`div`,{className:`grid h-full min-w-1 flex-1 grid-cols-3 items-end gap-px`,children:[(0,G.jsx)(`span`,{className:`block rounded-t-sm bg-foreground/65`,style:{height:`${n}%`}}),(0,G.jsx)(`span`,{className:`block rounded-t-sm bg-info/70`,style:{height:`${r}%`}}),(0,G.jsx)(`span`,{className:`block rounded-t-sm bg-warning/80`,style:{height:`${i}%`}})]})}),(0,G.jsx)(R,{side:`top`,className:`text-left`,children:(0,G.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,G.jsxs)(`div`,{children:[`CPU avg `,t.avgCpuPercent.toFixed(1),`%`]}),(0,G.jsxs)(`div`,{children:[`CPU peak `,t.maxCpuPercent.toFixed(1),`%`]}),(0,G.jsxs)(`div`,{children:[`Read `,H(t.ioReadBytes)]}),(0,G.jsxs)(`div`,{children:[`Write `,H(t.ioWriteBytes)]})]})})]},y(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,G.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,G.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,W.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,G.jsx)(m,{size:`icon-micro`,variant:`ghost-muted`,onClick:()=>i(n),"aria-label":r?`Expand ${o}`:`Collapse ${o}`,children:(0,G.jsx)(O,{className:`size-3.5`,icon:r?k:D})}):(0,G.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=T(`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,G.jsx)(`span`,{className:d}),t[12]=d,t[13]=f);let p;t[14]===o?p=t[15]:(p=(0,G.jsx)(L,{render:(0,G.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,G.jsx)(R,{side:`top`,variant:`code`,children:h}),t[16]=h,t[17]=g);let _;t[18]!==p||t[19]!==g?(_=(0,G.jsxs)(z,{children:[p,g]}),t[18]=p,t[19]=g,t[20]=_):_=t[20];let v;return t[21]!==_||t[22]!==l||t[23]!==u||t[24]!==f?(v=(0,G.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,_]}),t[21]=_,t[22]=l,t[23]=u,t[24]=f,t[25]=v):v=t[25],v}function tt(e){return e.category===`server-child`||e.category===`provider-root`||e.category===`terminal-root`}function nt(e){let t=(0,W.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,G.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,G.jsx)(Ce,{disabled:s,onSignal:c}),t[7]=s,t[8]=c,t[9]=l):l=t[9],l}function rt(e){let t=(0,W.c)(22),{processes:n,canMaintainEnvironment:r,signalingKeys:i,onSignal:a}=e,[o,s]=(0,K.useState)(it),c;t[0]!==o||t[1]!==n?(c=De(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,G.jsxs)(`colgroup`,{children:[(0,G.jsx)(`col`,{className:`w-[20%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[7%]`}),(0,G.jsx)(`col`,{className:`w-[8%]`}),(0,G.jsx)(`col`,{className:`w-[9%]`}),(0,G.jsx)(`col`,{className:`w-[9%]`}),(0,G.jsx)(`col`,{className:`w-[9%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[8%]`}),(0,G.jsx)(`col`,{className:`w-[6%]`}),(0,G.jsx)(`col`,{className:`w-[4%]`})]}),t[4]=f):f=t[4];let p;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,G.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,G.jsxs)(`tr`,{children:[(0,G.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Process`}),(0,G.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Category`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU Time`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Memory`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Read/s`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Write/s`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Read Total`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Write Total`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`PID`}),(0,G.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,G.jsx)(`tr`,{children:(0,G.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,G.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,G.jsx)(`td`,{className:`px-4 py-2 sm:pl-5`,children:(0,G.jsx)(et,{process:e,collapsed:o.has(Pe(e)),onToggle:d})}),(0,G.jsx)(`td`,{className:`truncate px-3 py-2 text-2xs text-muted-foreground`,children:Le(e.category)}),(0,G.jsxs)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:[e.cpuPercent.toFixed(1),`%`]}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:je(e.cpuTimeMs)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:H(e.residentBytes)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-info-foreground`,children:J(e.ioReadBytesPerSecond)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-warning-foreground`,children:J(e.ioWriteBytesPerSecond)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground`,children:H(e.ioReadBytes)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground`,children:(0,G.jsxs)(z,{children:[(0,G.jsx)(L,{render:(0,G.jsx)(`span`,{children:H(e.ioWriteBytes)})}),(0,G.jsx)(R,{side:`top`,children:ze(e.ioSemantics)})]})}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground`,children:e.identity.pid}),(0,G.jsx)(`td`,{className:`px-2 py-2 text-right sm:pr-4`,children:(0,G.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,G.jsx)(`div`,{className:`border-t border-border/60`,children:(0,G.jsx)(B,{chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`max-h-[min(68vh,48rem)] w-full max-w-full`,children:(0,G.jsxs)(`table`,{className:`w-full min-w-[1320px] table-fixed text-left text-xs`,children:[f,p,(0,G.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,W.c)(9),{processes:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,G.jsxs)(`colgroup`,{children:[(0,G.jsx)(`col`,{className:`w-[24%]`}),(0,G.jsx)(`col`,{className:`w-[11%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[11%]`}),(0,G.jsx)(`col`,{className:`w-[11%]`}),(0,G.jsx)(`col`,{className:`w-[11%]`}),(0,G.jsx)(`col`,{className:`w-[7%]`}),(0,G.jsx)(`col`,{className:`w-[5%]`})]}),t[0]=r):r=t[0];let i;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,G.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,G.jsxs)(`tr`,{children:[(0,G.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Process`}),(0,G.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Category`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU Time`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Peak CPU`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Peak Mem`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Read`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Write`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Samples`}),(0,G.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,G.jsx)(`tr`,{children:(0,G.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,G.jsx)(`div`,{className:`border-t border-border/60`,children:(0,G.jsx)(B,{chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`max-h-[28rem] w-full max-w-full`,children:(0,G.jsxs)(`table`,{className:`w-full min-w-[1020px] table-fixed text-left text-xs`,children:[r,i,(0,G.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,G.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,G.jsx)(`td`,{className:`px-4 py-2 sm:pl-5`,children:(0,G.jsxs)(z,{children:[(0,G.jsx)(L,{render:(0,G.jsx)(`span`,{className:`block truncate font-medium text-foreground`,children:e.name||e.command})}),(0,G.jsx)(R,{side:`top`,variant:`code`,children:e.command||e.name})]})}),(0,G.jsx)(`td`,{className:`truncate px-3 py-2 text-2xs text-muted-foreground`,children:Le(e.category)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:je(e.cpuTimeMs)}),(0,G.jsxs)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:[e.maxCpuPercent.toFixed(1),`%`]}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:H(e.peakRssBytes)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-info-foreground`,children:H(e.ioReadBytes)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-warning-foreground`,children:H(e.ioWriteBytes)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-muted-foreground`,children:e.sampleCount}),(0,G.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,W.c)(9),{entries:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,G.jsxs)(`colgroup`,{children:[(0,G.jsx)(`col`,{className:`w-[22%]`}),(0,G.jsx)(`col`,{className:`w-[28%]`}),(0,G.jsx)(`col`,{className:`w-[14%]`}),(0,G.jsx)(`col`,{className:`w-[14%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[12%]`})]}),t[0]=r):r=t[0];let i;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,G.jsx)(`thead`,{className:`border-b border-border/60 text-3xs uppercase tracking-widest text-muted-foreground/65`,children:(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Component`}),(0,G.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Operation`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Logical Read`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Logical Write`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Count`}),(0,G.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,G.jsx)(`tr`,{children:(0,G.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,G.jsx)(`div`,{className:`overflow-x-auto border-t border-border/60`,children:(0,G.jsxs)(`table`,{className:`w-full min-w-[720px] table-fixed text-left text-xs`,children:[r,i,(0,G.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,G.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,G.jsx)(`td`,{className:`truncate px-4 py-2 font-medium text-foreground sm:pl-5`,children:e.component}),(0,G.jsx)(`td`,{className:`truncate px-3 py-2 text-muted-foreground`,children:e.operation}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-info-foreground`,children:H(e.logicalReadBytes)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums text-warning-foreground`,children:H(e.logicalWriteBytes)}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right font-mono tabular-nums`,children:e.count}),(0,G.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),`s`]})]},`${e.component}:${e.operation}`)}function lt({environmentId:e}){let[t,n]=(0,K.useState)(9e5),r=Ae.find(e=>e.windowMs===t)??Ae[1],a=P(e,o),c=we(e),l=c.retry,u=Te({windowMs:r.windowMs,bucketMs:r.bucketMs},e),d=u.refresh,g=(0,K.useRef)({environmentId:e,windowMs:t,refreshHistory:d});(0,K.useEffect)(()=>{g.current={environmentId:e,windowMs:t,refreshHistory:d}},[e,t,d]);let _=oe(N.signalProcess,{reportFailure:!1}),[y,S]=(0,K.useState)(()=>new Set),w=(0,K.useRef)(new Set),T=(0,K.useRef)(e);(0,K.useEffect)(()=>(T.current=e,()=>{T.current=null}),[e]);let[E,D]=(0,K.useState)(!1),O=c.data,k=O?.groups.allP4,j=(0,K.useCallback)(async(e,t)=>{let n=T.current;if(n===null||!F(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,S(i);let a=()=>{let e=new Set(w.current);e.delete(r),w.current=e,S(e)};if(t===`SIGKILL`){let n=!1;try{n=await ie().dialogs.confirm(`Send SIGKILL to process ${e.identity.pid}? This cannot be handled by the process.`,{variant:`destructive`})}catch(e){a(),A.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||!F(n,`environment:maintain`)?a():_({environmentId:n,input:{pid:e.identity.pid,startTimeMs:e.identity.startTimeMs,signal:t}}).then(n=>{if(n._tag===`Failure`){if(ne(n))return;throw re(n)}n.value.signaled||A.add({type:`error`,title:`Could not send ${t}`,description:b(n.value.message,()=>`Failed to send ${t} to process ${e.identity.pid}.`)})}).catch(e=>{A.add({type:`error`,title:`Could not send ${t}`,description:e instanceof Error?e.message:`Failed to send ${t}.`})}).finally(()=>{a()})},[_]),M=(0,K.useCallback)(()=>{let e=T.current;e!==null&&F(e,`environment:maintain`)&&(D(!0),l().then(()=>{d();let n=g.current;T.current===e&&n.environmentId===e&&n.windowMs!==t&&n.refreshHistory()}).catch(e=>{A.add({type:`error`,title:`Could not restart resource monitor`,description:e instanceof Error?e.message:`The resource monitor retry failed.`})}).finally(()=>{D(!1)}))},[l]),ae=O?f(O.speedLimitPercent):null,I=Oe({nativeStatus:O?.health.native.status??null,error:c.error}),se=O!==null&&(O.power.onBattery!==`unknown`||O.power.lowPowerMode!==`unknown`||O.power.idle!==`unknown`||O.power.locked!==`unknown`||O.power.thermalState!==`unknown`);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(V,{title:`Resource monitor`,icon:(0,G.jsx)(h,{className:`size-4 text-muted-foreground`}),headerAction:(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[O?(0,G.jsx)(He,{label:`Native`,status:O.health.native.status}):null,(0,G.jsx)(Ue,{sampledAt:O?.readAt??null}),(0,G.jsxs)(z,{children:[(0,G.jsx)(L,{render:(0,G.jsx)(m,{size:`icon-micro`,variant:`ghost`,disabled:c.isPending,onClick:c.refresh,"aria-label":`Refresh resource telemetry`,children:(0,G.jsx)(be,{size:`xs`,refreshing:c.isPending})})}),(0,G.jsx)(R,{side:`top`,children:`Refresh telemetry snapshot`})]})]}),children:(0,G.jsxs)(`div`,{className:`overflow-hidden rounded-2xl border border-border/70 bg-card shadow-sm/5`,children:[(0,G.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,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-3xs font-semibold uppercase tracking-widest text-muted-foreground/70`,children:`P4 system footprint`}),(0,G.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,G.jsxs)(`div`,{className:`flex items-center gap-2 text-3xs text-muted-foreground/65`,children:[(0,G.jsx)(`span`,{className:`size-1.5 rounded-full bg-success`}),`Sampling every `,O?Ne(O.sampleIntervalMs):`...`]})]}),(0,G.jsxs)(`div`,{className:`grid grid-cols-2 divide-x divide-y divide-border/55 md:grid-cols-3`,children:[(0,G.jsx)(Y,{icon:(0,G.jsx)(te,{className:`size-3.5`}),label:`Current CPU`,value:k?`${k.currentCpuPercent.toFixed(1)}%`:`...`,detail:k?`${je(k.cpuTimeMs)} observed CPU time`:void 0}),(0,G.jsx)(Y,{icon:(0,G.jsx)(ee,{className:`size-3.5`}),label:`Resident memory`,value:k?H(k.currentRssBytes):`...`,detail:k?`${H(k.peakRssBytes)} combined process peaks`:void 0}),(0,G.jsx)(Y,{icon:(0,G.jsx)(h,{className:`size-3.5`}),label:`Process count`,value:k?String(k.processCount):`...`,detail:k?`${k.processStarts} starts · ${k.processExits} exits`:void 0}),(0,G.jsx)(Y,{icon:(0,G.jsx)(i,{className:`size-3.5`}),label:`Read throughput`,value:k?J(k.ioReadBytesPerSecond):`...`,detail:k?`${H(k.ioReadBytes)} observed`:void 0}),(0,G.jsx)(Y,{icon:(0,G.jsx)(x,{className:`size-3.5`}),label:`Write throughput`,value:k?J(k.ioWriteBytesPerSecond):`...`,detail:k?`${H(k.ioWriteBytes)} observed`:void 0,tone:k&&k.ioWriteBytesPerSecond>=10485760?`danger`:k&&k.ioWriteBytesPerSecond>=1048576?`warning`:`default`}),(0,G.jsx)(Y,{icon:(0,G.jsx)(s,{className:`size-3.5`}),label:`CPU speed limit`,value:O?ae===null?`Unknown`:`${ae.toFixed(0)}%`:`...`,detail:O?`${O.power.thermalState} thermal state`:void 0,tone:ae!==null&&ae<80?`warning`:`default`})]}),c.error?(0,G.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,G.jsx)(C,{className:`mt-0.5 size-3.5 shrink-0`}),(0,G.jsx)(`span`,{children:c.error})]}):null,O?(0,G.jsxs)(`div`,{className:`grid border-t border-border/60 bg-muted/10 md:grid-cols-3`,children:[(0,G.jsx)(We,{label:`Backend + agents`,accentClass:`bg-success/80`,aggregate:O.groups.backend}),(0,G.jsx)(We,{label:`Desktop`,accentClass:`bg-info/80`,aggregate:O.groups.electron}),(0,G.jsx)(We,{label:`Monitor overhead`,accentClass:`bg-warning/80`,aggregate:O.groups.monitor})]}):null]})}),(0,G.jsx)(V,{title:`Host & collection`,icon:(0,G.jsx)(s,{className:`size-4 text-muted-foreground`}),headerAction:I?(0,G.jsxs)(m,{size:`xs`,variant:`outline`,disabled:E,onClick:M,children:[(0,G.jsx)(be,{size:`xs`,refreshing:E}),`Retry monitor`]}):null,children:(0,G.jsxs)(`div`,{className:`grid overflow-hidden rounded-2xl border border-border/70 bg-card shadow-xs/5 md:grid-cols-2 md:divide-x md:divide-border/60`,children:[(0,G.jsxs)(`div`,{className:`px-4 py-4 sm:px-5`,children:[(0,G.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-3xs font-semibold uppercase tracking-widest text-muted-foreground/70`,children:[(0,G.jsx)(`span`,{className:`flex size-6 items-center justify-center rounded-md bg-muted/60`,children:(0,G.jsx)(v,{className:`size-3.5`})}),`Host state`]}),se&&O?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(X,{label:`Power source`,value:Be(O.power.onBattery,{true:`Battery`,false:`External power`})}),(0,G.jsx)(X,{label:`Low power mode`,value:Be(O.power.lowPowerMode,{true:`Enabled`,false:`Disabled`})}),(0,G.jsx)(X,{label:`Idle`,value:`${Be(O.power.idle,{true:`Idle`,false:`Active`})}${O.power.idleSeconds===null?``:` · ${Math.round(O.power.idleSeconds)}s`}`}),(0,G.jsx)(X,{label:`Session`,value:O.power.suspended?`Suspended`:Be(O.power.locked,{true:`Locked`,false:`Unlocked`})}),(0,G.jsx)(X,{label:`Thermal`,value:O.power.thermalState,valueClassName:O.power.thermalState===`serious`||O.power.thermalState===`critical`?`text-destructive`:void 0})]}):(0,G.jsxs)(`div`,{className:`rounded-xl border border-dashed border-border/70 bg-muted/20 px-4 py-5`,children:[(0,G.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:`Desktop host signals not connected`}),(0,G.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,G.jsxs)(`div`,{className:`border-t border-border/60 px-4 py-4 md:border-t-0 sm:px-5`,children:[(0,G.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-3xs font-semibold uppercase tracking-widest text-muted-foreground/70`,children:[(0,G.jsx)(`span`,{className:`flex size-6 items-center justify-center rounded-md bg-muted/60`,children:(0,G.jsx)(s,{className:`size-3.5`})}),`Collection health`]}),O?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Ke,{label:`Native process monitor`,health:O.health.native}),(0,G.jsx)(Ke,{label:`Electron main process`,health:O.health.desktop}),(0,G.jsx)(X,{label:`Collection time`,value:Me(O.health.collectionDurationMicros)}),(0,G.jsx)(X,{label:`Process scan`,value:`${O.health.retainedProcessCount}/${O.health.scannedProcessCount} retained`}),(0,G.jsx)(X,{label:`Inaccessible`,value:String(O.health.inaccessibleProcessCount),valueClassName:O.health.inaccessibleProcessCount>0?`text-warning-foreground`:void 0}),(0,G.jsx)(X,{label:`Sidecar`,value:p(O.health.sidecarVersion,{onNone:()=>`Unavailable`,onSome:e=>`${e}${p(O.health.sidecarPid,{onNone:()=>``,onSome:e=>` · PID ${e}`})}`})}),(0,G.jsx)(X,{label:`Restarts`,value:String(O.health.restartCount)})]}):(0,G.jsx)(`div`,{className:`py-4 text-xs text-muted-foreground`,children:`Waiting for collector health.`})]})]})}),(0,G.jsx)(V,{title:`Resource timeline`,icon:(0,G.jsx)(i,{className:`size-4 text-muted-foreground`}),headerAction:(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(Xe,{selectedWindowMs:t,onSelect:n}),(0,G.jsx)(m,{size:`icon-micro`,variant:`ghost`,disabled:u.isPending,onClick:u.refresh,"aria-label":`Refresh resource history`,children:(0,G.jsx)(be,{size:`xs`,refreshing:u.isPending})})]}),children:(0,G.jsxs)(`div`,{className:`overflow-hidden rounded-2xl border border-border/70 bg-card shadow-xs/5`,children:[u.error?(0,G.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,G.jsx)(C,{className:`mt-0.5 size-3.5 shrink-0`}),(0,G.jsx)(`span`,{children:u.error})]}):null,(0,G.jsx)(Qe,{buckets:u.data?.buckets??[]}),(0,G.jsx)(at,{processes:u.data?.topProcesses??[]})]})}),(0,G.jsx)(V,{title:`Live process tree`,icon:(0,G.jsx)(te,{className:`size-4 text-muted-foreground`}),headerAction:O?(0,G.jsxs)(`span`,{className:`text-3xs text-muted-foreground/55`,children:[`Identity: `,(0,G.jsx)(`span`,{className:`font-mono`,children:`PID + start time`})]}):null,children:(0,G.jsx)(`div`,{className:`overflow-hidden rounded-2xl border border-border/70 bg-card shadow-xs/5`,children:(0,G.jsx)(rt,{processes:O?.processes??[],canMaintainEnvironment:a,signalingKeys:y,onSignal:j})})}),(0,G.jsx)(V,{title:`Instrumented application I/O`,icon:(0,G.jsx)(x,{className:`size-4 text-muted-foreground`}),headerAction:(0,G.jsx)(`span`,{className:`text-3xs text-muted-foreground/55`,children:`Logical bytes by operation`}),children:(0,G.jsxs)(`div`,{className:`overflow-hidden rounded-2xl border border-border/70 bg-card shadow-xs/5`,children:[(0,G.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,G.jsx)(st,{entries:O?.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,W.c)(3),{environment:t,scope:n}=me();if(n.kind!==`environment`||!t){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,G.jsx)(V,{title:`OpenTelemetry export`,id:`telemetry-export`,children:(0,G.jsx)(U,{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,G.jsx)(mt,{},t.environmentId),e[1]=t.environmentId,e[2]=r),r}function mt(){let{environment:e}=me(),t=pe(e=>e.observability),[n,r]=(0,K.useState)({}),[i,a]=(0,K.useState)(!1),[o,s]=(0,K.useState)(null),c=e?.environmentId,l=E(N.checkOtlpEndpoint.permissionAtom(c??null)),u=l&&e?.serverConfig?.environment.capabilities.otlpEndpointCheck===!0,[d,f]=(0,K.useState)(()=>Object.fromEntries(ut.filter(({key:e})=>dt(t[e])).map(({key:e})=>[e,{url:t[e],result:null}]))),p=oe(N.updateSettings,{reportFailure:!0}),h=oe(N.checkOtlpEndpoint),g={...t,...n},_=ut.filter(({key:e})=>g[e].trim()!==t[e]),v=_.length>0,y=e?.serverConfig?.observability,b=async(e,t,n)=>{if(!c)return;let r=await h({environmentId:c,input:{signal:t,url:n}});f(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})},x=(e,t,n)=>{dt(n)&&(f(t=>({...t,[e]:{url:n,result:null}})),b(e,t,n))},S=(0,K.useEffectEvent)(()=>{for(let{key:e,signal:t}of ut){let n=d[e];n?.result===null&&b(e,t,n.url)}});return(0,K.useEffect)(()=>{u&&S()},[u]),(0,G.jsx)(V,{title:`OpenTelemetry export`,id:`telemetry-export`,children:(0,G.jsxs)(`form`,{className:`grid gap-4 px-4 py-4 sm:px-5`,onSubmit:async t=>{if(t.preventDefault(),e&&!i){a(!0),s(null);try{(await p({environmentId:e.environmentId,input:{patch:{observability:Object.fromEntries(_.map(({key:e})=>[e,g[e]]))}}}))._tag===`Success`&&(r({}),s(`Saved. Restart the server to apply.`))}finally{a(!1)}}},children:[(0,G.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.`}),!l&&(0,G.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=g[e].trim(),c=u?ft(o,d[e]):null;return(0,G.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[c&&(0,G.jsx)(_e,{dotClassName:c.dot}),(0,G.jsxs)(ve,{htmlFor:e,children:[n,` endpoint`]})]}),c&&(0,G.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:c.label})]}),(0,G.jsxs)(`div`,{className:`flex gap-2`,children:[(0,G.jsx)(fe,{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:g[e],disabled:i||!l,onChange:n=>{let i=n.target.value;r(n=>{let r={...n,[e]:i};return i.trim()===t[e]&&delete r[e],r}),s(null)}}),u&&(0,G.jsx)(m,{type:`button`,size:`sm`,variant:`outline`,disabled:!dt(o)||d[e]?.result===null,onClick:()=>void x(e,a,o),children:`Test`})]}),t[e]!==(y?.[e]??``)&&(0,G.jsxs)(`p`,{className:`break-all text-xs text-muted-foreground`,children:[`Running: `,y?.[e]||`Disabled`]})]},e)}),(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,G.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:o}),(0,G.jsxs)(`div`,{className:`flex shrink-0 gap-2`,children:[(0,G.jsx)(m,{type:`button`,size:`xs`,variant:`outline`,disabled:!v||i||!l,onClick:()=>{if(r({}),s(null),u)for(let{key:e,signal:n}of ut)d[e]?.url!==t[e]&&x(e,n,t[e])},children:`Discard`}),(0,G.jsx)(m,{type:`submit`,size:`xs`,disabled:!v||i||!l,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)} s`}function gt(e){if(e<1024)return`${e} B`;let t=[`KB`,`MB`,`GB`],n=-1,r=e;do r/=1024,n+=1;while(r>=1024&&n<t.length-1);return`${r.toFixed(r>=10?1:2)} ${t[n]}`}function _t(e){return e?ce(y(e)):`No trace records`}function vt(e){return _t(e).replaceAll(` `,`\xA0`)}function yt(e){return e.length<=32?e:`${e.slice(0,18)}...${e.slice(-10)}`}function bt(e){return e?.includes(`not a live descendant`)??!1}function $(e){let t=(0,W.c)(17),{label:n,value:r,tooltip:i,tone:o}=e,s=o===void 0?`default`:o,c;t[0]===n?c=t[1]:(c=(0,G.jsx)(`span`,{className:`min-w-0 truncate`,children:n}),t[0]=n,t[1]=c);let l;t[2]!==n||t[3]!==i?(l=i?(0,G.jsxs)(z,{children:[(0,G.jsx)(L,{render:(0,G.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,G.jsx)(a,{className:`size-3`})})}),(0,G.jsx)(R,{side:`top`,children:i})]}):null,t[2]=n,t[3]=i,t[4]=l):l=t[4];let u;t[5]!==c||t[6]!==l?(u=(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5 text-2xs font-medium uppercase tracking-widest text-muted-foreground/70`,children:[c,l]}),t[5]=c,t[6]=l,t[7]=u):u=t[7];let d=s===`warning`&&`text-warning-foreground`,f=s===`danger`&&`text-destructive`,p;t[8]!==d||t[9]!==f?(p=T(`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,G.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,G.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 xt(e){let t=(0,W.c)(6),{children:n}=e,r,i,a,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,G.jsx)(`span`,{className:`pointer-events-none absolute inset-y-0 left-1/2 w-px bg-border/60`,"aria-hidden":!0}),i=(0,G.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,G.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,G.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,G.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 St(e){let t=(0,W.c)(2),{label:n}=e,r;return t[0]===n?r=t[1]:(r=(0,G.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 Ct(e){let t=(0,W.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=T(`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,G.jsx)(`colgroup`,{children:n.map((e,t)=>(0,G.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,G.jsx)(`th`,{className:T(`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,G.jsx)(`thead`,{className:`border-b border-border/60 text-2xs uppercase tracking-widest text-muted-foreground/70`,children:(0,G.jsx)(`tr`,{children:u})}),t[12]=u,t[13]=d);let f;t[14]===r?f=t[15]:(f=(0,G.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,G.jsx)(B,{radius:`none`,chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`w-full max-w-full`,children:(0,G.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 wt(e){let t=(0,W.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:a}=j(r),o;t[1]===n?o=t[2]:(o=yt(n),t[1]=n,t[2]=o);let s;t[3]===o?s=t[4]:(s=(0,G.jsx)(L,{render:(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-2xs`,children:o})}),t[3]=o,t[4]=s);let c;t[5]===n?c=t[6]:(c=(0,G.jsx)(R,{side:`top`,variant:`code`,children:n}),t[5]=n,t[6]=c);let l;t[7]!==s||t[8]!==c?(l=(0,G.jsxs)(z,{children:[s,c]}),t[7]=s,t[8]=c,t[9]=l):l=t[9];let u=a?`Copied trace ID`:`Copy trace ID`,d;t[10]!==i||t[11]!==n?(d=()=>i(n),t[10]=i,t[11]=n,t[12]=d):d=t[12];let f;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,G.jsx)(g,{className:`size-3`}),t[13]=f):f=t[13];let p;t[14]!==u||t[15]!==d?(p=(0,G.jsx)(L,{render:(0,G.jsx)(m,{size:`icon-micro`,variant:`ghost-muted`,"aria-label":u,onClick:d,children:f})}),t[14]=u,t[15]=d,t[16]=p):p=t[16];let h=a?`Copied`:`Copy full trace ID`,_;t[17]===h?_=t[18]:(_=(0,G.jsx)(R,{side:`top`,children:h}),t[17]=h,t[18]=_);let v;t[19]!==_||t[20]!==p?(v=(0,G.jsxs)(z,{children:[p,_]}),t[19]=_,t[20]=p,t[21]=v):v=t[21];let y;return t[22]!==v||t[23]!==l?(y=(0,G.jsxs)(`div`,{className:`flex w-full min-w-0 max-w-full items-center gap-2`,children:[l,v]}),t[22]=v,t[23]=l,t[24]=y):y=t[24],y}function Tt(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 Et(e){return e.depth>0?`Subprocess`:/\b(codex|claude|opencode|cursor)\b/i.test(e.command)?`Agent`:`Process`}function Dt(e){let t=(0,W.c)(22),{process:n,isExpanded:r,onToggle:i}=e,a;t[0]===n.command?a=t[1]:(a=Tt(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,G.jsx)(m,{size:`icon-micro`,variant:`ghost-muted`,"aria-label":r?`Collapse ${o}`:`Expand ${o}`,onClick:()=>i(n.pid),children:(0,G.jsx)(O,{className:`size-3.5`,icon:r?D:k})}):(0,G.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,G.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,G.jsx)(L,{render:(0,G.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,G.jsx)(R,{side:`top`,variant:`code`,children:n.command}),t[13]=n.command,t[14]=p);let h;t[15]!==f||t[16]!==p?(h=(0,G.jsxs)(z,{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,G.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 Ot(e){let t=(0,W.c)(18),{processes:n,canMaintainEnvironment:r,signalingPid:i,onSignal:a,emptyLabel:o}=e,[s,c]=(0,K.useState)(kt),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,G.jsxs)(`colgroup`,{children:[(0,G.jsx)(`col`,{className:`w-[24%]`}),(0,G.jsx)(`col`,{className:`w-[8%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[33%]`}),(0,G.jsx)(`col`,{className:`w-[8%]`}),(0,G.jsx)(`col`,{className:`w-[11%]`}),(0,G.jsx)(`col`,{className:`w-[6%]`})]}),t[4]=p):p=t[4];let m;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,G.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,G.jsxs)(`tr`,{children:[(0,G.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Name`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Memory`}),(0,G.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Command`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`PID`}),(0,G.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Type`}),(0,G.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,G.jsx)(`tr`,{children:(0,G.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,G.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,G.jsx)(`td`,{className:`px-4 py-2 align-middle sm:pl-5`,children:(0,G.jsx)(Dt,{process:e,isExpanded:!s.has(e.pid),onToggle:f})}),(0,G.jsxs)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:[e.cpuPercent.toFixed(1),`%`]}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:gt(e.rssBytes)}),(0,G.jsx)(`td`,{className:`px-3 py-2 align-middle text-muted-foreground`,children:(0,G.jsxs)(z,{children:[(0,G.jsx)(L,{render:(0,G.jsx)(`span`,{className:`block truncate`,children:e.command})}),(0,G.jsx)(R,{side:`top`,variant:`code`,children:e.command})]})}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums text-muted-foreground`,children:e.pid}),(0,G.jsx)(`td`,{className:`truncate px-3 py-2 align-middle text-muted-foreground`,children:Et(e)}),(0,G.jsx)(`td`,{className:`p-2 align-middle sm:pr-4`,children:(0,G.jsx)(Ce,{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,G.jsx)(`div`,{className:`border-t border-border/60`,children:(0,G.jsx)(B,{radius:`none`,chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`max-h-[min(64vh,44rem)] w-full max-w-full`,children:(0,G.jsxs)(`table`,{className:`w-full min-w-[1040px] table-fixed text-left text-xs`,children:[p,m,(0,G.jsxs)(`tbody`,{className:`divide-y divide-border/50`,children:[h,g]})]})})}),t[15]=h,t[16]=g,t[17]=_):_=t[17],_}function kt(){return new Set}var At=[{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 jt(e){if(e<60)return`${e.toFixed(e>=10?1:2)}s`;let t=e/60;return t<60?`${t.toFixed(t>=10?1:2)}m`:`${(t/60).toFixed(2)}h`}function Mt(e){let t=Tt(e);return t.length>42?`${t.slice(0,39)}...`:t}function Nt(e){let t=(0,W.c)(21),{process:n,visualDepth:r}=e,i;t[0]===n.command?i=t[1]:(i=Mt(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,G.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=T(`size-1.5 shrink-0 rounded-full`,u),t[5]=u,t[6]=d);let f;t[7]===d?f=t[8]:(f=(0,G.jsx)(`span`,{className:d}),t[7]=d,t[8]=f);let p;t[9]===a?p=t[10]:(p=(0,G.jsx)(L,{render:(0,G.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,G.jsx)(R,{side:`top`,variant:`code`,children:n.command}),t[11]=n.command,t[12]=m);let h;t[13]!==m||t[14]!==p?(h=(0,G.jsxs)(z,{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,G.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 Pt(e){let t=(0,W.c)(9),{buckets:n}=e,r;t[0]===n?r=t[1]:(r=Math.max(1,...n.map(Ft)),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,G.jsxs)(z,{children:[(0,G.jsx)(L,{render:(0,G.jsx)(`div`,{className:`flex h-full min-w-1 flex-1 items-end`,children:(0,G.jsxs)(`div`,{className:`relative h-full w-full`,"aria-label":`Average CPU ${e.avgCpuPercent.toFixed(1)}%, peak CPU ${e.maxCpuPercent.toFixed(1)}%`,children:[(0,G.jsx)(`div`,{className:`absolute inset-x-0 bottom-0 rounded-t-sm bg-foreground/15 transition-colors`,style:{height:`${t}%`}}),(0,G.jsx)(`div`,{className:`absolute inset-x-0 bottom-0 rounded-t-sm bg-foreground/60 transition-colors`,style:{height:`${n}%`}})]})})}),(0,G.jsxs)(R,{side:`top`,children:[`Avg `,e.avgCpuPercent.toFixed(1),`%, peak `,e.maxCpuPercent.toFixed(1),`%`]})]},y(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,G.jsx)(`div`,{className:`border-t border-border/60 px-4 py-3 sm:px-5`,children:(0,G.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 Ft(e){return e.maxCpuPercent}function It(e){let t=(0,W.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=At.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=At.map(Lt),t[4]=s):s=t[4];let c;return t[5]!==a||t[6]!==o?(c=(0,G.jsx)(ue,{"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 Lt(e){return(0,G.jsx)(de,{value:String(e.windowMs),children:e.label},e.windowMs)}function Rt(e){let t=(0,W.c)(13),{processes:n,emptyLabel:r}=e,i=n.reduce(zt,null),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,G.jsxs)(`colgroup`,{children:[(0,G.jsx)(`col`,{className:`w-[24%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`}),(0,G.jsx)(`col`,{className:`w-[16%]`}),(0,G.jsx)(`col`,{className:`w-[10%]`})]}),t[0]=a):a=t[0];let o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,G.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,G.jsxs)(`tr`,{children:[(0,G.jsx)(`th`,{className:`px-4 py-2 font-semibold sm:pl-5`,children:`Process`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`CPU Time`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Current`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Average`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Peak`}),(0,G.jsx)(`th`,{className:`px-3 py-2 text-right font-semibold`,children:`Max Mem`}),(0,G.jsx)(`th`,{className:`px-3 py-2 font-semibold`,children:`Command`}),(0,G.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,G.jsx)(`tr`,{children:(0,G.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,G.jsxs)(`tr`,{className:`hover:bg-muted/20`,children:[(0,G.jsx)(`td`,{className:`px-4 py-2 align-middle sm:pl-5`,children:(0,G.jsx)(Nt,{process:e,visualDepth:e.isServerRoot||i===null?0:Math.max(1,e.depth-i+1)})}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:jt(e.cpuSecondsApprox)}),(0,G.jsxs)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:[e.currentCpuPercent.toFixed(1),`%`]}),(0,G.jsxs)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:[e.avgCpuPercent.toFixed(1),`%`]}),(0,G.jsxs)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:[e.maxCpuPercent.toFixed(1),`%`]}),(0,G.jsx)(`td`,{className:`px-3 py-2 text-right align-middle font-mono tabular-nums`,children:gt(e.maxRssBytes)}),(0,G.jsx)(`td`,{className:`px-3 py-2 align-middle text-muted-foreground`,children:(0,G.jsxs)(z,{children:[(0,G.jsx)(L,{render:(0,G.jsx)(`span`,{className:`block truncate`,children:e.command})}),(0,G.jsx)(R,{side:`top`,variant:`code`,children:e.command})]})}),(0,G.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,G.jsx)(`div`,{className:`border-t border-border/60`,children:(0,G.jsx)(B,{chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`max-h-[min(64vh,44rem)] w-full max-w-full`,children:(0,G.jsxs)(`table`,{className:`w-full min-w-[980px] table-fixed text-left text-xs`,children:[a,o,(0,G.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 zt(e,t){return t.isServerRoot?e:e===null?t.depth:Math.min(e,t.depth)}function Bt(e){let t=(0,W.c)(7),{checkedAt:n}=e;ge();let r;t[0]===n?r=t[1]:(r=le(n?y(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,G.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,G.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,G.jsx)(`span`,{className:`text-2xs text-muted-foreground/60`,children:i.suffix?(0,G.jsxs)(G.Fragment,{children:[`Checked `,(0,G.jsx)(`span`,{className:`font-mono tabular-nums`,children:i.value}),` `,i.suffix]}):(0,G.jsxs)(G.Fragment,{children:[`Checked `,i.value]})}),t[4]=i.suffix,t[5]=i.value,t[6]=a):a=t[6],a}function Vt(e){let t=(0,W.c)(12),{isPending:n,label:r,onClick:i}=e,a;t[0]===n?a=t[1]:(a=(0,G.jsx)(be,{refreshing:n}),t[0]=n,t[1]=a);let o;t[2]!==n||t[3]!==r||t[4]!==i||t[5]!==a?(o=(0,G.jsx)(L,{render:(0,G.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,G.jsx)(R,{side:`top`,children:r}),t[7]=r,t[8]=s);let c;return t[9]!==o||t[10]!==s?(c=(0,G.jsxs)(z,{children:[o,s]}),t[9]=o,t[10]=s,t[11]=c):c=t[11],c}function Ht(){let{environment:e}=me(),t=e?.environmentId??null,n=P(t,o),r=e?.serverConfig?.observability,i=e?.serverConfig?.availableEditors,a=P(t,d),s=I(t===null?null:ae.sessionStateAtom(t)),c=xe({connectionPhase:e?.connection.phase??`available`,session:s.data,hasSessionError:s.error!==null}),u=c.canReadDiagnostics,p=oe(N.signalProcess,{reportFailure:!1}),h=ye(t,i??[]),[g,_]=(0,K.useState)(9e5),v=At.find(e=>e.windowMs===g)??At[1],{data:x,error:S,isPending:ee,refresh:te}=I(t===null||!u?null:N.traceDiagnostics({environmentId:t,input:{}})),{data:E,error:D,isPending:O,refresh:k}=I(t===null||!u?null:N.processDiagnostics({environmentId:t,input:{}})),{data:j,error:M,isPending:se,refresh:ce}=I(t===null||!u?null:N.processResourceHistory({environmentId:t,input:{windowMs:v.windowMs,bucketMs:v.bucketMs}})),[le,ue]=(0,K.useState)(!1),[de,fe]=(0,K.useState)(null),[pe,ge]=(0,K.useState)(null),_e=(0,K.useRef)(null),H=(0,K.useRef)(t),ve=(0,K.useRef)(E);(0,K.useEffect)(()=>{ve.current=E},[E]),(0,K.useEffect)(()=>(H.current=t,()=>{H.current=null}),[t]);let be=(0,K.useCallback)(()=>{let e=r?.logsDirectoryPath??null;e&&t!==null&&F(t,`orchestration:operate`)&&(ue(!0),fe(null),(async()=>{let t=await h(e);if(ue(!1),t._tag===`Failure`&&!ne(t)){let e=re(t);fe(e instanceof Error?e.message:`Unable to open logs folder.`)}})())},[t,r?.logsDirectoryPath,h]),U=ee&&x===null,W=O&&E===null,Ce=se&&j===null,[we,Te]=(0,K.useState)(null);we!==t&&u&&!U&&!W&&!Ce&&Te(t);let Ee=(0,K.useCallback)(async(e,t)=>{let n=H.current,r=ve.current?.processes.find(t=>t.pid===e);if(n===null||r===void 0||!F(n,`environment:maintain`)||_e.current!==null)return;_e.current=e,ge(e);let i=()=>{_e.current=null,ge(null)};if(t===`SIGKILL`){let n=!1;try{n=await ie().dialogs.confirm(`Send SIGKILL to process ${e}? This cannot be handled by the process.`,{variant:`destructive`})}catch(e){i(),A.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=H.current;if(a===null||a!==n||!F(a,`environment:maintain`))i();else if(ve.current?.processes.find(t=>t.pid===e)?.startTimeMs!==r.startTimeMs)i();else try{let i=await p({environmentId:n,input:{pid:e,startTimeMs:r.startTimeMs,signal:t}});if(i._tag===`Failure`){if(!ne(i)){let e=re(i);A.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=w(i.value.message);if(k(),bt(e)){A.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}A.add({type:`error`,title:`Could not send ${t}`,description:e??`Failed to send ${t}.`});return}k()}finally{i()}},[k,p]),De=E?f(E.error):null,Oe=j?f(j.error):null,q=x?f(x.error):null,ke=x?b(x.partialFailure,()=>!1):!1;return u?(0,G.jsxs)(he,{width:`expanded`,className:`gap-10`,children:[(0,G.jsx)(lt,{environmentId:t}),(0,G.jsxs)(V,{title:`Live Processes`,headerAction:(0,G.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,G.jsx)(Bt,{checkedAt:E?.readAt??null}),(0,G.jsx)(Vt,{isPending:O,label:`Refresh process diagnostics`,onClick:k})]}),children:[(0,G.jsxs)(xt,{children:[(0,G.jsx)($,{label:`Child Processes`,value:E?Z(E.processCount):`...`}),(0,G.jsx)($,{label:`CPU`,value:E?`${E.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,G.jsx)($,{label:`Memory`,value:E?gt(E.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,G.jsx)($,{label:`Server PID`,value:E?String(E.serverPid):`...`})]}),De||D?(0,G.jsxs)(`div`,{className:`space-y-2 border-t border-border/60 px-4 py-3 text-xs text-muted-foreground sm:px-5`,children:[De?(0,G.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,G.jsx)(C,{className:`mt-0.5 size-3.5 shrink-0`}),(0,G.jsx)(`span`,{children:De.message})]}):null,D?(0,G.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,G.jsx)(C,{className:`mt-0.5 size-3.5 shrink-0`}),(0,G.jsx)(`span`,{children:D})]}):null]}):null,(0,G.jsx)(Ot,{processes:E?.processes??[],canMaintainEnvironment:n,signalingPid:pe,onSignal:Ee,emptyLabel:W?`Loading live processes...`:`No live descendant processes found.`})]}),(0,G.jsxs)(V,{title:`Resource History`,headerAction:(0,G.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,G.jsx)(It,{selectedWindowMs:g,onSelect:_}),(0,G.jsx)(Bt,{checkedAt:j?.readAt??null}),(0,G.jsx)(Vt,{isPending:se,label:`Refresh resource history`,onClick:ce})]}),children:[(0,G.jsxs)(xt,{children:[(0,G.jsx)($,{label:`CPU Time`,value:j?jt(j.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,G.jsx)($,{label:`Samples`,value:j?Z(j.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,G.jsx)($,{label:`Interval`,value:j?j.sampleIntervalMs===0?`On demand`:Q(j.sampleIntervalMs):`...`}),(0,G.jsx)($,{label:`Processes`,value:j?Z(j.topProcesses.length):`...`})]}),Oe||M?(0,G.jsxs)(`div`,{className:`space-y-2 border-t border-border/60 px-4 py-3 text-xs text-muted-foreground sm:px-5`,children:[Oe?(0,G.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,G.jsx)(C,{className:`mt-0.5 size-3.5 shrink-0`}),(0,G.jsx)(`span`,{children:Oe.message})]}):null,M?(0,G.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,G.jsx)(C,{className:`mt-0.5 size-3.5 shrink-0`}),(0,G.jsx)(`span`,{children:M})]}):null]}):null,(0,G.jsx)(Pt,{buckets:j?.buckets??[]}),(0,G.jsx)(Rt,{processes:j?.topProcesses??[],emptyLabel:Ce?`Collecting process resource samples...`:`No process resource samples found for this window.`})]}),(0,G.jsxs)(V,{title:`Trace Diagnostics`,headerAction:(0,G.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,G.jsx)(Bt,{checkedAt:x?.readAt??null}),(0,G.jsxs)(z,{children:[(0,G.jsx)(L,{render:(0,G.jsx)(m,{size:`icon-xs`,variant:`ghost-muted`,disabled:!a||!r?.logsDirectoryPath||le,onClick:be,"aria-label":`Open logs folder`,children:(0,G.jsx)(l,{})})}),(0,G.jsx)(R,{side:`top`,children:`Open logs folder`})]}),(0,G.jsx)(Vt,{isPending:ee,label:`Refresh trace diagnostics`,onClick:te})]}),children:[(0,G.jsxs)(xt,{children:[(0,G.jsx)($,{label:`Spans`,value:x?Z(x.recordCount):`...`}),(0,G.jsx)($,{label:`Failures`,value:x?Z(x.failureCount):`...`,tone:x&&x.failureCount>0?`danger`:`default`}),(0,G.jsx)($,{label:`Slow Spans`,value:x?Z(x.slowSpanCount):`...`,tooltip:x?`Spans with a duration of ${Q(x.slowSpanThresholdMs)} or longer.`:`Spans at or above the configured slow-span threshold.`,tone:x&&x.slowSpanCount>0?`warning`:`default`}),(0,G.jsx)($,{label:`Parse Errors`,value:x?Z(x.parseErrorCount):`...`,tone:x&&x.parseErrorCount>0?`warning`:`default`})]}),de||q||S?(0,G.jsxs)(`div`,{className:`space-y-2 border-t border-border/60 px-4 py-3 text-xs text-muted-foreground sm:px-5`,children:[de?(0,G.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,G.jsx)(C,{className:`mt-0.5 size-3.5 shrink-0`}),(0,G.jsx)(`span`,{children:de})]}):null,q?(0,G.jsxs)(`div`,{className:T(`flex items-start gap-2`,ke?`text-warning-foreground`:`text-destructive`),children:[(0,G.jsx)(C,{className:`mt-0.5 size-3.5 shrink-0`}),(0,G.jsx)(`span`,{children:ke?`Some trace files could not be read, so diagnostics may be incomplete. ${q.message}`:q.message})]}):null,S?(0,G.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,G.jsx)(C,{className:`mt-0.5 size-3.5 shrink-0`}),(0,G.jsx)(`span`,{children:S})]}):null]}):null]}),(0,G.jsx)(V,{title:`Latest Failures`,children:x&&x.latestFailures.length>0?(0,G.jsx)(Ct,{headers:[`Span`,`Cause`,`Duration`,`Ended`],children:x.latestFailures.map(e=>(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`td`,{className:`px-4 py-3 align-top text-xs font-medium text-foreground first:sm:pl-5`,children:e.name}),(0,G.jsx)(`td`,{className:`max-w-[360px] px-4 py-3 align-top text-muted-foreground`,children:(0,G.jsx)(Se,{text:e.cause})}),(0,G.jsx)(`td`,{className:`px-4 py-3 align-top font-mono tabular-nums`,children:Q(e.durationMs)}),(0,G.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums text-muted-foreground last:sm:pr-5`,children:vt(e.endedAt)})]},`${e.traceId}:${e.spanId}`))}):(0,G.jsx)(St,{label:U?`Loading failures...`:`No failed spans found.`})}),(0,G.jsx)(V,{title:`Most Common Failures`,children:x&&x.commonFailures.length>0?(0,G.jsx)(Ct,{headers:[`Span`,`Count`,`Cause`,`Last Seen`],minTableWidth:`min-w-[760px]`,children:x.commonFailures.map(e=>(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`td`,{className:`px-4 py-3 align-top text-xs font-medium text-foreground first:sm:pl-5`,children:e.name}),(0,G.jsx)(`td`,{className:`px-4 py-3 align-top font-mono tabular-nums`,children:Z(e.count)}),(0,G.jsx)(`td`,{className:`max-w-[360px] px-4 py-3 align-top text-muted-foreground`,children:(0,G.jsx)(Se,{text:e.cause})}),(0,G.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:vt(e.lastSeenAt)})]},`${e.name}:${e.cause}`))}):(0,G.jsx)(St,{label:U?`Loading failure groups...`:`No repeated failures found.`})}),(0,G.jsx)(V,{title:`Slowest Spans`,children:x&&x.slowestSpans.length>0?(0,G.jsx)(Ct,{headers:[`Span`,`Duration`,`Ended`,`Trace`],minTableWidth:`min-w-[900px]`,columnWidths:[`w-[44%]`,`w-[14%]`,`w-[12%]`,`w-[30%]`],children:x.slowestSpans.map(e=>(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`td`,{className:`px-4 py-3 align-top text-xs font-medium text-foreground first:sm:pl-5`,children:e.name}),(0,G.jsx)(`td`,{className:`px-4 py-3 align-top font-mono tabular-nums`,children:Q(e.durationMs)}),(0,G.jsx)(`td`,{className:`w-px whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums text-muted-foreground`,children:vt(e.endedAt)}),(0,G.jsx)(`td`,{className:`min-w-0 whitespace-nowrap px-4 py-3 align-top text-muted-foreground last:sm:pr-5`,children:(0,G.jsx)(wt,{traceId:e.traceId})})]},`${e.traceId}:${e.spanId}`))}):(0,G.jsx)(St,{label:U?`Loading slow spans...`:`No spans found.`})}),(0,G.jsx)(V,{title:`Span Logs`,children:x&&x.latestWarningAndErrorLogs.length>0?(0,G.jsx)(B,{radius:`none`,chainVerticalScroll:!0,scrollFade:!0,hideScrollbars:!0,className:`w-full max-w-full`,children:(0,G.jsxs)(`table`,{className:`w-full min-w-[920px] table-fixed text-left text-xs`,children:[(0,G.jsxs)(`colgroup`,{children:[(0,G.jsx)(`col`,{className:`w-[11%]`}),(0,G.jsx)(`col`,{className:`w-[9%]`}),(0,G.jsx)(`col`,{className:`w-[24%]`}),(0,G.jsx)(`col`,{className:`w-[26%]`}),(0,G.jsx)(`col`,{className:`w-[30%]`})]}),(0,G.jsx)(`thead`,{className:`border-b border-border/60 text-2xs uppercase tracking-widest text-muted-foreground/70`,children:(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold sm:pl-5`,children:`Time`}),(0,G.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold`,children:`Level`}),(0,G.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold`,children:`Span`}),(0,G.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold`,children:`Message`}),(0,G.jsx)(`th`,{className:`whitespace-nowrap px-4 py-2.5 font-semibold sm:pr-5`,children:`Trace`})]})}),(0,G.jsx)(`tbody`,{className:`divide-y divide-border/60`,children:x.latestWarningAndErrorLogs.map(e=>(0,G.jsxs)(`tr`,{className:`hover:bg-muted/15`,children:[(0,G.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums text-muted-foreground sm:pl-5`,children:vt(e.seenAt)}),(0,G.jsx)(`td`,{className:`px-4 py-3 align-top`,children:(0,G.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,G.jsx)(`td`,{className:`px-4 py-3 align-top`,children:(0,G.jsx)(`div`,{className:`truncate font-medium text-foreground`,children:e.spanName})}),(0,G.jsx)(`td`,{className:`px-4 py-3 align-top text-muted-foreground`,children:(0,G.jsx)(Se,{collapsedClassName:`line-clamp-2`,expandLabel:`Show full message`,text:e.message})}),(0,G.jsx)(`td`,{className:`min-w-0 whitespace-nowrap px-4 py-3 align-top text-muted-foreground sm:pr-5`,children:(0,G.jsx)(wt,{traceId:e.traceId})})]},`${e.traceId}:${e.spanId}:${y(e.seenAt)}:${e.message}`))})]})}):(0,G.jsx)(St,{label:U?`Loading recent logs...`:`No warnings or errors found.`})}),(0,G.jsx)(V,{title:`Top Span Names`,children:x&&x.topSpansByCount.length>0?(0,G.jsx)(Ct,{headers:[`Span`,`Count`,`Failures`,`Average`,`Max`],minTableWidth:`min-w-[760px]`,columnWidths:[`w-[48%]`,`w-[13%]`,`w-[13%]`,`w-[13%]`,`w-[13%]`],children:x.topSpansByCount.map(e=>(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`td`,{className:`px-4 py-3 align-top text-xs font-medium text-foreground first:sm:pl-5`,children:e.name}),(0,G.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums`,children:Z(e.count)}),(0,G.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums`,children:Z(e.failureCount)}),(0,G.jsx)(`td`,{className:`whitespace-nowrap px-4 py-3 align-top font-mono tabular-nums`,children:Q(e.averageDurationMs)}),(0,G.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,G.jsx)(St,{label:U?`Loading span names...`:`No spans found.`})}),we===t&&(0,G.jsx)(pt,{})]}):(0,G.jsx)(he,{children:(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t===null?`Connect an environment to see diagnostics.`:c.isPending?`Checking diagnostics access…`:c.error})})}var Ut=Ht;export{Ut as component};
|
|
2
|
+
//# sourceMappingURL=settings.diagnostics-lQ8O62tl.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./react-BUfh6y28.js";import{n as t,t as n}from"./jsx-runtime-DJeoFXNw.js";import{n as r}from"./SettingsPanels-
|
|
2
|
-
//# sourceMappingURL=settings.general-
|
|
1
|
+
import{a as e}from"./react-BUfh6y28.js";import{n as t,t as n}from"./jsx-runtime-DJeoFXNw.js";import{n as r}from"./SettingsPanels-DxAtLrQJ.js";var i=t(),a=e(n());function o(){let e=(0,i.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,a.jsx)(r,{}),e[0]=t):t=e[0],t}export{o as component};
|
|
2
|
+
//# sourceMappingURL=settings.general-BWHDfXfO.js.map
|