@hienlh/ppm 0.26.30 → 0.26.31
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 +7 -0
- 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-DdOOi40j.js → accounts-settings-section-Cz2F6wSB.js} +1 -1
- package/dist/web/assets/accounts-settings-section-Cz2F6wSB.js.br +0 -0
- package/dist/web/assets/accounts-settings-section-Cz2F6wSB.js.gz +0 -0
- package/dist/web/assets/{agent-session-sheet-DrGTDCGf.js → agent-session-sheet-B5R60PbH.js} +2 -2
- package/dist/web/assets/agent-session-sheet-B5R60PbH.js.br +0 -0
- package/dist/web/assets/agent-session-sheet-B5R60PbH.js.gz +0 -0
- package/dist/web/assets/{agent-session-window-content-BYtnnDj7.js → agent-session-window-content-C7gcEJRy.js} +1 -1
- package/dist/web/assets/agent-session-window-content-C7gcEJRy.js.br +0 -0
- package/dist/web/assets/agent-session-window-content-C7gcEJRy.js.gz +0 -0
- package/dist/web/assets/{ai-resource-editor-COFega94.js → ai-resource-editor-CZnk82St.js} +1 -1
- package/dist/web/assets/ai-resource-editor-CZnk82St.js.br +0 -0
- package/dist/web/assets/ai-resource-editor-CZnk82St.js.gz +0 -0
- package/dist/web/assets/{ai-settings-section-B7Clb3Ph.js → ai-settings-section-CM5wQ8oW.js} +1 -1
- package/dist/web/assets/ai-settings-section-CM5wQ8oW.js.br +0 -0
- package/dist/web/assets/ai-settings-section-CM5wQ8oW.js.gz +0 -0
- package/dist/web/assets/{ai-settings-section-DI54qFgt.js → ai-settings-section-r-7lxkdN.js} +1 -1
- package/dist/web/assets/ai-settings-section-r-7lxkdN.js.br +0 -0
- package/dist/web/assets/ai-settings-section-r-7lxkdN.js.gz +0 -0
- package/dist/web/assets/{android-tab-Cde_HW-w.js → android-tab-D9XFMc5s.js} +1 -1
- package/dist/web/assets/android-tab-D9XFMc5s.js.br +0 -0
- package/dist/web/assets/android-tab-D9XFMc5s.js.gz +0 -0
- package/dist/web/assets/{antigravity-usage-view-CDGsubUs.js → antigravity-usage-view-Bc-muiqC.js} +1 -1
- package/dist/web/assets/antigravity-usage-view-Bc-muiqC.js.br +0 -0
- package/dist/web/assets/{antigravity-usage-view-CDGsubUs.js.gz → antigravity-usage-view-Bc-muiqC.js.gz} +0 -0
- package/dist/web/assets/{appearance-settings-section-DHn8xrzo.js → appearance-settings-section-Duul1M9-.js} +1 -1
- package/dist/web/assets/appearance-settings-section-Duul1M9-.js.br +0 -0
- package/dist/web/assets/appearance-settings-section-Duul1M9-.js.gz +0 -0
- package/dist/web/assets/{apps-panel-CZfxbkiw.js → apps-panel-Dp4MRxZb.js} +1 -1
- package/dist/web/assets/apps-panel-Dp4MRxZb.js.br +0 -0
- package/dist/web/assets/apps-panel-Dp4MRxZb.js.gz +0 -0
- package/dist/web/assets/{assistant-settings-section-CiEJ-wP_.js → assistant-settings-section-C8dnq8_N.js} +1 -1
- package/dist/web/assets/assistant-settings-section-C8dnq8_N.js.br +0 -0
- package/dist/web/assets/assistant-settings-section-C8dnq8_N.js.gz +0 -0
- package/dist/web/assets/{assistant-tab-CXQXPLF_.js → assistant-tab-Bs6h4Gf9.js} +1 -1
- package/dist/web/assets/assistant-tab-Bs6h4Gf9.js.br +0 -0
- package/dist/web/assets/assistant-tab-Bs6h4Gf9.js.gz +0 -0
- package/dist/web/assets/{branch-review-tab-CoczozHQ.js → branch-review-tab-42Zu7LVM.js} +1 -1
- package/dist/web/assets/branch-review-tab-42Zu7LVM.js.br +0 -0
- package/dist/web/assets/branch-review-tab-42Zu7LVM.js.gz +0 -0
- package/dist/web/assets/{chat-tab-De3iofct.js → chat-tab-BYVbVNBU.js} +1 -1
- package/dist/web/assets/chat-tab-BYVbVNBU.js.br +0 -0
- package/dist/web/assets/chat-tab-BYVbVNBU.js.gz +0 -0
- package/dist/web/assets/chat-tab-CDOyehMI.js +17 -0
- package/dist/web/assets/chat-tab-CDOyehMI.js.br +0 -0
- package/dist/web/assets/chat-tab-CDOyehMI.js.gz +0 -0
- package/dist/web/assets/{code-editor-BHuTauGz.js → code-editor-Bol9bvup.js} +4 -4
- package/dist/web/assets/code-editor-Bol9bvup.js.br +0 -0
- package/dist/web/assets/code-editor-Bol9bvup.js.gz +0 -0
- package/dist/web/assets/{conflict-editor-D8kIOcxU.js → conflict-editor-DpcWkF1n.js} +1 -1
- package/dist/web/assets/conflict-editor-DpcWkF1n.js.br +0 -0
- package/dist/web/assets/conflict-editor-DpcWkF1n.js.gz +0 -0
- package/dist/web/assets/{connection-form-tab-UsdARMsC.js → connection-form-tab-Dcv7_LKF.js} +1 -1
- package/dist/web/assets/connection-form-tab-Dcv7_LKF.js.br +0 -0
- package/dist/web/assets/connection-form-tab-Dcv7_LKF.js.gz +0 -0
- package/dist/web/assets/{csv-preview-Mzw2saJV.js → csv-preview-B2TbyK_t.js} +1 -1
- package/dist/web/assets/csv-preview-B2TbyK_t.js.br +0 -0
- package/dist/web/assets/csv-preview-B2TbyK_t.js.gz +0 -0
- package/dist/web/assets/{database-drivers-section-D3zn3c_6.js → database-drivers-section-CIpxGpBg.js} +1 -1
- package/dist/web/assets/database-drivers-section-CIpxGpBg.js.br +0 -0
- package/dist/web/assets/database-drivers-section-CIpxGpBg.js.gz +0 -0
- package/dist/web/assets/{db-tab-parts-9fyVffo3.js → db-tab-parts-ITcBUPOl.js} +1 -1
- package/dist/web/assets/db-tab-parts-ITcBUPOl.js.br +0 -0
- package/dist/web/assets/db-tab-parts-ITcBUPOl.js.gz +0 -0
- package/dist/web/assets/{design-settings-section-9PFMZjT_.js → design-settings-section-uGcTp0xm.js} +1 -1
- package/dist/web/assets/design-settings-section-uGcTp0xm.js.br +0 -0
- package/dist/web/assets/design-settings-section-uGcTp0xm.js.gz +0 -0
- package/dist/web/assets/{design-tab-CoqFJQSR.js → design-tab-CUBLmhA_.js} +1 -1
- package/dist/web/assets/design-tab-CUBLmhA_.js.br +0 -0
- package/dist/web/assets/design-tab-CUBLmhA_.js.gz +0 -0
- package/dist/web/assets/{designs-sidebar-panel-BY1ZqrHe.js → designs-sidebar-panel-BNHjso1n.js} +1 -1
- package/dist/web/assets/designs-sidebar-panel-BNHjso1n.js.br +0 -0
- package/dist/web/assets/designs-sidebar-panel-BNHjso1n.js.gz +0 -0
- package/dist/web/assets/{diff-viewer-CpqSe-o9.js → diff-viewer-BDtesMjO.js} +1 -1
- package/dist/web/assets/diff-viewer-BDtesMjO.js.br +0 -0
- package/dist/web/assets/diff-viewer-BDtesMjO.js.gz +0 -0
- package/dist/web/assets/{docx-preview-CbBmJWbj.js → docx-preview-9Ml5_fbG.js} +1 -1
- package/dist/web/assets/docx-preview-9Ml5_fbG.js.br +0 -0
- package/dist/web/assets/docx-preview-9Ml5_fbG.js.gz +0 -0
- package/dist/web/assets/{editor-dialog-Dxi5SO0y.js → editor-dialog-DpXV1Z0v.js} +1 -1
- package/dist/web/assets/editor-dialog-DpXV1Z0v.js.br +0 -0
- package/dist/web/assets/editor-dialog-DpXV1Z0v.js.gz +0 -0
- package/dist/web/assets/{editor-language-service-bm29r4Fu.js → editor-language-service-j04SQVJt.js} +1 -1
- package/dist/web/assets/editor-language-service-j04SQVJt.js.br +0 -0
- package/dist/web/assets/editor-language-service-j04SQVJt.js.gz +0 -0
- package/dist/web/assets/{explorer-body-CbmcewbM.js → explorer-body-C1NDoXfr.js} +1 -1
- package/dist/web/assets/explorer-body-C1NDoXfr.js.br +0 -0
- package/dist/web/assets/explorer-body-C1NDoXfr.js.gz +0 -0
- package/dist/web/assets/{explorer-window-content-D9wAL573.js → explorer-window-content-DCkRo5vF.js} +1 -1
- package/dist/web/assets/explorer-window-content-DCkRo5vF.js.br +0 -0
- package/dist/web/assets/explorer-window-content-DCkRo5vF.js.gz +0 -0
- package/dist/web/assets/{extension-manager-section-DebQeiKl.js → extension-manager-section-BzPmeO_l.js} +1 -1
- package/dist/web/assets/extension-manager-section-BzPmeO_l.js.br +0 -0
- package/dist/web/assets/extension-manager-section-BzPmeO_l.js.gz +0 -0
- package/dist/web/assets/{extension-webview-BnAyQBUZ.js → extension-webview-C6bRYlvp.js} +1 -1
- package/dist/web/assets/extension-webview-C6bRYlvp.js.br +0 -0
- package/dist/web/assets/extension-webview-C6bRYlvp.js.gz +0 -0
- package/dist/web/assets/{files-settings-section-MUf9xin0.js → files-settings-section-CoecdMyn.js} +1 -1
- package/dist/web/assets/files-settings-section-CoecdMyn.js.br +0 -0
- package/dist/web/assets/files-settings-section-CoecdMyn.js.gz +0 -0
- package/dist/web/assets/{general-settings-section-2UpgwBHP.js → general-settings-section-BN__JBq9.js} +1 -1
- package/dist/web/assets/general-settings-section-BN__JBq9.js.br +0 -0
- package/dist/web/assets/general-settings-section-BN__JBq9.js.gz +0 -0
- package/dist/web/assets/{git-log-panel-B-gEt6FO.js → git-log-panel-D6VEokPi.js} +1 -1
- package/dist/web/assets/git-log-panel-D6VEokPi.js.br +0 -0
- package/dist/web/assets/git-log-panel-D6VEokPi.js.gz +0 -0
- package/dist/web/assets/{git-review-tab-4qOe-u0d.js → git-review-tab-B_qy-D4h.js} +1 -1
- package/dist/web/assets/git-review-tab-B_qy-D4h.js.br +0 -0
- package/dist/web/assets/git-review-tab-B_qy-D4h.js.gz +0 -0
- package/dist/web/assets/{glide-data-grid-UEC9DyPH.js → glide-data-grid-BxmJ3ryq.js} +1 -1
- package/dist/web/assets/glide-data-grid-BxmJ3ryq.js.br +0 -0
- package/dist/web/assets/glide-data-grid-BxmJ3ryq.js.gz +0 -0
- package/dist/web/assets/{grid-save-dialog-SzJ8X5z4.js → grid-save-dialog-enzWzJ7J.js} +1 -1
- package/dist/web/assets/grid-save-dialog-enzWzJ7J.js.br +0 -0
- package/dist/web/assets/grid-save-dialog-enzWzJ7J.js.gz +0 -0
- package/dist/web/assets/{group-chat-tab-ByBqKGr9.js → group-chat-tab-DvPQmyxr.js} +1 -1
- package/dist/web/assets/group-chat-tab-DvPQmyxr.js.br +0 -0
- package/dist/web/assets/group-chat-tab-DvPQmyxr.js.gz +0 -0
- package/dist/web/assets/{impexp-tab-BhMUbG1w.js → impexp-tab-D0aoq-fo.js} +1 -1
- package/dist/web/assets/impexp-tab-D0aoq-fo.js.br +0 -0
- package/dist/web/assets/impexp-tab-D0aoq-fo.js.gz +0 -0
- package/dist/web/assets/{index-C1yo_ZSD.js → index-B_STtuHL.js} +5 -5
- package/dist/web/assets/index-B_STtuHL.js.br +0 -0
- package/dist/web/assets/index-B_STtuHL.js.gz +0 -0
- package/dist/web/assets/{jira-watcher-section-BqdMrEZT.js → jira-watcher-section-NbkZN3fb.js} +1 -1
- package/dist/web/assets/{keybindings-store-Cq2SS7Bo.js → keybindings-store-B1_aryuo.js} +1 -1
- package/dist/web/assets/{keyboard-shortcuts-section-Dct0U4b5.js → keyboard-shortcuts-section-mYjvvv_y.js} +1 -1
- package/dist/web/assets/keyboard-shortcuts-section-mYjvvv_y.js.br +0 -0
- package/dist/web/assets/keyboard-shortcuts-section-mYjvvv_y.js.gz +0 -0
- package/dist/web/assets/{language-servers-section-DdqVZqBF.js → language-servers-section-BSwHUDJQ.js} +2 -2
- package/dist/web/assets/language-servers-section-BSwHUDJQ.js.br +0 -0
- package/dist/web/assets/language-servers-section-BSwHUDJQ.js.gz +0 -0
- package/dist/web/assets/{logs-app-BLrj-ybS.js → logs-app-CsEtQyUu.js} +1 -1
- package/dist/web/assets/logs-app-CsEtQyUu.js.br +0 -0
- package/dist/web/assets/{logs-app-BLrj-ybS.js.gz → logs-app-CsEtQyUu.js.gz} +0 -0
- package/dist/web/assets/{logs-tab-Bj5eSZD4.js → logs-tab-B2CNTiMx.js} +1 -1
- package/dist/web/assets/{logs-window-content-opPE-UY_.js → logs-window-content-Ba9yFly2.js} +1 -1
- package/dist/web/assets/{lsp-client-S9kz4kJR.js → lsp-client-CQO7drJW.js} +1 -1
- package/dist/web/assets/lsp-client-CQO7drJW.js.br +0 -0
- package/dist/web/assets/lsp-client-CQO7drJW.js.gz +0 -0
- package/dist/web/assets/{markdown-renderer-BUZQ9GkL.js → markdown-renderer-FBRIZVZE.js} +1 -1
- package/dist/web/assets/markdown-renderer-FBRIZVZE.js.br +0 -0
- package/dist/web/assets/markdown-renderer-FBRIZVZE.js.gz +0 -0
- package/dist/web/assets/{markdown-renderer-CYaCVe6_.js → markdown-renderer-HKqp5VOV.js} +1 -1
- package/dist/web/assets/markdown-renderer-HKqp5VOV.js.br +0 -0
- package/dist/web/assets/markdown-renderer-HKqp5VOV.js.gz +0 -0
- package/dist/web/assets/{mobile-explorer-sheet-DGnvriZK.js → mobile-explorer-sheet-DPzwE96u.js} +1 -1
- package/dist/web/assets/mobile-explorer-sheet-DPzwE96u.js.br +0 -0
- package/dist/web/assets/mobile-explorer-sheet-DPzwE96u.js.gz +0 -0
- package/dist/web/assets/{monaco-diff-editor-6yHLqPh6.js → monaco-diff-editor-DZSTwTr7.js} +1 -1
- package/dist/web/assets/{new-design-dialog-C5yFdNqq.js → new-design-dialog-BkmUc5l2.js} +1 -1
- package/dist/web/assets/{new-design-dialog-C5yFdNqq.js.br → new-design-dialog-BkmUc5l2.js.br} +0 -0
- package/dist/web/assets/new-design-dialog-BkmUc5l2.js.gz +0 -0
- package/dist/web/assets/{notifications-settings-section-CCkjBI1i.js → notifications-settings-section-BV3P3yel.js} +1 -1
- package/dist/web/assets/notifications-settings-section-BV3P3yel.js.br +0 -0
- package/dist/web/assets/notifications-settings-section-BV3P3yel.js.gz +0 -0
- package/dist/web/assets/{onboarding-entry-CPAdrK58.js → onboarding-entry-DGkHd3Rb.js} +1 -1
- package/dist/web/assets/onboarding-entry-DGkHd3Rb.js.br +0 -0
- package/dist/web/assets/onboarding-entry-DGkHd3Rb.js.gz +0 -0
- package/dist/web/assets/{open-manager-chat-Bb6TIBkj.js → open-manager-chat-Cce6ApXH.js} +1 -1
- package/dist/web/assets/open-manager-chat-Cce6ApXH.js.br +0 -0
- package/dist/web/assets/open-manager-chat-Cce6ApXH.js.gz +0 -0
- package/dist/web/assets/{open-manager-chat-HCfUk2df.js → open-manager-chat-S_Kank3H.js} +1 -1
- package/dist/web/assets/open-manager-chat-S_Kank3H.js.br +0 -0
- package/dist/web/assets/open-manager-chat-S_Kank3H.js.gz +0 -0
- package/dist/web/assets/{problems-panel-DWsRAD-U.js → problems-panel-Kgj_Yf87.js} +1 -1
- package/dist/web/assets/problems-panel-Kgj_Yf87.js.br +0 -0
- package/dist/web/assets/problems-panel-Kgj_Yf87.js.gz +0 -0
- package/dist/web/assets/{process-table-BY9RyNlS.js → process-table-DoNHqCUm.js} +1 -1
- package/dist/web/assets/process-table-DoNHqCUm.js.br +0 -0
- package/dist/web/assets/process-table-DoNHqCUm.js.gz +0 -0
- package/dist/web/assets/{proxy-settings-section-CP8F2NxO.js → proxy-settings-section-PLuM-k5g.js} +1 -1
- package/dist/web/assets/proxy-settings-section-PLuM-k5g.js.br +0 -0
- package/dist/web/assets/proxy-settings-section-PLuM-k5g.js.gz +0 -0
- package/dist/web/assets/{query-tab-yG8LLbez.js → query-tab-DG4jqc2S.js} +1 -1
- package/dist/web/assets/query-tab-DG4jqc2S.js.br +0 -0
- package/dist/web/assets/query-tab-DG4jqc2S.js.gz +0 -0
- package/dist/web/assets/{release-notes-window-content-JWv9YpbO.js → release-notes-window-content-C1tjihMF.js} +1 -1
- package/dist/web/assets/{remote-access-settings-section-YEmhjT0A.js → remote-access-settings-section-OmDVEGLa.js} +1 -1
- package/dist/web/assets/remote-access-settings-section-OmDVEGLa.js.br +0 -0
- package/dist/web/assets/remote-access-settings-section-OmDVEGLa.js.gz +0 -0
- package/dist/web/assets/{remote-desktop-clipboard-notice-CLo_iFUn.js → remote-desktop-clipboard-notice-Ct6EZbzV.js} +1 -1
- package/dist/web/assets/remote-desktop-clipboard-notice-Ct6EZbzV.js.br +0 -0
- package/dist/web/assets/remote-desktop-clipboard-notice-Ct6EZbzV.js.gz +0 -0
- package/dist/web/assets/{remote-desktop-mobile-sheet-Biv_7ACf.js → remote-desktop-mobile-sheet-CLSXeU5h.js} +2 -2
- package/dist/web/assets/remote-desktop-mobile-sheet-CLSXeU5h.js.br +0 -0
- package/dist/web/assets/remote-desktop-mobile-sheet-CLSXeU5h.js.gz +0 -0
- package/dist/web/assets/{remote-desktop-mobile-view-D9xSVmuO.js → remote-desktop-mobile-view-D1hA0w_Q.js} +1 -1
- package/dist/web/assets/remote-desktop-mobile-view-D1hA0w_Q.js.br +0 -0
- package/dist/web/assets/remote-desktop-mobile-view-D1hA0w_Q.js.gz +0 -0
- package/dist/web/assets/{remote-desktop-readiness-gate-C94gjSq_.js → remote-desktop-readiness-gate-Ci7SwTRY.js} +1 -1
- package/dist/web/assets/remote-desktop-readiness-gate-Ci7SwTRY.js.br +0 -0
- package/dist/web/assets/remote-desktop-readiness-gate-Ci7SwTRY.js.gz +0 -0
- package/dist/web/assets/{remote-desktop-window-content-DJsTyWt3.js → remote-desktop-window-content-BS1vxoMj.js} +1 -1
- package/dist/web/assets/remote-desktop-window-content-BS1vxoMj.js.br +0 -0
- package/dist/web/assets/remote-desktop-window-content-BS1vxoMj.js.gz +0 -0
- package/dist/web/assets/{rename-object-dialog-HnxqPZm1.js → rename-object-dialog-DIeczIaO.js} +1 -1
- package/dist/web/assets/rename-object-dialog-DIeczIaO.js.br +0 -0
- package/dist/web/assets/rename-object-dialog-DIeczIaO.js.gz +0 -0
- package/dist/web/assets/{reveal-task-in-sidebar-CM2GLG3g.js → reveal-task-in-sidebar-Daao7aC9.js} +1 -1
- package/dist/web/assets/{review-address-setup-Ca_Ghden.js → review-address-setup-DqnqvrGv.js} +1 -1
- package/dist/web/assets/review-address-setup-DqnqvrGv.js.br +0 -0
- package/dist/web/assets/review-address-setup-DqnqvrGv.js.gz +0 -0
- package/dist/web/assets/{review-code-AWQkbVER.js → review-code-SMU1gJob.js} +1 -1
- package/dist/web/assets/review-code-SMU1gJob.js.br +0 -0
- package/dist/web/assets/review-code-SMU1gJob.js.gz +0 -0
- package/dist/web/assets/{save-as-dialog-ChQjGbCB.js → save-as-dialog-CPwLbIA3.js} +1 -1
- package/dist/web/assets/save-as-dialog-CPwLbIA3.js.br +0 -0
- package/dist/web/assets/save-as-dialog-CPwLbIA3.js.gz +0 -0
- package/dist/web/assets/{schedule-form-DxL7Ez0H.js → schedule-form-COjqb4Ge.js} +3 -3
- package/dist/web/assets/schedule-form-COjqb4Ge.js.br +0 -0
- package/dist/web/assets/schedule-form-COjqb4Ge.js.gz +0 -0
- package/dist/web/assets/{schedule-script-editor-CMIRfGR1.js → schedule-script-editor-C8YlX83W.js} +1 -1
- package/dist/web/assets/schedule-script-editor-C8YlX83W.js.br +0 -0
- package/dist/web/assets/schedule-script-editor-C8YlX83W.js.gz +0 -0
- package/dist/web/assets/{schedules-app-DCxDgww9.js → schedules-app-B8zPreon.js} +1 -1
- package/dist/web/assets/schedules-app-B8zPreon.js.br +0 -0
- package/dist/web/assets/schedules-app-B8zPreon.js.gz +0 -0
- package/dist/web/assets/{schedules-settings-section-GuQTrDJK.js → schedules-settings-section-BMnMWVUi.js} +3 -3
- package/dist/web/assets/schedules-settings-section-BMnMWVUi.js.br +0 -0
- package/dist/web/assets/schedules-settings-section-BMnMWVUi.js.gz +0 -0
- package/dist/web/assets/{schedules-tab-DdJtHgxV.js → schedules-tab-C-ccsLxW.js} +1 -1
- package/dist/web/assets/schedules-tab-C-ccsLxW.js.br +0 -0
- package/dist/web/assets/schedules-tab-C-ccsLxW.js.gz +0 -0
- package/dist/web/assets/{schedules-ui-TdMAYT0H.js → schedules-ui-CrmbzKxq.js} +1 -1
- package/dist/web/assets/schedules-ui-CrmbzKxq.js.br +0 -0
- package/dist/web/assets/schedules-ui-CrmbzKxq.js.gz +0 -0
- package/dist/web/assets/{schedules-window-content-9yvaaO3H.js → schedules-window-content-Bit1Z82i.js} +1 -1
- package/dist/web/assets/schedules-window-content-Bit1Z82i.js.br +0 -0
- package/dist/web/assets/schedules-window-content-Bit1Z82i.js.gz +0 -0
- package/dist/web/assets/{session-review-tab-5ByXzgxd.js → session-review-tab-e2mTMTRJ.js} +1 -1
- package/dist/web/assets/session-review-tab-e2mTMTRJ.js.br +0 -0
- package/dist/web/assets/session-review-tab-e2mTMTRJ.js.gz +0 -0
- package/dist/web/assets/{settings-body-DQIGymoQ.js → settings-body-Cmkt1SJk.js} +1 -1
- package/dist/web/assets/settings-body-Cmkt1SJk.js.br +0 -0
- package/dist/web/assets/settings-body-Cmkt1SJk.js.gz +0 -0
- package/dist/web/assets/{settings-rows-CT0CMEsd.js → settings-rows-BuCm2bbB.js} +1 -1
- package/dist/web/assets/settings-rows-BuCm2bbB.js.br +0 -0
- package/dist/web/assets/settings-rows-BuCm2bbB.js.gz +0 -0
- package/dist/web/assets/{settings-section-content-BPyH-2YV.js → settings-section-content-CLxRaZch.js} +2 -2
- package/dist/web/assets/settings-section-content-CLxRaZch.js.br +0 -0
- package/dist/web/assets/settings-section-content-CLxRaZch.js.gz +0 -0
- package/dist/web/assets/{settings-section-content-Ctd_-TMU.js → settings-section-content-Dh-sfp72.js} +1 -1
- package/dist/web/assets/{settings-tab-Bfg354Ka.js → settings-tab-D9wUDiUL.js} +1 -1
- package/dist/web/assets/{settings-window-content-DUsz8Bh5.js → settings-window-content-CWnNJeDA.js} +1 -1
- package/dist/web/assets/{sql-object-tab-7GhGJ4uQ.js → sql-object-tab-Lh3WhMPZ.js} +1 -1
- package/dist/web/assets/sql-object-tab-Lh3WhMPZ.js.br +0 -0
- package/dist/web/assets/sql-object-tab-Lh3WhMPZ.js.gz +0 -0
- package/dist/web/assets/{sqlite-viewer-BCa1mim9.js → sqlite-viewer-oexB5W3P.js} +1 -1
- package/dist/web/assets/sqlite-viewer-oexB5W3P.js.br +0 -0
- package/dist/web/assets/sqlite-viewer-oexB5W3P.js.gz +0 -0
- package/dist/web/assets/{storage-settings-section-C2-SW7xV.js → storage-settings-section-Bpoy091_.js} +1 -1
- package/dist/web/assets/storage-settings-section-Bpoy091_.js.br +0 -0
- package/dist/web/assets/storage-settings-section-Bpoy091_.js.gz +0 -0
- package/dist/web/assets/{structure-save-dialog-B1T0Rz32.js → structure-save-dialog-_o3KLjL6.js} +1 -1
- package/dist/web/assets/structure-save-dialog-_o3KLjL6.js.br +0 -0
- package/dist/web/assets/structure-save-dialog-_o3KLjL6.js.gz +0 -0
- package/dist/web/assets/{structure-tab-CNAqLHsg.js → structure-tab-BWJgPzsz.js} +1 -1
- package/dist/web/assets/structure-tab-BWJgPzsz.js.br +0 -0
- package/dist/web/assets/structure-tab-BWJgPzsz.js.gz +0 -0
- package/dist/web/assets/{system-monitor-body-DMnTABKR.js → system-monitor-body-CeTN1D4_.js} +2 -2
- package/dist/web/assets/system-monitor-body-CeTN1D4_.js.br +0 -0
- package/dist/web/assets/system-monitor-body-CeTN1D4_.js.gz +0 -0
- package/dist/web/assets/{system-monitor-tab-DUF6O7Xz.js → system-monitor-tab-BrJTf2E7.js} +1 -1
- package/dist/web/assets/{system-monitor-window-content-DQsbA25H.js → system-monitor-window-content-YEY0Mesp.js} +1 -1
- package/dist/web/assets/{tab-host-window-content-BDhc4wKT.js → tab-host-window-content-nRudFszu.js} +1 -1
- package/dist/web/assets/tab-host-window-content-nRudFszu.js.br +0 -0
- package/dist/web/assets/tab-host-window-content-nRudFszu.js.gz +0 -0
- package/dist/web/assets/{table-tab-pxQwA8ud.js → table-tab-D_BG9tws.js} +1 -1
- package/dist/web/assets/table-tab-D_BG9tws.js.br +0 -0
- package/dist/web/assets/table-tab-D_BG9tws.js.gz +0 -0
- package/dist/web/assets/{task-detail-mobile-hCX_U3AG.js → task-detail-mobile-C-OFgEqU.js} +1 -1
- package/dist/web/assets/task-detail-mobile-C-OFgEqU.js.br +0 -0
- package/dist/web/assets/task-detail-mobile-C-OFgEqU.js.gz +0 -0
- package/dist/web/assets/{task-sheet-cYC4D2FZ.js → task-sheet-D5XLPGsv.js} +1 -1
- package/dist/web/assets/task-sheet-D5XLPGsv.js.br +0 -0
- package/dist/web/assets/task-sheet-D5XLPGsv.js.gz +0 -0
- package/dist/web/assets/{task-status-grid-Cg3IAZTP.js → task-status-grid-Cy86_hiJ.js} +1 -1
- package/dist/web/assets/task-status-grid-Cy86_hiJ.js.br +0 -0
- package/dist/web/assets/task-status-grid-Cy86_hiJ.js.gz +0 -0
- package/dist/web/assets/{task-tab-DUyJ3EdZ.js → task-tab-CGBp2BuW.js} +1 -1
- package/dist/web/assets/task-tab-CGBp2BuW.js.br +0 -0
- package/dist/web/assets/task-tab-CGBp2BuW.js.gz +0 -0
- package/dist/web/assets/{tasks-sidebar-panel-C7JzyhjL.js → tasks-sidebar-panel-BPZxehe2.js} +1 -1
- package/dist/web/assets/tasks-sidebar-panel-BPZxehe2.js.br +0 -0
- package/dist/web/assets/tasks-sidebar-panel-BPZxehe2.js.gz +0 -0
- package/dist/web/assets/{telegram-bot-token-field-cC31If8Y.js → telegram-bot-token-field-C4C1Lx54.js} +1 -1
- package/dist/web/assets/telegram-bot-token-field-C4C1Lx54.js.br +0 -0
- package/dist/web/assets/telegram-bot-token-field-C4C1Lx54.js.gz +0 -0
- package/dist/web/assets/{terminal-tab-BKn9orPm.js → terminal-tab-r7DvmDkn.js} +1 -1
- package/dist/web/assets/terminal-tab-r7DvmDkn.js.br +0 -0
- package/dist/web/assets/terminal-tab-r7DvmDkn.js.gz +0 -0
- package/dist/web/assets/{tool-cards-DjP_ANs5.js → tool-cards-BMvCkMrc.js} +3 -3
- package/dist/web/assets/tool-cards-BMvCkMrc.js.br +0 -0
- package/dist/web/assets/tool-cards-BMvCkMrc.js.gz +0 -0
- package/dist/web/assets/{tools-settings-section-DD1jwvQK.js → tools-settings-section-BdaYaCMA.js} +1 -1
- package/dist/web/assets/tools-settings-section-BdaYaCMA.js.br +0 -0
- package/dist/web/assets/tools-settings-section-BdaYaCMA.js.gz +0 -0
- package/dist/web/assets/{use-db-read-C0TwRbcj.js → use-db-read-C-M9ufKb.js} +1 -1
- package/dist/web/assets/use-db-read-C-M9ufKb.js.br +0 -0
- package/dist/web/assets/use-db-read-C-M9ufKb.js.gz +0 -0
- package/dist/web/assets/{use-inline-blame-D9xZQKIK.js → use-inline-blame-DO3v-c0T.js} +1 -1
- package/dist/web/assets/use-inline-blame-DO3v-c0T.js.br +0 -0
- package/dist/web/assets/use-inline-blame-DO3v-c0T.js.gz +0 -0
- package/dist/web/assets/{use-lsp-CnIYa0YQ.js → use-lsp-CIrG9p_O.js} +1 -1
- package/dist/web/assets/use-lsp-CIrG9p_O.js.br +0 -0
- package/dist/web/assets/use-lsp-CIrG9p_O.js.gz +0 -0
- package/dist/web/assets/{use-monaco-theme-Co5CU8CI.js → use-monaco-theme-syap4PHb.js} +1 -1
- package/dist/web/assets/{use-process-kill-C9_KMMEB.js → use-process-kill-DCpdxmos.js} +1 -1
- package/dist/web/assets/use-process-kill-DCpdxmos.js.br +0 -0
- package/dist/web/assets/use-process-kill-DCpdxmos.js.gz +0 -0
- package/dist/web/assets/{use-sql-schema-info-DCd3AhR3.js → use-sql-schema-info-Ba0vMKMP.js} +1 -1
- package/dist/web/assets/use-sql-schema-info-Ba0vMKMP.js.br +0 -0
- package/dist/web/assets/use-sql-schema-info-Ba0vMKMP.js.gz +0 -0
- package/dist/web/assets/{use-websocket-B-sllKQE.js → use-websocket-F3qAHq3A.js} +1 -1
- package/dist/web/assets/{vault-settings-section-Cyai0ayj.js → vault-settings-section-DqqK9yAG.js} +1 -1
- package/dist/web/assets/vault-settings-section-DqqK9yAG.js.br +0 -0
- package/dist/web/assets/vault-settings-section-DqqK9yAG.js.gz +0 -0
- package/dist/web/assets/{voice-settings-section-TOtzMr4U.js → voice-settings-section-DWXTDCIK.js} +1 -1
- package/dist/web/assets/voice-settings-section-DWXTDCIK.js.br +0 -0
- package/dist/web/assets/voice-settings-section-DWXTDCIK.js.gz +0 -0
- package/dist/web/assets/{web-preview-tab-DZsrtRLQ.js → web-preview-tab-FTTkrEhi.js} +1 -1
- package/dist/web/assets/web-preview-tab-FTTkrEhi.js.br +0 -0
- package/dist/web/assets/web-preview-tab-FTTkrEhi.js.gz +0 -0
- package/dist/web/assets/{xlsx-preview-KN0-tznp.js → xlsx-preview-OlnGEuoj.js} +1 -1
- package/dist/web/assets/xlsx-preview-OlnGEuoj.js.br +0 -0
- package/dist/web/assets/xlsx-preview-OlnGEuoj.js.gz +0 -0
- package/dist/web/index.html +1 -1
- package/dist/web/index.html.br +0 -0
- package/dist/web/index.html.gz +0 -0
- package/dist/web/sw.js +1 -1
- package/dist/web/sw.js.br +0 -0
- package/dist/web/sw.js.gz +0 -0
- package/docs/architecture/ai-chat-and-providers.md +1 -1
- package/docs/architecture/ppm-assistant.md +11 -6
- package/docs/architecture/schedules.md +10 -1
- package/package.json +1 -1
- package/src/server/routes/schedules.ts +6 -5
- package/src/server/ws/chat-collab-approval-relay.ts +1 -1
- package/src/server/ws/chat.ts +1 -1
- package/src/services/assistant/assistant-instructions-chats.ts +3 -2
- package/src/services/assistant-cards/assistant-cards-db.ts +14 -0
- package/src/services/assistant-cards/assistant-cards-startup.ts +0 -2
- package/src/services/assistant-cards/manager-report-env.ts +9 -1
- package/src/services/assistant-cards/manager-report-tool.ts +70 -2
- package/src/services/assistant-cards/manager-signals.ts +3 -2
- package/src/services/assistant-cards/ordinary-chat-cards.ts +8 -21
- package/src/services/assistant-managers/manager-context-entry.ts +1 -1
- package/src/services/assistant-mcp/assistant-schedule-propose-tool.ts +2 -1
- package/src/services/assistant-mcp/assistant-schedule-write-tools.ts +2 -1
- package/src/services/db.service.ts +22 -2
- package/src/services/schedule-creator-backfill.ts +122 -0
- package/src/services/schedule-proposals/script-proposal-create.ts +6 -3
- package/src/services/scheduler-db.service.ts +10 -2
- package/src/services/session-collab/collab-schedule-proposals.ts +3 -2
- package/src/services/session-collab/collab-schedules.ts +1 -1
- package/src/services/session-collab/session-collab-tool.ts +6 -2
- package/src/services/session-schedules/session-schedule-save.ts +28 -1
- package/src/types/scheduler.ts +7 -0
- package/src/web/components/chat/session-schedules-chip.tsx +37 -11
- package/dist/web/assets/accounts-settings-section-DdOOi40j.js.br +0 -0
- package/dist/web/assets/accounts-settings-section-DdOOi40j.js.gz +0 -0
- package/dist/web/assets/agent-session-sheet-DrGTDCGf.js.br +0 -0
- package/dist/web/assets/agent-session-sheet-DrGTDCGf.js.gz +0 -0
- package/dist/web/assets/agent-session-window-content-BYtnnDj7.js.br +0 -0
- package/dist/web/assets/agent-session-window-content-BYtnnDj7.js.gz +0 -0
- package/dist/web/assets/ai-resource-editor-COFega94.js.br +0 -0
- package/dist/web/assets/ai-resource-editor-COFega94.js.gz +0 -0
- package/dist/web/assets/ai-settings-section-B7Clb3Ph.js.br +0 -0
- package/dist/web/assets/ai-settings-section-B7Clb3Ph.js.gz +0 -0
- package/dist/web/assets/ai-settings-section-DI54qFgt.js.br +0 -0
- package/dist/web/assets/ai-settings-section-DI54qFgt.js.gz +0 -0
- package/dist/web/assets/android-tab-Cde_HW-w.js.br +0 -0
- package/dist/web/assets/android-tab-Cde_HW-w.js.gz +0 -0
- package/dist/web/assets/antigravity-usage-view-CDGsubUs.js.br +0 -0
- package/dist/web/assets/appearance-settings-section-DHn8xrzo.js.br +0 -0
- package/dist/web/assets/appearance-settings-section-DHn8xrzo.js.gz +0 -0
- package/dist/web/assets/apps-panel-CZfxbkiw.js.br +0 -0
- package/dist/web/assets/apps-panel-CZfxbkiw.js.gz +0 -0
- package/dist/web/assets/assistant-settings-section-CiEJ-wP_.js.br +0 -0
- package/dist/web/assets/assistant-settings-section-CiEJ-wP_.js.gz +0 -0
- package/dist/web/assets/assistant-tab-CXQXPLF_.js.br +0 -0
- package/dist/web/assets/assistant-tab-CXQXPLF_.js.gz +0 -0
- package/dist/web/assets/branch-review-tab-CoczozHQ.js.br +0 -0
- package/dist/web/assets/branch-review-tab-CoczozHQ.js.gz +0 -0
- package/dist/web/assets/chat-tab-BEMvwnRo.js +0 -17
- package/dist/web/assets/chat-tab-BEMvwnRo.js.br +0 -0
- package/dist/web/assets/chat-tab-BEMvwnRo.js.gz +0 -0
- package/dist/web/assets/chat-tab-De3iofct.js.br +0 -0
- package/dist/web/assets/chat-tab-De3iofct.js.gz +0 -0
- package/dist/web/assets/code-editor-BHuTauGz.js.br +0 -0
- package/dist/web/assets/code-editor-BHuTauGz.js.gz +0 -0
- package/dist/web/assets/conflict-editor-D8kIOcxU.js.br +0 -0
- package/dist/web/assets/conflict-editor-D8kIOcxU.js.gz +0 -0
- package/dist/web/assets/connection-form-tab-UsdARMsC.js.br +0 -0
- package/dist/web/assets/connection-form-tab-UsdARMsC.js.gz +0 -0
- package/dist/web/assets/csv-preview-Mzw2saJV.js.br +0 -0
- package/dist/web/assets/csv-preview-Mzw2saJV.js.gz +0 -0
- package/dist/web/assets/database-drivers-section-D3zn3c_6.js.br +0 -0
- package/dist/web/assets/database-drivers-section-D3zn3c_6.js.gz +0 -0
- package/dist/web/assets/db-tab-parts-9fyVffo3.js.br +0 -0
- package/dist/web/assets/db-tab-parts-9fyVffo3.js.gz +0 -0
- package/dist/web/assets/design-settings-section-9PFMZjT_.js.br +0 -0
- package/dist/web/assets/design-settings-section-9PFMZjT_.js.gz +0 -0
- package/dist/web/assets/design-tab-CoqFJQSR.js.br +0 -0
- package/dist/web/assets/design-tab-CoqFJQSR.js.gz +0 -0
- package/dist/web/assets/designs-sidebar-panel-BY1ZqrHe.js.br +0 -0
- package/dist/web/assets/designs-sidebar-panel-BY1ZqrHe.js.gz +0 -0
- package/dist/web/assets/diff-viewer-CpqSe-o9.js.br +0 -0
- package/dist/web/assets/diff-viewer-CpqSe-o9.js.gz +0 -0
- package/dist/web/assets/docx-preview-CbBmJWbj.js.br +0 -0
- package/dist/web/assets/docx-preview-CbBmJWbj.js.gz +0 -0
- package/dist/web/assets/editor-dialog-Dxi5SO0y.js.br +0 -0
- package/dist/web/assets/editor-dialog-Dxi5SO0y.js.gz +0 -0
- package/dist/web/assets/editor-language-service-bm29r4Fu.js.br +0 -0
- package/dist/web/assets/editor-language-service-bm29r4Fu.js.gz +0 -0
- package/dist/web/assets/explorer-body-CbmcewbM.js.br +0 -0
- package/dist/web/assets/explorer-body-CbmcewbM.js.gz +0 -0
- package/dist/web/assets/explorer-window-content-D9wAL573.js.br +0 -0
- package/dist/web/assets/explorer-window-content-D9wAL573.js.gz +0 -0
- package/dist/web/assets/extension-manager-section-DebQeiKl.js.br +0 -0
- package/dist/web/assets/extension-manager-section-DebQeiKl.js.gz +0 -0
- package/dist/web/assets/extension-webview-BnAyQBUZ.js.br +0 -0
- package/dist/web/assets/extension-webview-BnAyQBUZ.js.gz +0 -0
- package/dist/web/assets/files-settings-section-MUf9xin0.js.br +0 -0
- package/dist/web/assets/files-settings-section-MUf9xin0.js.gz +0 -0
- package/dist/web/assets/general-settings-section-2UpgwBHP.js.br +0 -0
- package/dist/web/assets/general-settings-section-2UpgwBHP.js.gz +0 -0
- package/dist/web/assets/git-log-panel-B-gEt6FO.js.br +0 -0
- package/dist/web/assets/git-log-panel-B-gEt6FO.js.gz +0 -0
- package/dist/web/assets/git-review-tab-4qOe-u0d.js.br +0 -0
- package/dist/web/assets/git-review-tab-4qOe-u0d.js.gz +0 -0
- package/dist/web/assets/glide-data-grid-UEC9DyPH.js.br +0 -0
- package/dist/web/assets/glide-data-grid-UEC9DyPH.js.gz +0 -0
- package/dist/web/assets/grid-save-dialog-SzJ8X5z4.js.br +0 -0
- package/dist/web/assets/grid-save-dialog-SzJ8X5z4.js.gz +0 -0
- package/dist/web/assets/group-chat-tab-ByBqKGr9.js.br +0 -0
- package/dist/web/assets/group-chat-tab-ByBqKGr9.js.gz +0 -0
- package/dist/web/assets/impexp-tab-BhMUbG1w.js.br +0 -0
- package/dist/web/assets/impexp-tab-BhMUbG1w.js.gz +0 -0
- package/dist/web/assets/index-C1yo_ZSD.js.br +0 -0
- package/dist/web/assets/index-C1yo_ZSD.js.gz +0 -0
- package/dist/web/assets/keyboard-shortcuts-section-Dct0U4b5.js.br +0 -0
- package/dist/web/assets/keyboard-shortcuts-section-Dct0U4b5.js.gz +0 -0
- package/dist/web/assets/language-servers-section-DdqVZqBF.js.br +0 -0
- package/dist/web/assets/language-servers-section-DdqVZqBF.js.gz +0 -0
- package/dist/web/assets/logs-app-BLrj-ybS.js.br +0 -0
- package/dist/web/assets/lsp-client-S9kz4kJR.js.br +0 -0
- package/dist/web/assets/lsp-client-S9kz4kJR.js.gz +0 -0
- package/dist/web/assets/markdown-renderer-BUZQ9GkL.js.br +0 -0
- package/dist/web/assets/markdown-renderer-BUZQ9GkL.js.gz +0 -0
- package/dist/web/assets/markdown-renderer-CYaCVe6_.js.br +0 -0
- package/dist/web/assets/markdown-renderer-CYaCVe6_.js.gz +0 -0
- package/dist/web/assets/mobile-explorer-sheet-DGnvriZK.js.br +0 -0
- package/dist/web/assets/mobile-explorer-sheet-DGnvriZK.js.gz +0 -0
- package/dist/web/assets/new-design-dialog-C5yFdNqq.js.gz +0 -0
- package/dist/web/assets/notifications-settings-section-CCkjBI1i.js.br +0 -0
- package/dist/web/assets/notifications-settings-section-CCkjBI1i.js.gz +0 -0
- package/dist/web/assets/onboarding-entry-CPAdrK58.js.br +0 -0
- package/dist/web/assets/onboarding-entry-CPAdrK58.js.gz +0 -0
- package/dist/web/assets/open-manager-chat-Bb6TIBkj.js.br +0 -0
- package/dist/web/assets/open-manager-chat-Bb6TIBkj.js.gz +0 -0
- package/dist/web/assets/open-manager-chat-HCfUk2df.js.br +0 -0
- package/dist/web/assets/open-manager-chat-HCfUk2df.js.gz +0 -0
- package/dist/web/assets/problems-panel-DWsRAD-U.js.br +0 -0
- package/dist/web/assets/problems-panel-DWsRAD-U.js.gz +0 -0
- package/dist/web/assets/process-table-BY9RyNlS.js.br +0 -0
- package/dist/web/assets/process-table-BY9RyNlS.js.gz +0 -0
- package/dist/web/assets/proxy-settings-section-CP8F2NxO.js.br +0 -0
- package/dist/web/assets/proxy-settings-section-CP8F2NxO.js.gz +0 -0
- package/dist/web/assets/query-tab-yG8LLbez.js.br +0 -0
- package/dist/web/assets/query-tab-yG8LLbez.js.gz +0 -0
- package/dist/web/assets/remote-access-settings-section-YEmhjT0A.js.br +0 -0
- package/dist/web/assets/remote-access-settings-section-YEmhjT0A.js.gz +0 -0
- package/dist/web/assets/remote-desktop-clipboard-notice-CLo_iFUn.js.br +0 -0
- package/dist/web/assets/remote-desktop-clipboard-notice-CLo_iFUn.js.gz +0 -0
- package/dist/web/assets/remote-desktop-mobile-sheet-Biv_7ACf.js.br +0 -0
- package/dist/web/assets/remote-desktop-mobile-sheet-Biv_7ACf.js.gz +0 -0
- package/dist/web/assets/remote-desktop-mobile-view-D9xSVmuO.js.br +0 -0
- package/dist/web/assets/remote-desktop-mobile-view-D9xSVmuO.js.gz +0 -0
- package/dist/web/assets/remote-desktop-readiness-gate-C94gjSq_.js.br +0 -0
- package/dist/web/assets/remote-desktop-readiness-gate-C94gjSq_.js.gz +0 -0
- package/dist/web/assets/remote-desktop-window-content-DJsTyWt3.js.br +0 -0
- package/dist/web/assets/remote-desktop-window-content-DJsTyWt3.js.gz +0 -0
- package/dist/web/assets/rename-object-dialog-HnxqPZm1.js.br +0 -0
- package/dist/web/assets/rename-object-dialog-HnxqPZm1.js.gz +0 -0
- package/dist/web/assets/review-address-setup-Ca_Ghden.js.br +0 -0
- package/dist/web/assets/review-address-setup-Ca_Ghden.js.gz +0 -0
- package/dist/web/assets/review-code-AWQkbVER.js.br +0 -0
- package/dist/web/assets/review-code-AWQkbVER.js.gz +0 -0
- package/dist/web/assets/save-as-dialog-ChQjGbCB.js.br +0 -0
- package/dist/web/assets/save-as-dialog-ChQjGbCB.js.gz +0 -0
- package/dist/web/assets/schedule-form-DxL7Ez0H.js.br +0 -0
- package/dist/web/assets/schedule-form-DxL7Ez0H.js.gz +0 -0
- package/dist/web/assets/schedule-script-editor-CMIRfGR1.js.br +0 -0
- package/dist/web/assets/schedule-script-editor-CMIRfGR1.js.gz +0 -0
- package/dist/web/assets/schedules-app-DCxDgww9.js.br +0 -0
- package/dist/web/assets/schedules-app-DCxDgww9.js.gz +0 -0
- package/dist/web/assets/schedules-settings-section-GuQTrDJK.js.br +0 -0
- package/dist/web/assets/schedules-settings-section-GuQTrDJK.js.gz +0 -0
- package/dist/web/assets/schedules-tab-DdJtHgxV.js.br +0 -0
- package/dist/web/assets/schedules-tab-DdJtHgxV.js.gz +0 -0
- package/dist/web/assets/schedules-ui-TdMAYT0H.js.br +0 -0
- package/dist/web/assets/schedules-ui-TdMAYT0H.js.gz +0 -0
- package/dist/web/assets/schedules-window-content-9yvaaO3H.js.br +0 -0
- package/dist/web/assets/schedules-window-content-9yvaaO3H.js.gz +0 -0
- package/dist/web/assets/session-review-tab-5ByXzgxd.js.br +0 -0
- package/dist/web/assets/session-review-tab-5ByXzgxd.js.gz +0 -0
- package/dist/web/assets/settings-body-DQIGymoQ.js.br +0 -0
- package/dist/web/assets/settings-body-DQIGymoQ.js.gz +0 -0
- package/dist/web/assets/settings-rows-CT0CMEsd.js.br +0 -0
- package/dist/web/assets/settings-rows-CT0CMEsd.js.gz +0 -0
- package/dist/web/assets/settings-section-content-BPyH-2YV.js.br +0 -0
- package/dist/web/assets/settings-section-content-BPyH-2YV.js.gz +0 -0
- package/dist/web/assets/sql-object-tab-7GhGJ4uQ.js.br +0 -0
- package/dist/web/assets/sql-object-tab-7GhGJ4uQ.js.gz +0 -0
- package/dist/web/assets/sqlite-viewer-BCa1mim9.js.br +0 -0
- package/dist/web/assets/sqlite-viewer-BCa1mim9.js.gz +0 -0
- package/dist/web/assets/storage-settings-section-C2-SW7xV.js.br +0 -0
- package/dist/web/assets/storage-settings-section-C2-SW7xV.js.gz +0 -0
- package/dist/web/assets/structure-save-dialog-B1T0Rz32.js.br +0 -0
- package/dist/web/assets/structure-save-dialog-B1T0Rz32.js.gz +0 -0
- package/dist/web/assets/structure-tab-CNAqLHsg.js.br +0 -0
- package/dist/web/assets/structure-tab-CNAqLHsg.js.gz +0 -0
- package/dist/web/assets/system-monitor-body-DMnTABKR.js.br +0 -0
- package/dist/web/assets/system-monitor-body-DMnTABKR.js.gz +0 -0
- package/dist/web/assets/tab-host-window-content-BDhc4wKT.js.br +0 -0
- package/dist/web/assets/tab-host-window-content-BDhc4wKT.js.gz +0 -0
- package/dist/web/assets/table-tab-pxQwA8ud.js.br +0 -0
- package/dist/web/assets/table-tab-pxQwA8ud.js.gz +0 -0
- package/dist/web/assets/task-detail-mobile-hCX_U3AG.js.br +0 -0
- package/dist/web/assets/task-detail-mobile-hCX_U3AG.js.gz +0 -0
- package/dist/web/assets/task-sheet-cYC4D2FZ.js.br +0 -0
- package/dist/web/assets/task-sheet-cYC4D2FZ.js.gz +0 -0
- package/dist/web/assets/task-status-grid-Cg3IAZTP.js.br +0 -0
- package/dist/web/assets/task-status-grid-Cg3IAZTP.js.gz +0 -0
- package/dist/web/assets/task-tab-DUyJ3EdZ.js.br +0 -0
- package/dist/web/assets/task-tab-DUyJ3EdZ.js.gz +0 -0
- package/dist/web/assets/tasks-sidebar-panel-C7JzyhjL.js.br +0 -0
- package/dist/web/assets/tasks-sidebar-panel-C7JzyhjL.js.gz +0 -0
- package/dist/web/assets/telegram-bot-token-field-cC31If8Y.js.br +0 -0
- package/dist/web/assets/telegram-bot-token-field-cC31If8Y.js.gz +0 -0
- package/dist/web/assets/terminal-tab-BKn9orPm.js.br +0 -0
- package/dist/web/assets/terminal-tab-BKn9orPm.js.gz +0 -0
- package/dist/web/assets/tool-cards-DjP_ANs5.js.br +0 -0
- package/dist/web/assets/tool-cards-DjP_ANs5.js.gz +0 -0
- package/dist/web/assets/tools-settings-section-DD1jwvQK.js.br +0 -0
- package/dist/web/assets/tools-settings-section-DD1jwvQK.js.gz +0 -0
- package/dist/web/assets/use-db-read-C0TwRbcj.js.br +0 -0
- package/dist/web/assets/use-db-read-C0TwRbcj.js.gz +0 -0
- package/dist/web/assets/use-inline-blame-D9xZQKIK.js.br +0 -0
- package/dist/web/assets/use-inline-blame-D9xZQKIK.js.gz +0 -0
- package/dist/web/assets/use-lsp-CnIYa0YQ.js.br +0 -0
- package/dist/web/assets/use-lsp-CnIYa0YQ.js.gz +0 -0
- package/dist/web/assets/use-process-kill-C9_KMMEB.js.br +0 -0
- package/dist/web/assets/use-process-kill-C9_KMMEB.js.gz +0 -0
- package/dist/web/assets/use-sql-schema-info-DCd3AhR3.js.br +0 -0
- package/dist/web/assets/use-sql-schema-info-DCd3AhR3.js.gz +0 -0
- package/dist/web/assets/vault-settings-section-Cyai0ayj.js.br +0 -0
- package/dist/web/assets/vault-settings-section-Cyai0ayj.js.gz +0 -0
- package/dist/web/assets/voice-settings-section-TOtzMr4U.js.br +0 -0
- package/dist/web/assets/voice-settings-section-TOtzMr4U.js.gz +0 -0
- package/dist/web/assets/web-preview-tab-DZsrtRLQ.js.br +0 -0
- package/dist/web/assets/web-preview-tab-DZsrtRLQ.js.gz +0 -0
- package/dist/web/assets/xlsx-preview-KN0-tznp.js.br +0 -0
- package/dist/web/assets/xlsx-preview-KN0-tznp.js.gz +0 -0
package/dist/web/assets/{vault-settings-section-Cyai0ayj.js → vault-settings-section-DqqK9yAG.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-CT0CMEsd.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-BuCm2bbB.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-TOtzMr4U.js → voice-settings-section-DWXTDCIK.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-C1yo_ZSD.js";import"./run-in-terminal-CMLJUGsE.js";import{t as D}from"./separator-oOpmQBhw.js";import{r as O}from"./settings-rows-CT0CMEsd.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-B_STtuHL.js";import"./run-in-terminal-CMLJUGsE.js";import{t as D}from"./separator-oOpmQBhw.js";import{r as O}from"./settings-rows-BuCm2bbB.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-B_STtuHL.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-B_STtuHL.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-B_STtuHL.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">
|
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":"1b414e9bcabc56ed360792e3f99d8c44","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-OqWQKHct.css"},{"revision":null,"url":"assets/index-C1yo_ZSD.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":"e39e2e09d9419f41cdfe7e5048125178","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-OqWQKHct.css"},{"revision":null,"url":"assets/index-B_STtuHL.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))});
|
package/dist/web/sw.js.br
CHANGED
|
Binary file
|
package/dist/web/sw.js.gz
CHANGED
|
Binary file
|
|
@@ -1028,7 +1028,7 @@ slot (`approval_request` with tool `ppm:session_collab`) and answered over HTTP
|
|
|
1028
1028
|
(`message`). *Allow for this session* holds per sender → target in memory only, until a restart,
|
|
1029
1029
|
and ends for good once the target runs more permissively than when it was allowed.
|
|
1030
1030
|
|
|
1031
|
-
Messaging an existing session asks nothing else. One card per session at a time, held
|
|
1031
|
+
Messaging an existing session asks nothing else. One card per session at a time, held an hour (`COLLAB_APPROVAL_WAIT_MS`), and mirrored to the PPM Assistant's "Waiting on you" whichever chat it is in.
|
|
1032
1032
|
PPM's approvals share one generalized slot with `db_execute` (`chat-ppm-approvals.ts`). A card
|
|
1033
1033
|
notifies as `collab_approval` ("Sessions need you"); an AI-created session finishing its turn sends
|
|
1034
1034
|
no "Chat completed" (a turn stopped by an error still does). `POST /chat/sessions/:id/stop-children`
|
|
@@ -1322,12 +1322,17 @@ in `assistant_cards` (migration 65) and announced on `/ws/global` as `assistant:
|
|
|
1322
1322
|
before the card as one photo or one album (`assistant-telegram-card-photos.ts`), each captioned
|
|
1323
1323
|
with its number (no link: the photo is the picture), under the same quiet hours and silence as the card, and
|
|
1324
1324
|
not at all for a project whose cards reach the phone by title only. Rules events become `rules_note` / `rules_change` cards, and the Assistant pausing its
|
|
1325
|
-
own messages a `budget` card (`assistant-event-cards.ts`).
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1325
|
+
own messages a `budget` card (`assistant-event-cards.ts`). Every other chat of a project,
|
|
1326
|
+
watched or not, gets the same `approval` / `question` mirror (`ordinary-chat-cards.ts` says
|
|
1327
|
+
which: not the Assistant's own, not a manager, not an extension's turn, not a Design chat),
|
|
1328
|
+
carrying `payload.chat` (its name and provider) and `payload.expiresAt` for a card that gives up
|
|
1329
|
+
by itself (a session tool's, after an hour): such a card used to wait only in its chat and run
|
|
1330
|
+
out while the user was away. A chat a manager opened, at any depth, is mirrored like any other:
|
|
1331
|
+
it used to be left to the manager to relay, which it learned of only when it next looked, often
|
|
1332
|
+
after the card ran out. A manager's `needs_decision` or `urgent` report about such a card (named
|
|
1333
|
+
by `chat`, or by naming exactly one such chat's session id with no `draft`) is folded into the
|
|
1334
|
+
mirror: nothing is filed and the call returns the mirror's id, its note saying how to file a report
|
|
1335
|
+
that only named the chat but is about something else (`manager-report-tool.ts`). A mirror's
|
|
1331
1336
|
Telegram copy says when it expires; when it does, `approval_resolved` carries reason `expired`,
|
|
1332
1337
|
the copy says so and one line under it tells the phone. A session tool's card is answered from
|
|
1333
1338
|
Telegram or from the mirror (origin `telegram` / `assistant_card`, once, never "for the
|
|
@@ -247,7 +247,16 @@ else: it never creates a chat. Code in `src/services/session-schedules/`.
|
|
|
247
247
|
- **In the chat.** The prompt is preceded by a `<ppm-schedule-run-v1>` block
|
|
248
248
|
(`src/shared/chat-schedule-run.ts`), which only the server writes; the chat draws it as one
|
|
249
249
|
"Schedule … ran" line that opens to the prompt (`schedule-run-line.tsx`), and a footer chip
|
|
250
|
-
lists the chat's schedules with pause, resume and delete (`session-schedules-chip.tsx`).
|
|
250
|
+
lists the chat's schedules with open, pause, resume and delete (`session-schedules-chip.tsx`).
|
|
251
|
+
The chip asks `GET /api/schedules?session=<id>` (`chatSchedulesOf`), which answers the session
|
|
252
|
+
schedules aimed at the chat *and* every schedule its AI created, script and prompt ones
|
|
253
|
+
included: `schedules.created_by_session_id` (migration 80) is set by the session tools
|
|
254
|
+
(`session_schedule_create`, `session_schedule_propose_script`) and by the PPM Assistant's
|
|
255
|
+
`schedule_save` / `schedule_propose_script`, which pass it in the route body. A schedule a person
|
|
256
|
+
makes in Settings or the CLI has none. Migration 80 fills it for older script and prompt
|
|
257
|
+
schedules from `session-trace.db` where the trace names the schedule's id and name within 15
|
|
258
|
+
minutes of its creation (`schedule-creator-backfill.ts`); older than the trace's retention, a
|
|
259
|
+
schedule stays unlinked.
|
|
251
260
|
- **A prompt that is a slash command.** A scheduled `/skill args` goes through the same alias
|
|
252
261
|
rewrite as a typed one. In a Claude chat it then stays the message's first characters, since
|
|
253
262
|
Claude Code runs a leading `/name` as that command or skill: the block goes after it
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@ import { Hono, type Context } from "hono";
|
|
|
3
3
|
import { ok, err } from "../../types/api.ts";
|
|
4
4
|
import { SESSION_ID_RE } from "../../shared/session-turn-ids.ts";
|
|
5
5
|
|
|
6
|
-
import { createSessionSchedule,
|
|
6
|
+
import { chatSchedulesOf, createSessionSchedule, creatorOf, patchSessionSchedule } from "../../services/session-schedules/session-schedule-save.ts";
|
|
7
7
|
import {
|
|
8
8
|
getSchedules,
|
|
9
9
|
getSchedule,
|
|
@@ -57,8 +57,8 @@ schedulesRoutes.use("*", async (c, next) => {
|
|
|
57
57
|
});
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
|
-
* Every schedule, or with `?session=<id>`
|
|
61
|
-
* had (
|
|
60
|
+
* Every schedule, or with `?session=<id>` what that one chat's footer chip lists under any id it
|
|
61
|
+
* had (the session schedules aimed at it and every schedule its AI created), or with `?task=<id>` the reminders that task owns. Each comes as an
|
|
62
62
|
* overview (`schedules-overview.ts`): the view plus its newest run, project, effective permission
|
|
63
63
|
* mode and task, which is everything the Schedules window and the rail's count read.
|
|
64
64
|
*/
|
|
@@ -68,7 +68,7 @@ schedulesRoutes.get("/", (c) => {
|
|
|
68
68
|
const task = c.req.query("task");
|
|
69
69
|
if (task !== undefined && !TASK_ID_RE.test(task)) return c.json(err("task must be a task id"), 400);
|
|
70
70
|
const enabledOnly = c.req.query("enabledOnly") === "true";
|
|
71
|
-
const rows = session !== undefined ?
|
|
71
|
+
const rows = session !== undefined ? chatSchedulesOf(session) : task !== undefined ? listSchedulesForTask(task) : getSchedules();
|
|
72
72
|
return c.json(ok(toScheduleOverviews(rows.filter((s) => !enabledOnly || s.enabled))));
|
|
73
73
|
});
|
|
74
74
|
|
|
@@ -107,7 +107,8 @@ schedulesRoutes.post("/", async (c) => {
|
|
|
107
107
|
return c.json(ok(toScheduleOverviews([created])[0]), 201);
|
|
108
108
|
}
|
|
109
109
|
// Snapshot the default provider so resume keeps working if default changes later
|
|
110
|
-
|
|
110
|
+
// `created_by_session_id` is set by the PPM Assistant's tools: it only lists the schedule in that chat's chip.
|
|
111
|
+
const id = insertSchedule({ ...newScheduleFrom(body, configService.get("ai").default_provider), created_by_session_id: creatorOf(body) });
|
|
111
112
|
schedulerService.rearm();
|
|
112
113
|
return c.json(ok(toScheduleOverviews([getSchedule(id)!])[0]), 201);
|
|
113
114
|
} catch (e) {
|
|
@@ -8,7 +8,7 @@ import { decidingInput } from "../../services/chat-control/approval-deciding-inp
|
|
|
8
8
|
* chat's server-side listeners whichever chat shows them, so the PPM Assistant's "Waiting on you"
|
|
9
9
|
* and its Telegram bridge carry them beside every other card, and settled by a person's press there
|
|
10
10
|
* through the same broker a click in PPM answers. A chat that waits on such a card is stopped until
|
|
11
|
-
* someone answers, and the card gives up after
|
|
11
|
+
* someone answers, and the card gives up after an hour: shown only on PPM's screen, it ran out
|
|
12
12
|
* while the user was away and never knew.
|
|
13
13
|
*
|
|
14
14
|
* Off PPM a card answers once or not at all: "allow for this session" is never offered there.
|
package/src/server/ws/chat.ts
CHANGED
|
@@ -1229,7 +1229,7 @@ function announcePpmApproval(sessionId: string, event: { type: string; requestId
|
|
|
1229
1229
|
const entry = activeSessions.get(sessionId);
|
|
1230
1230
|
if (!entry) return false;
|
|
1231
1231
|
// An extension's turn with nobody watching: the broker settles it as unanswerable rather than
|
|
1232
|
-
// holding a card for
|
|
1232
|
+
// holding a card for an hour that no device shows.
|
|
1233
1233
|
if (unattendedExtensionTurn(entry)) return false;
|
|
1234
1234
|
approvals.offer(sessionId, entry, ppmApprovalEvent(event));
|
|
1235
1235
|
armExtensionApprovalDeadline(sessionId, entry, event.requestId);
|
|
@@ -74,8 +74,9 @@ export const ASSISTANT_CHATS_SUBSECTIONS = `### Running the user's chats
|
|
|
74
74
|
|
|
75
75
|
### Cards and manager news
|
|
76
76
|
- What needs the user reaches them as a card PPM builds, not through you: a manager's report
|
|
77
|
-
(needs a decision, urgent, done, failed, the morning digest),
|
|
78
|
-
|
|
77
|
+
(needs a decision, urgent, done, failed, the morning digest), the approval or question any chat
|
|
78
|
+
of a project waits on (a manager chat's own, a chat a manager opened at any depth, or one the user
|
|
79
|
+
opened), a rules change PPM held, or a note that you paused messaging. A card is in front of
|
|
79
80
|
the user the moment it exists. Cards that only wait for an answer never wake you.
|
|
80
81
|
- PPM wakes this conversation with "News from manager chats" when a manager reports something
|
|
81
82
|
done, failed or urgent, or answers a message of yours nobody waited for. The details are in a
|