@hienlh/ppm 0.26.25 → 0.26.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/CLAUDE.md +1 -0
- package/assets/skills/ppm/SKILL.md +1 -1
- package/assets/skills/ppm/references/cli-reference.md +1 -1
- package/assets/skills/ppm/references/http-api.md +1 -1
- package/dist/web/assets/{accounts-settings-section-C3D3rsFc.js → accounts-settings-section-CHq3WVao.js} +1 -1
- package/dist/web/assets/accounts-settings-section-CHq3WVao.js.br +0 -0
- package/dist/web/assets/accounts-settings-section-CHq3WVao.js.gz +0 -0
- package/dist/web/assets/{agent-session-sheet-DLDOXcKE.js → agent-session-sheet-C0sgsTt9.js} +2 -2
- package/dist/web/assets/agent-session-sheet-C0sgsTt9.js.br +0 -0
- package/dist/web/assets/agent-session-sheet-C0sgsTt9.js.gz +0 -0
- package/dist/web/assets/{agent-session-window-content-BGuwxE19.js → agent-session-window-content-CbrD8f8E.js} +1 -1
- package/dist/web/assets/agent-session-window-content-CbrD8f8E.js.br +0 -0
- package/dist/web/assets/agent-session-window-content-CbrD8f8E.js.gz +0 -0
- package/dist/web/assets/{ai-resource-editor-DT-26Rdp.js → ai-resource-editor-CjellqxA.js} +1 -1
- package/dist/web/assets/ai-resource-editor-CjellqxA.js.br +0 -0
- package/dist/web/assets/ai-resource-editor-CjellqxA.js.gz +0 -0
- package/dist/web/assets/{ai-settings-section-BsoV8DFp.js → ai-settings-section-CSRMdQ2S.js} +1 -1
- package/dist/web/assets/ai-settings-section-CSRMdQ2S.js.br +0 -0
- package/dist/web/assets/ai-settings-section-CSRMdQ2S.js.gz +0 -0
- package/dist/web/assets/ai-settings-section-Db9X6wec.js +1 -0
- package/dist/web/assets/ai-settings-section-Db9X6wec.js.br +0 -0
- package/dist/web/assets/ai-settings-section-Db9X6wec.js.gz +0 -0
- package/dist/web/assets/{android-tab-3HjRSoW_.js → android-tab-DG1-4oee.js} +1 -1
- package/dist/web/assets/android-tab-DG1-4oee.js.br +0 -0
- package/dist/web/assets/android-tab-DG1-4oee.js.gz +0 -0
- package/dist/web/assets/{antigravity-usage-view-CE1g-eZl.js → antigravity-usage-view-C9gPFRb5.js} +1 -1
- package/dist/web/assets/antigravity-usage-view-C9gPFRb5.js.br +0 -0
- package/dist/web/assets/antigravity-usage-view-C9gPFRb5.js.gz +0 -0
- package/dist/web/assets/{appearance-settings-section-CJG4qHvE.js → appearance-settings-section-By5gIwBb.js} +1 -1
- package/dist/web/assets/appearance-settings-section-By5gIwBb.js.br +0 -0
- package/dist/web/assets/appearance-settings-section-By5gIwBb.js.gz +0 -0
- package/dist/web/assets/{apps-panel-B4jbxAe_.js → apps-panel-D7fUCDns.js} +1 -1
- package/dist/web/assets/apps-panel-D7fUCDns.js.br +0 -0
- package/dist/web/assets/apps-panel-D7fUCDns.js.gz +0 -0
- package/dist/web/assets/{assistant-settings-section-Di5jjuKn.js → assistant-settings-section-D2XmOMHN.js} +1 -1
- package/dist/web/assets/assistant-settings-section-D2XmOMHN.js.br +0 -0
- package/dist/web/assets/assistant-settings-section-D2XmOMHN.js.gz +0 -0
- package/dist/web/assets/{assistant-tab-D2Wwkel7.js → assistant-tab-BFarx_Ed.js} +1 -1
- package/dist/web/assets/assistant-tab-BFarx_Ed.js.br +0 -0
- package/dist/web/assets/assistant-tab-BFarx_Ed.js.gz +0 -0
- package/dist/web/assets/{branch-review-tab-DetdGBW0.js → branch-review-tab-DdIk8GqJ.js} +1 -1
- package/dist/web/assets/branch-review-tab-DdIk8GqJ.js.br +0 -0
- package/dist/web/assets/branch-review-tab-DdIk8GqJ.js.gz +0 -0
- package/dist/web/assets/{chat-tab-DgA92PM1.js → chat-tab-CAE9EaFD.js} +3 -3
- package/dist/web/assets/chat-tab-CAE9EaFD.js.br +0 -0
- package/dist/web/assets/chat-tab-CAE9EaFD.js.gz +0 -0
- package/dist/web/assets/{chat-tab-uk6z9nF_.js → chat-tab-CvA7BVJ4.js} +1 -1
- package/dist/web/assets/chat-tab-CvA7BVJ4.js.br +0 -0
- package/dist/web/assets/chat-tab-CvA7BVJ4.js.gz +0 -0
- package/dist/web/assets/{code-editor-D88i7jW3.js → code-editor-DtOD5q9b.js} +4 -4
- package/dist/web/assets/code-editor-DtOD5q9b.js.br +0 -0
- package/dist/web/assets/code-editor-DtOD5q9b.js.gz +0 -0
- package/dist/web/assets/{conflict-editor-DmK-qOnp.js → conflict-editor-Dj4BkpPf.js} +1 -1
- package/dist/web/assets/conflict-editor-Dj4BkpPf.js.br +0 -0
- package/dist/web/assets/conflict-editor-Dj4BkpPf.js.gz +0 -0
- package/dist/web/assets/{connection-form-tab-BRtP0dOS.js → connection-form-tab-Dk7r5Mtu.js} +1 -1
- package/dist/web/assets/connection-form-tab-Dk7r5Mtu.js.br +0 -0
- package/dist/web/assets/connection-form-tab-Dk7r5Mtu.js.gz +0 -0
- package/dist/web/assets/{csv-preview-CvJiaQvt.js → csv-preview-Dgmt5iQZ.js} +1 -1
- package/dist/web/assets/csv-preview-Dgmt5iQZ.js.br +0 -0
- package/dist/web/assets/csv-preview-Dgmt5iQZ.js.gz +0 -0
- package/dist/web/assets/{database-drivers-section-Bbw7LpNB.js → database-drivers-section-DSbxYtMp.js} +1 -1
- package/dist/web/assets/database-drivers-section-DSbxYtMp.js.br +0 -0
- package/dist/web/assets/database-drivers-section-DSbxYtMp.js.gz +0 -0
- package/dist/web/assets/{db-tab-parts-DZB-gBVo.js → db-tab-parts-CWVmqUJa.js} +1 -1
- package/dist/web/assets/db-tab-parts-CWVmqUJa.js.br +0 -0
- package/dist/web/assets/db-tab-parts-CWVmqUJa.js.gz +0 -0
- package/dist/web/assets/{design-settings-section-BPzrBXBF.js → design-settings-section-CnWSH_2N.js} +1 -1
- package/dist/web/assets/design-settings-section-CnWSH_2N.js.br +0 -0
- package/dist/web/assets/design-settings-section-CnWSH_2N.js.gz +0 -0
- package/dist/web/assets/{design-tab-CZsssg4U.js → design-tab-DiqcX1dI.js} +1 -1
- package/dist/web/assets/design-tab-DiqcX1dI.js.br +0 -0
- package/dist/web/assets/design-tab-DiqcX1dI.js.gz +0 -0
- package/dist/web/assets/{designs-sidebar-panel-BUe18lf3.js → designs-sidebar-panel-DeE4Jcpo.js} +1 -1
- package/dist/web/assets/designs-sidebar-panel-DeE4Jcpo.js.br +0 -0
- package/dist/web/assets/designs-sidebar-panel-DeE4Jcpo.js.gz +0 -0
- package/dist/web/assets/{diff-viewer-CP37xrCa.js → diff-viewer-6O_OSt5v.js} +1 -1
- package/dist/web/assets/diff-viewer-6O_OSt5v.js.br +0 -0
- package/dist/web/assets/diff-viewer-6O_OSt5v.js.gz +0 -0
- package/dist/web/assets/{docx-preview-bdsOmavD.js → docx-preview-CLWVH9aX.js} +1 -1
- package/dist/web/assets/docx-preview-CLWVH9aX.js.br +0 -0
- package/dist/web/assets/docx-preview-CLWVH9aX.js.gz +0 -0
- package/dist/web/assets/{editor-dialog-CutBoEjk.js → editor-dialog-DFix0Lrm.js} +1 -1
- package/dist/web/assets/editor-dialog-DFix0Lrm.js.br +0 -0
- package/dist/web/assets/editor-dialog-DFix0Lrm.js.gz +0 -0
- package/dist/web/assets/{editor-language-service-CvWIXOhc.js → editor-language-service-BxWCC26X.js} +1 -1
- package/dist/web/assets/editor-language-service-BxWCC26X.js.br +0 -0
- package/dist/web/assets/editor-language-service-BxWCC26X.js.gz +0 -0
- package/dist/web/assets/{explorer-body-CQmBBXfv.js → explorer-body-D0CQnNgj.js} +1 -1
- package/dist/web/assets/explorer-body-D0CQnNgj.js.br +0 -0
- package/dist/web/assets/explorer-body-D0CQnNgj.js.gz +0 -0
- package/dist/web/assets/{explorer-window-content-CLjCoNbm.js → explorer-window-content-DPLxcaoz.js} +1 -1
- package/dist/web/assets/explorer-window-content-DPLxcaoz.js.br +0 -0
- package/dist/web/assets/explorer-window-content-DPLxcaoz.js.gz +0 -0
- package/dist/web/assets/{extension-manager-section-DdYQKLbO.js → extension-manager-section-BWPlMBS4.js} +1 -1
- package/dist/web/assets/extension-manager-section-BWPlMBS4.js.br +0 -0
- package/dist/web/assets/extension-manager-section-BWPlMBS4.js.gz +0 -0
- package/dist/web/assets/{extension-webview-DK9hh2Y0.js → extension-webview-D5IPLnq8.js} +1 -1
- package/dist/web/assets/extension-webview-D5IPLnq8.js.br +0 -0
- package/dist/web/assets/extension-webview-D5IPLnq8.js.gz +0 -0
- package/dist/web/assets/{files-settings-section-8cUNHAuu.js → files-settings-section-MR-8W7DJ.js} +1 -1
- package/dist/web/assets/files-settings-section-MR-8W7DJ.js.br +0 -0
- package/dist/web/assets/files-settings-section-MR-8W7DJ.js.gz +0 -0
- package/dist/web/assets/{general-settings-section-D7vmzQJb.js → general-settings-section-CEl3ciuP.js} +1 -1
- package/dist/web/assets/general-settings-section-CEl3ciuP.js.br +0 -0
- package/dist/web/assets/general-settings-section-CEl3ciuP.js.gz +0 -0
- package/dist/web/assets/{git-log-panel-BSaunxeG.js → git-log-panel-DBfy0HRE.js} +1 -1
- package/dist/web/assets/git-log-panel-DBfy0HRE.js.br +0 -0
- package/dist/web/assets/git-log-panel-DBfy0HRE.js.gz +0 -0
- package/dist/web/assets/{git-review-tab-DIVcQU2d.js → git-review-tab-C1V1CZAt.js} +1 -1
- package/dist/web/assets/git-review-tab-C1V1CZAt.js.br +0 -0
- package/dist/web/assets/git-review-tab-C1V1CZAt.js.gz +0 -0
- package/dist/web/assets/{glide-data-grid-DSFI7lj5.js → glide-data-grid-D84U-1qn.js} +1 -1
- package/dist/web/assets/glide-data-grid-D84U-1qn.js.br +0 -0
- package/dist/web/assets/glide-data-grid-D84U-1qn.js.gz +0 -0
- package/dist/web/assets/{grid-save-dialog-CZJ8CGwa.js → grid-save-dialog-D9q2lcrq.js} +1 -1
- package/dist/web/assets/grid-save-dialog-D9q2lcrq.js.br +0 -0
- package/dist/web/assets/grid-save-dialog-D9q2lcrq.js.gz +0 -0
- package/dist/web/assets/{group-chat-tab-DFeXDRvD.js → group-chat-tab-Bl0ECmSY.js} +1 -1
- package/dist/web/assets/group-chat-tab-Bl0ECmSY.js.br +0 -0
- package/dist/web/assets/group-chat-tab-Bl0ECmSY.js.gz +0 -0
- package/dist/web/assets/{impexp-tab-BDexxZ-D.js → impexp-tab-BgGbQxzM.js} +1 -1
- package/dist/web/assets/impexp-tab-BgGbQxzM.js.br +0 -0
- package/dist/web/assets/impexp-tab-BgGbQxzM.js.gz +0 -0
- package/dist/web/assets/{index-hkWEyYns.js → index-CXjsAVvH.js} +5 -5
- package/dist/web/assets/index-CXjsAVvH.js.br +0 -0
- package/dist/web/assets/index-CXjsAVvH.js.gz +0 -0
- package/dist/web/assets/{jira-watcher-section-BQsk6Meh.js → jira-watcher-section-ButbXGom.js} +1 -1
- package/dist/web/assets/{keybindings-store-BOeSz2cZ.js → keybindings-store-csigJZE3.js} +1 -1
- package/dist/web/assets/{keyboard-shortcuts-section-Cmj42EhF.js → keyboard-shortcuts-section-BWvBH4ZU.js} +1 -1
- package/dist/web/assets/keyboard-shortcuts-section-BWvBH4ZU.js.br +0 -0
- package/dist/web/assets/keyboard-shortcuts-section-BWvBH4ZU.js.gz +0 -0
- package/dist/web/assets/{language-servers-section-Brh3-9ue.js → language-servers-section-DnehfNOm.js} +2 -2
- package/dist/web/assets/language-servers-section-DnehfNOm.js.br +0 -0
- package/dist/web/assets/language-servers-section-DnehfNOm.js.gz +0 -0
- package/dist/web/assets/{logs-app-C10T12Nn.js → logs-app-BlFJdAK9.js} +1 -1
- package/dist/web/assets/logs-app-BlFJdAK9.js.br +0 -0
- package/dist/web/assets/{logs-app-C10T12Nn.js.gz → logs-app-BlFJdAK9.js.gz} +0 -0
- package/dist/web/assets/{logs-tab-CQ6JE1PH.js → logs-tab-LAVt-dDa.js} +1 -1
- package/dist/web/assets/{logs-window-content-BZeunJPF.js → logs-window-content-Dfswr7eH.js} +1 -1
- package/dist/web/assets/{lsp-client-DWUEmZTw.js → lsp-client-CHfLLcaF.js} +1 -1
- package/dist/web/assets/lsp-client-CHfLLcaF.js.br +0 -0
- package/dist/web/assets/lsp-client-CHfLLcaF.js.gz +0 -0
- package/dist/web/assets/{markdown-renderer-R5P0d4vU.js → markdown-renderer-CSFnCZ8K.js} +1 -1
- package/dist/web/assets/markdown-renderer-CSFnCZ8K.js.br +0 -0
- package/dist/web/assets/markdown-renderer-CSFnCZ8K.js.gz +0 -0
- package/dist/web/assets/{markdown-renderer-CJIFwRyF.js → markdown-renderer-DksvADDz.js} +1 -1
- package/dist/web/assets/markdown-renderer-DksvADDz.js.br +0 -0
- package/dist/web/assets/markdown-renderer-DksvADDz.js.gz +0 -0
- package/dist/web/assets/{mobile-explorer-sheet-IG9QzF6l.js → mobile-explorer-sheet-B5sLjLZs.js} +1 -1
- package/dist/web/assets/mobile-explorer-sheet-B5sLjLZs.js.br +0 -0
- package/dist/web/assets/mobile-explorer-sheet-B5sLjLZs.js.gz +0 -0
- package/dist/web/assets/{monaco-diff-editor-DHjtaEX2.js → monaco-diff-editor-CXo44_VI.js} +1 -1
- package/dist/web/assets/{new-design-dialog-jBSJbk9e.js → new-design-dialog-_GiCQMy2.js} +1 -1
- package/dist/web/assets/new-design-dialog-_GiCQMy2.js.br +0 -0
- package/dist/web/assets/new-design-dialog-_GiCQMy2.js.gz +0 -0
- package/dist/web/assets/notification-settings-BJjDdN0W.js +1 -0
- package/dist/web/assets/notification-settings-BJjDdN0W.js.br +0 -0
- package/dist/web/assets/notification-settings-BJjDdN0W.js.gz +0 -0
- package/dist/web/assets/{notifications-settings-section-BXuOARiv.js → notifications-settings-section-D8irgdCE.js} +1 -1
- package/dist/web/assets/notifications-settings-section-D8irgdCE.js.br +0 -0
- package/dist/web/assets/notifications-settings-section-D8irgdCE.js.gz +0 -0
- package/dist/web/assets/{onboarding-entry-BKevZSkh.js → onboarding-entry-DzhsgvnY.js} +1 -1
- package/dist/web/assets/onboarding-entry-DzhsgvnY.js.br +0 -0
- package/dist/web/assets/onboarding-entry-DzhsgvnY.js.gz +0 -0
- package/dist/web/assets/{open-manager-chat-gmviInoL.js → open-manager-chat-Bkb2PmYu.js} +1 -1
- package/dist/web/assets/open-manager-chat-Bkb2PmYu.js.br +0 -0
- package/dist/web/assets/open-manager-chat-Bkb2PmYu.js.gz +0 -0
- package/dist/web/assets/{open-manager-chat-CzGWRVmq.js → open-manager-chat-CNVW5U1C.js} +1 -1
- package/dist/web/assets/open-manager-chat-CNVW5U1C.js.br +0 -0
- package/dist/web/assets/open-manager-chat-CNVW5U1C.js.gz +0 -0
- package/dist/web/assets/{problems-panel-El3QJIV6.js → problems-panel-DZCBTTK0.js} +1 -1
- package/dist/web/assets/problems-panel-DZCBTTK0.js.br +0 -0
- package/dist/web/assets/problems-panel-DZCBTTK0.js.gz +0 -0
- package/dist/web/assets/{process-table-BqXICQFQ.js → process-table-oLXQ1Mj2.js} +1 -1
- package/dist/web/assets/process-table-oLXQ1Mj2.js.br +0 -0
- package/dist/web/assets/process-table-oLXQ1Mj2.js.gz +0 -0
- package/dist/web/assets/{proxy-settings-section-m-6EeVHv.js → proxy-settings-section-D88d-YqC.js} +1 -1
- package/dist/web/assets/proxy-settings-section-D88d-YqC.js.br +0 -0
- package/dist/web/assets/proxy-settings-section-D88d-YqC.js.gz +0 -0
- package/dist/web/assets/{query-tab-GB_U7IeW.js → query-tab-D3UWqL_c.js} +1 -1
- package/dist/web/assets/query-tab-D3UWqL_c.js.br +0 -0
- package/dist/web/assets/query-tab-D3UWqL_c.js.gz +0 -0
- package/dist/web/assets/{release-notes-window-content-CwUQhgZ_.js → release-notes-window-content-DBGd9q2f.js} +1 -1
- package/dist/web/assets/{remote-access-settings-section-XCqpwwga.js → remote-access-settings-section-lDOBuTcD.js} +1 -1
- package/dist/web/assets/remote-access-settings-section-lDOBuTcD.js.br +0 -0
- package/dist/web/assets/remote-access-settings-section-lDOBuTcD.js.gz +0 -0
- package/dist/web/assets/{remote-desktop-clipboard-notice-Dv9WhBL3.js → remote-desktop-clipboard-notice-C8lLPqSE.js} +1 -1
- package/dist/web/assets/remote-desktop-clipboard-notice-C8lLPqSE.js.br +0 -0
- package/dist/web/assets/remote-desktop-clipboard-notice-C8lLPqSE.js.gz +0 -0
- package/dist/web/assets/{remote-desktop-mobile-sheet-mucuAaLY.js → remote-desktop-mobile-sheet-1X9nMYdk.js} +2 -2
- package/dist/web/assets/remote-desktop-mobile-sheet-1X9nMYdk.js.br +0 -0
- package/dist/web/assets/remote-desktop-mobile-sheet-1X9nMYdk.js.gz +0 -0
- package/dist/web/assets/{remote-desktop-mobile-view-Cj1MLaFm.js → remote-desktop-mobile-view-DXlyxMuT.js} +1 -1
- package/dist/web/assets/remote-desktop-mobile-view-DXlyxMuT.js.br +0 -0
- package/dist/web/assets/remote-desktop-mobile-view-DXlyxMuT.js.gz +0 -0
- package/dist/web/assets/{remote-desktop-readiness-gate-NsbB_MYU.js → remote-desktop-readiness-gate-CapsSTlz.js} +1 -1
- package/dist/web/assets/remote-desktop-readiness-gate-CapsSTlz.js.br +0 -0
- package/dist/web/assets/remote-desktop-readiness-gate-CapsSTlz.js.gz +0 -0
- package/dist/web/assets/{remote-desktop-window-content-BhLPmsZd.js → remote-desktop-window-content-CmASOSoo.js} +1 -1
- package/dist/web/assets/remote-desktop-window-content-CmASOSoo.js.br +0 -0
- package/dist/web/assets/remote-desktop-window-content-CmASOSoo.js.gz +0 -0
- package/dist/web/assets/{rename-object-dialog-BGHpYZhK.js → rename-object-dialog-CFhoU1ti.js} +1 -1
- package/dist/web/assets/rename-object-dialog-CFhoU1ti.js.br +0 -0
- package/dist/web/assets/rename-object-dialog-CFhoU1ti.js.gz +0 -0
- package/dist/web/assets/{reveal-task-in-sidebar-kgQ18Zdo.js → reveal-task-in-sidebar-Dz0tH8vo.js} +1 -1
- package/dist/web/assets/{review-address-setup-iMXqLLGl.js → review-address-setup-CHbOBPtn.js} +1 -1
- package/dist/web/assets/review-address-setup-CHbOBPtn.js.br +0 -0
- package/dist/web/assets/review-address-setup-CHbOBPtn.js.gz +0 -0
- package/dist/web/assets/{review-code-DHxs5cqr.js → review-code-Ek4TK-FX.js} +1 -1
- package/dist/web/assets/review-code-Ek4TK-FX.js.br +0 -0
- package/dist/web/assets/review-code-Ek4TK-FX.js.gz +0 -0
- package/dist/web/assets/{save-as-dialog-Djahsc1T.js → save-as-dialog-m00iZElW.js} +1 -1
- package/dist/web/assets/save-as-dialog-m00iZElW.js.br +0 -0
- package/dist/web/assets/save-as-dialog-m00iZElW.js.gz +0 -0
- package/dist/web/assets/{schedule-form-BL62-9bF.js → schedule-form-BDbZLG_F.js} +3 -3
- package/dist/web/assets/schedule-form-BDbZLG_F.js.br +0 -0
- package/dist/web/assets/schedule-form-BDbZLG_F.js.gz +0 -0
- package/dist/web/assets/{schedule-script-editor-CkJnUiR4.js → schedule-script-editor-BC7_nlsE.js} +1 -1
- package/dist/web/assets/schedule-script-editor-BC7_nlsE.js.br +0 -0
- package/dist/web/assets/schedule-script-editor-BC7_nlsE.js.gz +0 -0
- package/dist/web/assets/{schedules-app-C9_n1L6K.js → schedules-app-C6IdZ1hz.js} +1 -1
- package/dist/web/assets/schedules-app-C6IdZ1hz.js.br +0 -0
- package/dist/web/assets/schedules-app-C6IdZ1hz.js.gz +0 -0
- package/dist/web/assets/{schedules-settings-section-CI_0jYgG.js → schedules-settings-section-Dhc_ZbMP.js} +3 -3
- package/dist/web/assets/schedules-settings-section-Dhc_ZbMP.js.br +0 -0
- package/dist/web/assets/schedules-settings-section-Dhc_ZbMP.js.gz +0 -0
- package/dist/web/assets/{schedules-tab-BvYAcvO_.js → schedules-tab-NMvWV7xN.js} +1 -1
- package/dist/web/assets/schedules-tab-NMvWV7xN.js.br +0 -0
- package/dist/web/assets/schedules-tab-NMvWV7xN.js.gz +0 -0
- package/dist/web/assets/{schedules-ui-Bj4uM71z.js → schedules-ui-DaSldyoD.js} +1 -1
- package/dist/web/assets/schedules-ui-DaSldyoD.js.br +0 -0
- package/dist/web/assets/schedules-ui-DaSldyoD.js.gz +0 -0
- package/dist/web/assets/{schedules-window-content-fn4dXnW0.js → schedules-window-content-MseZLBpK.js} +1 -1
- package/dist/web/assets/schedules-window-content-MseZLBpK.js.br +0 -0
- package/dist/web/assets/schedules-window-content-MseZLBpK.js.gz +0 -0
- package/dist/web/assets/{session-review-tab-DSEjqKaO.js → session-review-tab-BEPMJynS.js} +1 -1
- package/dist/web/assets/session-review-tab-BEPMJynS.js.br +0 -0
- package/dist/web/assets/session-review-tab-BEPMJynS.js.gz +0 -0
- package/dist/web/assets/{settings-body-Bx7lXh_W.js → settings-body-D2e_RbI4.js} +1 -1
- package/dist/web/assets/settings-body-D2e_RbI4.js.br +0 -0
- package/dist/web/assets/settings-body-D2e_RbI4.js.gz +0 -0
- package/dist/web/assets/{settings-rows-6kYZSWYo.js → settings-rows-B6puQ-Vk.js} +1 -1
- package/dist/web/assets/settings-rows-B6puQ-Vk.js.br +0 -0
- package/dist/web/assets/settings-rows-B6puQ-Vk.js.gz +0 -0
- package/dist/web/assets/{settings-section-content-BHSM6JLt.js → settings-section-content-DPyAAu71.js} +1 -1
- package/dist/web/assets/{settings-section-content-Ch4UlUlz.js → settings-section-content-Mzy53zFZ.js} +2 -2
- package/dist/web/assets/settings-section-content-Mzy53zFZ.js.br +0 -0
- package/dist/web/assets/settings-section-content-Mzy53zFZ.js.gz +0 -0
- package/dist/web/assets/{settings-tab-C33ydIbT.js → settings-tab-DFgGmabd.js} +1 -1
- package/dist/web/assets/{settings-window-content-B6xiTov9.js → settings-window-content-C9IxMJOD.js} +1 -1
- package/dist/web/assets/{sql-object-tab-DF68oD4Y.js → sql-object-tab-DXiJqm1Y.js} +1 -1
- package/dist/web/assets/sql-object-tab-DXiJqm1Y.js.br +0 -0
- package/dist/web/assets/sql-object-tab-DXiJqm1Y.js.gz +0 -0
- package/dist/web/assets/{sqlite-viewer-C53FYUW7.js → sqlite-viewer-BoqlcTq3.js} +1 -1
- package/dist/web/assets/sqlite-viewer-BoqlcTq3.js.br +0 -0
- package/dist/web/assets/sqlite-viewer-BoqlcTq3.js.gz +0 -0
- package/dist/web/assets/{storage-settings-section-DHccXTed.js → storage-settings-section-BSzvRWfE.js} +1 -1
- package/dist/web/assets/storage-settings-section-BSzvRWfE.js.br +0 -0
- package/dist/web/assets/storage-settings-section-BSzvRWfE.js.gz +0 -0
- package/dist/web/assets/{structure-save-dialog-ByyfWBQ3.js → structure-save-dialog-DmAOFSGl.js} +1 -1
- package/dist/web/assets/structure-save-dialog-DmAOFSGl.js.br +0 -0
- package/dist/web/assets/structure-save-dialog-DmAOFSGl.js.gz +0 -0
- package/dist/web/assets/{structure-tab-DbFGcN7I.js → structure-tab-Cj2T4GOA.js} +1 -1
- package/dist/web/assets/structure-tab-Cj2T4GOA.js.br +0 -0
- package/dist/web/assets/structure-tab-Cj2T4GOA.js.gz +0 -0
- package/dist/web/assets/{system-monitor-body-BxBWIZfo.js → system-monitor-body-ryEXCvyT.js} +2 -2
- package/dist/web/assets/system-monitor-body-ryEXCvyT.js.br +0 -0
- package/dist/web/assets/system-monitor-body-ryEXCvyT.js.gz +0 -0
- package/dist/web/assets/{system-monitor-tab-DxKpeIaE.js → system-monitor-tab-DcNzbPgb.js} +1 -1
- package/dist/web/assets/{system-monitor-window-content-DAY6eSK7.js → system-monitor-window-content-CpFLui4-.js} +1 -1
- package/dist/web/assets/{tab-host-window-content-xvl32Qm6.js → tab-host-window-content-CD92R8Dj.js} +1 -1
- package/dist/web/assets/tab-host-window-content-CD92R8Dj.js.br +0 -0
- package/dist/web/assets/tab-host-window-content-CD92R8Dj.js.gz +0 -0
- package/dist/web/assets/{table-tab-u-7eOEjr.js → table-tab-zoEhA_cF.js} +1 -1
- package/dist/web/assets/table-tab-zoEhA_cF.js.br +0 -0
- package/dist/web/assets/table-tab-zoEhA_cF.js.gz +0 -0
- package/dist/web/assets/{task-detail-mobile-dMcVIoRs.js → task-detail-mobile-40HLTUnk.js} +1 -1
- package/dist/web/assets/task-detail-mobile-40HLTUnk.js.br +0 -0
- package/dist/web/assets/task-detail-mobile-40HLTUnk.js.gz +0 -0
- package/dist/web/assets/{task-sheet-BpL6w5FD.js → task-sheet-Tbk7O-Ak.js} +1 -1
- package/dist/web/assets/task-sheet-Tbk7O-Ak.js.br +0 -0
- package/dist/web/assets/task-sheet-Tbk7O-Ak.js.gz +0 -0
- package/dist/web/assets/{task-status-grid-Bt-UFG9Y.js → task-status-grid-D4UX5sy_.js} +1 -1
- package/dist/web/assets/task-status-grid-D4UX5sy_.js.br +0 -0
- package/dist/web/assets/task-status-grid-D4UX5sy_.js.gz +0 -0
- package/dist/web/assets/{task-tab-Bx3UftQY.js → task-tab-CrW-DqBd.js} +1 -1
- package/dist/web/assets/task-tab-CrW-DqBd.js.br +0 -0
- package/dist/web/assets/task-tab-CrW-DqBd.js.gz +0 -0
- package/dist/web/assets/{tasks-sidebar-panel-DopLJjgy.js → tasks-sidebar-panel-D3opTyDQ.js} +1 -1
- package/dist/web/assets/tasks-sidebar-panel-D3opTyDQ.js.br +0 -0
- package/dist/web/assets/tasks-sidebar-panel-D3opTyDQ.js.gz +0 -0
- package/dist/web/assets/{telegram-bot-token-field-DRkuw4nN.js → telegram-bot-token-field-CP_XKOOb.js} +1 -1
- package/dist/web/assets/telegram-bot-token-field-CP_XKOOb.js.br +0 -0
- package/dist/web/assets/telegram-bot-token-field-CP_XKOOb.js.gz +0 -0
- package/dist/web/assets/{terminal-tab-CYGksYRc.js → terminal-tab-eVtopKuS.js} +1 -1
- package/dist/web/assets/terminal-tab-eVtopKuS.js.br +0 -0
- package/dist/web/assets/terminal-tab-eVtopKuS.js.gz +0 -0
- package/dist/web/assets/{tool-cards-ChRYIgbI.js → tool-cards-CqkbtQmV.js} +3 -3
- package/dist/web/assets/tool-cards-CqkbtQmV.js.br +0 -0
- package/dist/web/assets/tool-cards-CqkbtQmV.js.gz +0 -0
- package/dist/web/assets/{tools-settings-section-CgK3FQoK.js → tools-settings-section-ym2uDafc.js} +1 -1
- package/dist/web/assets/tools-settings-section-ym2uDafc.js.br +0 -0
- package/dist/web/assets/tools-settings-section-ym2uDafc.js.gz +0 -0
- package/dist/web/assets/{use-db-read-DhCLiECm.js → use-db-read-MivtTKTM.js} +1 -1
- package/dist/web/assets/use-db-read-MivtTKTM.js.br +0 -0
- package/dist/web/assets/use-db-read-MivtTKTM.js.gz +0 -0
- package/dist/web/assets/{use-inline-blame-BM3xEWhp.js → use-inline-blame-qDX6zmzH.js} +1 -1
- package/dist/web/assets/use-inline-blame-qDX6zmzH.js.br +0 -0
- package/dist/web/assets/use-inline-blame-qDX6zmzH.js.gz +0 -0
- package/dist/web/assets/{use-lsp-DbU39GP7.js → use-lsp-BdHI4aa8.js} +1 -1
- package/dist/web/assets/use-lsp-BdHI4aa8.js.br +0 -0
- package/dist/web/assets/use-lsp-BdHI4aa8.js.gz +0 -0
- package/dist/web/assets/{use-monaco-theme-B2WpajeO.js → use-monaco-theme-B4sZXOJo.js} +1 -1
- package/dist/web/assets/{use-process-kill-9NhJJrf6.js → use-process-kill-B7kifhe_.js} +1 -1
- package/dist/web/assets/use-process-kill-B7kifhe_.js.br +0 -0
- package/dist/web/assets/use-process-kill-B7kifhe_.js.gz +0 -0
- package/dist/web/assets/{use-sql-schema-info-C11TKahK.js → use-sql-schema-info-w7C5brXk.js} +1 -1
- package/dist/web/assets/use-sql-schema-info-w7C5brXk.js.br +0 -0
- package/dist/web/assets/use-sql-schema-info-w7C5brXk.js.gz +0 -0
- package/dist/web/assets/{use-websocket-B5u-9Nte.js → use-websocket-DsX1l-DK.js} +1 -1
- package/dist/web/assets/{vault-settings-section-CcruoXwN.js → vault-settings-section-B0oWe-n2.js} +1 -1
- package/dist/web/assets/vault-settings-section-B0oWe-n2.js.br +0 -0
- package/dist/web/assets/vault-settings-section-B0oWe-n2.js.gz +0 -0
- package/dist/web/assets/{voice-settings-section-DBQVSx2W.js → voice-settings-section-DNNYOnyl.js} +1 -1
- package/dist/web/assets/voice-settings-section-DNNYOnyl.js.br +0 -0
- package/dist/web/assets/voice-settings-section-DNNYOnyl.js.gz +0 -0
- package/dist/web/assets/{web-preview-tab-DKosRbHw.js → web-preview-tab-CvP7EV4g.js} +1 -1
- package/dist/web/assets/web-preview-tab-CvP7EV4g.js.br +0 -0
- package/dist/web/assets/web-preview-tab-CvP7EV4g.js.gz +0 -0
- package/dist/web/assets/{xlsx-preview-DCBVVwtB.js → xlsx-preview-EuM_t7JD.js} +1 -1
- package/dist/web/assets/xlsx-preview-EuM_t7JD.js.br +0 -0
- package/dist/web/assets/xlsx-preview-EuM_t7JD.js.gz +0 -0
- package/dist/web/index.html +1 -1
- package/dist/web/index.html.br +0 -0
- package/dist/web/index.html.gz +0 -0
- package/dist/web/sw.js +1 -1
- package/dist/web/sw.js.br +0 -0
- package/dist/web/sw.js.gz +0 -0
- package/package.json +1 -1
- package/src/cli/commands/restart.ts +8 -5
- package/src/cli/commands/stop.ts +14 -2
- package/src/cli/utils/ai-setting-write.ts +3 -0
- package/src/index.ts +6 -1
- package/src/providers/claude-agent-sdk-query-options.ts +36 -5
- package/src/providers/claude-agent-sdk.ts +24 -3
- package/src/providers/claude-warm-spare.ts +3 -0
- package/src/server/index.ts +42 -6
- package/src/server/routes/settings.ts +15 -0
- package/src/server/ws/chat.ts +52 -2
- package/src/services/autostart-generator.ts +23 -4
- package/src/services/autostart-register.ts +16 -1
- package/src/services/cli-leftover-reaper.ts +84 -0
- package/src/services/config-write-guard.ts +10 -0
- package/src/services/memory-diagnostics-spawns.ts +7 -0
- package/src/services/memory-guard/heavy-command-gate.ts +317 -0
- package/src/services/memory-guard/idle-subprocess-release.ts +47 -0
- package/src/services/memory-guard/low-memory-alert.ts +56 -0
- package/src/services/memory-guard/memory-guard.service.ts +85 -0
- package/src/services/memory-pulse.ts +129 -0
- package/src/services/memory-watchdog.ts +60 -2
- package/src/services/notification.service.ts +1 -1
- package/src/services/restart-news/previous-run-death.ts +208 -0
- package/src/services/restart-news/restart-news-text.ts +1 -0
- package/src/services/restart-news/supervisor-start-reason.ts +14 -1
- package/src/services/supervisor-memory-guard.ts +68 -0
- package/src/services/supervisor-state.ts +6 -1
- package/src/services/supervisor-watchdog/ensure-supervisor-decision.ts +98 -0
- package/src/services/supervisor-watchdog/ensure-supervisor.ts +149 -0
- package/src/services/supervisor-watchdog/leftover-recovery.ts +46 -0
- package/src/services/supervisor-watchdog/recorded-pid.ts +53 -0
- package/src/services/supervisor.ts +141 -16
- package/src/services/system-commit.ts +69 -0
- package/src/shared/memory-guard.ts +53 -0
- package/src/shared/notification-settings.ts +4 -3
- package/src/shared/restart-news.ts +4 -2
- package/src/types/config.ts +9 -0
- package/src/web/components/settings/ai-settings-section.tsx +10 -0
- package/src/web/components/settings/memory-guard-settings.tsx +78 -0
- package/src/web/lib/api-settings.ts +3 -0
- package/dist/web/assets/accounts-settings-section-C3D3rsFc.js.br +0 -0
- package/dist/web/assets/accounts-settings-section-C3D3rsFc.js.gz +0 -0
- package/dist/web/assets/agent-session-sheet-DLDOXcKE.js.br +0 -0
- package/dist/web/assets/agent-session-sheet-DLDOXcKE.js.gz +0 -0
- package/dist/web/assets/agent-session-window-content-BGuwxE19.js.br +0 -0
- package/dist/web/assets/agent-session-window-content-BGuwxE19.js.gz +0 -0
- package/dist/web/assets/ai-resource-editor-DT-26Rdp.js.br +0 -0
- package/dist/web/assets/ai-resource-editor-DT-26Rdp.js.gz +0 -0
- package/dist/web/assets/ai-settings-section-BsoV8DFp.js.br +0 -0
- package/dist/web/assets/ai-settings-section-BsoV8DFp.js.gz +0 -0
- package/dist/web/assets/ai-settings-section-C9A9ic78.js +0 -1
- package/dist/web/assets/ai-settings-section-C9A9ic78.js.br +0 -0
- package/dist/web/assets/ai-settings-section-C9A9ic78.js.gz +0 -0
- package/dist/web/assets/android-tab-3HjRSoW_.js.br +0 -0
- package/dist/web/assets/android-tab-3HjRSoW_.js.gz +0 -0
- package/dist/web/assets/antigravity-usage-view-CE1g-eZl.js.br +0 -0
- package/dist/web/assets/antigravity-usage-view-CE1g-eZl.js.gz +0 -0
- package/dist/web/assets/appearance-settings-section-CJG4qHvE.js.br +0 -0
- package/dist/web/assets/appearance-settings-section-CJG4qHvE.js.gz +0 -0
- package/dist/web/assets/apps-panel-B4jbxAe_.js.br +0 -0
- package/dist/web/assets/apps-panel-B4jbxAe_.js.gz +0 -0
- package/dist/web/assets/assistant-settings-section-Di5jjuKn.js.br +0 -0
- package/dist/web/assets/assistant-settings-section-Di5jjuKn.js.gz +0 -0
- package/dist/web/assets/assistant-tab-D2Wwkel7.js.br +0 -0
- package/dist/web/assets/assistant-tab-D2Wwkel7.js.gz +0 -0
- package/dist/web/assets/branch-review-tab-DetdGBW0.js.br +0 -0
- package/dist/web/assets/branch-review-tab-DetdGBW0.js.gz +0 -0
- package/dist/web/assets/chat-tab-DgA92PM1.js.br +0 -0
- package/dist/web/assets/chat-tab-DgA92PM1.js.gz +0 -0
- package/dist/web/assets/chat-tab-uk6z9nF_.js.br +0 -0
- package/dist/web/assets/chat-tab-uk6z9nF_.js.gz +0 -0
- package/dist/web/assets/code-editor-D88i7jW3.js.br +0 -0
- package/dist/web/assets/code-editor-D88i7jW3.js.gz +0 -0
- package/dist/web/assets/conflict-editor-DmK-qOnp.js.br +0 -0
- package/dist/web/assets/conflict-editor-DmK-qOnp.js.gz +0 -0
- package/dist/web/assets/connection-form-tab-BRtP0dOS.js.br +0 -0
- package/dist/web/assets/connection-form-tab-BRtP0dOS.js.gz +0 -0
- package/dist/web/assets/csv-preview-CvJiaQvt.js.br +0 -0
- package/dist/web/assets/csv-preview-CvJiaQvt.js.gz +0 -0
- package/dist/web/assets/database-drivers-section-Bbw7LpNB.js.br +0 -0
- package/dist/web/assets/database-drivers-section-Bbw7LpNB.js.gz +0 -0
- package/dist/web/assets/db-tab-parts-DZB-gBVo.js.br +0 -0
- package/dist/web/assets/db-tab-parts-DZB-gBVo.js.gz +0 -0
- package/dist/web/assets/design-settings-section-BPzrBXBF.js.br +0 -0
- package/dist/web/assets/design-settings-section-BPzrBXBF.js.gz +0 -0
- package/dist/web/assets/design-tab-CZsssg4U.js.br +0 -0
- package/dist/web/assets/design-tab-CZsssg4U.js.gz +0 -0
- package/dist/web/assets/designs-sidebar-panel-BUe18lf3.js.br +0 -0
- package/dist/web/assets/designs-sidebar-panel-BUe18lf3.js.gz +0 -0
- package/dist/web/assets/diff-viewer-CP37xrCa.js.br +0 -0
- package/dist/web/assets/diff-viewer-CP37xrCa.js.gz +0 -0
- package/dist/web/assets/docx-preview-bdsOmavD.js.br +0 -0
- package/dist/web/assets/docx-preview-bdsOmavD.js.gz +0 -0
- package/dist/web/assets/editor-dialog-CutBoEjk.js.br +0 -0
- package/dist/web/assets/editor-dialog-CutBoEjk.js.gz +0 -0
- package/dist/web/assets/editor-language-service-CvWIXOhc.js.br +0 -0
- package/dist/web/assets/editor-language-service-CvWIXOhc.js.gz +0 -0
- package/dist/web/assets/explorer-body-CQmBBXfv.js.br +0 -0
- package/dist/web/assets/explorer-body-CQmBBXfv.js.gz +0 -0
- package/dist/web/assets/explorer-window-content-CLjCoNbm.js.br +0 -0
- package/dist/web/assets/explorer-window-content-CLjCoNbm.js.gz +0 -0
- package/dist/web/assets/extension-manager-section-DdYQKLbO.js.br +0 -0
- package/dist/web/assets/extension-manager-section-DdYQKLbO.js.gz +0 -0
- package/dist/web/assets/extension-webview-DK9hh2Y0.js.br +0 -0
- package/dist/web/assets/extension-webview-DK9hh2Y0.js.gz +0 -0
- package/dist/web/assets/files-settings-section-8cUNHAuu.js.br +0 -0
- package/dist/web/assets/files-settings-section-8cUNHAuu.js.gz +0 -0
- package/dist/web/assets/general-settings-section-D7vmzQJb.js.br +0 -0
- package/dist/web/assets/general-settings-section-D7vmzQJb.js.gz +0 -0
- package/dist/web/assets/git-log-panel-BSaunxeG.js.br +0 -0
- package/dist/web/assets/git-log-panel-BSaunxeG.js.gz +0 -0
- package/dist/web/assets/git-review-tab-DIVcQU2d.js.br +0 -0
- package/dist/web/assets/git-review-tab-DIVcQU2d.js.gz +0 -0
- package/dist/web/assets/glide-data-grid-DSFI7lj5.js.br +0 -0
- package/dist/web/assets/glide-data-grid-DSFI7lj5.js.gz +0 -0
- package/dist/web/assets/grid-save-dialog-CZJ8CGwa.js.br +0 -0
- package/dist/web/assets/grid-save-dialog-CZJ8CGwa.js.gz +0 -0
- package/dist/web/assets/group-chat-tab-DFeXDRvD.js.br +0 -0
- package/dist/web/assets/group-chat-tab-DFeXDRvD.js.gz +0 -0
- package/dist/web/assets/impexp-tab-BDexxZ-D.js.br +0 -0
- package/dist/web/assets/impexp-tab-BDexxZ-D.js.gz +0 -0
- package/dist/web/assets/index-hkWEyYns.js.br +0 -0
- package/dist/web/assets/index-hkWEyYns.js.gz +0 -0
- package/dist/web/assets/keyboard-shortcuts-section-Cmj42EhF.js.br +0 -0
- package/dist/web/assets/keyboard-shortcuts-section-Cmj42EhF.js.gz +0 -0
- package/dist/web/assets/language-servers-section-Brh3-9ue.js.br +0 -0
- package/dist/web/assets/language-servers-section-Brh3-9ue.js.gz +0 -0
- package/dist/web/assets/logs-app-C10T12Nn.js.br +0 -0
- package/dist/web/assets/lsp-client-DWUEmZTw.js.br +0 -0
- package/dist/web/assets/lsp-client-DWUEmZTw.js.gz +0 -0
- package/dist/web/assets/markdown-renderer-CJIFwRyF.js.br +0 -0
- package/dist/web/assets/markdown-renderer-CJIFwRyF.js.gz +0 -0
- package/dist/web/assets/markdown-renderer-R5P0d4vU.js.br +0 -0
- package/dist/web/assets/markdown-renderer-R5P0d4vU.js.gz +0 -0
- package/dist/web/assets/mobile-explorer-sheet-IG9QzF6l.js.br +0 -0
- package/dist/web/assets/mobile-explorer-sheet-IG9QzF6l.js.gz +0 -0
- package/dist/web/assets/new-design-dialog-jBSJbk9e.js.br +0 -0
- package/dist/web/assets/new-design-dialog-jBSJbk9e.js.gz +0 -0
- package/dist/web/assets/notification-settings-DPwVHqce.js +0 -1
- package/dist/web/assets/notification-settings-DPwVHqce.js.br +0 -0
- package/dist/web/assets/notification-settings-DPwVHqce.js.gz +0 -0
- package/dist/web/assets/notifications-settings-section-BXuOARiv.js.br +0 -0
- package/dist/web/assets/notifications-settings-section-BXuOARiv.js.gz +0 -0
- package/dist/web/assets/onboarding-entry-BKevZSkh.js.br +0 -0
- package/dist/web/assets/onboarding-entry-BKevZSkh.js.gz +0 -0
- package/dist/web/assets/open-manager-chat-CzGWRVmq.js.br +0 -2
- package/dist/web/assets/open-manager-chat-CzGWRVmq.js.gz +0 -0
- package/dist/web/assets/open-manager-chat-gmviInoL.js.br +0 -0
- package/dist/web/assets/open-manager-chat-gmviInoL.js.gz +0 -0
- package/dist/web/assets/problems-panel-El3QJIV6.js.br +0 -0
- package/dist/web/assets/problems-panel-El3QJIV6.js.gz +0 -0
- package/dist/web/assets/process-table-BqXICQFQ.js.br +0 -0
- package/dist/web/assets/process-table-BqXICQFQ.js.gz +0 -0
- package/dist/web/assets/proxy-settings-section-m-6EeVHv.js.br +0 -0
- package/dist/web/assets/proxy-settings-section-m-6EeVHv.js.gz +0 -0
- package/dist/web/assets/query-tab-GB_U7IeW.js.br +0 -0
- package/dist/web/assets/query-tab-GB_U7IeW.js.gz +0 -0
- package/dist/web/assets/remote-access-settings-section-XCqpwwga.js.br +0 -0
- package/dist/web/assets/remote-access-settings-section-XCqpwwga.js.gz +0 -0
- package/dist/web/assets/remote-desktop-clipboard-notice-Dv9WhBL3.js.br +0 -0
- package/dist/web/assets/remote-desktop-clipboard-notice-Dv9WhBL3.js.gz +0 -0
- package/dist/web/assets/remote-desktop-mobile-sheet-mucuAaLY.js.br +0 -0
- package/dist/web/assets/remote-desktop-mobile-sheet-mucuAaLY.js.gz +0 -0
- package/dist/web/assets/remote-desktop-mobile-view-Cj1MLaFm.js.br +0 -0
- package/dist/web/assets/remote-desktop-mobile-view-Cj1MLaFm.js.gz +0 -0
- package/dist/web/assets/remote-desktop-readiness-gate-NsbB_MYU.js.br +0 -0
- package/dist/web/assets/remote-desktop-readiness-gate-NsbB_MYU.js.gz +0 -0
- package/dist/web/assets/remote-desktop-window-content-BhLPmsZd.js.br +0 -0
- package/dist/web/assets/remote-desktop-window-content-BhLPmsZd.js.gz +0 -0
- package/dist/web/assets/rename-object-dialog-BGHpYZhK.js.br +0 -0
- package/dist/web/assets/rename-object-dialog-BGHpYZhK.js.gz +0 -0
- package/dist/web/assets/review-address-setup-iMXqLLGl.js.br +0 -0
- package/dist/web/assets/review-address-setup-iMXqLLGl.js.gz +0 -0
- package/dist/web/assets/review-code-DHxs5cqr.js.br +0 -0
- package/dist/web/assets/review-code-DHxs5cqr.js.gz +0 -0
- package/dist/web/assets/save-as-dialog-Djahsc1T.js.br +0 -0
- package/dist/web/assets/save-as-dialog-Djahsc1T.js.gz +0 -0
- package/dist/web/assets/schedule-form-BL62-9bF.js.br +0 -0
- package/dist/web/assets/schedule-form-BL62-9bF.js.gz +0 -0
- package/dist/web/assets/schedule-script-editor-CkJnUiR4.js.br +0 -0
- package/dist/web/assets/schedule-script-editor-CkJnUiR4.js.gz +0 -0
- package/dist/web/assets/schedules-app-C9_n1L6K.js.br +0 -0
- package/dist/web/assets/schedules-app-C9_n1L6K.js.gz +0 -0
- package/dist/web/assets/schedules-settings-section-CI_0jYgG.js.br +0 -0
- package/dist/web/assets/schedules-settings-section-CI_0jYgG.js.gz +0 -0
- package/dist/web/assets/schedules-tab-BvYAcvO_.js.br +0 -0
- package/dist/web/assets/schedules-tab-BvYAcvO_.js.gz +0 -0
- package/dist/web/assets/schedules-ui-Bj4uM71z.js.br +0 -0
- package/dist/web/assets/schedules-ui-Bj4uM71z.js.gz +0 -0
- package/dist/web/assets/schedules-window-content-fn4dXnW0.js.br +0 -0
- package/dist/web/assets/schedules-window-content-fn4dXnW0.js.gz +0 -0
- package/dist/web/assets/session-review-tab-DSEjqKaO.js.br +0 -0
- package/dist/web/assets/session-review-tab-DSEjqKaO.js.gz +0 -0
- package/dist/web/assets/settings-body-Bx7lXh_W.js.br +0 -0
- package/dist/web/assets/settings-body-Bx7lXh_W.js.gz +0 -0
- package/dist/web/assets/settings-rows-6kYZSWYo.js.br +0 -0
- package/dist/web/assets/settings-rows-6kYZSWYo.js.gz +0 -0
- package/dist/web/assets/settings-section-content-Ch4UlUlz.js.br +0 -0
- package/dist/web/assets/settings-section-content-Ch4UlUlz.js.gz +0 -0
- package/dist/web/assets/sql-object-tab-DF68oD4Y.js.br +0 -0
- package/dist/web/assets/sql-object-tab-DF68oD4Y.js.gz +0 -0
- package/dist/web/assets/sqlite-viewer-C53FYUW7.js.br +0 -0
- package/dist/web/assets/sqlite-viewer-C53FYUW7.js.gz +0 -0
- package/dist/web/assets/storage-settings-section-DHccXTed.js.br +0 -0
- package/dist/web/assets/storage-settings-section-DHccXTed.js.gz +0 -0
- package/dist/web/assets/structure-save-dialog-ByyfWBQ3.js.br +0 -0
- package/dist/web/assets/structure-save-dialog-ByyfWBQ3.js.gz +0 -0
- package/dist/web/assets/structure-tab-DbFGcN7I.js.br +0 -0
- package/dist/web/assets/structure-tab-DbFGcN7I.js.gz +0 -0
- package/dist/web/assets/system-monitor-body-BxBWIZfo.js.br +0 -0
- package/dist/web/assets/system-monitor-body-BxBWIZfo.js.gz +0 -0
- package/dist/web/assets/tab-host-window-content-xvl32Qm6.js.br +0 -0
- package/dist/web/assets/tab-host-window-content-xvl32Qm6.js.gz +0 -0
- package/dist/web/assets/table-tab-u-7eOEjr.js.br +0 -0
- package/dist/web/assets/table-tab-u-7eOEjr.js.gz +0 -0
- package/dist/web/assets/task-detail-mobile-dMcVIoRs.js.br +0 -0
- package/dist/web/assets/task-detail-mobile-dMcVIoRs.js.gz +0 -0
- package/dist/web/assets/task-sheet-BpL6w5FD.js.br +0 -0
- package/dist/web/assets/task-sheet-BpL6w5FD.js.gz +0 -0
- package/dist/web/assets/task-status-grid-Bt-UFG9Y.js.br +0 -0
- package/dist/web/assets/task-status-grid-Bt-UFG9Y.js.gz +0 -0
- package/dist/web/assets/task-tab-Bx3UftQY.js.br +0 -0
- package/dist/web/assets/task-tab-Bx3UftQY.js.gz +0 -0
- package/dist/web/assets/tasks-sidebar-panel-DopLJjgy.js.br +0 -0
- package/dist/web/assets/tasks-sidebar-panel-DopLJjgy.js.gz +0 -0
- package/dist/web/assets/telegram-bot-token-field-DRkuw4nN.js.br +0 -0
- package/dist/web/assets/telegram-bot-token-field-DRkuw4nN.js.gz +0 -0
- package/dist/web/assets/terminal-tab-CYGksYRc.js.br +0 -0
- package/dist/web/assets/terminal-tab-CYGksYRc.js.gz +0 -0
- package/dist/web/assets/tool-cards-ChRYIgbI.js.br +0 -0
- package/dist/web/assets/tool-cards-ChRYIgbI.js.gz +0 -0
- package/dist/web/assets/tools-settings-section-CgK3FQoK.js.br +0 -0
- package/dist/web/assets/tools-settings-section-CgK3FQoK.js.gz +0 -0
- package/dist/web/assets/use-db-read-DhCLiECm.js.br +0 -0
- package/dist/web/assets/use-db-read-DhCLiECm.js.gz +0 -0
- package/dist/web/assets/use-inline-blame-BM3xEWhp.js.br +0 -0
- package/dist/web/assets/use-inline-blame-BM3xEWhp.js.gz +0 -0
- package/dist/web/assets/use-lsp-DbU39GP7.js.br +0 -0
- package/dist/web/assets/use-lsp-DbU39GP7.js.gz +0 -0
- package/dist/web/assets/use-process-kill-9NhJJrf6.js.br +0 -0
- package/dist/web/assets/use-process-kill-9NhJJrf6.js.gz +0 -0
- package/dist/web/assets/use-sql-schema-info-C11TKahK.js.br +0 -0
- package/dist/web/assets/use-sql-schema-info-C11TKahK.js.gz +0 -0
- package/dist/web/assets/vault-settings-section-CcruoXwN.js.br +0 -0
- package/dist/web/assets/vault-settings-section-CcruoXwN.js.gz +0 -0
- package/dist/web/assets/voice-settings-section-DBQVSx2W.js.br +0 -0
- package/dist/web/assets/voice-settings-section-DBQVSx2W.js.gz +0 -0
- package/dist/web/assets/web-preview-tab-DKosRbHw.js.br +0 -0
- package/dist/web/assets/web-preview-tab-DKosRbHw.js.gz +0 -0
- package/dist/web/assets/xlsx-preview-DCBVVwtB.js.br +0 -0
- package/dist/web/assets/xlsx-preview-DCBVVwtB.js.gz +0 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { appendFileSync, readFileSync, renameSync, statSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { uptime as osUptime } from "node:os";
|
|
3
|
+
import { resolve } from "node:path";
|
|
4
|
+
import { getPpmDir } from "../ppm-dir.ts";
|
|
5
|
+
import { decideEnsure, type EnsureAction, type WatchdogState } from "./ensure-supervisor-decision.ts";
|
|
6
|
+
import { commitExhausted, describeCommit, type SystemCommit } from "../system-commit.ts";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* `ppm __ensure_supervisor__`: one run of PPM's watchdog task (`ensure-supervisor-decision.ts`
|
|
10
|
+
* says what it decides and why). Started hidden by the Windows Task Scheduler at logon and every
|
|
11
|
+
* 2 minutes, so a run that finds PPM up must cost next to nothing: it reads `status.json` and one
|
|
12
|
+
* process list and exits, without opening the database or loading the CLI. Only a run that has
|
|
13
|
+
* to act loads the config, and only a start loads the server's start path.
|
|
14
|
+
*
|
|
15
|
+
* Never kills anything. Starting goes through `startServer`, exactly as `ppm start` does.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
const STATE_FILE = "watchdog-state.json";
|
|
19
|
+
/** Image names a live supervisor runs under: Bun from source, the compiled `ppm` binary. */
|
|
20
|
+
const SUPERVISOR_IMAGES = new Set(["bun", "ppm"]);
|
|
21
|
+
|
|
22
|
+
function readJson<T>(file: string): T | null {
|
|
23
|
+
try { return JSON.parse(readFileSync(file, "utf-8").replace(/^/, "")) as T; } catch { return null; }
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function writeState(dir: string, state: WatchdogState): void {
|
|
27
|
+
try {
|
|
28
|
+
const file = resolve(dir, STATE_FILE);
|
|
29
|
+
const tmp = `${file}.${process.pid}.tmp`;
|
|
30
|
+
writeFileSync(tmp, JSON.stringify(state));
|
|
31
|
+
renameSync(tmp, file);
|
|
32
|
+
} catch { /* the next run starts from what is there */ }
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function logLine(dir: string, level: "INFO" | "WARN" | "ERROR", msg: string): void {
|
|
36
|
+
try { appendFileSync(resolve(dir, "ppm.log"), `[${new Date().toISOString()}] [${level}] [watchdog] ${msg}\n`); } catch { /* no log */ }
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Whether `pid` is alive, runs under a supervisor's image and is the process the status recorded
|
|
41
|
+
* (`recorded-pid.ts`: it started before the file was last written, so a pid reused since does not
|
|
42
|
+
* pass for PPM). False when it is not; true when the process list is unreadable.
|
|
43
|
+
*/
|
|
44
|
+
async function supervisorRuns(pid: unknown, statusWrittenAt: number | null): Promise<boolean> {
|
|
45
|
+
if (typeof pid !== "number" || pid <= 0) return false;
|
|
46
|
+
try { process.kill(pid, 0); } catch { return false; }
|
|
47
|
+
const { readProcessList } = await import("../process-tree-memory.ts");
|
|
48
|
+
const list = await readProcessList(pid);
|
|
49
|
+
// Unreadable list: trust liveness rather than start a second supervisor on top of a live one.
|
|
50
|
+
if (!list) return true;
|
|
51
|
+
const p = list.find((x) => x.pid === pid);
|
|
52
|
+
if (!p || !SUPERVISOR_IMAGES.has(p.name)) return false;
|
|
53
|
+
const { isRecordedProcess } = await import("./recorded-pid.ts");
|
|
54
|
+
return isRecordedProcess(true, process.platform === "win32" ? p.startedAt : undefined, statusWrittenAt);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface EnsureRunOptions {
|
|
58
|
+
/** The PPM folder; the process's own (`getPpmDir`) when omitted. */
|
|
59
|
+
ppmDir?: string;
|
|
60
|
+
/** What starts PPM and what tells the user it gave up. Tests pass ones that refuse. */
|
|
61
|
+
start?: typeof startPpm;
|
|
62
|
+
notifyGaveUp?: typeof notifyGaveUp;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export async function runEnsureSupervisor(opts: EnsureRunOptions = {}): Promise<EnsureAction> {
|
|
66
|
+
const dir = opts.ppmDir ?? getPpmDir();
|
|
67
|
+
const statusFile = resolve(dir, "status.json");
|
|
68
|
+
const status = readJson<Record<string, unknown>>(statusFile);
|
|
69
|
+
let statusAgeMs: number | null = null;
|
|
70
|
+
try { statusAgeMs = Date.now() - statSync(statusFile).mtimeMs; } catch { /* none */ }
|
|
71
|
+
const state = readJson<WatchdogState>(resolve(dir, STATE_FILE)) ?? { starts: [] };
|
|
72
|
+
if (!Array.isArray(state.starts)) state.starts = [];
|
|
73
|
+
const now = Date.now();
|
|
74
|
+
let bootAt: number | null = null;
|
|
75
|
+
try { bootAt = now - osUptime() * 1000; } catch { /* unknown */ }
|
|
76
|
+
const supervisorAlive = await supervisorRuns(status?.supervisorPid, statusAgeMs === null ? null : now - statusAgeMs);
|
|
77
|
+
|
|
78
|
+
// The common run, PPM up: no memory read, no config, no database.
|
|
79
|
+
let commit: SystemCommit | null = null;
|
|
80
|
+
if (!supervisorAlive && status) {
|
|
81
|
+
const { readSystemCommit } = await import("../system-commit.ts");
|
|
82
|
+
commit = await readSystemCommit();
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const { decision, state: next } = decideEnsure({
|
|
86
|
+
now, bootAt, statusState: typeof status?.state === "string" ? status.state : null, statusAgeMs,
|
|
87
|
+
supervisorAlive, state, memoryExhausted: commitExhausted(commit),
|
|
88
|
+
});
|
|
89
|
+
writeState(dir, next);
|
|
90
|
+
|
|
91
|
+
switch (decision.action) {
|
|
92
|
+
case "none":
|
|
93
|
+
return decision;
|
|
94
|
+
case "wait":
|
|
95
|
+
logLine(dir, "WARN", `PPM is not running, but the machine is out of memory (${commit ? describeCommit(commit) : "unreadable"}): waiting ${Math.round(decision.waitedMs / 1000)}s so far before starting it`);
|
|
96
|
+
return decision;
|
|
97
|
+
case "give-up":
|
|
98
|
+
logLine(dir, "ERROR", `PPM was started ${decision.starts} times in 30 minutes and is down again: not starting it again for now`);
|
|
99
|
+
await (opts.notifyGaveUp ?? notifyGaveUp)(decision.starts);
|
|
100
|
+
return decision;
|
|
101
|
+
case "start": {
|
|
102
|
+
const waited = decision.afterWaitMs !== undefined ? ` after waiting ${Math.round(decision.afterWaitMs / 1000)}s for memory` : "";
|
|
103
|
+
logLine(dir, "WARN", `PPM is not running (${decision.why === "boot" ? "first run since the machine started" : "its last run did not stop"}) — starting it${waited}`);
|
|
104
|
+
await (opts.start ?? startPpm)(dir, status, decision);
|
|
105
|
+
return decision;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
async function notifyGaveUp(starts: number): Promise<void> {
|
|
111
|
+
try {
|
|
112
|
+
const { configService } = await import("../config.service.ts");
|
|
113
|
+
configService.load();
|
|
114
|
+
const { notificationService } = await import("../notification.service.ts");
|
|
115
|
+
await notificationService.broadcast("memory", {
|
|
116
|
+
title: "PPM is down",
|
|
117
|
+
body: `PPM went down ${starts} times in 30 minutes; its watchdog stopped restarting it for now. Start it with 'ppm start' once the machine has memory again.`,
|
|
118
|
+
project: "",
|
|
119
|
+
sessionId: "",
|
|
120
|
+
}, { coalesceKey: "watchdog-gave-up" });
|
|
121
|
+
} catch { /* nothing else to tell it with */ }
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
async function startPpm(dir: string, status: Record<string, unknown> | null, decision: Extract<EnsureAction, { action: "start" }>): Promise<void> {
|
|
125
|
+
const { writeRestartRequest } = await import("../restart-news/start-reason.ts");
|
|
126
|
+
// Who asked: the previous run's own death (`previous-run-death.ts`) outranks this as the reason.
|
|
127
|
+
writeRestartRequest(dir, decision.why === "boot"
|
|
128
|
+
? { kind: "boot", requestedBy: "PPM's watchdog task (Task Scheduler), at logon" }
|
|
129
|
+
: { kind: "manual", detail: "PPM's watchdog task found PPM not running", requestedBy: "PPM's watchdog task (Task Scheduler)" });
|
|
130
|
+
const auto = readJson<{ config?: { port?: number; profile?: string; minimal?: boolean } }>(resolve(dir, "autostart.json"))?.config;
|
|
131
|
+
const port = typeof status?.port === "number" ? status.port : auto?.port;
|
|
132
|
+
const profile = typeof status?.profile === "string" ? status.profile : auto?.profile;
|
|
133
|
+
const minimal = status?.minimalMode === true || auto?.minimal === true;
|
|
134
|
+
const { startServer } = await import("../../server/index.ts");
|
|
135
|
+
await startServer({ port: port ? String(port) : undefined, profile: profile || undefined, minimal });
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/** The process entry: one run, then exit (a start leaves PPM running detached, as `ppm start` does). */
|
|
139
|
+
export async function ensureSupervisorMain(): Promise<never> {
|
|
140
|
+
try {
|
|
141
|
+
await runEnsureSupervisor();
|
|
142
|
+
process.exit(0);
|
|
143
|
+
} catch (e) {
|
|
144
|
+
try { logLine(getPpmDir(), "ERROR", `watchdog run failed: ${(e as Error).message}`); } catch { /* none */ }
|
|
145
|
+
process.exit(1);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
if (import.meta.main) await ensureSupervisorMain();
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a start (`ppm start`, `ppm restart`, the watchdog task) does with what a dead supervisor
|
|
3
|
+
* left running. Pure: liveness and the port's listener are passed in.
|
|
4
|
+
*
|
|
5
|
+
* A supervisor that died — out of memory on 20/11/2026 — leaves its server orphaned, and its
|
|
6
|
+
* detached edge (the public port) and tunnel (the public URL) still working. The start used to
|
|
7
|
+
* kill all of them; the new supervisor then had to spawn a fresh tunnel (a quick tunnel's URL
|
|
8
|
+
* changes) and the port check found the edge on the port and either killed it or gave up with
|
|
9
|
+
* "Port 3214 is already in use". Now only the orphaned server goes: the edge and the tunnel are
|
|
10
|
+
* left for the new supervisor to adopt (`adoptEdge`, `adoptTunnel`, which check identity).
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
const LIVE_STATES = new Set(["running", "paused", "upgrading"]);
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The previous run's processes to kill before starting: its supervisor and server, if alive, and
|
|
17
|
+
* its tunnel when no supervisor will adopt it (the run was not live: stopped, or no state). Nothing
|
|
18
|
+
* at all when `status.json` predates this boot — it survives a reboot, and its pids may now name
|
|
19
|
+
* any program. The tunnel is a candidate only: the caller confirms it is PPM's own cloudflared.
|
|
20
|
+
*/
|
|
21
|
+
export function leftoverPidsToKill(
|
|
22
|
+
prev: Record<string, unknown>,
|
|
23
|
+
alive: (pid: number) => boolean,
|
|
24
|
+
boot: { bootAt?: number | null; statusWrittenAt?: number | null } = {},
|
|
25
|
+
): { pids: number[]; tunnel: number | null } {
|
|
26
|
+
if (boot.bootAt != null && boot.statusWrittenAt != null && boot.statusWrittenAt < boot.bootAt) return { pids: [], tunnel: null };
|
|
27
|
+
const pids: number[] = [];
|
|
28
|
+
for (const key of ["supervisorPid", "pid"] as const) {
|
|
29
|
+
const p = prev[key];
|
|
30
|
+
if (typeof p === "number" && p > 0 && !pids.includes(p) && alive(p)) pids.push(p);
|
|
31
|
+
}
|
|
32
|
+
const t = prev.tunnelPid;
|
|
33
|
+
const adoptable = LIVE_STATES.has(String(prev.state));
|
|
34
|
+
const tunnel = !adoptable && typeof t === "number" && t > 0 && !pids.includes(t) && alive(t) ? t : null;
|
|
35
|
+
return { pids, tunnel };
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Whether the port is held by the previous run's own edge, which the new supervisor will adopt —
|
|
40
|
+
* so "in use" is not a reason to stop or to reclaim it. Only when the recorded edge is alive and is
|
|
41
|
+
* the port's listener: an unknown listener (0) is not taken as the edge.
|
|
42
|
+
*/
|
|
43
|
+
export function edgeHoldsPort(prev: Record<string, unknown>, alive: (pid: number) => boolean, listener: number): boolean {
|
|
44
|
+
const edge = prev.edgePid;
|
|
45
|
+
return typeof edge === "number" && edge > 0 && listener === edge && alive(edge);
|
|
46
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { statSync } from "node:fs";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Whether a pid `status.json` recorded still names the process that was recorded, rather than one
|
|
5
|
+
* the OS handed the number to later.
|
|
6
|
+
*
|
|
7
|
+
* `status.json` outlives its run, a reboot included, and on Windows the boot time cannot tell the
|
|
8
|
+
* two apart: with Fast Startup (the default on many Windows 10/11 machines) "Shut down" hibernates
|
|
9
|
+
* the kernel, so `os.uptime()` keeps counting across it. What can: a process that really belonged
|
|
10
|
+
* to the recorded run started before the file was last written (the supervisor rewrites it while it
|
|
11
|
+
* runs), and a process that took a dead run's pid started after. Before PPM's watchdog started PPM
|
|
12
|
+
* at every logon, a reused pid meant `ppm start` could tree-kill a stranger, or refuse to start as
|
|
13
|
+
* "already running".
|
|
14
|
+
*
|
|
15
|
+
* Windows reads the start times over FFI (`readProcessList`); elsewhere liveness is all there is
|
|
16
|
+
* (and Linux's uptime does reset at boot, which `leftoverPidsToKill` checks).
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/** Grace for clock and file-time granularity: a process started this much after the write still counts. */
|
|
20
|
+
const START_GRACE_MS = 2_000;
|
|
21
|
+
|
|
22
|
+
/** Pure: alive, and (when both times are known) started no later than the record was written. Exported for tests. */
|
|
23
|
+
export function isRecordedProcess(alive: boolean, startedAt: number | undefined, recordedAt: number | null): boolean {
|
|
24
|
+
if (!alive) return false;
|
|
25
|
+
if (startedAt === undefined || recordedAt === null) return true;
|
|
26
|
+
return startedAt <= recordedAt + START_GRACE_MS;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** When `file` was last written (ms), or null. */
|
|
30
|
+
export function writtenAt(file: string): number | null {
|
|
31
|
+
try { return statSync(file).mtimeMs; } catch { return null; }
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* The pids among `pids` that are still the recorded processes. One process-list read for all of
|
|
36
|
+
* them; never throws.
|
|
37
|
+
*/
|
|
38
|
+
export async function recordedProcesses(pids: readonly number[], recordedAt: number | null): Promise<Set<number>> {
|
|
39
|
+
const out = new Set<number>();
|
|
40
|
+
const alive = (pid: number) => { try { process.kill(pid, 0); return true; } catch { return false; } };
|
|
41
|
+
let starts: Map<number, number> | null = null;
|
|
42
|
+
if (process.platform === "win32" && recordedAt !== null) {
|
|
43
|
+
try {
|
|
44
|
+
const { readProcessList } = await import("../process-tree-memory.ts");
|
|
45
|
+
const list = await readProcessList(process.pid);
|
|
46
|
+
if (list) starts = new Map(list.map((p) => [p.pid, p.startedAt]));
|
|
47
|
+
} catch { /* liveness only */ }
|
|
48
|
+
}
|
|
49
|
+
for (const pid of pids) {
|
|
50
|
+
if (isRecordedProcess(alive(pid), starts?.get(pid), starts ? recordedAt : null)) out.add(pid);
|
|
51
|
+
}
|
|
52
|
+
return out;
|
|
53
|
+
}
|
|
@@ -18,7 +18,7 @@ import { cleanupStaleBinaryUpgradeArtifacts } from "./binary-upgrade-swap.ts";
|
|
|
18
18
|
import {
|
|
19
19
|
type SupervisorState,
|
|
20
20
|
getState, setState, waitForResume, triggerResume,
|
|
21
|
-
readAndDeleteCmd, readStatus, updateStatus, writeStatus,
|
|
21
|
+
readAndDeleteCmd, readStatus, updateStatus, writeStatus, statusWrittenAt,
|
|
22
22
|
STATUS_FILE, PID_FILE,
|
|
23
23
|
} from "./supervisor-state.ts";
|
|
24
24
|
import { resolveTunnelConfig, type ResolvedTunnelConfig, type TunnelMode } from "./named-tunnel/named-tunnel-config.ts";
|
|
@@ -54,6 +54,12 @@ import { waitForReplacement } from "./supervisor-self-replace-wait.ts";
|
|
|
54
54
|
import { readThreadSnapshot, describeThreadSnapshot, type ThreadSnapshot } from "./process-thread-snapshot.ts";
|
|
55
55
|
import { readMachineCpuTimes, machineBusyFraction, type MachineCpuTimes } from "./machine-cpu.ts";
|
|
56
56
|
import { uptime as osUptime } from "node:os";
|
|
57
|
+
import { previousSupervisorDied, readPreviousRunDeath } from "./restart-news/previous-run-death.ts";
|
|
58
|
+
import { describeCommit, readSystemCommit } from "./system-commit.ts";
|
|
59
|
+
import { readPulse } from "./memory-pulse.ts";
|
|
60
|
+
import {
|
|
61
|
+
healthMissCounts, MAX_MEMORY_WAIT_MS, MEMORY_POLL_MS, memoryExhausted, oomBackoffMs, oomExitReason,
|
|
62
|
+
} from "./supervisor-memory-guard.ts";
|
|
57
63
|
import { dropStaleRestartRequest, peekRestartRequester, requesterNote, startReasonEnv, takeRestartRequest, type StartReason } from "./restart-news/start-reason.ts";
|
|
58
64
|
import { dropOrderedStop, writeOrderedStop } from "./restart-news/ordered-stop-note.ts";
|
|
59
65
|
import {
|
|
@@ -178,6 +184,11 @@ let _opts: { port: number; host: string; share: boolean } = { port: 8080, host:
|
|
|
178
184
|
|
|
179
185
|
let serverRestarts = 0;
|
|
180
186
|
let lastServerCrash = 0;
|
|
187
|
+
/** Restarts after an out-of-memory exit, counted apart from crashes (`supervisor-memory-guard.ts`). */
|
|
188
|
+
let oomRestarts = 0;
|
|
189
|
+
let lastOomRestart = 0;
|
|
190
|
+
/** Since when health probes have been failing with memory exhausted; null when memory is fine. */
|
|
191
|
+
let healthLowMemorySince: number | null = null;
|
|
181
192
|
let tunnelRestarts = 0;
|
|
182
193
|
let lastTunnelCrash = 0;
|
|
183
194
|
|
|
@@ -925,6 +936,28 @@ export async function spawnServer(
|
|
|
925
936
|
return spawnServer(serverArgs, logFd, decision.reason);
|
|
926
937
|
}
|
|
927
938
|
|
|
939
|
+
// Out of memory: the machine, not the server, is what failed. Wait for commit to come back and
|
|
940
|
+
// restart on a backoff of its own, outside the crash budget that pauses PPM for good.
|
|
941
|
+
const upForS = Math.round((Date.now() - startedAt) / 1000);
|
|
942
|
+
const exitCommit = await readSystemCommit();
|
|
943
|
+
if (exitCommit && memoryExhausted(exitCommit)) {
|
|
944
|
+
const reason = oomExitReason({ exitCode, signal: exitSignal, upForS }, exitCommit, readPulse(getPpmDir(), childPid));
|
|
945
|
+
if (Date.now() - lastOomRestart > STABLE_WINDOW_MS) oomRestarts = 0;
|
|
946
|
+
oomRestarts++;
|
|
947
|
+
const delay = oomBackoffMs(oomRestarts);
|
|
948
|
+
log("ERROR", `Server went down with the machine out of memory (${describeCommit(exitCommit)}) — ${reason.detail}. Waiting ${Math.round(delay / 1000)}s, then until memory is no longer exhausted (at most ${MAX_MEMORY_WAIT_MS / 60_000} min), before restarting it`);
|
|
949
|
+
serverBackoffPending = true;
|
|
950
|
+
memoryWaitSkipped = false;
|
|
951
|
+
try {
|
|
952
|
+
await sleepUnlessSkipped(delay);
|
|
953
|
+
const waited = await waitForFreeMemory();
|
|
954
|
+
if (waited > 0) log("INFO", `Free memory ${waited >= MAX_MEMORY_WAIT_MS ? "did not come back" : "came back"} after ${Math.round(waited / 1000)}s — restarting the server`);
|
|
955
|
+
} finally { serverBackoffPending = false; }
|
|
956
|
+
lastOomRestart = Date.now();
|
|
957
|
+
if (!shuttingDown) return spawnServer(serverArgs, logFd, reason);
|
|
958
|
+
return;
|
|
959
|
+
}
|
|
960
|
+
|
|
928
961
|
// Crash — apply backoff. A server the health check killed is the watchdog's restart.
|
|
929
962
|
const crashReason = decision.reason;
|
|
930
963
|
const now = Date.now();
|
|
@@ -958,7 +991,8 @@ export async function spawnServer(
|
|
|
958
991
|
const delay = backoffDelay(serverRestarts);
|
|
959
992
|
log("ERROR", `Server crashed (exit ${exitCode}, signal ${exitSignal}, up ${Math.round((Date.now() - startedAt) / 1000)}s) — restart #${serverRestarts}/${MAX_RESTARTS}, restarting in ${delay}ms`);
|
|
960
993
|
serverBackoffPending = true;
|
|
961
|
-
|
|
994
|
+
memoryWaitSkipped = false;
|
|
995
|
+
try { await sleepUnlessSkipped(delay); } finally { serverBackoffPending = false; }
|
|
962
996
|
|
|
963
997
|
if (!shuttingDown) return spawnServer(serverArgs, logFd, crashReason);
|
|
964
998
|
}
|
|
@@ -969,6 +1003,40 @@ export async function spawnServer(
|
|
|
969
1003
|
*/
|
|
970
1004
|
const takeRequest = (): StartReason | null => takeRestartRequest(getPpmDir());
|
|
971
1005
|
|
|
1006
|
+
/**
|
|
1007
|
+
* Set by a restart someone asks for (`ppm restart`, PPM Cloud) while the supervisor waits out an
|
|
1008
|
+
* out-of-memory exit: the wait ends and the server starts now. Without it the restart found no
|
|
1009
|
+
* server to bounce and did nothing for up to twelve minutes.
|
|
1010
|
+
*/
|
|
1011
|
+
let memoryWaitSkipped = false;
|
|
1012
|
+
|
|
1013
|
+
/** Sleep `ms`, cut short by {@link memoryWaitSkipped} or a shutdown. */
|
|
1014
|
+
async function sleepUnlessSkipped(ms: number): Promise<void> {
|
|
1015
|
+
const until = Date.now() + ms;
|
|
1016
|
+
while (!memoryWaitSkipped && !shuttingDown && Date.now() < until) await Bun.sleep(Math.min(1000, until - Date.now()));
|
|
1017
|
+
}
|
|
1018
|
+
|
|
1019
|
+
/** Wait until free commit is no longer exhausted (or unreadable), for at most {@link MAX_MEMORY_WAIT_MS}. Returns the ms waited. */
|
|
1020
|
+
async function waitForFreeMemory(): Promise<number> {
|
|
1021
|
+
const start = Date.now();
|
|
1022
|
+
while (!shuttingDown && !memoryWaitSkipped && Date.now() - start < MAX_MEMORY_WAIT_MS) {
|
|
1023
|
+
if (!memoryExhausted(await readSystemCommit())) break;
|
|
1024
|
+
await sleepUnlessSkipped(MEMORY_POLL_MS);
|
|
1025
|
+
}
|
|
1026
|
+
return Date.now() - start;
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
/**
|
|
1030
|
+
* A restart asked for while no server runs: during an out-of-memory wait, end the wait (the pending
|
|
1031
|
+
* spawn then starts the server) instead of starting a second one. True when it did.
|
|
1032
|
+
*/
|
|
1033
|
+
function skipMemoryWaitForRestart(): boolean {
|
|
1034
|
+
if (!serverBackoffPending || serverChild) return false;
|
|
1035
|
+
memoryWaitSkipped = true;
|
|
1036
|
+
log("INFO", "Restart asked for while the server waits to be restarted — starting it now");
|
|
1037
|
+
return true;
|
|
1038
|
+
}
|
|
1039
|
+
|
|
972
1040
|
/** Seconds since the machine started; null when the OS will not say (then it is not a boot). */
|
|
973
1041
|
function machineUptimeS(): number | null {
|
|
974
1042
|
try { return osUptime(); } catch { return null; }
|
|
@@ -1503,6 +1571,15 @@ function startServerHealthCheck() {
|
|
|
1503
1571
|
const err = e as { name?: string; code?: string; message?: string } | null;
|
|
1504
1572
|
lastProbe = err?.name === "TimeoutError" ? "timeout after 5s" : err?.code ?? err?.message ?? String(e);
|
|
1505
1573
|
}
|
|
1574
|
+
// A server not answering while the machine is out of memory is paging, not hung, and
|
|
1575
|
+
// killing it frees nothing the culprit holds: those misses do not count, for a while.
|
|
1576
|
+
const probeCommit = await readSystemCommit();
|
|
1577
|
+
const grace = healthMissCounts(memoryExhausted(probeCommit), healthLowMemorySince, Date.now());
|
|
1578
|
+
healthLowMemorySince = grace.lowSince;
|
|
1579
|
+
if (!grace.counts && probeCommit) {
|
|
1580
|
+
log("WARN", `Server health probe on port ${checkPort} failed (${lastProbe}) with the machine out of memory (${describeCommit(probeCommit)}) — not counted; the server is left running`);
|
|
1581
|
+
return;
|
|
1582
|
+
}
|
|
1506
1583
|
healthFailCount++;
|
|
1507
1584
|
// Read while the server is still not answering: the main thread's wait is the cause.
|
|
1508
1585
|
const waitingOn = await describeUnresponsiveServer(serverChild?.pid);
|
|
@@ -1731,13 +1808,20 @@ async function adoptTunnel(): Promise<boolean> {
|
|
|
1731
1808
|
}
|
|
1732
1809
|
|
|
1733
1810
|
/** Kill stale tunnel PID from status.json (cleanup after failed adoption) */
|
|
1734
|
-
function killStaleTunnel() {
|
|
1811
|
+
async function killStaleTunnel(): Promise<void> {
|
|
1735
1812
|
try {
|
|
1736
1813
|
const status = readStatus();
|
|
1737
1814
|
const pid = status.tunnelPid as number;
|
|
1738
|
-
if (
|
|
1739
|
-
|
|
1740
|
-
|
|
1815
|
+
if (pid) {
|
|
1816
|
+
// Only a cloudflared: the record can be from a run whose pid now names another program
|
|
1817
|
+
// (a dead supervisor's, kept for adoption, when adoption refused it for exactly that).
|
|
1818
|
+
if (await isCloudflaredPid(pid)) {
|
|
1819
|
+
try { process.kill(pid, "SIGTERM"); } catch {}
|
|
1820
|
+
log("INFO", `Killed stale tunnel (PID: ${pid})`);
|
|
1821
|
+
} else {
|
|
1822
|
+
log("INFO", `Stale tunnel record PID ${pid} is not a cloudflared — leaving it alone`);
|
|
1823
|
+
}
|
|
1824
|
+
}
|
|
1741
1825
|
} catch {}
|
|
1742
1826
|
updateStatus({ tunnelPid: null, shareUrl: null });
|
|
1743
1827
|
}
|
|
@@ -2090,6 +2174,8 @@ async function connectCloud(opts: { port: number }, serverArgs: string[], logFd:
|
|
|
2090
2174
|
} else if (getState() === "paused" || getState() === "stopped") {
|
|
2091
2175
|
triggerResume();
|
|
2092
2176
|
sendResult(true);
|
|
2177
|
+
} else if (skipMemoryWaitForRestart()) {
|
|
2178
|
+
sendResult(true);
|
|
2093
2179
|
} else {
|
|
2094
2180
|
sendResult(false, "No server child to restart");
|
|
2095
2181
|
}
|
|
@@ -2344,6 +2430,23 @@ export async function runSupervisor(opts: {
|
|
|
2344
2430
|
}
|
|
2345
2431
|
}
|
|
2346
2432
|
|
|
2433
|
+
// ── Windows: a task registered by an older PPM starts PPM at logon only. Re-register it so
|
|
2434
|
+
// its watchdog trigger (`__ensure_supervisor__` every 2 minutes) brings PPM back after the
|
|
2435
|
+
// supervisor itself dies, which nothing inside PPM can do. No admin needed; an isolated
|
|
2436
|
+
// PPM_HOME never touches the real task (`enableAutoStart` refuses).
|
|
2437
|
+
if (process.platform === "win32") {
|
|
2438
|
+
try {
|
|
2439
|
+
const { staleWindowsTaskConfig, enableAutoStart } = await import("./autostart-register.ts");
|
|
2440
|
+
const stale = staleWindowsTaskConfig();
|
|
2441
|
+
if (stale) {
|
|
2442
|
+
await enableAutoStart(stale, { skipStart: true });
|
|
2443
|
+
log("INFO", "Autostart task re-registered with the watchdog trigger (PPM is started again within 2 minutes if it goes down)");
|
|
2444
|
+
}
|
|
2445
|
+
} catch (e) {
|
|
2446
|
+
log("WARN", `Autostart task re-registration failed (non-fatal): ${e}`);
|
|
2447
|
+
}
|
|
2448
|
+
}
|
|
2449
|
+
|
|
2347
2450
|
// Global exception handlers — supervisor must never crash
|
|
2348
2451
|
process.on("uncaughtException", (err) => {
|
|
2349
2452
|
log("ERROR", `Uncaught exception: ${err.stack || err.message}`);
|
|
@@ -2357,6 +2460,24 @@ export async function runSupervisor(opts: {
|
|
|
2357
2460
|
writeFileSync(PID_FILE(), String(process.pid));
|
|
2358
2461
|
const prevStatus = readStatus();
|
|
2359
2462
|
const isUpgrade = prevStatus.state === "upgrading";
|
|
2463
|
+
// Read before the rewrite below erases what the previous run left: whether it died, and of what.
|
|
2464
|
+
const bootInfo = {
|
|
2465
|
+
bootAt: ((up) => (up === null ? null : Date.now() - up * 1000))(machineUptimeS()),
|
|
2466
|
+
statusWrittenAt: statusWrittenAt(),
|
|
2467
|
+
};
|
|
2468
|
+
// Not awaited here: asking the OS for its low-memory reports takes seconds on a struggling
|
|
2469
|
+
// machine, and `ppm start` gives a new supervisor ten seconds to publish its server. Only the
|
|
2470
|
+
// first server's start reason needs it, and the edge and the tunnel come up meanwhile.
|
|
2471
|
+
const previousDeathP = isUpgrade
|
|
2472
|
+
? Promise.resolve(null)
|
|
2473
|
+
: readPreviousRunDeath(prevStatus, getPpmDir(), bootInfo).then((death) => {
|
|
2474
|
+
if (death) log("WARN", `Previous run did not stop — ${death.kind}: ${death.detail ?? "no detail"}`);
|
|
2475
|
+
return death;
|
|
2476
|
+
});
|
|
2477
|
+
// A supervisor that died (out of memory, killed) leaves its detached edge and tunnel running,
|
|
2478
|
+
// still serving the public port and URL: keep their records, as an upgrade does, so they are
|
|
2479
|
+
// adopted rather than replaced. Adoption checks each one's identity and liveness itself.
|
|
2480
|
+
const keepDetached = isUpgrade || previousSupervisorDied(prevStatus, bootInfo);
|
|
2360
2481
|
writeStatus({
|
|
2361
2482
|
supervisorPid: process.pid, port: opts.port, host: opts.host, availableVersion: null,
|
|
2362
2483
|
// Which database this supervisor's server runs on: the CLI's process commands and its
|
|
@@ -2365,18 +2486,18 @@ export async function runSupervisor(opts: {
|
|
|
2365
2486
|
minimalMode: !!opts.minimal,
|
|
2366
2487
|
state: "running", pausedAt: null, pauseReason: null, lastCrashError: null,
|
|
2367
2488
|
pid: null,
|
|
2368
|
-
tunnelPid:
|
|
2369
|
-
shareUrl:
|
|
2370
|
-
tunnelPort:
|
|
2489
|
+
tunnelPid: keepDetached ? (prevStatus.tunnelPid ?? null) : null,
|
|
2490
|
+
shareUrl: keepDetached ? (prevStatus.shareUrl ?? null) : null,
|
|
2491
|
+
tunnelPort: keepDetached ? (prevStatus.tunnelPort ?? null) : null,
|
|
2371
2492
|
// The edge is detached and survives self-replace exactly like the tunnel,
|
|
2372
2493
|
// so its PID must survive this wholesale rewrite or the new supervisor
|
|
2373
2494
|
// would spawn a second edge and collide on the public port.
|
|
2374
|
-
edgePid:
|
|
2495
|
+
edgePid: keepDetached ? (prevStatus.edgePid ?? null) : null,
|
|
2375
2496
|
// tunnelMode/tunnelWarning survive an upgrade the same way tunnelPid/shareUrl
|
|
2376
2497
|
// do above — otherwise a live named tunnel would report as unset mode with
|
|
2377
2498
|
// no warning history the instant the new supervisor takes over.
|
|
2378
|
-
tunnelMode:
|
|
2379
|
-
tunnelWarning:
|
|
2499
|
+
tunnelMode: keepDetached ? (prevStatus.tunnelMode ?? null) : null,
|
|
2500
|
+
tunnelWarning: keepDetached ? (prevStatus.tunnelWarning ?? null) : null,
|
|
2380
2501
|
// Unconditional (not upgrade-gated): every boot of this code understands
|
|
2381
2502
|
// "retunnel" — its ABSENCE is how phase 3's UI detects a pre-upgrade
|
|
2382
2503
|
// supervisor that predates the retunnel command entirely.
|
|
@@ -2386,7 +2507,7 @@ export async function runSupervisor(opts: {
|
|
|
2386
2507
|
// Diagnostic: a cold start (isUpgrade=false) always nulls the tunnel and forces
|
|
2387
2508
|
// a fresh URL. A genuine upgrade must arrive here with state "upgrading" AND a
|
|
2388
2509
|
// live tunnelPid for the public URL to survive — log both to catch which path ran.
|
|
2389
|
-
log("INFO", `Startup: isUpgrade=${isUpgrade} prevState=${prevStatus.state} prevTunnelPid=${prevStatus.tunnelPid ?? null} prevShareUrl=${prevStatus.shareUrl ?? null}`);
|
|
2510
|
+
log("INFO", `Startup: isUpgrade=${isUpgrade} keepDetached=${keepDetached} prevState=${prevStatus.state} prevTunnelPid=${prevStatus.tunnelPid ?? null} prevShareUrl=${prevStatus.shareUrl ?? null}`);
|
|
2390
2511
|
|
|
2391
2512
|
// Build __serve__ args. Port 0 = OS-assigned, bound to loopback only: the
|
|
2392
2513
|
// edge is the sole public listener, and the server publishes whatever port it
|
|
@@ -2489,6 +2610,8 @@ export async function runSupervisor(opts: {
|
|
|
2489
2610
|
if (serverChild) {
|
|
2490
2611
|
serverRestartRequested = true; // flag so spawnServer skips backoff
|
|
2491
2612
|
requestServerShutdown(serverChild, "ppm restart").catch(() => {});
|
|
2613
|
+
} else if (skipMemoryWaitForRestart()) {
|
|
2614
|
+
// A spawn is already pending behind the wait for memory; it starts now.
|
|
2492
2615
|
} else {
|
|
2493
2616
|
// Nothing to bounce — the spawn loop is gone. Without this `ppm restart`
|
|
2494
2617
|
// silently no-ops and only `stop --kill` + `start` recovers.
|
|
@@ -2597,6 +2720,8 @@ export async function runSupervisor(opts: {
|
|
|
2597
2720
|
log("INFO", `Windows command: restart server only${requesterNote(cmd.requestedBy ?? peekRestartRequester(getPpmDir()))}`);
|
|
2598
2721
|
if (getState() === "paused" || getState() === "stopped") {
|
|
2599
2722
|
triggerResume();
|
|
2723
|
+
} else if (skipMemoryWaitForRestart()) {
|
|
2724
|
+
// A spawn is already pending behind the wait for memory; it starts now.
|
|
2600
2725
|
} else if (serverChild) {
|
|
2601
2726
|
serverRestartRequested = true;
|
|
2602
2727
|
// Tree-kill + reap — single-PID kill orphans SDK grandchildren that
|
|
@@ -2704,7 +2829,7 @@ export async function runSupervisor(opts: {
|
|
|
2704
2829
|
log("INFO", "Tunnel adopted from previous instance — public URL preserved");
|
|
2705
2830
|
} else {
|
|
2706
2831
|
log("WARN", "Tunnel adoption failed/skipped — spawning FRESH tunnel (public URL will change)");
|
|
2707
|
-
killStaleTunnel(); // kill orphaned tunnel before spawning new one
|
|
2832
|
+
await killStaleTunnel(); // kill orphaned tunnel before spawning new one
|
|
2708
2833
|
}
|
|
2709
2834
|
// Sweep leftover cloudflared orphans (crashed supervisors / pre-fix stale
|
|
2710
2835
|
// loops) so they don't saturate the network and false-trigger regeneration.
|
|
@@ -2713,7 +2838,7 @@ export async function runSupervisor(opts: {
|
|
|
2713
2838
|
// Switched off while a tunnel from an earlier boot is still alive: nothing
|
|
2714
2839
|
// adopts or probes it now, so it would go on serving a stale origin with no
|
|
2715
2840
|
// supervisor watching it.
|
|
2716
|
-
killStaleTunnel();
|
|
2841
|
+
await killStaleTunnel();
|
|
2717
2842
|
await reapOrphanedTunnels(null);
|
|
2718
2843
|
}
|
|
2719
2844
|
|
|
@@ -2774,7 +2899,7 @@ export async function runSupervisor(opts: {
|
|
|
2774
2899
|
}, prevStatus.shareHostPid, { ppmRestarting: true });
|
|
2775
2900
|
|
|
2776
2901
|
// Spawn server + (fresh) tunnel in parallel
|
|
2777
|
-
const promises: Promise<void>[] = [spawnServer(serverArgs, logFd, initialStartReason({ isUpgrade, uptimeS: machineUptimeS(), takeRequest }))];
|
|
2902
|
+
const promises: Promise<void>[] = [spawnServer(serverArgs, logFd, initialStartReason({ isUpgrade, uptimeS: machineUptimeS(), takeRequest, previousDeath: await previousDeathP }))];
|
|
2778
2903
|
const tunnelLoopStarted = tunnelSharingEnabled && !tunnelAdopted;
|
|
2779
2904
|
if (tunnelLoopStarted) promises.push(spawnTunnel(_opts.port));
|
|
2780
2905
|
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* How much memory the machine can still hand out, as one pair of numbers every memory guard reads.
|
|
5
|
+
*
|
|
6
|
+
* Windows: the commit charge — what `VirtualAlloc` is refused against. When it runs out every
|
|
7
|
+
* process that asks for memory fails at once (on 20/11/2026 a chat's jest took the machine there
|
|
8
|
+
* and the PPM server, its supervisor, codex and the WireGuard service all died in the same second),
|
|
9
|
+
* so free *commit*, not free RAM, is the number that predicts it. Read with `K32GetPerformanceInfo`
|
|
10
|
+
* over FFI (`readWindowsCommit`), no child process.
|
|
11
|
+
*
|
|
12
|
+
* Linux: overcommit makes `Committed_AS` a poor predictor (it routinely exceeds `CommitLimit`
|
|
13
|
+
* harmlessly), so "free" is what the kernel says it can still give without the OOM killer:
|
|
14
|
+
* `MemAvailable` plus free swap, out of RAM plus swap.
|
|
15
|
+
*
|
|
16
|
+
* Elsewhere: null. Every caller treats null as "cannot tell" and does nothing.
|
|
17
|
+
*/
|
|
18
|
+
export interface SystemCommit {
|
|
19
|
+
freeMB: number;
|
|
20
|
+
limitMB: number;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** The figures in `/proc/meminfo`, or null when the ones needed are missing. Exported for tests. */
|
|
24
|
+
export function parseLinuxMeminfo(text: string): SystemCommit | null {
|
|
25
|
+
const kb = (key: string): number | undefined => {
|
|
26
|
+
const m = new RegExp(`^${key}:\\s+(\\d+)\\s*kB`, "m").exec(text);
|
|
27
|
+
return m ? Number(m[1]) : undefined;
|
|
28
|
+
};
|
|
29
|
+
const total = kb("MemTotal");
|
|
30
|
+
const available = kb("MemAvailable");
|
|
31
|
+
if (total === undefined || available === undefined) return null;
|
|
32
|
+
const swapTotal = kb("SwapTotal") ?? 0;
|
|
33
|
+
const swapFree = kb("SwapFree") ?? 0;
|
|
34
|
+
return { freeMB: Math.round((available + swapFree) / 1024), limitMB: Math.round((total + swapTotal) / 1024) };
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** Free commit right now; null when this platform cannot be read. Never throws. */
|
|
38
|
+
export async function readSystemCommit(platform: NodeJS.Platform = process.platform): Promise<SystemCommit | null> {
|
|
39
|
+
try {
|
|
40
|
+
if (platform === "win32") {
|
|
41
|
+
const { readWindowsCommit } = await import("./assistant-mcp/assistant-system-windows-memory.ts");
|
|
42
|
+
const c = await readWindowsCommit(platform);
|
|
43
|
+
if (!c || c.commitLimitMB <= 0) return null;
|
|
44
|
+
return { freeMB: Math.max(0, c.commitLimitMB - c.commitUsedMB), limitMB: c.commitLimitMB };
|
|
45
|
+
}
|
|
46
|
+
if (platform === "linux") return parseLinuxMeminfo(readFileSync("/proc/meminfo", "utf-8"));
|
|
47
|
+
} catch { /* unreadable */ }
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** Free commit at or under this share of the limit is exhausted, whatever the thresholds say. */
|
|
52
|
+
export const EXHAUSTED_SHARE = 0.05;
|
|
53
|
+
/** …as is free commit at or under this many MB, whatever the limit. */
|
|
54
|
+
export const EXHAUSTED_MB = 2048;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Whether the machine is out of memory now, not merely low on it. The restart paths (the
|
|
58
|
+
* supervisor's wait, the watchdog task, a death diagnosis) go by this rather than by the user's
|
|
59
|
+
* block threshold: a machine that normally runs with less free commit than the threshold would
|
|
60
|
+
* otherwise have every crash read as out of memory and every restart held for minutes.
|
|
61
|
+
*/
|
|
62
|
+
export const commitExhausted = (c: SystemCommit | null): boolean =>
|
|
63
|
+
!!c && (c.freeMB <= EXHAUSTED_MB || c.freeMB <= c.limitMB * EXHAUSTED_SHARE);
|
|
64
|
+
|
|
65
|
+
/** "4.4 of 51.9 GB free", for a log line or a notification. */
|
|
66
|
+
export function describeCommit(c: SystemCommit): string {
|
|
67
|
+
const gb = (mb: number) => (mb / 1024).toFixed(1);
|
|
68
|
+
return `${gb(c.freeMB)} of ${gb(c.limitMB)} GB free`;
|
|
69
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PPM's memory guard: the thresholds every part of it reads, in one place.
|
|
3
|
+
*
|
|
4
|
+
* Free commit below `warnFreeGB` → a notification naming the chat that is growing fastest.
|
|
5
|
+
* Below `blockFreeGB` → new heavy commands (test runners, type checks, builds, e2e) are refused,
|
|
6
|
+
* idle chat subprocesses are released, and a supervisor waiting to restart a server that died
|
|
7
|
+
* of it keeps waiting. Thresholds are absolute GB, not a share of the limit: the limit moves when
|
|
8
|
+
* Windows grows or shrinks its page file, and what a test run takes does not.
|
|
9
|
+
*
|
|
10
|
+
* `idleCliReleaseMinutes`: a chat's subprocess (and the MCP servers under it) is released once
|
|
11
|
+
* the chat has been idle that long even with a tab open on it; 0 keeps it for as long as a tab is.
|
|
12
|
+
*
|
|
13
|
+
* Stored as `ai.memory_warn_free_gb`, `ai.memory_block_free_gb`, `ai.idle_cli_release_minutes`.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
export const DEFAULT_MEMORY_WARN_FREE_GB = 15;
|
|
17
|
+
export const DEFAULT_MEMORY_BLOCK_FREE_GB = 10;
|
|
18
|
+
export const DEFAULT_IDLE_CLI_RELEASE_MINUTES = 60;
|
|
19
|
+
export const MAX_MEMORY_FREE_GB = 512;
|
|
20
|
+
export const MAX_IDLE_CLI_RELEASE_MINUTES = 7 * 24 * 60;
|
|
21
|
+
|
|
22
|
+
export interface MemoryGuardSettings {
|
|
23
|
+
warnFreeGB: number;
|
|
24
|
+
blockFreeGB: number;
|
|
25
|
+
idleCliReleaseMinutes: number;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface MemoryGuardConfig {
|
|
29
|
+
memory_warn_free_gb?: number;
|
|
30
|
+
memory_block_free_gb?: number;
|
|
31
|
+
idle_cli_release_minutes?: number;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** A free-commit threshold: a number of GB from 0 (off) to {@link MAX_MEMORY_FREE_GB}, halves allowed. */
|
|
35
|
+
export const isValidFreeGB = (v: unknown): v is number =>
|
|
36
|
+
typeof v === "number" && Number.isFinite(v) && v >= 0 && v <= MAX_MEMORY_FREE_GB && Math.round(v * 2) === v * 2;
|
|
37
|
+
|
|
38
|
+
export const isValidIdleCliReleaseMinutes = (v: unknown): v is number =>
|
|
39
|
+
typeof v === "number" && Number.isInteger(v) && v >= 0 && v <= MAX_IDLE_CLI_RELEASE_MINUTES;
|
|
40
|
+
|
|
41
|
+
/** The settings in force: anything missing or invalid falls back to its default. */
|
|
42
|
+
export function memoryGuardSettings(ai: MemoryGuardConfig | undefined): MemoryGuardSettings {
|
|
43
|
+
const warn = isValidFreeGB(ai?.memory_warn_free_gb) ? ai!.memory_warn_free_gb! : DEFAULT_MEMORY_WARN_FREE_GB;
|
|
44
|
+
const block = isValidFreeGB(ai?.memory_block_free_gb) ? ai!.memory_block_free_gb! : DEFAULT_MEMORY_BLOCK_FREE_GB;
|
|
45
|
+
const idle = isValidIdleCliReleaseMinutes(ai?.idle_cli_release_minutes)
|
|
46
|
+
? ai!.idle_cli_release_minutes!
|
|
47
|
+
: DEFAULT_IDLE_CLI_RELEASE_MINUTES;
|
|
48
|
+
return { warnFreeGB: warn, blockFreeGB: block, idleCliReleaseMinutes: idle };
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** True when `freeMB` is under `thresholdGB`; a threshold of 0 is off. */
|
|
52
|
+
export const belowFreeGB = (freeMB: number, thresholdGB: number): boolean =>
|
|
53
|
+
thresholdGB > 0 && freeMB < thresholdGB * 1024;
|