@hienlh/ppm 0.26.35 → 0.26.37

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.
Files changed (646) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/assets/skills/ppm/SKILL.md +1 -1
  3. package/assets/skills/ppm/references/cli-reference.md +32 -0
  4. package/assets/skills/ppm/references/http-api.md +1 -1
  5. package/dist/web/assets/{accounts-settings-section-DzgkmItP.js → accounts-settings-section-BEhO_tk8.js} +1 -1
  6. package/dist/web/assets/accounts-settings-section-BEhO_tk8.js.br +0 -0
  7. package/dist/web/assets/accounts-settings-section-BEhO_tk8.js.gz +0 -0
  8. package/dist/web/assets/{agent-session-sheet-D1zcLabJ.js → agent-session-sheet-CPGbWwvV.js} +2 -2
  9. package/dist/web/assets/agent-session-sheet-CPGbWwvV.js.br +0 -0
  10. package/dist/web/assets/agent-session-sheet-CPGbWwvV.js.gz +0 -0
  11. package/dist/web/assets/{agent-session-window-content-CheLJrvd.js → agent-session-window-content-Dg07wugC.js} +1 -1
  12. package/dist/web/assets/agent-session-window-content-Dg07wugC.js.br +0 -0
  13. package/dist/web/assets/agent-session-window-content-Dg07wugC.js.gz +0 -0
  14. package/dist/web/assets/{ai-resource-editor-DAhYtyVR.js → ai-resource-editor-CtREVrLq.js} +1 -1
  15. package/dist/web/assets/ai-resource-editor-CtREVrLq.js.br +0 -0
  16. package/dist/web/assets/ai-resource-editor-CtREVrLq.js.gz +0 -0
  17. package/dist/web/assets/{ai-settings-section-Bs2Q8txC.js → ai-settings-section-D4V29bTK.js} +1 -1
  18. package/dist/web/assets/ai-settings-section-D4V29bTK.js.br +0 -0
  19. package/dist/web/assets/ai-settings-section-D4V29bTK.js.gz +0 -0
  20. package/dist/web/assets/{ai-settings-section-buiug4ab.js → ai-settings-section-pI5l7zwf.js} +1 -1
  21. package/dist/web/assets/ai-settings-section-pI5l7zwf.js.br +0 -0
  22. package/dist/web/assets/ai-settings-section-pI5l7zwf.js.gz +0 -0
  23. package/dist/web/assets/{android-tab-BcFSiNS4.js → android-tab-COBazVpe.js} +1 -1
  24. package/dist/web/assets/android-tab-COBazVpe.js.br +0 -0
  25. package/dist/web/assets/android-tab-COBazVpe.js.gz +0 -0
  26. package/dist/web/assets/{antigravity-usage-view-Dkl4BEnk.js → antigravity-usage-view-0ncr6xtB.js} +1 -1
  27. package/dist/web/assets/antigravity-usage-view-0ncr6xtB.js.br +0 -0
  28. package/dist/web/assets/antigravity-usage-view-0ncr6xtB.js.gz +0 -0
  29. package/dist/web/assets/{appearance-settings-section-CR599TVd.js → appearance-settings-section-C2EEFTJx.js} +1 -1
  30. package/dist/web/assets/appearance-settings-section-C2EEFTJx.js.br +0 -0
  31. package/dist/web/assets/appearance-settings-section-C2EEFTJx.js.gz +0 -0
  32. package/dist/web/assets/{apps-panel-DyRhMVo6.js → apps-panel-B8S6bQbf.js} +1 -1
  33. package/dist/web/assets/apps-panel-B8S6bQbf.js.br +0 -0
  34. package/dist/web/assets/apps-panel-B8S6bQbf.js.gz +0 -0
  35. package/dist/web/assets/{assistant-settings-section-BpGcDoCX.js → assistant-settings-section-ChpHdoRK.js} +1 -1
  36. package/dist/web/assets/assistant-settings-section-ChpHdoRK.js.br +0 -0
  37. package/dist/web/assets/assistant-settings-section-ChpHdoRK.js.gz +0 -0
  38. package/dist/web/assets/assistant-tab-CQ_F6i7a.js +1 -0
  39. package/dist/web/assets/assistant-tab-CQ_F6i7a.js.br +0 -0
  40. package/dist/web/assets/assistant-tab-CQ_F6i7a.js.gz +0 -0
  41. package/dist/web/assets/{branch-review-tab-CBWti0df.js → branch-review-tab-X1OFlHua.js} +1 -1
  42. package/dist/web/assets/branch-review-tab-X1OFlHua.js.br +0 -0
  43. package/dist/web/assets/branch-review-tab-X1OFlHua.js.gz +0 -0
  44. package/dist/web/assets/build-message-with-attachments-CQod0B6Y.js +6 -0
  45. package/dist/web/assets/build-message-with-attachments-CQod0B6Y.js.br +0 -0
  46. package/dist/web/assets/build-message-with-attachments-CQod0B6Y.js.gz +0 -0
  47. package/dist/web/assets/chat-tab-CC4Kdd-2.js +19 -0
  48. package/dist/web/assets/chat-tab-CC4Kdd-2.js.br +0 -0
  49. package/dist/web/assets/chat-tab-CC4Kdd-2.js.gz +0 -0
  50. package/dist/web/assets/{chat-tab-B0l9R47-.js → chat-tab-DvrdNeY6.js} +1 -1
  51. package/dist/web/assets/chat-tab-DvrdNeY6.js.br +0 -0
  52. package/dist/web/assets/chat-tab-DvrdNeY6.js.gz +0 -0
  53. package/dist/web/assets/{code-editor-C6T06OM0.js → code-editor-DghKg-2t.js} +4 -4
  54. package/dist/web/assets/code-editor-DghKg-2t.js.br +0 -0
  55. package/dist/web/assets/code-editor-DghKg-2t.js.gz +0 -0
  56. package/dist/web/assets/{conflict-editor-IUGo31O7.js → conflict-editor-DjMfF2Ic.js} +1 -1
  57. package/dist/web/assets/conflict-editor-DjMfF2Ic.js.br +0 -0
  58. package/dist/web/assets/conflict-editor-DjMfF2Ic.js.gz +0 -0
  59. package/dist/web/assets/{connection-form-tab-CRaPR_7u.js → connection-form-tab-4F3QZwjd.js} +1 -1
  60. package/dist/web/assets/connection-form-tab-4F3QZwjd.js.br +0 -0
  61. package/dist/web/assets/connection-form-tab-4F3QZwjd.js.gz +0 -0
  62. package/dist/web/assets/control-size-DFdAJqoq.js +1 -0
  63. package/dist/web/assets/{csv-preview-DnbhTHtg.js → csv-preview-DrXZZ19d.js} +1 -1
  64. package/dist/web/assets/csv-preview-DrXZZ19d.js.br +0 -0
  65. package/dist/web/assets/csv-preview-DrXZZ19d.js.gz +0 -0
  66. package/dist/web/assets/{database-drivers-section-DDkitf-C.js → database-drivers-section-CkRM5irG.js} +1 -1
  67. package/dist/web/assets/database-drivers-section-CkRM5irG.js.br +0 -0
  68. package/dist/web/assets/database-drivers-section-CkRM5irG.js.gz +0 -0
  69. package/dist/web/assets/{db-tab-parts-Bn1XluOS.js → db-tab-parts-CJ1YDKqH.js} +1 -1
  70. package/dist/web/assets/db-tab-parts-CJ1YDKqH.js.br +0 -0
  71. package/dist/web/assets/db-tab-parts-CJ1YDKqH.js.gz +0 -0
  72. package/dist/web/assets/{design-settings-section-BQtaosko.js → design-settings-section-CAK_hCh4.js} +1 -1
  73. package/dist/web/assets/design-settings-section-CAK_hCh4.js.br +0 -0
  74. package/dist/web/assets/design-settings-section-CAK_hCh4.js.gz +0 -0
  75. package/dist/web/assets/{design-tab-Qq11_FG_.js → design-tab-DE9hJ2Tp.js} +1 -1
  76. package/dist/web/assets/design-tab-DE9hJ2Tp.js.br +0 -0
  77. package/dist/web/assets/design-tab-DE9hJ2Tp.js.gz +0 -0
  78. package/dist/web/assets/{designs-sidebar-panel-DynuYrEy.js → designs-sidebar-panel-Ccw_gDvw.js} +1 -1
  79. package/dist/web/assets/designs-sidebar-panel-Ccw_gDvw.js.br +0 -0
  80. package/dist/web/assets/designs-sidebar-panel-Ccw_gDvw.js.gz +0 -0
  81. package/dist/web/assets/{diff-viewer-CRqu4PHL.js → diff-viewer-BW6UFALQ.js} +1 -1
  82. package/dist/web/assets/diff-viewer-BW6UFALQ.js.br +0 -0
  83. package/dist/web/assets/diff-viewer-BW6UFALQ.js.gz +0 -0
  84. package/dist/web/assets/{docx-preview-DNxkU06E.js → docx-preview-BKDKCeHF.js} +1 -1
  85. package/dist/web/assets/docx-preview-BKDKCeHF.js.br +0 -0
  86. package/dist/web/assets/docx-preview-BKDKCeHF.js.gz +0 -0
  87. package/dist/web/assets/{editor-dialog-BgS7c2xy.js → editor-dialog-Dv85fQ2J.js} +1 -1
  88. package/dist/web/assets/editor-dialog-Dv85fQ2J.js.br +0 -0
  89. package/dist/web/assets/editor-dialog-Dv85fQ2J.js.gz +0 -0
  90. package/dist/web/assets/{editor-language-service-CAaJYiOM.js → editor-language-service-BhZftNpk.js} +1 -1
  91. package/dist/web/assets/editor-language-service-BhZftNpk.js.br +0 -0
  92. package/dist/web/assets/editor-language-service-BhZftNpk.js.gz +0 -0
  93. package/dist/web/assets/{explorer-body-Df4eaNIl.js → explorer-body-CTnhg-Dh.js} +1 -1
  94. package/dist/web/assets/explorer-body-CTnhg-Dh.js.br +0 -0
  95. package/dist/web/assets/explorer-body-CTnhg-Dh.js.gz +0 -0
  96. package/dist/web/assets/{explorer-window-content-CO_wzX6g.js → explorer-window-content-BNbOw8hc.js} +1 -1
  97. package/dist/web/assets/explorer-window-content-BNbOw8hc.js.br +0 -0
  98. package/dist/web/assets/explorer-window-content-BNbOw8hc.js.gz +0 -0
  99. package/dist/web/assets/{extension-manager-section-Dp_RwlXW.js → extension-manager-section-DFP5g4da.js} +1 -1
  100. package/dist/web/assets/extension-manager-section-DFP5g4da.js.br +0 -0
  101. package/dist/web/assets/extension-manager-section-DFP5g4da.js.gz +0 -0
  102. package/dist/web/assets/{extension-webview-Cy3BqKwe.js → extension-webview-_3bdHWFj.js} +1 -1
  103. package/dist/web/assets/extension-webview-_3bdHWFj.js.br +0 -0
  104. package/dist/web/assets/extension-webview-_3bdHWFj.js.gz +0 -0
  105. package/dist/web/assets/{files-settings-section-BMqAivnr.js → files-settings-section-D2dimKCL.js} +1 -1
  106. package/dist/web/assets/files-settings-section-D2dimKCL.js.br +0 -0
  107. package/dist/web/assets/files-settings-section-D2dimKCL.js.gz +0 -0
  108. package/dist/web/assets/{general-settings-section-BUpPgXqs.js → general-settings-section-CrVbQVQz.js} +1 -1
  109. package/dist/web/assets/general-settings-section-CrVbQVQz.js.br +0 -0
  110. package/dist/web/assets/general-settings-section-CrVbQVQz.js.gz +0 -0
  111. package/dist/web/assets/{git-log-panel-DBlswPgD.js → git-log-panel-l4LbpPzQ.js} +1 -1
  112. package/dist/web/assets/git-log-panel-l4LbpPzQ.js.br +0 -0
  113. package/dist/web/assets/git-log-panel-l4LbpPzQ.js.gz +0 -0
  114. package/dist/web/assets/{git-review-tab-BROZ7vMB.js → git-review-tab-BrZSTQcW.js} +1 -1
  115. package/dist/web/assets/git-review-tab-BrZSTQcW.js.br +0 -0
  116. package/dist/web/assets/git-review-tab-BrZSTQcW.js.gz +0 -0
  117. package/dist/web/assets/{glide-data-grid-Dg_LyJVR.js → glide-data-grid-DsDeT5uF.js} +1 -1
  118. package/dist/web/assets/glide-data-grid-DsDeT5uF.js.br +0 -0
  119. package/dist/web/assets/glide-data-grid-DsDeT5uF.js.gz +0 -0
  120. package/dist/web/assets/{grid-save-dialog-CBJNlccW.js → grid-save-dialog-DGKAHRTL.js} +1 -1
  121. package/dist/web/assets/grid-save-dialog-DGKAHRTL.js.br +0 -0
  122. package/dist/web/assets/grid-save-dialog-DGKAHRTL.js.gz +0 -0
  123. package/dist/web/assets/{group-chat-tab-GmJhNN-T.js → group-chat-tab-CdwqdwYc.js} +1 -1
  124. package/dist/web/assets/group-chat-tab-CdwqdwYc.js.br +0 -0
  125. package/dist/web/assets/group-chat-tab-CdwqdwYc.js.gz +0 -0
  126. package/dist/web/assets/{impexp-tab-BmIl-fjQ.js → impexp-tab-DB_yqgLE.js} +1 -1
  127. package/dist/web/assets/impexp-tab-DB_yqgLE.js.br +0 -0
  128. package/dist/web/assets/impexp-tab-DB_yqgLE.js.gz +0 -0
  129. package/dist/web/assets/{index-CawDVth1.css → index-BrxyfrYc.css} +1 -1
  130. package/dist/web/assets/index-BrxyfrYc.css.br +0 -0
  131. package/dist/web/assets/{index-CawDVth1.css.gz → index-BrxyfrYc.css.gz} +0 -0
  132. package/dist/web/assets/{index-OScFbOhP.js → index-ix3m5QQT.js} +8 -8
  133. package/dist/web/assets/index-ix3m5QQT.js.br +0 -0
  134. package/dist/web/assets/index-ix3m5QQT.js.gz +0 -0
  135. package/dist/web/assets/{jira-watcher-section-Bu103yH7.js → jira-watcher-section-BWBiQlPs.js} +1 -1
  136. package/dist/web/assets/{keybindings-store-Bh-5DZHD.js → keybindings-store-QmeVPDSj.js} +1 -1
  137. package/dist/web/assets/{keyboard-shortcuts-section-BdMhgks-.js → keyboard-shortcuts-section-DGJxSmeN.js} +1 -1
  138. package/dist/web/assets/keyboard-shortcuts-section-DGJxSmeN.js.br +0 -0
  139. package/dist/web/assets/keyboard-shortcuts-section-DGJxSmeN.js.gz +0 -0
  140. package/dist/web/assets/{language-servers-section-D-R9pYKX.js → language-servers-section-BGlgHxKe.js} +2 -2
  141. package/dist/web/assets/language-servers-section-BGlgHxKe.js.br +0 -0
  142. package/dist/web/assets/language-servers-section-BGlgHxKe.js.gz +0 -0
  143. package/dist/web/assets/{logs-app-u2ulYdoM.js → logs-app-CQLEmiL0.js} +1 -1
  144. package/dist/web/assets/logs-app-CQLEmiL0.js.br +0 -0
  145. package/dist/web/assets/logs-app-CQLEmiL0.js.gz +0 -0
  146. package/dist/web/assets/{logs-tab-BvMHNhwE.js → logs-tab-BUZ8Pl7m.js} +1 -1
  147. package/dist/web/assets/{logs-window-content-DZWDuEZ8.js → logs-window-content-Nk_lEwwi.js} +1 -1
  148. package/dist/web/assets/{lsp-client-DIGWPiKt.js → lsp-client-DI0orIfb.js} +1 -1
  149. package/dist/web/assets/lsp-client-DI0orIfb.js.br +0 -0
  150. package/dist/web/assets/lsp-client-DI0orIfb.js.gz +0 -0
  151. package/dist/web/assets/{markdown-renderer-BbvhKFs3.js → markdown-renderer-5ELHEVko.js} +1 -1
  152. package/dist/web/assets/markdown-renderer-5ELHEVko.js.br +0 -0
  153. package/dist/web/assets/markdown-renderer-5ELHEVko.js.gz +0 -0
  154. package/dist/web/assets/{markdown-renderer-D3E-23G3.js → markdown-renderer-CTLbCvuX.js} +1 -1
  155. package/dist/web/assets/markdown-renderer-CTLbCvuX.js.br +0 -0
  156. package/dist/web/assets/markdown-renderer-CTLbCvuX.js.gz +0 -0
  157. package/dist/web/assets/{mobile-explorer-sheet-CceoZDgW.js → mobile-explorer-sheet-DUXUIT_S.js} +1 -1
  158. package/dist/web/assets/mobile-explorer-sheet-DUXUIT_S.js.br +0 -0
  159. package/dist/web/assets/mobile-explorer-sheet-DUXUIT_S.js.gz +0 -0
  160. package/dist/web/assets/{monaco-diff-editor-C-ntgY28.js → monaco-diff-editor-C51sEZ3h.js} +1 -1
  161. package/dist/web/assets/{new-design-dialog-TY-X6NQz.js → new-design-dialog-DyTs5NF3.js} +1 -1
  162. package/dist/web/assets/new-design-dialog-DyTs5NF3.js.br +0 -0
  163. package/dist/web/assets/new-design-dialog-DyTs5NF3.js.gz +0 -0
  164. package/dist/web/assets/{notifications-settings-section-DsIG8Als.js → notifications-settings-section-rDUrin7F.js} +1 -1
  165. package/dist/web/assets/notifications-settings-section-rDUrin7F.js.br +0 -0
  166. package/dist/web/assets/notifications-settings-section-rDUrin7F.js.gz +0 -0
  167. package/dist/web/assets/{onboarding-entry-Dp2rStoW.js → onboarding-entry-CyjU3Cgr.js} +1 -1
  168. package/dist/web/assets/onboarding-entry-CyjU3Cgr.js.br +0 -0
  169. package/dist/web/assets/onboarding-entry-CyjU3Cgr.js.gz +0 -0
  170. package/dist/web/assets/{open-manager-chat-BB9Re8UJ.js → open-manager-chat-Ds3FJ52k.js} +1 -1
  171. package/dist/web/assets/open-manager-chat-Ds3FJ52k.js.br +0 -0
  172. package/dist/web/assets/open-manager-chat-Ds3FJ52k.js.gz +0 -0
  173. package/dist/web/assets/{open-manager-chat-rWA0E5kY.js → open-manager-chat-n5_HfX06.js} +1 -1
  174. package/dist/web/assets/open-manager-chat-n5_HfX06.js.br +0 -0
  175. package/dist/web/assets/open-manager-chat-n5_HfX06.js.gz +0 -0
  176. package/dist/web/assets/{problems-panel-D3L5acfV.js → problems-panel-DLlLK8v8.js} +1 -1
  177. package/dist/web/assets/problems-panel-DLlLK8v8.js.br +0 -0
  178. package/dist/web/assets/problems-panel-DLlLK8v8.js.gz +0 -0
  179. package/dist/web/assets/{process-table-KDtO1yXj.js → process-table-RDK2LHuV.js} +1 -1
  180. package/dist/web/assets/process-table-RDK2LHuV.js.br +0 -0
  181. package/dist/web/assets/process-table-RDK2LHuV.js.gz +0 -0
  182. package/dist/web/assets/{proxy-settings-section-DzwfhaDM.js → proxy-settings-section-DiFiMJhe.js} +1 -1
  183. package/dist/web/assets/proxy-settings-section-DiFiMJhe.js.br +0 -0
  184. package/dist/web/assets/proxy-settings-section-DiFiMJhe.js.gz +0 -0
  185. package/dist/web/assets/{query-tab-Dc7A5AD2.js → query-tab-Bxm0IDr6.js} +1 -1
  186. package/dist/web/assets/query-tab-Bxm0IDr6.js.br +0 -0
  187. package/dist/web/assets/query-tab-Bxm0IDr6.js.gz +0 -0
  188. package/dist/web/assets/{release-notes-window-content-BbQ1oxeW.js → release-notes-window-content-DNj9KYy_.js} +1 -1
  189. package/dist/web/assets/{remembered-approvals-section-CeiVnPjy.js → remembered-approvals-section-BiBtGfyX.js} +1 -1
  190. package/dist/web/assets/remembered-approvals-section-BiBtGfyX.js.br +0 -0
  191. package/dist/web/assets/remembered-approvals-section-BiBtGfyX.js.gz +0 -0
  192. package/dist/web/assets/{remote-access-settings-section-BRVoa10i.js → remote-access-settings-section-Dnj8FTwS.js} +1 -1
  193. package/dist/web/assets/remote-access-settings-section-Dnj8FTwS.js.br +0 -0
  194. package/dist/web/assets/remote-access-settings-section-Dnj8FTwS.js.gz +0 -0
  195. package/dist/web/assets/{remote-desktop-clipboard-notice-DvqTVLyu.js → remote-desktop-clipboard-notice-BodoNltd.js} +1 -1
  196. package/dist/web/assets/remote-desktop-clipboard-notice-BodoNltd.js.br +0 -0
  197. package/dist/web/assets/remote-desktop-clipboard-notice-BodoNltd.js.gz +0 -0
  198. package/dist/web/assets/{remote-desktop-mobile-sheet-D4pifStu.js → remote-desktop-mobile-sheet-_w3mYM_P.js} +2 -2
  199. package/dist/web/assets/remote-desktop-mobile-sheet-_w3mYM_P.js.br +0 -0
  200. package/dist/web/assets/remote-desktop-mobile-sheet-_w3mYM_P.js.gz +0 -0
  201. package/dist/web/assets/{remote-desktop-mobile-view-CyRge_q5.js → remote-desktop-mobile-view-CMXT4IiE.js} +1 -1
  202. package/dist/web/assets/remote-desktop-mobile-view-CMXT4IiE.js.br +0 -0
  203. package/dist/web/assets/remote-desktop-mobile-view-CMXT4IiE.js.gz +0 -0
  204. package/dist/web/assets/{remote-desktop-readiness-gate-BWUf-70Y.js → remote-desktop-readiness-gate-BN8sjRA7.js} +1 -1
  205. package/dist/web/assets/remote-desktop-readiness-gate-BN8sjRA7.js.br +0 -0
  206. package/dist/web/assets/remote-desktop-readiness-gate-BN8sjRA7.js.gz +0 -0
  207. package/dist/web/assets/{remote-desktop-window-content-DXmfn8Sh.js → remote-desktop-window-content-CNT3V6WV.js} +1 -1
  208. package/dist/web/assets/remote-desktop-window-content-CNT3V6WV.js.br +0 -0
  209. package/dist/web/assets/remote-desktop-window-content-CNT3V6WV.js.gz +0 -0
  210. package/dist/web/assets/{rename-object-dialog-BKYPuUkc.js → rename-object-dialog-jTc0ilcX.js} +1 -1
  211. package/dist/web/assets/rename-object-dialog-jTc0ilcX.js.br +0 -0
  212. package/dist/web/assets/rename-object-dialog-jTc0ilcX.js.gz +0 -0
  213. package/dist/web/assets/{reveal-task-in-sidebar-rUst91sn.js → reveal-task-in-sidebar-D6S9NuwD.js} +1 -1
  214. package/dist/web/assets/{review-address-setup-BBGexRBv.js → review-address-setup-DlNvPw0H.js} +1 -1
  215. package/dist/web/assets/review-address-setup-DlNvPw0H.js.br +0 -0
  216. package/dist/web/assets/review-address-setup-DlNvPw0H.js.gz +0 -0
  217. package/dist/web/assets/{review-code-CetnuUTd.js → review-code-n_E_bah4.js} +1 -1
  218. package/dist/web/assets/review-code-n_E_bah4.js.br +0 -0
  219. package/dist/web/assets/review-code-n_E_bah4.js.gz +0 -0
  220. package/dist/web/assets/{save-as-dialog-Du_kLMGt.js → save-as-dialog-DNEArWI8.js} +1 -1
  221. package/dist/web/assets/save-as-dialog-DNEArWI8.js.br +0 -0
  222. package/dist/web/assets/save-as-dialog-DNEArWI8.js.gz +0 -0
  223. package/dist/web/assets/{schedule-form-DcIzUoul.js → schedule-form-w1IqUBGt.js} +3 -3
  224. package/dist/web/assets/schedule-form-w1IqUBGt.js.br +0 -0
  225. package/dist/web/assets/schedule-form-w1IqUBGt.js.gz +0 -0
  226. package/dist/web/assets/{schedule-script-editor-em6lB2jU.js → schedule-script-editor-CE-07UUD.js} +1 -1
  227. package/dist/web/assets/schedule-script-editor-CE-07UUD.js.br +0 -0
  228. package/dist/web/assets/schedule-script-editor-CE-07UUD.js.gz +0 -0
  229. package/dist/web/assets/{schedules-app-8buzQrs1.js → schedules-app-Dr_UCkYQ.js} +1 -1
  230. package/dist/web/assets/schedules-app-Dr_UCkYQ.js.br +0 -0
  231. package/dist/web/assets/schedules-app-Dr_UCkYQ.js.gz +0 -0
  232. package/dist/web/assets/{schedules-settings-section-DoGGnhty.js → schedules-settings-section-DgJP_2hL.js} +3 -3
  233. package/dist/web/assets/schedules-settings-section-DgJP_2hL.js.br +0 -0
  234. package/dist/web/assets/schedules-settings-section-DgJP_2hL.js.gz +0 -0
  235. package/dist/web/assets/{schedules-tab-CwVGDRXz.js → schedules-tab-DvrCbSh2.js} +1 -1
  236. package/dist/web/assets/schedules-tab-DvrCbSh2.js.br +0 -0
  237. package/dist/web/assets/schedules-tab-DvrCbSh2.js.gz +0 -0
  238. package/dist/web/assets/{schedules-ui-B-0Gkjhf.js → schedules-ui-B8cBUXvy.js} +1 -1
  239. package/dist/web/assets/schedules-ui-B8cBUXvy.js.br +0 -0
  240. package/dist/web/assets/schedules-ui-B8cBUXvy.js.gz +0 -0
  241. package/dist/web/assets/{schedules-window-content-CMnWh76g.js → schedules-window-content-BdTqADTN.js} +1 -1
  242. package/dist/web/assets/schedules-window-content-BdTqADTN.js.br +0 -0
  243. package/dist/web/assets/schedules-window-content-BdTqADTN.js.gz +0 -0
  244. package/dist/web/assets/{session-review-tab-UMJ8-4Yu.js → session-review-tab-CHQwXl3k.js} +1 -1
  245. package/dist/web/assets/session-review-tab-CHQwXl3k.js.br +0 -0
  246. package/dist/web/assets/session-review-tab-CHQwXl3k.js.gz +0 -0
  247. package/dist/web/assets/{settings-body-D5B0vQbc.js → settings-body-BGi_yp6T.js} +1 -1
  248. package/dist/web/assets/settings-body-BGi_yp6T.js.br +0 -0
  249. package/dist/web/assets/settings-body-BGi_yp6T.js.gz +0 -0
  250. package/dist/web/assets/{settings-rows-DfoCivEv.js → settings-rows-DxAQdCNV.js} +1 -1
  251. package/dist/web/assets/settings-rows-DxAQdCNV.js.br +0 -0
  252. package/dist/web/assets/settings-rows-DxAQdCNV.js.gz +0 -0
  253. package/dist/web/assets/{settings-section-content-BHNACZA3.js → settings-section-content-B2NMhI8X.js} +1 -1
  254. package/dist/web/assets/{settings-section-content-BP8TOtrg.js → settings-section-content-BclHkj-U.js} +2 -2
  255. package/dist/web/assets/settings-section-content-BclHkj-U.js.br +0 -0
  256. package/dist/web/assets/settings-section-content-BclHkj-U.js.gz +0 -0
  257. package/dist/web/assets/{settings-tab-C54qBgRF.js → settings-tab-H9KOVNSp.js} +1 -1
  258. package/dist/web/assets/{settings-window-content-CaPtZWPc.js → settings-window-content-GIPC9SFL.js} +1 -1
  259. package/dist/web/assets/{sql-object-tab-DV249L-U.js → sql-object-tab-CMt5WjOZ.js} +1 -1
  260. package/dist/web/assets/sql-object-tab-CMt5WjOZ.js.br +0 -0
  261. package/dist/web/assets/sql-object-tab-CMt5WjOZ.js.gz +0 -0
  262. package/dist/web/assets/{sqlite-viewer-CmK5OYkR.js → sqlite-viewer-BazSUbqq.js} +1 -1
  263. package/dist/web/assets/sqlite-viewer-BazSUbqq.js.br +0 -0
  264. package/dist/web/assets/sqlite-viewer-BazSUbqq.js.gz +0 -0
  265. package/dist/web/assets/{storage-settings-section-DCzcJkwk.js → storage-settings-section-B1VnfN9n.js} +1 -1
  266. package/dist/web/assets/storage-settings-section-B1VnfN9n.js.br +0 -0
  267. package/dist/web/assets/storage-settings-section-B1VnfN9n.js.gz +0 -0
  268. package/dist/web/assets/{structure-save-dialog-CvqrG4_X.js → structure-save-dialog-Dgh9tRdb.js} +1 -1
  269. package/dist/web/assets/structure-save-dialog-Dgh9tRdb.js.br +0 -0
  270. package/dist/web/assets/structure-save-dialog-Dgh9tRdb.js.gz +0 -0
  271. package/dist/web/assets/{structure-tab-B7F3uwsj.js → structure-tab-DDMMTTcg.js} +1 -1
  272. package/dist/web/assets/structure-tab-DDMMTTcg.js.br +0 -0
  273. package/dist/web/assets/structure-tab-DDMMTTcg.js.gz +0 -0
  274. package/dist/web/assets/{system-monitor-body-DJ2_sxqE.js → system-monitor-body-BD8nBNey.js} +2 -2
  275. package/dist/web/assets/system-monitor-body-BD8nBNey.js.br +0 -0
  276. package/dist/web/assets/system-monitor-body-BD8nBNey.js.gz +0 -0
  277. package/dist/web/assets/{system-monitor-tab-CpS5vLhg.js → system-monitor-tab-CeN1RErt.js} +1 -1
  278. package/dist/web/assets/{system-monitor-window-content-DxVdiKqq.js → system-monitor-window-content-BN2JK7-U.js} +1 -1
  279. package/dist/web/assets/{tab-host-window-content-BUvWXnNj.js → tab-host-window-content-C97cDVKH.js} +1 -1
  280. package/dist/web/assets/tab-host-window-content-C97cDVKH.js.br +0 -0
  281. package/dist/web/assets/tab-host-window-content-C97cDVKH.js.gz +0 -0
  282. package/dist/web/assets/{table-tab-BwCa_Sh3.js → table-tab-Dy1uZWXy.js} +1 -1
  283. package/dist/web/assets/table-tab-Dy1uZWXy.js.br +0 -0
  284. package/dist/web/assets/table-tab-Dy1uZWXy.js.gz +0 -0
  285. package/dist/web/assets/{task-chip-peek-DZUOS5BX.js → task-chip-peek-dtuuhUxI.js} +1 -1
  286. package/dist/web/assets/task-chip-peek-dtuuhUxI.js.br +0 -0
  287. package/dist/web/assets/task-chip-peek-dtuuhUxI.js.gz +0 -0
  288. package/dist/web/assets/{task-detail-mobile-BDIRfnWh.js → task-detail-mobile-IaMJIz_N.js} +1 -1
  289. package/dist/web/assets/task-detail-mobile-IaMJIz_N.js.br +0 -0
  290. package/dist/web/assets/task-detail-mobile-IaMJIz_N.js.gz +0 -0
  291. package/dist/web/assets/{task-sheet-Bubq6PoR.js → task-sheet-DVFo_TeZ.js} +1 -1
  292. package/dist/web/assets/task-sheet-DVFo_TeZ.js.br +0 -0
  293. package/dist/web/assets/task-sheet-DVFo_TeZ.js.gz +0 -0
  294. package/dist/web/assets/{task-status-grid-Est7JMQm.js → task-status-grid-B3Rh0z5j.js} +1 -1
  295. package/dist/web/assets/task-status-grid-B3Rh0z5j.js.br +0 -0
  296. package/dist/web/assets/task-status-grid-B3Rh0z5j.js.gz +0 -0
  297. package/dist/web/assets/{task-tab-BtwF9pK7.js → task-tab-B_y6t0uh.js} +1 -1
  298. package/dist/web/assets/task-tab-B_y6t0uh.js.br +0 -0
  299. package/dist/web/assets/task-tab-B_y6t0uh.js.gz +0 -0
  300. package/dist/web/assets/{task-working-session-chip-Dz22uaog.js → task-working-session-chip-DvSXY2w8.js} +1 -1
  301. package/dist/web/assets/task-working-session-chip-DvSXY2w8.js.br +0 -0
  302. package/dist/web/assets/task-working-session-chip-DvSXY2w8.js.gz +0 -0
  303. package/dist/web/assets/{tasks-sidebar-panel-DwCYUpBu.js → tasks-sidebar-panel-DGyqyNAq.js} +1 -1
  304. package/dist/web/assets/tasks-sidebar-panel-DGyqyNAq.js.br +0 -0
  305. package/dist/web/assets/tasks-sidebar-panel-DGyqyNAq.js.gz +0 -0
  306. package/dist/web/assets/{telegram-bot-token-field-DBxdaaJ7.js → telegram-bot-token-field-DPChDRoY.js} +1 -1
  307. package/dist/web/assets/telegram-bot-token-field-DPChDRoY.js.br +0 -0
  308. package/dist/web/assets/telegram-bot-token-field-DPChDRoY.js.gz +0 -0
  309. package/dist/web/assets/{terminal-tab-DhoY4bM_.js → terminal-tab-CMrkki1e.js} +1 -1
  310. package/dist/web/assets/terminal-tab-CMrkki1e.js.br +0 -0
  311. package/dist/web/assets/terminal-tab-CMrkki1e.js.gz +0 -0
  312. package/dist/web/assets/{tool-cards-C2-7-SQr.js → tool-cards-ByfYqVsL.js} +3 -3
  313. package/dist/web/assets/tool-cards-ByfYqVsL.js.br +0 -0
  314. package/dist/web/assets/tool-cards-ByfYqVsL.js.gz +0 -0
  315. package/dist/web/assets/{tools-settings-section-W_Y0dscJ.js → tools-settings-section-B3cpVpAc.js} +1 -1
  316. package/dist/web/assets/tools-settings-section-B3cpVpAc.js.br +0 -0
  317. package/dist/web/assets/tools-settings-section-B3cpVpAc.js.gz +0 -0
  318. package/dist/web/assets/{use-db-read-DkdhLvi3.js → use-db-read-DeRAN-5C.js} +1 -1
  319. package/dist/web/assets/use-db-read-DeRAN-5C.js.br +0 -0
  320. package/dist/web/assets/use-db-read-DeRAN-5C.js.gz +0 -0
  321. package/dist/web/assets/{use-inline-blame-B6D7FNKA.js → use-inline-blame-x1_OPRN2.js} +1 -1
  322. package/dist/web/assets/use-inline-blame-x1_OPRN2.js.br +0 -0
  323. package/dist/web/assets/use-inline-blame-x1_OPRN2.js.gz +0 -0
  324. package/dist/web/assets/{use-lsp-cOwiy7B2.js → use-lsp-kByMJgNI.js} +1 -1
  325. package/dist/web/assets/use-lsp-kByMJgNI.js.br +0 -0
  326. package/dist/web/assets/use-lsp-kByMJgNI.js.gz +0 -0
  327. package/dist/web/assets/{use-monaco-theme-DSuNmsTl.js → use-monaco-theme-BQ-OZWX-.js} +1 -1
  328. package/dist/web/assets/{use-process-kill-7NhyKpdz.js → use-process-kill-DePGCnDh.js} +1 -1
  329. package/dist/web/assets/use-process-kill-DePGCnDh.js.br +0 -0
  330. package/dist/web/assets/use-process-kill-DePGCnDh.js.gz +0 -0
  331. package/dist/web/assets/{use-sql-schema-info-X5R9acSy.js → use-sql-schema-info-CEwen2i1.js} +1 -1
  332. package/dist/web/assets/use-sql-schema-info-CEwen2i1.js.br +0 -0
  333. package/dist/web/assets/use-sql-schema-info-CEwen2i1.js.gz +0 -0
  334. package/dist/web/assets/{use-websocket-CD3p9Y8W.js → use-websocket-C9n8q7-s.js} +1 -1
  335. package/dist/web/assets/{vault-settings-section-DixIMoCx.js → vault-settings-section-Qf4G31wB.js} +1 -1
  336. package/dist/web/assets/vault-settings-section-Qf4G31wB.js.br +0 -0
  337. package/dist/web/assets/vault-settings-section-Qf4G31wB.js.gz +0 -0
  338. package/dist/web/assets/voice-settings-section-YdjYWdW7.js +1 -0
  339. package/dist/web/assets/voice-settings-section-YdjYWdW7.js.br +0 -0
  340. package/dist/web/assets/voice-settings-section-YdjYWdW7.js.gz +0 -0
  341. package/dist/web/assets/web-browser-settings-BZVtGZ79.js +1 -0
  342. package/dist/web/assets/web-browser-settings-section-XrT7sOpD.js +1 -0
  343. package/dist/web/assets/web-browser-settings-section-XrT7sOpD.js.br +0 -0
  344. package/dist/web/assets/web-browser-settings-section-XrT7sOpD.js.gz +0 -0
  345. package/dist/web/assets/{web-browser-tab-DNpbiXRO.js → web-browser-tab-BuIPf4J8.js} +1 -1
  346. package/dist/web/assets/{web-browser-view-8xcUIVkn.js → web-browser-view-DzyPBSfd.js} +1 -1
  347. package/dist/web/assets/web-browser-view-DzyPBSfd.js.br +0 -0
  348. package/dist/web/assets/web-browser-view-DzyPBSfd.js.gz +0 -0
  349. package/dist/web/assets/{web-browser-window-content-CO5_vHcN.js → web-browser-window-content-B29mzsLG.js} +1 -1
  350. package/dist/web/assets/{web-preview-tab-DBSjWPuH.js → web-preview-tab-CNgD447y.js} +1 -1
  351. package/dist/web/assets/web-preview-tab-CNgD447y.js.br +0 -0
  352. package/dist/web/assets/web-preview-tab-CNgD447y.js.gz +0 -0
  353. package/dist/web/assets/{xlsx-preview-OxrvsQtU.js → xlsx-preview-b8gMgch2.js} +1 -1
  354. package/dist/web/assets/xlsx-preview-b8gMgch2.js.br +0 -0
  355. package/dist/web/assets/xlsx-preview-b8gMgch2.js.gz +0 -0
  356. package/dist/web/index.html +5 -5
  357. package/dist/web/index.html.br +0 -0
  358. package/dist/web/index.html.gz +0 -0
  359. package/dist/web/sw.js +1 -1
  360. package/dist/web/sw.js.br +0 -0
  361. package/dist/web/sw.js.gz +0 -0
  362. package/docs/architecture/ai-chat-and-providers.md +4 -2
  363. package/docs/architecture/ppm-assistant.md +10 -1
  364. package/docs/architecture/workspace-and-ui.md +12 -2
  365. package/package.json +1 -1
  366. package/src/cli/commands/speech-cmd-learned.ts +98 -0
  367. package/src/cli/commands/speech-cmd.ts +3 -0
  368. package/src/server/routes/chat.ts +9 -2
  369. package/src/server/routes/speech-voice-message.ts +2 -1
  370. package/src/server/ws/chat-user-words.ts +13 -2
  371. package/src/services/assistant/ppm-cli-reference.ts +13 -0
  372. package/src/services/assistant/ppm-cli-routing.ts +1 -0
  373. package/src/services/assistant-cards/card-reply-actions.ts +34 -1
  374. package/src/services/assistant-cards/forward-verbatim.ts +17 -3
  375. package/src/services/assistant-settings-tools/settings-catalog-types.ts +6 -0
  376. package/src/services/assistant-settings-tools/settings-catalog-voice-words.ts +127 -0
  377. package/src/services/assistant-settings-tools/settings-catalog.ts +2 -1
  378. package/src/services/assistant-settings-tools/settings-write-tools.ts +4 -1
  379. package/src/services/assistant-telegram/assistant-telegram-card-replies.ts +14 -9
  380. package/src/services/assistant-telegram/assistant-telegram-cards.ts +42 -16
  381. package/src/services/assistant-telegram/assistant-telegram-inbound.ts +75 -5
  382. package/src/services/assistant-telegram/assistant-telegram-task-message.ts +4 -2
  383. package/src/services/assistant-telegram/assistant-telegram-voice-card.ts +11 -3
  384. package/src/services/assistant-telegram/assistant-telegram-voice-pending.ts +16 -1
  385. package/src/services/assistant-telegram/assistant-telegram-voice.ts +14 -8
  386. package/src/services/assistant-telegram/assistant-telegram.service.ts +3 -0
  387. package/src/services/voice-message/voice-learned-store.ts +29 -5
  388. package/src/services/voice-message/voice-upload-receipt.ts +38 -0
  389. package/src/services/web-browser/screencast-link.ts +53 -0
  390. package/src/services/web-browser/screencast-pacer.ts +144 -23
  391. package/src/services/web-browser/screencast-scale.ts +34 -0
  392. package/src/services/web-browser/viewer-hub.ts +4 -1
  393. package/src/shared/voice-message.ts +5 -1
  394. package/src/shared/web-browser-settings.ts +22 -5
  395. package/src/web/components/assistant/cards/approval-mirror-card.tsx +24 -0
  396. package/src/web/components/assistant/cards/card-reply-bar.tsx +35 -6
  397. package/src/web/components/assistant/cards/card-voice-reply-parts.tsx +149 -0
  398. package/src/web/components/assistant/cards/decision-set/decision-reply-field.tsx +37 -3
  399. package/src/web/components/assistant/cards/decision-set/decision-send-api.ts +8 -1
  400. package/src/web/components/assistant/cards/decision-set/decision-set-card.tsx +14 -4
  401. package/src/web/components/assistant/cards/decision-set/decision-set.tsx +1 -0
  402. package/src/web/components/assistant/manager-chat-waiting-cards.tsx +2 -1
  403. package/src/web/components/chat/message-input.tsx +4 -39
  404. package/src/web/components/chat/question-card.tsx +31 -2
  405. package/src/web/components/chat/voice-recording-bar.tsx +19 -8
  406. package/src/web/components/chat/voice-transcript-block.tsx +13 -9
  407. package/src/web/components/settings/voice-learned-words-list.tsx +4 -3
  408. package/src/web/components/settings/web-browser-settings-section.tsx +8 -3
  409. package/src/web/hooks/use-card-voice-reply.ts +115 -0
  410. package/src/web/hooks/use-voice-message-composer.ts +3 -16
  411. package/src/web/lib/assistant-cards-api.ts +5 -1
  412. package/src/web/lib/card-voice-reply.ts +63 -0
  413. package/src/web/lib/chat-upload-client.ts +43 -0
  414. package/src/web/lib/control-size.ts +3 -0
  415. package/src/web/lib/decision-set/decision-set-model.ts +4 -1
  416. package/src/web/lib/decision-set/decision-set-send.ts +4 -3
  417. package/src/web/lib/voice-learn-after-send.ts +21 -0
  418. package/src/web/stores/assistant-card-reply-store.ts +10 -1
  419. package/dist/web/assets/accounts-settings-section-DzgkmItP.js.br +0 -0
  420. package/dist/web/assets/accounts-settings-section-DzgkmItP.js.gz +0 -0
  421. package/dist/web/assets/agent-session-sheet-D1zcLabJ.js.br +0 -0
  422. package/dist/web/assets/agent-session-sheet-D1zcLabJ.js.gz +0 -0
  423. package/dist/web/assets/agent-session-window-content-CheLJrvd.js.br +0 -0
  424. package/dist/web/assets/agent-session-window-content-CheLJrvd.js.gz +0 -0
  425. package/dist/web/assets/ai-resource-editor-DAhYtyVR.js.br +0 -0
  426. package/dist/web/assets/ai-resource-editor-DAhYtyVR.js.gz +0 -0
  427. package/dist/web/assets/ai-settings-section-Bs2Q8txC.js.br +0 -0
  428. package/dist/web/assets/ai-settings-section-Bs2Q8txC.js.gz +0 -0
  429. package/dist/web/assets/ai-settings-section-buiug4ab.js.br +0 -0
  430. package/dist/web/assets/ai-settings-section-buiug4ab.js.gz +0 -0
  431. package/dist/web/assets/android-tab-BcFSiNS4.js.br +0 -0
  432. package/dist/web/assets/android-tab-BcFSiNS4.js.gz +0 -0
  433. package/dist/web/assets/antigravity-usage-view-Dkl4BEnk.js.br +0 -0
  434. package/dist/web/assets/antigravity-usage-view-Dkl4BEnk.js.gz +0 -0
  435. package/dist/web/assets/appearance-settings-section-CR599TVd.js.br +0 -0
  436. package/dist/web/assets/appearance-settings-section-CR599TVd.js.gz +0 -0
  437. package/dist/web/assets/apps-panel-DyRhMVo6.js.br +0 -0
  438. package/dist/web/assets/apps-panel-DyRhMVo6.js.gz +0 -0
  439. package/dist/web/assets/assistant-settings-section-BpGcDoCX.js.br +0 -0
  440. package/dist/web/assets/assistant-settings-section-BpGcDoCX.js.gz +0 -0
  441. package/dist/web/assets/assistant-tab-BZSegzNY.js +0 -1
  442. package/dist/web/assets/assistant-tab-BZSegzNY.js.br +0 -0
  443. package/dist/web/assets/assistant-tab-BZSegzNY.js.gz +0 -0
  444. package/dist/web/assets/branch-review-tab-CBWti0df.js.br +0 -0
  445. package/dist/web/assets/branch-review-tab-CBWti0df.js.gz +0 -0
  446. package/dist/web/assets/build-message-with-attachments-Bod8RL2w.js +0 -6
  447. package/dist/web/assets/build-message-with-attachments-Bod8RL2w.js.br +0 -0
  448. package/dist/web/assets/build-message-with-attachments-Bod8RL2w.js.gz +0 -0
  449. package/dist/web/assets/chat-tab-B0l9R47-.js.br +0 -0
  450. package/dist/web/assets/chat-tab-B0l9R47-.js.gz +0 -0
  451. package/dist/web/assets/chat-tab-CY2edRZz.js +0 -19
  452. package/dist/web/assets/chat-tab-CY2edRZz.js.br +0 -0
  453. package/dist/web/assets/chat-tab-CY2edRZz.js.gz +0 -0
  454. package/dist/web/assets/code-editor-C6T06OM0.js.br +0 -0
  455. package/dist/web/assets/code-editor-C6T06OM0.js.gz +0 -0
  456. package/dist/web/assets/conflict-editor-IUGo31O7.js.br +0 -0
  457. package/dist/web/assets/conflict-editor-IUGo31O7.js.gz +0 -0
  458. package/dist/web/assets/connection-form-tab-CRaPR_7u.js.br +0 -0
  459. package/dist/web/assets/connection-form-tab-CRaPR_7u.js.gz +0 -0
  460. package/dist/web/assets/control-size-CvT_Fwg5.js +0 -1
  461. package/dist/web/assets/csv-preview-DnbhTHtg.js.br +0 -0
  462. package/dist/web/assets/csv-preview-DnbhTHtg.js.gz +0 -0
  463. package/dist/web/assets/database-drivers-section-DDkitf-C.js.br +0 -0
  464. package/dist/web/assets/database-drivers-section-DDkitf-C.js.gz +0 -0
  465. package/dist/web/assets/db-tab-parts-Bn1XluOS.js.br +0 -0
  466. package/dist/web/assets/db-tab-parts-Bn1XluOS.js.gz +0 -0
  467. package/dist/web/assets/design-settings-section-BQtaosko.js.br +0 -0
  468. package/dist/web/assets/design-settings-section-BQtaosko.js.gz +0 -0
  469. package/dist/web/assets/design-tab-Qq11_FG_.js.br +0 -0
  470. package/dist/web/assets/design-tab-Qq11_FG_.js.gz +0 -0
  471. package/dist/web/assets/designs-sidebar-panel-DynuYrEy.js.br +0 -0
  472. package/dist/web/assets/designs-sidebar-panel-DynuYrEy.js.gz +0 -0
  473. package/dist/web/assets/diff-viewer-CRqu4PHL.js.br +0 -0
  474. package/dist/web/assets/diff-viewer-CRqu4PHL.js.gz +0 -0
  475. package/dist/web/assets/docx-preview-DNxkU06E.js.br +0 -0
  476. package/dist/web/assets/docx-preview-DNxkU06E.js.gz +0 -0
  477. package/dist/web/assets/editor-dialog-BgS7c2xy.js.br +0 -0
  478. package/dist/web/assets/editor-dialog-BgS7c2xy.js.gz +0 -0
  479. package/dist/web/assets/editor-language-service-CAaJYiOM.js.br +0 -0
  480. package/dist/web/assets/editor-language-service-CAaJYiOM.js.gz +0 -0
  481. package/dist/web/assets/explorer-body-Df4eaNIl.js.br +0 -0
  482. package/dist/web/assets/explorer-body-Df4eaNIl.js.gz +0 -0
  483. package/dist/web/assets/explorer-window-content-CO_wzX6g.js.br +0 -0
  484. package/dist/web/assets/explorer-window-content-CO_wzX6g.js.gz +0 -0
  485. package/dist/web/assets/extension-manager-section-Dp_RwlXW.js.br +0 -0
  486. package/dist/web/assets/extension-manager-section-Dp_RwlXW.js.gz +0 -0
  487. package/dist/web/assets/extension-webview-Cy3BqKwe.js.br +0 -0
  488. package/dist/web/assets/extension-webview-Cy3BqKwe.js.gz +0 -0
  489. package/dist/web/assets/files-settings-section-BMqAivnr.js.br +0 -0
  490. package/dist/web/assets/files-settings-section-BMqAivnr.js.gz +0 -0
  491. package/dist/web/assets/general-settings-section-BUpPgXqs.js.br +0 -0
  492. package/dist/web/assets/general-settings-section-BUpPgXqs.js.gz +0 -0
  493. package/dist/web/assets/git-log-panel-DBlswPgD.js.br +0 -0
  494. package/dist/web/assets/git-log-panel-DBlswPgD.js.gz +0 -0
  495. package/dist/web/assets/git-review-tab-BROZ7vMB.js.br +0 -0
  496. package/dist/web/assets/git-review-tab-BROZ7vMB.js.gz +0 -0
  497. package/dist/web/assets/glide-data-grid-Dg_LyJVR.js.br +0 -0
  498. package/dist/web/assets/glide-data-grid-Dg_LyJVR.js.gz +0 -0
  499. package/dist/web/assets/grid-save-dialog-CBJNlccW.js.br +0 -0
  500. package/dist/web/assets/grid-save-dialog-CBJNlccW.js.gz +0 -0
  501. package/dist/web/assets/group-chat-tab-GmJhNN-T.js.br +0 -0
  502. package/dist/web/assets/group-chat-tab-GmJhNN-T.js.gz +0 -0
  503. package/dist/web/assets/impexp-tab-BmIl-fjQ.js.br +0 -0
  504. package/dist/web/assets/impexp-tab-BmIl-fjQ.js.gz +0 -0
  505. package/dist/web/assets/index-CawDVth1.css.br +0 -0
  506. package/dist/web/assets/index-OScFbOhP.js.br +0 -0
  507. package/dist/web/assets/index-OScFbOhP.js.gz +0 -0
  508. package/dist/web/assets/keyboard-shortcuts-section-BdMhgks-.js.br +0 -0
  509. package/dist/web/assets/keyboard-shortcuts-section-BdMhgks-.js.gz +0 -0
  510. package/dist/web/assets/language-servers-section-D-R9pYKX.js.br +0 -0
  511. package/dist/web/assets/language-servers-section-D-R9pYKX.js.gz +0 -0
  512. package/dist/web/assets/logs-app-u2ulYdoM.js.br +0 -0
  513. package/dist/web/assets/logs-app-u2ulYdoM.js.gz +0 -0
  514. package/dist/web/assets/lsp-client-DIGWPiKt.js.br +0 -0
  515. package/dist/web/assets/lsp-client-DIGWPiKt.js.gz +0 -0
  516. package/dist/web/assets/markdown-renderer-BbvhKFs3.js.br +0 -0
  517. package/dist/web/assets/markdown-renderer-BbvhKFs3.js.gz +0 -0
  518. package/dist/web/assets/markdown-renderer-D3E-23G3.js.br +0 -0
  519. package/dist/web/assets/markdown-renderer-D3E-23G3.js.gz +0 -0
  520. package/dist/web/assets/mobile-explorer-sheet-CceoZDgW.js.br +0 -0
  521. package/dist/web/assets/mobile-explorer-sheet-CceoZDgW.js.gz +0 -0
  522. package/dist/web/assets/new-design-dialog-TY-X6NQz.js.br +0 -0
  523. package/dist/web/assets/new-design-dialog-TY-X6NQz.js.gz +0 -0
  524. package/dist/web/assets/notifications-settings-section-DsIG8Als.js.br +0 -0
  525. package/dist/web/assets/notifications-settings-section-DsIG8Als.js.gz +0 -0
  526. package/dist/web/assets/onboarding-entry-Dp2rStoW.js.br +0 -0
  527. package/dist/web/assets/onboarding-entry-Dp2rStoW.js.gz +0 -0
  528. package/dist/web/assets/open-manager-chat-BB9Re8UJ.js.br +0 -0
  529. package/dist/web/assets/open-manager-chat-BB9Re8UJ.js.gz +0 -0
  530. package/dist/web/assets/open-manager-chat-rWA0E5kY.js.br +0 -0
  531. package/dist/web/assets/open-manager-chat-rWA0E5kY.js.gz +0 -0
  532. package/dist/web/assets/problems-panel-D3L5acfV.js.br +0 -0
  533. package/dist/web/assets/problems-panel-D3L5acfV.js.gz +0 -0
  534. package/dist/web/assets/process-table-KDtO1yXj.js.br +0 -0
  535. package/dist/web/assets/process-table-KDtO1yXj.js.gz +0 -0
  536. package/dist/web/assets/proxy-settings-section-DzwfhaDM.js.br +0 -0
  537. package/dist/web/assets/proxy-settings-section-DzwfhaDM.js.gz +0 -0
  538. package/dist/web/assets/query-tab-Dc7A5AD2.js.br +0 -0
  539. package/dist/web/assets/query-tab-Dc7A5AD2.js.gz +0 -0
  540. package/dist/web/assets/remembered-approvals-section-CeiVnPjy.js.br +0 -0
  541. package/dist/web/assets/remembered-approvals-section-CeiVnPjy.js.gz +0 -0
  542. package/dist/web/assets/remote-access-settings-section-BRVoa10i.js.br +0 -0
  543. package/dist/web/assets/remote-access-settings-section-BRVoa10i.js.gz +0 -0
  544. package/dist/web/assets/remote-desktop-clipboard-notice-DvqTVLyu.js.br +0 -0
  545. package/dist/web/assets/remote-desktop-clipboard-notice-DvqTVLyu.js.gz +0 -0
  546. package/dist/web/assets/remote-desktop-mobile-sheet-D4pifStu.js.br +0 -0
  547. package/dist/web/assets/remote-desktop-mobile-sheet-D4pifStu.js.gz +0 -0
  548. package/dist/web/assets/remote-desktop-mobile-view-CyRge_q5.js.br +0 -0
  549. package/dist/web/assets/remote-desktop-mobile-view-CyRge_q5.js.gz +0 -0
  550. package/dist/web/assets/remote-desktop-readiness-gate-BWUf-70Y.js.br +0 -0
  551. package/dist/web/assets/remote-desktop-readiness-gate-BWUf-70Y.js.gz +0 -0
  552. package/dist/web/assets/remote-desktop-window-content-DXmfn8Sh.js.br +0 -0
  553. package/dist/web/assets/remote-desktop-window-content-DXmfn8Sh.js.gz +0 -0
  554. package/dist/web/assets/rename-object-dialog-BKYPuUkc.js.br +0 -0
  555. package/dist/web/assets/rename-object-dialog-BKYPuUkc.js.gz +0 -0
  556. package/dist/web/assets/review-address-setup-BBGexRBv.js.br +0 -0
  557. package/dist/web/assets/review-address-setup-BBGexRBv.js.gz +0 -0
  558. package/dist/web/assets/review-code-CetnuUTd.js.br +0 -0
  559. package/dist/web/assets/review-code-CetnuUTd.js.gz +0 -0
  560. package/dist/web/assets/save-as-dialog-Du_kLMGt.js.br +0 -0
  561. package/dist/web/assets/save-as-dialog-Du_kLMGt.js.gz +0 -0
  562. package/dist/web/assets/schedule-form-DcIzUoul.js.br +0 -0
  563. package/dist/web/assets/schedule-form-DcIzUoul.js.gz +0 -0
  564. package/dist/web/assets/schedule-script-editor-em6lB2jU.js.br +0 -0
  565. package/dist/web/assets/schedule-script-editor-em6lB2jU.js.gz +0 -0
  566. package/dist/web/assets/schedules-app-8buzQrs1.js.br +0 -0
  567. package/dist/web/assets/schedules-app-8buzQrs1.js.gz +0 -0
  568. package/dist/web/assets/schedules-settings-section-DoGGnhty.js.br +0 -0
  569. package/dist/web/assets/schedules-settings-section-DoGGnhty.js.gz +0 -0
  570. package/dist/web/assets/schedules-tab-CwVGDRXz.js.br +0 -0
  571. package/dist/web/assets/schedules-tab-CwVGDRXz.js.gz +0 -0
  572. package/dist/web/assets/schedules-ui-B-0Gkjhf.js.br +0 -0
  573. package/dist/web/assets/schedules-ui-B-0Gkjhf.js.gz +0 -0
  574. package/dist/web/assets/schedules-window-content-CMnWh76g.js.br +0 -0
  575. package/dist/web/assets/schedules-window-content-CMnWh76g.js.gz +0 -0
  576. package/dist/web/assets/session-review-tab-UMJ8-4Yu.js.br +0 -0
  577. package/dist/web/assets/session-review-tab-UMJ8-4Yu.js.gz +0 -0
  578. package/dist/web/assets/settings-body-D5B0vQbc.js.br +0 -0
  579. package/dist/web/assets/settings-body-D5B0vQbc.js.gz +0 -0
  580. package/dist/web/assets/settings-rows-DfoCivEv.js.br +0 -0
  581. package/dist/web/assets/settings-rows-DfoCivEv.js.gz +0 -0
  582. package/dist/web/assets/settings-section-content-BP8TOtrg.js.br +0 -0
  583. package/dist/web/assets/settings-section-content-BP8TOtrg.js.gz +0 -0
  584. package/dist/web/assets/sql-object-tab-DV249L-U.js.br +0 -0
  585. package/dist/web/assets/sql-object-tab-DV249L-U.js.gz +0 -0
  586. package/dist/web/assets/sqlite-viewer-CmK5OYkR.js.br +0 -0
  587. package/dist/web/assets/sqlite-viewer-CmK5OYkR.js.gz +0 -0
  588. package/dist/web/assets/storage-settings-section-DCzcJkwk.js.br +0 -0
  589. package/dist/web/assets/storage-settings-section-DCzcJkwk.js.gz +0 -0
  590. package/dist/web/assets/structure-save-dialog-CvqrG4_X.js.br +0 -0
  591. package/dist/web/assets/structure-save-dialog-CvqrG4_X.js.gz +0 -0
  592. package/dist/web/assets/structure-tab-B7F3uwsj.js.br +0 -0
  593. package/dist/web/assets/structure-tab-B7F3uwsj.js.gz +0 -0
  594. package/dist/web/assets/system-monitor-body-DJ2_sxqE.js.br +0 -0
  595. package/dist/web/assets/system-monitor-body-DJ2_sxqE.js.gz +0 -0
  596. package/dist/web/assets/tab-host-window-content-BUvWXnNj.js.br +0 -0
  597. package/dist/web/assets/tab-host-window-content-BUvWXnNj.js.gz +0 -0
  598. package/dist/web/assets/table-tab-BwCa_Sh3.js.br +0 -0
  599. package/dist/web/assets/table-tab-BwCa_Sh3.js.gz +0 -0
  600. package/dist/web/assets/task-chip-peek-DZUOS5BX.js.br +0 -0
  601. package/dist/web/assets/task-chip-peek-DZUOS5BX.js.gz +0 -0
  602. package/dist/web/assets/task-detail-mobile-BDIRfnWh.js.br +0 -0
  603. package/dist/web/assets/task-detail-mobile-BDIRfnWh.js.gz +0 -0
  604. package/dist/web/assets/task-sheet-Bubq6PoR.js.br +0 -0
  605. package/dist/web/assets/task-sheet-Bubq6PoR.js.gz +0 -0
  606. package/dist/web/assets/task-status-grid-Est7JMQm.js.br +0 -0
  607. package/dist/web/assets/task-status-grid-Est7JMQm.js.gz +0 -0
  608. package/dist/web/assets/task-tab-BtwF9pK7.js.br +0 -0
  609. package/dist/web/assets/task-tab-BtwF9pK7.js.gz +0 -0
  610. package/dist/web/assets/task-working-session-chip-Dz22uaog.js.br +0 -0
  611. package/dist/web/assets/task-working-session-chip-Dz22uaog.js.gz +0 -0
  612. package/dist/web/assets/tasks-sidebar-panel-DwCYUpBu.js.br +0 -0
  613. package/dist/web/assets/tasks-sidebar-panel-DwCYUpBu.js.gz +0 -0
  614. package/dist/web/assets/telegram-bot-token-field-DBxdaaJ7.js.br +0 -0
  615. package/dist/web/assets/telegram-bot-token-field-DBxdaaJ7.js.gz +0 -0
  616. package/dist/web/assets/terminal-tab-DhoY4bM_.js.br +0 -0
  617. package/dist/web/assets/terminal-tab-DhoY4bM_.js.gz +0 -0
  618. package/dist/web/assets/tool-cards-C2-7-SQr.js.br +0 -0
  619. package/dist/web/assets/tool-cards-C2-7-SQr.js.gz +0 -0
  620. package/dist/web/assets/tools-settings-section-W_Y0dscJ.js.br +0 -0
  621. package/dist/web/assets/tools-settings-section-W_Y0dscJ.js.gz +0 -0
  622. package/dist/web/assets/use-db-read-DkdhLvi3.js.br +0 -6
  623. package/dist/web/assets/use-db-read-DkdhLvi3.js.gz +0 -0
  624. package/dist/web/assets/use-inline-blame-B6D7FNKA.js.br +0 -0
  625. package/dist/web/assets/use-inline-blame-B6D7FNKA.js.gz +0 -0
  626. package/dist/web/assets/use-lsp-cOwiy7B2.js.br +0 -0
  627. package/dist/web/assets/use-lsp-cOwiy7B2.js.gz +0 -0
  628. package/dist/web/assets/use-process-kill-7NhyKpdz.js.br +0 -0
  629. package/dist/web/assets/use-process-kill-7NhyKpdz.js.gz +0 -0
  630. package/dist/web/assets/use-sql-schema-info-X5R9acSy.js.br +0 -0
  631. package/dist/web/assets/use-sql-schema-info-X5R9acSy.js.gz +0 -0
  632. package/dist/web/assets/vault-settings-section-DixIMoCx.js.br +0 -0
  633. package/dist/web/assets/vault-settings-section-DixIMoCx.js.gz +0 -0
  634. package/dist/web/assets/voice-settings-section-68GjW7l9.js +0 -1
  635. package/dist/web/assets/voice-settings-section-68GjW7l9.js.br +0 -0
  636. package/dist/web/assets/voice-settings-section-68GjW7l9.js.gz +0 -0
  637. package/dist/web/assets/web-browser-settings-CscYbqaH.js +0 -1
  638. package/dist/web/assets/web-browser-settings-section-BGqFpU9P.js +0 -1
  639. package/dist/web/assets/web-browser-settings-section-BGqFpU9P.js.br +0 -0
  640. package/dist/web/assets/web-browser-settings-section-BGqFpU9P.js.gz +0 -0
  641. package/dist/web/assets/web-browser-view-8xcUIVkn.js.br +0 -0
  642. package/dist/web/assets/web-browser-view-8xcUIVkn.js.gz +0 -0
  643. package/dist/web/assets/web-preview-tab-DBSjWPuH.js.br +0 -0
  644. package/dist/web/assets/web-preview-tab-DBSjWPuH.js.gz +0 -0
  645. package/dist/web/assets/xlsx-preview-OxrvsQtU.js.br +0 -0
  646. package/dist/web/assets/xlsx-preview-OxrvsQtU.js.gz +0 -0
@@ -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"./vendor-ui-BQzUk4nq.js";import{j as r}from"./api-client-DSCscZEd.js";import{S as i}from"./vault-Q5oPy0h3.js";import{f as a,g as o,h as s,o as c}from"./session-collab-BD1AwcUC.js";import"./button-CtdEWN7U.js";import"./chat-preparation-cache-D6KJ1ZMi.js";import{t as l}from"./input-CCVoN0-P.js";import{o as u,r as d,t as f}from"./feature-intros-BNK1hj-A.js";import{a as p,x as m}from"./api-settings-DOq_SIAU.js";import{a as h}from"./db-ai-tools-x8SPCTHe.js";import"./design-canvas-check-DAc84j07.js";import"./tab-open-protocol-D5UyfEsm.js";import{i as g,r as _,t as v}from"./ppm-tools-D46CufEw.js";import{Vn as y,n as b,t as x}from"./index-OScFbOhP.js";import{n as S,r as C}from"./settings-rows-DfoCivEv.js";var w=e(t(),1),T=e=>e instanceof Error?e.message:String(e);function E(){let[e,t]=(0,w.useState)(()=>new Set);return(0,w.useEffect)(()=>{let e=!0;return x().then(n=>{if(!(!e||!n||n.newInSettings.length===0)){t(new Set(n.newInSettings.flatMap(e=>d(e)?.tools??[])));for(let e of n.newInSettings)b(e).catch(t=>console.warn(`Could not record that ${e} was seen: ${T(t)}`))}}).catch(e=>console.warn(`Could not load the new-feature markers: ${T(e)}`)),()=>{e=!1}},[]),e}var D=Object.freeze({askBeforeCreate:!0,maxDepth:3,maxAutoMessagesPerPair:20,maxRunningSpawned:5,waitTimeoutMinutes:10}),O=Object.freeze({maxDepth:{min:1,max:5},maxAutoMessagesPerPair:{min:1,max:200},maxRunningSpawned:{min:1,max:20},waitTimeoutMinutes:{min:1,max:60}}),k=Object.keys(O);function A(e,t){let{min:n,max:r}=O[e];return Math.min(r,Math.max(n,Math.round(t)))}function j(e){let t=e&&typeof e==`object`&&!Array.isArray(e)?e:{},n={...D};typeof t.askBeforeCreate==`boolean`&&(n.askBeforeCreate=t.askBeforeCreate);for(let e of k){let r=t[e];typeof r==`number`&&Number.isFinite(r)&&(n[e]=A(e,r))}return n}var M=n(),N=[{key:`maxDepth`,label:`How deep`,note:`Sessions created by created sessions, counted from one you started.`},{key:`maxAutoMessagesPerPair`,label:`Messages per pair`,note:`Sent between two sessions before you are asked. Writing in either starts the count again.`},{key:`maxRunningSpawned`,label:`Running at once`,note:`AI-created sessions of one project working at the same time.`},{key:`waitTimeoutMinutes`,label:`Longest wait`,note:`How long a session waits for a reply before going on.`,unit:`min`}];function P({stored:e,onChange:t}){let n=j(e);return(0,M.jsxs)(`div`,{className:`divide-y divide-border rounded-lg border border-border`,"data-session-collab-settings":``,children:[(0,M.jsx)(C,{label:`Ask before creating sessions`,note:`An AI asks you before it opens a new session. Messaging a session that already exists never asks.`,checked:n.askBeforeCreate,onChange:e=>t({askBeforeCreate:e})}),N.map(e=>(0,M.jsx)(F,{setting:e,value:n[e.key],onCommit:n=>t({[e.key]:n})},e.key))]})}function F({setting:e,value:t,onCommit:n}){let r=(0,w.useId)(),{min:i,max:a}=O[e.key],[o,s]=(0,w.useState)(String(t));return(0,w.useEffect)(()=>s(String(t)),[t]),(0,M.jsxs)(`div`,{className:`flex flex-col gap-2 px-4 py-3 md:flex-row md:items-center md:justify-between`,children:[(0,M.jsxs)(`label`,{htmlFor:r,className:`min-w-0 flex-1`,children:[(0,M.jsx)(`span`,{className:`block text-sm`,children:e.label}),(0,M.jsxs)(`span`,{className:`block text-xs text-muted-foreground`,children:[e.note,` `,i,`–`,a,e.unit?` ${e.unit}`:``,`.`]})]}),(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,M.jsx)(l,{id:r,type:`number`,inputMode:`numeric`,min:i,max:a,step:1,value:o,onChange:e=>s(e.target.value),onBlur:()=>{let r=Number(o),i=Number.isFinite(r)&&o.trim()!==``?A(e.key,r):t;s(String(i)),i!==t&&n(i)},onKeyDown:e=>{e.key===`Enter`&&e.target.blur()},"data-session-collab-number":e.key,className:`h-11 w-full md:h-8 md:w-24`}),e.unit&&(0,M.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.unit})]})]})}var I=e=>e instanceof Error?e.message:String(e),L={open_file:{label:`Open files`,note:`Opens a file in a PPM tab, at a line when it points you at one.`},open_preview:{label:`Show pages`,note:`Opens a page, chart or report it made in a PPM tab, and reads back its errors and a screenshot. While on, Claude's claude.ai Artifact tool is off.`},open_url:{label:`Show running apps`,note:`Opens a web server running on this machine, such as a dev server, in a PPM tab. On another device it goes through a private Tailscale forward; it never makes a public link.`},read_terminal:{label:`Read terminals`,note:`Reads what the terminals of the chat's project printed, so you need not paste an error into the chat.`},run_in_terminal:{label:`Type commands`,note:`Opens a terminal with a command typed in, for one that needs your password or your eyes. Nothing runs until you press Enter.`},search_sessions:{label:`Search chats`,note:`Searches the titles and the prompts and answers of this project's chats, never what tools printed, and says which turn each match is in.`},list_session_turns:{label:`List turns`,note:`Lists the turns of one of this project's chats: number, time and the first line of each prompt.`},read_session_turns:{label:`Read turns`,note:`Reads chosen turns of this project's chats: prompts, answers and one line per tool call. In another project, only the turns whose links you sent it.`},db_query:{label:`Read databases`,note:`Runs read-only SQL. It cannot change anything.`},open_query:{label:`Open Query tabs`,note:`Opens a Query tab holding a script it wrote. You press Run.`},db_execute:{label:`Change databases`,note:`Runs a change only after you approve it with PPM's password, once, in one transaction.`},create_session:{label:`Create sessions`,note:`Opens a new session of this project to hand work to. It shows in your session list, and you can open, chat into or stop it.`},send_to_session:{label:`Message sessions`,note:`Sends a message to another session of this project, and can wait for its reply. Only an explicit message reaches another session.`},session_status:{label:`Check sessions`,note:`Reads what the linked sessions are doing: running or idle, waiting on you, and the opening of their last answer.`},design_screenshot:{label:`Screenshot designs`,note:`Renders a design's pages to pictures on this machine, with a Chrome or Edge it finds here, so the AI can look at them and a manager chat can send them to you with a card.`},session_schedule_create:{label:`Schedule prompts`,note:`Schedules a prompt into its own chat on a cron, repeating or once. It survives restarts and is delivered when the chat is idle.`},session_schedule_list:{label:`List schedules`,note:`Lists the prompts scheduled into its own chat, with their next fire.`},session_schedule_delete:{label:`Delete schedules`,note:`Deletes a prompt scheduled into its own chat. Another chat's schedules are out of its reach.`},session_schedule_set_enabled:{label:`Pause and resume schedules`,note:`Pauses any schedule of its project at once, and says which. Turns a prompt scheduled into its own chat back on at once, and any other schedule of its project only after you allow a card.`},session_schedule_claim:{label:`Claim schedules`,note:`Lists a script or prompt schedule of its project that no chat owns in its own footer chip. It never takes one another chat owns; Settings → Schedules can move it.`},session_schedule_propose_script:{label:`Propose script schedules`,note:`Proposes a script schedule for its project. Nothing is created until you allow a card in PPM showing the whole script, where it runs, when, and which chats it messages.`},vault_list:{label:`List vault items`,note:`Lists the names, kinds and tiers of your vault's items, never a value.`},vault_read:{label:`Read vault items`,note:`Reads public items at once. Secure items need your password on a card; a sealed item is shown to you unless you give it to the AI.`},vault_propose:{label:`Propose vault items`,note:`Asks you to save something to the vault. You pick the tier and confirm with its password.`},ppm_task_list:{label:`List tasks`,note:`Lists a project's tasks in “what to do first” order, with filters.`},ppm_task_get:{label:`Read tasks`,note:`Reads one task: its fields, links, children, recent history and the check of the chat it was handed to.`},ppm_task_project:{label:`Read task settings`,note:`Reads a project's statuses, members and custom fields.`},ppm_task_create:{label:`Create tasks`,note:`Adds a task. It is recorded in the task's history and you can undo it.`},ppm_task_update:{label:`Change tasks`,note:`Changes a task's fields, links or result, with a reason shown in its history. You can undo it.`},ppm_task_close:{label:`Close tasks`,note:`Closes a task as done or dropped. You can undo it.`},ppm_task_reorder:{label:`Reorder tasks`,note:`Moves a task up or down among tasks of the same urgency and importance.`},ppm_task_undo:{label:`Undo task changes`,note:`Undoes a change an AI made, within 90 days, while nobody changed the same fields since.`},ppm_task_project_update:{label:`Change task settings`,note:`Adds or edits a project's members, statuses and custom fields, and how often handed-off work is checked.`},ppm_task_notify_manager:{label:`Tell the manager now`,note:`The PPM Assistant only: wakes a project's manager chat about task changes, after you said yes.`},report_withdraw:{label:`Withdraw stale cards`,note:`A manager chat takes back its cards a newer card replaced or you handled elsewhere (the Assistant too, when you ask it), saying why. Restore brings one back.`}},R=[{title:`Tabs`,intro:`On the device you are chatting from.`,tools:[`open_file`,`open_preview`,`open_url`]},{title:`Terminal`,intro:`PPM's own terminals, on the machine PPM runs on.`,tools:v},{title:`Session history`,intro:`Earlier chats of the chat's own project, read-only. Another project is reachable only through turn links you sent.`,tools:u},{title:`Database`,intro:`On the connections with “Available to the AI chat” on. The AI never sees their passwords.`,tools:h},{title:`Session collaboration`,intro:`Sessions of one project opening and messaging each other. Every session an AI creates is an ordinary one you can see, open and stop.`,tools:c},{title:`Schedules`,intro:`Prompts a chat schedules into itself, and script schedules it proposes for its project behind a card. Each one is listed in Settings → Schedules, where you can turn it off or delete it.`,tools:s},{title:`Tasks`,intro:`Every chat, including manager chats and the PPM Assistant, in projects with Tasks on. A chat started before a change gets it at its next start.`,tools:a},{title:`Vault`,intro:`Your secret vault (Settings → Vault), for ordinary chats. Off until you turn them on here; the PPM Assistant always has them.`,tools:i},{title:`Cards`,intro:`The cards in “Waiting on you”. PPM never closes a card that waits on you by itself; with this on, the card's own manager may.`,tools:o}];function z(){let[e,t]=(0,w.useState)(null),[n,i]=(0,w.useState)(null),a=(0,w.useCallback)(async()=>{try{t(await p()),i(null)}catch(e){i(I(e))}},[]),o=E();(0,w.useEffect)(()=>{a();let e=()=>void a();return window.addEventListener(f,e),()=>window.removeEventListener(f,e)},[a]),y(`ai`,()=>void a());let l=(0,w.useCallback)(async(e,n)=>{t(t=>t&&{...t,ppm_tools:_(t.ppm_tools,{[e]:n})});try{t(await m({ppm_tools:{[e]:n}}))}catch(e){r.error(`Could not save`,{description:I(e)}),await a()}},[a]),u=(0,w.useCallback)(async e=>{t(t=>t&&{...t,session_collab:{...t.session_collab,...e}});try{t(await m({session_collab:e}))}catch(e){r.error(`Could not save`,{description:I(e)}),await a()}},[a]),d=(0,w.useCallback)(async e=>{t(t=>t&&{...t,hide_builtin_cron:e});try{t(await m({hide_builtin_cron:e}))}catch(e){r.error(`Could not save`,{description:I(e)}),await a()}},[a]);return e?(0,M.jsxs)(`div`,{className:`space-y-6`,children:[(0,M.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:`PPM's own tools for the AI chat, with Claude, Codex and Antigravity alike. New chats get the tools that are on; turning one off also stops it in chats already open.`}),R.map(t=>(0,M.jsxs)(`section`,{className:`space-y-3`,children:[(0,M.jsx)(S,{title:t.title,children:t.intro}),(0,M.jsx)(`div`,{className:`divide-y divide-border rounded-lg border border-border`,children:t.tools.map(t=>(0,M.jsx)(C,{label:(0,M.jsxs)(M.Fragment,{children:[L[t].label,(0,M.jsx)(`code`,{className:`ml-2 font-mono text-[11px] text-muted-foreground`,children:t}),o.has(t)&&(0,M.jsx)(`span`,{"data-new-tool":t,className:`ml-2 rounded bg-primary px-1.5 py-0.5 text-[10px] font-semibold uppercase text-primary-foreground`,children:`New`})]}),note:L[t].note,checked:g(e,t),onChange:e=>void l(t,e)},t))}),t.tools===c&&(0,M.jsx)(P,{stored:e.session_collab,onChange:e=>void u(e)}),t.tools===s&&(0,M.jsx)(`div`,{className:`rounded-lg border border-border`,children:(0,M.jsx)(C,{label:`Hide Claude's built-in cron tools`,note:g(e,`session_schedule_create`)?`Claude chats start without CronCreate, CronList and CronDelete, whose jobs end with the chat's process, so Claude schedules through PPM. /loop keeps working.`:`Takes effect while “Schedule prompts” is on. Claude only: Codex has no cron tools of its own.`,checked:e.hide_builtin_cron!==!1,onChange:e=>void d(e)})})]},t.title))]}):(0,M.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n??`Loading…`})}export{z as ToolsSettingsSection};
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{j as r}from"./api-client-DSCscZEd.js";import{S as i}from"./vault-Q5oPy0h3.js";import{f as a,g as o,h as s,o as c}from"./session-collab-BD1AwcUC.js";import"./button-CtdEWN7U.js";import"./chat-preparation-cache-D6KJ1ZMi.js";import{t as l}from"./input-CCVoN0-P.js";import{o as u,r as d,t as f}from"./feature-intros-BNK1hj-A.js";import{a as p,x as m}from"./api-settings-DOq_SIAU.js";import{a as h}from"./db-ai-tools-x8SPCTHe.js";import"./design-canvas-check-DAc84j07.js";import"./tab-open-protocol-D5UyfEsm.js";import{i as g,r as _,t as v}from"./ppm-tools-D46CufEw.js";import{Vn as y,n as b,t as x}from"./index-ix3m5QQT.js";import{n as S,r as C}from"./settings-rows-DxAQdCNV.js";var w=e(t(),1),T=e=>e instanceof Error?e.message:String(e);function E(){let[e,t]=(0,w.useState)(()=>new Set);return(0,w.useEffect)(()=>{let e=!0;return x().then(n=>{if(!(!e||!n||n.newInSettings.length===0)){t(new Set(n.newInSettings.flatMap(e=>d(e)?.tools??[])));for(let e of n.newInSettings)b(e).catch(t=>console.warn(`Could not record that ${e} was seen: ${T(t)}`))}}).catch(e=>console.warn(`Could not load the new-feature markers: ${T(e)}`)),()=>{e=!1}},[]),e}var D=Object.freeze({askBeforeCreate:!0,maxDepth:3,maxAutoMessagesPerPair:20,maxRunningSpawned:5,waitTimeoutMinutes:10}),O=Object.freeze({maxDepth:{min:1,max:5},maxAutoMessagesPerPair:{min:1,max:200},maxRunningSpawned:{min:1,max:20},waitTimeoutMinutes:{min:1,max:60}}),k=Object.keys(O);function A(e,t){let{min:n,max:r}=O[e];return Math.min(r,Math.max(n,Math.round(t)))}function j(e){let t=e&&typeof e==`object`&&!Array.isArray(e)?e:{},n={...D};typeof t.askBeforeCreate==`boolean`&&(n.askBeforeCreate=t.askBeforeCreate);for(let e of k){let r=t[e];typeof r==`number`&&Number.isFinite(r)&&(n[e]=A(e,r))}return n}var M=n(),N=[{key:`maxDepth`,label:`How deep`,note:`Sessions created by created sessions, counted from one you started.`},{key:`maxAutoMessagesPerPair`,label:`Messages per pair`,note:`Sent between two sessions before you are asked. Writing in either starts the count again.`},{key:`maxRunningSpawned`,label:`Running at once`,note:`AI-created sessions of one project working at the same time.`},{key:`waitTimeoutMinutes`,label:`Longest wait`,note:`How long a session waits for a reply before going on.`,unit:`min`}];function P({stored:e,onChange:t}){let n=j(e);return(0,M.jsxs)(`div`,{className:`divide-y divide-border rounded-lg border border-border`,"data-session-collab-settings":``,children:[(0,M.jsx)(C,{label:`Ask before creating sessions`,note:`An AI asks you before it opens a new session. Messaging a session that already exists never asks.`,checked:n.askBeforeCreate,onChange:e=>t({askBeforeCreate:e})}),N.map(e=>(0,M.jsx)(F,{setting:e,value:n[e.key],onCommit:n=>t({[e.key]:n})},e.key))]})}function F({setting:e,value:t,onCommit:n}){let r=(0,w.useId)(),{min:i,max:a}=O[e.key],[o,s]=(0,w.useState)(String(t));return(0,w.useEffect)(()=>s(String(t)),[t]),(0,M.jsxs)(`div`,{className:`flex flex-col gap-2 px-4 py-3 md:flex-row md:items-center md:justify-between`,children:[(0,M.jsxs)(`label`,{htmlFor:r,className:`min-w-0 flex-1`,children:[(0,M.jsx)(`span`,{className:`block text-sm`,children:e.label}),(0,M.jsxs)(`span`,{className:`block text-xs text-muted-foreground`,children:[e.note,` `,i,`–`,a,e.unit?` ${e.unit}`:``,`.`]})]}),(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,M.jsx)(l,{id:r,type:`number`,inputMode:`numeric`,min:i,max:a,step:1,value:o,onChange:e=>s(e.target.value),onBlur:()=>{let r=Number(o),i=Number.isFinite(r)&&o.trim()!==``?A(e.key,r):t;s(String(i)),i!==t&&n(i)},onKeyDown:e=>{e.key===`Enter`&&e.target.blur()},"data-session-collab-number":e.key,className:`h-11 w-full md:h-8 md:w-24`}),e.unit&&(0,M.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.unit})]})]})}var I=e=>e instanceof Error?e.message:String(e),L={open_file:{label:`Open files`,note:`Opens a file in a PPM tab, at a line when it points you at one.`},open_preview:{label:`Show pages`,note:`Opens a page, chart or report it made in a PPM tab, and reads back its errors and a screenshot. While on, Claude's claude.ai Artifact tool is off.`},open_url:{label:`Show running apps`,note:`Opens a web server running on this machine, such as a dev server, in a PPM tab. On another device it goes through a private Tailscale forward; it never makes a public link.`},read_terminal:{label:`Read terminals`,note:`Reads what the terminals of the chat's project printed, so you need not paste an error into the chat.`},run_in_terminal:{label:`Type commands`,note:`Opens a terminal with a command typed in, for one that needs your password or your eyes. Nothing runs until you press Enter.`},search_sessions:{label:`Search chats`,note:`Searches the titles and the prompts and answers of this project's chats, never what tools printed, and says which turn each match is in.`},list_session_turns:{label:`List turns`,note:`Lists the turns of one of this project's chats: number, time and the first line of each prompt.`},read_session_turns:{label:`Read turns`,note:`Reads chosen turns of this project's chats: prompts, answers and one line per tool call. In another project, only the turns whose links you sent it.`},db_query:{label:`Read databases`,note:`Runs read-only SQL. It cannot change anything.`},open_query:{label:`Open Query tabs`,note:`Opens a Query tab holding a script it wrote. You press Run.`},db_execute:{label:`Change databases`,note:`Runs a change only after you approve it with PPM's password, once, in one transaction.`},create_session:{label:`Create sessions`,note:`Opens a new session of this project to hand work to. It shows in your session list, and you can open, chat into or stop it.`},send_to_session:{label:`Message sessions`,note:`Sends a message to another session of this project, and can wait for its reply. Only an explicit message reaches another session.`},session_status:{label:`Check sessions`,note:`Reads what the linked sessions are doing: running or idle, waiting on you, and the opening of their last answer.`},design_screenshot:{label:`Screenshot designs`,note:`Renders a design's pages to pictures on this machine, with a Chrome or Edge it finds here, so the AI can look at them and a manager chat can send them to you with a card.`},session_schedule_create:{label:`Schedule prompts`,note:`Schedules a prompt into its own chat on a cron, repeating or once. It survives restarts and is delivered when the chat is idle.`},session_schedule_list:{label:`List schedules`,note:`Lists the prompts scheduled into its own chat, with their next fire.`},session_schedule_delete:{label:`Delete schedules`,note:`Deletes a prompt scheduled into its own chat. Another chat's schedules are out of its reach.`},session_schedule_set_enabled:{label:`Pause and resume schedules`,note:`Pauses any schedule of its project at once, and says which. Turns a prompt scheduled into its own chat back on at once, and any other schedule of its project only after you allow a card.`},session_schedule_claim:{label:`Claim schedules`,note:`Lists a script or prompt schedule of its project that no chat owns in its own footer chip. It never takes one another chat owns; Settings → Schedules can move it.`},session_schedule_propose_script:{label:`Propose script schedules`,note:`Proposes a script schedule for its project. Nothing is created until you allow a card in PPM showing the whole script, where it runs, when, and which chats it messages.`},vault_list:{label:`List vault items`,note:`Lists the names, kinds and tiers of your vault's items, never a value.`},vault_read:{label:`Read vault items`,note:`Reads public items at once. Secure items need your password on a card; a sealed item is shown to you unless you give it to the AI.`},vault_propose:{label:`Propose vault items`,note:`Asks you to save something to the vault. You pick the tier and confirm with its password.`},ppm_task_list:{label:`List tasks`,note:`Lists a project's tasks in “what to do first” order, with filters.`},ppm_task_get:{label:`Read tasks`,note:`Reads one task: its fields, links, children, recent history and the check of the chat it was handed to.`},ppm_task_project:{label:`Read task settings`,note:`Reads a project's statuses, members and custom fields.`},ppm_task_create:{label:`Create tasks`,note:`Adds a task. It is recorded in the task's history and you can undo it.`},ppm_task_update:{label:`Change tasks`,note:`Changes a task's fields, links or result, with a reason shown in its history. You can undo it.`},ppm_task_close:{label:`Close tasks`,note:`Closes a task as done or dropped. You can undo it.`},ppm_task_reorder:{label:`Reorder tasks`,note:`Moves a task up or down among tasks of the same urgency and importance.`},ppm_task_undo:{label:`Undo task changes`,note:`Undoes a change an AI made, within 90 days, while nobody changed the same fields since.`},ppm_task_project_update:{label:`Change task settings`,note:`Adds or edits a project's members, statuses and custom fields, and how often handed-off work is checked.`},ppm_task_notify_manager:{label:`Tell the manager now`,note:`The PPM Assistant only: wakes a project's manager chat about task changes, after you said yes.`},report_withdraw:{label:`Withdraw stale cards`,note:`A manager chat takes back its cards a newer card replaced or you handled elsewhere (the Assistant too, when you ask it), saying why. Restore brings one back.`}},R=[{title:`Tabs`,intro:`On the device you are chatting from.`,tools:[`open_file`,`open_preview`,`open_url`]},{title:`Terminal`,intro:`PPM's own terminals, on the machine PPM runs on.`,tools:v},{title:`Session history`,intro:`Earlier chats of the chat's own project, read-only. Another project is reachable only through turn links you sent.`,tools:u},{title:`Database`,intro:`On the connections with “Available to the AI chat” on. The AI never sees their passwords.`,tools:h},{title:`Session collaboration`,intro:`Sessions of one project opening and messaging each other. Every session an AI creates is an ordinary one you can see, open and stop.`,tools:c},{title:`Schedules`,intro:`Prompts a chat schedules into itself, and script schedules it proposes for its project behind a card. Each one is listed in Settings → Schedules, where you can turn it off or delete it.`,tools:s},{title:`Tasks`,intro:`Every chat, including manager chats and the PPM Assistant, in projects with Tasks on. A chat started before a change gets it at its next start.`,tools:a},{title:`Vault`,intro:`Your secret vault (Settings → Vault), for ordinary chats. Off until you turn them on here; the PPM Assistant always has them.`,tools:i},{title:`Cards`,intro:`The cards in “Waiting on you”. PPM never closes a card that waits on you by itself; with this on, the card's own manager may.`,tools:o}];function z(){let[e,t]=(0,w.useState)(null),[n,i]=(0,w.useState)(null),a=(0,w.useCallback)(async()=>{try{t(await p()),i(null)}catch(e){i(I(e))}},[]),o=E();(0,w.useEffect)(()=>{a();let e=()=>void a();return window.addEventListener(f,e),()=>window.removeEventListener(f,e)},[a]),y(`ai`,()=>void a());let l=(0,w.useCallback)(async(e,n)=>{t(t=>t&&{...t,ppm_tools:_(t.ppm_tools,{[e]:n})});try{t(await m({ppm_tools:{[e]:n}}))}catch(e){r.error(`Could not save`,{description:I(e)}),await a()}},[a]),u=(0,w.useCallback)(async e=>{t(t=>t&&{...t,session_collab:{...t.session_collab,...e}});try{t(await m({session_collab:e}))}catch(e){r.error(`Could not save`,{description:I(e)}),await a()}},[a]),d=(0,w.useCallback)(async e=>{t(t=>t&&{...t,hide_builtin_cron:e});try{t(await m({hide_builtin_cron:e}))}catch(e){r.error(`Could not save`,{description:I(e)}),await a()}},[a]);return e?(0,M.jsxs)(`div`,{className:`space-y-6`,children:[(0,M.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:`PPM's own tools for the AI chat, with Claude, Codex and Antigravity alike. New chats get the tools that are on; turning one off also stops it in chats already open.`}),R.map(t=>(0,M.jsxs)(`section`,{className:`space-y-3`,children:[(0,M.jsx)(S,{title:t.title,children:t.intro}),(0,M.jsx)(`div`,{className:`divide-y divide-border rounded-lg border border-border`,children:t.tools.map(t=>(0,M.jsx)(C,{label:(0,M.jsxs)(M.Fragment,{children:[L[t].label,(0,M.jsx)(`code`,{className:`ml-2 font-mono text-[11px] text-muted-foreground`,children:t}),o.has(t)&&(0,M.jsx)(`span`,{"data-new-tool":t,className:`ml-2 rounded bg-primary px-1.5 py-0.5 text-[10px] font-semibold uppercase text-primary-foreground`,children:`New`})]}),note:L[t].note,checked:g(e,t),onChange:e=>void l(t,e)},t))}),t.tools===c&&(0,M.jsx)(P,{stored:e.session_collab,onChange:e=>void u(e)}),t.tools===s&&(0,M.jsx)(`div`,{className:`rounded-lg border border-border`,children:(0,M.jsx)(C,{label:`Hide Claude's built-in cron tools`,note:g(e,`session_schedule_create`)?`Claude chats start without CronCreate, CronList and CronDelete, whose jobs end with the chat's process, so Claude schedules through PPM. /loop keeps working.`:`Takes effect while “Schedule prompts” is on. Claude only: Codex has no cron tools of its own.`,checked:e.hide_builtin_cron!==!1,onChange:e=>void d(e)})})]},t.title))]}):(0,M.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n??`Loading…`})}export{z as ToolsSettingsSection};
@@ -1 +1 @@
1
- import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t}from"./vendor-markdown-26eoXJk7.js";import{r as n}from"./api-client-DSCscZEd.js";import{tt as r}from"./window-store-Bl6ySrZZ.js";import{t as i}from"./panel-store-B5zTGca0.js";import{i as a}from"./db-drivers-BIKN5HLb.js";import{L as o}from"./db-explorer-store-Bzw8bf2f.js";import{$n as s}from"./index-OScFbOhP.js";var c=e(t(),1);function l(e,t,i){let l=e&&t?r(e,t):null,[d,f]=(0,c.useState)({data:null,error:null,loading:l!==null,driver:null}),p=(0,c.useRef)(0),m=(0,c.useRef)([]),h=(0,c.useCallback)(async()=>{if(!l){for(let e of m.current.splice(0))e();return}let e=++p.current;f(e=>({...e,loading:!0}));let t;try{t={data:await n.get(l),error:null,loading:!1,driver:null}}catch(e){t={data:null,error:e.message,loading:!1,driver:a(e)}}if(e===p.current){f(t);for(let e of m.current.splice(0))e()}},[l]),g=(0,c.useCallback)(()=>new Promise(e=>{m.current.push(e),h()}),[h]);(0,c.useEffect)(()=>{h()},[h]);let{active:_,shown:v}=u(i);(0,c.useEffect)(()=>{v>0&&h()},[v]);let y=e?.kind===`connection`?e.connectionId:null,b=o(e=>y===null?0:e.structureChanges[y]??0),x=(0,c.useRef)(b);return(0,c.useEffect)(()=>{b!==x.current&&(x.current=b,_&&h())},[b]),s(e=>{d.driver?.id===e&&h()}),{...d,reload:g}}function u(e){let t=i(t=>!!e&&Object.values(t.panels).some(t=>t.activeTabId===e)),[n,r]=(0,c.useState)(0),a=(0,c.useRef)(t);return(0,c.useEffect)(()=>{t&&!a.current&&r(e=>e+1),a.current=t},[t]),{active:t,shown:n}}export{l as t};
1
+ import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t}from"./vendor-markdown-26eoXJk7.js";import{r as n}from"./api-client-DSCscZEd.js";import{tt as r}from"./window-store-Bl6ySrZZ.js";import{t as i}from"./panel-store-B5zTGca0.js";import{i as a}from"./db-drivers-BIKN5HLb.js";import{L as o}from"./db-explorer-store-Bzw8bf2f.js";import{$n as s}from"./index-ix3m5QQT.js";var c=e(t(),1);function l(e,t,i){let l=e&&t?r(e,t):null,[d,f]=(0,c.useState)({data:null,error:null,loading:l!==null,driver:null}),p=(0,c.useRef)(0),m=(0,c.useRef)([]),h=(0,c.useCallback)(async()=>{if(!l){for(let e of m.current.splice(0))e();return}let e=++p.current;f(e=>({...e,loading:!0}));let t;try{t={data:await n.get(l),error:null,loading:!1,driver:null}}catch(e){t={data:null,error:e.message,loading:!1,driver:a(e)}}if(e===p.current){f(t);for(let e of m.current.splice(0))e()}},[l]),g=(0,c.useCallback)(()=>new Promise(e=>{m.current.push(e),h()}),[h]);(0,c.useEffect)(()=>{h()},[h]);let{active:_,shown:v}=u(i);(0,c.useEffect)(()=>{v>0&&h()},[v]);let y=e?.kind===`connection`?e.connectionId:null,b=o(e=>y===null?0:e.structureChanges[y]??0),x=(0,c.useRef)(b);return(0,c.useEffect)(()=>{b!==x.current&&(x.current=b,_&&h())},[b]),s(e=>{d.driver?.id===e&&h()}),{...d,reload:g}}function u(e){let t=i(t=>!!e&&Object.values(t.panels).some(t=>t.activeTabId===e)),[n,r]=(0,c.useState)(0),a=(0,c.useRef)(t);return(0,c.useEffect)(()=>{t&&!a.current&&r(e=>e+1),a.current=t},[t]),{active:t,shown:n}}export{l as t};
@@ -1,4 +1,4 @@
1
- import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t}from"./vendor-markdown-26eoXJk7.js";import{j as n,r}from"./api-client-DSCscZEd.js";import{i}from"./project-store-BaGmhKos.js";import{r as a}from"./clipboard-DQuoK2EM.js";import{t as o}from"./use-git-repo-BjCnSkJ0.js";import{Dr as s,Er as c,Tr as l,wr as u}from"./index-OScFbOhP.js";var d=[`ppm.blame.copySha`,`ppm.blame.fileHistory`,`ppm.blame.blameFile`,`ppm.blame.showInGraph`],f=7;function p(e){return e.replace(/[\\`*_{}[\]()#+\-!<>]/g,e=>`\\${e}`)}function m(e){let t=e.trim().split(/\s+/).filter(Boolean);return t.length===0?`?`:(t[0][0]+(t.length>1?t[t.length-1][0]:``)).toUpperCase()}var h=[`4E79A7`,`F28E2B`,`E15759`,`76B7B2`,`59A14F`,`AF7AA1`,`9C755F`,`B07AA1`];function g(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return h[Math.abs(t)%h.length]}function _(e){let t=`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><circle cx="8" cy="8" r="8" fill="#${g(e)}"/><text x="8" y="11.5" font-family="sans-serif" font-size="7" font-weight="700" fill="#ffffff" text-anchor="middle">${v(m(e))}</text></svg>`;return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`}function v(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`)}function y(e,t){return`command:${e}?${encodeURIComponent(JSON.stringify(t))}`}function b(e){let{commit:t,detail:n,filePath:r,projectPath:i,now:a=Date.now()}=e;if(s(t.hash))return null;let o=t.author||`Unknown`,l=t.hash.slice(0,f),m=[],h=t.authorTime>0?`${c(t.authorTime*1e3,a)} (${u(t.authorTime*1e3)})`:``;m.push(`![](${_(o)}) **${p(o)}**${h?` &nbsp;$(history) ${p(h)}`:``}`);let g=n?.message||t.summary;g&&(m.push(``),m.push(p(g).split(`
1
+ import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t}from"./vendor-markdown-26eoXJk7.js";import{j as n,r}from"./api-client-DSCscZEd.js";import{i}from"./project-store-BaGmhKos.js";import{r as a}from"./clipboard-DQuoK2EM.js";import{t as o}from"./use-git-repo-BjCnSkJ0.js";import{Dr as s,Er as c,Tr as l,wr as u}from"./index-ix3m5QQT.js";var d=[`ppm.blame.copySha`,`ppm.blame.fileHistory`,`ppm.blame.blameFile`,`ppm.blame.showInGraph`],f=7;function p(e){return e.replace(/[\\`*_{}[\]()#+\-!<>]/g,e=>`\\${e}`)}function m(e){let t=e.trim().split(/\s+/).filter(Boolean);return t.length===0?`?`:(t[0][0]+(t.length>1?t[t.length-1][0]:``)).toUpperCase()}var h=[`4E79A7`,`F28E2B`,`E15759`,`76B7B2`,`59A14F`,`AF7AA1`,`9C755F`,`B07AA1`];function g(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return h[Math.abs(t)%h.length]}function _(e){let t=`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><circle cx="8" cy="8" r="8" fill="#${g(e)}"/><text x="8" y="11.5" font-family="sans-serif" font-size="7" font-weight="700" fill="#ffffff" text-anchor="middle">${v(m(e))}</text></svg>`;return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`}function v(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`)}function y(e,t){return`command:${e}?${encodeURIComponent(JSON.stringify(t))}`}function b(e){let{commit:t,detail:n,filePath:r,projectPath:i,now:a=Date.now()}=e;if(s(t.hash))return null;let o=t.author||`Unknown`,l=t.hash.slice(0,f),m=[],h=t.authorTime>0?`${c(t.authorTime*1e3,a)} (${u(t.authorTime*1e3)})`:``;m.push(`![](${_(o)}) **${p(o)}**${h?` &nbsp;$(history) ${p(h)}`:``}`);let g=n?.message||t.summary;g&&(m.push(``),m.push(p(g).split(`
2
2
  `).join(`
3
3
  `)));let v=[``,`---`,``],b=[`[$(git-commit) ${l}](${y(`ppm.blame.copySha`,[t.hash])} "Copy commit hash")`];i&&b.push(`[$(history) File History](${y(`ppm.blame.fileHistory`,[i,r])} "Open the file's history")`,`[$(users) Blame](${y(`ppm.blame.blameFile`,[i,r])} "Open the blame view")`,`[$(git-branch) Graph](${y(`ppm.blame.showInGraph`,[i])} "Open the commit graph")`),m.push(...v),m.push(b.join(` &nbsp; `));let x=[...(n?.removed??[]).map(e=>`-${e}`),...(n?.added??[]).map(e=>`+${e}`)];if(x.length>0){m.push(...v),m.push("```diff"),m.push(...x),m.push("```"),m.push(``);let e=(n?.removed.length??0)===0?`added in`:`in`;m.push(`Changes ${e} \`${l}\``)}return{value:m.join(`
4
4
  `),isTrusted:{enabledCommands:[...d]},supportThemeIcons:!0}}var x=!1;function S(e,t){window.dispatchEvent(new CustomEvent(`ext:command:execute`,{detail:{command:e,args:t}}))}function C(e){return typeof e==`string`&&/^[0-9a-f]{7,40}$/.test(e)?e:null}function w(e){return typeof e==`string`&&e.length>0?e:null}function T(e,t,n){let r=w(t),i=w(n);!r||!i||S(e,[r,i])}function E(e){x||(x=!0,e.editor.registerCommand(`ppm.blame.copySha`,(e,t)=>{let r=C(t);r&&a(r).then(e=>{n[e?`success`:`error`](e?`Copied ${r.slice(0,7)}`:`Could not copy`)})}),e.editor.registerCommand(`ppm.blame.fileHistory`,(e,t,n)=>{T(`git-graph.fileHistory`,t,n)}),e.editor.registerCommand(`ppm.blame.blameFile`,(e,t,n)=>{T(`git-graph.blame`,t,n)}),e.editor.registerCommand(`ppm.blame.showInGraph`,(e,t)=>{let n=w(t);n&&S(`git-graph.view`,[n])}))}var D=`diff`,O=!1;function k(e){if(!O){if(e.languages.getLanguages().some(e=>e.id===`diff`)){O=!0;return}e.languages.register({id:D,aliases:[`Diff`,`patch`],extensions:[`.diff`,`.patch`]}),e.languages.setMonarchTokensProvider(D,{tokenizer:{root:[[/^diff .*$/,`meta.diff.header`],[/^(index|similarity index|rename from|rename to|new file mode|deleted file mode|old mode|new mode) .*$/,`meta.diff.header`],[/^(\+\+\+|---) .*$/,`meta.diff.header`],[/^@@.*$/,`meta.diff.range`],[/^\+.*$/,`inserted`],[/^-.*$/,`deleted`],[/^\\ .*$/,`meta.diff.header`],[/^.*$/,``]]}}),O=!0}}var A=e(t(),1),j=`inline-blame-styles`,M=`
@@ -1,4 +1,4 @@
1
- import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t}from"./vendor-markdown-26eoXJk7.js";import"./vendor-ui-BQzUk4nq.js";import{o as n,r}from"./api-client-DSCscZEd.js";import"./ws-auth-BoXvat-e.js";import{vt as i}from"./index-OScFbOhP.js";import{i as a,r as o,t as s}from"./lsp-client-DIGWPiKt.js";var c=e(t(),1),l=new Map;function u(e,t){l.set(e.uri.toString(),t)}function ee(e){l.delete(e.uri.toString())}function d(e){return l.get(e.uri.toString())}function f(e){if(!e.startsWith(`file:`))return null;let t=e.slice(5),n=``;if(t.startsWith(`//`)){t=t.slice(2);let e=t.indexOf(`/`);n=e<0?t:t.slice(0,e),t=e<0?``:t.slice(e)}let r=t.split(`/`).map(p).join(`/`);return/^\/[A-Za-z]:/.test(r)?r.slice(1):n?`//${p(n)}${r}`:r}function p(e){try{return decodeURIComponent(e)}catch{return e}}var m=40,h=500,g=3,_=6,v=new Map,y=new Map;function te(e){return(y.get(e)??0)>=g}function b(e){x(e,(y.get(e)??0)+1)}function ne(e){x(e,g)}function x(e,t){for(y.delete(e),y.set(e,t);y.size>h;){let e=y.keys().next().value;if(e===void 0)return;y.delete(e)}}function re(e){y.delete(e)}async function S(e,t,n){let r=0,i=Array.from({length:Math.min(t,e.length)},async()=>{for(;;){let t=r++;if(t>=e.length)return;await n(e[t])}});await Promise.all(i)}function C(e,t){let n=e.replace(/\\/g,`/`).replace(/\/+$/,``),r=t.replace(/\\/g,`/`),i=n+`/`,a=/^[A-Za-z]:\//.test(i),o=r.slice(0,i.length);return(a?o.toLowerCase()!==i.toLowerCase():o!==i)?null:r.slice(i.length)}async function w(e,t,i,a){if(!i)return;let o=new Set,s=[...new Set(a)].filter(t=>{if(te(t))return!1;let n=v.get(t);return n&&(v.delete(t),!n.isDisposed())?(v.set(t,n),o.add(t),!1):t.startsWith(`file:`)&&!e.editor.getModel(e.Uri.parse(t))});s.length!==0&&(await S(s,_,async a=>{try{let s=f(a),c=s?C(i,s):null;if(!c){ne(a);return}let l=(await r.get(`${n(t)}/files/read?path=${encodeURIComponent(c)}`))?.content;if(typeof l!=`string`){b(a);return}re(a);let u=e.Uri.parse(a);if(e.editor.getModel(u)){o.add(a);return}v.set(a,e.editor.createModel(l,void 0,u)),o.add(a)}catch{b(a)}}),T(o))}function T(e){for(let t of[...v.keys()]){if(v.size<=m)return;if(e.has(t))continue;let n=v.get(t);v.delete(t);try{n?.dispose()}catch{}}}function E(){for(let e of v.values())try{e.dispose()}catch{}v.clear(),y.clear()}function D(e){if(!e)return;let t=new AbortController;return e.isCancellationRequested?t.abort():e.onCancellationRequested(()=>t.abort()),t.signal}function O(e){return{line:e.lineNumber-1,character:e.column-1}}function ie(e){return{lineNumber:e.line+1,column:e.character+1}}function k(e){return{start:{line:e.startLineNumber-1,character:e.startColumn-1},end:{line:e.endLineNumber-1,character:e.endColumn-1}}}function A(e){return{startLineNumber:e.start.line+1,startColumn:e.start.character+1,endLineNumber:e.end.line+1,endColumn:e.end.character+1}}var ae={1:`Text`,2:`Method`,3:`Function`,4:`Constructor`,5:`Field`,6:`Variable`,7:`Class`,8:`Interface`,9:`Module`,10:`Property`,11:`Unit`,12:`Value`,13:`Enum`,14:`Keyword`,15:`Snippet`,16:`Color`,17:`File`,18:`Reference`,19:`Folder`,20:`EnumMember`,21:`Constant`,22:`Struct`,23:`Event`,24:`Operator`,25:`TypeParameter`},oe={1:`File`,2:`Module`,3:`Namespace`,4:`Package`,5:`Class`,6:`Method`,7:`Property`,8:`Field`,9:`Constructor`,10:`Enum`,11:`Interface`,12:`Function`,13:`Variable`,14:`Constant`,15:`String`,16:`Number`,17:`Boolean`,18:`Array`,19:`Object`,20:`Key`,21:`Null`,22:`EnumMember`,23:`Struct`,24:`Event`,25:`Operator`,26:`TypeParameter`},se={1:`Error`,2:`Warning`,3:`Info`,4:`Hint`},ce={1:`Text`,2:`Read`,3:`Write`};function j(e,t){let n=ae[t??0];return e.languages.CompletionItemKind[n??`Text`]}function M(e,t){let n=oe[t??0];return e.languages.SymbolKind[n??`Variable`]}function N(e,t){let n=se[t??0];return e.MarkerSeverity[n??`Warning`]}function P(e,t){let n=ce[t??0];return e.languages.DocumentHighlightKind[n??`Text`]}function F(e){if(e!=null){if(Array.isArray(e)){let t=e.map(F).filter(e=>!!e?.value);return t.length===0?void 0:{value:t.map(e=>e.value).join(`
1
+ import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t}from"./vendor-markdown-26eoXJk7.js";import"./vendor-ui-BQzUk4nq.js";import{o as n,r}from"./api-client-DSCscZEd.js";import"./ws-auth-BoXvat-e.js";import{vt as i}from"./index-ix3m5QQT.js";import{i as a,r as o,t as s}from"./lsp-client-DI0orIfb.js";var c=e(t(),1),l=new Map;function u(e,t){l.set(e.uri.toString(),t)}function ee(e){l.delete(e.uri.toString())}function d(e){return l.get(e.uri.toString())}function f(e){if(!e.startsWith(`file:`))return null;let t=e.slice(5),n=``;if(t.startsWith(`//`)){t=t.slice(2);let e=t.indexOf(`/`);n=e<0?t:t.slice(0,e),t=e<0?``:t.slice(e)}let r=t.split(`/`).map(p).join(`/`);return/^\/[A-Za-z]:/.test(r)?r.slice(1):n?`//${p(n)}${r}`:r}function p(e){try{return decodeURIComponent(e)}catch{return e}}var m=40,h=500,g=3,_=6,v=new Map,y=new Map;function te(e){return(y.get(e)??0)>=g}function b(e){x(e,(y.get(e)??0)+1)}function ne(e){x(e,g)}function x(e,t){for(y.delete(e),y.set(e,t);y.size>h;){let e=y.keys().next().value;if(e===void 0)return;y.delete(e)}}function re(e){y.delete(e)}async function S(e,t,n){let r=0,i=Array.from({length:Math.min(t,e.length)},async()=>{for(;;){let t=r++;if(t>=e.length)return;await n(e[t])}});await Promise.all(i)}function C(e,t){let n=e.replace(/\\/g,`/`).replace(/\/+$/,``),r=t.replace(/\\/g,`/`),i=n+`/`,a=/^[A-Za-z]:\//.test(i),o=r.slice(0,i.length);return(a?o.toLowerCase()!==i.toLowerCase():o!==i)?null:r.slice(i.length)}async function w(e,t,i,a){if(!i)return;let o=new Set,s=[...new Set(a)].filter(t=>{if(te(t))return!1;let n=v.get(t);return n&&(v.delete(t),!n.isDisposed())?(v.set(t,n),o.add(t),!1):t.startsWith(`file:`)&&!e.editor.getModel(e.Uri.parse(t))});s.length!==0&&(await S(s,_,async a=>{try{let s=f(a),c=s?C(i,s):null;if(!c){ne(a);return}let l=(await r.get(`${n(t)}/files/read?path=${encodeURIComponent(c)}`))?.content;if(typeof l!=`string`){b(a);return}re(a);let u=e.Uri.parse(a);if(e.editor.getModel(u)){o.add(a);return}v.set(a,e.editor.createModel(l,void 0,u)),o.add(a)}catch{b(a)}}),T(o))}function T(e){for(let t of[...v.keys()]){if(v.size<=m)return;if(e.has(t))continue;let n=v.get(t);v.delete(t);try{n?.dispose()}catch{}}}function E(){for(let e of v.values())try{e.dispose()}catch{}v.clear(),y.clear()}function D(e){if(!e)return;let t=new AbortController;return e.isCancellationRequested?t.abort():e.onCancellationRequested(()=>t.abort()),t.signal}function O(e){return{line:e.lineNumber-1,character:e.column-1}}function ie(e){return{lineNumber:e.line+1,column:e.character+1}}function k(e){return{start:{line:e.startLineNumber-1,character:e.startColumn-1},end:{line:e.endLineNumber-1,character:e.endColumn-1}}}function A(e){return{startLineNumber:e.start.line+1,startColumn:e.start.character+1,endLineNumber:e.end.line+1,endColumn:e.end.character+1}}var ae={1:`Text`,2:`Method`,3:`Function`,4:`Constructor`,5:`Field`,6:`Variable`,7:`Class`,8:`Interface`,9:`Module`,10:`Property`,11:`Unit`,12:`Value`,13:`Enum`,14:`Keyword`,15:`Snippet`,16:`Color`,17:`File`,18:`Reference`,19:`Folder`,20:`EnumMember`,21:`Constant`,22:`Struct`,23:`Event`,24:`Operator`,25:`TypeParameter`},oe={1:`File`,2:`Module`,3:`Namespace`,4:`Package`,5:`Class`,6:`Method`,7:`Property`,8:`Field`,9:`Constructor`,10:`Enum`,11:`Interface`,12:`Function`,13:`Variable`,14:`Constant`,15:`String`,16:`Number`,17:`Boolean`,18:`Array`,19:`Object`,20:`Key`,21:`Null`,22:`EnumMember`,23:`Struct`,24:`Event`,25:`Operator`,26:`TypeParameter`},se={1:`Error`,2:`Warning`,3:`Info`,4:`Hint`},ce={1:`Text`,2:`Read`,3:`Write`};function j(e,t){let n=ae[t??0];return e.languages.CompletionItemKind[n??`Text`]}function M(e,t){let n=oe[t??0];return e.languages.SymbolKind[n??`Variable`]}function N(e,t){let n=se[t??0];return e.MarkerSeverity[n??`Warning`]}function P(e,t){let n=ce[t??0];return e.languages.DocumentHighlightKind[n??`Text`]}function F(e){if(e!=null){if(Array.isArray(e)){let t=e.map(F).filter(e=>!!e?.value);return t.length===0?void 0:{value:t.map(e=>e.value).join(`
2
2
 
3
3
  ---
4
4
 
@@ -1 +1 @@
1
- import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{t}from"./settings-store-DirmJxtu.js";import{D as n}from"./vendor-markdown-26eoXJk7.js";import{r,t as i}from"./apply-theme-BeLRfsSu.js";import{t as a}from"./resolve-theme-BHAgAaFk.js";import{K as o}from"./index-OScFbOhP.js";var s=e(n(),1);function c(){let e=t(e=>e.themeStyle),n=t(e=>e.themeMode),c=t(e=>e.customThemeId),l=t(e=>e.customThemes),u=()=>o(r()??a(e,n,l,c)),[d,f]=(0,s.useState)(u);return(0,s.useEffect)(()=>{f(u());let e=()=>f(u());return window.addEventListener(i,e),()=>window.removeEventListener(i,e)},[e,n,c,l]),d}export{c as t};
1
+ import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{t}from"./settings-store-DirmJxtu.js";import{D as n}from"./vendor-markdown-26eoXJk7.js";import{r,t as i}from"./apply-theme-BeLRfsSu.js";import{t as a}from"./resolve-theme-BHAgAaFk.js";import{K as o}from"./index-ix3m5QQT.js";var s=e(n(),1);function c(){let e=t(e=>e.themeStyle),n=t(e=>e.themeMode),c=t(e=>e.customThemeId),l=t(e=>e.customThemes),u=()=>o(r()??a(e,n,l,c)),[d,f]=(0,s.useState)(u);return(0,s.useEffect)(()=>{f(u());let e=()=>f(u());return window.addEventListener(i,e),()=>window.removeEventListener(i,e)},[e,n,c,l]),d}export{c as t};
@@ -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{a as r,j as i}from"./api-client-DSCscZEd.js";import{t as a}from"./mobile-bottom-sheet-C78UMLrn.js";import{n as o}from"./use-is-mobile-CrfIt67b.js";import{t as s}from"./button-CtdEWN7U.js";import{a as c,n as l,o as u,t as d}from"./dialog-BWXzvHlC.js";import{Qn as f}from"./index-OScFbOhP.js";import{r as p}from"./format-bytes-JtOteeDT.js";var m=e(t(),1),h=n();function g({target:e,onConfirm:t,onCancel:n}){let r=o(),[i,g]=(0,m.useState)(!1);if((0,m.useEffect)(()=>{e||g(!1)},[e]),!e)return null;let _=e.kind===`group`,v=_?`End app`:`End process`,y=_?e.group.cpu:e.proc.cpu,b=_?e.group.ramMB:e.proc.ramMB,x=(0,h.jsxs)(`div`,{className:`space-y-4`,"data-testid":`sysmon-kill-confirm`,"data-kill-kind":e.kind,children:[_?(0,h.jsxs)(`p`,{className:`text-sm`,children:[`End `,(0,h.jsx)(`span`,{className:`font-medium`,children:e.group.label}),` and all its`,` `,(0,h.jsx)(`span`,{className:`font-medium`,children:e.members.length}),` processes?`]}):(0,h.jsxs)(`p`,{className:`text-sm`,children:[`End `,(0,h.jsx)(`span`,{className:`font-medium`,children:e.proc.name}),` (pid `,e.proc.pid,`)?`]}),(0,h.jsxs)(`p`,{className:`text-xs text-text-subtle`,children:[`CPU `,y.toFixed(1),`% · RAM `,p(b)]}),!_&&(0,h.jsxs)(`label`,{className:`flex items-center justify-between gap-3 min-h-11 py-1`,children:[(0,h.jsx)(`span`,{className:`text-sm`,children:`Also end child processes`}),(0,h.jsx)(f,{checked:i,onCheckedChange:g,"data-testid":`sysmon-kill-tree`,"aria-label":`Also end child processes`})]}),(0,h.jsxs)(`div`,{className:`flex flex-col-reverse md:flex-row gap-2 md:justify-end pt-2`,children:[(0,h.jsx)(s,{variant:`outline`,onClick:n,"data-testid":`sysmon-kill-confirm-cancel`,className:`min-h-11`,children:`Cancel`}),(0,h.jsx)(s,{variant:`destructive`,autoFocus:!1,onClick:()=>t(e,i),"data-testid":`sysmon-kill-confirm-ok`,className:`min-h-11`,children:_?`End ${e.members.length} processes`:`End process`})]})]});return r?(0,h.jsx)(a,{open:!0,onClose:n,children:(0,h.jsxs)(`div`,{className:`px-4 pb-4`,children:[(0,h.jsx)(`h2`,{className:`text-base font-semibold mb-3`,children:v}),x]})}):(0,h.jsx)(d,{open:!0,onOpenChange:e=>!e&&n(),children:(0,h.jsxs)(l,{children:[(0,h.jsx)(c,{children:(0,h.jsx)(u,{children:v})}),x]})})}function _(e,t){return{pid:e.pid,startedAt:e.startedAt,tree:t}}function v(e,t){let n=e.rootPid===null?void 0:t.find(t=>t.pid===e.rootPid);return n?[_(n,!0)]:t.map(e=>_(e,!1))}function y(e){return e.some(e=>e.protected)}async function b(e){let t=r(),n={"Content-Type":`application/json`,"X-PPM-Request":`1`};t&&(n.Authorization=`Bearer ${t}`);let i=await fetch(`/api/system/resources/kill`,{method:`POST`,headers:n,body:JSON.stringify(e)}),a;try{a=await i.json()}catch{throw Error(i.ok?`Empty response from server`:`Server error (HTTP ${i.status})`)}if(a.ok===!1)throw Error(a.error??`HTTP ${i.status}`);return a.data}function x(e){let[t,n]=(0,m.useState)(null),r=(0,m.useCallback)(t=>{let n=new Map(e.processes.map(e=>[e.pid,e]));return t.pids.map(e=>n.get(e)).filter(e=>!!e)},[e.processes]),a=(0,m.useMemo)(()=>new Map(e.groups.map(e=>[e.key,y(r(e))])),[e.groups,r]),o=(0,m.useCallback)(e=>n({kind:`process`,proc:e}),[]),s=(0,m.useCallback)(e=>n({kind:`group`,group:e,members:r(e)}),[r]),c=(0,m.useCallback)(()=>n(null),[]);return{pendingKill:t,groupProtected:a,requestKillProcess:o,requestKillGroup:s,confirmKill:(0,m.useCallback)(async(e,t)=>{if(n(null),e.kind===`process`){let{proc:n}=e;try{await b(_(n,t)),i.success(`Ended ${n.name} (${n.pid})`)}catch(e){i.error(e instanceof Error?e.message:`Failed to end ${n.name}`)}return}let{group:r,members:a}=e,o=[];for(let e of v(r,a))try{await b(e)}catch(t){o.push(t instanceof Error?t.message:`pid ${e.pid}`)}o.length===0?i.success(`Ended ${r.label} (${a.length} processes)`):i.error(`${r.label}: ${o.length} of ${a.length} could not be ended — ${o[0]}`)},[]),cancelKill:c}}export{y as n,g as r,x as t};
1
+ import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-26eoXJk7.js";import{a as r,j as i}from"./api-client-DSCscZEd.js";import{t as a}from"./mobile-bottom-sheet-C78UMLrn.js";import{n as o}from"./use-is-mobile-CrfIt67b.js";import{t as s}from"./button-CtdEWN7U.js";import{a as c,n as l,o as u,t as d}from"./dialog-BWXzvHlC.js";import{Qn as f}from"./index-ix3m5QQT.js";import{r as p}from"./format-bytes-JtOteeDT.js";var m=e(t(),1),h=n();function g({target:e,onConfirm:t,onCancel:n}){let r=o(),[i,g]=(0,m.useState)(!1);if((0,m.useEffect)(()=>{e||g(!1)},[e]),!e)return null;let _=e.kind===`group`,v=_?`End app`:`End process`,y=_?e.group.cpu:e.proc.cpu,b=_?e.group.ramMB:e.proc.ramMB,x=(0,h.jsxs)(`div`,{className:`space-y-4`,"data-testid":`sysmon-kill-confirm`,"data-kill-kind":e.kind,children:[_?(0,h.jsxs)(`p`,{className:`text-sm`,children:[`End `,(0,h.jsx)(`span`,{className:`font-medium`,children:e.group.label}),` and all its`,` `,(0,h.jsx)(`span`,{className:`font-medium`,children:e.members.length}),` processes?`]}):(0,h.jsxs)(`p`,{className:`text-sm`,children:[`End `,(0,h.jsx)(`span`,{className:`font-medium`,children:e.proc.name}),` (pid `,e.proc.pid,`)?`]}),(0,h.jsxs)(`p`,{className:`text-xs text-text-subtle`,children:[`CPU `,y.toFixed(1),`% · RAM `,p(b)]}),!_&&(0,h.jsxs)(`label`,{className:`flex items-center justify-between gap-3 min-h-11 py-1`,children:[(0,h.jsx)(`span`,{className:`text-sm`,children:`Also end child processes`}),(0,h.jsx)(f,{checked:i,onCheckedChange:g,"data-testid":`sysmon-kill-tree`,"aria-label":`Also end child processes`})]}),(0,h.jsxs)(`div`,{className:`flex flex-col-reverse md:flex-row gap-2 md:justify-end pt-2`,children:[(0,h.jsx)(s,{variant:`outline`,onClick:n,"data-testid":`sysmon-kill-confirm-cancel`,className:`min-h-11`,children:`Cancel`}),(0,h.jsx)(s,{variant:`destructive`,autoFocus:!1,onClick:()=>t(e,i),"data-testid":`sysmon-kill-confirm-ok`,className:`min-h-11`,children:_?`End ${e.members.length} processes`:`End process`})]})]});return r?(0,h.jsx)(a,{open:!0,onClose:n,children:(0,h.jsxs)(`div`,{className:`px-4 pb-4`,children:[(0,h.jsx)(`h2`,{className:`text-base font-semibold mb-3`,children:v}),x]})}):(0,h.jsx)(d,{open:!0,onOpenChange:e=>!e&&n(),children:(0,h.jsxs)(l,{children:[(0,h.jsx)(c,{children:(0,h.jsx)(u,{children:v})}),x]})})}function _(e,t){return{pid:e.pid,startedAt:e.startedAt,tree:t}}function v(e,t){let n=e.rootPid===null?void 0:t.find(t=>t.pid===e.rootPid);return n?[_(n,!0)]:t.map(e=>_(e,!1))}function y(e){return e.some(e=>e.protected)}async function b(e){let t=r(),n={"Content-Type":`application/json`,"X-PPM-Request":`1`};t&&(n.Authorization=`Bearer ${t}`);let i=await fetch(`/api/system/resources/kill`,{method:`POST`,headers:n,body:JSON.stringify(e)}),a;try{a=await i.json()}catch{throw Error(i.ok?`Empty response from server`:`Server error (HTTP ${i.status})`)}if(a.ok===!1)throw Error(a.error??`HTTP ${i.status}`);return a.data}function x(e){let[t,n]=(0,m.useState)(null),r=(0,m.useCallback)(t=>{let n=new Map(e.processes.map(e=>[e.pid,e]));return t.pids.map(e=>n.get(e)).filter(e=>!!e)},[e.processes]),a=(0,m.useMemo)(()=>new Map(e.groups.map(e=>[e.key,y(r(e))])),[e.groups,r]),o=(0,m.useCallback)(e=>n({kind:`process`,proc:e}),[]),s=(0,m.useCallback)(e=>n({kind:`group`,group:e,members:r(e)}),[r]),c=(0,m.useCallback)(()=>n(null),[]);return{pendingKill:t,groupProtected:a,requestKillProcess:o,requestKillGroup:s,confirmKill:(0,m.useCallback)(async(e,t)=>{if(n(null),e.kind===`process`){let{proc:n}=e;try{await b(_(n,t)),i.success(`Ended ${n.name} (${n.pid})`)}catch(e){i.error(e instanceof Error?e.message:`Failed to end ${n.name}`)}return}let{group:r,members:a}=e,o=[];for(let e of v(r,a))try{await b(e)}catch(t){o.push(t instanceof Error?t.message:`pid ${e.pid}`)}o.length===0?i.success(`Ended ${r.label} (${a.length} processes)`):i.error(`${r.label}: ${o.length} of ${a.length} could not be ended — ${o[0]}`)},[]),cancelKill:c}}export{y as n,g as r,x as t};
@@ -1,4 +1,4 @@
1
- import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-26eoXJk7.js";import{r}from"./api-client-DSCscZEd.js";import{tt as i}from"./window-store-Bl6ySrZZ.js";import{n as a}from"./explorer-model-CMB2DLaE.js";import{c as o,l as s,o as c,r as l}from"./split-sql-statements-0B9v-kNm.js";import{J as u,q as d}from"./index-OScFbOhP.js";import{t as f}from"./use-monaco-theme-DSuNmsTl.js";import{t as p}from"./editor-font-CmDF-3iD.js";import{t as m}from"./sql-completion-provider-DzhGbF_2.js";function h(e,t){return t?.text.trim()?{sql:t.text,lineOffset:t.startLine-1,from:`selection`}:e.trim()?{sql:e,lineOffset:0,from:`script`}:null}function g(e,t,n){let r=s(e,t,n);return r?{sql:r.run,lineOffset:l(r),from:`statement`}:null}function _(e,t,n,r){return t?.text.trim()?{sql:t.text,lineOffset:t.startLine-1,from:`selection`}:g(e,n,r)}var v=/\s/;function y(e,t,n){let r=0;for(let t=1;t<n.lineNumber;t++)r=e.indexOf(`
1
+ import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-26eoXJk7.js";import{r}from"./api-client-DSCscZEd.js";import{tt as i}from"./window-store-Bl6ySrZZ.js";import{n as a}from"./explorer-model-CMB2DLaE.js";import{c as o,l as s,o as c,r as l}from"./split-sql-statements-0B9v-kNm.js";import{J as u,q as d}from"./index-ix3m5QQT.js";import{t as f}from"./use-monaco-theme-BQ-OZWX-.js";import{t as p}from"./editor-font-CmDF-3iD.js";import{t as m}from"./sql-completion-provider-DzhGbF_2.js";function h(e,t){return t?.text.trim()?{sql:t.text,lineOffset:t.startLine-1,from:`selection`}:e.trim()?{sql:e,lineOffset:0,from:`script`}:null}function g(e,t,n){let r=s(e,t,n);return r?{sql:r.run,lineOffset:l(r),from:`statement`}:null}function _(e,t,n,r){return t?.text.trim()?{sql:t.text,lineOffset:t.startLine-1,from:`selection`}:g(e,n,r)}var v=/\s/;function y(e,t,n){let r=0;for(let t=1;t<n.lineNumber;t++)r=e.indexOf(`
2
2
  `,r)+1;r+=n.column-1;let i=0;for(let t=0;t<r;t++)v.test(e[t])||i++;let a=r===0||v.test(e[r-1]),o=a?i:i-1,s=0;for(let e=0;s<t.length;s++)if(!v.test(t[s])){if(e===o)break;e++}!a&&s<t.length&&s++;let c=1,l=0;for(let e=t.indexOf(`
3
3
  `);e!==-1&&e<s;e=t.indexOf(`
4
4
  `,e+1))c++,l=e+1;return{lineNumber:c,column:s-l+1}}var b=e(t(),1),x=n(),S=120;function C(e){let t=e.getSelection(),n=e.getModel();return!t||!n||t.isEmpty()?null:{text:n.getValueInRange(t),startLine:t.startLineNumber}}function w({onExecute:e,loading:t,defaultValue:n=`SELECT * FROM `,schemaInfo:r,onSqlChange:i,persistedSql:a,dialect:s=`postgres`,handleRef:l,queryTab:v=!1,errorLines:w,onFormat:T}){let[E,D]=(0,b.useState)(()=>a??n),O=(0,b.useRef)(!!a),[k,A]=(0,b.useState)(null),j=(0,b.useRef)(e);j.current=e;let M=(0,b.useRef)(s);M.current=s;let N=(0,b.useRef)(T);N.current=T;let P=f();(0,b.useEffect)(()=>{if(!k||!r)return;let{editor:e,monaco:t}=k,n=t.languages.registerCompletionItemProvider(`sql`,m(t,r,()=>M.current,e));return()=>n.dispose()},[k,r]);let F=(0,b.useCallback)((e,t)=>{let n=()=>{let t=e.getPosition();return t?g(e.getValue(),t.lineNumber,M.current):null};e.addAction({id:`run-query-at-cursor`,label:`Run Statement at Cursor`,keybindings:[t.KeyMod.CtrlCmd|t.KeyCode.Enter,...v?[t.KeyMod.CtrlCmd|t.KeyMod.Shift|t.KeyCode.Enter]:[]],run:()=>{let e=n();e&&j.current(e)}}),v&&(e.addAction({id:`run-query-script`,label:`Run Script or Selection`,keybindings:[t.KeyCode.F5],run:()=>{let t=h(e.getValue(),C(e));t&&j.current(t)}}),e.addAction({id:`format-query-script`,label:`Format SQL`,keybindings:[t.KeyMod.Shift|t.KeyMod.Alt|t.KeyCode.KeyF],run:()=>N.current?.()})),l&&(l.current={runAtCursor:()=>{e.getAction(`run-query-at-cursor`)?.run()},runScript:()=>{let t=h(e.getValue(),C(e));t&&j.current(t)},selectionOrStatement:()=>{let t=e.getPosition();return _(e.getValue(),C(e),t?.lineNumber??1,M.current)},revealLine:t=>{e.setPosition({lineNumber:t,column:1}),e.revealLineInCenterIfOutsideViewport(t),e.focus()},insertText:n=>{let r=e.getSelection();if(!r)return;e.pushUndoStop(),e.executeEdits(`ppm-insert`,[{range:r,text:n,forceMoveMarkers:!0}],e=>{let n=e[0]?.range;return n?[new t.Selection(n.startLineNumber,n.startColumn,n.endLineNumber,n.endColumn)]:null}),e.pushUndoStop();let i=e.getSelection();i&&e.revealRangeInCenterIfOutsideViewport(i),e.focus()},reformat:n=>{let r=e.getModel();if(!r)return;let i=r.getValue(t.editor.EndOfLinePreference.LF),a=n(i);if(a!==i){let n=y(i,a,e.getPosition()??{lineNumber:1,column:1});e.pushUndoStop(),e.executeEdits(`ppm-format`,[{range:r.getFullModelRange(),text:a}],[new t.Selection(n.lineNumber,n.column,n.lineNumber,n.column)]),e.pushUndoStop(),e.revealPositionInCenterIfOutsideViewport(n)}e.focus()}}),A({editor:e,monaco:t})},[l]);return(0,b.useEffect)(()=>{if(!k||!v)return;let{editor:e,monaco:t}=k,n=e.createDecorationsCollection(),r=null,i=null,a=()=>{i=null;let a=e.getModel(),s=e.getPosition();if(!a||!s)return n.clear();let l=a.getVersionId();r?.version!==l&&(r={version:l,statements:c(a.getValue(),M.current)});let u=r.statements.length>1?o(r.statements,s.lineNumber):null;n.set(u?[{range:new t.Range(u.startLine,1,u.endLine,1),options:{isWholeLine:!0,lineNumberClassName:`ppm-sql-current-statement`,linesDecorationsClassName:`ppm-sql-current-statement-bar`}}]:[])},s=()=>{i&&clearTimeout(i),i=setTimeout(a,S)};a();let l=e.onDidChangeCursorPosition(s),u=e.onDidChangeModelContent(s);return()=>{i&&clearTimeout(i),l.dispose(),u.dispose(),n.clear()}},[k,v]),(0,b.useEffect)(()=>{if(!k||!w?.length)return;let{editor:e,monaco:t}=k,n=e.getModel()?.getLineCount()??0,r=e.createDecorationsCollection(w.filter(e=>e>=1&&e<=n).map(e=>({range:new t.Range(e,1,e,1),options:{isWholeLine:!0,className:`ppm-sql-error-line`,linesDecorationsClassName:`ppm-sql-error-bar`}}))),i=e.onDidChangeModelContent(()=>r.clear());return()=>{i.dispose(),r.clear()}},[k,w]),(0,b.useEffect)(()=>{O.current||D(n)},[n]),(0,x.jsx)(`div`,{className:`h-full overflow-hidden`,children:(0,x.jsx)(u,{beforeMount:d,height:`100%`,language:`sql`,theme:P,value:E,onChange:e=>{let t=e??``;D(t),O.current=!0,i?.(t)},onMount:F,options:{minimap:{enabled:!1},lineNumbers:v?`on`:`off`,scrollBeyondLastLine:!1,wordWrap:`on`,fontFamily:p,fontSize:12,tabSize:2,renderLineHighlight:`none`,overviewRulerLanes:0,hideCursorInOverviewRuler:!0,scrollbar:{vertical:`auto`,horizontal:`auto`,verticalScrollbarSize:6,horizontalScrollbarSize:6},padding:{top:4,bottom:4},lineDecorationsWidth:v?8:4,lineNumbersMinChars:v?3:0,glyphMargin:!1,folding:!1,fixedOverflowWidgets:!0}})})}function T(e){let[t,n]=(0,b.useState)([]);return(0,b.useEffect)(()=>{if(n([]),!e)return;let t=!0;return(e.kind===`connection`&&e.database===void 0?r.get(i(e,`/tables?cached=1`)):r.get(i(e,`/objects`)).then(e=>e.objects.filter(e=>a.has(e.kind)).map(e=>({name:e.name,schema:e.schema??``})))).then(e=>{t&&n(e.map(({name:e,schema:t})=>({name:e,schema:t})))}).catch(()=>{}),()=>{t=!1}},[e]),(0,b.useMemo)(()=>{if(!(!e||t.length===0))return{tables:t,getColumns:(t,n)=>r.get(i(e,`/schema?table=${encodeURIComponent(t)}${n?`&schema=${encodeURIComponent(n)}`:``}`))}},[e,t])}export{w as n,T as t};
@@ -1 +1 @@
1
- import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t}from"./vendor-markdown-26eoXJk7.js";import{W as n}from"./index-OScFbOhP.js";var r=e(t(),1);function i({url:e,onMessage:t,autoConnect:i=!0,idleTimeoutMs:a,onConnectionChange:o}){let s=(0,r.useRef)(null),c=(0,r.useRef)(t),l=(0,r.useRef)(o);return c.current=t,l.current=o,(0,r.useEffect)(()=>{let t=!0,r=new n(e,{idleTimeoutMs:a,onConnectionChange:e=>{t&&l.current?.(e)}});return s.current=r,r.onMessage(e=>c.current?.(e)),i&&r.connect(),()=>{t=!1,r.disconnect(),s.current=null}},[e,i,a]),{send:(0,r.useCallback)(e=>{s.current?.send(e)},[]),connect:(0,r.useCallback)(()=>{s.current?.connect()},[]),disconnect:(0,r.useCallback)(()=>{s.current?.disconnect()},[])}}export{i as t};
1
+ import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t}from"./vendor-markdown-26eoXJk7.js";import{W as n}from"./index-ix3m5QQT.js";var r=e(t(),1);function i({url:e,onMessage:t,autoConnect:i=!0,idleTimeoutMs:a,onConnectionChange:o}){let s=(0,r.useRef)(null),c=(0,r.useRef)(t),l=(0,r.useRef)(o);return c.current=t,l.current=o,(0,r.useEffect)(()=>{let t=!0,r=new n(e,{idleTimeoutMs:a,onConnectionChange:e=>{t&&l.current?.(e)}});return s.current=r,r.onMessage(e=>c.current?.(e)),i&&r.connect(),()=>{t=!1,r.disconnect(),s.current=null}},[e,i,a]),{send:(0,r.useCallback)(e=>{s.current?.send(e)},[]),connect:(0,r.useCallback)(()=>{s.current?.connect()},[]),disconnect:(0,r.useCallback)(()=>{s.current?.disconnect()},[])}}export{i as t};
@@ -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-DAc84j07.js";import"./tab-open-protocol-D5UyfEsm.js";import"./vault-tool-call-DSMwzVDz.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-DrhqcOc6.js";import{t as J}from"./design-responsive-dialog-CC557bnX.js";import{n as Y,t as X}from"./settings-rows-DfoCivEv.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-DAc84j07.js";import"./tab-open-protocol-D5UyfEsm.js";import"./vault-tool-call-DSMwzVDz.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-DrhqcOc6.js";import{t as J}from"./design-responsive-dialog-CC557bnX.js";import{n as Y,t as X}from"./settings-rows-DxAQdCNV.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};
@@ -0,0 +1 @@
1
+ import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{t}from"./settings-store-DirmJxtu.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,Fr as o,Nn as s,Pr as c,Sn as l,Xr as u,gr as d,ht as f,j as p,lr as m,pi as h,sr as g}from"./icons-CpR5Vw3J.js";import{a as _,j as v,r as y,v as b,y as x}from"./api-client-DSCscZEd.js";import{n as S}from"./utils-DMiycH3O.js";import"./window-store-Bl6ySrZZ.js";import"./panel-store-B5zTGca0.js";import{i as C}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-BD1AwcUC.js";import{t as w}from"./button-CtdEWN7U.js";import{t as T}from"./input-CCVoN0-P.js";import{i as E}from"./control-size-DFdAJqoq.js";import{t as D}from"./feature-intros-BNK1hj-A.js";import{i as O}from"./voice-message-CNThCsr3.js";import{a as k,c as A,n as j,t as M}from"./use-voice-message-recorder-BxjLFY10.js";import{Vn as N}from"./index-ix3m5QQT.js";import"./run-in-terminal-Bhp0sfyb.js";import{t as ee}from"./separator-TnMkIcEp.js";import{r as P}from"./settings-rows-DxAQdCNV.js";import{t as te}from"./run-in-terminal-button-BP_KVP3Z.js";var F=e(n(),1),I=r();function L(e,t){let n=t.replace(/\s+/g,` `).trim();return!n||e.some(e=>e.toLowerCase()===n.toLowerCase())?null:[...e,n]}function R({words:e,learned:t=[],placeholder:n,busy:r,onWordsChange:i,onRemoveLearned:a}){let[o,s]=(0,F.useState)(``),l=()=>{let t=L(e,o);s(``),t&&i(t)};return(0,I.jsxs)(`div`,{className:`overflow-hidden rounded-xl border border-border bg-panel`,children:[(0,I.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,I.jsx)(`span`,{className:`text-xs text-text-3`,children:`No words yet.`}),t.map(e=>(0,I.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,I.jsx)(c,{className:`size-3 shrink-0 text-accent-2`,"aria-label":`Learned`}),e.word,e.from&&(0,I.jsxs)(`span`,{className:`font-sans text-[11px] text-text-3`,children:[`← `,e.from]}),a&&(0,I.jsx)(z,{label:`Remove learned word ${e.word}`,disabled:r,onClick:()=>a(e.word)})]},`learned-${e.word}`)),e.map(t=>(0,I.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,I.jsx)(z,{label:`Remove ${t}`,disabled:r,onClick:()=>i(e.filter(e=>e!==t))})]},t))]}),t.length>0&&(0,I.jsxs)(`p`,{className:`flex items-center gap-1.5 px-3.5 pb-2 text-[11.5px] text-text-3`,children:[(0,I.jsx)(c,{className:`size-3 text-accent-2`}),`learned from your corrections`]}),(0,I.jsxs)(`form`,{className:`flex gap-2 px-3.5 pb-3`,onSubmit:e=>{e.preventDefault(),l()},children:[(0,I.jsx)(T,{value:o,onChange:e=>s(e.target.value),placeholder:n,"aria-label":n,disabled:r,className:`h-11 md:h-[34px]`}),(0,I.jsxs)(w,{type:`submit`,variant:`outline`,disabled:r||!o.trim(),className:`h-11 gap-1.5 md:h-[34px]`,children:[(0,I.jsx)(m,{className:`size-3.5`}),`Add`]})]})]})}function z({label:e,disabled:t,onClick:n}){return(0,I.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,I.jsx)(h,{className:`size-3`})})}var B=10080*60*1e3;function V(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 ne(e,t=new Date){let n=`learned ${V(e.at,t)}`;if(!e.lastUsedAt||e.lastUsedAt===e.at)return{text:n,title:n};let r=`used ${V(e.lastUsedAt,t)}`;return{text:r,title:`${n}, last ${r}`}}function re(e){return e.source===`cleanup`?`clean-up · ${e.hits??1}×`:e.source===`chat`?`chat · ${e.hits??1}×`:`your edit`}function ie(e){return e.source===`chat`?`chat · ${e.chats} of 3 chats or days`:`clean-up · seen ${e.hits}×`}function ae(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 oe({learned:e,blocked:t,learning:n,busy:r,onUndo:a,onRestore:o,onSkip:s}){let[c,l]=(0,F.useState)(`week`),u=(0,F.useMemo)(()=>new Date,[e,t]),d=(0,F.useMemo)(()=>[...e].sort((e,t)=>t.at.localeCompare(e.at)),[e]),f=d.filter(e=>u.getTime()-Date.parse(e.at)<B),p=ae(e,u),m=c===`week`?f:d;return(0,I.jsxs)(`div`,{className:`overflow-hidden rounded-xl border border-border bg-panel`,"data-voice-learned-list":``,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 border-b border-border-soft px-3 py-2`,children:[(0,I.jsxs)(H,{active:c===`week`,onClick:()=>l(`week`),children:[`This week · `,f.length]}),(0,I.jsxs)(H,{active:c===`all`,onClick:()=>l(`all`),children:[`All · `,e.length]}),(0,I.jsxs)(H,{active:c===`learning`,onClick:()=>l(`learning`),children:[`Learning · `,n.length]}),(0,I.jsxs)(H,{active:c===`undone`,onClick:()=>l(`undone`),children:[`Undone · `,t.length]}),(0,I.jsx)(`span`,{className:`flex-1`}),(c===`week`||c===`all`)&&(0,I.jsxs)(w,{variant:`outline`,size:`sm`,disabled:r||p.length===0,onClick:()=>a(p),className:`h-11 w-full border-destructive/40 text-destructive md:h-[30px] md:w-auto`,children:[`Undo everything learned today`,p.length?` (${p.length})`:``]})]}),c===`learning`?n.length===0?(0,I.jsx)(U,{children:`Nothing being learned. A word the clean-up or the chat's AI read differently is counted here until it is learned.`}):(0,I.jsx)(`ul`,{children:n.map(e=>(0,I.jsx)(W,{word:e.to,heard:e.from,badge:ie(e),badgeTone:e.source===`chat`?`chat`:`cleanup`,when:{text:`seen ${V(e.at,u)}`,title:``},children:(0,I.jsx)(w,{variant:`outline`,size:`sm`,disabled:r,onClick:()=>s(e.to),className:`h-11 md:h-[30px]`,"aria-label":`Don't learn ${e.to}`,children:`Don't learn`})},`learning-${e.from}-${e.to}`))}):c===`undone`?t.length===0?(0,I.jsx)(U,{children:`Nothing undone. A word you undo stays here, and is never learned again until you restore it.`}):(0,I.jsx)(`ul`,{children:[...t].sort((e,t)=>t.at.localeCompare(e.at)).map(e=>(0,I.jsx)(W,{word:e.word,heard:e.from,badge:e.learning?.length?`not learned · Restore counts it again`:`undone · never again`,when:{text:`${e.learning?.length?`stopped`:`undone`} ${V(e.at,u)}`,title:``},dim:!0,children:(0,I.jsx)(w,{variant:`outline`,size:`sm`,disabled:r,onClick:()=>o(e.word),className:`h-11 md:h-[30px]`,children:`Restore`})},`blocked-${e.word}`))}):m.length===0?(0,I.jsx)(U,{children:c===`week`?`Nothing learned this week.`:`Nothing learned yet. Words appear here once the clean-up or the chat's AI has read them the same way a few times, or when you correct a transcript.`}):(0,I.jsx)(`ul`,{children:m.map(e=>(0,I.jsx)(W,{word:e.word,heard:e.from,badge:re(e),badgeTone:e.source===`cleanup`?`cleanup`:e.source===`chat`?`chat`:`edit`,when:ne(e,u),phrase:e.kind===`phrase`,children:(0,I.jsxs)(w,{variant:`outline`,size:`sm`,disabled:r,onClick:()=>a([e.word]),className:`h-11 gap-1.5 md:h-[30px]`,"aria-label":`Undo learned word ${e.word}`,children:[(0,I.jsx)(i,{className:`size-3.5`}),`Undo`]})},`learned-${e.word}`))})]})}function H({active:e,onClick:t,children:n}){return(0,I.jsx)(`button`,{type:`button`,onClick:t,"aria-pressed":e,className:S(`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 U({children:e}){return(0,I.jsx)(`p`,{className:`px-4 py-4 text-xs leading-relaxed text-text-3`,children:e})}function W({word:e,heard:t,badge:n,badgeTone:r,when:i,dim:a,phrase:o,children:s}){return(0,I.jsxs)(`li`,{className:S(`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,I.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,I.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,I.jsxs)(`span`,{className:`col-span-2 row-start-3 flex items-center gap-2 md:col-span-1 md:row-start-auto`,children:[(0,I.jsx)(`span`,{className:S(`whitespace-nowrap rounded-full border px-2 py-0.5 text-[10.5px]`,r===`cleanup`?`border-accent-2/40 text-accent-2`:r===`chat`?`border-info/40 text-info`:r===`edit`?`border-warning/40 text-warning`:`border-border text-text-3`),children:n}),(0,I.jsx)(`span`,{className:`text-xs text-text-3 md:hidden`,title:i.title||void 0,children:i.text})]}),(0,I.jsx)(`span`,{className:`hidden text-xs text-text-3 md:block`,title:i.title||void 0,children:i.text}),(0,I.jsx)(`span`,{className:`col-start-2 row-start-1 justify-self-end md:col-start-auto md:row-start-auto`,children:s})]})}var G={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`}},se=e=>e.reduce((e,t,n)=>e+t.word.length+(n?2:0),0);function ce({view:e,busy:t,projectSelect:n,save:r}){let i=e.selfLearning,a=Object.values(e.transcriptFix).includes(`haiku`);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(K,{title:`Self-learning`,children:[(0,I.jsx)(P,{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 or the chat's AI has read 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,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(P,{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,I.jsx)(P,{label:`Learn from the clean-up's corrections`,note:a?`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 neither the chat box nor Telegram uses.`,checked:e.learnFromCleanup&&a,disabled:t||!a,onChange:e=>r({learnFromCleanup:e})}),(0,I.jsx)(P,{label:`Learn from how the AI read your words`,note:`A voice message sent as heard asks the AI to open its answer with "Hiểu là: heard → meant" when it read a word differently. The same reading in three messages is learned, and one nobody says for 30 days leaves the list by itself. No extra AI call.`,checked:e.learnFromChat,disabled:t,onChange:e=>r({learnFromChat:e})}),(0,I.jsx)(P,{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,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(K,{title:(0,I.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2`,children:[`What Whisper hears first `,n]}),bare:!0,children:(0,I.jsx)(le,{words:e.whisperPrompt,max:e.whisperPromptMaxChars})}),(0,I.jsx)(K,{title:`Learned words · this project`,bare:!0,children:(0,I.jsx)(oe,{learned:e.projectLearned,blocked:e.projectBlocked,learning:e.projectLearning,busy:t,onUndo:e=>r({removeLearned:e}),onRestore:e=>r({restoreBlocked:[e]}),onSkip:e=>r({skipLearning:[e]})})})]})]})}function le({words:e,max:t}){let n=se(e),r=n=>e.filter(e=>e.source===n).reduce((e,t)=>e+t.word.length+2,0)/Math.max(t,1);return(0,I.jsxs)(`div`,{className:`overflow-hidden rounded-xl border border-border bg-panel`,"data-voice-prompt-preview":``,children:[(0,I.jsx)(`p`,{className:`break-words px-4 py-3 font-mono text-xs leading-relaxed`,children:e.length===0?(0,I.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,I.jsxs)(`span`,{className:G[t.source].text,children:[t.word,n<e.length-1?`, `:``]},`${n}:${t.word}`))}),(0,I.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,I.jsxs)(`span`,{className:`font-mono`,children:[n,` / `,t,` characters`]}),(0,I.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,I.jsx)(`span`,{className:S(`h-full`,G[e].dot),style:{width:`${Math.min(100,r(e)*100)}%`}},e))}),(0,I.jsx)(`span`,{className:`flex flex-wrap gap-3`,children:[`typed`,`learned`,`picked`].map(e=>(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,I.jsx)(`span`,{className:S(`size-2 rounded-full`,G[e].dot)}),G[e].label]},e))})]})]})}function K({title:e,children:t,bare:n}){return(0,I.jsxs)(`section`,{children:[(0,I.jsx)(`div`,{className:`mb-2 text-[11px] font-semibold uppercase tracking-wider text-text-3`,children:e}),n?t:(0,I.jsx)(`div`,{className:`divide-y divide-border-soft overflow-hidden rounded-xl border border-border bg-panel`,children:t})]})}var ue=[{surface:`composer`,label:`Chat box`},{surface:`telegram`,label:`Telegram`}],de=[{value:`hints`,label:`As heard, with hints`},{value:`haiku`,label:`Tidy with Claude Haiku`}],fe=`As heard: Whisper's text goes as it is, with the words it misheard for you before attached for the AI that reads it — about 3 s sooner, no extra call. Claude Haiku: one call per message on your Claude account fixes misheard words and punctuation first, reading the last 8 messages, memory, CLAUDE.md and your word lists.`;function pe({value:e,disabled:t,onChange:n}){return(0,I.jsxs)(`div`,{className:`space-y-2.5 px-4 py-3`,"data-testid":`voice-transcript-fix`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`p`,{className:`text-sm`,children:`Misheard words`}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:fe})]}),ue.map(({surface:r,label:i})=>(0,I.jsxs)(`div`,{className:`flex flex-col gap-1.5 sm:flex-row sm:items-center sm:gap-3`,children:[(0,I.jsx)(`span`,{className:`w-20 shrink-0 text-xs font-medium text-text-2`,children:i}),(0,I.jsx)(`div`,{role:`radiogroup`,"aria-label":`${i}: misheard words`,className:`flex min-w-0 flex-1 gap-1.5`,children:de.map(i=>{let a=e[r]===i.value;return(0,I.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":a,disabled:t,"data-surface":r,"data-choice":i.value,onClick:()=>{a||n(r,i.value)},className:S(`h-11 min-w-0 flex-1 truncate rounded-lg border px-2.5 text-[12.5px] transition-colors md:h-8`,a?`border-accent-wash-border bg-accent-wash font-medium text-text`:`border-border bg-panel text-text-2 hover:bg-surface-hover`,t&&`cursor-default opacity-60`),children:i.label},i.value)})})]},r))]})}function me({onEnabledChange:e}){let t=C(e=>e.projects),n=C(e=>e.activeProject?.name),[r,i]=(0,F.useState)(()=>(n&&!x(n)?n:t[0]?.name)??`__assistant__`),[o,s]=(0,F.useState)(null),[c,l]=(0,F.useState)(!1),[u,d]=(0,F.useState)(!1),[f,p]=(0,F.useState)(0);N(`voice`,()=>p(e=>e+1)),(0,F.useEffect)(()=>{let e=!0,t=()=>k(r).then(t=>{e&&(s(t),l(!1))}).catch(()=>{e&&l(!0)});return t(),window.addEventListener(D,t),()=>{e=!1,window.removeEventListener(D,t)}},[r,f]),(0,F.useEffect)(()=>{o&&e?.(o.enabled)},[o,e]);let m=(0,F.useCallback)(async e=>{d(!0);try{s(await A({project:r,...e}))}catch(e){v.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 h=r===`__assistant__`?`PPM Assistant`:r,g=(0,I.jsxs)(`label`,{className:`relative inline-flex items-center`,children:[(0,I.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=>!x(e.name)).map(e=>(0,I.jsx)(`option`,{value:e.name,children:e.name},e.name)),(0,I.jsx)(`option`,{value:b,children:`PPM Assistant`})]}),(0,I.jsx)(a,{className:`pointer-events-none absolute right-2 size-3 text-text-3`})]});return(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsxs)(q,{title:`Voice messages`,children:[(0,I.jsx)(P,{label:`Voice messages`,note:`The mic in the chat box records a message and Whisper turns it into text on this host. Off: the mic dictates into the box as before.`,checked:o.enabled,disabled:u,onChange:e=>void m({enabled:e})}),o.enabled&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(P,{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 m({reviewBeforeSend:e})}),(0,I.jsx)(pe,{value:o.transcriptFix,disabled:u,onChange:(e,t)=>void m({transcriptFix:{[e]:t}})}),Object.values(o.transcriptFix).includes(`haiku`)&&(0,I.jsx)(P,{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 m({vietnameseFixes:e})}),(0,I.jsx)(J,{label:`Longest recording`,value:O(120)}),!o.whisperReady&&(0,I.jsx)(J,{label:`Whisper`,children:`Not installed on this host yet. Install it below; until then the mic offers the install.`})]})]}),o.enabled&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(q,{title:`Words · all projects`,bare:!0,children:(0,I.jsx)(R,{words:o.words,placeholder:`Add a word or name…`,busy:u,onWordsChange:e=>void m({words:e})})}),(0,I.jsx)(q,{bare:!0,title:(0,I.jsxs)(`span`,{className:`flex items-center gap-2`,children:[`Words · project`,g]}),children:(0,I.jsx)(R,{words:o.projectWords,learned:o.selfLearning?[]:o.projectLearned,placeholder:`Add a word for ${h}…`,busy:u,onWordsChange:e=>void m({projectWords:e}),onRemoveLearned:e=>void m({removeLearned:[e]})})}),(0,I.jsx)(ce,{view:o,busy:u,projectSelect:g,save:e=>void m(e)})]})]})}function q({title:e,children:t,bare:n}){return(0,I.jsxs)(`section`,{children:[(0,I.jsx)(`div`,{className:`mb-2 text-[11px] font-semibold uppercase tracking-wider text-text-3`,children:e}),n?t:(0,I.jsx)(`div`,{className:`divide-y divide-border-soft overflow-hidden rounded-xl border border-border bg-panel`,children:t})]})}function J({label:e,value:t,children:n}){return(0,I.jsxs)(`div`,{className:`flex min-h-11 items-center gap-3 px-4 py-2.5`,children:[(0,I.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,I.jsx)(`p`,{className:`text-sm`,children:e}),n&&(0,I.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:n})]}),t&&(0,I.jsx)(`span`,{className:`shrink-0 font-mono text-xs text-text-2`,children:t})]})}var Y=e=>`${Math.round(e/1e6)} MB`,he=e=>`${(e/1e9).toFixed(1)} GB`;function ge({gpu:e,cpuBytes:t,value:n,onChange:r}){if(!e.cudaBuild&&e.installedBuild!==`cuda`)return null;let i=e.cudaBuild?`Uses ${e.nvidia?.name??`the NVIDIA card`}: under a second per message. About ${he(e.cudaBuild.unpackedBytes)} on disk.`:`Installed, but no NVIDIA card that can use it answers right now.`;return(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(`p`,{className:`text-xs font-medium`,children:`Build`}),(0,I.jsxs)(`div`,{className:`flex flex-col sm:flex-row gap-2`,children:[(0,I.jsx)(X,{label:`CPU`,size:t?Y(t):null,note:`Works on any machine. A short message takes about 5 seconds.`,active:n===`cpu`,onClick:()=>r(`cpu`)}),(0,I.jsx)(X,{label:`GPU (NVIDIA)`,size:e.cudaBuild?Y(e.cudaBuild.bytes):null,note:i,active:n===`cuda`,onClick:()=>r(`cuda`)})]})]})}function X({label:e,size:t,note:n,active:r,onClick:i}){return(0,I.jsxs)(`button`,{type:`button`,onClick:i,"aria-pressed":r,className:S(`flex-1 rounded-lg border px-4 py-3 text-left transition-colors`,r?`border-primary ring-2 ring-primary`:`border-border hover:bg-muted/50`),children:[(0,I.jsxs)(`span`,{className:`flex items-center justify-between gap-3`,children:[(0,I.jsx)(`span`,{className:`text-sm font-medium`,children:e}),t&&(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t})]}),(0,I.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:n})]})}var Z=e=>e.backend===`cuda`||e.backend===`metal`||e.backend===`gpu`;function _e(e){if(e.backend===null)return e.probing?`Checking whether it can use the GPU…`:`Not checked yet.`;if(Z(e)){let t=e.backend===`cuda`?`CUDA`:e.backend===`metal`?`Metal`:null,n=[e.device,t&&`(${t})`].filter(Boolean).join(` `);return e.useGpu?`Runs on the GPU${n?` — ${n}`:``}.`:`GPU turned off — runs on the CPU.`}return e.installedBuild===`cuda`?`The GPU build is installed but found no GPU it can use, so it runs on the CPU.`:`Runs on the CPU.`}function ve({status:e,onStatus:t}){let n=e.gpu,[r,i]=(0,F.useState)(!1);if(!e.ready||!n)return null;let a=async(e,n,r)=>{i(!0);try{t(await y.post(e,n))}catch(e){v.error(r??`Could not change the GPU setting`,{description:e instanceof Error?e.message:String(e)})}finally{i(!1)}},o=n.installedBuild===`cpu`&&n.cudaBuild;return(0,I.jsxs)(`div`,{className:`space-y-3 rounded-lg border border-border p-3`,children:[(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)(`p`,{className:`flex items-center gap-2 text-sm`,children:[n.probing&&(0,I.jsx)(l,{className:`size-3.5 animate-spin`}),_e(n)]}),o&&(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`This host has `,n.nvidia?.name??`an NVIDIA card`,`. Choose the GPU build below to transcribe in under a second.`]}),n.probeError&&n.installedBuild!==`cpu`&&(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Last check: `,n.probeError]})]}),Z(n)&&(0,I.jsx)(P,{label:`Use GPU`,note:`Off: Whisper leaves the GPU to other work and each message takes several seconds longer.`,checked:n.useGpu,disabled:r,onChange:e=>void a(`/api/speech/gpu`,{useGpu:e})}),n.lastFailure&&n.useGpu&&(0,I.jsxs)(`p`,{className:`text-xs text-warning`,children:[`The GPU failed on `,new Date(n.lastFailure.at).toLocaleString(),` (`,n.lastFailure.message,`), so that message was transcribed on the CPU instead.`]}),n.installedBuild!==`cpu`&&(0,I.jsxs)(w,{variant:`outline`,disabled:r||n.probing,onClick:()=>void a(`/api/speech/gpu/check`,void 0,`Could not check the GPU`),className:S(E,`cursor-pointer`),children:[r?(0,I.jsx)(l,{className:`size-3.5 animate-spin`}):(0,I.jsx)(d,{className:`size-3.5`}),`Check again`]})]})}var ye=`/whisper-test-sample.mp3`;async function Q(e,t,n){let r=_(),i=await fetch(`/api/speech/test?lang=${encodeURIComponent(t)}&device=${n}`,{method:`POST`,headers:{"Content-Type":`audio/wav`,...r?{Authorization:`Bearer ${r}`}:{}},body:e}),a=await i.json().catch(()=>null);if(!i.ok||!a?.ok||!a.data)throw Error(a?.error??`HTTP ${i.status}`);return a.data}function $(e){let t=e/1e3;return`${t<1?t.toFixed(2):t<10?t.toFixed(1):Math.round(t)} s`}function be(e,t){if(e<=0||t<=e)return null;let n=t/e;return`${n<10?n.toFixed(1):Math.round(n)}× faster on the GPU`}function xe(e){let t=e.backend===`cuda`?`CUDA`:e.backend===`metal`?`Metal`:null;return`${e.ranOn===`gpu`?`GPU${e.device?` — ${e.device}`:``}${t?` (${t})`:``}`:e.fellBack?`CPU (the GPU failed, so it ran again on the CPU)`:`CPU`} · ${e.model}`}var Se=`vi`;function Ce({status:e}){let[t,n]=(0,F.useState)(null),[r,i]=(0,F.useState)(null),[a,c]=(0,F.useState)(null),[u,d]=(0,F.useState)(null),[f,p]=(0,F.useState)(0),m=(0,F.useRef)(null),h=async(e,t)=>{m.current={wav:e,lang:t},i(null),c(null),d(null),n(`running`);try{i(await Q(e,t,`default`))}catch(e){d(e instanceof Error?e.message:String(e))}finally{n(null)}},_=M(e=>{n(`running`),j(e.blob).then(e=>h(e,Se)).catch(e=>{d(e instanceof Error?e.message:String(e)),n(null)})});(0,F.useEffect)(()=>{if(!_.recording)return;p(0);let e=Date.now(),t=setInterval(()=>p(Math.floor((Date.now()-e)/1e3)),250),n=setTimeout(()=>_.stop(),15*1e3);return()=>{clearInterval(t),clearTimeout(n)}},[_.recording]),(0,F.useEffect)(()=>()=>{m.current=null,_.cancel()},[]);let v=async()=>{d(null),n(`running`);try{await h(await j(await(await fetch(ye)).blob()),`en`)}catch(e){d(e instanceof Error?e.message:String(e)),n(null)}},y=async()=>{if(m.current){n(`comparing`),d(null);try{c(await Q(m.current.wav,m.current.lang,`cpu`))}catch(e){d(e instanceof Error?e.message:String(e))}finally{n(null)}}};if(!e.ready)return null;let b=_.supported&&typeof window<`u`&&window.isSecureContext,x=r?.ranOn===`gpu`,C=x&&a?be(r.ms,a.ms):null;return(0,I.jsxs)(`div`,{className:`space-y-3 rounded-lg border border-border p-3`,"data-testid":`whisper-test`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`p`,{className:`text-sm font-medium`,children:`Try it`}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Say a sentence and see what Whisper writes and how long it takes. The audio stays on this host and is deleted after the run.`})]}),(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[b&&(_.recording?(0,I.jsxs)(w,{onClick:_.stop,className:S(E,`cursor-pointer`),children:[(0,I.jsx)(o,{className:`size-3.5`}),`Stop · `,f,`s / `,15,`s`]}):(0,I.jsxs)(w,{onClick:()=>void _.start(),disabled:t!==null,className:S(E,`cursor-pointer`),children:[(0,I.jsx)(s,{className:`size-3.5`}),`Record a test`]})),(0,I.jsxs)(w,{variant:`outline`,onClick:()=>void v(),disabled:t!==null||_.recording,className:S(E,`cursor-pointer`),children:[(0,I.jsx)(g,{className:`size-3.5`}),`Use the sample (11 s, English)`]})]}),!b&&(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`The microphone needs HTTPS or localhost here, so only the sample can be used on this page.`}),t===`running`&&(0,I.jsxs)(`p`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,I.jsx)(l,{className:`size-3.5 animate-spin`}),` Transcribing on this host…`]}),u&&(0,I.jsx)(`p`,{className:`text-xs text-error`,children:u}),r&&(0,I.jsxs)(`div`,{className:`space-y-2 rounded-md bg-muted/50 p-3`,"data-testid":`whisper-test-result`,children:[(0,I.jsx)(`p`,{className:`text-sm break-words`,children:r.text||(0,I.jsx)(`span`,{className:`text-muted-foreground`,children:`(no speech heard)`})}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[(0,I.jsx)(`span`,{className:`font-medium text-foreground`,children:$(r.ms)}),` · `,xe(r)]}),a&&(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,"data-testid":`whisper-test-compare`,children:[`Same audio on the CPU: `,(0,I.jsx)(`span`,{className:`font-medium text-foreground`,children:$(a.ms)}),C?` — ${C}`:``]}),x&&!a&&(0,I.jsxs)(w,{variant:`outline`,onClick:()=>void y(),disabled:t!==null,className:S(E,`cursor-pointer`),children:[t===`comparing`&&(0,I.jsx)(l,{className:`size-3.5 animate-spin`}),t===`comparing`?`Running on the CPU…`:`Compare with the CPU`]})]})]})}var we={binary:`Downloading whisper.cpp`,model:`Downloading the model`,vad:`Downloading the voice detector`,verify:`Checking it runs here`,gpu:`Checking the GPU`};function Te(e,t){let n=e.gpu;return!n||n.installedBuild===`system`?null:t||(n.installedBuild?n.installedBuild:n.cudaBuild?`cuda`:`cpu`)}var Ee=e=>`${Math.round(e/1e6)} MB`;function De(){let e=t(e=>e.voiceEngine),n=t(e=>e.setVoiceEngine),[r,i]=(0,F.useState)(null),[a,o]=(0,F.useState)(!1),[s,c]=(0,F.useState)(null),[d,m]=(0,F.useState)(null),[h,g]=(0,F.useState)(!1),_=(0,F.useRef)(null),b=(0,F.useCallback)(async()=>{try{let e=await y.get(`/api/speech/status`);i(e),c(t=>t??e.model?.id??e.models.at(-1)?.id??null)}catch{}},[]);(0,F.useEffect)(()=>{b()},[b]);let x=!!r?.install&&!r.install.done,C=!!r?.gpu?.probing;(0,F.useEffect)(()=>{if(!(!x&&!C))return _.current=setTimeout(()=>void b(),700),()=>{_.current&&clearTimeout(_.current)}},[x,C,r,b]);let[T,E]=(0,F.useState)(!1),D=!!r?.installable;(0,F.useEffect)(()=>{if(!T||D)return;let e=setInterval(()=>{document.visibilityState===`visible`&&b()},4e3),t=setTimeout(()=>E(!1),10*6e4);return()=>{clearInterval(e),clearTimeout(t)}},[T,D,b]),(0,F.useEffect)(()=>{r&&!r.ready&&e===`whisper`&&n(`browser`)},[r,e,n]);let O=r?Te(r,d):null,k=async()=>{if(s){g(!0);try{await y.post(`/api/speech/install`,{model:s,...O?{build:O}:{}}),m(null),await b()}catch(e){v.error(`Could not start the install`,{description:e instanceof Error?e.message:String(e)})}finally{g(!1)}}},A=async()=>{g(!0);try{await y.post(`/api/speech/uninstall`),n(`browser`),await b()}catch(e){v.error(`Could not remove Whisper`,{description:e instanceof Error?e.message:String(e)})}finally{g(!1)}},j=r?.install??null,M=j&&j.totalBytes>0?Math.round(j.receivedBytes/j.totalBytes*100):null,N=r?.gpu?.installedBuild??null,P=!!O&&(N===`cpu`||N===`cuda`)&&O!==N,L=!!r?.model&&r.model.id!==s,R=O===`cuda`?`GPU build`:`CPU build`,z=r?.ready?L?`Switch to ${r.models.find(e=>e.id===s)?.label}${P?` (${R})`:``}`:P?`Switch to the ${R}`:`Installed`:`Install`,B=typeof window<`u`&&!window.isSecureContext;return(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsx)(me,{onEnabledChange:o}),!a&&(0,I.jsxs)(`section`,{className:`space-y-3`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h3`,{className:`text-sm font-medium`,children:`Speech to text`}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`What the mic button in the chat box uses. This device only.`})]}),(0,I.jsxs)(`div`,{className:`flex flex-col sm:flex-row gap-2`,children:[(0,I.jsx)(Oe,{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,I.jsx)(Oe,{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})]}),B&&(0,I.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,I.jsx)(ee,{}),(0,I.jsxs)(`section`,{className:`space-y-3`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h3`,{className:`text-sm font-medium`,children:`Whisper on this host`}),(0,I.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&&(0,I.jsx)(ve,{status:r,onStatus:i}),r&&!x&&(0,I.jsx)(Ce,{status:r}),r&&!r.installable&&(r.installHint?(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`There is no prebuilt whisper.cpp for this platform, so it comes from Homebrew:`,` `,(0,I.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,I.jsx)(te,{command:r.installHint,label:`Install with Homebrew`,onRun:()=>E(!0)})]}):(0,I.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,I.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5`,children:`whisper-cli on PATH`})]})),j&&!j.done&&(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,I.jsx)(l,{className:`size-3.5 animate-spin`}),(0,I.jsxs)(`span`,{children:[we[j.phase],j.phase===`binary`&&j.build===`cuda`?` (GPU build)`:``,M===null||j.phase===`gpu`?`…`:` — ${M}%`]})]}),(0,I.jsx)(`div`,{className:`h-1.5 w-full overflow-hidden rounded-full bg-muted`,children:(0,I.jsx)(`div`,{className:`h-full bg-primary transition-[width]`,style:{width:`${M??0}%`}})})]}),j?.error&&(0,I.jsx)(`p`,{className:`text-xs text-error`,children:j.error}),r?.installable&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`div`,{className:`space-y-2`,children:r.models.map(e=>{let t=s===e.id,n=r.model?.id===e.id;return(0,I.jsxs)(`button`,{type:`button`,onClick:()=>c(e.id),className:S(`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,I.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,I.jsx)(`span`,{className:`text-sm font-medium`,children:e.label}),(0,I.jsxs)(`span`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[n&&(0,I.jsx)(p,{className:`size-3.5 text-success`}),Ee(e.bytes)]})]}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.note})]},e.id)})}),r.gpu&&O&&(0,I.jsx)(ge,{gpu:r.gpu,cpuBytes:r.cpuBuildBytes??null,value:O,onChange:m}),(0,I.jsxs)(`div`,{className:`flex flex-col sm:flex-row gap-2`,children:[(0,I.jsxs)(w,{onClick:k,disabled:h||x||!s||r.ready&&!L&&!P,className:`flex-1 gap-2 cursor-pointer`,children:[(0,I.jsx)(f,{className:`size-4`}),z]}),(r.model||r.binary?.source===`bundled`)&&(0,I.jsxs)(w,{variant:`outline`,onClick:A,disabled:h||x,className:`gap-2 cursor-pointer text-error`,children:[(0,I.jsx)(u,{className:`size-4`}),`Remove`]})]})]})]})]})}function Oe({label:e,note:t,value:n,current:r,onChange:i}){return(0,I.jsxs)(`button`,{type:`button`,onClick:()=>i(n),className:S(`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,I.jsxs)(`span`,{className:`flex items-center gap-2 text-sm font-medium`,children:[(0,I.jsx)(s,{className:`size-4`}),e]}),(0,I.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:t})]})}export{De as VoiceSettingsSection};
@@ -0,0 +1 @@
1
+ var e=Object.freeze({maxTabs:4,idleStopMinutes:10,autoFps:!0,fpsCap:12,jpegQuality:55,allowLocalhost:!0,allowLan:!0,allowPublicTunnel:!0,audio:!0,aiControl:!0,browserPath:null}),t={saver:{autoFps:!1,fpsCap:8,jpegQuality:45},balanced:{autoFps:!1,fpsCap:12,jpegQuality:55},smooth:{autoFps:!1,fpsCap:20,jpegQuality:65}};export{t as n,e as t};
@@ -0,0 +1 @@
1
+ import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import"./settings-store-DirmJxtu.js";import{D as t,E as n}from"./vendor-markdown-26eoXJk7.js";import"./vendor-ui-BQzUk4nq.js";import{Kt as r,r as i}from"./icons-CpR5Vw3J.js";import{j as a,r as o}from"./api-client-DSCscZEd.js";import"./window-store-Bl6ySrZZ.js";import"./panel-store-B5zTGca0.js";import"./project-store-BaGmhKos.js";import"./project-framework-store-vI8djw4a.js";import"./session-list-sync-triggers-_I5gGBSe.js";import"./tab-store-CdpGgbmw.js";import"./use-is-mobile-CrfIt67b.js";import"./settings-categories-B_629iML.js";import"./open-settings-CGqVSUo5.js";import{Qn as s,_n as c,hn as l}from"./index-ix3m5QQT.js";import{n as u}from"./web-browser-settings-BZVtGZ79.js";import{i as d}from"./web-browser-button-styles-ByWVMgQh.js";var f=e(t(),1),p=n();function m(e){return(0,p.jsxs)(`label`,{className:`flex items-start gap-3 py-1.5 cursor-pointer`,children:[(0,p.jsxs)(`div`,{className:`flex-1`,children:[(0,p.jsx)(`div`,{className:`text-sm`,children:e.title}),e.body&&(0,p.jsx)(`div`,{className:`text-xs text-muted-foreground leading-relaxed`,children:e.body})]}),(0,p.jsx)(s,{checked:e.checked,disabled:e.disabled,onCheckedChange:e.onChange,className:`mt-1`})]})}var h=`flex gap-2 rounded-md bg-warning/10 px-3 py-2 text-xs leading-relaxed`;function g(){let[e,t]=(0,f.useState)(null),n=(0,f.useCallback)(async()=>{try{t(await o.get(`/api/web-browser/capabilities`))}catch{}},[]);(0,f.useEffect)(()=>{n()},[n]);let s=async n=>{if(e)try{let r=await o.put(`/api/web-browser/settings`,{...e.settings,...n});t({...e,settings:r}),c()}catch(e){a.error(`Could not save`,{description:e instanceof Error?e.message:String(e)})}};if(!e)return(0,p.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:`Loading…`});let g=e.settings,_=e.publicRequest,v=g.autoFps?`auto`:Object.entries(u).find(([,e])=>e.fpsCap===g.fpsCap&&e.jpegQuality===g.jpegQuality)?.[0]??`custom`;return(0,p.jsxs)(`div`,{className:`space-y-6`,children:[(0,p.jsxs)(`section`,{className:`space-y-2`,children:[(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`h3`,{className:`text-sm font-medium`,children:`Web browser`}),(0,p.jsx)(`p`,{className:`text-xs text-muted-foreground leading-relaxed`,children:`A Chrome that runs on this host, shown in a PPM window (a tab on a phone). It uses its own profile: no logins shared with your Chrome or with AI chats' Playwright.`})]}),(0,p.jsx)(m,{title:`Turn on the web browser`,checked:g.enabled===!0,onChange:e=>void s({enabled:e})}),g.enabled===!0&&(0,p.jsxs)(`button`,{type:`button`,className:d,onClick:l,children:[(0,p.jsx)(r,{}),`Open the browser`]}),e.browsers.length===0?(0,p.jsxs)(`p`,{className:h,children:[(0,p.jsx)(i,{className:`size-4 shrink-0`}),`No Chrome or Edge found on this host. `,e.installHint]}):(0,p.jsxs)(`label`,{className:`flex items-center gap-3 py-1 text-sm`,children:[(0,p.jsx)(`span`,{className:`flex-1`,children:`Browser on this host`}),(0,p.jsx)(`select`,{className:`min-h-9 rounded-md border border-border bg-panel px-2 text-sm`,disabled:_,value:g.browserPath??e.browsers[0].path,onChange:e=>void s({browserPath:e.target.value}),children:e.browsers.map(e=>(0,p.jsxs)(`option`,{value:e.path,children:[e.name,` `,e.version]},e.path))})]})]}),(0,p.jsxs)(`section`,{className:`space-y-2`,children:[(0,p.jsx)(`h3`,{className:`text-sm font-medium`,children:`Memory`}),(0,p.jsxs)(`label`,{className:`flex items-center gap-3 py-1 text-sm`,children:[(0,p.jsxs)(`span`,{className:`flex-1`,children:[`Most tabs at once `,(0,p.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`(each page costs 100–500 MB)`})]}),(0,p.jsx)(`input`,{type:`number`,min:1,max:8,value:g.maxTabs,onChange:e=>void s({maxTabs:Number(e.target.value)}),className:`w-20 min-h-9 rounded-md border border-border bg-panel px-2`})]}),(0,p.jsxs)(`label`,{className:`flex items-center gap-3 py-1 text-sm`,children:[(0,p.jsx)(`span`,{className:`flex-1`,children:`Stop the browser after this many minutes unused`}),(0,p.jsx)(`input`,{type:`number`,min:2,max:120,value:g.idleStopMinutes,onChange:e=>void s({idleStopMinutes:Number(e.target.value)}),className:`w-20 min-h-9 rounded-md border border-border bg-panel px-2`})]}),(0,p.jsxs)(`label`,{className:`flex items-center gap-3 py-1 text-sm`,children:[(0,p.jsxs)(`span`,{className:`flex-1`,children:[`Picture `,(0,p.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`(more frames cost more bandwidth)`})]}),(0,p.jsxs)(`select`,{value:v,onChange:e=>{if(e.target.value===`auto`)return void s({autoFps:!0});let t=u[e.target.value];t&&s(t)},className:`min-h-9 rounded-md border border-border bg-panel px-2 text-sm`,children:[(0,p.jsxs)(`option`,{value:`auto`,children:[`Auto (up to `,30,` fps, follows the connection)`]}),(0,p.jsx)(`option`,{value:`saver`,children:`Saver (8 fps)`}),(0,p.jsx)(`option`,{value:`balanced`,children:`Balanced (12 fps)`}),(0,p.jsx)(`option`,{value:`smooth`,children:`Smooth (20 fps)`}),v===`custom`&&(0,p.jsxs)(`option`,{value:`custom`,children:[`Custom (`,g.fpsCap,` fps)`]})]})]}),(0,p.jsx)(m,{title:`Sound`,body:`Pages' sound plays on the device you view from; the host's speakers stay silent.`,checked:g.audio,onChange:e=>void s({audio:e})})]}),(0,p.jsxs)(`section`,{className:`space-y-2`,children:[(0,p.jsx)(`h3`,{className:`text-sm font-medium`,children:`What it may reach`}),_&&(0,p.jsxs)(`p`,{className:h,children:[(0,p.jsx)(i,{className:`size-4 shrink-0`}),`You are on a public link: these can only be changed from the LAN or Tailscale.`]}),(0,p.jsx)(m,{title:`Services on this machine (localhost)`,disabled:_,checked:g.allowLocalhost,body:`Dev servers and local tools. PPM's own ports are always blocked.`,onChange:e=>void s({allowLocalhost:e})}),(0,p.jsx)(m,{title:`Devices on your network (LAN)`,disabled:_,checked:g.allowLan,body:`Router, NAS, printers. Cloud metadata addresses are always blocked.`,onChange:e=>void s({allowLan:e})}),(0,p.jsx)(m,{title:`Use it over a public link`,disabled:_,checked:g.allowPublicTunnel,body:`When off, the browser opens only from the LAN or Tailscale.`,onChange:e=>void s({allowPublicTunnel:e})}),(0,p.jsx)(m,{title:`Let AI chats drive it`,disabled:_,checked:g.aiControl,body:`Each chat asks you once before it first uses the browser; you can take it back at any time.`,onChange:e=>void s({aiControl:e})}),g.allowPublicTunnel&&(g.allowLocalhost||g.allowLan)&&(0,p.jsxs)(`p`,{className:h,children:[(0,p.jsx)(i,{className:`size-4 shrink-0`}),`With a public link on, anyone holding PPM's password over the Internet can use this browser to open`,g.allowLocalhost&&g.allowLan?` this machine's local services and the devices on your home network`:g.allowLocalhost?` this machine's local services`:` the devices on your home network`,`.`]}),g.aiControl&&(0,p.jsxs)(`p`,{className:h,children:[(0,p.jsx)(i,{className:`size-4 shrink-0`}),`A page can try to talk an AI into clicking things on sites this browser is signed in to.`]})]}),(0,p.jsxs)(`section`,{className:`space-y-2`,children:[(0,p.jsx)(`h3`,{className:`text-sm font-medium`,children:`Data`}),(0,p.jsx)(`button`,{type:`button`,className:d,onClick:async()=>{window.confirm(`Clear the browser's logins, history and downloads on the host?`)&&(await o.post(`/api/web-browser/clear-data`),a.success(`Browsing data cleared`))},children:`Clear browsing data…`})]})]})}export{g as WebBrowserSettingsSection};
@@ -1 +1 @@
1
- import"./settings-store-DirmJxtu.js";import{E as e}from"./vendor-markdown-26eoXJk7.js";import"./vendor-ui-BQzUk4nq.js";import"./icons-CpR5Vw3J.js";import"./api-client-DSCscZEd.js";import"./portal-container-context-C84rlnJ6.js";import"./window-store-Bl6ySrZZ.js";import"./panel-store-B5zTGca0.js";import"./project-store-BaGmhKos.js";import"./project-framework-store-vI8djw4a.js";import"./session-list-sync-triggers-_I5gGBSe.js";import"./tab-store-CdpGgbmw.js";import"./mobile-bottom-sheet-C78UMLrn.js";import"./use-visual-viewport-tMLO63yY.js";import{n as t}from"./use-is-mobile-CrfIt67b.js";import"./settings-categories-B_629iML.js";import"./open-settings-CGqVSUo5.js";import"./ws-auth-BoXvat-e.js";import"./web-browser-button-styles-ByWVMgQh.js";import{t as n}from"./web-browser-view-8xcUIVkn.js";var r=e();function i(){return(0,r.jsx)(n,{phone:t()})}export{i as WebBrowserTab};
1
+ import"./settings-store-DirmJxtu.js";import{E as e}from"./vendor-markdown-26eoXJk7.js";import"./vendor-ui-BQzUk4nq.js";import"./icons-CpR5Vw3J.js";import"./api-client-DSCscZEd.js";import"./portal-container-context-C84rlnJ6.js";import"./window-store-Bl6ySrZZ.js";import"./panel-store-B5zTGca0.js";import"./project-store-BaGmhKos.js";import"./project-framework-store-vI8djw4a.js";import"./session-list-sync-triggers-_I5gGBSe.js";import"./tab-store-CdpGgbmw.js";import"./mobile-bottom-sheet-C78UMLrn.js";import"./use-visual-viewport-tMLO63yY.js";import{n as t}from"./use-is-mobile-CrfIt67b.js";import"./settings-categories-B_629iML.js";import"./open-settings-CGqVSUo5.js";import"./ws-auth-BoXvat-e.js";import"./web-browser-button-styles-ByWVMgQh.js";import{t as n}from"./web-browser-view-DzyPBSfd.js";var r=e();function i(){return(0,r.jsx)(n,{phone:t()})}export{i as WebBrowserTab};