@hienlh/ppm 0.26.26 → 0.26.27
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 +8 -0
- package/CLAUDE.md +2 -2
- package/assets/skills/ppm/SKILL.md +1 -1
- package/assets/skills/ppm/references/http-api.md +1 -1
- package/dist/web/assets/{accounts-settings-section-CHq3WVao.js → accounts-settings-section-D3_w2ePm.js} +1 -1
- package/dist/web/assets/accounts-settings-section-D3_w2ePm.js.br +0 -0
- package/dist/web/assets/accounts-settings-section-D3_w2ePm.js.gz +0 -0
- package/dist/web/assets/{agent-session-sheet-C0sgsTt9.js → agent-session-sheet-DYwZjQP7.js} +2 -2
- package/dist/web/assets/agent-session-sheet-DYwZjQP7.js.br +0 -0
- package/dist/web/assets/agent-session-sheet-DYwZjQP7.js.gz +0 -0
- package/dist/web/assets/{agent-session-window-content-CbrD8f8E.js → agent-session-window-content-D07cutjV.js} +1 -1
- package/dist/web/assets/agent-session-window-content-D07cutjV.js.br +0 -0
- package/dist/web/assets/agent-session-window-content-D07cutjV.js.gz +0 -0
- package/dist/web/assets/{ai-resource-editor-CjellqxA.js → ai-resource-editor--cO_JuHk.js} +1 -1
- package/dist/web/assets/ai-resource-editor--cO_JuHk.js.br +0 -0
- package/dist/web/assets/ai-resource-editor--cO_JuHk.js.gz +0 -0
- package/dist/web/assets/{ai-settings-section-CSRMdQ2S.js → ai-settings-section-Brn-aWB3.js} +1 -1
- package/dist/web/assets/ai-settings-section-Brn-aWB3.js.br +0 -0
- package/dist/web/assets/ai-settings-section-Brn-aWB3.js.gz +0 -0
- package/dist/web/assets/{ai-settings-section-Db9X6wec.js → ai-settings-section-CnyTPE3r.js} +1 -1
- package/dist/web/assets/ai-settings-section-CnyTPE3r.js.br +0 -0
- package/dist/web/assets/ai-settings-section-CnyTPE3r.js.gz +0 -0
- package/dist/web/assets/{android-tab-DG1-4oee.js → android-tab-Dh586Izw.js} +1 -1
- package/dist/web/assets/android-tab-Dh586Izw.js.br +0 -0
- package/dist/web/assets/android-tab-Dh586Izw.js.gz +0 -0
- package/dist/web/assets/{antigravity-usage-view-C9gPFRb5.js → antigravity-usage-view-B3nS0dXF.js} +1 -1
- package/dist/web/assets/antigravity-usage-view-B3nS0dXF.js.br +0 -0
- package/dist/web/assets/antigravity-usage-view-B3nS0dXF.js.gz +0 -0
- package/dist/web/assets/{appearance-settings-section-By5gIwBb.js → appearance-settings-section-DTLHddyX.js} +1 -1
- package/dist/web/assets/appearance-settings-section-DTLHddyX.js.br +0 -0
- package/dist/web/assets/appearance-settings-section-DTLHddyX.js.gz +0 -0
- package/dist/web/assets/{apps-panel-D7fUCDns.js → apps-panel-CkgEPDcf.js} +1 -1
- package/dist/web/assets/apps-panel-CkgEPDcf.js.br +0 -0
- package/dist/web/assets/apps-panel-CkgEPDcf.js.gz +0 -0
- package/dist/web/assets/{assistant-settings-section-D2XmOMHN.js → assistant-settings-section-DRfpX0tI.js} +1 -1
- package/dist/web/assets/assistant-settings-section-DRfpX0tI.js.br +0 -0
- package/dist/web/assets/assistant-settings-section-DRfpX0tI.js.gz +0 -0
- package/dist/web/assets/{assistant-tab-BFarx_Ed.js → assistant-tab-DQ3og-MK.js} +1 -1
- package/dist/web/assets/assistant-tab-DQ3og-MK.js.br +0 -0
- package/dist/web/assets/assistant-tab-DQ3og-MK.js.gz +0 -0
- package/dist/web/assets/{branch-review-tab-DdIk8GqJ.js → branch-review-tab-C3yGKHTd.js} +1 -1
- package/dist/web/assets/branch-review-tab-C3yGKHTd.js.br +0 -0
- package/dist/web/assets/branch-review-tab-C3yGKHTd.js.gz +0 -0
- package/dist/web/assets/{build-message-with-attachments-Dsq01VRu.js → build-message-with-attachments-Co6REDSl.js} +1 -1
- package/dist/web/assets/build-message-with-attachments-Co6REDSl.js.br +0 -0
- package/dist/web/assets/build-message-with-attachments-Co6REDSl.js.gz +0 -0
- package/dist/web/assets/{chat-tab-CvA7BVJ4.js → chat-tab-C3w-wc2n.js} +1 -1
- package/dist/web/assets/chat-tab-C3w-wc2n.js.br +0 -0
- package/dist/web/assets/chat-tab-C3w-wc2n.js.gz +0 -0
- package/dist/web/assets/chat-tab-JRu__VsV.js +16 -0
- package/dist/web/assets/chat-tab-JRu__VsV.js.br +0 -0
- package/dist/web/assets/chat-tab-JRu__VsV.js.gz +0 -0
- package/dist/web/assets/{code-editor-DtOD5q9b.js → code-editor-H7RVivX2.js} +4 -4
- package/dist/web/assets/code-editor-H7RVivX2.js.br +0 -0
- package/dist/web/assets/code-editor-H7RVivX2.js.gz +0 -0
- package/dist/web/assets/{conflict-editor-Dj4BkpPf.js → conflict-editor-ga3hijb0.js} +1 -1
- package/dist/web/assets/conflict-editor-ga3hijb0.js.br +0 -0
- package/dist/web/assets/conflict-editor-ga3hijb0.js.gz +0 -0
- package/dist/web/assets/{connection-form-tab-Dk7r5Mtu.js → connection-form-tab-D_zOAzNd.js} +1 -1
- package/dist/web/assets/connection-form-tab-D_zOAzNd.js.br +0 -0
- package/dist/web/assets/{connection-form-tab-Dk7r5Mtu.js.gz → connection-form-tab-D_zOAzNd.js.gz} +0 -0
- package/dist/web/assets/{csv-preview-Dgmt5iQZ.js → csv-preview-AZ34W-Mh.js} +1 -1
- package/dist/web/assets/csv-preview-AZ34W-Mh.js.br +0 -0
- package/dist/web/assets/csv-preview-AZ34W-Mh.js.gz +0 -0
- package/dist/web/assets/{database-drivers-section-DSbxYtMp.js → database-drivers-section-CrqeJq7u.js} +1 -1
- package/dist/web/assets/database-drivers-section-CrqeJq7u.js.br +0 -0
- package/dist/web/assets/database-drivers-section-CrqeJq7u.js.gz +0 -0
- package/dist/web/assets/{db-tab-parts-CWVmqUJa.js → db-tab-parts-_IP72jRK.js} +1 -1
- package/dist/web/assets/db-tab-parts-_IP72jRK.js.br +0 -0
- package/dist/web/assets/db-tab-parts-_IP72jRK.js.gz +0 -0
- package/dist/web/assets/{design-settings-section-CnWSH_2N.js → design-settings-section-BtV8M47M.js} +1 -1
- package/dist/web/assets/design-settings-section-BtV8M47M.js.br +0 -0
- package/dist/web/assets/design-settings-section-BtV8M47M.js.gz +0 -0
- package/dist/web/assets/{design-tab-DiqcX1dI.js → design-tab-T7fULsYK.js} +1 -1
- package/dist/web/assets/design-tab-T7fULsYK.js.br +0 -0
- package/dist/web/assets/design-tab-T7fULsYK.js.gz +0 -0
- package/dist/web/assets/{designs-sidebar-panel-DeE4Jcpo.js → designs-sidebar-panel-DSmsYAGy.js} +1 -1
- package/dist/web/assets/designs-sidebar-panel-DSmsYAGy.js.br +0 -0
- package/dist/web/assets/designs-sidebar-panel-DSmsYAGy.js.gz +0 -0
- package/dist/web/assets/{diff-viewer-6O_OSt5v.js → diff-viewer-tQfd7lY-.js} +1 -1
- package/dist/web/assets/diff-viewer-tQfd7lY-.js.br +0 -0
- package/dist/web/assets/diff-viewer-tQfd7lY-.js.gz +0 -0
- package/dist/web/assets/{docx-preview-CLWVH9aX.js → docx-preview-B0Z5AIva.js} +1 -1
- package/dist/web/assets/docx-preview-B0Z5AIva.js.br +0 -0
- package/dist/web/assets/docx-preview-B0Z5AIva.js.gz +0 -0
- package/dist/web/assets/{editor-dialog-DFix0Lrm.js → editor-dialog-CS7gfskk.js} +1 -1
- package/dist/web/assets/{editor-dialog-DFix0Lrm.js.br → editor-dialog-CS7gfskk.js.br} +0 -0
- package/dist/web/assets/editor-dialog-CS7gfskk.js.gz +0 -0
- package/dist/web/assets/{editor-language-service-BxWCC26X.js → editor-language-service-COewJHSy.js} +1 -1
- package/dist/web/assets/editor-language-service-COewJHSy.js.br +0 -0
- package/dist/web/assets/editor-language-service-COewJHSy.js.gz +0 -0
- package/dist/web/assets/{explorer-body-D0CQnNgj.js → explorer-body-C84sjy1L.js} +1 -1
- package/dist/web/assets/explorer-body-C84sjy1L.js.br +0 -0
- package/dist/web/assets/explorer-body-C84sjy1L.js.gz +0 -0
- package/dist/web/assets/{explorer-window-content-DPLxcaoz.js → explorer-window-content-lf8LzExx.js} +1 -1
- package/dist/web/assets/explorer-window-content-lf8LzExx.js.br +0 -0
- package/dist/web/assets/explorer-window-content-lf8LzExx.js.gz +0 -0
- package/dist/web/assets/{extension-manager-section-BWPlMBS4.js → extension-manager-section-CZEzquNp.js} +1 -1
- package/dist/web/assets/extension-manager-section-CZEzquNp.js.br +0 -0
- package/dist/web/assets/extension-manager-section-CZEzquNp.js.gz +0 -0
- package/dist/web/assets/{extension-webview-D5IPLnq8.js → extension-webview-BHrLFzXj.js} +1 -1
- package/dist/web/assets/extension-webview-BHrLFzXj.js.br +0 -0
- package/dist/web/assets/extension-webview-BHrLFzXj.js.gz +0 -0
- package/dist/web/assets/file-store-DvNGR1CA.js +1 -0
- package/dist/web/assets/file-store-DvNGR1CA.js.br +0 -0
- package/dist/web/assets/file-store-DvNGR1CA.js.gz +0 -0
- package/dist/web/assets/{files-settings-section-MR-8W7DJ.js → files-settings-section-BlUeoibH.js} +1 -1
- package/dist/web/assets/files-settings-section-BlUeoibH.js.br +0 -0
- package/dist/web/assets/files-settings-section-BlUeoibH.js.gz +0 -0
- package/dist/web/assets/{general-settings-section-CEl3ciuP.js → general-settings-section-DhI6sUM3.js} +1 -1
- package/dist/web/assets/general-settings-section-DhI6sUM3.js.br +0 -0
- package/dist/web/assets/general-settings-section-DhI6sUM3.js.gz +0 -0
- package/dist/web/assets/{git-log-panel-DBfy0HRE.js → git-log-panel-CDss_FRo.js} +1 -1
- package/dist/web/assets/git-log-panel-CDss_FRo.js.br +0 -0
- package/dist/web/assets/git-log-panel-CDss_FRo.js.gz +0 -0
- package/dist/web/assets/{git-review-tab-C1V1CZAt.js → git-review-tab-Dq0n4l6O.js} +1 -1
- package/dist/web/assets/git-review-tab-Dq0n4l6O.js.br +0 -0
- package/dist/web/assets/git-review-tab-Dq0n4l6O.js.gz +0 -0
- package/dist/web/assets/{glide-data-grid-D84U-1qn.js → glide-data-grid-j8rWvpbY.js} +1 -1
- package/dist/web/assets/glide-data-grid-j8rWvpbY.js.br +0 -0
- package/dist/web/assets/{glide-data-grid-D84U-1qn.js.gz → glide-data-grid-j8rWvpbY.js.gz} +0 -0
- package/dist/web/assets/{grid-save-dialog-D9q2lcrq.js → grid-save-dialog-uxoRmuGo.js} +1 -1
- package/dist/web/assets/grid-save-dialog-uxoRmuGo.js.br +0 -0
- package/dist/web/assets/grid-save-dialog-uxoRmuGo.js.gz +0 -0
- package/dist/web/assets/{group-chat-tab-Bl0ECmSY.js → group-chat-tab-CuR5xrEo.js} +1 -1
- package/dist/web/assets/group-chat-tab-CuR5xrEo.js.br +0 -0
- package/dist/web/assets/group-chat-tab-CuR5xrEo.js.gz +0 -0
- package/dist/web/assets/{impexp-tab-BgGbQxzM.js → impexp-tab-KSdMfwa0.js} +1 -1
- package/dist/web/assets/impexp-tab-KSdMfwa0.js.br +0 -0
- package/dist/web/assets/impexp-tab-KSdMfwa0.js.gz +0 -0
- package/dist/web/assets/index-0VrQhdqv.css +1 -0
- package/dist/web/assets/index-0VrQhdqv.css.br +0 -0
- package/dist/web/assets/index-0VrQhdqv.css.gz +0 -0
- package/dist/web/assets/index-CwW8jYaQ.js +61 -0
- package/dist/web/assets/index-CwW8jYaQ.js.br +0 -0
- package/dist/web/assets/index-CwW8jYaQ.js.gz +0 -0
- package/dist/web/assets/{jira-watcher-section-ButbXGom.js → jira-watcher-section-Bwmios6B.js} +1 -1
- package/dist/web/assets/{keybindings-store-csigJZE3.js → keybindings-store-cNyx7joi.js} +1 -1
- package/dist/web/assets/{keyboard-shortcuts-section-BWvBH4ZU.js → keyboard-shortcuts-section-Dj3JImAF.js} +1 -1
- package/dist/web/assets/keyboard-shortcuts-section-Dj3JImAF.js.br +0 -0
- package/dist/web/assets/keyboard-shortcuts-section-Dj3JImAF.js.gz +0 -0
- package/dist/web/assets/{language-servers-section-DnehfNOm.js → language-servers-section-CefYgT1u.js} +2 -2
- package/dist/web/assets/language-servers-section-CefYgT1u.js.br +0 -0
- package/dist/web/assets/language-servers-section-CefYgT1u.js.gz +0 -0
- package/dist/web/assets/{logs-app-BlFJdAK9.js → logs-app-BXRv_zvF.js} +1 -1
- package/dist/web/assets/logs-app-BXRv_zvF.js.br +0 -0
- package/dist/web/assets/logs-app-BXRv_zvF.js.gz +0 -0
- package/dist/web/assets/{logs-tab-LAVt-dDa.js → logs-tab-Bj0QRW79.js} +1 -1
- package/dist/web/assets/{logs-window-content-Dfswr7eH.js → logs-window-content-BLmlGYHL.js} +1 -1
- package/dist/web/assets/{lsp-client-CHfLLcaF.js → lsp-client-DVXWoea-.js} +1 -1
- package/dist/web/assets/lsp-client-DVXWoea-.js.br +0 -0
- package/dist/web/assets/lsp-client-DVXWoea-.js.gz +0 -0
- package/dist/web/assets/{markdown-renderer-CSFnCZ8K.js → markdown-renderer-DWtBXkPO.js} +1 -1
- package/dist/web/assets/markdown-renderer-DWtBXkPO.js.br +0 -0
- package/dist/web/assets/markdown-renderer-DWtBXkPO.js.gz +0 -0
- package/dist/web/assets/{markdown-renderer-DksvADDz.js → markdown-renderer-P026cp3s.js} +1 -1
- package/dist/web/assets/markdown-renderer-P026cp3s.js.br +0 -0
- package/dist/web/assets/markdown-renderer-P026cp3s.js.gz +0 -0
- package/dist/web/assets/{mobile-explorer-sheet-B5sLjLZs.js → mobile-explorer-sheet-B9HZDsEs.js} +1 -1
- package/dist/web/assets/mobile-explorer-sheet-B9HZDsEs.js.br +0 -0
- package/dist/web/assets/mobile-explorer-sheet-B9HZDsEs.js.gz +0 -0
- package/dist/web/assets/{monaco-diff-editor-CXo44_VI.js → monaco-diff-editor-B8ArCEIw.js} +1 -1
- package/dist/web/assets/{new-design-dialog-_GiCQMy2.js → new-design-dialog-oIiyRrhh.js} +1 -1
- package/dist/web/assets/new-design-dialog-oIiyRrhh.js.br +0 -0
- package/dist/web/assets/new-design-dialog-oIiyRrhh.js.gz +0 -0
- package/dist/web/assets/{notifications-settings-section-D8irgdCE.js → notifications-settings-section-BkcKbTgz.js} +1 -1
- package/dist/web/assets/notifications-settings-section-BkcKbTgz.js.br +0 -0
- package/dist/web/assets/notifications-settings-section-BkcKbTgz.js.gz +0 -0
- package/dist/web/assets/{onboarding-entry-DzhsgvnY.js → onboarding-entry-DiyOOJFf.js} +1 -1
- package/dist/web/assets/{onboarding-entry-DzhsgvnY.js.br → onboarding-entry-DiyOOJFf.js.br} +0 -0
- package/dist/web/assets/onboarding-entry-DiyOOJFf.js.gz +0 -0
- package/dist/web/assets/{open-manager-chat-CNVW5U1C.js → open-manager-chat-D6UohARN.js} +1 -1
- package/dist/web/assets/{open-manager-chat-CNVW5U1C.js.br → open-manager-chat-D6UohARN.js.br} +0 -0
- package/dist/web/assets/open-manager-chat-D6UohARN.js.gz +0 -0
- package/dist/web/assets/{open-manager-chat-Bkb2PmYu.js → open-manager-chat-nL69R9PI.js} +1 -1
- package/dist/web/assets/open-manager-chat-nL69R9PI.js.br +0 -0
- package/dist/web/assets/open-manager-chat-nL69R9PI.js.gz +0 -0
- package/dist/web/assets/{problems-panel-DZCBTTK0.js → problems-panel-oyuU0uxS.js} +1 -1
- package/dist/web/assets/problems-panel-oyuU0uxS.js.br +0 -0
- package/dist/web/assets/problems-panel-oyuU0uxS.js.gz +0 -0
- package/dist/web/assets/{process-table-oLXQ1Mj2.js → process-table-BsR2ECwi.js} +1 -1
- package/dist/web/assets/process-table-BsR2ECwi.js.br +0 -0
- package/dist/web/assets/process-table-BsR2ECwi.js.gz +0 -0
- package/dist/web/assets/{proxy-settings-section-D88d-YqC.js → proxy-settings-section-Q1kpZeaT.js} +1 -1
- package/dist/web/assets/proxy-settings-section-Q1kpZeaT.js.br +0 -0
- package/dist/web/assets/proxy-settings-section-Q1kpZeaT.js.gz +0 -0
- package/dist/web/assets/{query-tab-D3UWqL_c.js → query-tab-Bx-Jp2_d.js} +1 -1
- package/dist/web/assets/query-tab-Bx-Jp2_d.js.br +0 -0
- package/dist/web/assets/query-tab-Bx-Jp2_d.js.gz +0 -0
- package/dist/web/assets/{release-notes-window-content-DBGd9q2f.js → release-notes-window-content-B6xYuiZK.js} +1 -1
- package/dist/web/assets/{remote-access-settings-section-lDOBuTcD.js → remote-access-settings-section-C1QRH2ow.js} +1 -1
- package/dist/web/assets/remote-access-settings-section-C1QRH2ow.js.br +0 -0
- package/dist/web/assets/remote-access-settings-section-C1QRH2ow.js.gz +0 -0
- package/dist/web/assets/{remote-desktop-clipboard-notice-C8lLPqSE.js → remote-desktop-clipboard-notice-DdINcOEY.js} +1 -1
- package/dist/web/assets/remote-desktop-clipboard-notice-DdINcOEY.js.br +0 -0
- package/dist/web/assets/remote-desktop-clipboard-notice-DdINcOEY.js.gz +0 -0
- package/dist/web/assets/{remote-desktop-mobile-sheet-1X9nMYdk.js → remote-desktop-mobile-sheet-BlEM8AcD.js} +2 -2
- package/dist/web/assets/remote-desktop-mobile-sheet-BlEM8AcD.js.br +0 -0
- package/dist/web/assets/remote-desktop-mobile-sheet-BlEM8AcD.js.gz +0 -0
- package/dist/web/assets/{remote-desktop-mobile-view-DXlyxMuT.js → remote-desktop-mobile-view-GvyV8wyb.js} +1 -1
- package/dist/web/assets/remote-desktop-mobile-view-GvyV8wyb.js.br +0 -0
- package/dist/web/assets/remote-desktop-mobile-view-GvyV8wyb.js.gz +0 -0
- package/dist/web/assets/{remote-desktop-readiness-gate-CapsSTlz.js → remote-desktop-readiness-gate-BSpv6mQ-.js} +1 -1
- package/dist/web/assets/remote-desktop-readiness-gate-BSpv6mQ-.js.br +0 -0
- package/dist/web/assets/remote-desktop-readiness-gate-BSpv6mQ-.js.gz +0 -0
- package/dist/web/assets/{remote-desktop-window-content-CmASOSoo.js → remote-desktop-window-content-Iup6SCK3.js} +1 -1
- package/dist/web/assets/remote-desktop-window-content-Iup6SCK3.js.br +0 -0
- package/dist/web/assets/remote-desktop-window-content-Iup6SCK3.js.gz +0 -0
- package/dist/web/assets/{rename-object-dialog-CFhoU1ti.js → rename-object-dialog-Bn8F5g-i.js} +1 -1
- package/dist/web/assets/rename-object-dialog-Bn8F5g-i.js.br +0 -0
- package/dist/web/assets/rename-object-dialog-Bn8F5g-i.js.gz +0 -0
- package/dist/web/assets/{reveal-task-in-sidebar-Dz0tH8vo.js → reveal-task-in-sidebar-f_-2Az7U.js} +1 -1
- package/dist/web/assets/{review-address-setup-CHbOBPtn.js → review-address-setup-2XE_wU5y.js} +1 -1
- package/dist/web/assets/review-address-setup-2XE_wU5y.js.br +0 -0
- package/dist/web/assets/review-address-setup-2XE_wU5y.js.gz +0 -0
- package/dist/web/assets/{review-code-Ek4TK-FX.js → review-code-gFAi1VYM.js} +1 -1
- package/dist/web/assets/review-code-gFAi1VYM.js.br +0 -0
- package/dist/web/assets/review-code-gFAi1VYM.js.gz +0 -0
- package/dist/web/assets/{save-as-dialog-m00iZElW.js → save-as-dialog-BQDZtrUf.js} +1 -1
- package/dist/web/assets/save-as-dialog-BQDZtrUf.js.br +0 -0
- package/dist/web/assets/save-as-dialog-BQDZtrUf.js.gz +0 -0
- package/dist/web/assets/{schedule-form-BDbZLG_F.js → schedule-form-DiuMU_nt.js} +3 -3
- package/dist/web/assets/schedule-form-DiuMU_nt.js.br +0 -0
- package/dist/web/assets/schedule-form-DiuMU_nt.js.gz +0 -0
- package/dist/web/assets/{schedule-script-editor-BC7_nlsE.js → schedule-script-editor-28peB9iT.js} +1 -1
- package/dist/web/assets/schedule-script-editor-28peB9iT.js.br +0 -0
- package/dist/web/assets/schedule-script-editor-28peB9iT.js.gz +0 -0
- package/dist/web/assets/{schedules-app-C6IdZ1hz.js → schedules-app-NT6c01VK.js} +1 -1
- package/dist/web/assets/schedules-app-NT6c01VK.js.br +0 -0
- package/dist/web/assets/schedules-app-NT6c01VK.js.gz +0 -0
- package/dist/web/assets/{schedules-settings-section-Dhc_ZbMP.js → schedules-settings-section-Dq56Aq9t.js} +3 -3
- package/dist/web/assets/schedules-settings-section-Dq56Aq9t.js.br +0 -0
- package/dist/web/assets/schedules-settings-section-Dq56Aq9t.js.gz +0 -0
- package/dist/web/assets/{schedules-tab-NMvWV7xN.js → schedules-tab-CKo3Zsj6.js} +1 -1
- package/dist/web/assets/schedules-tab-CKo3Zsj6.js.br +0 -0
- package/dist/web/assets/schedules-tab-CKo3Zsj6.js.gz +0 -0
- package/dist/web/assets/{schedules-ui-DaSldyoD.js → schedules-ui-Ct6leygy.js} +1 -1
- package/dist/web/assets/schedules-ui-Ct6leygy.js.br +0 -0
- package/dist/web/assets/schedules-ui-Ct6leygy.js.gz +0 -0
- package/dist/web/assets/{schedules-window-content-MseZLBpK.js → schedules-window-content-C589_OKf.js} +1 -1
- package/dist/web/assets/schedules-window-content-C589_OKf.js.br +0 -0
- package/dist/web/assets/schedules-window-content-C589_OKf.js.gz +0 -0
- package/dist/web/assets/{session-review-tab-BEPMJynS.js → session-review-tab-CkGq1u-8.js} +1 -1
- package/dist/web/assets/session-review-tab-CkGq1u-8.js.br +0 -0
- package/dist/web/assets/session-review-tab-CkGq1u-8.js.gz +0 -0
- package/dist/web/assets/{settings-body-D2e_RbI4.js → settings-body-BqZQAys_.js} +1 -1
- package/dist/web/assets/settings-body-BqZQAys_.js.br +0 -0
- package/dist/web/assets/settings-body-BqZQAys_.js.gz +0 -0
- package/dist/web/assets/{settings-rows-B6puQ-Vk.js → settings-rows-Bb4STWcn.js} +1 -1
- package/dist/web/assets/settings-rows-Bb4STWcn.js.br +0 -0
- package/dist/web/assets/settings-rows-Bb4STWcn.js.gz +0 -0
- package/dist/web/assets/{settings-section-content-DPyAAu71.js → settings-section-content-DX_GdFMc.js} +1 -1
- package/dist/web/assets/{settings-section-content-Mzy53zFZ.js → settings-section-content-Di0LahcQ.js} +2 -2
- package/dist/web/assets/settings-section-content-Di0LahcQ.js.br +0 -0
- package/dist/web/assets/settings-section-content-Di0LahcQ.js.gz +0 -0
- package/dist/web/assets/{settings-tab-DFgGmabd.js → settings-tab-DX0h-GYd.js} +1 -1
- package/dist/web/assets/{settings-window-content-C9IxMJOD.js → settings-window-content-CEQNeSdk.js} +1 -1
- package/dist/web/assets/{sql-object-tab-DXiJqm1Y.js → sql-object-tab-DJXb0lpf.js} +1 -1
- package/dist/web/assets/sql-object-tab-DJXb0lpf.js.br +0 -0
- package/dist/web/assets/sql-object-tab-DJXb0lpf.js.gz +0 -0
- package/dist/web/assets/{sqlite-viewer-BoqlcTq3.js → sqlite-viewer-hs32HxsR.js} +1 -1
- package/dist/web/assets/sqlite-viewer-hs32HxsR.js.br +0 -0
- package/dist/web/assets/sqlite-viewer-hs32HxsR.js.gz +0 -0
- package/dist/web/assets/{storage-settings-section-BSzvRWfE.js → storage-settings-section-CPUJt1fa.js} +1 -1
- package/dist/web/assets/storage-settings-section-CPUJt1fa.js.br +0 -0
- package/dist/web/assets/storage-settings-section-CPUJt1fa.js.gz +0 -0
- package/dist/web/assets/{structure-save-dialog-DmAOFSGl.js → structure-save-dialog-DanBkCiV.js} +1 -1
- package/dist/web/assets/structure-save-dialog-DanBkCiV.js.br +0 -0
- package/dist/web/assets/structure-save-dialog-DanBkCiV.js.gz +0 -0
- package/dist/web/assets/{structure-tab-Cj2T4GOA.js → structure-tab-C5CeA6ix.js} +1 -1
- package/dist/web/assets/structure-tab-C5CeA6ix.js.br +0 -0
- package/dist/web/assets/structure-tab-C5CeA6ix.js.gz +0 -0
- package/dist/web/assets/{system-monitor-body-ryEXCvyT.js → system-monitor-body-zvJUsvO9.js} +2 -2
- package/dist/web/assets/system-monitor-body-zvJUsvO9.js.br +0 -0
- package/dist/web/assets/system-monitor-body-zvJUsvO9.js.gz +0 -0
- package/dist/web/assets/{system-monitor-tab-DcNzbPgb.js → system-monitor-tab-BEmD7cX5.js} +1 -1
- package/dist/web/assets/{system-monitor-window-content-CpFLui4-.js → system-monitor-window-content-DghMx4JN.js} +1 -1
- package/dist/web/assets/{tab-host-window-content-CD92R8Dj.js → tab-host-window-content-BkrRvAg-.js} +1 -1
- package/dist/web/assets/{tab-host-window-content-CD92R8Dj.js.br → tab-host-window-content-BkrRvAg-.js.br} +0 -0
- package/dist/web/assets/tab-host-window-content-BkrRvAg-.js.gz +0 -0
- package/dist/web/assets/{table-tab-zoEhA_cF.js → table-tab-DaOD-uvL.js} +1 -1
- package/dist/web/assets/table-tab-DaOD-uvL.js.br +0 -0
- package/dist/web/assets/table-tab-DaOD-uvL.js.gz +0 -0
- package/dist/web/assets/{task-detail-mobile-40HLTUnk.js → task-detail-mobile-BmXfCLrx.js} +1 -1
- package/dist/web/assets/task-detail-mobile-BmXfCLrx.js.br +0 -0
- package/dist/web/assets/task-detail-mobile-BmXfCLrx.js.gz +0 -0
- package/dist/web/assets/{task-sheet-Tbk7O-Ak.js → task-sheet-B5pIWo1Q.js} +1 -1
- package/dist/web/assets/task-sheet-B5pIWo1Q.js.br +0 -0
- package/dist/web/assets/task-sheet-B5pIWo1Q.js.gz +0 -0
- package/dist/web/assets/{task-status-grid-D4UX5sy_.js → task-status-grid-D-GhknFi.js} +1 -1
- package/dist/web/assets/task-status-grid-D-GhknFi.js.br +0 -0
- package/dist/web/assets/task-status-grid-D-GhknFi.js.gz +0 -0
- package/dist/web/assets/{task-tab-CrW-DqBd.js → task-tab-CK7aG2Ec.js} +1 -1
- package/dist/web/assets/task-tab-CK7aG2Ec.js.br +0 -0
- package/dist/web/assets/task-tab-CK7aG2Ec.js.gz +0 -0
- package/dist/web/assets/{tasks-sidebar-panel-D3opTyDQ.js → tasks-sidebar-panel-D51n4uTs.js} +1 -1
- package/dist/web/assets/tasks-sidebar-panel-D51n4uTs.js.br +0 -0
- package/dist/web/assets/tasks-sidebar-panel-D51n4uTs.js.gz +0 -0
- package/dist/web/assets/{telegram-bot-token-field-CP_XKOOb.js → telegram-bot-token-field-Cn2tYIPN.js} +1 -1
- package/dist/web/assets/telegram-bot-token-field-Cn2tYIPN.js.br +0 -0
- package/dist/web/assets/telegram-bot-token-field-Cn2tYIPN.js.gz +0 -0
- package/dist/web/assets/{terminal-tab-eVtopKuS.js → terminal-tab-Cn7mR-ju.js} +1 -1
- package/dist/web/assets/terminal-tab-Cn7mR-ju.js.br +0 -0
- package/dist/web/assets/terminal-tab-Cn7mR-ju.js.gz +0 -0
- package/dist/web/assets/{tool-cards-CqkbtQmV.js → tool-cards-BsbretjX.js} +3 -3
- package/dist/web/assets/tool-cards-BsbretjX.js.br +0 -0
- package/dist/web/assets/tool-cards-BsbretjX.js.gz +0 -0
- package/dist/web/assets/{tools-settings-section-ym2uDafc.js → tools-settings-section-VR1kAUqP.js} +1 -1
- package/dist/web/assets/tools-settings-section-VR1kAUqP.js.br +0 -0
- package/dist/web/assets/tools-settings-section-VR1kAUqP.js.gz +0 -0
- package/dist/web/assets/{use-db-read-MivtTKTM.js → use-db-read-DQ9NNFO5.js} +1 -1
- package/dist/web/assets/{use-db-read-MivtTKTM.js.br → use-db-read-DQ9NNFO5.js.br} +0 -0
- package/dist/web/assets/use-db-read-DQ9NNFO5.js.gz +0 -0
- package/dist/web/assets/{use-inline-blame-qDX6zmzH.js → use-inline-blame-D3icIZN5.js} +1 -1
- package/dist/web/assets/use-inline-blame-D3icIZN5.js.br +0 -0
- package/dist/web/assets/use-inline-blame-D3icIZN5.js.gz +0 -0
- package/dist/web/assets/{use-lsp-BdHI4aa8.js → use-lsp-B_rWeV_U.js} +1 -1
- package/dist/web/assets/use-lsp-B_rWeV_U.js.br +0 -0
- package/dist/web/assets/use-lsp-B_rWeV_U.js.gz +0 -0
- package/dist/web/assets/{use-monaco-theme-B4sZXOJo.js → use-monaco-theme-yVbWyiD5.js} +1 -1
- package/dist/web/assets/{use-process-kill-B7kifhe_.js → use-process-kill-DnsJehPH.js} +1 -1
- package/dist/web/assets/use-process-kill-DnsJehPH.js.br +0 -0
- package/dist/web/assets/use-process-kill-DnsJehPH.js.gz +0 -0
- package/dist/web/assets/{use-sql-schema-info-w7C5brXk.js → use-sql-schema-info-BVycXVe5.js} +1 -1
- package/dist/web/assets/use-sql-schema-info-BVycXVe5.js.br +0 -0
- package/dist/web/assets/use-sql-schema-info-BVycXVe5.js.gz +0 -0
- package/dist/web/assets/{use-websocket-DsX1l-DK.js → use-websocket-C_m-8l_F.js} +1 -1
- package/dist/web/assets/{vault-settings-section-B0oWe-n2.js → vault-settings-section-AmzR65kD.js} +1 -1
- package/dist/web/assets/vault-settings-section-AmzR65kD.js.br +0 -0
- package/dist/web/assets/vault-settings-section-AmzR65kD.js.gz +0 -0
- package/dist/web/assets/{voice-settings-section-DNNYOnyl.js → voice-settings-section-BRp23eqt.js} +1 -1
- package/dist/web/assets/voice-settings-section-BRp23eqt.js.br +0 -0
- package/dist/web/assets/voice-settings-section-BRp23eqt.js.gz +0 -0
- package/dist/web/assets/{web-preview-tab-CvP7EV4g.js → web-preview-tab-4RG8fhNU.js} +1 -1
- package/dist/web/assets/web-preview-tab-4RG8fhNU.js.br +0 -0
- package/dist/web/assets/web-preview-tab-4RG8fhNU.js.gz +0 -0
- package/dist/web/assets/{xlsx-preview-EuM_t7JD.js → xlsx-preview-BtWDXYin.js} +1 -1
- package/dist/web/assets/xlsx-preview-BtWDXYin.js.br +0 -0
- package/dist/web/assets/xlsx-preview-BtWDXYin.js.gz +0 -0
- package/dist/web/index.html +4 -4
- 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/index.ts +5 -1
- package/src/server/routes/files.ts +7 -3
- package/src/services/file-filter.service.ts +1 -1
- package/src/services/file-glob.ts +1 -1
- package/src/services/file-index/file-index-runner.ts +178 -84
- package/src/services/file-index/file-index-walk-process.ts +70 -0
- package/src/services/file-index/file-index-worker.ts +22 -50
- package/src/services/file-index/index-search.ts +1 -1
- package/src/services/file-index/index-walk.ts +143 -41
- package/src/services/file-list-index.service.ts +32 -6
- package/src/shared/file-index-limits.ts +1 -1
- package/src/types/project.ts +2 -0
- package/src/web/components/chat/chat-tab.tsx +12 -3
- package/src/web/components/chat/footer-popover.tsx +5 -3
- package/src/web/components/layout/command-palette-truncated-notice.tsx +29 -0
- package/src/web/components/layout/command-palette.tsx +6 -0
- package/src/web/hooks/use-scroll-edge-fades.ts +72 -0
- package/src/web/stores/file-store.ts +10 -2
- package/src/web/styles/globals.css +30 -0
- 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-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-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-CjellqxA.js.br +0 -0
- package/dist/web/assets/ai-resource-editor-CjellqxA.js.gz +0 -0
- 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.br +0 -0
- package/dist/web/assets/ai-settings-section-Db9X6wec.js.gz +0 -0
- 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-C9gPFRb5.js.br +0 -0
- package/dist/web/assets/antigravity-usage-view-C9gPFRb5.js.gz +0 -0
- 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-D7fUCDns.js.br +0 -0
- package/dist/web/assets/apps-panel-D7fUCDns.js.gz +0 -0
- 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-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-DdIk8GqJ.js.br +0 -0
- package/dist/web/assets/branch-review-tab-DdIk8GqJ.js.gz +0 -0
- package/dist/web/assets/build-message-with-attachments-Dsq01VRu.js.br +0 -0
- package/dist/web/assets/build-message-with-attachments-Dsq01VRu.js.gz +0 -0
- package/dist/web/assets/chat-tab-CAE9EaFD.js +0 -16
- 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-CvA7BVJ4.js.br +0 -0
- package/dist/web/assets/chat-tab-CvA7BVJ4.js.gz +0 -0
- 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-Dj4BkpPf.js.br +0 -0
- package/dist/web/assets/conflict-editor-Dj4BkpPf.js.gz +0 -0
- package/dist/web/assets/connection-form-tab-Dk7r5Mtu.js.br +0 -0
- 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-DSbxYtMp.js.br +0 -0
- package/dist/web/assets/database-drivers-section-DSbxYtMp.js.gz +0 -0
- 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-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-DiqcX1dI.js.br +0 -0
- package/dist/web/assets/design-tab-DiqcX1dI.js.gz +0 -0
- 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-6O_OSt5v.js.br +0 -0
- package/dist/web/assets/diff-viewer-6O_OSt5v.js.gz +0 -0
- 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-DFix0Lrm.js.gz +0 -0
- 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-D0CQnNgj.js.br +0 -0
- package/dist/web/assets/explorer-body-D0CQnNgj.js.gz +0 -0
- 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-BWPlMBS4.js.br +0 -0
- package/dist/web/assets/extension-manager-section-BWPlMBS4.js.gz +0 -0
- 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/file-store-KmDlwUZn.js +0 -1
- package/dist/web/assets/file-store-KmDlwUZn.js.br +0 -0
- package/dist/web/assets/file-store-KmDlwUZn.js.gz +0 -0
- 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-CEl3ciuP.js.br +0 -0
- package/dist/web/assets/general-settings-section-CEl3ciuP.js.gz +0 -0
- 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-C1V1CZAt.js.br +0 -0
- package/dist/web/assets/git-review-tab-C1V1CZAt.js.gz +0 -0
- package/dist/web/assets/glide-data-grid-D84U-1qn.js.br +0 -0
- 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-Bl0ECmSY.js.br +0 -0
- package/dist/web/assets/group-chat-tab-Bl0ECmSY.js.gz +0 -0
- 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-CXjsAVvH.js +0 -61
- package/dist/web/assets/index-CXjsAVvH.js.br +0 -0
- package/dist/web/assets/index-CXjsAVvH.js.gz +0 -0
- package/dist/web/assets/index-NLV9BOl2.css +0 -1
- package/dist/web/assets/index-NLV9BOl2.css.br +0 -0
- package/dist/web/assets/index-NLV9BOl2.css.gz +0 -0
- 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-DnehfNOm.js.br +0 -0
- package/dist/web/assets/language-servers-section-DnehfNOm.js.gz +0 -0
- package/dist/web/assets/logs-app-BlFJdAK9.js.br +0 -0
- package/dist/web/assets/logs-app-BlFJdAK9.js.gz +0 -0
- 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-CSFnCZ8K.js.br +0 -0
- package/dist/web/assets/markdown-renderer-CSFnCZ8K.js.gz +0 -0
- 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-B5sLjLZs.js.br +0 -0
- package/dist/web/assets/mobile-explorer-sheet-B5sLjLZs.js.gz +0 -0
- 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/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-DzhsgvnY.js.gz +0 -0
- 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-CNVW5U1C.js.gz +0 -0
- 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-oLXQ1Mj2.js.br +0 -0
- package/dist/web/assets/process-table-oLXQ1Mj2.js.gz +0 -0
- 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-D3UWqL_c.js.br +0 -0
- package/dist/web/assets/query-tab-D3UWqL_c.js.gz +0 -0
- 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-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-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-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-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-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-CFhoU1ti.js.br +0 -0
- package/dist/web/assets/rename-object-dialog-CFhoU1ti.js.gz +0 -0
- 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-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-m00iZElW.js.br +0 -0
- package/dist/web/assets/save-as-dialog-m00iZElW.js.gz +0 -0
- 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-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-C6IdZ1hz.js.br +0 -0
- package/dist/web/assets/schedules-app-C6IdZ1hz.js.gz +0 -0
- 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-NMvWV7xN.js.br +0 -0
- package/dist/web/assets/schedules-tab-NMvWV7xN.js.gz +0 -0
- 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-MseZLBpK.js.br +0 -0
- package/dist/web/assets/schedules-window-content-MseZLBpK.js.gz +0 -0
- 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-D2e_RbI4.js.br +0 -0
- package/dist/web/assets/settings-body-D2e_RbI4.js.gz +0 -0
- 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-Mzy53zFZ.js.br +0 -0
- package/dist/web/assets/settings-section-content-Mzy53zFZ.js.gz +0 -0
- 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-BoqlcTq3.js.br +0 -0
- package/dist/web/assets/sqlite-viewer-BoqlcTq3.js.gz +0 -0
- 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-DmAOFSGl.js.br +0 -0
- package/dist/web/assets/structure-save-dialog-DmAOFSGl.js.gz +0 -0
- 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-ryEXCvyT.js.br +0 -0
- package/dist/web/assets/system-monitor-body-ryEXCvyT.js.gz +0 -0
- package/dist/web/assets/tab-host-window-content-CD92R8Dj.js.gz +0 -0
- 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-40HLTUnk.js.br +0 -0
- package/dist/web/assets/task-detail-mobile-40HLTUnk.js.gz +0 -0
- 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-D4UX5sy_.js.br +0 -0
- package/dist/web/assets/task-status-grid-D4UX5sy_.js.gz +0 -0
- 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-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-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-eVtopKuS.js.br +0 -0
- package/dist/web/assets/terminal-tab-eVtopKuS.js.gz +0 -0
- 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-ym2uDafc.js.br +0 -0
- package/dist/web/assets/tools-settings-section-ym2uDafc.js.gz +0 -0
- package/dist/web/assets/use-db-read-MivtTKTM.js.gz +0 -0
- 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-BdHI4aa8.js.br +0 -0
- package/dist/web/assets/use-lsp-BdHI4aa8.js.gz +0 -0
- 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-w7C5brXk.js.br +0 -0
- package/dist/web/assets/use-sql-schema-info-w7C5brXk.js.gz +0 -0
- 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-DNNYOnyl.js.br +0 -0
- package/dist/web/assets/voice-settings-section-DNNYOnyl.js.gz +0 -0
- 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-EuM_t7JD.js.br +0 -0
- package/dist/web/assets/xlsx-preview-EuM_t7JD.js.gz +0 -0
package/dist/web/assets/{vault-settings-section-B0oWe-n2.js → vault-settings-section-AmzR65kD.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-26eoXJk7.js";import{yt as r}from"./vendor-ui-BQzUk4nq.js";import{Ar as i,Et as a,Xr as o,_t as s,d as c,er as l,ht as u,ln as d,lr as f,nr as p,pi as m,rn as h,ti as g,ut as _,vt as v,wn as y}from"./icons-CpR5Vw3J.js";import{j as b}from"./api-client-DSCscZEd.js";import{n as x}from"./utils-DMiycH3O.js";import"./portal-container-context-C84rlnJ6.js";import"./mobile-bottom-sheet-C78UMLrn.js";import"./use-visual-viewport-tMLO63yY.js";import"./use-is-mobile-CrfIt67b.js";import{D as S,a as C,b as w,f as T,g as E,i as D,k as O,l as k,m as A,n as ee,o as j,r as M,s as te,w as N,x as P}from"./vault-Q5oPy0h3.js";import{t as ne}from"./vault-focus-store-BYABW4-C.js";import{t as F}from"./button-CtdEWN7U.js";import"./dialog-BWXzvHlC.js";import{r as I}from"./clipboard-DQuoK2EM.js";import{t as L}from"./input-CCVoN0-P.js";import"./design-canvas-check-DahR87XO.js";import"./tab-open-protocol-2j23y-fq.js";import"./vault-tool-call-DZB6P-R4.js";import{_ as R,a as z,f as B,g as V,h as H,i as U,n as W,o as re,p as G,r as ie,s as ae,t as oe,v as K,y as q}from"./vault-fields-8WmUiC7P.js";import{t as J}from"./design-responsive-dialog-Ccf_PhuE.js";import{n as Y,t as X}from"./settings-rows-B6puQ-Vk.js";var Z=e(t(),1);function se(){let[e,t]=(0,Z.useState)(null),[n,r]=(0,Z.useState)(null),i=(0,Z.useCallback)(async()=>{try{let[e,n]=await Promise.all([V.status(),V.items()]),i=n.filter(e=>e.tier===`public`),a=await Promise.all(i.map(e=>V.reveal(e.id).then(t=>[e.id,t.value])));t({status:e,items:n,publicValues:Object.fromEntries(a)}),r(null)}catch(e){r(R(e).message)}},[]);return(0,Z.useEffect)(()=>{i()},[i]),{data:e,error:n,refresh:i}}var Q=n();function ce({files:e,actions:t}){return e.length?(0,Q.jsx)(`ul`,{className:`mt-2 space-y-1.5`,"data-vault-files":``,children:e.map(e=>(0,Q.jsxs)(`li`,{className:`flex items-center gap-2 rounded-lg border border-border bg-panel-2/60 py-1 pl-2 pr-1`,"data-vault-file":e.id,children:[(0,Q.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-md bg-panel-2 text-text-secondary`,"aria-hidden":!0,children:e.type===`application/pdf`?(0,Q.jsx)(a,{className:`size-4`}):(0,Q.jsx)(h,{className:`size-4`})}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`p`,{className:`truncate text-sm`,children:e.label}),(0,Q.jsxs)(`p`,{className:`text-[11px] text-muted-foreground`,children:[j[e.type],` · `,N(e.size)]})]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0`,children:[(0,Q.jsx)(X,{label:`Preview ${e.label}`,onClick:()=>t.onPreview(e),children:(0,Q.jsx)(s,{className:`size-4`})}),(0,Q.jsx)(X,{label:`Download ${e.label}`,onClick:()=>t.onDownload(e),children:(0,Q.jsx)(u,{className:`size-4`})}),(0,Q.jsx)(X,{label:`Rename ${e.label}`,onClick:()=>t.onRename(e),children:(0,Q.jsx)(p,{className:`size-4`})}),(0,Q.jsx)(X,{label:`Delete ${e.label}`,danger:!0,onClick:()=>t.onDelete(e),children:(0,Q.jsx)(o,{className:`size-4`})})]})]},e.id))}):null}var le=3e4,ue=e=>new Date(e).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`});function de({item:e,publicValue:t,revealed:n,onShow:r,onHide:i,onEdit:a,onMove:u,onDelete:d,onAddFile:f,fileActions:m}){let h=q(!!n),[g,y]=(0,Z.useState)(!1),b=!!n&&n.until>h;(0,Z.useEffect)(()=>{n&&n.until<=h&&i?.()},[n,h,i]),(0,Z.useEffect)(()=>y(!1),[n]);let x=t??(b?n.value:null);return(0,Q.jsxs)(`div`,{className:`px-4 py-2`,"data-vault-item":e.id,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1 md:flex-row md:items-start md:gap-3`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsxs)(`p`,{className:`truncate text-sm`,children:[e.name,` `,(0,Q.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`· `,k[e.kind]]}),!!e.attachments?.length&&(0,Q.jsxs)(`span`,{className:`ml-1 inline-flex items-center gap-0.5 text-xs text-muted-foreground`,"data-vault-file-count":``,children:[`· `,(0,Q.jsx)(l,{className:`size-3`}),e.attachments.length]})]}),(0,Q.jsxs)(`p`,{className:`text-[11px] text-muted-foreground`,children:[`Updated `,ue(e.updatedAt)]})]}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-1 md:shrink-0`,children:[x!==null&&(0,Q.jsx)(X,{label:g?`Copied`:`Copy`,onClick:()=>void I(x).then(y),children:(0,Q.jsx)(_,{className:`size-4`})}),r&&(b?(0,Q.jsx)(X,{label:`Hide`,onClick:()=>i?.(),children:(0,Q.jsx)(v,{className:`size-4`})}):(0,Q.jsx)(X,{label:`Show`,onClick:r,children:(0,Q.jsx)(s,{className:`size-4`})})),(0,Q.jsx)(X,{label:`Edit`,onClick:a,children:(0,Q.jsx)(p,{className:`size-4`})}),f&&(0,Q.jsx)(X,{label:`Attach a photo or PDF`,onClick:f,children:(0,Q.jsx)(l,{className:`size-4`})}),(0,Q.jsx)(X,{label:`Move to another tier`,onClick:u,children:(0,Q.jsx)(c,{className:`size-4`})}),(0,Q.jsx)(X,{label:`Delete`,danger:!0,onClick:d,children:(0,Q.jsx)(o,{className:`size-4`})})]})]}),x!==null&&(0,Q.jsxs)(`div`,{className:`mt-1 flex items-start gap-2`,children:[(0,Q.jsx)(`code`,{className:`block max-h-60 min-w-0 flex-1 select-text overflow-auto whitespace-pre-wrap break-all rounded bg-panel-2 px-2 py-1 font-mono text-xs`,"data-vault-value":``,children:x}),b&&(0,Q.jsx)(`span`,{className:`shrink-0 pt-1 font-mono text-[11px] text-muted-foreground`,children:H(n.until-h)})]}),m&&e.attachments?.length?(0,Q.jsx)(ce,{files:e.attachments,actions:m}):null]})}function fe({items:e,values:t,onAdd:n,onEdit:r,onMove:i,onDelete:a}){return(0,Q.jsxs)(`section`,{className:`space-y-3`,"data-vault-tier":`public`,children:[(0,Q.jsx)(Y,{title:`Public`,children:oe}),(0,Q.jsxs)(`div`,{className:`divide-y divide-border rounded-lg border border-border`,children:[e.length===0&&(0,Q.jsx)(`p`,{className:`px-4 py-3 text-xs text-muted-foreground`,children:`No items yet.`}),e.map(e=>(0,Q.jsx)(de,{item:e,publicValue:t[e.id]??``,onEdit:()=>r(e),onMove:()=>i(e),onDelete:()=>a(e)},e.id))]}),(0,Q.jsxs)(F,{className:`h-11 md:h-9`,onClick:n,children:[(0,Q.jsx)(f,{className:`size-4`}),`Add`]})]})}var pe={secure:`Encrypted under its own password. The AI reads an item only after you type that password on a card in PPM, once or for a few minutes.`,sealed:`Encrypted under a second, separate password and never kept open. One item per card, shown to you unless you give it to the AI that once.`};function me({tier:e,status:t,items:n,revealed:r,now:a,actions:s}){let c=P[e],l=t.settingsOpenUntil-a,u=t.lockedUntil-a;return t.enabled?(0,Q.jsxs)(`section`,{className:`space-y-3`,"data-vault-tier":e,children:[(0,Q.jsx)(Y,{title:c,children:pe[e]}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs`,children:[e===`secure`&&(l>0?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-success/15 px-2 py-1 text-success`,"data-vault-unlocked":``,children:[(0,Q.jsx)(i,{className:`size-3.5`}),`Unlocked, `,H(l),` left`]}),(0,Q.jsx)(F,{variant:`outline`,className:`h-11 md:h-8`,onClick:s.onLock,children:`Lock now`})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-panel-2 px-2 py-1 text-text-secondary`,children:[(0,Q.jsx)(y,{className:`size-3.5`}),`Locked`]}),(0,Q.jsx)(F,{variant:`outline`,className:`h-11 md:h-8`,onClick:s.onUnlock,children:`Unlock for 5 minutes`})]})),e===`sealed`&&(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:`Asks for its password at every action.`}),u>0&&(0,Q.jsxs)(`span`,{className:`text-error`,"data-vault-locked-out":``,children:[`Too many wrong passwords — try again in `,Math.ceil(u/1e3),` s.`]})]}),(0,Q.jsxs)(`div`,{className:`divide-y divide-border rounded-lg border border-border`,children:[n.length===0&&(0,Q.jsx)(`p`,{className:`px-4 py-3 text-xs text-muted-foreground`,children:`No items yet.`}),n.map(e=>(0,Q.jsx)(de,{item:e,revealed:r?.id===e.id?r:null,onShow:()=>s.onShow(e),onHide:s.onHide,onEdit:()=>s.onEdit(e),onMove:()=>s.onMove(e),onDelete:()=>s.onDelete(e),onAddFile:()=>s.onAddFile(e),fileActions:s.fileActions},e.id))]}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Q.jsxs)(F,{className:`h-11 md:h-9`,onClick:s.onAdd,children:[(0,Q.jsx)(f,{className:`size-4`}),`Add`]}),(0,Q.jsxs)(F,{variant:`outline`,className:`h-11 md:h-9`,onClick:s.onChangePassword,children:[(0,Q.jsx)(d,{className:`size-4`}),`Change password`]}),(0,Q.jsxs)(F,{variant:`outline`,className:`h-11 md:h-9 text-error`,onClick:s.onDeleteTier,children:[(0,Q.jsx)(o,{className:`size-4`}),`Delete tier`]})]})]}):(0,Q.jsxs)(`section`,{className:`space-y-3`,"data-vault-tier":e,children:[(0,Q.jsx)(Y,{title:c,children:pe[e]}),(0,Q.jsxs)(F,{className:`h-11 md:h-9`,onClick:s.onEnable,children:[(0,Q.jsx)(y,{className:`size-4`}),`Turn on`]})]})}function he({prompt:e,onClose:t}){let[n,r]=(0,Z.useState)(``),[i,a]=(0,Z.useState)(!1),[o,s]=(0,Z.useState)(!1),[c,l]=(0,Z.useState)(null),[u,d]=(0,Z.useState)(!1),f=q(!!c?.lockedUntil);if((0,Z.useEffect)(()=>{r(``),a(!1),l(null),d(e?.askPassword??!1)},[e]),!e)return null;let p=(c?.lockedUntil??0)>f,m=!o&&!p&&(!u||n.length>0)&&(!e.acknowledge||i),h=async()=>{if(m){s(!0),l(null);try{await e.run(u?n:void 0),t()}catch(t){let n=R(t);n.needsPassword&&e.tier&&d(!0),l(n)}finally{s(!1)}}},g=c?K(c,f):null;return(0,Q.jsx)(J,{open:!0,onClose:()=>{o||t()},title:e.title,description:e.description,footer:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(F,{variant:`outline`,disabled:o,onClick:t,children:`Cancel`}),(0,Q.jsx)(F,{variant:e.danger?`destructive`:`default`,disabled:!m,onClick:()=>void h(),children:e.confirmLabel})]}),children:(0,Q.jsxs)(`form`,{className:`space-y-3`,onSubmit:e=>{e.preventDefault(),h()},children:[u&&e.tier&&(0,Q.jsx)(G,{label:`${P[e.tier]} tier password`,value:n,onChange:r,disabled:o,invalid:!!c}),e.acknowledge&&(0,Q.jsx)(B,{checked:i,onChange:a,disabled:o,dataAttr:`acknowledge`,children:e.acknowledge}),c&&(0,Q.jsxs)(`p`,{className:`text-xs text-error`,role:`alert`,children:[c.message,g&&` ${g}`]})]})})}function ge({edit:e,onClose:t,onDone:n}){let[r,i]=(0,Z.useState)(``),[a,o]=(0,Z.useState)(`other`),[s,c]=(0,Z.useState)(``),[l,u]=(0,Z.useState)(``),[d,f]=(0,Z.useState)(``),[p,m]=(0,Z.useState)(!1),[h,g]=(0,Z.useState)(!1),[_,v]=(0,Z.useState)(null),y=q(!!_?.lockedUntil);if((0,Z.useEffect)(()=>{i(e?.item?.name??``),o(e?.item?.kind??`other`),c(e?.value??``),u(``),f(``),m(e?.askPassword??!1),v(null)},[e]),!e)return null;let{tier:b,item:x}=e,S=b!==`public`,C=(_?.lockedUntil??0)>y,w=!h&&!C&&r.trim().length>0&&(x?!0:s.length>0)&&(!p||d.length>0),T=_?K(_,y):null,E=async()=>{if(!w)return;g(!0),v(null);let e=p?d:void 0;try{x?await V.updateItem(x.id,{name:r.trim(),kind:a,...s?{value:s}:{},...l?{note:l}:{}},e):await V.addItem({tier:b,name:r.trim(),kind:a,value:s,...l?{note:l}:{},password:e}),n(),t()}catch(e){let t=R(e);t.needsPassword&&S&&m(!0),v(t)}finally{g(!1)}};return(0,Q.jsx)(J,{open:!0,onClose:()=>{h||t()},title:`${x?`Edit`:`Add`} ${P[b]} item`,footer:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(F,{variant:`outline`,disabled:h,onClick:t,children:`Cancel`}),(0,Q.jsx)(F,{disabled:!w,onClick:()=>void E(),children:x?`Save`:`Add`})]}),children:(0,Q.jsxs)(`form`,{className:`space-y-3`,onSubmit:e=>{e.preventDefault(),E()},children:[b===`public`&&(0,Q.jsx)(W,{}),(0,Q.jsx)(z,{value:r,onChange:i,disabled:h}),b===`public`&&O(r)&&(0,Q.jsx)(ie,{}),(0,Q.jsx)(U,{value:a,onChange:o,disabled:h}),(0,Q.jsx)(ae,{value:s,onChange:c,disabled:h,masked:S,placeholder:x&&S?`New value (leave empty to keep the current one)`:`Value`}),(0,Q.jsx)(L,{"aria-label":`Note`,placeholder:x?`Note (leave empty to keep)`:`Note (optional)`,autoComplete:`off`,value:l,onChange:e=>u(e.target.value),disabled:h,className:`h-11 md:h-9`}),p&&S&&(0,Q.jsx)(G,{label:`${P[b]} tier password`,value:d,onChange:f,disabled:h,invalid:!!_}),_&&(0,Q.jsxs)(`p`,{className:`text-xs text-error`,role:`alert`,children:[_.message,T&&` ${T}`]})]})})}function _e({move:e,onClose:t,onDone:n}){let[r,i]=(0,Z.useState)(`secure`),[a,o]=(0,Z.useState)({}),[s,c]=(0,Z.useState)(!1),[l,u]=(0,Z.useState)(!1),[d,f]=(0,Z.useState)(null),p=q(!!d?.lockedUntil),m=t=>!!e&&t!==e.item.tier&&(t===`public`||e.enabled[t]);if((0,Z.useEffect)(()=>{i(w.find(m)??`public`),o({}),c(!1),f(null)},[e]),!e)return null;let h=[e.item.tier,r].filter(S).filter(t=>t===`sealed`||!e.secureOpen||s),g=(d?.lockedUntil??0)>p,_=!l&&!g&&m(r)&&h.every(e=>!!a[e]),v=d?K(d,p):null,y=async()=>{if(_){u(!0),f(null);try{let i={};for(let e of h)i[e]=a[e];await V.move(e.item.id,r,i),n(),t()}catch(e){let t=R(e);t.needsPassword&&c(!0),f(t)}finally{u(!1)}}};return(0,Q.jsx)(J,{open:!0,onClose:()=>{l||t()},title:`Move “${e.item.name}”`,description:`Now in the ${P[e.item.tier]} tier.`,footer:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(F,{variant:`outline`,disabled:l,onClick:t,children:`Cancel`}),(0,Q.jsx)(F,{disabled:!_,onClick:()=>void y(),children:`Move`})]}),children:(0,Q.jsxs)(`form`,{className:`space-y-3`,onSubmit:e=>{e.preventDefault(),y()},children:[(0,Q.jsx)(re,{value:r,onChange:i,enabled:m,disabled:l}),r===`public`&&(0,Q.jsx)(W,{}),h.map(e=>(0,Q.jsx)(G,{label:`${P[e]} tier password`,value:a[e]??``,onChange:t=>o(n=>({...n,[e]:t})),disabled:l,invalid:!!d},e)),d&&(0,Q.jsxs)(`p`,{className:`text-xs text-error`,role:`alert`,children:[d.message,v&&` ${v}`]})]})})}var ve=[`Too short`,`Weak`,`Fair`,`Good`,`Strong`];function ye(e,t){let n=[...e].length;if(n<t)return{score:0,label:ve[0]};let r=[/[a-z]/,/[A-Z]/,/\d/,/[^A-Za-z0-9]/].filter(t=>t.test(e)).length,i=new Set(e).size,a=1;(n>=t+4||r>=3)&&a++,n>=t*1.5&&r>=2&&a++,(n>=t*2||n>=t+4&&r>=4)&&a++,i<Math.min(6,n/2)&&(a=1);let o=Math.min(4,a);return{score:o,label:ve[o]}}var be=[`bg-error`,`bg-error`,`bg-warning`,`bg-success`,`bg-success`];function xe(e,t,n){let r=A[e];return[...t].length<r?`At least ${r} characters.`:t===n?null:`The two passwords differ.`}function Se({tier:e,password:t,confirm:n,onPassword:r,onConfirm:i,disabled:a,label:o=`New password`}){let s=A[e],c=ye(t,s),l=n.length>0&&n!==t;return(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsx)(L,{type:`password`,autoComplete:`new-password`,spellCheck:!1,"aria-label":o,placeholder:o,value:t,onChange:e=>r(e.target.value),disabled:a,className:`h-11 md:h-9`}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,"data-vault-strength":c.score,children:[(0,Q.jsx)(`div`,{className:`flex flex-1 gap-1`,"aria-hidden":!0,children:[1,2,3,4].map(e=>(0,Q.jsx)(`span`,{className:x(`h-1.5 flex-1 rounded-full`,t&&c.score>=e?be[c.score]:`bg-panel-2`)},e))}),(0,Q.jsx)(`span`,{className:`w-20 text-right text-[11px] text-text-subtle`,children:t?c.label:`${s}+ characters`})]}),(0,Q.jsx)(L,{type:`password`,autoComplete:`new-password`,spellCheck:!1,"aria-label":`Type it again`,placeholder:`Type it again`,value:n,onChange:e=>i(e.target.value),disabled:a,"aria-invalid":l,className:`h-11 md:h-9`}),l&&(0,Q.jsx)(`p`,{className:`text-[11px] text-error`,children:`The two passwords differ.`})]})}function Ce(){return(0,Q.jsx)(`p`,{className:`rounded-md border border-error/50 bg-error/10 p-2 text-xs font-medium text-error`,"data-vault-forget-warning":``,children:`Forget this password and every item in this tier is lost for good; PPM cannot recover it.`})}function we({tier:e,onClose:t,onDone:n}){let[r,i]=(0,Z.useState)(``),[a,o]=(0,Z.useState)(``),[s,c]=(0,Z.useState)(!1),[l,u]=(0,Z.useState)(!1),[d,f]=(0,Z.useState)(null);if((0,Z.useEffect)(()=>{i(``),o(``),c(!1),f(null)},[e]),!e)return null;let p=xe(e,r,a),m=!l&&!p&&s,h=async()=>{if(m){u(!0),f(null);try{await V.enableTier(e,r),n(),t()}catch(e){f(R(e).message)}finally{u(!1)}}};return(0,Q.jsx)(J,{open:!0,onClose:()=>{l||t()},title:`Turn on the ${P[e]} tier`,description:e===`secure`?`Items here are encrypted. The AI reads them only after you type this password on a card.`:`Items here are encrypted under a second password. One item per card, shown to you unless you give it to the AI.`,footer:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(F,{variant:`outline`,disabled:l,onClick:t,children:`Cancel`}),(0,Q.jsx)(F,{disabled:!m,onClick:()=>void h(),children:`Turn on`})]}),children:(0,Q.jsxs)(`form`,{className:`space-y-3`,onSubmit:e=>{e.preventDefault(),h()},children:[(0,Q.jsx)(Se,{tier:e,password:r,confirm:a,onPassword:i,onConfirm:o,disabled:l,label:`${P[e]} tier password`}),e===`sealed`&&(0,Q.jsx)(`p`,{className:`text-xs text-text-secondary`,children:`This password must differ from the Secure tier's password.`}),(0,Q.jsx)(Ce,{}),(0,Q.jsx)(B,{checked:s,onChange:c,disabled:l,dataAttr:`forget-ack`,children:`I understand that PPM cannot recover this password or the items under it.`}),d&&(0,Q.jsx)(`p`,{className:`text-xs text-error`,role:`alert`,children:d})]})})}function Te({tier:e,onClose:t,onDone:n}){let[r,i]=(0,Z.useState)(``),[a,o]=(0,Z.useState)(``),[s,c]=(0,Z.useState)(``),[l,u]=(0,Z.useState)(!1),[d,f]=(0,Z.useState)(null),p=q(!!d?.lockedUntil);if((0,Z.useEffect)(()=>{i(``),o(``),c(``),f(null)},[e]),!e)return null;let m=(d?.lockedUntil??0)>p,h=!l&&!m&&r.length>0&&!xe(e,a,s),g=d?K(d,p):null,_=async()=>{if(h){u(!0),f(null);try{await V.changePassword(e,r,a),n(),t()}catch(e){f(R(e))}finally{u(!1)}}};return(0,Q.jsx)(J,{open:!0,onClose:()=>{l||t()},title:`Change the ${P[e]} tier password`,footer:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(F,{variant:`outline`,disabled:l,onClick:t,children:`Cancel`}),(0,Q.jsx)(F,{disabled:!h,onClick:()=>void _(),children:`Change password`})]}),children:(0,Q.jsxs)(`form`,{className:`space-y-3`,onSubmit:e=>{e.preventDefault(),_()},children:[(0,Q.jsx)(G,{label:`Current password`,value:r,onChange:i,disabled:l,invalid:!!d}),(0,Q.jsx)(Se,{tier:e,password:a,confirm:s,onPassword:o,onConfirm:c,disabled:l}),e===`sealed`&&(0,Q.jsx)(`p`,{className:`text-xs text-text-secondary`,children:`The new password must differ from the Secure tier's password.`}),(0,Q.jsx)(Ce,{}),d&&(0,Q.jsxs)(`p`,{className:`text-xs text-error`,role:`alert`,children:[d.message,g&&` ${g}`]})]})})}var Ee=/^image\/(jpeg|png|webp)$/,$=e=>Ee.test(e);function De(e,t,n=E){let r=Math.max(e,t);return r>n?n/r:1}async function Oe(e,t=E){if(!$(e.type))return{blob:e,name:e.name};let n=await createImageBitmap(e,{imageOrientation:`from-image`});try{let r=De(n.width,n.height,t),i=document.createElement(`canvas`);i.width=Math.max(1,Math.round(n.width*r)),i.height=Math.max(1,Math.round(n.height*r));let a=i.getContext(`2d`);if(!a)throw Error(`This browser could not prepare the photo. Tick “Keep the original” to upload it as it is.`);a.drawImage(n,0,0,i.width,i.height);let o=e.type===`image/png`?`image/png`:`image/jpeg`,s=await new Promise(e=>i.toBlob(e,o,.88));if(!s)throw Error(`This browser could not prepare the photo. Tick “Keep the original” to upload it as it is.`);return{blob:s,name:`${e.name.replace(/\.[^.]+$/,``)||`photo`}.${o===`image/png`?`png`:`jpg`}`}}finally{n.close()}}function ke({upload:e,onClose:t,onDone:n}){let[r,i]=(0,Z.useState)(null),[a,o]=(0,Z.useState)(``),[s,c]=(0,Z.useState)(!1),[l,u]=(0,Z.useState)(``),[d,f]=(0,Z.useState)(!1),[p,m]=(0,Z.useState)(!1),[h,_]=(0,Z.useState)(null),v=(0,Z.useRef)(null),y=q(!!h?.lockedUntil);if((0,Z.useEffect)(()=>{i(null),o(``),c(!1),u(``),f(e?.askPassword??!1),_(null)},[e]),!e)return null;let{item:b}=e,x=P[b.tier],S=(b.attachments?.length??0)>=10,w=(h?.lockedUntil??0)>y,T=!p&&!w&&!S&&!!r&&(!d||l.length>0),E=h?K(h,y):null,D=!!r&&(s||!$(r.type))&&r.size>10485760,O=async()=>{if(!(!T||!r||D)){m(!0),_(null);try{let e=s?{blob:r,name:r.name}:await Oe(r);await V.uploadFile(b.id,e.blob,e.name,{label:a.trim()||void 0,password:d?l:void 0}),n(),t()}catch(e){let t=R(e);t.needsPassword&&f(!0),_(t)}finally{m(!1)}}};return(0,Q.jsx)(J,{open:!0,onClose:()=>{p||t()},title:`Attach a file to “${b.name}”`,description:`Encrypted under the ${x} tier's key. Only you can open it, in PPM; no AI reads it.`,footer:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(F,{variant:`outline`,disabled:p,onClick:t,children:`Cancel`}),(0,Q.jsx)(F,{disabled:!T||D,onClick:()=>void O(),children:p?`Uploading…`:`Attach`})]}),children:(0,Q.jsxs)(`form`,{className:`space-y-3`,onSubmit:e=>{e.preventDefault(),O()},"data-vault-upload":``,children:[(0,Q.jsx)(`input`,{ref:v,type:`file`,accept:C.join(`,`),className:`sr-only`,"aria-label":`Choose a photo or PDF`,"data-vault-upload-input":``,onChange:e=>{i(e.target.files?.[0]??null),_(null),e.target.value=``}}),(0,Q.jsxs)(`button`,{type:`button`,disabled:p||S,onClick:()=>v.current?.click(),className:`flex min-h-20 w-full flex-col items-center justify-center gap-1 rounded-lg border border-dashed border-border px-3 py-3 text-center text-sm text-text-secondary can-hover:hover:bg-panel-2 disabled:opacity-50`,children:[(0,Q.jsx)(g,{className:`size-5`}),r?(0,Q.jsxs)(`span`,{className:`max-w-full truncate text-text-primary`,"data-vault-upload-chosen":``,children:[r.name,` · `,N(r.size)]}):(0,Q.jsx)(`span`,{children:`Choose a photo or PDF`}),(0,Q.jsxs)(`span`,{className:`text-[11px] text-text-subtle`,children:[`JPEG, PNG, WebP or PDF · up to `,M/(1024*1024),` MB · `,10,` per item`]})]}),S&&(0,Q.jsxs)(`p`,{className:`text-xs text-error`,children:[`This item already holds `,10,` files.`]}),(0,Q.jsx)(L,{"aria-label":`Label`,placeholder:`Label, e.g. Passport photo page (optional)`,autoComplete:`off`,maxLength:120,value:a,disabled:p,onChange:e=>o(e.target.value),className:`h-11 md:h-9`}),(0,Q.jsx)(`p`,{className:`text-[11px] text-text-subtle`,children:`The label is what lists and the AI see. The file's own name stays encrypted with the file.`}),r&&$(r.type)&&(0,Q.jsxs)(B,{checked:s,onChange:c,disabled:p,dataAttr:`keep-original`,children:[`Keep the original. Otherwise the photo is shrunk to `,2e3.toLocaleString(),` px and its EXIF (location, phone model) is removed before upload.`]}),D&&(0,Q.jsxs)(`p`,{className:`text-xs text-error`,children:[`This file is larger than `,10485760/(1024*1024),` MB.`]}),d&&(0,Q.jsx)(G,{label:`${x} tier password`,value:l,onChange:u,disabled:p,invalid:!!h}),h&&(0,Q.jsxs)(`p`,{className:`text-xs text-error`,role:`alert`,children:[h.message,E&&` ${E}`]})]})})}var Ae=e(r(),1);function je(e,t){let n=URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=t,r.rel=`noopener`,document.body.appendChild(r),r.click(),r.remove(),setTimeout(()=>URL.revokeObjectURL(n),1e4)}function Me({view:e,onClose:t}){let n=q(!!e),[r,i]=(0,Z.useState)(null),a=e?.blob??null;(0,Z.useEffect)(()=>{if(!a)return;let e=URL.createObjectURL(a);return i(e),()=>{URL.revokeObjectURL(e),i(null)}},[a]),(0,Z.useEffect)(()=>{e&&n>=e.until&&t()},[e,n,t]),(0,Z.useEffect)(()=>{if(!e)return;let n=e=>{e.key===`Escape`&&t()};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t]);let o=e?.file.type===`application/pdf`,s=(0,Z.useMemo)(()=>!e||!r?null:o?(0,Q.jsx)(`iframe`,{title:e.file.label,src:r,className:`h-full w-full border-0 bg-white`,"data-vault-viewer-pdf":``}):(0,Q.jsx)(`img`,{src:r,alt:e.file.label,className:`max-h-full max-w-full object-contain`,"data-vault-viewer-image":``}),[e,r,o]);return e?(0,Ae.createPortal)((0,Q.jsxs)(`div`,{className:`fixed inset-0 z-[100] flex flex-col bg-black/95 text-white`,role:`dialog`,"aria-modal":`true`,"aria-label":e.file.label,"data-vault-viewer":``,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-white/10 px-3 py-2`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`p`,{className:`truncate text-sm font-medium`,children:e.file.label}),(0,Q.jsxs)(`p`,{className:`text-[11px] text-white/60`,children:[j[e.file.type],` · `,N(e.file.size)]})]}),(0,Q.jsx)(`span`,{className:`font-mono text-xs text-white/70`,"data-vault-viewer-countdown":``,children:H(e.until-n)}),(0,Q.jsx)(`button`,{type:`button`,onClick:t,"aria-label":`Close`,className:`inline-flex size-11 items-center justify-center rounded-lg can-hover:hover:bg-white/10`,children:(0,Q.jsx)(m,{className:`size-5`})})]}),(0,Q.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center p-2`,children:s}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-t border-white/10 px-3 py-2 pb-[max(0.5rem,env(safe-area-inset-bottom))]`,children:[(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>je(e.blob,e.fileName),className:`inline-flex h-11 items-center gap-2 rounded-lg border border-white/20 px-4 text-sm can-hover:hover:bg-white/10`,children:[(0,Q.jsx)(u,{className:`size-4`}),`Download`]}),(0,Q.jsx)(`p`,{className:`ml-auto text-[11px] text-white/60`,children:`Shown on this device only. No AI sees it; nothing is kept in the browser.`})]})]}),document.body):null}function Ne({file:e,onClose:t,onRename:n}){let[r,i]=(0,Z.useState)(e.label),a=r.trim(),o=a.length>0&&a!==e.label,s=()=>{o&&(t(),n(a))};return(0,Q.jsx)(J,{open:!0,onClose:t,title:`Rename file`,description:`The label is what lists and the AI see. Do not put a secret in it.`,footer:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(F,{variant:`outline`,onClick:t,children:`Cancel`}),(0,Q.jsx)(F,{disabled:!o,onClick:s,children:`Rename`})]}),children:(0,Q.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),s()},children:(0,Q.jsx)(L,{"aria-label":`Label`,autoFocus:!0,autoComplete:`off`,maxLength:120,value:r,onChange:e=>i(e.target.value),className:`h-11 md:h-9`})})})}var Pe=[`ring-2`,`ring-primary`,`rounded-md`];function Fe(){let{data:e,error:t,refresh:n}=se(),[r,i]=(0,Z.useState)(null),[a,o]=(0,Z.useState)(null),[s,c]=(0,Z.useState)(null),[l,u]=(0,Z.useState)(null),[d,f]=(0,Z.useState)(null),[p,m]=(0,Z.useState)(null),[h,g]=(0,Z.useState)(null),[_,v]=(0,Z.useState)(null),[y,x]=(0,Z.useState)(null),S=q(!!e),C=(0,Z.useCallback)(()=>m(null),[]),w=(0,Z.useCallback)(()=>v(null),[]),E=ne(e=>e.itemId),[O,k]=(0,Z.useState)(null),A=!!e;if((0,Z.useEffect)(()=>{!A||!E||(ne.getState().clear(),k(E))},[A,E]),(0,Z.useEffect)(()=>{if(!O)return;let e=document.querySelector(`[data-vault-item="${CSS.escape(O)}"]`);if(!e){k(null);return}e.scrollIntoView({block:`center`,behavior:`smooth`}),e.classList.add(...Pe);let t=setTimeout(()=>k(null),4e3);return()=>{clearTimeout(t),e.classList.remove(...Pe)}},[O]),!e)return(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t??`Loading…`});let{status:j,items:M}=e,N=j.tiers.secure.settingsOpenUntil>S,F=e=>e===`sealed`||!N,I=()=>void n(),L=(e,t,n)=>{let r=async e=>{try{await t.run(e)}finally{I()}},a={...t,tier:e,run:r};if(e&&!n&&!F(e)){r(void 0).catch(e=>{let t=R(e);t.needsPassword?i({...a,askPassword:!0}):b.error(t.message)});return}i({...a,askPassword:e!==null&&F(e)})},z=e=>L(e.tier===`public`?null:e.tier,{title:`Delete “${e.name}”?`,description:`Deleted items stay in older backups until they expire.`,confirmLabel:`Delete`,danger:!0,run:async t=>{await V.deleteItem(e.id,t)}},!0),B=e=>c({item:e,enabled:{secure:j.tiers.secure.enabled,sealed:j.tiers.sealed.enabled},secureOpen:N}),H=e=>({onPreview:t=>L(e,{title:`Open “${t.label}”`,description:`Shown on this device for ${D/1e3} seconds. No AI sees it.`,confirmLabel:`Open`,run:async e=>{let{blob:n,fileName:r}=await V.openFile(t.id,{password:e});v({file:t,blob:n,fileName:r,until:Date.now()+D})}},!1),onDownload:t=>L(e,{title:`Download “${t.label}”`,description:`The file is saved decrypted to this device's downloads.`,confirmLabel:`Download`,run:async e=>{let{blob:n,fileName:r}=await V.openFile(t.id,{password:e,download:!0});je(n,r)}},e===`sealed`),onRename:e=>x(e),onDelete:t=>L(e,{title:`Delete “${t.label}”?`,description:`Deleted files stay in older backups until they expire.`,confirmLabel:`Delete`,danger:!0,run:async e=>{await V.deleteFile(t.id,e)}},!0)}),U=e=>({onEnable:()=>u(e),onAdd:()=>o({tier:e,askPassword:F(e)}),onShow:t=>L(e,{title:`Show “${t.name}”`,description:`Shown here for ${le/1e3} seconds.`,confirmLabel:`Show`,run:async e=>{let n=await V.reveal(t.id,e);m({id:t.id,value:n.value,until:Date.now()+le})}},!1),onHide:C,onEdit:t=>o({tier:e,item:t,askPassword:F(e)}),onMove:B,onDelete:z,onAddFile:t=>g({item:{...t,tier:e},askPassword:F(e)}),fileActions:H(e),onChangePassword:()=>f(e),onDeleteTier:()=>i({tier:e,askPassword:!0,title:`Delete the ${P[e]} tier?`,description:`The tier is turned off and every item and file in it is deleted. ${ee}`,confirmLabel:`Delete tier`,danger:!0,acknowledge:`Delete all ${j.tiers[e].itemCount} item${j.tiers[e].itemCount===1?``:`s`} in this tier for good.`,run:async t=>{try{await V.deleteTier(e,t??``)}finally{I()}}}),...e===`secure`?{onUnlock:()=>i({tier:e,askPassword:!0,title:`Unlock the Secure tier`,description:`Settings keeps it open for five minutes.`,confirmLabel:`Unlock`,run:async e=>{try{await V.unlockSecure(e??``)}finally{I()}}}),onLock:()=>{m(null),V.lock(`secure`).then(I,e=>b.error(R(e).message))}}:{}});return(0,Q.jsxs)(`div`,{className:`space-y-6`,children:[(0,Q.jsxs)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:[`Personal details the AI may need, kept in three tiers. The Secure and Sealed tiers are encrypted under passwords of their own, separate from PPM's password; neither password is stored, and a restart locks both. Deleted items stay in older backups until they expire.`,` `,te]}),(0,Q.jsx)(fe,{items:M.filter(e=>e.tier===`public`),values:e.publicValues,onAdd:()=>o({tier:`public`,askPassword:!1}),onEdit:t=>o({tier:`public`,item:t,value:e.publicValues[t.id],askPassword:!1}),onMove:B,onDelete:z}),T.map(e=>(0,Q.jsx)(me,{tier:e,status:j.tiers[e],items:M.filter(t=>t.tier===e),revealed:p,now:S,actions:U(e)},e)),(0,Q.jsx)(he,{prompt:r,onClose:()=>i(null)}),(0,Q.jsx)(ge,{edit:a,onClose:()=>o(null),onDone:I}),(0,Q.jsx)(_e,{move:s,onClose:()=>c(null),onDone:I}),(0,Q.jsx)(we,{tier:l,onClose:()=>u(null),onDone:I}),(0,Q.jsx)(Te,{tier:d,onClose:()=>f(null),onDone:I}),(0,Q.jsx)(ke,{upload:h,onClose:()=>g(null),onDone:I}),(0,Q.jsx)(Me,{view:_,onClose:w}),y&&(0,Q.jsx)(Ne,{file:y,onClose:()=>x(null),onRename:e=>{let t=M.find(e=>e.id===y.itemId)?.tier;!t||t===`public`||L(t,{title:`Rename “${y.label}”`,confirmLabel:`Rename`,run:async t=>{await V.renameFile(y.id,e,t)}},!1)}})]})}export{Fe as VaultSettingsSection};
|
|
1
|
+
import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-26eoXJk7.js";import{yt as r}from"./vendor-ui-BQzUk4nq.js";import{Ar as i,Et as a,Xr as o,_t as s,d as c,er as l,ht as u,ln as d,lr as f,nr as p,pi as m,rn as h,ti as g,ut as _,vt as v,wn as y}from"./icons-CpR5Vw3J.js";import{j as b}from"./api-client-DSCscZEd.js";import{n as x}from"./utils-DMiycH3O.js";import"./portal-container-context-C84rlnJ6.js";import"./mobile-bottom-sheet-C78UMLrn.js";import"./use-visual-viewport-tMLO63yY.js";import"./use-is-mobile-CrfIt67b.js";import{D as S,a as C,b as w,f as T,g as E,i as D,k as O,l as k,m as A,n as ee,o as j,r as M,s as te,w as N,x as P}from"./vault-Q5oPy0h3.js";import{t as ne}from"./vault-focus-store-BYABW4-C.js";import{t as F}from"./button-CtdEWN7U.js";import"./dialog-BWXzvHlC.js";import{r as I}from"./clipboard-DQuoK2EM.js";import{t as L}from"./input-CCVoN0-P.js";import"./design-canvas-check-DahR87XO.js";import"./tab-open-protocol-2j23y-fq.js";import"./vault-tool-call-DZB6P-R4.js";import{_ as R,a as z,f as B,g as V,h as H,i as U,n as W,o as re,p as G,r as ie,s as ae,t as oe,v as K,y as q}from"./vault-fields-8WmUiC7P.js";import{t as J}from"./design-responsive-dialog-Ccf_PhuE.js";import{n as Y,t as X}from"./settings-rows-Bb4STWcn.js";var Z=e(t(),1);function se(){let[e,t]=(0,Z.useState)(null),[n,r]=(0,Z.useState)(null),i=(0,Z.useCallback)(async()=>{try{let[e,n]=await Promise.all([V.status(),V.items()]),i=n.filter(e=>e.tier===`public`),a=await Promise.all(i.map(e=>V.reveal(e.id).then(t=>[e.id,t.value])));t({status:e,items:n,publicValues:Object.fromEntries(a)}),r(null)}catch(e){r(R(e).message)}},[]);return(0,Z.useEffect)(()=>{i()},[i]),{data:e,error:n,refresh:i}}var Q=n();function ce({files:e,actions:t}){return e.length?(0,Q.jsx)(`ul`,{className:`mt-2 space-y-1.5`,"data-vault-files":``,children:e.map(e=>(0,Q.jsxs)(`li`,{className:`flex items-center gap-2 rounded-lg border border-border bg-panel-2/60 py-1 pl-2 pr-1`,"data-vault-file":e.id,children:[(0,Q.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-md bg-panel-2 text-text-secondary`,"aria-hidden":!0,children:e.type===`application/pdf`?(0,Q.jsx)(a,{className:`size-4`}):(0,Q.jsx)(h,{className:`size-4`})}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`p`,{className:`truncate text-sm`,children:e.label}),(0,Q.jsxs)(`p`,{className:`text-[11px] text-muted-foreground`,children:[j[e.type],` · `,N(e.size)]})]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0`,children:[(0,Q.jsx)(X,{label:`Preview ${e.label}`,onClick:()=>t.onPreview(e),children:(0,Q.jsx)(s,{className:`size-4`})}),(0,Q.jsx)(X,{label:`Download ${e.label}`,onClick:()=>t.onDownload(e),children:(0,Q.jsx)(u,{className:`size-4`})}),(0,Q.jsx)(X,{label:`Rename ${e.label}`,onClick:()=>t.onRename(e),children:(0,Q.jsx)(p,{className:`size-4`})}),(0,Q.jsx)(X,{label:`Delete ${e.label}`,danger:!0,onClick:()=>t.onDelete(e),children:(0,Q.jsx)(o,{className:`size-4`})})]})]},e.id))}):null}var le=3e4,ue=e=>new Date(e).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`});function de({item:e,publicValue:t,revealed:n,onShow:r,onHide:i,onEdit:a,onMove:u,onDelete:d,onAddFile:f,fileActions:m}){let h=q(!!n),[g,y]=(0,Z.useState)(!1),b=!!n&&n.until>h;(0,Z.useEffect)(()=>{n&&n.until<=h&&i?.()},[n,h,i]),(0,Z.useEffect)(()=>y(!1),[n]);let x=t??(b?n.value:null);return(0,Q.jsxs)(`div`,{className:`px-4 py-2`,"data-vault-item":e.id,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1 md:flex-row md:items-start md:gap-3`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsxs)(`p`,{className:`truncate text-sm`,children:[e.name,` `,(0,Q.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`· `,k[e.kind]]}),!!e.attachments?.length&&(0,Q.jsxs)(`span`,{className:`ml-1 inline-flex items-center gap-0.5 text-xs text-muted-foreground`,"data-vault-file-count":``,children:[`· `,(0,Q.jsx)(l,{className:`size-3`}),e.attachments.length]})]}),(0,Q.jsxs)(`p`,{className:`text-[11px] text-muted-foreground`,children:[`Updated `,ue(e.updatedAt)]})]}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-1 md:shrink-0`,children:[x!==null&&(0,Q.jsx)(X,{label:g?`Copied`:`Copy`,onClick:()=>void I(x).then(y),children:(0,Q.jsx)(_,{className:`size-4`})}),r&&(b?(0,Q.jsx)(X,{label:`Hide`,onClick:()=>i?.(),children:(0,Q.jsx)(v,{className:`size-4`})}):(0,Q.jsx)(X,{label:`Show`,onClick:r,children:(0,Q.jsx)(s,{className:`size-4`})})),(0,Q.jsx)(X,{label:`Edit`,onClick:a,children:(0,Q.jsx)(p,{className:`size-4`})}),f&&(0,Q.jsx)(X,{label:`Attach a photo or PDF`,onClick:f,children:(0,Q.jsx)(l,{className:`size-4`})}),(0,Q.jsx)(X,{label:`Move to another tier`,onClick:u,children:(0,Q.jsx)(c,{className:`size-4`})}),(0,Q.jsx)(X,{label:`Delete`,danger:!0,onClick:d,children:(0,Q.jsx)(o,{className:`size-4`})})]})]}),x!==null&&(0,Q.jsxs)(`div`,{className:`mt-1 flex items-start gap-2`,children:[(0,Q.jsx)(`code`,{className:`block max-h-60 min-w-0 flex-1 select-text overflow-auto whitespace-pre-wrap break-all rounded bg-panel-2 px-2 py-1 font-mono text-xs`,"data-vault-value":``,children:x}),b&&(0,Q.jsx)(`span`,{className:`shrink-0 pt-1 font-mono text-[11px] text-muted-foreground`,children:H(n.until-h)})]}),m&&e.attachments?.length?(0,Q.jsx)(ce,{files:e.attachments,actions:m}):null]})}function fe({items:e,values:t,onAdd:n,onEdit:r,onMove:i,onDelete:a}){return(0,Q.jsxs)(`section`,{className:`space-y-3`,"data-vault-tier":`public`,children:[(0,Q.jsx)(Y,{title:`Public`,children:oe}),(0,Q.jsxs)(`div`,{className:`divide-y divide-border rounded-lg border border-border`,children:[e.length===0&&(0,Q.jsx)(`p`,{className:`px-4 py-3 text-xs text-muted-foreground`,children:`No items yet.`}),e.map(e=>(0,Q.jsx)(de,{item:e,publicValue:t[e.id]??``,onEdit:()=>r(e),onMove:()=>i(e),onDelete:()=>a(e)},e.id))]}),(0,Q.jsxs)(F,{className:`h-11 md:h-9`,onClick:n,children:[(0,Q.jsx)(f,{className:`size-4`}),`Add`]})]})}var pe={secure:`Encrypted under its own password. The AI reads an item only after you type that password on a card in PPM, once or for a few minutes.`,sealed:`Encrypted under a second, separate password and never kept open. One item per card, shown to you unless you give it to the AI that once.`};function me({tier:e,status:t,items:n,revealed:r,now:a,actions:s}){let c=P[e],l=t.settingsOpenUntil-a,u=t.lockedUntil-a;return t.enabled?(0,Q.jsxs)(`section`,{className:`space-y-3`,"data-vault-tier":e,children:[(0,Q.jsx)(Y,{title:c,children:pe[e]}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs`,children:[e===`secure`&&(l>0?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-success/15 px-2 py-1 text-success`,"data-vault-unlocked":``,children:[(0,Q.jsx)(i,{className:`size-3.5`}),`Unlocked, `,H(l),` left`]}),(0,Q.jsx)(F,{variant:`outline`,className:`h-11 md:h-8`,onClick:s.onLock,children:`Lock now`})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-panel-2 px-2 py-1 text-text-secondary`,children:[(0,Q.jsx)(y,{className:`size-3.5`}),`Locked`]}),(0,Q.jsx)(F,{variant:`outline`,className:`h-11 md:h-8`,onClick:s.onUnlock,children:`Unlock for 5 minutes`})]})),e===`sealed`&&(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:`Asks for its password at every action.`}),u>0&&(0,Q.jsxs)(`span`,{className:`text-error`,"data-vault-locked-out":``,children:[`Too many wrong passwords — try again in `,Math.ceil(u/1e3),` s.`]})]}),(0,Q.jsxs)(`div`,{className:`divide-y divide-border rounded-lg border border-border`,children:[n.length===0&&(0,Q.jsx)(`p`,{className:`px-4 py-3 text-xs text-muted-foreground`,children:`No items yet.`}),n.map(e=>(0,Q.jsx)(de,{item:e,revealed:r?.id===e.id?r:null,onShow:()=>s.onShow(e),onHide:s.onHide,onEdit:()=>s.onEdit(e),onMove:()=>s.onMove(e),onDelete:()=>s.onDelete(e),onAddFile:()=>s.onAddFile(e),fileActions:s.fileActions},e.id))]}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Q.jsxs)(F,{className:`h-11 md:h-9`,onClick:s.onAdd,children:[(0,Q.jsx)(f,{className:`size-4`}),`Add`]}),(0,Q.jsxs)(F,{variant:`outline`,className:`h-11 md:h-9`,onClick:s.onChangePassword,children:[(0,Q.jsx)(d,{className:`size-4`}),`Change password`]}),(0,Q.jsxs)(F,{variant:`outline`,className:`h-11 md:h-9 text-error`,onClick:s.onDeleteTier,children:[(0,Q.jsx)(o,{className:`size-4`}),`Delete tier`]})]})]}):(0,Q.jsxs)(`section`,{className:`space-y-3`,"data-vault-tier":e,children:[(0,Q.jsx)(Y,{title:c,children:pe[e]}),(0,Q.jsxs)(F,{className:`h-11 md:h-9`,onClick:s.onEnable,children:[(0,Q.jsx)(y,{className:`size-4`}),`Turn on`]})]})}function he({prompt:e,onClose:t}){let[n,r]=(0,Z.useState)(``),[i,a]=(0,Z.useState)(!1),[o,s]=(0,Z.useState)(!1),[c,l]=(0,Z.useState)(null),[u,d]=(0,Z.useState)(!1),f=q(!!c?.lockedUntil);if((0,Z.useEffect)(()=>{r(``),a(!1),l(null),d(e?.askPassword??!1)},[e]),!e)return null;let p=(c?.lockedUntil??0)>f,m=!o&&!p&&(!u||n.length>0)&&(!e.acknowledge||i),h=async()=>{if(m){s(!0),l(null);try{await e.run(u?n:void 0),t()}catch(t){let n=R(t);n.needsPassword&&e.tier&&d(!0),l(n)}finally{s(!1)}}},g=c?K(c,f):null;return(0,Q.jsx)(J,{open:!0,onClose:()=>{o||t()},title:e.title,description:e.description,footer:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(F,{variant:`outline`,disabled:o,onClick:t,children:`Cancel`}),(0,Q.jsx)(F,{variant:e.danger?`destructive`:`default`,disabled:!m,onClick:()=>void h(),children:e.confirmLabel})]}),children:(0,Q.jsxs)(`form`,{className:`space-y-3`,onSubmit:e=>{e.preventDefault(),h()},children:[u&&e.tier&&(0,Q.jsx)(G,{label:`${P[e.tier]} tier password`,value:n,onChange:r,disabled:o,invalid:!!c}),e.acknowledge&&(0,Q.jsx)(B,{checked:i,onChange:a,disabled:o,dataAttr:`acknowledge`,children:e.acknowledge}),c&&(0,Q.jsxs)(`p`,{className:`text-xs text-error`,role:`alert`,children:[c.message,g&&` ${g}`]})]})})}function ge({edit:e,onClose:t,onDone:n}){let[r,i]=(0,Z.useState)(``),[a,o]=(0,Z.useState)(`other`),[s,c]=(0,Z.useState)(``),[l,u]=(0,Z.useState)(``),[d,f]=(0,Z.useState)(``),[p,m]=(0,Z.useState)(!1),[h,g]=(0,Z.useState)(!1),[_,v]=(0,Z.useState)(null),y=q(!!_?.lockedUntil);if((0,Z.useEffect)(()=>{i(e?.item?.name??``),o(e?.item?.kind??`other`),c(e?.value??``),u(``),f(``),m(e?.askPassword??!1),v(null)},[e]),!e)return null;let{tier:b,item:x}=e,S=b!==`public`,C=(_?.lockedUntil??0)>y,w=!h&&!C&&r.trim().length>0&&(x?!0:s.length>0)&&(!p||d.length>0),T=_?K(_,y):null,E=async()=>{if(!w)return;g(!0),v(null);let e=p?d:void 0;try{x?await V.updateItem(x.id,{name:r.trim(),kind:a,...s?{value:s}:{},...l?{note:l}:{}},e):await V.addItem({tier:b,name:r.trim(),kind:a,value:s,...l?{note:l}:{},password:e}),n(),t()}catch(e){let t=R(e);t.needsPassword&&S&&m(!0),v(t)}finally{g(!1)}};return(0,Q.jsx)(J,{open:!0,onClose:()=>{h||t()},title:`${x?`Edit`:`Add`} ${P[b]} item`,footer:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(F,{variant:`outline`,disabled:h,onClick:t,children:`Cancel`}),(0,Q.jsx)(F,{disabled:!w,onClick:()=>void E(),children:x?`Save`:`Add`})]}),children:(0,Q.jsxs)(`form`,{className:`space-y-3`,onSubmit:e=>{e.preventDefault(),E()},children:[b===`public`&&(0,Q.jsx)(W,{}),(0,Q.jsx)(z,{value:r,onChange:i,disabled:h}),b===`public`&&O(r)&&(0,Q.jsx)(ie,{}),(0,Q.jsx)(U,{value:a,onChange:o,disabled:h}),(0,Q.jsx)(ae,{value:s,onChange:c,disabled:h,masked:S,placeholder:x&&S?`New value (leave empty to keep the current one)`:`Value`}),(0,Q.jsx)(L,{"aria-label":`Note`,placeholder:x?`Note (leave empty to keep)`:`Note (optional)`,autoComplete:`off`,value:l,onChange:e=>u(e.target.value),disabled:h,className:`h-11 md:h-9`}),p&&S&&(0,Q.jsx)(G,{label:`${P[b]} tier password`,value:d,onChange:f,disabled:h,invalid:!!_}),_&&(0,Q.jsxs)(`p`,{className:`text-xs text-error`,role:`alert`,children:[_.message,T&&` ${T}`]})]})})}function _e({move:e,onClose:t,onDone:n}){let[r,i]=(0,Z.useState)(`secure`),[a,o]=(0,Z.useState)({}),[s,c]=(0,Z.useState)(!1),[l,u]=(0,Z.useState)(!1),[d,f]=(0,Z.useState)(null),p=q(!!d?.lockedUntil),m=t=>!!e&&t!==e.item.tier&&(t===`public`||e.enabled[t]);if((0,Z.useEffect)(()=>{i(w.find(m)??`public`),o({}),c(!1),f(null)},[e]),!e)return null;let h=[e.item.tier,r].filter(S).filter(t=>t===`sealed`||!e.secureOpen||s),g=(d?.lockedUntil??0)>p,_=!l&&!g&&m(r)&&h.every(e=>!!a[e]),v=d?K(d,p):null,y=async()=>{if(_){u(!0),f(null);try{let i={};for(let e of h)i[e]=a[e];await V.move(e.item.id,r,i),n(),t()}catch(e){let t=R(e);t.needsPassword&&c(!0),f(t)}finally{u(!1)}}};return(0,Q.jsx)(J,{open:!0,onClose:()=>{l||t()},title:`Move “${e.item.name}”`,description:`Now in the ${P[e.item.tier]} tier.`,footer:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(F,{variant:`outline`,disabled:l,onClick:t,children:`Cancel`}),(0,Q.jsx)(F,{disabled:!_,onClick:()=>void y(),children:`Move`})]}),children:(0,Q.jsxs)(`form`,{className:`space-y-3`,onSubmit:e=>{e.preventDefault(),y()},children:[(0,Q.jsx)(re,{value:r,onChange:i,enabled:m,disabled:l}),r===`public`&&(0,Q.jsx)(W,{}),h.map(e=>(0,Q.jsx)(G,{label:`${P[e]} tier password`,value:a[e]??``,onChange:t=>o(n=>({...n,[e]:t})),disabled:l,invalid:!!d},e)),d&&(0,Q.jsxs)(`p`,{className:`text-xs text-error`,role:`alert`,children:[d.message,v&&` ${v}`]})]})})}var ve=[`Too short`,`Weak`,`Fair`,`Good`,`Strong`];function ye(e,t){let n=[...e].length;if(n<t)return{score:0,label:ve[0]};let r=[/[a-z]/,/[A-Z]/,/\d/,/[^A-Za-z0-9]/].filter(t=>t.test(e)).length,i=new Set(e).size,a=1;(n>=t+4||r>=3)&&a++,n>=t*1.5&&r>=2&&a++,(n>=t*2||n>=t+4&&r>=4)&&a++,i<Math.min(6,n/2)&&(a=1);let o=Math.min(4,a);return{score:o,label:ve[o]}}var be=[`bg-error`,`bg-error`,`bg-warning`,`bg-success`,`bg-success`];function xe(e,t,n){let r=A[e];return[...t].length<r?`At least ${r} characters.`:t===n?null:`The two passwords differ.`}function Se({tier:e,password:t,confirm:n,onPassword:r,onConfirm:i,disabled:a,label:o=`New password`}){let s=A[e],c=ye(t,s),l=n.length>0&&n!==t;return(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsx)(L,{type:`password`,autoComplete:`new-password`,spellCheck:!1,"aria-label":o,placeholder:o,value:t,onChange:e=>r(e.target.value),disabled:a,className:`h-11 md:h-9`}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,"data-vault-strength":c.score,children:[(0,Q.jsx)(`div`,{className:`flex flex-1 gap-1`,"aria-hidden":!0,children:[1,2,3,4].map(e=>(0,Q.jsx)(`span`,{className:x(`h-1.5 flex-1 rounded-full`,t&&c.score>=e?be[c.score]:`bg-panel-2`)},e))}),(0,Q.jsx)(`span`,{className:`w-20 text-right text-[11px] text-text-subtle`,children:t?c.label:`${s}+ characters`})]}),(0,Q.jsx)(L,{type:`password`,autoComplete:`new-password`,spellCheck:!1,"aria-label":`Type it again`,placeholder:`Type it again`,value:n,onChange:e=>i(e.target.value),disabled:a,"aria-invalid":l,className:`h-11 md:h-9`}),l&&(0,Q.jsx)(`p`,{className:`text-[11px] text-error`,children:`The two passwords differ.`})]})}function Ce(){return(0,Q.jsx)(`p`,{className:`rounded-md border border-error/50 bg-error/10 p-2 text-xs font-medium text-error`,"data-vault-forget-warning":``,children:`Forget this password and every item in this tier is lost for good; PPM cannot recover it.`})}function we({tier:e,onClose:t,onDone:n}){let[r,i]=(0,Z.useState)(``),[a,o]=(0,Z.useState)(``),[s,c]=(0,Z.useState)(!1),[l,u]=(0,Z.useState)(!1),[d,f]=(0,Z.useState)(null);if((0,Z.useEffect)(()=>{i(``),o(``),c(!1),f(null)},[e]),!e)return null;let p=xe(e,r,a),m=!l&&!p&&s,h=async()=>{if(m){u(!0),f(null);try{await V.enableTier(e,r),n(),t()}catch(e){f(R(e).message)}finally{u(!1)}}};return(0,Q.jsx)(J,{open:!0,onClose:()=>{l||t()},title:`Turn on the ${P[e]} tier`,description:e===`secure`?`Items here are encrypted. The AI reads them only after you type this password on a card.`:`Items here are encrypted under a second password. One item per card, shown to you unless you give it to the AI.`,footer:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(F,{variant:`outline`,disabled:l,onClick:t,children:`Cancel`}),(0,Q.jsx)(F,{disabled:!m,onClick:()=>void h(),children:`Turn on`})]}),children:(0,Q.jsxs)(`form`,{className:`space-y-3`,onSubmit:e=>{e.preventDefault(),h()},children:[(0,Q.jsx)(Se,{tier:e,password:r,confirm:a,onPassword:i,onConfirm:o,disabled:l,label:`${P[e]} tier password`}),e===`sealed`&&(0,Q.jsx)(`p`,{className:`text-xs text-text-secondary`,children:`This password must differ from the Secure tier's password.`}),(0,Q.jsx)(Ce,{}),(0,Q.jsx)(B,{checked:s,onChange:c,disabled:l,dataAttr:`forget-ack`,children:`I understand that PPM cannot recover this password or the items under it.`}),d&&(0,Q.jsx)(`p`,{className:`text-xs text-error`,role:`alert`,children:d})]})})}function Te({tier:e,onClose:t,onDone:n}){let[r,i]=(0,Z.useState)(``),[a,o]=(0,Z.useState)(``),[s,c]=(0,Z.useState)(``),[l,u]=(0,Z.useState)(!1),[d,f]=(0,Z.useState)(null),p=q(!!d?.lockedUntil);if((0,Z.useEffect)(()=>{i(``),o(``),c(``),f(null)},[e]),!e)return null;let m=(d?.lockedUntil??0)>p,h=!l&&!m&&r.length>0&&!xe(e,a,s),g=d?K(d,p):null,_=async()=>{if(h){u(!0),f(null);try{await V.changePassword(e,r,a),n(),t()}catch(e){f(R(e))}finally{u(!1)}}};return(0,Q.jsx)(J,{open:!0,onClose:()=>{l||t()},title:`Change the ${P[e]} tier password`,footer:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(F,{variant:`outline`,disabled:l,onClick:t,children:`Cancel`}),(0,Q.jsx)(F,{disabled:!h,onClick:()=>void _(),children:`Change password`})]}),children:(0,Q.jsxs)(`form`,{className:`space-y-3`,onSubmit:e=>{e.preventDefault(),_()},children:[(0,Q.jsx)(G,{label:`Current password`,value:r,onChange:i,disabled:l,invalid:!!d}),(0,Q.jsx)(Se,{tier:e,password:a,confirm:s,onPassword:o,onConfirm:c,disabled:l}),e===`sealed`&&(0,Q.jsx)(`p`,{className:`text-xs text-text-secondary`,children:`The new password must differ from the Secure tier's password.`}),(0,Q.jsx)(Ce,{}),d&&(0,Q.jsxs)(`p`,{className:`text-xs text-error`,role:`alert`,children:[d.message,g&&` ${g}`]})]})})}var Ee=/^image\/(jpeg|png|webp)$/,$=e=>Ee.test(e);function De(e,t,n=E){let r=Math.max(e,t);return r>n?n/r:1}async function Oe(e,t=E){if(!$(e.type))return{blob:e,name:e.name};let n=await createImageBitmap(e,{imageOrientation:`from-image`});try{let r=De(n.width,n.height,t),i=document.createElement(`canvas`);i.width=Math.max(1,Math.round(n.width*r)),i.height=Math.max(1,Math.round(n.height*r));let a=i.getContext(`2d`);if(!a)throw Error(`This browser could not prepare the photo. Tick “Keep the original” to upload it as it is.`);a.drawImage(n,0,0,i.width,i.height);let o=e.type===`image/png`?`image/png`:`image/jpeg`,s=await new Promise(e=>i.toBlob(e,o,.88));if(!s)throw Error(`This browser could not prepare the photo. Tick “Keep the original” to upload it as it is.`);return{blob:s,name:`${e.name.replace(/\.[^.]+$/,``)||`photo`}.${o===`image/png`?`png`:`jpg`}`}}finally{n.close()}}function ke({upload:e,onClose:t,onDone:n}){let[r,i]=(0,Z.useState)(null),[a,o]=(0,Z.useState)(``),[s,c]=(0,Z.useState)(!1),[l,u]=(0,Z.useState)(``),[d,f]=(0,Z.useState)(!1),[p,m]=(0,Z.useState)(!1),[h,_]=(0,Z.useState)(null),v=(0,Z.useRef)(null),y=q(!!h?.lockedUntil);if((0,Z.useEffect)(()=>{i(null),o(``),c(!1),u(``),f(e?.askPassword??!1),_(null)},[e]),!e)return null;let{item:b}=e,x=P[b.tier],S=(b.attachments?.length??0)>=10,w=(h?.lockedUntil??0)>y,T=!p&&!w&&!S&&!!r&&(!d||l.length>0),E=h?K(h,y):null,D=!!r&&(s||!$(r.type))&&r.size>10485760,O=async()=>{if(!(!T||!r||D)){m(!0),_(null);try{let e=s?{blob:r,name:r.name}:await Oe(r);await V.uploadFile(b.id,e.blob,e.name,{label:a.trim()||void 0,password:d?l:void 0}),n(),t()}catch(e){let t=R(e);t.needsPassword&&f(!0),_(t)}finally{m(!1)}}};return(0,Q.jsx)(J,{open:!0,onClose:()=>{p||t()},title:`Attach a file to “${b.name}”`,description:`Encrypted under the ${x} tier's key. Only you can open it, in PPM; no AI reads it.`,footer:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(F,{variant:`outline`,disabled:p,onClick:t,children:`Cancel`}),(0,Q.jsx)(F,{disabled:!T||D,onClick:()=>void O(),children:p?`Uploading…`:`Attach`})]}),children:(0,Q.jsxs)(`form`,{className:`space-y-3`,onSubmit:e=>{e.preventDefault(),O()},"data-vault-upload":``,children:[(0,Q.jsx)(`input`,{ref:v,type:`file`,accept:C.join(`,`),className:`sr-only`,"aria-label":`Choose a photo or PDF`,"data-vault-upload-input":``,onChange:e=>{i(e.target.files?.[0]??null),_(null),e.target.value=``}}),(0,Q.jsxs)(`button`,{type:`button`,disabled:p||S,onClick:()=>v.current?.click(),className:`flex min-h-20 w-full flex-col items-center justify-center gap-1 rounded-lg border border-dashed border-border px-3 py-3 text-center text-sm text-text-secondary can-hover:hover:bg-panel-2 disabled:opacity-50`,children:[(0,Q.jsx)(g,{className:`size-5`}),r?(0,Q.jsxs)(`span`,{className:`max-w-full truncate text-text-primary`,"data-vault-upload-chosen":``,children:[r.name,` · `,N(r.size)]}):(0,Q.jsx)(`span`,{children:`Choose a photo or PDF`}),(0,Q.jsxs)(`span`,{className:`text-[11px] text-text-subtle`,children:[`JPEG, PNG, WebP or PDF · up to `,M/(1024*1024),` MB · `,10,` per item`]})]}),S&&(0,Q.jsxs)(`p`,{className:`text-xs text-error`,children:[`This item already holds `,10,` files.`]}),(0,Q.jsx)(L,{"aria-label":`Label`,placeholder:`Label, e.g. Passport photo page (optional)`,autoComplete:`off`,maxLength:120,value:a,disabled:p,onChange:e=>o(e.target.value),className:`h-11 md:h-9`}),(0,Q.jsx)(`p`,{className:`text-[11px] text-text-subtle`,children:`The label is what lists and the AI see. The file's own name stays encrypted with the file.`}),r&&$(r.type)&&(0,Q.jsxs)(B,{checked:s,onChange:c,disabled:p,dataAttr:`keep-original`,children:[`Keep the original. Otherwise the photo is shrunk to `,2e3.toLocaleString(),` px and its EXIF (location, phone model) is removed before upload.`]}),D&&(0,Q.jsxs)(`p`,{className:`text-xs text-error`,children:[`This file is larger than `,10485760/(1024*1024),` MB.`]}),d&&(0,Q.jsx)(G,{label:`${x} tier password`,value:l,onChange:u,disabled:p,invalid:!!h}),h&&(0,Q.jsxs)(`p`,{className:`text-xs text-error`,role:`alert`,children:[h.message,E&&` ${E}`]})]})})}var Ae=e(r(),1);function je(e,t){let n=URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=t,r.rel=`noopener`,document.body.appendChild(r),r.click(),r.remove(),setTimeout(()=>URL.revokeObjectURL(n),1e4)}function Me({view:e,onClose:t}){let n=q(!!e),[r,i]=(0,Z.useState)(null),a=e?.blob??null;(0,Z.useEffect)(()=>{if(!a)return;let e=URL.createObjectURL(a);return i(e),()=>{URL.revokeObjectURL(e),i(null)}},[a]),(0,Z.useEffect)(()=>{e&&n>=e.until&&t()},[e,n,t]),(0,Z.useEffect)(()=>{if(!e)return;let n=e=>{e.key===`Escape`&&t()};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t]);let o=e?.file.type===`application/pdf`,s=(0,Z.useMemo)(()=>!e||!r?null:o?(0,Q.jsx)(`iframe`,{title:e.file.label,src:r,className:`h-full w-full border-0 bg-white`,"data-vault-viewer-pdf":``}):(0,Q.jsx)(`img`,{src:r,alt:e.file.label,className:`max-h-full max-w-full object-contain`,"data-vault-viewer-image":``}),[e,r,o]);return e?(0,Ae.createPortal)((0,Q.jsxs)(`div`,{className:`fixed inset-0 z-[100] flex flex-col bg-black/95 text-white`,role:`dialog`,"aria-modal":`true`,"aria-label":e.file.label,"data-vault-viewer":``,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-white/10 px-3 py-2`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`p`,{className:`truncate text-sm font-medium`,children:e.file.label}),(0,Q.jsxs)(`p`,{className:`text-[11px] text-white/60`,children:[j[e.file.type],` · `,N(e.file.size)]})]}),(0,Q.jsx)(`span`,{className:`font-mono text-xs text-white/70`,"data-vault-viewer-countdown":``,children:H(e.until-n)}),(0,Q.jsx)(`button`,{type:`button`,onClick:t,"aria-label":`Close`,className:`inline-flex size-11 items-center justify-center rounded-lg can-hover:hover:bg-white/10`,children:(0,Q.jsx)(m,{className:`size-5`})})]}),(0,Q.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center p-2`,children:s}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-t border-white/10 px-3 py-2 pb-[max(0.5rem,env(safe-area-inset-bottom))]`,children:[(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>je(e.blob,e.fileName),className:`inline-flex h-11 items-center gap-2 rounded-lg border border-white/20 px-4 text-sm can-hover:hover:bg-white/10`,children:[(0,Q.jsx)(u,{className:`size-4`}),`Download`]}),(0,Q.jsx)(`p`,{className:`ml-auto text-[11px] text-white/60`,children:`Shown on this device only. No AI sees it; nothing is kept in the browser.`})]})]}),document.body):null}function Ne({file:e,onClose:t,onRename:n}){let[r,i]=(0,Z.useState)(e.label),a=r.trim(),o=a.length>0&&a!==e.label,s=()=>{o&&(t(),n(a))};return(0,Q.jsx)(J,{open:!0,onClose:t,title:`Rename file`,description:`The label is what lists and the AI see. Do not put a secret in it.`,footer:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(F,{variant:`outline`,onClick:t,children:`Cancel`}),(0,Q.jsx)(F,{disabled:!o,onClick:s,children:`Rename`})]}),children:(0,Q.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),s()},children:(0,Q.jsx)(L,{"aria-label":`Label`,autoFocus:!0,autoComplete:`off`,maxLength:120,value:r,onChange:e=>i(e.target.value),className:`h-11 md:h-9`})})})}var Pe=[`ring-2`,`ring-primary`,`rounded-md`];function Fe(){let{data:e,error:t,refresh:n}=se(),[r,i]=(0,Z.useState)(null),[a,o]=(0,Z.useState)(null),[s,c]=(0,Z.useState)(null),[l,u]=(0,Z.useState)(null),[d,f]=(0,Z.useState)(null),[p,m]=(0,Z.useState)(null),[h,g]=(0,Z.useState)(null),[_,v]=(0,Z.useState)(null),[y,x]=(0,Z.useState)(null),S=q(!!e),C=(0,Z.useCallback)(()=>m(null),[]),w=(0,Z.useCallback)(()=>v(null),[]),E=ne(e=>e.itemId),[O,k]=(0,Z.useState)(null),A=!!e;if((0,Z.useEffect)(()=>{!A||!E||(ne.getState().clear(),k(E))},[A,E]),(0,Z.useEffect)(()=>{if(!O)return;let e=document.querySelector(`[data-vault-item="${CSS.escape(O)}"]`);if(!e){k(null);return}e.scrollIntoView({block:`center`,behavior:`smooth`}),e.classList.add(...Pe);let t=setTimeout(()=>k(null),4e3);return()=>{clearTimeout(t),e.classList.remove(...Pe)}},[O]),!e)return(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t??`Loading…`});let{status:j,items:M}=e,N=j.tiers.secure.settingsOpenUntil>S,F=e=>e===`sealed`||!N,I=()=>void n(),L=(e,t,n)=>{let r=async e=>{try{await t.run(e)}finally{I()}},a={...t,tier:e,run:r};if(e&&!n&&!F(e)){r(void 0).catch(e=>{let t=R(e);t.needsPassword?i({...a,askPassword:!0}):b.error(t.message)});return}i({...a,askPassword:e!==null&&F(e)})},z=e=>L(e.tier===`public`?null:e.tier,{title:`Delete “${e.name}”?`,description:`Deleted items stay in older backups until they expire.`,confirmLabel:`Delete`,danger:!0,run:async t=>{await V.deleteItem(e.id,t)}},!0),B=e=>c({item:e,enabled:{secure:j.tiers.secure.enabled,sealed:j.tiers.sealed.enabled},secureOpen:N}),H=e=>({onPreview:t=>L(e,{title:`Open “${t.label}”`,description:`Shown on this device for ${D/1e3} seconds. No AI sees it.`,confirmLabel:`Open`,run:async e=>{let{blob:n,fileName:r}=await V.openFile(t.id,{password:e});v({file:t,blob:n,fileName:r,until:Date.now()+D})}},!1),onDownload:t=>L(e,{title:`Download “${t.label}”`,description:`The file is saved decrypted to this device's downloads.`,confirmLabel:`Download`,run:async e=>{let{blob:n,fileName:r}=await V.openFile(t.id,{password:e,download:!0});je(n,r)}},e===`sealed`),onRename:e=>x(e),onDelete:t=>L(e,{title:`Delete “${t.label}”?`,description:`Deleted files stay in older backups until they expire.`,confirmLabel:`Delete`,danger:!0,run:async e=>{await V.deleteFile(t.id,e)}},!0)}),U=e=>({onEnable:()=>u(e),onAdd:()=>o({tier:e,askPassword:F(e)}),onShow:t=>L(e,{title:`Show “${t.name}”`,description:`Shown here for ${le/1e3} seconds.`,confirmLabel:`Show`,run:async e=>{let n=await V.reveal(t.id,e);m({id:t.id,value:n.value,until:Date.now()+le})}},!1),onHide:C,onEdit:t=>o({tier:e,item:t,askPassword:F(e)}),onMove:B,onDelete:z,onAddFile:t=>g({item:{...t,tier:e},askPassword:F(e)}),fileActions:H(e),onChangePassword:()=>f(e),onDeleteTier:()=>i({tier:e,askPassword:!0,title:`Delete the ${P[e]} tier?`,description:`The tier is turned off and every item and file in it is deleted. ${ee}`,confirmLabel:`Delete tier`,danger:!0,acknowledge:`Delete all ${j.tiers[e].itemCount} item${j.tiers[e].itemCount===1?``:`s`} in this tier for good.`,run:async t=>{try{await V.deleteTier(e,t??``)}finally{I()}}}),...e===`secure`?{onUnlock:()=>i({tier:e,askPassword:!0,title:`Unlock the Secure tier`,description:`Settings keeps it open for five minutes.`,confirmLabel:`Unlock`,run:async e=>{try{await V.unlockSecure(e??``)}finally{I()}}}),onLock:()=>{m(null),V.lock(`secure`).then(I,e=>b.error(R(e).message))}}:{}});return(0,Q.jsxs)(`div`,{className:`space-y-6`,children:[(0,Q.jsxs)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:[`Personal details the AI may need, kept in three tiers. The Secure and Sealed tiers are encrypted under passwords of their own, separate from PPM's password; neither password is stored, and a restart locks both. Deleted items stay in older backups until they expire.`,` `,te]}),(0,Q.jsx)(fe,{items:M.filter(e=>e.tier===`public`),values:e.publicValues,onAdd:()=>o({tier:`public`,askPassword:!1}),onEdit:t=>o({tier:`public`,item:t,value:e.publicValues[t.id],askPassword:!1}),onMove:B,onDelete:z}),T.map(e=>(0,Q.jsx)(me,{tier:e,status:j.tiers[e],items:M.filter(t=>t.tier===e),revealed:p,now:S,actions:U(e)},e)),(0,Q.jsx)(he,{prompt:r,onClose:()=>i(null)}),(0,Q.jsx)(ge,{edit:a,onClose:()=>o(null),onDone:I}),(0,Q.jsx)(_e,{move:s,onClose:()=>c(null),onDone:I}),(0,Q.jsx)(we,{tier:l,onClose:()=>u(null),onDone:I}),(0,Q.jsx)(Te,{tier:d,onClose:()=>f(null),onDone:I}),(0,Q.jsx)(ke,{upload:h,onClose:()=>g(null),onDone:I}),(0,Q.jsx)(Me,{view:_,onClose:w}),y&&(0,Q.jsx)(Ne,{file:y,onClose:()=>x(null),onRename:e=>{let t=M.find(e=>e.id===y.itemId)?.tier;!t||t===`public`||L(t,{title:`Rename “${y.label}”`,confirmLabel:`Rename`,run:async t=>{await V.renameFile(y.id,e,t)}},!1)}})]})}export{Fe as VaultSettingsSection};
|
|
Binary file
|
|
Binary file
|
package/dist/web/assets/{voice-settings-section-DNNYOnyl.js → voice-settings-section-BRp23eqt.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{t}from"./settings-store-C8OGZwk3.js";import{D as n,E as r}from"./vendor-markdown-26eoXJk7.js";import"./vendor-ui-BQzUk4nq.js";import{$r as i,F as a,Nn as o,Pr as s,Sn as c,Xr as l,ht as u,j as d,lr as f,pi as p}from"./icons-CpR5Vw3J.js";import{j as m,r as h,v as g,y as _}from"./api-client-DSCscZEd.js";import{n as v}from"./utils-DMiycH3O.js";import"./window-store-B_dGEBYm.js";import"./panel-store-D-yxAgT2.js";import{i as y}from"./project-store-BaGmhKos.js";import"./project-framework-store-vI8djw4a.js";import"./session-list-sync-triggers-_I5gGBSe.js";import"./vault-Q5oPy0h3.js";import"./session-collab-zjo6GNuD.js";import{t as b}from"./button-CtdEWN7U.js";import{t as x}from"./input-CCVoN0-P.js";import{t as S}from"./feature-intros-ChY01Oi8.js";import{c as C,d as w,n as T}from"./voice-message-DbyzMM-l.js";import{Rn as E}from"./index-CXjsAVvH.js";import"./run-in-terminal-CMLJUGsE.js";import{t as D}from"./separator-oOpmQBhw.js";import{r as O}from"./settings-rows-B6puQ-Vk.js";import{t as k}from"./run-in-terminal-button-D7aVhM2f.js";var A=e(n(),1),j=r();function M(e,t){let n=t.replace(/\s+/g,` `).trim();return!n||e.some(e=>e.toLowerCase()===n.toLowerCase())?null:[...e,n]}function N({words:e,learned:t=[],placeholder:n,busy:r,onWordsChange:i,onRemoveLearned:a}){let[o,c]=(0,A.useState)(``),l=()=>{let t=M(e,o);c(``),t&&i(t)};return(0,j.jsxs)(`div`,{className:`overflow-hidden rounded-xl border border-border bg-panel`,children:[(0,j.jsxs)(`div`,{className:`flex flex-wrap gap-1.5 px-3.5 py-3 max-md:gap-y-5`,children:[e.length===0&&t.length===0&&(0,j.jsx)(`span`,{className:`text-xs text-text-3`,children:`No words yet.`}),t.map(e=>(0,j.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-full border border-accent-2/40 bg-accent-2/10 py-0.5 pl-2.5 pr-1 font-mono text-[12.5px] text-text`,children:[(0,j.jsx)(s,{className:`size-3 shrink-0 text-accent-2`,"aria-label":`Learned`}),e.word,e.from&&(0,j.jsxs)(`span`,{className:`font-sans text-[11px] text-text-3`,children:[`← `,e.from]}),a&&(0,j.jsx)(P,{label:`Remove learned word ${e.word}`,disabled:r,onClick:()=>a(e.word)})]},`learned-${e.word}`)),e.map(t=>(0,j.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full border border-border-soft bg-panel-2 py-0.5 pl-2.5 pr-1 font-mono text-[12.5px] text-text`,children:[t,(0,j.jsx)(P,{label:`Remove ${t}`,disabled:r,onClick:()=>i(e.filter(e=>e!==t))})]},t))]}),t.length>0&&(0,j.jsxs)(`p`,{className:`flex items-center gap-1.5 px-3.5 pb-2 text-[11.5px] text-text-3`,children:[(0,j.jsx)(s,{className:`size-3 text-accent-2`}),`learned from your corrections`]}),(0,j.jsxs)(`form`,{className:`flex gap-2 px-3.5 pb-3`,onSubmit:e=>{e.preventDefault(),l()},children:[(0,j.jsx)(x,{value:o,onChange:e=>c(e.target.value),placeholder:n,"aria-label":n,disabled:r,className:`h-11 md:h-[34px]`}),(0,j.jsxs)(b,{type:`submit`,variant:`outline`,disabled:r||!o.trim(),className:`h-11 gap-1.5 md:h-[34px]`,children:[(0,j.jsx)(f,{className:`size-3.5`}),`Add`]})]})]})}function P({label:e,disabled:t,onClick:n}){return(0,j.jsx)(`button`,{type:`button`,onClick:n,disabled:t,"aria-label":e,title:e,className:`relative grid size-[18px] shrink-0 place-items-center rounded-full text-text-3 transition-colors before:absolute before:-inset-y-3.5 before:-inset-x-1 before:content-[''] can-hover:hover:bg-surface-hover can-hover:hover:text-text disabled:opacity-50 md:before:-inset-1`,children:(0,j.jsx)(p,{className:`size-3`})})}var F=10080*60*1e3;function I(e,t=new Date){let n=new Date(e);if(Number.isNaN(n.getTime()))return``;let r=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime(),i=Math.round((r(t)-r(n))/864e5);return i<=0?`today ${n.toTimeString().slice(0,5)}`:i===1?`yesterday`:i<7?n.toLocaleDateString(void 0,{weekday:`short`}):n.toLocaleDateString(void 0,{day:`numeric`,month:`short`})}function L(e,t=new Date){let n=`learned ${I(e.at,t)}`;if(!e.lastUsedAt||e.lastUsedAt===e.at)return{text:n,title:n};let r=`used ${I(e.lastUsedAt,t)}`;return{text:r,title:`${n}, last ${r}`}}function R(e){return e.source===`cleanup`?`clean-up · ${e.hits??1}×`:`your edit`}function z(e,t=new Date){let n=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime();return e.filter(e=>Date.parse(e.at)>=n).map(e=>e.word)}function B({learned:e,blocked:t,busy:n,onUndo:r,onRestore:a}){let[o,s]=(0,A.useState)(`week`),c=(0,A.useMemo)(()=>new Date,[e,t]),l=(0,A.useMemo)(()=>[...e].sort((e,t)=>t.at.localeCompare(e.at)),[e]),u=l.filter(e=>c.getTime()-Date.parse(e.at)<F),d=z(e,c),f=o===`week`?u:l;return(0,j.jsxs)(`div`,{className:`overflow-hidden rounded-xl border border-border bg-panel`,"data-voice-learned-list":``,children:[(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 border-b border-border-soft px-3 py-2`,children:[(0,j.jsxs)(V,{active:o===`week`,onClick:()=>s(`week`),children:[`This week · `,u.length]}),(0,j.jsxs)(V,{active:o===`all`,onClick:()=>s(`all`),children:[`All · `,e.length]}),(0,j.jsxs)(V,{active:o===`undone`,onClick:()=>s(`undone`),children:[`Undone · `,t.length]}),(0,j.jsx)(`span`,{className:`flex-1`}),o!==`undone`&&(0,j.jsxs)(b,{variant:`outline`,size:`sm`,disabled:n||d.length===0,onClick:()=>r(d),className:`h-11 w-full border-destructive/40 text-destructive md:h-[30px] md:w-auto`,children:[`Undo everything learned today`,d.length?` (${d.length})`:``]})]}),o===`undone`?t.length===0?(0,j.jsx)(H,{children:`Nothing undone. A word you undo stays here, and is never learned again until you restore it.`}):(0,j.jsx)(`ul`,{children:[...t].sort((e,t)=>t.at.localeCompare(e.at)).map(e=>(0,j.jsx)(U,{word:e.word,heard:e.from,badge:`undone · never again`,when:{text:`undone ${I(e.at,c)}`,title:``},dim:!0,children:(0,j.jsx)(b,{variant:`outline`,size:`sm`,disabled:n,onClick:()=>a(e.word),className:`h-11 md:h-[30px]`,children:`Restore`})},`blocked-${e.word}`))}):f.length===0?(0,j.jsx)(H,{children:o===`week`?`Nothing learned this week.`:`Nothing learned yet. Words appear here once the clean-up has fixed them a few times, or when you correct a transcript.`}):(0,j.jsx)(`ul`,{children:f.map(e=>(0,j.jsx)(U,{word:e.word,heard:e.from,badge:R(e),badgeTone:e.source===`cleanup`?`cleanup`:`edit`,when:L(e,c),phrase:e.kind===`phrase`,children:(0,j.jsxs)(b,{variant:`outline`,size:`sm`,disabled:n,onClick:()=>r([e.word]),className:`h-11 gap-1.5 md:h-[30px]`,"aria-label":`Undo learned word ${e.word}`,children:[(0,j.jsx)(i,{className:`size-3.5`}),`Undo`]})},`learned-${e.word}`))})]})}function V({active:e,onClick:t,children:n}){return(0,j.jsx)(`button`,{type:`button`,onClick:t,"aria-pressed":e,className:v(`h-11 rounded-lg px-2.5 text-[12.5px] md:h-[30px]`,e?`bg-panel-2 text-text`:`text-text-2 hover:text-text`),children:n})}function H({children:e}){return(0,j.jsx)(`p`,{className:`px-4 py-4 text-xs leading-relaxed text-text-3`,children:e})}function U({word:e,heard:t,badge:n,badgeTone:r,when:i,dim:a,phrase:o,children:s}){return(0,j.jsxs)(`li`,{className:v(`grid grid-cols-[minmax(0,1fr)_auto] items-center gap-x-3 gap-y-1 border-t border-border-soft px-4 py-2.5 first:border-t-0`,`md:grid-cols-[minmax(0,1.2fr)_minmax(0,1fr)_auto_9.5rem_auto]`,a&&`text-text-dim`),children:[(0,j.jsx)(`span`,{className:`min-w-0 truncate text-sm font-semibold`,title:o?`Only the clean-up uses this one; Whisper is not told.`:void 0,children:e}),(0,j.jsx)(`span`,{className:`col-span-2 row-start-2 min-w-0 truncate text-[12.5px] text-text-3 line-through md:col-span-1 md:row-start-auto`,children:t}),(0,j.jsxs)(`span`,{className:`col-span-2 row-start-3 flex items-center gap-2 md:col-span-1 md:row-start-auto`,children:[(0,j.jsx)(`span`,{className:v(`whitespace-nowrap rounded-full border px-2 py-0.5 text-[10.5px]`,r===`cleanup`?`border-accent-2/40 text-accent-2`:r===`edit`?`border-warning/40 text-warning`:`border-border text-text-3`),children:n}),(0,j.jsx)(`span`,{className:`text-xs text-text-3 md:hidden`,title:i.title||void 0,children:i.text})]}),(0,j.jsx)(`span`,{className:`hidden text-xs text-text-3 md:block`,title:i.title||void 0,children:i.text}),(0,j.jsx)(`span`,{className:`col-start-2 row-start-1 justify-self-end md:col-start-auto md:row-start-auto`,children:s})]})}var W={typed:{label:`your words`,dot:`bg-warning`,text:`text-text`},learned:{label:`learned`,dot:`bg-accent-2`,text:`text-text`},picked:{label:`picked up`,dot:`bg-primary`,text:`text-text-2`}},G=e=>e.reduce((e,t,n)=>e+t.word.length+(n?2:0),0);function K({view:e,busy:t,projectSelect:n,save:r}){let i=e.selfLearning;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(J,{title:`Self-learning`,children:[(0,j.jsx)(O,{label:`Learn your words by itself`,note:`Without anyone editing a transcript, PPM picks up names and task codes for Whisper and learns a word once the clean-up has fixed it the same way a few times. Learned words work at once; undo any of them below.`,checked:i,disabled:t,onChange:e=>r({selfLearning:e})}),i&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(O,{label:`Pick up words from the project`,note:`Project and chat names, recent task codes and titles, and CLAUDE.md terms, refreshed once a day. A project gets only its own words; the PPM Assistant gets every project's.`,checked:e.learnAutoVocabulary,disabled:t,onChange:e=>r({learnAutoVocabulary:e})}),(0,j.jsx)(O,{label:`Learn from the clean-up's corrections`,note:e.cleanupEnabled?`A word the clean-up fixed the same way in three messages (two when the project already uses it) is learned, and one nobody says for 30 days leaves the list by itself. No extra Haiku call.`:`Needs the Haiku clean-up, which is off.`,checked:e.learnFromCleanup&&e.cleanupEnabled,disabled:t||!e.cleanupEnabled,onChange:e=>r({learnFromCleanup:e})}),(0,j.jsx)(O,{label:`Weekly summary`,note:`Monday's morning digest lists the words learned that week. It asks nothing; undo here any time.`,checked:e.weeklySummary,disabled:t,onChange:e=>r({weeklySummary:e})})]})]}),i&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(J,{title:(0,j.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2`,children:[`What Whisper hears first `,n]}),bare:!0,children:(0,j.jsx)(q,{words:e.whisperPrompt,max:e.whisperPromptMaxChars})}),(0,j.jsx)(J,{title:`Learned words · this project`,bare:!0,children:(0,j.jsx)(B,{learned:e.projectLearned,blocked:e.projectBlocked,busy:t,onUndo:e=>r({removeLearned:e}),onRestore:e=>r({restoreBlocked:[e]})})})]})]})}function q({words:e,max:t}){let n=G(e),r=n=>e.filter(e=>e.source===n).reduce((e,t)=>e+t.word.length+2,0)/Math.max(t,1);return(0,j.jsxs)(`div`,{className:`overflow-hidden rounded-xl border border-border bg-panel`,"data-voice-prompt-preview":``,children:[(0,j.jsx)(`p`,{className:`break-words px-4 py-3 font-mono text-xs leading-relaxed`,children:e.length===0?(0,j.jsx)(`span`,{className:`text-text-3`,children:`Nothing yet: add words above, or wait for the first picked-up list.`}):e.map((t,n)=>(0,j.jsxs)(`span`,{className:W[t.source].text,children:[t.word,n<e.length-1?`, `:``]},`${n}:${t.word}`))}),(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1.5 border-t border-border-soft px-4 py-2.5 text-xs text-text-2`,children:[(0,j.jsxs)(`span`,{className:`font-mono`,children:[n,` / `,t,` characters`]}),(0,j.jsx)(`span`,{className:`flex h-1.5 min-w-24 flex-1 overflow-hidden rounded-full bg-panel-2`,"aria-hidden":!0,children:[`typed`,`learned`,`picked`].map(e=>(0,j.jsx)(`span`,{className:v(`h-full`,W[e].dot),style:{width:`${Math.min(100,r(e)*100)}%`}},e))}),(0,j.jsx)(`span`,{className:`flex flex-wrap gap-3`,children:[`typed`,`learned`,`picked`].map(e=>(0,j.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,j.jsx)(`span`,{className:v(`size-2 rounded-full`,W[e].dot)}),W[e].label]},e))})]})]})}function J({title:e,children:t,bare:n}){return(0,j.jsxs)(`section`,{children:[(0,j.jsx)(`div`,{className:`mb-2 text-[11px] font-semibold uppercase tracking-wider text-text-3`,children:e}),n?t:(0,j.jsx)(`div`,{className:`divide-y divide-border-soft overflow-hidden rounded-xl border border-border bg-panel`,children:t})]})}function Y({onEnabledChange:e}){let t=y(e=>e.projects),n=y(e=>e.activeProject?.name),[r,i]=(0,A.useState)(()=>(n&&!_(n)?n:t[0]?.name)??`__assistant__`),[o,s]=(0,A.useState)(null),[c,l]=(0,A.useState)(!1),[u,d]=(0,A.useState)(!1),[f,p]=(0,A.useState)(0);E(`voice`,()=>p(e=>e+1)),(0,A.useEffect)(()=>{let e=!0,t=()=>C(r).then(t=>{e&&(s(t),l(!1))}).catch(()=>{e&&l(!0)});return t(),window.addEventListener(S,t),()=>{e=!1,window.removeEventListener(S,t)}},[r,f]),(0,A.useEffect)(()=>{o&&e?.(o.enabled)},[o,e]);let h=(0,A.useCallback)(async e=>{d(!0);try{s(await w({project:r,...e}))}catch(e){m.error(`Could not save the voice settings`,{description:e instanceof Error?e.message:String(e)})}finally{d(!1)}},[r]);if(c||!o)return null;let v=r===`__assistant__`?`PPM Assistant`:r,b=(0,j.jsxs)(`label`,{className:`relative inline-flex items-center`,children:[(0,j.jsxs)(`select`,{value:r,onChange:e=>i(e.target.value),"aria-label":`Project`,className:`h-11 appearance-none rounded-lg border border-border bg-panel py-0 pl-2.5 pr-7 text-[12.5px] font-medium normal-case tracking-normal text-text md:h-[30px]`,children:[t.filter(e=>!_(e.name)).map(e=>(0,j.jsx)(`option`,{value:e.name,children:e.name},e.name)),(0,j.jsx)(`option`,{value:g,children:`PPM Assistant`})]}),(0,j.jsx)(a,{className:`pointer-events-none absolute right-2 size-3 text-text-3`})]});return(0,j.jsxs)(`div`,{className:`space-y-6`,children:[(0,j.jsxs)(X,{title:`Voice messages`,children:[(0,j.jsx)(O,{label:`Voice messages`,note:`The mic in the chat box records a message: Whisper turns it into text on this host, then it is tidied for you to read. Off: the mic dictates into the box as before.`,checked:o.enabled,disabled:u,onChange:e=>void h({enabled:e})}),o.enabled&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(O,{label:`Read the transcript before it is sent`,note:`Off: the transcript goes to the AI as soon as it is ready. When the clean-up fails it always waits for you.`,checked:o.reviewBeforeSend,disabled:u,onChange:e=>void h({reviewBeforeSend:e})}),(0,j.jsx)(O,{label:`Tidy the transcript with Claude Haiku`,note:`One call per message on your Claude account. Reads the last 8 messages, memory and CLAUDE.md, file names and your word lists, and fixes misheard words and punctuation only. It also learns words from your edits. Off: Whisper's transcript is used as it is and Haiku is never called; your word lists still help Whisper.`,checked:o.cleanupEnabled,disabled:u,onChange:e=>void h({cleanupEnabled:e})}),o.cleanupEnabled&&(0,j.jsx)(O,{label:`Fix Vietnamese words by context`,note:`The clean-up also fixes ordinary words Whisper misheard ("ta lệnh" → "ra lệnh") when the sentence makes the meaning clear. The Telegram card lists every word it changed.`,checked:o.vietnameseFixes,disabled:u,onChange:e=>void h({vietnameseFixes:e})}),(0,j.jsx)(Z,{label:`Longest recording`,value:T(120)}),!o.whisperReady&&(0,j.jsx)(Z,{label:`Whisper`,children:`Not installed on this host yet. Install it below; until then the mic offers the install.`})]})]}),o.enabled&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(X,{title:`Words · all projects`,bare:!0,children:(0,j.jsx)(N,{words:o.words,placeholder:`Add a word or name…`,busy:u,onWordsChange:e=>void h({words:e})})}),(0,j.jsx)(X,{bare:!0,title:(0,j.jsxs)(`span`,{className:`flex items-center gap-2`,children:[`Words · project`,b]}),children:(0,j.jsx)(N,{words:o.projectWords,learned:o.selfLearning?[]:o.projectLearned,placeholder:`Add a word for ${v}…`,busy:u,onWordsChange:e=>void h({projectWords:e}),onRemoveLearned:e=>void h({removeLearned:[e]})})}),(0,j.jsx)(K,{view:o,busy:u,projectSelect:b,save:e=>void h(e)})]})]})}function X({title:e,children:t,bare:n}){return(0,j.jsxs)(`section`,{children:[(0,j.jsx)(`div`,{className:`mb-2 text-[11px] font-semibold uppercase tracking-wider text-text-3`,children:e}),n?t:(0,j.jsx)(`div`,{className:`divide-y divide-border-soft overflow-hidden rounded-xl border border-border bg-panel`,children:t})]})}function Z({label:e,value:t,children:n}){return(0,j.jsxs)(`div`,{className:`flex min-h-11 items-center gap-3 px-4 py-2.5`,children:[(0,j.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,j.jsx)(`p`,{className:`text-sm`,children:e}),n&&(0,j.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:n})]}),t&&(0,j.jsx)(`span`,{className:`shrink-0 font-mono text-xs text-text-2`,children:t})]})}var Q={binary:`Downloading whisper.cpp`,model:`Downloading the model`,vad:`Downloading the voice detector`,verify:`Checking it runs here`},ee=e=>`${Math.round(e/1e6)} MB`;function te(){let e=t(e=>e.voiceEngine),n=t(e=>e.setVoiceEngine),[r,i]=(0,A.useState)(null),[a,o]=(0,A.useState)(!1),[s,f]=(0,A.useState)(null),[p,g]=(0,A.useState)(!1),_=(0,A.useRef)(null),y=(0,A.useCallback)(async()=>{try{let e=await h.get(`/api/speech/status`);i(e),f(t=>t??e.model?.id??e.models.at(-1)?.id??null)}catch{}},[]);(0,A.useEffect)(()=>{y()},[y]);let x=!!r?.install&&!r.install.done;(0,A.useEffect)(()=>{if(x)return _.current=setTimeout(()=>void y(),700),()=>{_.current&&clearTimeout(_.current)}},[x,r,y]);let[S,C]=(0,A.useState)(!1),w=!!r?.installable;(0,A.useEffect)(()=>{if(!S||w)return;let e=setInterval(()=>{document.visibilityState===`visible`&&y()},4e3),t=setTimeout(()=>C(!1),10*6e4);return()=>{clearInterval(e),clearTimeout(t)}},[S,w,y]),(0,A.useEffect)(()=>{r&&!r.ready&&e===`whisper`&&n(`browser`)},[r,e,n]);let T=async()=>{if(s){g(!0);try{await h.post(`/api/speech/install`,{model:s}),await y()}catch(e){m.error(`Could not start the install`,{description:e instanceof Error?e.message:String(e)})}finally{g(!1)}}},E=async()=>{g(!0);try{await h.post(`/api/speech/uninstall`),n(`browser`),await y()}catch(e){m.error(`Could not remove Whisper`,{description:e instanceof Error?e.message:String(e)})}finally{g(!1)}},O=r?.install??null,M=O&&O.totalBytes>0?Math.round(O.receivedBytes/O.totalBytes*100):null,N=typeof window<`u`&&!window.isSecureContext;return(0,j.jsxs)(`div`,{className:`space-y-6`,children:[(0,j.jsx)(Y,{onEnabledChange:o}),!a&&(0,j.jsxs)(`section`,{className:`space-y-3`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h3`,{className:`text-sm font-medium`,children:`Speech to text`}),(0,j.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`What the mic button in the chat box uses. This device only.`})]}),(0,j.jsxs)(`div`,{className:`flex flex-col sm:flex-row gap-2`,children:[(0,j.jsx)($,{label:`Browser`,note:`Text appears as you speak. Chrome, Edge and Safari only — the audio goes to their servers.`,value:`browser`,current:e,onChange:n}),r?.ready&&(0,j.jsx)($,{label:`Whisper on this host`,note:`Works in any browser and the audio never leaves your machine. Text arrives when you stop talking.`,value:`whisper`,current:e,onChange:n})]}),N&&(0,j.jsx)(`p`,{className:`text-xs text-warning`,children:`This page is on plain HTTP, where browsers block the microphone entirely. Open PPM over HTTPS or on localhost to use either engine.`})]}),(0,j.jsx)(D,{}),(0,j.jsxs)(`section`,{className:`space-y-3`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h3`,{className:`text-sm font-medium`,children:`Whisper on this host`}),(0,j.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r?.ready?`Installed — whisper.cpp ${r.version}, model ${r.model?.label}.`:`Runs speech to text on the machine PPM is installed on. Nothing is sent to a cloud service.`})]}),r&&!r.installable&&(r.installHint?(0,j.jsxs)(`div`,{className:`space-y-2`,children:[(0,j.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`There is no prebuilt whisper.cpp for this platform, so it comes from Homebrew:`,` `,(0,j.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5`,children:r.installHint}),`. PPM types it into a terminal; press Enter there, and the models appear here once it is installed.`]}),(0,j.jsx)(k,{command:r.installHint,label:`Install with Homebrew`,onRun:()=>C(!0)})]}):(0,j.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`There is no prebuilt whisper.cpp for this platform. Install it yourself and PPM will find it:`,` `,(0,j.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5`,children:`whisper-cli on PATH`})]})),O&&!O.done&&(0,j.jsxs)(`div`,{className:`space-y-2`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,j.jsx)(c,{className:`size-3.5 animate-spin`}),(0,j.jsxs)(`span`,{children:[Q[O.phase],M===null?`…`:` — ${M}%`]})]}),(0,j.jsx)(`div`,{className:`h-1.5 w-full overflow-hidden rounded-full bg-muted`,children:(0,j.jsx)(`div`,{className:`h-full bg-primary transition-[width]`,style:{width:`${M??0}%`}})})]}),O?.error&&(0,j.jsx)(`p`,{className:`text-xs text-error`,children:O.error}),r?.installable&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`div`,{className:`space-y-2`,children:r.models.map(e=>{let t=s===e.id,n=r.model?.id===e.id;return(0,j.jsxs)(`button`,{type:`button`,onClick:()=>f(e.id),className:v(`w-full rounded-lg border px-4 py-3 text-left transition-colors`,t?`border-primary ring-2 ring-primary`:`border-border hover:bg-muted/50`),children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,j.jsx)(`span`,{className:`text-sm font-medium`,children:e.label}),(0,j.jsxs)(`span`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[n&&(0,j.jsx)(d,{className:`size-3.5 text-success`}),ee(e.bytes)]})]}),(0,j.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.note})]},e.id)})}),(0,j.jsxs)(`div`,{className:`flex flex-col sm:flex-row gap-2`,children:[(0,j.jsxs)(b,{onClick:T,disabled:p||x||!s||r.model?.id===s,className:`flex-1 gap-2 cursor-pointer`,children:[(0,j.jsx)(u,{className:`size-4`}),r.model?r.model.id===s?`Installed`:`Switch to ${r.models.find(e=>e.id===s)?.label}`:`Install`]}),(r.model||r.binary?.source===`bundled`)&&(0,j.jsxs)(b,{variant:`outline`,onClick:E,disabled:p||x,className:`gap-2 cursor-pointer text-error`,children:[(0,j.jsx)(l,{className:`size-4`}),`Remove`]})]})]})]})]})}function $({label:e,note:t,value:n,current:r,onChange:i}){return(0,j.jsxs)(`button`,{type:`button`,onClick:()=>i(n),className:v(`flex-1 rounded-lg border px-4 py-3 text-left transition-colors`,r===n?`border-primary ring-2 ring-primary`:`border-border hover:bg-muted/50`),children:[(0,j.jsxs)(`span`,{className:`flex items-center gap-2 text-sm font-medium`,children:[(0,j.jsx)(o,{className:`size-4`}),e]}),(0,j.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:t})]})}export{te as VoiceSettingsSection};
|
|
1
|
+
import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{t}from"./settings-store-C8OGZwk3.js";import{D as n,E as r}from"./vendor-markdown-26eoXJk7.js";import"./vendor-ui-BQzUk4nq.js";import{$r as i,F as a,Nn as o,Pr as s,Sn as c,Xr as l,ht as u,j as d,lr as f,pi as p}from"./icons-CpR5Vw3J.js";import{j as m,r as h,v as g,y as _}from"./api-client-DSCscZEd.js";import{n as v}from"./utils-DMiycH3O.js";import"./window-store-B_dGEBYm.js";import"./panel-store-D-yxAgT2.js";import{i as y}from"./project-store-BaGmhKos.js";import"./project-framework-store-vI8djw4a.js";import"./session-list-sync-triggers-_I5gGBSe.js";import"./vault-Q5oPy0h3.js";import"./session-collab-zjo6GNuD.js";import{t as b}from"./button-CtdEWN7U.js";import{t as x}from"./input-CCVoN0-P.js";import{t as S}from"./feature-intros-ChY01Oi8.js";import{c as C,d as w,n as T}from"./voice-message-DbyzMM-l.js";import{Rn as E}from"./index-CwW8jYaQ.js";import"./run-in-terminal-CMLJUGsE.js";import{t as D}from"./separator-oOpmQBhw.js";import{r as O}from"./settings-rows-Bb4STWcn.js";import{t as k}from"./run-in-terminal-button-D7aVhM2f.js";var A=e(n(),1),j=r();function M(e,t){let n=t.replace(/\s+/g,` `).trim();return!n||e.some(e=>e.toLowerCase()===n.toLowerCase())?null:[...e,n]}function N({words:e,learned:t=[],placeholder:n,busy:r,onWordsChange:i,onRemoveLearned:a}){let[o,c]=(0,A.useState)(``),l=()=>{let t=M(e,o);c(``),t&&i(t)};return(0,j.jsxs)(`div`,{className:`overflow-hidden rounded-xl border border-border bg-panel`,children:[(0,j.jsxs)(`div`,{className:`flex flex-wrap gap-1.5 px-3.5 py-3 max-md:gap-y-5`,children:[e.length===0&&t.length===0&&(0,j.jsx)(`span`,{className:`text-xs text-text-3`,children:`No words yet.`}),t.map(e=>(0,j.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-full border border-accent-2/40 bg-accent-2/10 py-0.5 pl-2.5 pr-1 font-mono text-[12.5px] text-text`,children:[(0,j.jsx)(s,{className:`size-3 shrink-0 text-accent-2`,"aria-label":`Learned`}),e.word,e.from&&(0,j.jsxs)(`span`,{className:`font-sans text-[11px] text-text-3`,children:[`← `,e.from]}),a&&(0,j.jsx)(P,{label:`Remove learned word ${e.word}`,disabled:r,onClick:()=>a(e.word)})]},`learned-${e.word}`)),e.map(t=>(0,j.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full border border-border-soft bg-panel-2 py-0.5 pl-2.5 pr-1 font-mono text-[12.5px] text-text`,children:[t,(0,j.jsx)(P,{label:`Remove ${t}`,disabled:r,onClick:()=>i(e.filter(e=>e!==t))})]},t))]}),t.length>0&&(0,j.jsxs)(`p`,{className:`flex items-center gap-1.5 px-3.5 pb-2 text-[11.5px] text-text-3`,children:[(0,j.jsx)(s,{className:`size-3 text-accent-2`}),`learned from your corrections`]}),(0,j.jsxs)(`form`,{className:`flex gap-2 px-3.5 pb-3`,onSubmit:e=>{e.preventDefault(),l()},children:[(0,j.jsx)(x,{value:o,onChange:e=>c(e.target.value),placeholder:n,"aria-label":n,disabled:r,className:`h-11 md:h-[34px]`}),(0,j.jsxs)(b,{type:`submit`,variant:`outline`,disabled:r||!o.trim(),className:`h-11 gap-1.5 md:h-[34px]`,children:[(0,j.jsx)(f,{className:`size-3.5`}),`Add`]})]})]})}function P({label:e,disabled:t,onClick:n}){return(0,j.jsx)(`button`,{type:`button`,onClick:n,disabled:t,"aria-label":e,title:e,className:`relative grid size-[18px] shrink-0 place-items-center rounded-full text-text-3 transition-colors before:absolute before:-inset-y-3.5 before:-inset-x-1 before:content-[''] can-hover:hover:bg-surface-hover can-hover:hover:text-text disabled:opacity-50 md:before:-inset-1`,children:(0,j.jsx)(p,{className:`size-3`})})}var F=10080*60*1e3;function I(e,t=new Date){let n=new Date(e);if(Number.isNaN(n.getTime()))return``;let r=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime(),i=Math.round((r(t)-r(n))/864e5);return i<=0?`today ${n.toTimeString().slice(0,5)}`:i===1?`yesterday`:i<7?n.toLocaleDateString(void 0,{weekday:`short`}):n.toLocaleDateString(void 0,{day:`numeric`,month:`short`})}function L(e,t=new Date){let n=`learned ${I(e.at,t)}`;if(!e.lastUsedAt||e.lastUsedAt===e.at)return{text:n,title:n};let r=`used ${I(e.lastUsedAt,t)}`;return{text:r,title:`${n}, last ${r}`}}function R(e){return e.source===`cleanup`?`clean-up · ${e.hits??1}×`:`your edit`}function z(e,t=new Date){let n=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime();return e.filter(e=>Date.parse(e.at)>=n).map(e=>e.word)}function B({learned:e,blocked:t,busy:n,onUndo:r,onRestore:a}){let[o,s]=(0,A.useState)(`week`),c=(0,A.useMemo)(()=>new Date,[e,t]),l=(0,A.useMemo)(()=>[...e].sort((e,t)=>t.at.localeCompare(e.at)),[e]),u=l.filter(e=>c.getTime()-Date.parse(e.at)<F),d=z(e,c),f=o===`week`?u:l;return(0,j.jsxs)(`div`,{className:`overflow-hidden rounded-xl border border-border bg-panel`,"data-voice-learned-list":``,children:[(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 border-b border-border-soft px-3 py-2`,children:[(0,j.jsxs)(V,{active:o===`week`,onClick:()=>s(`week`),children:[`This week · `,u.length]}),(0,j.jsxs)(V,{active:o===`all`,onClick:()=>s(`all`),children:[`All · `,e.length]}),(0,j.jsxs)(V,{active:o===`undone`,onClick:()=>s(`undone`),children:[`Undone · `,t.length]}),(0,j.jsx)(`span`,{className:`flex-1`}),o!==`undone`&&(0,j.jsxs)(b,{variant:`outline`,size:`sm`,disabled:n||d.length===0,onClick:()=>r(d),className:`h-11 w-full border-destructive/40 text-destructive md:h-[30px] md:w-auto`,children:[`Undo everything learned today`,d.length?` (${d.length})`:``]})]}),o===`undone`?t.length===0?(0,j.jsx)(H,{children:`Nothing undone. A word you undo stays here, and is never learned again until you restore it.`}):(0,j.jsx)(`ul`,{children:[...t].sort((e,t)=>t.at.localeCompare(e.at)).map(e=>(0,j.jsx)(U,{word:e.word,heard:e.from,badge:`undone · never again`,when:{text:`undone ${I(e.at,c)}`,title:``},dim:!0,children:(0,j.jsx)(b,{variant:`outline`,size:`sm`,disabled:n,onClick:()=>a(e.word),className:`h-11 md:h-[30px]`,children:`Restore`})},`blocked-${e.word}`))}):f.length===0?(0,j.jsx)(H,{children:o===`week`?`Nothing learned this week.`:`Nothing learned yet. Words appear here once the clean-up has fixed them a few times, or when you correct a transcript.`}):(0,j.jsx)(`ul`,{children:f.map(e=>(0,j.jsx)(U,{word:e.word,heard:e.from,badge:R(e),badgeTone:e.source===`cleanup`?`cleanup`:`edit`,when:L(e,c),phrase:e.kind===`phrase`,children:(0,j.jsxs)(b,{variant:`outline`,size:`sm`,disabled:n,onClick:()=>r([e.word]),className:`h-11 gap-1.5 md:h-[30px]`,"aria-label":`Undo learned word ${e.word}`,children:[(0,j.jsx)(i,{className:`size-3.5`}),`Undo`]})},`learned-${e.word}`))})]})}function V({active:e,onClick:t,children:n}){return(0,j.jsx)(`button`,{type:`button`,onClick:t,"aria-pressed":e,className:v(`h-11 rounded-lg px-2.5 text-[12.5px] md:h-[30px]`,e?`bg-panel-2 text-text`:`text-text-2 hover:text-text`),children:n})}function H({children:e}){return(0,j.jsx)(`p`,{className:`px-4 py-4 text-xs leading-relaxed text-text-3`,children:e})}function U({word:e,heard:t,badge:n,badgeTone:r,when:i,dim:a,phrase:o,children:s}){return(0,j.jsxs)(`li`,{className:v(`grid grid-cols-[minmax(0,1fr)_auto] items-center gap-x-3 gap-y-1 border-t border-border-soft px-4 py-2.5 first:border-t-0`,`md:grid-cols-[minmax(0,1.2fr)_minmax(0,1fr)_auto_9.5rem_auto]`,a&&`text-text-dim`),children:[(0,j.jsx)(`span`,{className:`min-w-0 truncate text-sm font-semibold`,title:o?`Only the clean-up uses this one; Whisper is not told.`:void 0,children:e}),(0,j.jsx)(`span`,{className:`col-span-2 row-start-2 min-w-0 truncate text-[12.5px] text-text-3 line-through md:col-span-1 md:row-start-auto`,children:t}),(0,j.jsxs)(`span`,{className:`col-span-2 row-start-3 flex items-center gap-2 md:col-span-1 md:row-start-auto`,children:[(0,j.jsx)(`span`,{className:v(`whitespace-nowrap rounded-full border px-2 py-0.5 text-[10.5px]`,r===`cleanup`?`border-accent-2/40 text-accent-2`:r===`edit`?`border-warning/40 text-warning`:`border-border text-text-3`),children:n}),(0,j.jsx)(`span`,{className:`text-xs text-text-3 md:hidden`,title:i.title||void 0,children:i.text})]}),(0,j.jsx)(`span`,{className:`hidden text-xs text-text-3 md:block`,title:i.title||void 0,children:i.text}),(0,j.jsx)(`span`,{className:`col-start-2 row-start-1 justify-self-end md:col-start-auto md:row-start-auto`,children:s})]})}var W={typed:{label:`your words`,dot:`bg-warning`,text:`text-text`},learned:{label:`learned`,dot:`bg-accent-2`,text:`text-text`},picked:{label:`picked up`,dot:`bg-primary`,text:`text-text-2`}},G=e=>e.reduce((e,t,n)=>e+t.word.length+(n?2:0),0);function K({view:e,busy:t,projectSelect:n,save:r}){let i=e.selfLearning;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(J,{title:`Self-learning`,children:[(0,j.jsx)(O,{label:`Learn your words by itself`,note:`Without anyone editing a transcript, PPM picks up names and task codes for Whisper and learns a word once the clean-up has fixed it the same way a few times. Learned words work at once; undo any of them below.`,checked:i,disabled:t,onChange:e=>r({selfLearning:e})}),i&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(O,{label:`Pick up words from the project`,note:`Project and chat names, recent task codes and titles, and CLAUDE.md terms, refreshed once a day. A project gets only its own words; the PPM Assistant gets every project's.`,checked:e.learnAutoVocabulary,disabled:t,onChange:e=>r({learnAutoVocabulary:e})}),(0,j.jsx)(O,{label:`Learn from the clean-up's corrections`,note:e.cleanupEnabled?`A word the clean-up fixed the same way in three messages (two when the project already uses it) is learned, and one nobody says for 30 days leaves the list by itself. No extra Haiku call.`:`Needs the Haiku clean-up, which is off.`,checked:e.learnFromCleanup&&e.cleanupEnabled,disabled:t||!e.cleanupEnabled,onChange:e=>r({learnFromCleanup:e})}),(0,j.jsx)(O,{label:`Weekly summary`,note:`Monday's morning digest lists the words learned that week. It asks nothing; undo here any time.`,checked:e.weeklySummary,disabled:t,onChange:e=>r({weeklySummary:e})})]})]}),i&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(J,{title:(0,j.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2`,children:[`What Whisper hears first `,n]}),bare:!0,children:(0,j.jsx)(q,{words:e.whisperPrompt,max:e.whisperPromptMaxChars})}),(0,j.jsx)(J,{title:`Learned words · this project`,bare:!0,children:(0,j.jsx)(B,{learned:e.projectLearned,blocked:e.projectBlocked,busy:t,onUndo:e=>r({removeLearned:e}),onRestore:e=>r({restoreBlocked:[e]})})})]})]})}function q({words:e,max:t}){let n=G(e),r=n=>e.filter(e=>e.source===n).reduce((e,t)=>e+t.word.length+2,0)/Math.max(t,1);return(0,j.jsxs)(`div`,{className:`overflow-hidden rounded-xl border border-border bg-panel`,"data-voice-prompt-preview":``,children:[(0,j.jsx)(`p`,{className:`break-words px-4 py-3 font-mono text-xs leading-relaxed`,children:e.length===0?(0,j.jsx)(`span`,{className:`text-text-3`,children:`Nothing yet: add words above, or wait for the first picked-up list.`}):e.map((t,n)=>(0,j.jsxs)(`span`,{className:W[t.source].text,children:[t.word,n<e.length-1?`, `:``]},`${n}:${t.word}`))}),(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1.5 border-t border-border-soft px-4 py-2.5 text-xs text-text-2`,children:[(0,j.jsxs)(`span`,{className:`font-mono`,children:[n,` / `,t,` characters`]}),(0,j.jsx)(`span`,{className:`flex h-1.5 min-w-24 flex-1 overflow-hidden rounded-full bg-panel-2`,"aria-hidden":!0,children:[`typed`,`learned`,`picked`].map(e=>(0,j.jsx)(`span`,{className:v(`h-full`,W[e].dot),style:{width:`${Math.min(100,r(e)*100)}%`}},e))}),(0,j.jsx)(`span`,{className:`flex flex-wrap gap-3`,children:[`typed`,`learned`,`picked`].map(e=>(0,j.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,j.jsx)(`span`,{className:v(`size-2 rounded-full`,W[e].dot)}),W[e].label]},e))})]})]})}function J({title:e,children:t,bare:n}){return(0,j.jsxs)(`section`,{children:[(0,j.jsx)(`div`,{className:`mb-2 text-[11px] font-semibold uppercase tracking-wider text-text-3`,children:e}),n?t:(0,j.jsx)(`div`,{className:`divide-y divide-border-soft overflow-hidden rounded-xl border border-border bg-panel`,children:t})]})}function Y({onEnabledChange:e}){let t=y(e=>e.projects),n=y(e=>e.activeProject?.name),[r,i]=(0,A.useState)(()=>(n&&!_(n)?n:t[0]?.name)??`__assistant__`),[o,s]=(0,A.useState)(null),[c,l]=(0,A.useState)(!1),[u,d]=(0,A.useState)(!1),[f,p]=(0,A.useState)(0);E(`voice`,()=>p(e=>e+1)),(0,A.useEffect)(()=>{let e=!0,t=()=>C(r).then(t=>{e&&(s(t),l(!1))}).catch(()=>{e&&l(!0)});return t(),window.addEventListener(S,t),()=>{e=!1,window.removeEventListener(S,t)}},[r,f]),(0,A.useEffect)(()=>{o&&e?.(o.enabled)},[o,e]);let h=(0,A.useCallback)(async e=>{d(!0);try{s(await w({project:r,...e}))}catch(e){m.error(`Could not save the voice settings`,{description:e instanceof Error?e.message:String(e)})}finally{d(!1)}},[r]);if(c||!o)return null;let v=r===`__assistant__`?`PPM Assistant`:r,b=(0,j.jsxs)(`label`,{className:`relative inline-flex items-center`,children:[(0,j.jsxs)(`select`,{value:r,onChange:e=>i(e.target.value),"aria-label":`Project`,className:`h-11 appearance-none rounded-lg border border-border bg-panel py-0 pl-2.5 pr-7 text-[12.5px] font-medium normal-case tracking-normal text-text md:h-[30px]`,children:[t.filter(e=>!_(e.name)).map(e=>(0,j.jsx)(`option`,{value:e.name,children:e.name},e.name)),(0,j.jsx)(`option`,{value:g,children:`PPM Assistant`})]}),(0,j.jsx)(a,{className:`pointer-events-none absolute right-2 size-3 text-text-3`})]});return(0,j.jsxs)(`div`,{className:`space-y-6`,children:[(0,j.jsxs)(X,{title:`Voice messages`,children:[(0,j.jsx)(O,{label:`Voice messages`,note:`The mic in the chat box records a message: Whisper turns it into text on this host, then it is tidied for you to read. Off: the mic dictates into the box as before.`,checked:o.enabled,disabled:u,onChange:e=>void h({enabled:e})}),o.enabled&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(O,{label:`Read the transcript before it is sent`,note:`Off: the transcript goes to the AI as soon as it is ready. When the clean-up fails it always waits for you.`,checked:o.reviewBeforeSend,disabled:u,onChange:e=>void h({reviewBeforeSend:e})}),(0,j.jsx)(O,{label:`Tidy the transcript with Claude Haiku`,note:`One call per message on your Claude account. Reads the last 8 messages, memory and CLAUDE.md, file names and your word lists, and fixes misheard words and punctuation only. It also learns words from your edits. Off: Whisper's transcript is used as it is and Haiku is never called; your word lists still help Whisper.`,checked:o.cleanupEnabled,disabled:u,onChange:e=>void h({cleanupEnabled:e})}),o.cleanupEnabled&&(0,j.jsx)(O,{label:`Fix Vietnamese words by context`,note:`The clean-up also fixes ordinary words Whisper misheard ("ta lệnh" → "ra lệnh") when the sentence makes the meaning clear. The Telegram card lists every word it changed.`,checked:o.vietnameseFixes,disabled:u,onChange:e=>void h({vietnameseFixes:e})}),(0,j.jsx)(Z,{label:`Longest recording`,value:T(120)}),!o.whisperReady&&(0,j.jsx)(Z,{label:`Whisper`,children:`Not installed on this host yet. Install it below; until then the mic offers the install.`})]})]}),o.enabled&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(X,{title:`Words · all projects`,bare:!0,children:(0,j.jsx)(N,{words:o.words,placeholder:`Add a word or name…`,busy:u,onWordsChange:e=>void h({words:e})})}),(0,j.jsx)(X,{bare:!0,title:(0,j.jsxs)(`span`,{className:`flex items-center gap-2`,children:[`Words · project`,b]}),children:(0,j.jsx)(N,{words:o.projectWords,learned:o.selfLearning?[]:o.projectLearned,placeholder:`Add a word for ${v}…`,busy:u,onWordsChange:e=>void h({projectWords:e}),onRemoveLearned:e=>void h({removeLearned:[e]})})}),(0,j.jsx)(K,{view:o,busy:u,projectSelect:b,save:e=>void h(e)})]})]})}function X({title:e,children:t,bare:n}){return(0,j.jsxs)(`section`,{children:[(0,j.jsx)(`div`,{className:`mb-2 text-[11px] font-semibold uppercase tracking-wider text-text-3`,children:e}),n?t:(0,j.jsx)(`div`,{className:`divide-y divide-border-soft overflow-hidden rounded-xl border border-border bg-panel`,children:t})]})}function Z({label:e,value:t,children:n}){return(0,j.jsxs)(`div`,{className:`flex min-h-11 items-center gap-3 px-4 py-2.5`,children:[(0,j.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,j.jsx)(`p`,{className:`text-sm`,children:e}),n&&(0,j.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:n})]}),t&&(0,j.jsx)(`span`,{className:`shrink-0 font-mono text-xs text-text-2`,children:t})]})}var Q={binary:`Downloading whisper.cpp`,model:`Downloading the model`,vad:`Downloading the voice detector`,verify:`Checking it runs here`},ee=e=>`${Math.round(e/1e6)} MB`;function te(){let e=t(e=>e.voiceEngine),n=t(e=>e.setVoiceEngine),[r,i]=(0,A.useState)(null),[a,o]=(0,A.useState)(!1),[s,f]=(0,A.useState)(null),[p,g]=(0,A.useState)(!1),_=(0,A.useRef)(null),y=(0,A.useCallback)(async()=>{try{let e=await h.get(`/api/speech/status`);i(e),f(t=>t??e.model?.id??e.models.at(-1)?.id??null)}catch{}},[]);(0,A.useEffect)(()=>{y()},[y]);let x=!!r?.install&&!r.install.done;(0,A.useEffect)(()=>{if(x)return _.current=setTimeout(()=>void y(),700),()=>{_.current&&clearTimeout(_.current)}},[x,r,y]);let[S,C]=(0,A.useState)(!1),w=!!r?.installable;(0,A.useEffect)(()=>{if(!S||w)return;let e=setInterval(()=>{document.visibilityState===`visible`&&y()},4e3),t=setTimeout(()=>C(!1),10*6e4);return()=>{clearInterval(e),clearTimeout(t)}},[S,w,y]),(0,A.useEffect)(()=>{r&&!r.ready&&e===`whisper`&&n(`browser`)},[r,e,n]);let T=async()=>{if(s){g(!0);try{await h.post(`/api/speech/install`,{model:s}),await y()}catch(e){m.error(`Could not start the install`,{description:e instanceof Error?e.message:String(e)})}finally{g(!1)}}},E=async()=>{g(!0);try{await h.post(`/api/speech/uninstall`),n(`browser`),await y()}catch(e){m.error(`Could not remove Whisper`,{description:e instanceof Error?e.message:String(e)})}finally{g(!1)}},O=r?.install??null,M=O&&O.totalBytes>0?Math.round(O.receivedBytes/O.totalBytes*100):null,N=typeof window<`u`&&!window.isSecureContext;return(0,j.jsxs)(`div`,{className:`space-y-6`,children:[(0,j.jsx)(Y,{onEnabledChange:o}),!a&&(0,j.jsxs)(`section`,{className:`space-y-3`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h3`,{className:`text-sm font-medium`,children:`Speech to text`}),(0,j.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`What the mic button in the chat box uses. This device only.`})]}),(0,j.jsxs)(`div`,{className:`flex flex-col sm:flex-row gap-2`,children:[(0,j.jsx)($,{label:`Browser`,note:`Text appears as you speak. Chrome, Edge and Safari only — the audio goes to their servers.`,value:`browser`,current:e,onChange:n}),r?.ready&&(0,j.jsx)($,{label:`Whisper on this host`,note:`Works in any browser and the audio never leaves your machine. Text arrives when you stop talking.`,value:`whisper`,current:e,onChange:n})]}),N&&(0,j.jsx)(`p`,{className:`text-xs text-warning`,children:`This page is on plain HTTP, where browsers block the microphone entirely. Open PPM over HTTPS or on localhost to use either engine.`})]}),(0,j.jsx)(D,{}),(0,j.jsxs)(`section`,{className:`space-y-3`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h3`,{className:`text-sm font-medium`,children:`Whisper on this host`}),(0,j.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r?.ready?`Installed — whisper.cpp ${r.version}, model ${r.model?.label}.`:`Runs speech to text on the machine PPM is installed on. Nothing is sent to a cloud service.`})]}),r&&!r.installable&&(r.installHint?(0,j.jsxs)(`div`,{className:`space-y-2`,children:[(0,j.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`There is no prebuilt whisper.cpp for this platform, so it comes from Homebrew:`,` `,(0,j.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5`,children:r.installHint}),`. PPM types it into a terminal; press Enter there, and the models appear here once it is installed.`]}),(0,j.jsx)(k,{command:r.installHint,label:`Install with Homebrew`,onRun:()=>C(!0)})]}):(0,j.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`There is no prebuilt whisper.cpp for this platform. Install it yourself and PPM will find it:`,` `,(0,j.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5`,children:`whisper-cli on PATH`})]})),O&&!O.done&&(0,j.jsxs)(`div`,{className:`space-y-2`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,j.jsx)(c,{className:`size-3.5 animate-spin`}),(0,j.jsxs)(`span`,{children:[Q[O.phase],M===null?`…`:` — ${M}%`]})]}),(0,j.jsx)(`div`,{className:`h-1.5 w-full overflow-hidden rounded-full bg-muted`,children:(0,j.jsx)(`div`,{className:`h-full bg-primary transition-[width]`,style:{width:`${M??0}%`}})})]}),O?.error&&(0,j.jsx)(`p`,{className:`text-xs text-error`,children:O.error}),r?.installable&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`div`,{className:`space-y-2`,children:r.models.map(e=>{let t=s===e.id,n=r.model?.id===e.id;return(0,j.jsxs)(`button`,{type:`button`,onClick:()=>f(e.id),className:v(`w-full rounded-lg border px-4 py-3 text-left transition-colors`,t?`border-primary ring-2 ring-primary`:`border-border hover:bg-muted/50`),children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,j.jsx)(`span`,{className:`text-sm font-medium`,children:e.label}),(0,j.jsxs)(`span`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[n&&(0,j.jsx)(d,{className:`size-3.5 text-success`}),ee(e.bytes)]})]}),(0,j.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.note})]},e.id)})}),(0,j.jsxs)(`div`,{className:`flex flex-col sm:flex-row gap-2`,children:[(0,j.jsxs)(b,{onClick:T,disabled:p||x||!s||r.model?.id===s,className:`flex-1 gap-2 cursor-pointer`,children:[(0,j.jsx)(u,{className:`size-4`}),r.model?r.model.id===s?`Installed`:`Switch to ${r.models.find(e=>e.id===s)?.label}`:`Install`]}),(r.model||r.binary?.source===`bundled`)&&(0,j.jsxs)(b,{variant:`outline`,onClick:E,disabled:p||x,className:`gap-2 cursor-pointer text-error`,children:[(0,j.jsx)(l,{className:`size-4`}),`Remove`]})]})]})]})]})}function $({label:e,note:t,value:n,current:r,onChange:i}){return(0,j.jsxs)(`button`,{type:`button`,onClick:()=>i(n),className:v(`flex-1 rounded-lg border px-4 py-3 text-left transition-colors`,r===n?`border-primary ring-2 ring-primary`:`border-border hover:bg-muted/50`),children:[(0,j.jsxs)(`span`,{className:`flex items-center gap-2 text-sm font-medium`,children:[(0,j.jsx)(o,{className:`size-4`}),e]}),(0,j.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:t})]})}export{te as VoiceSettingsSection};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import"./settings-store-C8OGZwk3.js";import{D as t,E as n}from"./vendor-markdown-26eoXJk7.js";import"./vendor-ui-BQzUk4nq.js";import{Kt as r,gt as i,j as a,ut as o,wn as s,yr as c}from"./icons-CpR5Vw3J.js";import{j as l}from"./api-client-DSCscZEd.js";import"./window-store-B_dGEBYm.js";import{t as u}from"./panel-store-D-yxAgT2.js";import"./project-store-BaGmhKos.js";import"./project-framework-store-vI8djw4a.js";import"./session-list-sync-triggers-_I5gGBSe.js";import{r as d}from"./clipboard-DQuoK2EM.js";import{Pn as f,jn as p}from"./index-
|
|
1
|
+
import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import"./settings-store-C8OGZwk3.js";import{D as t,E as n}from"./vendor-markdown-26eoXJk7.js";import"./vendor-ui-BQzUk4nq.js";import{Kt as r,gt as i,j as a,ut as o,wn as s,yr as c}from"./icons-CpR5Vw3J.js";import{j as l}from"./api-client-DSCscZEd.js";import"./window-store-B_dGEBYm.js";import{t as u}from"./panel-store-D-yxAgT2.js";import"./project-store-BaGmhKos.js";import"./project-framework-store-vI8djw4a.js";import"./session-list-sync-triggers-_I5gGBSe.js";import{r as d}from"./clipboard-DQuoK2EM.js";import{Pn as f,jn as p}from"./index-CwW8jYaQ.js";var m=e(t(),1),h=n(),g=`flex items-center justify-center shrink-0 rounded min-h-11 min-w-11 md:min-h-7 md:min-w-7 text-muted-foreground hover:text-foreground hover:bg-muted`,_=3e3;function v(){return Promise.race([p.allowFraming(window.location.origin).then(()=>void 0,()=>void 0),new Promise(e=>setTimeout(e,_))])}function y({metadata:e,tabId:t}){let n=f(e?.url,window.location.origin),p=f(e?.currentUrl,window.location.origin),_=p&&n&&new URL(p).origin===new URL(n).origin?p:n,[y,b]=(0,m.useState)(_),[x,S]=(0,m.useState)(_),C=(0,m.useRef)(null),w=`${n}:${String(e?.aiOpenAt??``)}`,T=(0,m.useRef)(w),E=e?.via===`tailscale`||e?.via===`local`,[D,O]=(0,m.useState)(0),[k,A]=(0,m.useState)(!1),[j,M]=(0,m.useState)(!1);if((0,m.useEffect)(()=>{T.current!==w&&(T.current=w,b(n),S(n))},[w,n]),(0,m.useEffect)(()=>{let e=e=>{if(!n||!C.current?.contentWindow||e.source!==C.current.contentWindow||e.origin!==new URL(n).origin||e.data?.ppm!==`web-preview-navigation`)return;let r=f(e.data.url,window.location.origin);if(!(!r||new URL(r).origin!==e.origin)&&(b(r),t)){let e=u.getState(),n=Object.values(e.panels).flatMap(e=>e.tabs).find(e=>e.id===t);n&&n.metadata?.currentUrl!==r&&e.updateTab(t,{metadata:{...n.metadata,currentUrl:r}})}};return window.addEventListener(`message`,e),()=>window.removeEventListener(`message`,e)},[n,t]),(0,m.useEffect)(()=>{let e=!0;return v().then(()=>{e&&M(!0)}),()=>{e=!1}},[]),!y)return(0,h.jsx)(`div`,{role:`alert`,className:`p-4 text-sm text-destructive`,children:`This preview has no address PPM can show.`});let N=()=>{d(y).then(e=>{if(!e){l.error(`Failed to copy URL`);return}A(!0),setTimeout(()=>A(!1),2e3)})};return(0,h.jsxs)(`div`,{className:`flex h-full w-full flex-col-reverse md:flex-col bg-background`,children:[(0,h.jsxs)(`div`,{role:`toolbar`,"aria-label":`Web preview`,className:`flex items-center gap-2 md:gap-1 shrink-0 h-12 md:h-8 px-2 border-t md:border-t-0 md:border-b border-border`,children:[(0,h.jsx)(`span`,{className:`flex items-center justify-center shrink-0 size-7 text-muted-foreground`,title:e?.via===`local`?`Private: only this machine can open this address`:E?`Private: only devices in your tailnet can open this address`:`Public: anyone with this link can open it`,children:E?(0,h.jsx)(s,{className:`size-3.5`}):(0,h.jsx)(r,{className:`size-3.5`})}),(0,h.jsx)(`span`,{className:`flex-1 min-w-0 truncate text-xs text-muted-foreground select-all`,children:y}),(0,h.jsx)(`button`,{type:`button`,onClick:()=>void v().then(()=>{S(y),O(e=>e+1)}),title:`Reload`,"aria-label":`Reload`,className:g,children:(0,h.jsx)(c,{className:`size-4`})}),(0,h.jsx)(`button`,{type:`button`,onClick:N,title:`Copy URL`,"aria-label":`Copy URL`,className:g,children:k?(0,h.jsx)(a,{className:`size-4 text-success`}):(0,h.jsx)(o,{className:`size-4`})}),(0,h.jsx)(`a`,{href:y,target:`_blank`,rel:`noopener noreferrer`,title:`Open in browser`,"aria-label":`Open in browser`,className:g,children:(0,h.jsx)(i,{className:`size-4`})})]}),j?(0,h.jsx)(`iframe`,{ref:C,title:`Preview of ${y}`,src:x??void 0,sandbox:`allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox allow-modals allow-downloads`,allow:`clipboard-read; clipboard-write; fullscreen`,referrerPolicy:`no-referrer`,className:`flex-1 min-h-0 w-full border-0 bg-white`},`${D}:${String(e?.aiOpenAt??``)}`):(0,h.jsx)(`div`,{className:`flex-1 min-h-0 w-full bg-white`})]})}export{y as WebPreviewTab};
|
|
Binary file
|
|
Binary file
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-26eoXJk7.js";import"./vendor-ui-BQzUk4nq.js";import{Ot as r,Sn as i}from"./icons-CpR5Vw3J.js";import{n as a,o,r as s}from"./api-client-DSCscZEd.js";import{Qr as c}from"./index-
|
|
1
|
+
import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-26eoXJk7.js";import"./vendor-ui-BQzUk4nq.js";import{Ot as r,Sn as i}from"./icons-CpR5Vw3J.js";import{n as a,o,r as s}from"./api-client-DSCscZEd.js";import{Qr as c}from"./index-CwW8jYaQ.js";var l=e(t(),1);function u(e,t){return e===404&&t!==0?0:null}var d=7.2,f=18;function p(e,t){let n=Array(t).fill(0),r=Math.min(e.length,200);for(let i=0;i<r;i++){let r=e[i];for(let e=0;e<Math.min(r.length,t);e++){let t=r[e];if(!t)continue;let i=0;for(let e of t.split(`
|
|
2
2
|
`))i=Math.max(i,e.length);i>n[e]&&(n[e]=i)}}return n.map(e=>Math.round(Math.min(320,Math.max(64,e*d+f))))}function m(e){let t=e+1,n=``;for(;t>0;){let e=(t-1)%26;n=String.fromCharCode(65+e)+n,t=Math.floor((t-1)/26)}return n}var h=n(),g=28,_=52;function v(e,t,n){return`${/^(\/|[A-Za-z]:[/\\])/.test(e)?`/api/fs/xlsx-sheet`:`${o(t)}/files/xlsx-sheet`}?path=${encodeURIComponent(e)}&sheet=${n}`}function y({filePath:e,projectName:t}){let[n,o]=(0,l.useState)(null),[d,f]=(0,l.useState)(null),[y,b]=(0,l.useState)(!0),[x,S]=(0,l.useState)(null),[C,w]=(0,l.useState)(null),T=(0,l.useRef)(null),E=(0,l.useRef)(0),D=(0,l.useRef)(0);D.current=n?.sheet??0;let O=(0,l.useRef)(null);O.current=d;let k=(0,l.useCallback)((n,r)=>{let i=++E.current;r||f(n),b(!0),s.get(v(e,t,n)).then(e=>{i===E.current&&(e.sheet!==D.current&&w(null),o(e),S(null),f(null),b(!1))}).catch(e=>{if(i!==E.current)return;let t=u(e instanceof a?e.status:void 0,n);if(t!==null){k(t,r);return}S(e instanceof Error?e.message:`Failed to read workbook`),f(null),b(!1)})},[e,t]);(0,l.useEffect)(()=>(o(null),w(null),S(null),k(0,!1),()=>{E.current++}),[k]),(0,l.useEffect)(()=>{let n=n=>{let r=n.detail;if(r.projectName!==t||r.path!==e)return;let i=O.current;k(i??D.current,i===null)};return window.addEventListener(`file:changed`,n),()=>window.removeEventListener(`file:changed`,n)},[e,t,k]);let A=n?.rows??[],j=n?.columns??0,M=(0,l.useMemo)(()=>p(A,j),[A,j]),N=_+M.reduce((e,t)=>e+t,0),P=c({count:A.length,getScrollElement:()=>T.current,estimateSize:()=>g,overscan:20});if((0,l.useEffect)(()=>{T.current?.scrollTo({top:0,left:0})},[n?.sheet]),!n&&y)return(0,h.jsxs)(`div`,{className:`flex items-center justify-center h-full gap-2 text-text-secondary`,children:[(0,h.jsx)(i,{className:`size-5 animate-spin`}),(0,h.jsx)(`span`,{className:`text-sm`,children:`Reading workbook...`})]});if(!n)return(0,h.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-3 text-text-secondary px-6 text-center`,children:[(0,h.jsx)(r,{className:`size-10 text-text-subtle`}),(0,h.jsx)(`p`,{className:`text-sm`,children:`Failed to load workbook.`}),(0,h.jsx)(`p`,{className:`text-xs text-text-subtle`,children:x})]});let F=d??n.sheet,I=C?A[C.row]?.[C.col]??``:``,L=[n.truncatedRows&&`Showing the first ${A.length.toLocaleString()} rows`,n.truncatedColumns&&`Showing the first ${j} columns`].filter(Boolean);return(0,h.jsxs)(`div`,{className:`flex flex-col h-full min-h-0`,children:[x&&(0,h.jsx)(`div`,{role:`alert`,"data-testid":`xlsx-error`,className:`shrink-0 px-3 py-1.5 text-xs text-error bg-background border-b border-border`,children:x}),L.length>0&&(0,h.jsx)(`div`,{className:`shrink-0 px-3 py-1.5 text-xs text-text-secondary bg-muted/50 border-b border-border`,children:L.join(` · `)}),(0,h.jsxs)(`div`,{className:`shrink-0 flex items-stretch min-h-8 border-b border-border text-xs font-mono`,children:[(0,h.jsx)(`div`,{"data-testid":`xlsx-cell-ref`,className:`shrink-0 w-16 flex items-center justify-center border-r border-border text-text-secondary select-none`,children:C?`${m(C.col)}${C.row+1}`:``}),(0,h.jsx)(`div`,{"data-testid":`xlsx-cell-value`,className:`flex-1 min-w-0 max-h-24 overflow-auto px-2 py-1.5 whitespace-pre-wrap break-words select-text`,children:C?I:(0,h.jsx)(`span`,{className:`text-text-subtle select-none`,children:`Tap a cell to see its full value`})})]}),(0,h.jsx)(`div`,{ref:T,className:`relative flex-1 min-h-0 overflow-auto`,children:A.length===0?(0,h.jsx)(`div`,{className:`flex items-center justify-center h-full text-muted-foreground text-sm`,children:`Empty sheet`}):(0,h.jsxs)(`div`,{className:`text-xs font-mono`,style:{width:N,minWidth:`100%`},children:[(0,h.jsxs)(`div`,{className:`sticky top-0 z-10 flex bg-background border-b border-border`,style:{height:g},children:[(0,h.jsx)(`div`,{className:`sticky left-0 z-10 shrink-0 bg-background border-r border-border`,style:{width:_}}),M.map((e,t)=>(0,h.jsx)(`div`,{className:`shrink-0 flex items-center justify-center text-muted-foreground font-medium border-r border-border/50 select-none`,style:{width:e},children:m(t)},t))]}),(0,h.jsx)(`div`,{style:{height:P.getTotalSize(),position:`relative`},children:P.getVirtualItems().map(e=>{let t=A[e.index];return(0,h.jsxs)(`div`,{className:`absolute left-0 flex border-b border-border/50`,style:{top:0,height:g,width:N,transform:`translateY(${e.start}px)`},children:[(0,h.jsx)(`div`,{className:`sticky left-0 z-[1] shrink-0 flex items-center justify-end pr-2 bg-background text-muted-foreground border-r border-border select-none`,style:{width:_},children:e.index+1}),M.map((n,r)=>{let i=t[r],a=C?.row===e.index&&C.col===r;return(0,h.jsx)(`div`,{"data-cell":`${m(r)}${e.index+1}`,onClick:()=>w({row:e.index,col:r}),className:`shrink-0 px-2 flex items-center border-r border-r-border/30 overflow-hidden cursor-cell ${a?`outline outline-2 -outline-offset-2 outline-primary`:``}`,style:{width:n},children:(0,h.jsx)(`span`,{className:`truncate`,children:i??``})},r)})]},e.index)})})]})}),n.sheets.length>0&&(0,h.jsxs)(`div`,{className:`shrink-0 flex overflow-x-auto border-t border-border bg-muted/30`,role:`tablist`,"aria-label":`Sheets`,children:[n.sheets.map((e,t)=>(0,h.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":t===F,onClick:()=>{t!==F&&k(t,!1)},className:`shrink-0 min-h-8 pointer-coarse:min-h-11 px-4 text-xs whitespace-nowrap border-r border-border ${t===F?`bg-background text-foreground font-medium`:`text-text-secondary hover:bg-muted/50`}`,children:e||`Sheet ${t+1}`},t)),y&&(0,h.jsx)(i,{className:`size-4 animate-spin self-center mx-3 text-text-secondary`})]})]})}export{y as XlsxPreview};
|
|
Binary file
|
|
Binary file
|
package/dist/web/index.html
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<meta name="theme-color" content="#0f1419" />
|
|
7
7
|
<title>PPM — Personal Project Manager</title>
|
|
8
8
|
<link rel="icon" id="ppm-favicon" type="image/svg+xml" href="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2032%2032%22%3E%0A%20%20%3Crect%20width%3D%2232%22%20height%3D%2232%22%20rx%3D%226%22%20fill%3D%22%233b82f6%22%2F%3E%0A%20%20%3Ctext%20x%3D%2216%22%20y%3D%2222%22%20text-anchor%3D%22middle%22%20font-family%3D%22system-ui%2Csans-serif%22%20font-weight%3D%22700%22%20font-size%3D%2211%22%20fill%3D%22white%22%3EPPM%3C%2Ftext%3E%0A%3C%2Fsvg%3E" />
|
|
9
|
-
<script type="module" crossorigin src="/assets/index-
|
|
9
|
+
<script type="module" crossorigin src="/assets/index-CwW8jYaQ.js"></script>
|
|
10
10
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-C5c2KzVm.js">
|
|
11
11
|
<link rel="modulepreload" crossorigin href="/assets/preload-helper-uTix4PVD.js">
|
|
12
12
|
<link rel="modulepreload" crossorigin href="/assets/vendor-markdown-26eoXJk7.js">
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
<link rel="modulepreload" crossorigin href="/assets/design-canvas-check-DahR87XO.js">
|
|
64
64
|
<link rel="modulepreload" crossorigin href="/assets/input-CCVoN0-P.js">
|
|
65
65
|
<link rel="modulepreload" crossorigin href="/assets/model-thinking-selector-helpers-Ii9MVjOq.js">
|
|
66
|
-
<link rel="modulepreload" crossorigin href="/assets/file-store-
|
|
66
|
+
<link rel="modulepreload" crossorigin href="/assets/file-store-DvNGR1CA.js">
|
|
67
67
|
<link rel="modulepreload" crossorigin href="/assets/slash-command-picker-xIZbJS-p.js">
|
|
68
68
|
<link rel="modulepreload" crossorigin href="/assets/use-manager-chats-7IXu1wX5.js">
|
|
69
69
|
<link rel="modulepreload" crossorigin href="/assets/open-chat-in-window-CZaKKuqs.js">
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
<link rel="modulepreload" crossorigin href="/assets/send-to-chat-BJ_Ychvo.js">
|
|
98
98
|
<link rel="modulepreload" crossorigin href="/assets/notification-store-hHQ6I1WT.js">
|
|
99
99
|
<link rel="modulepreload" crossorigin href="/assets/unsaved-grid-rows-store-DKZSxIbb.js">
|
|
100
|
-
<link rel="modulepreload" crossorigin href="/assets/build-message-with-attachments-
|
|
100
|
+
<link rel="modulepreload" crossorigin href="/assets/build-message-with-attachments-Co6REDSl.js">
|
|
101
101
|
<link rel="modulepreload" crossorigin href="/assets/sql-identifiers-D62yiJWh.js">
|
|
102
102
|
<link rel="modulepreload" crossorigin href="/assets/db-explorer-store-C7GIVWvY.js">
|
|
103
103
|
<link rel="modulepreload" crossorigin href="/assets/fs-api-COsHlRxJ.js">
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
<link rel="modulepreload" crossorigin href="/assets/streaming-store-Dq4AjFuk.js">
|
|
113
113
|
<link rel="modulepreload" crossorigin href="/assets/apply-theme-BeLRfsSu.js">
|
|
114
114
|
<link rel="modulepreload" crossorigin href="/assets/resolve-theme-BHAgAaFk.js">
|
|
115
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
115
|
+
<link rel="stylesheet" crossorigin href="/assets/index-0VrQhdqv.css">
|
|
116
116
|
<link rel="manifest" href="/manifest.webmanifest"><script id="vite-plugin-pwa:register-sw" src="/registerSW.js"></script></head>
|
|
117
117
|
<body class="text-text font-sans antialiased" style="background: var(--bg)">
|
|
118
118
|
<!-- FOUC guard: apply the persisted theme mode before first paint.
|
package/dist/web/index.html.br
CHANGED
|
Binary file
|
package/dist/web/index.html.gz
CHANGED
|
Binary file
|
package/dist/web/sw.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
try{self[`workbox:core:7.3.0`]&&_()}catch{}var e=(e,...t)=>{let n=e;return t.length>0&&(n+=` :: ${JSON.stringify(t)}`),n},t=class extends Error{constructor(t,n){let r=e(t,n);super(r),this.name=t,this.details=n}},n={googleAnalytics:`googleAnalytics`,precache:`precache-v2`,prefix:`workbox`,runtime:`runtime`,suffix:typeof registration<`u`?registration.scope:``},r=e=>[n.prefix,e,n.suffix].filter(e=>e&&e.length>0).join(`-`),i=e=>{for(let t of Object.keys(n))e(t)},a={updateDetails:e=>{i(t=>{typeof e[t]==`string`&&(n[t]=e[t])})},getGoogleAnalyticsName:e=>e||r(n.googleAnalytics),getPrecacheName:e=>e||r(n.precache),getPrefix:()=>n.prefix,getRuntimeName:e=>e||r(n.runtime),getSuffix:()=>n.suffix};function o(e,t){let n=t();return e.waitUntil(n),n}try{self[`workbox:precaching:7.3.0`]&&_()}catch{}var s=`__WB_REVISION__`;function c(e){if(!e)throw new t(`add-to-cache-list-unexpected-type`,{entry:e});if(typeof e==`string`){let t=new URL(e,location.href);return{cacheKey:t.href,url:t.href}}let{revision:n,url:r}=e;if(!r)throw new t(`add-to-cache-list-unexpected-type`,{entry:e});if(!n){let e=new URL(r,location.href);return{cacheKey:e.href,url:e.href}}let i=new URL(r,location.href),a=new URL(r,location.href);return i.searchParams.set(s,n),{cacheKey:i.href,url:a.href}}var l=class{constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async({request:e,state:t})=>{t&&(t.originalRequest=e)},this.cachedResponseWillBeUsed=async({event:e,state:t,cachedResponse:n})=>{if(e.type===`install`&&t&&t.originalRequest&&t.originalRequest instanceof Request){let e=t.originalRequest.url;n?this.notUpdatedURLs.push(e):this.updatedURLs.push(e)}return n}}},u=class{constructor({precacheController:e}){this.cacheKeyWillBeUsed=async({request:e,params:t})=>{let n=t?.cacheKey||this._precacheController.getCacheKeyForURL(e.url);return n?new Request(n,{headers:e.headers}):e},this._precacheController=e}},d;function f(){if(d===void 0){let e=new Response(``);if(`body`in e)try{new Response(e.body),d=!0}catch{d=!1}d=!1}return d}async function p(e,n){let r=null;if(e.url&&(r=new URL(e.url).origin),r!==self.location.origin)throw new t(`cross-origin-copy-response`,{origin:r});let i=e.clone(),a={headers:new Headers(i.headers),status:i.status,statusText:i.statusText},o=n?n(a):a,s=f()?i.body:await i.blob();return new Response(s,o)}var m=e=>new URL(String(e),location.href).href.replace(RegExp(`^${location.origin}`),``);function h(e,t){let n=new URL(e);for(let e of t)n.searchParams.delete(e);return n.href}async function g(e,t,n,r){let i=h(t.url,n);if(t.url===i)return e.match(t,r);let a=Object.assign(Object.assign({},r),{ignoreSearch:!0}),o=await e.keys(t,a);for(let t of o)if(i===h(t.url,n))return e.match(t,r)}var v=class{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}},y=new Set;async function b(){for(let e of y)await e()}function x(e){return new Promise(t=>setTimeout(t,e))}try{self[`workbox:strategies:7.3.0`]&&_()}catch{}function S(e){return typeof e==`string`?new Request(e):e}var C=class{constructor(e,t){this._cacheKeys={},Object.assign(this,t),this.event=t.event,this._strategy=e,this._handlerDeferred=new v,this._extendLifetimePromises=[],this._plugins=[...e.plugins],this._pluginStateMap=new Map;for(let e of this._plugins)this._pluginStateMap.set(e,{});this.event.waitUntil(this._handlerDeferred.promise)}async fetch(e){let{event:n}=this,r=S(e);if(r.mode===`navigate`&&n instanceof FetchEvent&&n.preloadResponse){let e=await n.preloadResponse;if(e)return e}let i=this.hasCallback(`fetchDidFail`)?r.clone():null;try{for(let e of this.iterateCallbacks(`requestWillFetch`))r=await e({request:r.clone(),event:n})}catch(e){if(e instanceof Error)throw new t(`plugin-error-request-will-fetch`,{thrownErrorMessage:e.message})}let a=r.clone();try{let e;e=await fetch(r,r.mode===`navigate`?void 0:this._strategy.fetchOptions);for(let t of this.iterateCallbacks(`fetchDidSucceed`))e=await t({event:n,request:a,response:e});return e}catch(e){throw i&&await this.runCallbacks(`fetchDidFail`,{error:e,event:n,originalRequest:i.clone(),request:a.clone()}),e}}async fetchAndCachePut(e){let t=await this.fetch(e),n=t.clone();return this.waitUntil(this.cachePut(e,n)),t}async cacheMatch(e){let t=S(e),n,{cacheName:r,matchOptions:i}=this._strategy,a=await this.getCacheKey(t,`read`),o=Object.assign(Object.assign({},i),{cacheName:r});n=await caches.match(a,o);for(let e of this.iterateCallbacks(`cachedResponseWillBeUsed`))n=await e({cacheName:r,matchOptions:i,cachedResponse:n,request:a,event:this.event})||void 0;return n}async cachePut(e,n){let r=S(e);await x(0);let i=await this.getCacheKey(r,`write`);if(!n)throw new t(`cache-put-with-no-response`,{url:m(i.url)});let a=await this._ensureResponseSafeToCache(n);if(!a)return!1;let{cacheName:o,matchOptions:s}=this._strategy,c=await self.caches.open(o),l=this.hasCallback(`cacheDidUpdate`),u=l?await g(c,i.clone(),[`__WB_REVISION__`],s):null;try{await c.put(i,l?a.clone():a)}catch(e){if(e instanceof Error)throw e.name===`QuotaExceededError`&&await b(),e}for(let e of this.iterateCallbacks(`cacheDidUpdate`))await e({cacheName:o,oldResponse:u,newResponse:a.clone(),request:i,event:this.event});return!0}async getCacheKey(e,t){let n=`${e.url} | ${t}`;if(!this._cacheKeys[n]){let r=e;for(let e of this.iterateCallbacks(`cacheKeyWillBeUsed`))r=S(await e({mode:t,request:r,event:this.event,params:this.params}));this._cacheKeys[n]=r}return this._cacheKeys[n]}hasCallback(e){for(let t of this._strategy.plugins)if(e in t)return!0;return!1}async runCallbacks(e,t){for(let n of this.iterateCallbacks(e))await n(t)}*iterateCallbacks(e){for(let t of this._strategy.plugins)if(typeof t[e]==`function`){let n=this._pluginStateMap.get(t);yield r=>{let i=Object.assign(Object.assign({},r),{state:n});return t[e](i)}}}waitUntil(e){return this._extendLifetimePromises.push(e),e}async doneWaiting(){for(;this._extendLifetimePromises.length;){let e=this._extendLifetimePromises.splice(0),t=(await Promise.allSettled(e)).find(e=>e.status===`rejected`);if(t)throw t.reason}}destroy(){this._handlerDeferred.resolve(null)}async _ensureResponseSafeToCache(e){let t=e,n=!1;for(let e of this.iterateCallbacks(`cacheWillUpdate`))if(t=await e({request:this.request,response:t,event:this.event})||void 0,n=!0,!t)break;return n||t&&t.status!==200&&(t=void 0),t}},w=class{constructor(e={}){this.cacheName=a.getRuntimeName(e.cacheName),this.plugins=e.plugins||[],this.fetchOptions=e.fetchOptions,this.matchOptions=e.matchOptions}handle(e){let[t]=this.handleAll(e);return t}handleAll(e){e instanceof FetchEvent&&(e={event:e,request:e.request});let t=e.event,n=typeof e.request==`string`?new Request(e.request):e.request,r=`params`in e?e.params:void 0,i=new C(this,{event:t,request:n,params:r}),a=this._getResponse(i,n,t);return[a,this._awaitComplete(a,i,n,t)]}async _getResponse(e,n,r){await e.runCallbacks(`handlerWillStart`,{event:r,request:n});let i;try{if(i=await this._handle(n,e),!i||i.type===`error`)throw new t(`no-response`,{url:n.url})}catch(t){if(t instanceof Error){for(let a of e.iterateCallbacks(`handlerDidError`))if(i=await a({error:t,event:r,request:n}),i)break}if(!i)throw t}for(let t of e.iterateCallbacks(`handlerWillRespond`))i=await t({event:r,request:n,response:i});return i}async _awaitComplete(e,t,n,r){let i,a;try{i=await e}catch{}try{await t.runCallbacks(`handlerDidRespond`,{event:r,request:n,response:i}),await t.doneWaiting()}catch(e){e instanceof Error&&(a=e)}if(await t.runCallbacks(`handlerDidComplete`,{event:r,request:n,response:i,error:a}),t.destroy(),a)throw a}},T=class e extends w{constructor(t={}){t.cacheName=a.getPrecacheName(t.cacheName),super(t),this._fallbackToNetwork=t.fallbackToNetwork!==!1,this.plugins.push(e.copyRedirectedCacheableResponsesPlugin)}async _handle(e,t){return await t.cacheMatch(e)||(t.event&&t.event.type===`install`?await this._handleInstall(e,t):await this._handleFetch(e,t))}async _handleFetch(e,n){let r,i=n.params||{};if(this._fallbackToNetwork){let t=i.integrity,a=e.integrity,o=!a||a===t;r=await n.fetch(new Request(e,{integrity:e.mode===`no-cors`?void 0:a||t})),t&&o&&e.mode!==`no-cors`&&(this._useDefaultCacheabilityPluginIfNeeded(),await n.cachePut(e,r.clone()))}else throw new t(`missing-precache-entry`,{cacheName:this.cacheName,url:e.url});return r}async _handleInstall(e,n){this._useDefaultCacheabilityPluginIfNeeded();let r=await n.fetch(e);if(!await n.cachePut(e,r.clone()))throw new t(`bad-precaching-response`,{url:e.url,status:r.status});return r}_useDefaultCacheabilityPluginIfNeeded(){let t=null,n=0;for(let[r,i]of this.plugins.entries())i!==e.copyRedirectedCacheableResponsesPlugin&&(i===e.defaultPrecacheCacheabilityPlugin&&(t=r),i.cacheWillUpdate&&n++);n===0?this.plugins.push(e.defaultPrecacheCacheabilityPlugin):n>1&&t!==null&&this.plugins.splice(t,1)}};T.defaultPrecacheCacheabilityPlugin={async cacheWillUpdate({response:e}){return!e||e.status>=400?null:e}},T.copyRedirectedCacheableResponsesPlugin={async cacheWillUpdate({response:e}){return e.redirected?await p(e):e}};var E=class{constructor({cacheName:e,plugins:t=[],fallbackToNetwork:n=!0}={}){this._urlsToCacheKeys=new Map,this._urlsToCacheModes=new Map,this._cacheKeysToIntegrities=new Map,this._strategy=new T({cacheName:a.getPrecacheName(e),plugins:[...t,new u({precacheController:this})],fallbackToNetwork:n}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this._strategy}precache(e){this.addToCacheList(e),this._installAndActiveListenersAdded||=(self.addEventListener(`install`,this.install),self.addEventListener(`activate`,this.activate),!0)}addToCacheList(e){let n=[];for(let r of e){typeof r==`string`?n.push(r):r&&r.revision===void 0&&n.push(r.url);let{cacheKey:e,url:i}=c(r),a=typeof r!=`string`&&r.revision?`reload`:`default`;if(this._urlsToCacheKeys.has(i)&&this._urlsToCacheKeys.get(i)!==e)throw new t(`add-to-cache-list-conflicting-entries`,{firstEntry:this._urlsToCacheKeys.get(i),secondEntry:e});if(typeof r!=`string`&&r.integrity){if(this._cacheKeysToIntegrities.has(e)&&this._cacheKeysToIntegrities.get(e)!==r.integrity)throw new t(`add-to-cache-list-conflicting-integrities`,{url:i});this._cacheKeysToIntegrities.set(e,r.integrity)}if(this._urlsToCacheKeys.set(i,e),this._urlsToCacheModes.set(i,a),n.length>0){let e=`Workbox is precaching URLs without revision info: ${n.join(`, `)}\nThis is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(e)}}}install(e){return o(e,async()=>{let t=new l;this.strategy.plugins.push(t);for(let[t,n]of this._urlsToCacheKeys){let r=this._cacheKeysToIntegrities.get(n),i=this._urlsToCacheModes.get(t),a=new Request(t,{integrity:r,cache:i,credentials:`same-origin`});await Promise.all(this.strategy.handleAll({params:{cacheKey:n},request:a,event:e}))}let{updatedURLs:n,notUpdatedURLs:r}=t;return{updatedURLs:n,notUpdatedURLs:r}})}activate(e){return o(e,async()=>{let e=await self.caches.open(this.strategy.cacheName),t=await e.keys(),n=new Set(this._urlsToCacheKeys.values()),r=[];for(let i of t)n.has(i.url)||(await e.delete(i),r.push(i.url));return{deletedURLs:r}})}getURLsToCacheKeys(){return this._urlsToCacheKeys}getCachedURLs(){return[...this._urlsToCacheKeys.keys()]}getCacheKeyForURL(e){let t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}getIntegrityForCacheKey(e){return this._cacheKeysToIntegrities.get(e)}async matchPrecache(e){let t=e instanceof Request?e.url:e,n=this.getCacheKeyForURL(t);if(n)return(await self.caches.open(this.strategy.cacheName)).match(n)}createHandlerBoundToURL(e){let n=this.getCacheKeyForURL(e);if(!n)throw new t(`non-precached-url`,{url:e});return t=>(t.request=new Request(e),t.params=Object.assign({cacheKey:n},t.params),this.strategy.handle(t))}},D,O=()=>(D||=new E,D);try{self[`workbox:routing:7.3.0`]&&_()}catch{}var k=e=>e&&typeof e==`object`?e:{handle:e},A=class{constructor(e,t,n=`GET`){this.handler=k(t),this.match=e,this.method=n}setCatchHandler(e){this.catchHandler=k(e)}},j=class extends A{constructor(e,t,n){super(({url:t})=>{let n=e.exec(t.href);if(n&&!(t.origin!==location.origin&&n.index!==0))return n.slice(1)},t,n)}},M=class{constructor(){this._routes=new Map,this._defaultHandlerMap=new Map}get routes(){return this._routes}addFetchListener(){self.addEventListener(`fetch`,(e=>{let{request:t}=e,n=this.handleRequest({request:t,event:e});n&&e.respondWith(n)}))}addCacheListener(){self.addEventListener(`message`,(e=>{if(e.data&&e.data.type===`CACHE_URLS`){let{payload:t}=e.data,n=Promise.all(t.urlsToCache.map(t=>{typeof t==`string`&&(t=[t]);let n=new Request(...t);return this.handleRequest({request:n,event:e})}));e.waitUntil(n),e.ports&&e.ports[0]&&n.then(()=>e.ports[0].postMessage(!0))}}))}handleRequest({request:e,event:t}){let n=new URL(e.url,location.href);if(!n.protocol.startsWith(`http`))return;let r=n.origin===location.origin,{params:i,route:a}=this.findMatchingRoute({event:t,request:e,sameOrigin:r,url:n}),o=a&&a.handler,s=e.method;if(!o&&this._defaultHandlerMap.has(s)&&(o=this._defaultHandlerMap.get(s)),!o)return;let c;try{c=o.handle({url:n,request:e,event:t,params:i})}catch(e){c=Promise.reject(e)}let l=a&&a.catchHandler;return c instanceof Promise&&(this._catchHandler||l)&&(c=c.catch(async r=>{if(l)try{return await l.handle({url:n,request:e,event:t,params:i})}catch(e){e instanceof Error&&(r=e)}if(this._catchHandler)return this._catchHandler.handle({url:n,request:e,event:t});throw r})),c}findMatchingRoute({url:e,sameOrigin:t,request:n,event:r}){let i=this._routes.get(n.method)||[];for(let a of i){let i,o=a.match({url:e,sameOrigin:t,request:n,event:r});if(o)return i=o,(Array.isArray(i)&&i.length===0||o.constructor===Object&&Object.keys(o).length===0||typeof o==`boolean`)&&(i=void 0),{route:a,params:i}}return{}}setDefaultHandler(e,t=`GET`){this._defaultHandlerMap.set(t,k(e))}setCatchHandler(e){this._catchHandler=k(e)}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(e){if(!this._routes.has(e.method))throw new t(`unregister-route-but-not-found-with-method`,{method:e.method});let n=this._routes.get(e.method).indexOf(e);if(n>-1)this._routes.get(e.method).splice(n,1);else throw new t(`unregister-route-route-not-registered`)}},N,P=()=>(N||(N=new M,N.addFetchListener(),N.addCacheListener()),N);function F(e,n,r){let i;if(typeof e==`string`){let t=new URL(e,location.href);i=new A(({url:e})=>e.href===t.href,n,r)}else if(e instanceof RegExp)i=new j(e,n,r);else if(typeof e==`function`)i=new A(e,n,r);else if(e instanceof A)i=e;else throw new t(`unsupported-route-type`,{moduleName:`workbox-routing`,funcName:`registerRoute`,paramName:`capture`});return P().registerRoute(i),i}function I(e,t=[]){for(let n of[...e.searchParams.keys()])t.some(e=>e.test(n))&&e.searchParams.delete(n);return e}function*L(e,{ignoreURLParametersMatching:t=[/^utm_/,/^fbclid$/],directoryIndex:n=`index.html`,cleanURLs:r=!0,urlManipulation:i}={}){let a=new URL(e,location.href);a.hash=``,yield a.href;let o=I(a,t);if(yield o.href,n&&o.pathname.endsWith(`/`)){let e=new URL(o.href);e.pathname+=n,yield e.href}if(r){let e=new URL(o.href);e.pathname+=`.html`,yield e.href}if(i){let e=i({url:a});for(let t of e)yield t.href}}var R=class extends A{constructor(e,t){super(({request:n})=>{let r=e.getURLsToCacheKeys();for(let i of L(n.url,t)){let t=r.get(i);if(t)return{cacheKey:t,integrity:e.getIntegrityForCacheKey(t)}}},e.strategy)}};function z(e){F(new R(O(),e))}var B=`-precache-`,V=async(e,t=B)=>{let n=(await self.caches.keys()).filter(n=>n.includes(t)&&n.includes(self.registration.scope)&&n!==e);return await Promise.all(n.map(e=>self.caches.delete(e))),n};function H(){self.addEventListener(`activate`,(e=>{let t=a.getPrecacheName();e.waitUntil(V(t).then(e=>{}))}))}function U(e){O().precache(e)}function W(e,t){U(e),z(t)}var G=class extends w{async _handle(e,n){let r=await n.cacheMatch(e),i;if(!r)try{r=await n.fetchAndCachePut(e)}catch(e){e instanceof Error&&(i=e)}if(!r)throw new t(`no-response`,{url:e.url,error:i});return r}},K=`ppm:open-from-notification`;function q(e){let t=e&&typeof e==`object`?e:{},n=e=>typeof e==`string`?e:``;return{title:n(t.title)||`PPM`,body:n(t.body),url:n(t.url)||`/`,tag:n(t.tag),project:n(t.project),sessionId:n(t.sessionId),providerId:n(t.providerId)}}async function J(e,t,n){let r=new URL(e.url,n);if(r.origin===n){let n=(await t.matchAll({type:`window`,includeUncontrolled:!0})).filter(e=>!Y(e.url)),i=n.find(e=>e.focused)??n.find(e=>e.visibilityState===`visible`)??n[0];if(i){let t={type:K,url:r.href,project:e.project,sessionId:e.sessionId,providerId:e.providerId};i.postMessage(t),await i.focus().catch(()=>void 0);return}}await t.openWindow(r.href)}function Y(e){try{return new URL(e).pathname.startsWith(`/s/`)}catch{return!1}}W([{"revision":"706a6af8828afa8db585f8c5aa245d6c","url":"index.html"},{"revision":"26dccd02a2ef7522892015154f5e3680","url":"manifest.webmanifest"},{"revision":"a0fb34fc84eb148d51812cd62669f20d","url":"icon-512.svg"},{"revision":"a0fb34fc84eb148d51812cd62669f20d","url":"icon-192.svg"},{"revision":null,"url":"assets/index-NLV9BOl2.css"},{"revision":null,"url":"assets/index-CXjsAVvH.js"},{"revision":"a0fb34fc84eb148d51812cd62669f20d","url":"icon-192.svg"},{"revision":"a0fb34fc84eb148d51812cd62669f20d","url":"icon-512.svg"},{"revision":"26dccd02a2ef7522892015154f5e3680","url":"manifest.webmanifest"}]),H();var X=e=>(e.headers.get(`content-type`)??``).startsWith(`text/html`);F(({url:e})=>e.pathname.startsWith(`/assets/`),new G({cacheName:`ppm-assets`,plugins:[{cacheWillUpdate:async({response:e})=>X(e)?null:e,cachedResponseWillBeUsed:async({cachedResponse:e})=>e&&X(e)?null:e}]})),self.skipWaiting(),self.addEventListener(`activate`,()=>{self.clients.claim()}),self.addEventListener(`push`,e=>{let t=null;try{t=e.data?.json()}catch{t={body:e.data?.text()}}let n=q(t),r={body:n.body,icon:`/icon-192.svg`,data:n,...n.tag&&{tag:n.tag,renotify:!0}};e.waitUntil(self.registration.showNotification(n.title,r))}),self.addEventListener(`notificationclick`,e=>{e.notification.close();let t=q(e.notification.data);e.waitUntil(J(t,self.clients,self.location.origin))});
|
|
1
|
+
try{self[`workbox:core:7.3.0`]&&_()}catch{}var e=(e,...t)=>{let n=e;return t.length>0&&(n+=` :: ${JSON.stringify(t)}`),n},t=class extends Error{constructor(t,n){let r=e(t,n);super(r),this.name=t,this.details=n}},n={googleAnalytics:`googleAnalytics`,precache:`precache-v2`,prefix:`workbox`,runtime:`runtime`,suffix:typeof registration<`u`?registration.scope:``},r=e=>[n.prefix,e,n.suffix].filter(e=>e&&e.length>0).join(`-`),i=e=>{for(let t of Object.keys(n))e(t)},a={updateDetails:e=>{i(t=>{typeof e[t]==`string`&&(n[t]=e[t])})},getGoogleAnalyticsName:e=>e||r(n.googleAnalytics),getPrecacheName:e=>e||r(n.precache),getPrefix:()=>n.prefix,getRuntimeName:e=>e||r(n.runtime),getSuffix:()=>n.suffix};function o(e,t){let n=t();return e.waitUntil(n),n}try{self[`workbox:precaching:7.3.0`]&&_()}catch{}var s=`__WB_REVISION__`;function c(e){if(!e)throw new t(`add-to-cache-list-unexpected-type`,{entry:e});if(typeof e==`string`){let t=new URL(e,location.href);return{cacheKey:t.href,url:t.href}}let{revision:n,url:r}=e;if(!r)throw new t(`add-to-cache-list-unexpected-type`,{entry:e});if(!n){let e=new URL(r,location.href);return{cacheKey:e.href,url:e.href}}let i=new URL(r,location.href),a=new URL(r,location.href);return i.searchParams.set(s,n),{cacheKey:i.href,url:a.href}}var l=class{constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async({request:e,state:t})=>{t&&(t.originalRequest=e)},this.cachedResponseWillBeUsed=async({event:e,state:t,cachedResponse:n})=>{if(e.type===`install`&&t&&t.originalRequest&&t.originalRequest instanceof Request){let e=t.originalRequest.url;n?this.notUpdatedURLs.push(e):this.updatedURLs.push(e)}return n}}},u=class{constructor({precacheController:e}){this.cacheKeyWillBeUsed=async({request:e,params:t})=>{let n=t?.cacheKey||this._precacheController.getCacheKeyForURL(e.url);return n?new Request(n,{headers:e.headers}):e},this._precacheController=e}},d;function f(){if(d===void 0){let e=new Response(``);if(`body`in e)try{new Response(e.body),d=!0}catch{d=!1}d=!1}return d}async function p(e,n){let r=null;if(e.url&&(r=new URL(e.url).origin),r!==self.location.origin)throw new t(`cross-origin-copy-response`,{origin:r});let i=e.clone(),a={headers:new Headers(i.headers),status:i.status,statusText:i.statusText},o=n?n(a):a,s=f()?i.body:await i.blob();return new Response(s,o)}var m=e=>new URL(String(e),location.href).href.replace(RegExp(`^${location.origin}`),``);function h(e,t){let n=new URL(e);for(let e of t)n.searchParams.delete(e);return n.href}async function g(e,t,n,r){let i=h(t.url,n);if(t.url===i)return e.match(t,r);let a=Object.assign(Object.assign({},r),{ignoreSearch:!0}),o=await e.keys(t,a);for(let t of o)if(i===h(t.url,n))return e.match(t,r)}var v=class{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}},y=new Set;async function b(){for(let e of y)await e()}function x(e){return new Promise(t=>setTimeout(t,e))}try{self[`workbox:strategies:7.3.0`]&&_()}catch{}function S(e){return typeof e==`string`?new Request(e):e}var C=class{constructor(e,t){this._cacheKeys={},Object.assign(this,t),this.event=t.event,this._strategy=e,this._handlerDeferred=new v,this._extendLifetimePromises=[],this._plugins=[...e.plugins],this._pluginStateMap=new Map;for(let e of this._plugins)this._pluginStateMap.set(e,{});this.event.waitUntil(this._handlerDeferred.promise)}async fetch(e){let{event:n}=this,r=S(e);if(r.mode===`navigate`&&n instanceof FetchEvent&&n.preloadResponse){let e=await n.preloadResponse;if(e)return e}let i=this.hasCallback(`fetchDidFail`)?r.clone():null;try{for(let e of this.iterateCallbacks(`requestWillFetch`))r=await e({request:r.clone(),event:n})}catch(e){if(e instanceof Error)throw new t(`plugin-error-request-will-fetch`,{thrownErrorMessage:e.message})}let a=r.clone();try{let e;e=await fetch(r,r.mode===`navigate`?void 0:this._strategy.fetchOptions);for(let t of this.iterateCallbacks(`fetchDidSucceed`))e=await t({event:n,request:a,response:e});return e}catch(e){throw i&&await this.runCallbacks(`fetchDidFail`,{error:e,event:n,originalRequest:i.clone(),request:a.clone()}),e}}async fetchAndCachePut(e){let t=await this.fetch(e),n=t.clone();return this.waitUntil(this.cachePut(e,n)),t}async cacheMatch(e){let t=S(e),n,{cacheName:r,matchOptions:i}=this._strategy,a=await this.getCacheKey(t,`read`),o=Object.assign(Object.assign({},i),{cacheName:r});n=await caches.match(a,o);for(let e of this.iterateCallbacks(`cachedResponseWillBeUsed`))n=await e({cacheName:r,matchOptions:i,cachedResponse:n,request:a,event:this.event})||void 0;return n}async cachePut(e,n){let r=S(e);await x(0);let i=await this.getCacheKey(r,`write`);if(!n)throw new t(`cache-put-with-no-response`,{url:m(i.url)});let a=await this._ensureResponseSafeToCache(n);if(!a)return!1;let{cacheName:o,matchOptions:s}=this._strategy,c=await self.caches.open(o),l=this.hasCallback(`cacheDidUpdate`),u=l?await g(c,i.clone(),[`__WB_REVISION__`],s):null;try{await c.put(i,l?a.clone():a)}catch(e){if(e instanceof Error)throw e.name===`QuotaExceededError`&&await b(),e}for(let e of this.iterateCallbacks(`cacheDidUpdate`))await e({cacheName:o,oldResponse:u,newResponse:a.clone(),request:i,event:this.event});return!0}async getCacheKey(e,t){let n=`${e.url} | ${t}`;if(!this._cacheKeys[n]){let r=e;for(let e of this.iterateCallbacks(`cacheKeyWillBeUsed`))r=S(await e({mode:t,request:r,event:this.event,params:this.params}));this._cacheKeys[n]=r}return this._cacheKeys[n]}hasCallback(e){for(let t of this._strategy.plugins)if(e in t)return!0;return!1}async runCallbacks(e,t){for(let n of this.iterateCallbacks(e))await n(t)}*iterateCallbacks(e){for(let t of this._strategy.plugins)if(typeof t[e]==`function`){let n=this._pluginStateMap.get(t);yield r=>{let i=Object.assign(Object.assign({},r),{state:n});return t[e](i)}}}waitUntil(e){return this._extendLifetimePromises.push(e),e}async doneWaiting(){for(;this._extendLifetimePromises.length;){let e=this._extendLifetimePromises.splice(0),t=(await Promise.allSettled(e)).find(e=>e.status===`rejected`);if(t)throw t.reason}}destroy(){this._handlerDeferred.resolve(null)}async _ensureResponseSafeToCache(e){let t=e,n=!1;for(let e of this.iterateCallbacks(`cacheWillUpdate`))if(t=await e({request:this.request,response:t,event:this.event})||void 0,n=!0,!t)break;return n||t&&t.status!==200&&(t=void 0),t}},w=class{constructor(e={}){this.cacheName=a.getRuntimeName(e.cacheName),this.plugins=e.plugins||[],this.fetchOptions=e.fetchOptions,this.matchOptions=e.matchOptions}handle(e){let[t]=this.handleAll(e);return t}handleAll(e){e instanceof FetchEvent&&(e={event:e,request:e.request});let t=e.event,n=typeof e.request==`string`?new Request(e.request):e.request,r=`params`in e?e.params:void 0,i=new C(this,{event:t,request:n,params:r}),a=this._getResponse(i,n,t);return[a,this._awaitComplete(a,i,n,t)]}async _getResponse(e,n,r){await e.runCallbacks(`handlerWillStart`,{event:r,request:n});let i;try{if(i=await this._handle(n,e),!i||i.type===`error`)throw new t(`no-response`,{url:n.url})}catch(t){if(t instanceof Error){for(let a of e.iterateCallbacks(`handlerDidError`))if(i=await a({error:t,event:r,request:n}),i)break}if(!i)throw t}for(let t of e.iterateCallbacks(`handlerWillRespond`))i=await t({event:r,request:n,response:i});return i}async _awaitComplete(e,t,n,r){let i,a;try{i=await e}catch{}try{await t.runCallbacks(`handlerDidRespond`,{event:r,request:n,response:i}),await t.doneWaiting()}catch(e){e instanceof Error&&(a=e)}if(await t.runCallbacks(`handlerDidComplete`,{event:r,request:n,response:i,error:a}),t.destroy(),a)throw a}},T=class e extends w{constructor(t={}){t.cacheName=a.getPrecacheName(t.cacheName),super(t),this._fallbackToNetwork=t.fallbackToNetwork!==!1,this.plugins.push(e.copyRedirectedCacheableResponsesPlugin)}async _handle(e,t){return await t.cacheMatch(e)||(t.event&&t.event.type===`install`?await this._handleInstall(e,t):await this._handleFetch(e,t))}async _handleFetch(e,n){let r,i=n.params||{};if(this._fallbackToNetwork){let t=i.integrity,a=e.integrity,o=!a||a===t;r=await n.fetch(new Request(e,{integrity:e.mode===`no-cors`?void 0:a||t})),t&&o&&e.mode!==`no-cors`&&(this._useDefaultCacheabilityPluginIfNeeded(),await n.cachePut(e,r.clone()))}else throw new t(`missing-precache-entry`,{cacheName:this.cacheName,url:e.url});return r}async _handleInstall(e,n){this._useDefaultCacheabilityPluginIfNeeded();let r=await n.fetch(e);if(!await n.cachePut(e,r.clone()))throw new t(`bad-precaching-response`,{url:e.url,status:r.status});return r}_useDefaultCacheabilityPluginIfNeeded(){let t=null,n=0;for(let[r,i]of this.plugins.entries())i!==e.copyRedirectedCacheableResponsesPlugin&&(i===e.defaultPrecacheCacheabilityPlugin&&(t=r),i.cacheWillUpdate&&n++);n===0?this.plugins.push(e.defaultPrecacheCacheabilityPlugin):n>1&&t!==null&&this.plugins.splice(t,1)}};T.defaultPrecacheCacheabilityPlugin={async cacheWillUpdate({response:e}){return!e||e.status>=400?null:e}},T.copyRedirectedCacheableResponsesPlugin={async cacheWillUpdate({response:e}){return e.redirected?await p(e):e}};var E=class{constructor({cacheName:e,plugins:t=[],fallbackToNetwork:n=!0}={}){this._urlsToCacheKeys=new Map,this._urlsToCacheModes=new Map,this._cacheKeysToIntegrities=new Map,this._strategy=new T({cacheName:a.getPrecacheName(e),plugins:[...t,new u({precacheController:this})],fallbackToNetwork:n}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this._strategy}precache(e){this.addToCacheList(e),this._installAndActiveListenersAdded||=(self.addEventListener(`install`,this.install),self.addEventListener(`activate`,this.activate),!0)}addToCacheList(e){let n=[];for(let r of e){typeof r==`string`?n.push(r):r&&r.revision===void 0&&n.push(r.url);let{cacheKey:e,url:i}=c(r),a=typeof r!=`string`&&r.revision?`reload`:`default`;if(this._urlsToCacheKeys.has(i)&&this._urlsToCacheKeys.get(i)!==e)throw new t(`add-to-cache-list-conflicting-entries`,{firstEntry:this._urlsToCacheKeys.get(i),secondEntry:e});if(typeof r!=`string`&&r.integrity){if(this._cacheKeysToIntegrities.has(e)&&this._cacheKeysToIntegrities.get(e)!==r.integrity)throw new t(`add-to-cache-list-conflicting-integrities`,{url:i});this._cacheKeysToIntegrities.set(e,r.integrity)}if(this._urlsToCacheKeys.set(i,e),this._urlsToCacheModes.set(i,a),n.length>0){let e=`Workbox is precaching URLs without revision info: ${n.join(`, `)}\nThis is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(e)}}}install(e){return o(e,async()=>{let t=new l;this.strategy.plugins.push(t);for(let[t,n]of this._urlsToCacheKeys){let r=this._cacheKeysToIntegrities.get(n),i=this._urlsToCacheModes.get(t),a=new Request(t,{integrity:r,cache:i,credentials:`same-origin`});await Promise.all(this.strategy.handleAll({params:{cacheKey:n},request:a,event:e}))}let{updatedURLs:n,notUpdatedURLs:r}=t;return{updatedURLs:n,notUpdatedURLs:r}})}activate(e){return o(e,async()=>{let e=await self.caches.open(this.strategy.cacheName),t=await e.keys(),n=new Set(this._urlsToCacheKeys.values()),r=[];for(let i of t)n.has(i.url)||(await e.delete(i),r.push(i.url));return{deletedURLs:r}})}getURLsToCacheKeys(){return this._urlsToCacheKeys}getCachedURLs(){return[...this._urlsToCacheKeys.keys()]}getCacheKeyForURL(e){let t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}getIntegrityForCacheKey(e){return this._cacheKeysToIntegrities.get(e)}async matchPrecache(e){let t=e instanceof Request?e.url:e,n=this.getCacheKeyForURL(t);if(n)return(await self.caches.open(this.strategy.cacheName)).match(n)}createHandlerBoundToURL(e){let n=this.getCacheKeyForURL(e);if(!n)throw new t(`non-precached-url`,{url:e});return t=>(t.request=new Request(e),t.params=Object.assign({cacheKey:n},t.params),this.strategy.handle(t))}},D,O=()=>(D||=new E,D);try{self[`workbox:routing:7.3.0`]&&_()}catch{}var k=e=>e&&typeof e==`object`?e:{handle:e},A=class{constructor(e,t,n=`GET`){this.handler=k(t),this.match=e,this.method=n}setCatchHandler(e){this.catchHandler=k(e)}},j=class extends A{constructor(e,t,n){super(({url:t})=>{let n=e.exec(t.href);if(n&&!(t.origin!==location.origin&&n.index!==0))return n.slice(1)},t,n)}},M=class{constructor(){this._routes=new Map,this._defaultHandlerMap=new Map}get routes(){return this._routes}addFetchListener(){self.addEventListener(`fetch`,(e=>{let{request:t}=e,n=this.handleRequest({request:t,event:e});n&&e.respondWith(n)}))}addCacheListener(){self.addEventListener(`message`,(e=>{if(e.data&&e.data.type===`CACHE_URLS`){let{payload:t}=e.data,n=Promise.all(t.urlsToCache.map(t=>{typeof t==`string`&&(t=[t]);let n=new Request(...t);return this.handleRequest({request:n,event:e})}));e.waitUntil(n),e.ports&&e.ports[0]&&n.then(()=>e.ports[0].postMessage(!0))}}))}handleRequest({request:e,event:t}){let n=new URL(e.url,location.href);if(!n.protocol.startsWith(`http`))return;let r=n.origin===location.origin,{params:i,route:a}=this.findMatchingRoute({event:t,request:e,sameOrigin:r,url:n}),o=a&&a.handler,s=e.method;if(!o&&this._defaultHandlerMap.has(s)&&(o=this._defaultHandlerMap.get(s)),!o)return;let c;try{c=o.handle({url:n,request:e,event:t,params:i})}catch(e){c=Promise.reject(e)}let l=a&&a.catchHandler;return c instanceof Promise&&(this._catchHandler||l)&&(c=c.catch(async r=>{if(l)try{return await l.handle({url:n,request:e,event:t,params:i})}catch(e){e instanceof Error&&(r=e)}if(this._catchHandler)return this._catchHandler.handle({url:n,request:e,event:t});throw r})),c}findMatchingRoute({url:e,sameOrigin:t,request:n,event:r}){let i=this._routes.get(n.method)||[];for(let a of i){let i,o=a.match({url:e,sameOrigin:t,request:n,event:r});if(o)return i=o,(Array.isArray(i)&&i.length===0||o.constructor===Object&&Object.keys(o).length===0||typeof o==`boolean`)&&(i=void 0),{route:a,params:i}}return{}}setDefaultHandler(e,t=`GET`){this._defaultHandlerMap.set(t,k(e))}setCatchHandler(e){this._catchHandler=k(e)}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(e){if(!this._routes.has(e.method))throw new t(`unregister-route-but-not-found-with-method`,{method:e.method});let n=this._routes.get(e.method).indexOf(e);if(n>-1)this._routes.get(e.method).splice(n,1);else throw new t(`unregister-route-route-not-registered`)}},N,P=()=>(N||(N=new M,N.addFetchListener(),N.addCacheListener()),N);function F(e,n,r){let i;if(typeof e==`string`){let t=new URL(e,location.href);i=new A(({url:e})=>e.href===t.href,n,r)}else if(e instanceof RegExp)i=new j(e,n,r);else if(typeof e==`function`)i=new A(e,n,r);else if(e instanceof A)i=e;else throw new t(`unsupported-route-type`,{moduleName:`workbox-routing`,funcName:`registerRoute`,paramName:`capture`});return P().registerRoute(i),i}function I(e,t=[]){for(let n of[...e.searchParams.keys()])t.some(e=>e.test(n))&&e.searchParams.delete(n);return e}function*L(e,{ignoreURLParametersMatching:t=[/^utm_/,/^fbclid$/],directoryIndex:n=`index.html`,cleanURLs:r=!0,urlManipulation:i}={}){let a=new URL(e,location.href);a.hash=``,yield a.href;let o=I(a,t);if(yield o.href,n&&o.pathname.endsWith(`/`)){let e=new URL(o.href);e.pathname+=n,yield e.href}if(r){let e=new URL(o.href);e.pathname+=`.html`,yield e.href}if(i){let e=i({url:a});for(let t of e)yield t.href}}var R=class extends A{constructor(e,t){super(({request:n})=>{let r=e.getURLsToCacheKeys();for(let i of L(n.url,t)){let t=r.get(i);if(t)return{cacheKey:t,integrity:e.getIntegrityForCacheKey(t)}}},e.strategy)}};function z(e){F(new R(O(),e))}var B=`-precache-`,V=async(e,t=B)=>{let n=(await self.caches.keys()).filter(n=>n.includes(t)&&n.includes(self.registration.scope)&&n!==e);return await Promise.all(n.map(e=>self.caches.delete(e))),n};function H(){self.addEventListener(`activate`,(e=>{let t=a.getPrecacheName();e.waitUntil(V(t).then(e=>{}))}))}function U(e){O().precache(e)}function W(e,t){U(e),z(t)}var G=class extends w{async _handle(e,n){let r=await n.cacheMatch(e),i;if(!r)try{r=await n.fetchAndCachePut(e)}catch(e){e instanceof Error&&(i=e)}if(!r)throw new t(`no-response`,{url:e.url,error:i});return r}},K=`ppm:open-from-notification`;function q(e){let t=e&&typeof e==`object`?e:{},n=e=>typeof e==`string`?e:``;return{title:n(t.title)||`PPM`,body:n(t.body),url:n(t.url)||`/`,tag:n(t.tag),project:n(t.project),sessionId:n(t.sessionId),providerId:n(t.providerId)}}async function J(e,t,n){let r=new URL(e.url,n);if(r.origin===n){let n=(await t.matchAll({type:`window`,includeUncontrolled:!0})).filter(e=>!Y(e.url)),i=n.find(e=>e.focused)??n.find(e=>e.visibilityState===`visible`)??n[0];if(i){let t={type:K,url:r.href,project:e.project,sessionId:e.sessionId,providerId:e.providerId};i.postMessage(t),await i.focus().catch(()=>void 0);return}}await t.openWindow(r.href)}function Y(e){try{return new URL(e).pathname.startsWith(`/s/`)}catch{return!1}}W([{"revision":"2fbc71e3d4ad629e21cd394249e3e54a","url":"index.html"},{"revision":"26dccd02a2ef7522892015154f5e3680","url":"manifest.webmanifest"},{"revision":"a0fb34fc84eb148d51812cd62669f20d","url":"icon-512.svg"},{"revision":"a0fb34fc84eb148d51812cd62669f20d","url":"icon-192.svg"},{"revision":null,"url":"assets/index-CwW8jYaQ.js"},{"revision":null,"url":"assets/index-0VrQhdqv.css"},{"revision":"a0fb34fc84eb148d51812cd62669f20d","url":"icon-192.svg"},{"revision":"a0fb34fc84eb148d51812cd62669f20d","url":"icon-512.svg"},{"revision":"26dccd02a2ef7522892015154f5e3680","url":"manifest.webmanifest"}]),H();var X=e=>(e.headers.get(`content-type`)??``).startsWith(`text/html`);F(({url:e})=>e.pathname.startsWith(`/assets/`),new G({cacheName:`ppm-assets`,plugins:[{cacheWillUpdate:async({response:e})=>X(e)?null:e,cachedResponseWillBeUsed:async({cachedResponse:e})=>e&&X(e)?null:e}]})),self.skipWaiting(),self.addEventListener(`activate`,()=>{self.clients.claim()}),self.addEventListener(`push`,e=>{let t=null;try{t=e.data?.json()}catch{t={body:e.data?.text()}}let n=q(t),r={body:n.body,icon:`/icon-192.svg`,data:n,...n.tag&&{tag:n.tag,renotify:!0}};e.waitUntil(self.registration.showNotification(n.title,r))}),self.addEventListener(`notificationclick`,e=>{e.notification.close();let t=q(e.notification.data);e.waitUntil(J(t,self.clients,self.location.origin))});
|
package/dist/web/sw.js.br
CHANGED
|
Binary file
|
package/dist/web/sw.js.gz
CHANGED
|
Binary file
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -169,13 +169,14 @@ export async function buildProgram(): Promise<Command> {
|
|
|
169
169
|
*/
|
|
170
170
|
export function resolveEntryMode(
|
|
171
171
|
argv: string[],
|
|
172
|
-
): "supervise" | "serve" | "edge" | "share-host" | "ensure-supervisor" | "cli" {
|
|
172
|
+
): "supervise" | "serve" | "edge" | "share-host" | "ensure-supervisor" | "file-index-walk" | "cli" {
|
|
173
173
|
if (argv.includes("__supervise__")) return "supervise";
|
|
174
174
|
if (argv.includes("__serve__")) return "serve";
|
|
175
175
|
if (argv.includes("__edge__")) return "edge";
|
|
176
176
|
if (argv.includes("__share_host__")) return "share-host";
|
|
177
177
|
// PPM's watchdog task (Windows Task Scheduler): starts PPM when its last run died.
|
|
178
178
|
if (argv.includes("__ensure_supervisor__")) return "ensure-supervisor";
|
|
179
|
+
if (argv.includes("__file_index_walk__")) return "file-index-walk";
|
|
179
180
|
return "cli";
|
|
180
181
|
}
|
|
181
182
|
|
|
@@ -199,6 +200,9 @@ if (import.meta.main) {
|
|
|
199
200
|
case "ensure-supervisor":
|
|
200
201
|
await (await import("./services/supervisor-watchdog/ensure-supervisor.ts")).ensureSupervisorMain();
|
|
201
202
|
break;
|
|
203
|
+
case "file-index-walk":
|
|
204
|
+
await import("./services/file-index/file-index-walk-process.ts");
|
|
205
|
+
break;
|
|
202
206
|
default: {
|
|
203
207
|
// A command's stdout is its output (`--json`, a pipe): log lines go to stderr.
|
|
204
208
|
const { sendConsoleLogsToStderr } = await import("./services/logger.ts");
|
|
@@ -85,17 +85,21 @@ const MAX_INDEX_SEARCH_LIMIT = 500;
|
|
|
85
85
|
* Returns flat array of all project files {path, name} for palette/search.
|
|
86
86
|
* Result is cached; a file change marks it stale, and the stale list is served while it rebuilds.
|
|
87
87
|
* With `max`, a project holding more entries than that answers `FileIndexTooLarge` instead of the
|
|
88
|
-
* list, to be searched with `/files/index/search
|
|
88
|
+
* list, to be searched with `/files/index/search`; a list of `REMOTE_FILE_SEARCH_FROM_ENTRIES` or
|
|
89
|
+
* more always does, since only a sample of it is kept as JSON.
|
|
89
90
|
*/
|
|
90
91
|
fileRoutes.get("/index", async (c) => {
|
|
91
92
|
try {
|
|
92
93
|
const projectPath = c.get("projectPath");
|
|
93
94
|
outlastFirstWalk(c);
|
|
94
|
-
// The body is serialised and gzipped once per walk,
|
|
95
|
+
// The body is serialised and gzipped once per walk, in the walk process: nxsys-workspace's
|
|
95
96
|
// is 22 MB, which cost ~120 ms of the event loop to serialise and compress per download.
|
|
96
97
|
const build = await fileService.buildIndex(projectPath);
|
|
97
98
|
const max = Number(c.req.query("max"));
|
|
98
|
-
|
|
99
|
+
// A large build holds only a sample of its list as JSON (see `IndexBuild`), so it is never sent.
|
|
100
|
+
if (build.large || (max > 0 && build.count > max)) {
|
|
101
|
+
return c.json(ok<FileIndexTooLarge>({ tooLarge: true, count: build.count, ...(build.truncated && { truncated: true }) }));
|
|
102
|
+
}
|
|
99
103
|
const gzip = (c.req.header("Accept-Encoding") ?? "").includes("gzip");
|
|
100
104
|
return new Response(gzip ? build.gzip : build.json, {
|
|
101
105
|
headers: {
|
|
@@ -71,5 +71,5 @@ function dedup(arr: string[]): string[] {
|
|
|
71
71
|
return [...new Set(arr)];
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
// Matching lives in its own module so the file index
|
|
74
|
+
// Matching lives in its own module so the file index walk process can use it without the config store.
|
|
75
75
|
export { matchesGlob } from "./file-glob.ts";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* file-glob.ts
|
|
3
3
|
* VS Code-style glob matching for file excludes. Kept free of any import that reaches the
|
|
4
|
-
* config store or the database, because the file index
|
|
4
|
+
* config store or the database, because the file index walk runs it in a process of its own.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
/**
|