@hienlh/ppm 0.23.8 → 0.23.10

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 (448) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/CLAUDE.md +4 -0
  3. package/assets/skills/ppm/SKILL.md +1 -1
  4. package/assets/skills/ppm/references/cli-reference.md +4 -4
  5. package/assets/skills/ppm/references/http-api.md +1 -1
  6. package/dist/web/assets/accounts-settings-section-BOBJbG7i.js +1 -0
  7. package/dist/web/assets/accounts-settings-section-BOBJbG7i.js.br +0 -0
  8. package/dist/web/assets/accounts-settings-section-BOBJbG7i.js.gz +0 -0
  9. package/dist/web/assets/agent-session-sheet-CjD4hBZV.js +2 -0
  10. package/dist/web/assets/agent-session-sheet-CjD4hBZV.js.br +0 -0
  11. package/dist/web/assets/agent-session-sheet-CjD4hBZV.js.gz +0 -0
  12. package/dist/web/assets/agent-session-sheet-store-BcQbnaV2.js +1 -0
  13. package/dist/web/assets/agent-session-window-content-Drm1HsSn.js +1 -0
  14. package/dist/web/assets/agent-session-window-content-Drm1HsSn.js.br +0 -0
  15. package/dist/web/assets/agent-session-window-content-Drm1HsSn.js.gz +0 -0
  16. package/dist/web/assets/{ai-resource-editor-DfVRMUHS.js → ai-resource-editor-M1Eax2Hc.js} +1 -1
  17. package/dist/web/assets/ai-resource-editor-M1Eax2Hc.js.br +0 -0
  18. package/dist/web/assets/ai-resource-editor-M1Eax2Hc.js.gz +0 -0
  19. package/dist/web/assets/ai-settings-section-B73t9SXm.js +1 -0
  20. package/dist/web/assets/{ai-settings-section-Ezhw4Fef.js → ai-settings-section-H173dm1k.js} +1 -1
  21. package/dist/web/assets/ai-settings-section-H173dm1k.js.br +0 -0
  22. package/dist/web/assets/ai-settings-section-H173dm1k.js.gz +0 -0
  23. package/dist/web/assets/{api-settings-tYKJ5Fqk.js → api-settings-BA_n8cPt.js} +1 -1
  24. package/dist/web/assets/{appearance-settings-section-CPOAp0fY.js → appearance-settings-section-Dqu20pt8.js} +1 -1
  25. package/dist/web/assets/appearance-settings-section-Dqu20pt8.js.br +0 -0
  26. package/dist/web/assets/appearance-settings-section-Dqu20pt8.js.gz +0 -0
  27. package/dist/web/assets/{apps-panel-Cz7_o-M4.js → apps-panel-mkrzY7K0.js} +1 -1
  28. package/dist/web/assets/apps-panel-mkrzY7K0.js.br +0 -0
  29. package/dist/web/assets/apps-panel-mkrzY7K0.js.gz +0 -0
  30. package/dist/web/assets/branch-review-tab-Dw3bNixU.js +1 -0
  31. package/dist/web/assets/branch-review-tab-Dw3bNixU.js.br +0 -0
  32. package/dist/web/assets/branch-review-tab-Dw3bNixU.js.gz +0 -0
  33. package/dist/web/assets/chat-tab-BAbcVFzD.js +15 -0
  34. package/dist/web/assets/chat-tab-BAbcVFzD.js.br +0 -0
  35. package/dist/web/assets/chat-tab-BAbcVFzD.js.gz +0 -0
  36. package/dist/web/assets/chat-tab-BaXGaBEC.js +1 -0
  37. package/dist/web/assets/chat-tab-BaXGaBEC.js.br +4 -0
  38. package/dist/web/assets/chat-tab-BaXGaBEC.js.gz +0 -0
  39. package/dist/web/assets/code-editor-CXLANXnI.js +7 -0
  40. package/dist/web/assets/code-editor-CXLANXnI.js.br +0 -0
  41. package/dist/web/assets/code-editor-CXLANXnI.js.gz +0 -0
  42. package/dist/web/assets/{codex-reset-credit-button-D2hal4bG.js → codex-reset-credit-button-CB8Dfhki.js} +1 -1
  43. package/dist/web/assets/codex-reset-credit-button-CB8Dfhki.js.br +0 -0
  44. package/dist/web/assets/codex-reset-credit-button-CB8Dfhki.js.gz +0 -0
  45. package/dist/web/assets/{conflict-editor-Cj_gUncw.js → conflict-editor-CKsxIw3v.js} +2 -2
  46. package/dist/web/assets/conflict-editor-CKsxIw3v.js.br +0 -0
  47. package/dist/web/assets/conflict-editor-CKsxIw3v.js.gz +0 -0
  48. package/dist/web/assets/{csv-preview-Be3ODNj0.js → csv-preview-U0v_r_-7.js} +1 -1
  49. package/dist/web/assets/csv-preview-U0v_r_-7.js.br +0 -0
  50. package/dist/web/assets/csv-preview-U0v_r_-7.js.gz +0 -0
  51. package/dist/web/assets/{database-viewer-B1b--4y8.js → database-viewer-xQyUcBoL.js} +1 -1
  52. package/dist/web/assets/database-viewer-xQyUcBoL.js.br +0 -0
  53. package/dist/web/assets/database-viewer-xQyUcBoL.js.gz +0 -0
  54. package/dist/web/assets/{design-tab-8wi0IHss.js → design-tab-aaAt2_QE.js} +4 -4
  55. package/dist/web/assets/design-tab-aaAt2_QE.js.br +0 -0
  56. package/dist/web/assets/design-tab-aaAt2_QE.js.gz +0 -0
  57. package/dist/web/assets/{designs-sidebar-panel-D5-1Q8zQ.js → designs-sidebar-panel-CTzO4Thu.js} +1 -1
  58. package/dist/web/assets/designs-sidebar-panel-CTzO4Thu.js.br +0 -0
  59. package/dist/web/assets/designs-sidebar-panel-CTzO4Thu.js.gz +0 -0
  60. package/dist/web/assets/{diff-viewer-Dcxk6UTG.js → diff-viewer-CSE2-OE7.js} +1 -1
  61. package/dist/web/assets/diff-viewer-CSE2-OE7.js.br +0 -0
  62. package/dist/web/assets/diff-viewer-CSE2-OE7.js.gz +0 -0
  63. package/dist/web/assets/{edit-diff-preview-DxDAtYhi.js → edit-diff-preview-gH6pRk4S.js} +1 -1
  64. package/dist/web/assets/edit-diff-preview-gH6pRk4S.js.br +0 -0
  65. package/dist/web/assets/{edit-diff-preview-DxDAtYhi.js.gz → edit-diff-preview-gH6pRk4S.js.gz} +0 -0
  66. package/dist/web/assets/{editor-language-service-BVJQnTSV.js → editor-language-service-CYl04pUy.js} +1 -1
  67. package/dist/web/assets/editor-language-service-CYl04pUy.js.br +0 -0
  68. package/dist/web/assets/editor-language-service-CYl04pUy.js.gz +0 -0
  69. package/dist/web/assets/explorer-body-BBOcvwmV.js +2 -0
  70. package/dist/web/assets/explorer-body-BBOcvwmV.js.br +0 -0
  71. package/dist/web/assets/explorer-body-BBOcvwmV.js.gz +0 -0
  72. package/dist/web/assets/{explorer-window-content-DH5AD3Ng.js → explorer-window-content-juCGcrkc.js} +1 -1
  73. package/dist/web/assets/explorer-window-content-juCGcrkc.js.br +0 -0
  74. package/dist/web/assets/explorer-window-content-juCGcrkc.js.gz +0 -0
  75. package/dist/web/assets/{extension-manager-section-BJr6ccWw.js → extension-manager-section-poMRmwvg.js} +1 -1
  76. package/dist/web/assets/extension-manager-section-poMRmwvg.js.br +0 -0
  77. package/dist/web/assets/extension-manager-section-poMRmwvg.js.gz +0 -0
  78. package/dist/web/assets/{extension-webview-CYNXHd8D.js → extension-webview-0QfzTI6s.js} +1 -1
  79. package/dist/web/assets/extension-webview-0QfzTI6s.js.br +0 -0
  80. package/dist/web/assets/extension-webview-0QfzTI6s.js.gz +0 -0
  81. package/dist/web/assets/{files-settings-section-JX7o4lex.js → files-settings-section-DJptxRgH.js} +1 -1
  82. package/dist/web/assets/files-settings-section-DJptxRgH.js.br +0 -0
  83. package/dist/web/assets/files-settings-section-DJptxRgH.js.gz +0 -0
  84. package/dist/web/assets/{general-settings-section-kF94Mz5q.js → general-settings-section-BFNbdDNv.js} +1 -1
  85. package/dist/web/assets/general-settings-section-BFNbdDNv.js.br +0 -0
  86. package/dist/web/assets/general-settings-section-BFNbdDNv.js.gz +0 -0
  87. package/dist/web/assets/{git-log-panel-Crlp9ofM.js → git-log-panel-SMMIbjSe.js} +1 -1
  88. package/dist/web/assets/git-log-panel-SMMIbjSe.js.br +0 -0
  89. package/dist/web/assets/git-log-panel-SMMIbjSe.js.gz +0 -0
  90. package/dist/web/assets/{glide-data-grid-O6MO5dKU.js → glide-data-grid-DZVmgu0T.js} +3 -3
  91. package/dist/web/assets/glide-data-grid-DZVmgu0T.js.br +0 -0
  92. package/dist/web/assets/glide-data-grid-DZVmgu0T.js.gz +0 -0
  93. package/dist/web/assets/group-chat-tab-d_aaYuK_.js +1 -0
  94. package/dist/web/assets/group-chat-tab-d_aaYuK_.js.br +0 -0
  95. package/dist/web/assets/group-chat-tab-d_aaYuK_.js.gz +0 -0
  96. package/dist/web/assets/{index-DQCw6d-2.js → index-CIscPw4g.js} +6 -6
  97. package/dist/web/assets/index-CIscPw4g.js.br +0 -0
  98. package/dist/web/assets/index-CIscPw4g.js.gz +0 -0
  99. package/dist/web/assets/{jira-watcher-section-DwM7gqHT.js → jira-watcher-section-CsbhnLLn.js} +1 -1
  100. package/dist/web/assets/keybindings-store-BPs0pM0r.js +1 -0
  101. package/dist/web/assets/{keyboard-shortcuts-section-CewWGwiF.js → keyboard-shortcuts-section-CXqc2OtM.js} +1 -1
  102. package/dist/web/assets/keyboard-shortcuts-section-CXqc2OtM.js.br +0 -0
  103. package/dist/web/assets/keyboard-shortcuts-section-CXqc2OtM.js.gz +0 -0
  104. package/dist/web/assets/{language-servers-section-nricdxke.js → language-servers-section-B4FsBVvZ.js} +2 -2
  105. package/dist/web/assets/language-servers-section-B4FsBVvZ.js.br +0 -0
  106. package/dist/web/assets/language-servers-section-B4FsBVvZ.js.gz +0 -0
  107. package/dist/web/assets/{lsp-client-DRMEWb-z.js → lsp-client-MQ4mjDfT.js} +1 -1
  108. package/dist/web/assets/lsp-client-MQ4mjDfT.js.br +0 -0
  109. package/dist/web/assets/lsp-client-MQ4mjDfT.js.gz +0 -0
  110. package/dist/web/assets/markdown-renderer-BvCZZlue.js +1 -0
  111. package/dist/web/assets/{markdown-renderer-Dab9Us6u.js → markdown-renderer-CjPb5pns.js} +3 -3
  112. package/dist/web/assets/markdown-renderer-CjPb5pns.js.br +0 -0
  113. package/dist/web/assets/markdown-renderer-CjPb5pns.js.gz +0 -0
  114. package/dist/web/assets/{mobile-explorer-sheet-DtgdpvJ9.js → mobile-explorer-sheet-0aGhVQtI.js} +1 -1
  115. package/dist/web/assets/mobile-explorer-sheet-0aGhVQtI.js.br +0 -0
  116. package/dist/web/assets/mobile-explorer-sheet-0aGhVQtI.js.gz +0 -0
  117. package/dist/web/assets/{new-design-dialog-Dd5KDB_p.js → new-design-dialog-2oT2oc_F.js} +1 -1
  118. package/dist/web/assets/new-design-dialog-2oT2oc_F.js.br +0 -0
  119. package/dist/web/assets/new-design-dialog-2oT2oc_F.js.gz +0 -0
  120. package/dist/web/assets/notification-store-Dd25PMPQ.js +1 -0
  121. package/dist/web/assets/{panel-store-DrSH3Nhp.js → panel-store-1X6yM3XZ.js} +1 -1
  122. package/dist/web/assets/panel-store-1X6yM3XZ.js.br +0 -0
  123. package/dist/web/assets/panel-store-1X6yM3XZ.js.gz +0 -0
  124. package/dist/web/assets/performance-panel-Ub96qrEH.js +3 -0
  125. package/dist/web/assets/performance-panel-Ub96qrEH.js.br +0 -0
  126. package/dist/web/assets/performance-panel-Ub96qrEH.js.gz +0 -0
  127. package/dist/web/assets/{ppmbot-settings-section-D67u6gPi.js → ppmbot-settings-section-CPMGP66g.js} +1 -1
  128. package/dist/web/assets/ppmbot-settings-section-CPMGP66g.js.br +0 -0
  129. package/dist/web/assets/ppmbot-settings-section-CPMGP66g.js.gz +0 -0
  130. package/dist/web/assets/{problems-panel-DKgIw4uZ.js → problems-panel-CWwzZIP3.js} +1 -1
  131. package/dist/web/assets/problems-panel-CWwzZIP3.js.br +0 -0
  132. package/dist/web/assets/problems-panel-CWwzZIP3.js.gz +0 -0
  133. package/dist/web/assets/process-table-BwPws3zS.js +1 -0
  134. package/dist/web/assets/process-table-BwPws3zS.js.br +0 -0
  135. package/dist/web/assets/process-table-BwPws3zS.js.gz +0 -0
  136. package/dist/web/assets/{proxy-settings-section-CFiYcTBA.js → proxy-settings-section-nS8VbxI_.js} +1 -1
  137. package/dist/web/assets/proxy-settings-section-nS8VbxI_.js.br +0 -0
  138. package/dist/web/assets/proxy-settings-section-nS8VbxI_.js.gz +0 -0
  139. package/dist/web/assets/{query-audit-section-BybgiPsc.js → query-audit-section-Dv5Pxn-w.js} +1 -1
  140. package/dist/web/assets/query-audit-section-Dv5Pxn-w.js.br +0 -0
  141. package/dist/web/assets/query-audit-section-Dv5Pxn-w.js.gz +0 -0
  142. package/dist/web/assets/{remote-desktop-clipboard-notice-Bs3fZSRw.js → remote-desktop-clipboard-notice-DEbdu0hC.js} +1 -1
  143. package/dist/web/assets/remote-desktop-clipboard-notice-DEbdu0hC.js.br +0 -0
  144. package/dist/web/assets/remote-desktop-clipboard-notice-DEbdu0hC.js.gz +0 -0
  145. package/dist/web/assets/remote-desktop-mobile-sheet-BJm-akVY.js +2 -0
  146. package/dist/web/assets/remote-desktop-mobile-sheet-BJm-akVY.js.br +0 -0
  147. package/dist/web/assets/remote-desktop-mobile-sheet-BJm-akVY.js.gz +0 -0
  148. package/dist/web/assets/{remote-desktop-mobile-view-DgGOfPVY.js → remote-desktop-mobile-view-DPdGFD6C.js} +1 -1
  149. package/dist/web/assets/remote-desktop-mobile-view-DPdGFD6C.js.br +0 -0
  150. package/dist/web/assets/remote-desktop-mobile-view-DPdGFD6C.js.gz +0 -0
  151. package/dist/web/assets/{remote-desktop-readiness-gate-DOWryrQx.js → remote-desktop-readiness-gate-DV7YgSpP.js} +1 -1
  152. package/dist/web/assets/remote-desktop-readiness-gate-DV7YgSpP.js.br +0 -0
  153. package/dist/web/assets/remote-desktop-readiness-gate-DV7YgSpP.js.gz +0 -0
  154. package/dist/web/assets/remote-desktop-window-content-BktcWMjD.js +1 -0
  155. package/dist/web/assets/remote-desktop-window-content-BktcWMjD.js.br +0 -0
  156. package/dist/web/assets/remote-desktop-window-content-BktcWMjD.js.gz +0 -0
  157. package/dist/web/assets/{run-in-terminal-Cdn9PaAl.js → run-in-terminal-B_PCeBqG.js} +1 -1
  158. package/dist/web/assets/{schedules-settings-section-DGhG-b5O.js → schedules-settings-section-B3HYKSVh.js} +1 -1
  159. package/dist/web/assets/schedules-settings-section-B3HYKSVh.js.br +0 -0
  160. package/dist/web/assets/schedules-settings-section-B3HYKSVh.js.gz +0 -0
  161. package/dist/web/assets/{send-to-chat-B09VjsB5.js → send-to-chat-Bjg6c8Ld.js} +1 -1
  162. package/dist/web/assets/send-to-chat-Bjg6c8Ld.js.br +0 -0
  163. package/dist/web/assets/send-to-chat-Bjg6c8Ld.js.gz +0 -0
  164. package/dist/web/assets/{services-panel-0klE3O4g.js → services-panel-D6k6AVS4.js} +1 -1
  165. package/dist/web/assets/services-panel-D6k6AVS4.js.br +0 -0
  166. package/dist/web/assets/services-panel-D6k6AVS4.js.gz +0 -0
  167. package/dist/web/assets/{settings-body-CfqpqFfq.js → settings-body-Cu0mNA5x.js} +2 -2
  168. package/dist/web/assets/settings-body-Cu0mNA5x.js.br +0 -0
  169. package/dist/web/assets/settings-body-Cu0mNA5x.js.gz +0 -0
  170. package/dist/web/assets/{settings-store-3jIBB8gx.js → settings-store-DIV25PM_.js} +2 -2
  171. package/dist/web/assets/settings-store-DIV25PM_.js.br +0 -0
  172. package/dist/web/assets/settings-store-DIV25PM_.js.gz +0 -0
  173. package/dist/web/assets/{settings-tab-CHweH5Nh.js → settings-tab-C-A6RNQ3.js} +1 -1
  174. package/dist/web/assets/{settings-window-content-C6Od3qV7.js → settings-window-content-48e5FJAq.js} +1 -1
  175. package/dist/web/assets/{sql-query-editor-ALQ5_X0j.js → sql-query-editor-CgGWYu9K.js} +1 -1
  176. package/dist/web/assets/sql-query-editor-CgGWYu9K.js.br +0 -0
  177. package/dist/web/assets/sql-query-editor-CgGWYu9K.js.gz +0 -0
  178. package/dist/web/assets/{sqlite-viewer-DKTty_jR.js → sqlite-viewer-Co1Oi3dv.js} +1 -1
  179. package/dist/web/assets/sqlite-viewer-Co1Oi3dv.js.br +0 -0
  180. package/dist/web/assets/sqlite-viewer-Co1Oi3dv.js.gz +0 -0
  181. package/dist/web/assets/{system-monitor-body-D6J6lq7-.js → system-monitor-body-DxPKVa-W.js} +2 -2
  182. package/dist/web/assets/system-monitor-body-DxPKVa-W.js.br +0 -0
  183. package/dist/web/assets/system-monitor-body-DxPKVa-W.js.gz +0 -0
  184. package/dist/web/assets/system-monitor-tab-4miOZuQQ.js +1 -0
  185. package/dist/web/assets/{system-monitor-window-content-D1t30f32.js → system-monitor-window-content-B-A7DdML.js} +1 -1
  186. package/dist/web/assets/{tab-host-window-content-DTcx2D0O.js → tab-host-window-content-CChcpg1v.js} +1 -1
  187. package/dist/web/assets/tab-host-window-content-CChcpg1v.js.br +0 -0
  188. package/dist/web/assets/tab-host-window-content-CChcpg1v.js.gz +0 -0
  189. package/dist/web/assets/{tab-store-CUPgQIQz.js → tab-store-D33icgdA.js} +1 -1
  190. package/dist/web/assets/{terminal-tab-DgTfQKBI.js → terminal-tab-BDqlyBLK.js} +2 -2
  191. package/dist/web/assets/terminal-tab-BDqlyBLK.js.br +0 -0
  192. package/dist/web/assets/terminal-tab-BDqlyBLK.js.gz +0 -0
  193. package/dist/web/assets/tool-cards-iJ8tyrLq.js +9 -0
  194. package/dist/web/assets/tool-cards-iJ8tyrLq.js.br +0 -0
  195. package/dist/web/assets/tool-cards-iJ8tyrLq.js.gz +0 -0
  196. package/dist/web/assets/{use-inline-blame-Dv111BKY.js → use-inline-blame-D9js570a.js} +4 -4
  197. package/dist/web/assets/use-inline-blame-D9js570a.js.br +0 -0
  198. package/dist/web/assets/use-inline-blame-D9js570a.js.gz +0 -0
  199. package/dist/web/assets/{use-lsp-CZTFJIXX.js → use-lsp-BYtylZId.js} +1 -1
  200. package/dist/web/assets/use-lsp-BYtylZId.js.br +0 -0
  201. package/dist/web/assets/use-lsp-BYtylZId.js.gz +0 -0
  202. package/dist/web/assets/{use-monaco-theme-DL2dIG5L.js → use-monaco-theme-DJ8y_7IZ.js} +1 -1
  203. package/dist/web/assets/{use-process-kill-D7D9QvJG.js → use-process-kill-BS84S-kD.js} +1 -1
  204. package/dist/web/assets/use-process-kill-BS84S-kD.js.br +0 -0
  205. package/dist/web/assets/use-process-kill-BS84S-kD.js.gz +0 -0
  206. package/dist/web/assets/{use-websocket-ziY-Gz_B.js → use-websocket-Mqj27umG.js} +1 -1
  207. package/dist/web/assets/{video-preview-DzwY3q9W.js → video-preview-BuzUAIma.js} +1 -1
  208. package/dist/web/assets/video-preview-BuzUAIma.js.br +0 -0
  209. package/dist/web/assets/video-preview-BuzUAIma.js.gz +0 -0
  210. package/dist/web/assets/{voice-settings-section-B7zMHsuz.js → voice-settings-section-DnwQjBbw.js} +1 -1
  211. package/dist/web/assets/voice-settings-section-DnwQjBbw.js.br +0 -0
  212. package/dist/web/assets/voice-settings-section-DnwQjBbw.js.gz +0 -0
  213. package/dist/web/assets/{window-pip-registry-dxrBFfkP.js → window-pip-registry-Bl--fK8-.js} +1 -1
  214. package/dist/web/assets/window-store-vo1N70nK.js +1 -0
  215. package/dist/web/assets/window-store-vo1N70nK.js.br +0 -0
  216. package/dist/web/assets/window-store-vo1N70nK.js.gz +0 -0
  217. package/dist/web/index.html +6 -6
  218. package/dist/web/index.html.br +0 -0
  219. package/dist/web/index.html.gz +0 -0
  220. package/dist/web/sw.js +1 -1
  221. package/dist/web/sw.js.br +0 -0
  222. package/dist/web/sw.js.gz +0 -0
  223. package/docs/architecture/ai-chat-and-providers.md +66 -0
  224. package/docs/architecture/workspace-and-ui.md +15 -3
  225. package/docs/design-guidelines.md +6 -1
  226. package/package.json +1 -1
  227. package/src/providers/codex-app-server/codex-history.ts +4 -4
  228. package/src/providers/codex-app-server/codex-provider.ts +1 -1
  229. package/src/providers/codex-app-server/codex-rollout-tail-parser.ts +203 -0
  230. package/src/providers/codex-app-server/codex-subagent-thread.ts +7 -1
  231. package/src/server/index.ts +7 -2
  232. package/src/server/routes/chat.ts +12 -4
  233. package/src/server/ws/global.ts +19 -3
  234. package/src/services/agent-transcript/agent-transcript-activity.ts +72 -0
  235. package/src/services/agent-transcript/agent-transcript-codex-activity.ts +161 -0
  236. package/src/services/agent-transcript/agent-transcript-codex-tail-cache.ts +85 -0
  237. package/src/services/agent-transcript/agent-transcript-envelope.ts +86 -0
  238. package/src/services/agent-transcript/agent-transcript-error-map.ts +33 -0
  239. package/src/services/agent-transcript/agent-transcript-file-tail-feed.ts +180 -0
  240. package/src/services/agent-transcript/agent-transcript-file-tail-state.ts +100 -0
  241. package/src/services/agent-transcript/agent-transcript-fs-io.ts +79 -0
  242. package/src/services/agent-transcript/agent-transcript-hub-clock.ts +37 -0
  243. package/src/services/agent-transcript/agent-transcript-hub-registry.ts +153 -0
  244. package/src/services/agent-transcript/agent-transcript-hub.ts +103 -0
  245. package/src/services/agent-transcript/agent-transcript-index-cache.ts +85 -0
  246. package/src/services/agent-transcript/agent-transcript-session-hub-activity.ts +103 -0
  247. package/src/services/agent-transcript/agent-transcript-session-hub-read.ts +194 -0
  248. package/src/services/agent-transcript/agent-transcript-session-hub-types.ts +81 -0
  249. package/src/services/agent-transcript/agent-transcript-session-hub.ts +196 -0
  250. package/src/services/agent-transcript/agent-transcript-sources.ts +199 -0
  251. package/src/services/agent-transcript/agent-transcript-ws-like.ts +19 -0
  252. package/src/services/agent-transcript/claude-projects-root.ts +21 -0
  253. package/src/services/agent-transcript/session-ownership.ts +152 -0
  254. package/src/services/nested-subagent-spy.ts +3 -3
  255. package/src/services/subagent-transcript-merger.ts +21 -7
  256. package/src/shared/agent-transcript-protocol.ts +158 -0
  257. package/src/types/chat.ts +27 -3
  258. package/src/web/app.tsx +5 -5
  259. package/src/web/components/chat/agent-card-summary.tsx +73 -0
  260. package/src/web/components/chat/agent-session-context.ts +34 -0
  261. package/src/web/components/chat/agent-session-fallback-store.ts +60 -0
  262. package/src/web/components/chat/agent-session-sheet-store.ts +23 -0
  263. package/src/web/components/chat/{team-member-sheet.tsx → agent-session-sheet.tsx} +12 -12
  264. package/src/web/components/chat/agent-session-window-content.tsx +133 -0
  265. package/src/web/components/chat/chat-history-bar.tsx +1 -0
  266. package/src/web/components/chat/chat-tab.tsx +21 -4
  267. package/src/web/components/chat/codex-usage-panel.tsx +26 -8
  268. package/src/web/components/chat/running-agents-bar.tsx +93 -0
  269. package/src/web/components/chat/team-activity-panel.tsx +19 -5
  270. package/src/web/components/chat/tool-cards.tsx +73 -4
  271. package/src/web/components/chat/use-open-agent-session.ts +83 -0
  272. package/src/web/components/floating-window/window-content-registry.ts +4 -5
  273. package/src/web/components/floating-window/window-geometry.ts +18 -0
  274. package/src/web/components/floating-window/window-persistence.ts +5 -4
  275. package/src/web/components/floating-window/window-store-types.ts +1 -1
  276. package/src/web/components/settings/resolve-open-settings-action.ts +1 -1
  277. package/src/web/components/system/resolve-open-system-monitor-action.ts +1 -1
  278. package/src/web/hooks/use-agent-activity.ts +65 -0
  279. package/src/web/hooks/use-agent-session-stream.ts +134 -0
  280. package/src/web/hooks/use-chat.ts +12 -18
  281. package/src/web/hooks/use-global-events.ts +35 -2
  282. package/src/web/lib/agent-session-stream-merge.ts +48 -0
  283. package/src/web/lib/agent-step-summary.ts +331 -0
  284. package/src/web/lib/global-ws-channel.ts +41 -0
  285. package/src/web/lib/running-agent-rows.ts +115 -0
  286. package/dist/web/assets/accounts-settings-section-BNcPvEq1.js +0 -1
  287. package/dist/web/assets/accounts-settings-section-BNcPvEq1.js.br +0 -0
  288. package/dist/web/assets/accounts-settings-section-BNcPvEq1.js.gz +0 -0
  289. package/dist/web/assets/ai-resource-editor-DfVRMUHS.js.br +0 -0
  290. package/dist/web/assets/ai-resource-editor-DfVRMUHS.js.gz +0 -0
  291. package/dist/web/assets/ai-settings-section-B_0-P8jx.js +0 -1
  292. package/dist/web/assets/ai-settings-section-Ezhw4Fef.js.br +0 -0
  293. package/dist/web/assets/ai-settings-section-Ezhw4Fef.js.gz +0 -0
  294. package/dist/web/assets/appearance-settings-section-CPOAp0fY.js.br +0 -0
  295. package/dist/web/assets/appearance-settings-section-CPOAp0fY.js.gz +0 -0
  296. package/dist/web/assets/apps-panel-Cz7_o-M4.js.br +0 -0
  297. package/dist/web/assets/apps-panel-Cz7_o-M4.js.gz +0 -0
  298. package/dist/web/assets/branch-review-tab-BPx3kHrM.js +0 -1
  299. package/dist/web/assets/branch-review-tab-BPx3kHrM.js.br +0 -0
  300. package/dist/web/assets/branch-review-tab-BPx3kHrM.js.gz +0 -0
  301. package/dist/web/assets/chat-tab-BadDM_j8.js +0 -1
  302. package/dist/web/assets/chat-tab-BadDM_j8.js.br +0 -0
  303. package/dist/web/assets/chat-tab-BadDM_j8.js.gz +0 -0
  304. package/dist/web/assets/chat-tab-IqAY4c7p.js +0 -15
  305. package/dist/web/assets/chat-tab-IqAY4c7p.js.br +0 -0
  306. package/dist/web/assets/chat-tab-IqAY4c7p.js.gz +0 -0
  307. package/dist/web/assets/code-editor-Dmitw9QS.js +0 -7
  308. package/dist/web/assets/code-editor-Dmitw9QS.js.br +0 -0
  309. package/dist/web/assets/code-editor-Dmitw9QS.js.gz +0 -0
  310. package/dist/web/assets/codex-reset-credit-button-D2hal4bG.js.br +0 -0
  311. package/dist/web/assets/codex-reset-credit-button-D2hal4bG.js.gz +0 -0
  312. package/dist/web/assets/conflict-editor-Cj_gUncw.js.br +0 -0
  313. package/dist/web/assets/conflict-editor-Cj_gUncw.js.gz +0 -0
  314. package/dist/web/assets/csv-preview-Be3ODNj0.js.br +0 -0
  315. package/dist/web/assets/csv-preview-Be3ODNj0.js.gz +0 -0
  316. package/dist/web/assets/database-viewer-B1b--4y8.js.br +0 -0
  317. package/dist/web/assets/database-viewer-B1b--4y8.js.gz +0 -0
  318. package/dist/web/assets/design-tab-8wi0IHss.js.br +0 -0
  319. package/dist/web/assets/design-tab-8wi0IHss.js.gz +0 -0
  320. package/dist/web/assets/designs-sidebar-panel-D5-1Q8zQ.js.br +0 -0
  321. package/dist/web/assets/designs-sidebar-panel-D5-1Q8zQ.js.gz +0 -0
  322. package/dist/web/assets/diff-viewer-Dcxk6UTG.js.br +0 -0
  323. package/dist/web/assets/diff-viewer-Dcxk6UTG.js.gz +0 -0
  324. package/dist/web/assets/edit-diff-preview-DxDAtYhi.js.br +0 -0
  325. package/dist/web/assets/editor-language-service-BVJQnTSV.js.br +0 -0
  326. package/dist/web/assets/editor-language-service-BVJQnTSV.js.gz +0 -0
  327. package/dist/web/assets/explorer-body-CTkrlrI3.js +0 -2
  328. package/dist/web/assets/explorer-body-CTkrlrI3.js.br +0 -0
  329. package/dist/web/assets/explorer-body-CTkrlrI3.js.gz +0 -0
  330. package/dist/web/assets/explorer-window-content-DH5AD3Ng.js.br +0 -0
  331. package/dist/web/assets/explorer-window-content-DH5AD3Ng.js.gz +0 -0
  332. package/dist/web/assets/extension-manager-section-BJr6ccWw.js.br +0 -0
  333. package/dist/web/assets/extension-manager-section-BJr6ccWw.js.gz +0 -0
  334. package/dist/web/assets/extension-webview-CYNXHd8D.js.br +0 -0
  335. package/dist/web/assets/extension-webview-CYNXHd8D.js.gz +0 -0
  336. package/dist/web/assets/files-settings-section-JX7o4lex.js.br +0 -0
  337. package/dist/web/assets/files-settings-section-JX7o4lex.js.gz +0 -0
  338. package/dist/web/assets/general-settings-section-kF94Mz5q.js.br +0 -0
  339. package/dist/web/assets/general-settings-section-kF94Mz5q.js.gz +0 -0
  340. package/dist/web/assets/git-log-panel-Crlp9ofM.js.br +0 -0
  341. package/dist/web/assets/git-log-panel-Crlp9ofM.js.gz +0 -0
  342. package/dist/web/assets/glide-data-grid-O6MO5dKU.js.br +0 -0
  343. package/dist/web/assets/glide-data-grid-O6MO5dKU.js.gz +0 -0
  344. package/dist/web/assets/group-chat-tab-DGLSGf37.js +0 -1
  345. package/dist/web/assets/group-chat-tab-DGLSGf37.js.br +0 -0
  346. package/dist/web/assets/group-chat-tab-DGLSGf37.js.gz +0 -0
  347. package/dist/web/assets/index-DQCw6d-2.js.br +0 -0
  348. package/dist/web/assets/index-DQCw6d-2.js.gz +0 -0
  349. package/dist/web/assets/keybindings-store-CJtEHFIQ.js +0 -1
  350. package/dist/web/assets/keyboard-shortcuts-section-CewWGwiF.js.br +0 -0
  351. package/dist/web/assets/keyboard-shortcuts-section-CewWGwiF.js.gz +0 -0
  352. package/dist/web/assets/language-servers-section-nricdxke.js.br +0 -0
  353. package/dist/web/assets/language-servers-section-nricdxke.js.gz +0 -0
  354. package/dist/web/assets/lsp-client-DRMEWb-z.js.br +0 -0
  355. package/dist/web/assets/lsp-client-DRMEWb-z.js.gz +0 -0
  356. package/dist/web/assets/markdown-renderer-D5-xliE9.js +0 -1
  357. package/dist/web/assets/markdown-renderer-Dab9Us6u.js.br +0 -0
  358. package/dist/web/assets/markdown-renderer-Dab9Us6u.js.gz +0 -0
  359. package/dist/web/assets/mobile-explorer-sheet-DtgdpvJ9.js.br +0 -0
  360. package/dist/web/assets/mobile-explorer-sheet-DtgdpvJ9.js.gz +0 -0
  361. package/dist/web/assets/new-design-dialog-Dd5KDB_p.js.br +0 -0
  362. package/dist/web/assets/new-design-dialog-Dd5KDB_p.js.gz +0 -0
  363. package/dist/web/assets/notification-store-D2vTyp_Q.js +0 -1
  364. package/dist/web/assets/panel-store-DrSH3Nhp.js.br +0 -0
  365. package/dist/web/assets/panel-store-DrSH3Nhp.js.gz +0 -0
  366. package/dist/web/assets/performance-panel-LMGefOQ2.js +0 -3
  367. package/dist/web/assets/performance-panel-LMGefOQ2.js.br +0 -0
  368. package/dist/web/assets/performance-panel-LMGefOQ2.js.gz +0 -0
  369. package/dist/web/assets/ppmbot-settings-section-D67u6gPi.js.br +0 -0
  370. package/dist/web/assets/ppmbot-settings-section-D67u6gPi.js.gz +0 -0
  371. package/dist/web/assets/problems-panel-DKgIw4uZ.js.br +0 -0
  372. package/dist/web/assets/problems-panel-DKgIw4uZ.js.gz +0 -0
  373. package/dist/web/assets/process-table-BIAgC_jG.js +0 -1
  374. package/dist/web/assets/process-table-BIAgC_jG.js.br +0 -0
  375. package/dist/web/assets/process-table-BIAgC_jG.js.gz +0 -0
  376. package/dist/web/assets/proxy-settings-section-CFiYcTBA.js.br +0 -0
  377. package/dist/web/assets/proxy-settings-section-CFiYcTBA.js.gz +0 -0
  378. package/dist/web/assets/query-audit-section-BybgiPsc.js.br +0 -0
  379. package/dist/web/assets/query-audit-section-BybgiPsc.js.gz +0 -0
  380. package/dist/web/assets/remote-desktop-clipboard-notice-Bs3fZSRw.js.br +0 -0
  381. package/dist/web/assets/remote-desktop-clipboard-notice-Bs3fZSRw.js.gz +0 -0
  382. package/dist/web/assets/remote-desktop-mobile-sheet-DgxTdWMh.js +0 -2
  383. package/dist/web/assets/remote-desktop-mobile-sheet-DgxTdWMh.js.br +0 -0
  384. package/dist/web/assets/remote-desktop-mobile-sheet-DgxTdWMh.js.gz +0 -0
  385. package/dist/web/assets/remote-desktop-mobile-view-DgGOfPVY.js.br +0 -0
  386. package/dist/web/assets/remote-desktop-mobile-view-DgGOfPVY.js.gz +0 -0
  387. package/dist/web/assets/remote-desktop-readiness-gate-DOWryrQx.js.br +0 -0
  388. package/dist/web/assets/remote-desktop-readiness-gate-DOWryrQx.js.gz +0 -0
  389. package/dist/web/assets/remote-desktop-window-content-7t0wQsHx.js +0 -1
  390. package/dist/web/assets/remote-desktop-window-content-7t0wQsHx.js.br +0 -0
  391. package/dist/web/assets/remote-desktop-window-content-7t0wQsHx.js.gz +0 -0
  392. package/dist/web/assets/schedules-settings-section-DGhG-b5O.js.br +0 -0
  393. package/dist/web/assets/schedules-settings-section-DGhG-b5O.js.gz +0 -0
  394. package/dist/web/assets/send-to-chat-B09VjsB5.js.br +0 -0
  395. package/dist/web/assets/send-to-chat-B09VjsB5.js.gz +0 -0
  396. package/dist/web/assets/services-panel-0klE3O4g.js.br +0 -0
  397. package/dist/web/assets/services-panel-0klE3O4g.js.gz +0 -0
  398. package/dist/web/assets/settings-body-CfqpqFfq.js.br +0 -0
  399. package/dist/web/assets/settings-body-CfqpqFfq.js.gz +0 -0
  400. package/dist/web/assets/settings-store-3jIBB8gx.js.br +0 -0
  401. package/dist/web/assets/settings-store-3jIBB8gx.js.gz +0 -0
  402. package/dist/web/assets/sql-query-editor-ALQ5_X0j.js.br +0 -0
  403. package/dist/web/assets/sql-query-editor-ALQ5_X0j.js.gz +0 -0
  404. package/dist/web/assets/sqlite-viewer-DKTty_jR.js.br +0 -0
  405. package/dist/web/assets/sqlite-viewer-DKTty_jR.js.gz +0 -0
  406. package/dist/web/assets/system-monitor-body-D6J6lq7-.js.br +0 -0
  407. package/dist/web/assets/system-monitor-body-D6J6lq7-.js.gz +0 -0
  408. package/dist/web/assets/system-monitor-tab-Di18zNNS.js +0 -1
  409. package/dist/web/assets/tab-host-window-content-DTcx2D0O.js.br +0 -0
  410. package/dist/web/assets/tab-host-window-content-DTcx2D0O.js.gz +0 -0
  411. package/dist/web/assets/team-member-sheet-CFSbPG6n.js +0 -2
  412. package/dist/web/assets/team-member-sheet-CFSbPG6n.js.br +0 -0
  413. package/dist/web/assets/team-member-sheet-CFSbPG6n.js.gz +0 -0
  414. package/dist/web/assets/team-member-window-content-VeI6DGeM.js +0 -1
  415. package/dist/web/assets/team-member-window-content-VeI6DGeM.js.br +0 -0
  416. package/dist/web/assets/team-member-window-content-VeI6DGeM.js.gz +0 -0
  417. package/dist/web/assets/terminal-tab-DgTfQKBI.js.br +0 -0
  418. package/dist/web/assets/terminal-tab-DgTfQKBI.js.gz +0 -0
  419. package/dist/web/assets/tool-cards-_fpYI1hB.js +0 -9
  420. package/dist/web/assets/tool-cards-_fpYI1hB.js.br +0 -0
  421. package/dist/web/assets/tool-cards-_fpYI1hB.js.gz +0 -0
  422. package/dist/web/assets/use-inline-blame-Dv111BKY.js.br +0 -0
  423. package/dist/web/assets/use-inline-blame-Dv111BKY.js.gz +0 -0
  424. package/dist/web/assets/use-lsp-CZTFJIXX.js.br +0 -0
  425. package/dist/web/assets/use-lsp-CZTFJIXX.js.gz +0 -0
  426. package/dist/web/assets/use-open-team-member-ElN3KmCI.js +0 -1
  427. package/dist/web/assets/use-process-kill-D7D9QvJG.js.br +0 -0
  428. package/dist/web/assets/use-process-kill-D7D9QvJG.js.gz +0 -0
  429. package/dist/web/assets/video-preview-DzwY3q9W.js.br +0 -0
  430. package/dist/web/assets/video-preview-DzwY3q9W.js.gz +0 -0
  431. package/dist/web/assets/voice-settings-section-B7zMHsuz.js.br +0 -0
  432. package/dist/web/assets/voice-settings-section-B7zMHsuz.js.gz +0 -0
  433. package/dist/web/assets/window-store-B4cbZ5rr.js +0 -1
  434. package/dist/web/assets/window-store-B4cbZ5rr.js.br +0 -0
  435. package/dist/web/assets/window-store-B4cbZ5rr.js.gz +0 -0
  436. package/src/web/components/chat/team-member-window-content.tsx +0 -66
  437. package/src/web/components/chat/team-working-bar.tsx +0 -62
  438. package/src/web/components/chat/use-open-team-member.ts +0 -41
  439. package/src/web/hooks/use-member-transcript-tail.ts +0 -95
  440. /package/dist/web/assets/{api-settings-BeINN5Dy.js → api-settings-BWgfXl7o.js} +0 -0
  441. /package/dist/web/assets/{api-settings-BeINN5Dy.js.br → api-settings-BWgfXl7o.js.br} +0 -0
  442. /package/dist/web/assets/{api-settings-BeINN5Dy.js.gz → api-settings-BWgfXl7o.js.gz} +0 -0
  443. /package/dist/web/assets/{libesm-CxeQSM3t.js → libesm-DAF5_F99.js} +0 -0
  444. /package/dist/web/assets/{libesm-CxeQSM3t.js.br → libesm-DAF5_F99.js.br} +0 -0
  445. /package/dist/web/assets/{libesm-CxeQSM3t.js.gz → libesm-DAF5_F99.js.gz} +0 -0
  446. /package/dist/web/assets/{onboarding-entry-DD3QSDiz.js → onboarding-entry-Bh-WE3vq.js} +0 -0
  447. /package/dist/web/assets/{onboarding-entry-DD3QSDiz.js.br → onboarding-entry-Bh-WE3vq.js.br} +0 -0
  448. /package/dist/web/assets/{onboarding-entry-DD3QSDiz.js.gz → onboarding-entry-Bh-WE3vq.js.gz} +0 -0
@@ -1,4 +1,4 @@
1
- import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{C as t}from"./vendor-markdown-QKPNiWEd.js";import"./vendor-ui-P9Ym7hCv.js";import{o as n,r}from"./api-client-F5Zi1sR0.js";import"./ws-auth-J3hw0Mhc.js";import{J as i}from"./index-DQCw6d-2.js";import{i as a,r as o,t as s}from"./lsp-client-DRMEWb-z.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{C as t}from"./vendor-markdown-QKPNiWEd.js";import"./vendor-ui-P9Ym7hCv.js";import{o as n,r}from"./api-client-F5Zi1sR0.js";import"./ws-auth-J3hw0Mhc.js";import{X as i}from"./index-CIscPw4g.js";import{i as a,r as o,t as s}from"./lsp-client-MQ4mjDfT.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{C as t}from"./vendor-markdown-QKPNiWEd.js";import{t as n}from"./settings-store-3jIBB8gx.js";import{r,t as i}from"./apply-theme-aVoqSG0I.js";import{t as a}from"./resolve-theme-B87m6l4i.js";import{O as o}from"./index-DQCw6d-2.js";var s=e(t(),1);function c(){let e=n(e=>e.themeStyle),t=n(e=>e.themeMode),c=n(e=>e.customThemeId),l=n(e=>e.customThemes),u=()=>o(r()??a(e,t,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,t,c,l]),d}export{c as t};
1
+ import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{C as t}from"./vendor-markdown-QKPNiWEd.js";import{t as n}from"./settings-store-DIV25PM_.js";import{r,t as i}from"./apply-theme-aVoqSG0I.js";import{t as a}from"./resolve-theme-B87m6l4i.js";import{A as o}from"./index-CIscPw4g.js";var s=e(t(),1);function c(){let e=n(e=>e.themeStyle),t=n(e=>e.themeMode),c=n(e=>e.customThemeId),l=n(e=>e.customThemes),u=()=>o(r()??a(e,t,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,t,c,l]),d}export{c as t};
@@ -1 +1 @@
1
- import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{C as t,S as n}from"./vendor-markdown-QKPNiWEd.js";import{O as r,a as i}from"./api-client-F5Zi1sR0.js";import{n as a}from"./use-is-mobile-CkO33jqU.js";import{t as o}from"./button-CsmGH5xa.js";import{a as s,n as c,o as l,t as u}from"./dialog-z8PLkL8n.js";import{t as d}from"./mobile-bottom-sheet-CLic9ovp.js";import{Ct as f}from"./index-DQCw6d-2.js";import{r as p}from"./format-bytes-DZ8bW_uF.js";var m=e(t(),1),h=n();function g({target:e,onConfirm:t,onCancel:n}){let r=a(),[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)(o,{variant:`outline`,onClick:n,"data-testid":`sysmon-kill-confirm-cancel`,className:`min-h-11`,children:`Cancel`}),(0,h.jsx)(o,{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)(d,{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)(u,{open:!0,onOpenChange:e=>!e&&n(),children:(0,h.jsxs)(c,{children:[(0,h.jsx)(s,{children:(0,h.jsx)(l,{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=i(),n={"Content-Type":`application/json`,"X-PPM-Request":`1`};t&&(n.Authorization=`Bearer ${t}`);let r=await fetch(`/api/system/resources/kill`,{method:`POST`,headers:n,body:JSON.stringify(e)}),a;try{a=await r.json()}catch{throw Error(r.ok?`Empty response from server`:`Server error (HTTP ${r.status})`)}if(a.ok===!1)throw Error(a.error??`HTTP ${r.status}`);return a.data}function x(e){let[t,n]=(0,m.useState)(null),i=(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(i(e))])),[e.groups,i]),o=(0,m.useCallback)(e=>n({kind:`process`,proc:e}),[]),s=(0,m.useCallback)(e=>n({kind:`group`,group:e,members:i(e)}),[i]),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)),r.success(`Ended ${n.name} (${n.pid})`)}catch(e){r.error(e instanceof Error?e.message:`Failed to end ${n.name}`)}return}let{group:i,members:a}=e,o=[];for(let e of v(i,a))try{await b(e)}catch(t){o.push(t instanceof Error?t.message:`pid ${e.pid}`)}o.length===0?r.success(`Ended ${i.label} (${a.length} processes)`):r.error(`${i.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{C as t,S as n}from"./vendor-markdown-QKPNiWEd.js";import{O as r,a as i}from"./api-client-F5Zi1sR0.js";import{n as a}from"./use-is-mobile-CkO33jqU.js";import{t as o}from"./button-CsmGH5xa.js";import{a as s,n as c,o as l,t as u}from"./dialog-z8PLkL8n.js";import{t as d}from"./mobile-bottom-sheet-CLic9ovp.js";import{Tt as f}from"./index-CIscPw4g.js";import{r as p}from"./format-bytes-DZ8bW_uF.js";var m=e(t(),1),h=n();function g({target:e,onConfirm:t,onCancel:n}){let r=a(),[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)(o,{variant:`outline`,onClick:n,"data-testid":`sysmon-kill-confirm-cancel`,className:`min-h-11`,children:`Cancel`}),(0,h.jsx)(o,{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)(d,{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)(u,{open:!0,onOpenChange:e=>!e&&n(),children:(0,h.jsxs)(c,{children:[(0,h.jsx)(s,{children:(0,h.jsx)(l,{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=i(),n={"Content-Type":`application/json`,"X-PPM-Request":`1`};t&&(n.Authorization=`Bearer ${t}`);let r=await fetch(`/api/system/resources/kill`,{method:`POST`,headers:n,body:JSON.stringify(e)}),a;try{a=await r.json()}catch{throw Error(r.ok?`Empty response from server`:`Server error (HTTP ${r.status})`)}if(a.ok===!1)throw Error(a.error??`HTTP ${r.status}`);return a.data}function x(e){let[t,n]=(0,m.useState)(null),i=(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(i(e))])),[e.groups,i]),o=(0,m.useCallback)(e=>n({kind:`process`,proc:e}),[]),s=(0,m.useCallback)(e=>n({kind:`group`,group:e,members:i(e)}),[i]),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)),r.success(`Ended ${n.name} (${n.pid})`)}catch(e){r.error(e instanceof Error?e.message:`Failed to end ${n.name}`)}return}let{group:i,members:a}=e,o=[];for(let e of v(i,a))try{await b(e)}catch(t){o.push(t instanceof Error?t.message:`pid ${e.pid}`)}o.length===0?r.success(`Ended ${i.label} (${a.length} processes)`):r.error(`${i.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 +1 @@
1
- import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{C as t}from"./vendor-markdown-QKPNiWEd.js";import{y as n}from"./index-DQCw6d-2.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{C as t}from"./vendor-markdown-QKPNiWEd.js";import{x as n}from"./index-CIscPw4g.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{C as t,S as n}from"./vendor-markdown-QKPNiWEd.js";import"./vendor-ui-P9Ym7hCv.js";import{Cn as r,Et as i,Fr as a,Hr as o,Un as s,Ur as c,Wr as l,Yn as u,ar as d,bt as f,fr as p,hn as m,or as h,st as g,un as _,wt as v}from"./icons-CO_II6D-.js";import"./api-client-F5Zi1sR0.js";import"./portal-container-context-NFSuymMu.js";import{t as y}from"./button-CsmGH5xa.js";import{Cn as b,On as x,Sn as S,_n as C,bn as w,wn as T,xn as E,yn as D}from"./index-DQCw6d-2.js";import{o as O}from"./can-open-in-ppm-B9ZwTOGE.js";import{a as ee,i as te,n as k,r as A,t as j}from"./media-url-mOPwQ_ey.js";var M=e(t(),1),N={rotation:0,flipH:!1,flipV:!1};function P(e){return{...e,rotation:(e.rotation+90)%360}}function F(e){return{...e,rotation:(e.rotation+270)%360}}function I(e){return e.rotation===0&&!e.flipH&&!e.flipV}function L(e){let t=[];return e.rotation&&t.push(`rotate(${e.rotation}deg)`),e.flipH&&t.push(`scaleX(-1)`),e.flipV&&t.push(`scaleY(-1)`),t.length?t.join(` `):`none`}function R(e,t){return e.rotation===90||e.rotation===270?{maxWidth:t.height,maxHeight:t.width}:{maxWidth:t.width,maxHeight:t.height}}var z=[[`Space / K`,`Play / pause`],[`← / →`,`Seek 5s`],[`J / L or Shift+← / →`,`Seek 10s`],[`↑ / ↓`,`Volume`],[`M`,`Mute`],[`F`,`Fullscreen`],[`< / >`,`Speed`],[`R / Shift+R`,`Rotate`]];function ne(e){return(0,M.useCallback)(t=>{let n=t.target;if(n.tagName===`INPUT`||n.tagName===`TEXTAREA`||n.isContentEditable||t.ctrlKey||t.metaKey||t.altKey)return;let r=!0;switch(t.key){case` `:case`k`:case`K`:e.togglePlay();break;case`ArrowLeft`:e.seekBy(t.shiftKey?-10:-5);break;case`ArrowRight`:e.seekBy(t.shiftKey?10:5);break;case`j`:case`J`:e.seekBy(-10);break;case`l`:case`L`:e.seekBy(10);break;case`ArrowUp`:e.volumeBy(.1);break;case`ArrowDown`:e.volumeBy(-.1);break;case`m`:case`M`:e.toggleMute();break;case`f`:case`F`:e.toggleFullscreen();break;case`<`:case`,`:e.speedStep(-1);break;case`>`:case`.`:e.speedStep(1);break;case`r`:e.rotate(1);break;case`R`:e.rotate(-1);break;default:r=!1}r&&t.preventDefault()},[e])}var B=n(),V=[.25,.5,.75,1,1.25,1.5,2,3];function H({speed:e,onSpeed:t,transform:n,onRotate:r,onFlipH:o,onFlipV:s,onResetTransform:c}){return(0,B.jsxs)(C,{children:[(0,B.jsx)(x,{asChild:!0,children:(0,B.jsxs)(y,{variant:`ghost`,size:`icon`,className:`size-11 shrink-0 relative`,"aria-label":`Playback settings`,children:[(0,B.jsx)(p,{className:`size-5`}),e!==1&&(0,B.jsxs)(`span`,{className:`absolute -top-0.5 -right-0.5 text-[10px] leading-none px-1 rounded bg-primary text-primary-foreground tabular-nums`,children:[e,`x`]})]})}),(0,B.jsxs)(D,{align:`end`,className:`w-60 max-h-[70vh] overflow-y-auto`,children:[(0,B.jsx)(E,{children:`Speed`}),(0,B.jsx)(S,{value:String(e),onValueChange:e=>t(Number(e)),children:(0,B.jsx)(`div`,{className:`grid grid-cols-4 gap-1 px-1 pb-1`,children:V.map(e=>(0,B.jsxs)(b,{value:String(e),className:`justify-center pl-2 min-h-11 text-xs tabular-nums data-[state=checked]:bg-accent [&>span:first-child]:hidden`,children:[e,`x`]},e))})}),(0,B.jsx)(T,{}),(0,B.jsx)(E,{children:`Orientation`}),(0,B.jsxs)(w,{className:`min-h-11`,onSelect:e=>{e.preventDefault(),r(1)},children:[(0,B.jsx)(h,{className:`size-4`}),` Rotate right `,(0,B.jsx)(`span`,{className:`ml-auto text-xs text-text-subtle`,children:`R`})]}),(0,B.jsxs)(w,{className:`min-h-11`,onSelect:e=>{e.preventDefault(),r(-1)},children:[(0,B.jsx)(d,{className:`size-4`}),` Rotate left `,(0,B.jsx)(`span`,{className:`ml-auto text-xs text-text-subtle`,children:`⇧R`})]}),(0,B.jsxs)(w,{className:`min-h-11`,onSelect:e=>{e.preventDefault(),o()},children:[(0,B.jsx)(v,{className:`size-4`}),` Flip horizontal `,n.flipH&&(0,B.jsx)(`span`,{className:`ml-auto text-xs`,children:`✓`})]}),(0,B.jsxs)(w,{className:`min-h-11`,onSelect:e=>{e.preventDefault(),s()},children:[(0,B.jsx)(i,{className:`size-4`}),` Flip vertical `,n.flipV&&(0,B.jsx)(`span`,{className:`ml-auto text-xs`,children:`✓`})]}),!I(n)&&(0,B.jsxs)(w,{className:`min-h-11`,onSelect:c,children:[(0,B.jsx)(a,{className:`size-4`}),` Reset orientation`]}),(0,B.jsx)(T,{}),(0,B.jsx)(E,{children:`Keyboard`}),(0,B.jsx)(`div`,{className:`px-2 pb-2 grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-xs text-text-secondary`,children:z.map(([e,t])=>(0,B.jsxs)(`div`,{className:`contents`,children:[(0,B.jsx)(`kbd`,{className:`font-mono text-text-subtle whitespace-nowrap`,children:e}),(0,B.jsx)(`span`,{children:t})]},e))})]})]})}function re(e){let t=e.muted||e.volume===0?l:e.volume<.5?o:c,n=t=>e.onSeek(Number(t.target.value));return(0,B.jsxs)(`div`,{className:`flex items-center gap-1 px-2 py-1 bg-surface border-t border-border`,children:[(0,B.jsx)(y,{variant:`ghost`,size:`icon`,className:`size-11 shrink-0`,onClick:e.onTogglePlay,"aria-label":e.playing?`Pause`:`Play`,children:e.playing?(0,B.jsx)(s,{className:`size-5`}):(0,B.jsx)(u,{className:`size-5`})}),(0,B.jsxs)(`span`,{className:`text-xs tabular-nums text-text-secondary shrink-0 min-w-[4.5rem] text-center`,children:[U(e.position),e.duration?` / ${U(e.duration)}`:``]}),e.duration?(0,B.jsx)(`input`,{type:`range`,min:0,max:e.duration,step:.1,value:Math.min(e.position,e.duration),"aria-label":`Seek`,className:`flex-1 h-11 accent-primary cursor-pointer min-w-0`,onChange:t=>e.onScrub(Number(t.target.value)),onPointerUp:n,onKeyUp:n,onTouchEnd:n}):(0,B.jsx)(`div`,{className:`flex-1`}),(0,B.jsxs)(`div`,{className:`flex items-center shrink-0`,children:[(0,B.jsx)(y,{variant:`ghost`,size:`icon`,className:`size-11`,onClick:e.onToggleMute,"aria-label":e.muted?`Unmute`:`Mute`,children:(0,B.jsx)(t,{className:`size-5`})}),(0,B.jsx)(`input`,{type:`range`,min:0,max:1,step:.05,value:e.muted?0:e.volume,"aria-label":`Volume`,className:`hidden sm:block w-20 h-11 accent-primary cursor-pointer`,onChange:t=>e.onVolume(Number(t.target.value))})]}),(0,B.jsx)(H,{speed:e.speed,onSpeed:e.onSpeed,transform:e.transform,onRotate:e.onRotate,onFlipH:e.onFlipH,onFlipV:e.onFlipV,onResetTransform:e.onResetTransform}),(0,B.jsx)(y,{variant:`ghost`,size:`icon`,className:`size-11 shrink-0`,onClick:e.onToggleFullscreen,"aria-label":e.fullscreen?`Exit fullscreen`:`Fullscreen`,children:e.fullscreen?(0,B.jsx)(r,{className:`size-5`}):(0,B.jsx)(m,{className:`size-5`})})]})}function U(e){let t=Math.max(0,Math.floor(Number.isFinite(e)?e:0)),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60,a=n?String(r).padStart(2,`0`):String(r);return`${n?`${n}:`:``}${a}:${String(i).padStart(2,`0`)}`}function W({filePath:e,projectName:t,mode:n,probeDuration:r=null,onNativeError:i}){let a=(0,M.useRef)(null),o=(0,M.useRef)(null),s=(0,M.useRef)(null),c=(0,M.useRef)(!0),[l]=(0,M.useState)(j),[u,d]=(0,M.useState)(0),[f,p]=(0,M.useState)(0),[m,h]=(0,M.useState)(null),[g,v]=(0,M.useState)(!1),[b,x]=(0,M.useState)(!0),[S,C]=(0,M.useState)(null),[w,T]=(0,M.useState)(1),[E,D]=(0,M.useState)(!1),[O,k]=(0,M.useState)(1),[I,z]=(0,M.useState)(N),[H,U]=(0,M.useState)(!1),[W,G]=(0,M.useState)({width:0,height:0}),[K,q]=(0,M.useState)(null),J=n===`transcode`,Y=J?ee(e,t,u,l):A(e,t),X=J?r:m,ie=S??(J?u+f:f);(0,M.useEffect)(()=>{p(0),x(!0),q(null)},[Y]),(0,M.useEffect)(()=>{d(0),h(null),z(N)},[e,n]),(0,M.useEffect)(()=>{let e=s.current;e&&(e.volume=w,e.muted=E)},[w,E]),(0,M.useEffect)(()=>{let e=s.current;e&&(e.playbackRate=O)},[O,Y]),(0,M.useEffect)(()=>{let n=s.current,r=()=>{J&&te(e,t,l)};return window.addEventListener(`pagehide`,r),()=>{window.removeEventListener(`pagehide`,r),n&&!n.isConnected&&(n.pause(),n.removeAttribute(`src`),n.load(),r())}},[e,t,J,l]),(0,M.useEffect)(()=>{let e=()=>U(document.fullscreenElement===a.current);return document.addEventListener(`fullscreenchange`,e),()=>document.removeEventListener(`fullscreenchange`,e)},[]),(0,M.useEffect)(()=>{let e=o.current;if(!e)return;let t=new ResizeObserver(()=>G({width:e.clientWidth,height:e.clientHeight}));return t.observe(e),()=>t.disconnect()},[]);let Z=(0,M.useCallback)(e=>{let t=s.current,n=Math.max(0,X?Math.min(e,X-.5):e);if(C(null),!J){t&&(t.currentTime=n);return}Math.abs(n-(u+(t?.currentTime??0)))<.5||d(n)},[X,J,u]),Q=(0,M.useMemo)(()=>({togglePlay:()=>{let e=s.current;e&&(c.current=e.paused,e.paused?e.play().catch(()=>{}):e.pause())},seekBy:e=>Z((J?u:0)+(s.current?.currentTime??0)+e),toggleFullscreen:()=>{document.fullscreenElement?document.exitFullscreen():a.current?.requestFullscreen?.()},toggleMute:()=>D(e=>!e),volumeBy:e=>{D(!1),T(t=>Math.min(1,Math.max(0,Math.round((t+e)*100)/100)))},speedStep:e=>k(t=>{let n=V.indexOf(t);return V[Math.min(V.length-1,Math.max(0,(n===-1?3:n)+e))]??1}),rotate:e=>z(t=>e===1?P(t):F(t))}),[Z,J,u]),ae=ne(Q),$=R(I,W),oe=()=>{q(null),d(e=>e+.001)};return(0,B.jsxs)(`div`,{ref:a,"data-testid":`video-player`,tabIndex:0,onKeyDown:ae,className:`flex flex-col h-full bg-black outline-none focus-visible:ring-1 focus-visible:ring-primary/60`,children:[(0,B.jsxs)(`div`,{ref:o,className:`relative flex-1 min-h-0 flex items-center justify-center overflow-hidden`,onClick:e=>{a.current?.focus(),e.detail===1&&Q.togglePlay()},onDoubleClick:Q.toggleFullscreen,children:[(0,B.jsx)(`video`,{ref:s,src:Y,autoPlay:!0,playsInline:!0,preload:J?`auto`:`metadata`,style:{transform:L(I),maxWidth:$.maxWidth||void 0,maxHeight:$.maxHeight||void 0},onLoadedMetadata:e=>{let t=e.currentTarget;t.playbackRate=O,t.volume=w,t.muted=E,!J&&Number.isFinite(t.duration)&&h(t.duration),J&&!c.current&&t.pause()},onPlay:()=>v(!0),onPause:()=>v(!1),onWaiting:()=>x(!0),onPlaying:()=>x(!1),onCanPlay:()=>x(!1),onTimeUpdate:e=>p(e.currentTarget.currentTime),onEnded:()=>{v(!1),c.current=!1},onError:()=>{J?q(`Transcoding failed. ffmpeg may have stopped or the file is corrupt.`):i?.()}}),b&&!K&&(0,B.jsx)(_,{className:`absolute size-8 animate-spin text-white/80 pointer-events-none`}),K&&(0,B.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center gap-3 bg-black/85 text-text-secondary p-4 text-center`,onClick:e=>e.stopPropagation(),onDoubleClick:e=>e.stopPropagation(),children:[(0,B.jsx)(`p`,{className:`text-sm`,children:K}),(0,B.jsx)(y,{variant:`outline`,size:`sm`,className:`h-11 px-4`,onClick:oe,children:`Retry`})]})]}),(0,B.jsx)(re,{playing:g,position:ie,duration:X,volume:w,muted:E,speed:O,transform:I,fullscreen:H,onTogglePlay:Q.togglePlay,onScrub:C,onSeek:Z,onVolume:e=>{T(e),D(e===0)},onToggleMute:Q.toggleMute,onSpeed:k,onRotate:Q.rotate,onFlipH:()=>z(e=>({...e,flipH:!e.flipH})),onFlipV:()=>z(e=>({...e,flipV:!e.flipV})),onResetTransform:()=>z(N),onToggleFullscreen:Q.toggleFullscreen})]})}var G=new Set([`mp4`,`m4v`,`webm`,`ogg`,`ogv`,`mov`]);function K({filePath:e,projectName:t}){let n=O(e),[r,i]=(0,M.useState)(()=>G.has(n)?{kind:`native`}:{kind:`probing`});return(0,M.useEffect)(()=>{i(G.has(O(e))?{kind:`native`}:{kind:`probing`})},[e]),(0,M.useEffect)(()=>{if(r.kind!==`probing`)return;let n=!1;return k(e,t).then(e=>{n||i(e.transcodable?{kind:`transcode`,probe:e}:{kind:`unsupported`,probe:e})}).catch(()=>{n||i({kind:`unsupported`,probe:null})}),()=>{n=!0}},[r.kind,e,t]),r.kind===`probing`?(0,B.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,B.jsx)(_,{className:`size-5 animate-spin text-text-subtle`})}):r.kind===`transcode`?(0,B.jsx)(W,{filePath:e,projectName:t,mode:`transcode`,probeDuration:r.probe.duration}):r.kind===`unsupported`?(0,B.jsx)(q,{filePath:e,projectName:t,probe:r.probe}):(0,B.jsx)(W,{filePath:e,projectName:t,mode:`native`,onNativeError:()=>i({kind:`probing`})})}function q({filePath:e,projectName:t,probe:n}){let r=[n?.video?.codec,n?.audio?.codec].filter(Boolean).join(` + `);return(0,B.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-3 text-text-secondary p-6 text-center`,children:[(0,B.jsx)(f,{className:`size-10 text-text-subtle`}),(0,B.jsxs)(`p`,{className:`text-sm`,children:[`This video cannot be played in the browser`,r?` (${r})`:``,`.`]}),(0,B.jsxs)(`p`,{className:`text-xs text-text-subtle max-w-sm`,children:[`Install `,(0,B.jsx)(`code`,{children:`ffmpeg`}),` on the PPM server (e.g. `,(0,B.jsx)(`code`,{children:`winget install ffmpeg`}),`, `,(0,B.jsx)(`code`,{children:`brew install ffmpeg`}),`,`,` `,(0,B.jsx)(`code`,{children:`apt install ffmpeg`}),`) and restart PPM to transcode it on the fly.`]}),(0,B.jsx)(y,{asChild:!0,variant:`outline`,size:`sm`,className:`h-11 px-4`,children:(0,B.jsxs)(`a`,{href:`${A(e,t)}&download=true`,download:!0,children:[(0,B.jsx)(g,{className:`size-4 mr-2`}),` Download file`]})})]})}export{K as VideoPreview};
1
+ import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{C as t,S as n}from"./vendor-markdown-QKPNiWEd.js";import"./vendor-ui-P9Ym7hCv.js";import{Cn as r,Et as i,Fr as a,Hr as o,Un as s,Ur as c,Wr as l,Yn as u,ar as d,bt as f,fr as p,hn as m,or as h,st as g,un as _,wt as v}from"./icons-CO_II6D-.js";import"./api-client-F5Zi1sR0.js";import"./portal-container-context-NFSuymMu.js";import{t as y}from"./button-CsmGH5xa.js";import{An as b,Cn as x,En as S,Sn as C,Tn as w,wn as T,xn as E,yn as D}from"./index-CIscPw4g.js";import{o as O}from"./can-open-in-ppm-B9ZwTOGE.js";import{a as ee,i as te,n as k,r as A,t as j}from"./media-url-mOPwQ_ey.js";var M=e(t(),1),N={rotation:0,flipH:!1,flipV:!1};function P(e){return{...e,rotation:(e.rotation+90)%360}}function F(e){return{...e,rotation:(e.rotation+270)%360}}function I(e){return e.rotation===0&&!e.flipH&&!e.flipV}function L(e){let t=[];return e.rotation&&t.push(`rotate(${e.rotation}deg)`),e.flipH&&t.push(`scaleX(-1)`),e.flipV&&t.push(`scaleY(-1)`),t.length?t.join(` `):`none`}function R(e,t){return e.rotation===90||e.rotation===270?{maxWidth:t.height,maxHeight:t.width}:{maxWidth:t.width,maxHeight:t.height}}var z=[[`Space / K`,`Play / pause`],[`← / →`,`Seek 5s`],[`J / L or Shift+← / →`,`Seek 10s`],[`↑ / ↓`,`Volume`],[`M`,`Mute`],[`F`,`Fullscreen`],[`< / >`,`Speed`],[`R / Shift+R`,`Rotate`]];function ne(e){return(0,M.useCallback)(t=>{let n=t.target;if(n.tagName===`INPUT`||n.tagName===`TEXTAREA`||n.isContentEditable||t.ctrlKey||t.metaKey||t.altKey)return;let r=!0;switch(t.key){case` `:case`k`:case`K`:e.togglePlay();break;case`ArrowLeft`:e.seekBy(t.shiftKey?-10:-5);break;case`ArrowRight`:e.seekBy(t.shiftKey?10:5);break;case`j`:case`J`:e.seekBy(-10);break;case`l`:case`L`:e.seekBy(10);break;case`ArrowUp`:e.volumeBy(.1);break;case`ArrowDown`:e.volumeBy(-.1);break;case`m`:case`M`:e.toggleMute();break;case`f`:case`F`:e.toggleFullscreen();break;case`<`:case`,`:e.speedStep(-1);break;case`>`:case`.`:e.speedStep(1);break;case`r`:e.rotate(1);break;case`R`:e.rotate(-1);break;default:r=!1}r&&t.preventDefault()},[e])}var B=n(),V=[.25,.5,.75,1,1.25,1.5,2,3];function H({speed:e,onSpeed:t,transform:n,onRotate:r,onFlipH:o,onFlipV:s,onResetTransform:c}){return(0,B.jsxs)(D,{children:[(0,B.jsx)(b,{asChild:!0,children:(0,B.jsxs)(y,{variant:`ghost`,size:`icon`,className:`size-11 shrink-0 relative`,"aria-label":`Playback settings`,children:[(0,B.jsx)(p,{className:`size-5`}),e!==1&&(0,B.jsxs)(`span`,{className:`absolute -top-0.5 -right-0.5 text-[10px] leading-none px-1 rounded bg-primary text-primary-foreground tabular-nums`,children:[e,`x`]})]})}),(0,B.jsxs)(E,{align:`end`,className:`w-60 max-h-[70vh] overflow-y-auto`,children:[(0,B.jsx)(x,{children:`Speed`}),(0,B.jsx)(T,{value:String(e),onValueChange:e=>t(Number(e)),children:(0,B.jsx)(`div`,{className:`grid grid-cols-4 gap-1 px-1 pb-1`,children:V.map(e=>(0,B.jsxs)(w,{value:String(e),className:`justify-center pl-2 min-h-11 text-xs tabular-nums data-[state=checked]:bg-accent [&>span:first-child]:hidden`,children:[e,`x`]},e))})}),(0,B.jsx)(S,{}),(0,B.jsx)(x,{children:`Orientation`}),(0,B.jsxs)(C,{className:`min-h-11`,onSelect:e=>{e.preventDefault(),r(1)},children:[(0,B.jsx)(h,{className:`size-4`}),` Rotate right `,(0,B.jsx)(`span`,{className:`ml-auto text-xs text-text-subtle`,children:`R`})]}),(0,B.jsxs)(C,{className:`min-h-11`,onSelect:e=>{e.preventDefault(),r(-1)},children:[(0,B.jsx)(d,{className:`size-4`}),` Rotate left `,(0,B.jsx)(`span`,{className:`ml-auto text-xs text-text-subtle`,children:`⇧R`})]}),(0,B.jsxs)(C,{className:`min-h-11`,onSelect:e=>{e.preventDefault(),o()},children:[(0,B.jsx)(v,{className:`size-4`}),` Flip horizontal `,n.flipH&&(0,B.jsx)(`span`,{className:`ml-auto text-xs`,children:`✓`})]}),(0,B.jsxs)(C,{className:`min-h-11`,onSelect:e=>{e.preventDefault(),s()},children:[(0,B.jsx)(i,{className:`size-4`}),` Flip vertical `,n.flipV&&(0,B.jsx)(`span`,{className:`ml-auto text-xs`,children:`✓`})]}),!I(n)&&(0,B.jsxs)(C,{className:`min-h-11`,onSelect:c,children:[(0,B.jsx)(a,{className:`size-4`}),` Reset orientation`]}),(0,B.jsx)(S,{}),(0,B.jsx)(x,{children:`Keyboard`}),(0,B.jsx)(`div`,{className:`px-2 pb-2 grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-xs text-text-secondary`,children:z.map(([e,t])=>(0,B.jsxs)(`div`,{className:`contents`,children:[(0,B.jsx)(`kbd`,{className:`font-mono text-text-subtle whitespace-nowrap`,children:e}),(0,B.jsx)(`span`,{children:t})]},e))})]})]})}function re(e){let t=e.muted||e.volume===0?l:e.volume<.5?o:c,n=t=>e.onSeek(Number(t.target.value));return(0,B.jsxs)(`div`,{className:`flex items-center gap-1 px-2 py-1 bg-surface border-t border-border`,children:[(0,B.jsx)(y,{variant:`ghost`,size:`icon`,className:`size-11 shrink-0`,onClick:e.onTogglePlay,"aria-label":e.playing?`Pause`:`Play`,children:e.playing?(0,B.jsx)(s,{className:`size-5`}):(0,B.jsx)(u,{className:`size-5`})}),(0,B.jsxs)(`span`,{className:`text-xs tabular-nums text-text-secondary shrink-0 min-w-[4.5rem] text-center`,children:[U(e.position),e.duration?` / ${U(e.duration)}`:``]}),e.duration?(0,B.jsx)(`input`,{type:`range`,min:0,max:e.duration,step:.1,value:Math.min(e.position,e.duration),"aria-label":`Seek`,className:`flex-1 h-11 accent-primary cursor-pointer min-w-0`,onChange:t=>e.onScrub(Number(t.target.value)),onPointerUp:n,onKeyUp:n,onTouchEnd:n}):(0,B.jsx)(`div`,{className:`flex-1`}),(0,B.jsxs)(`div`,{className:`flex items-center shrink-0`,children:[(0,B.jsx)(y,{variant:`ghost`,size:`icon`,className:`size-11`,onClick:e.onToggleMute,"aria-label":e.muted?`Unmute`:`Mute`,children:(0,B.jsx)(t,{className:`size-5`})}),(0,B.jsx)(`input`,{type:`range`,min:0,max:1,step:.05,value:e.muted?0:e.volume,"aria-label":`Volume`,className:`hidden sm:block w-20 h-11 accent-primary cursor-pointer`,onChange:t=>e.onVolume(Number(t.target.value))})]}),(0,B.jsx)(H,{speed:e.speed,onSpeed:e.onSpeed,transform:e.transform,onRotate:e.onRotate,onFlipH:e.onFlipH,onFlipV:e.onFlipV,onResetTransform:e.onResetTransform}),(0,B.jsx)(y,{variant:`ghost`,size:`icon`,className:`size-11 shrink-0`,onClick:e.onToggleFullscreen,"aria-label":e.fullscreen?`Exit fullscreen`:`Fullscreen`,children:e.fullscreen?(0,B.jsx)(r,{className:`size-5`}):(0,B.jsx)(m,{className:`size-5`})})]})}function U(e){let t=Math.max(0,Math.floor(Number.isFinite(e)?e:0)),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60,a=n?String(r).padStart(2,`0`):String(r);return`${n?`${n}:`:``}${a}:${String(i).padStart(2,`0`)}`}function W({filePath:e,projectName:t,mode:n,probeDuration:r=null,onNativeError:i}){let a=(0,M.useRef)(null),o=(0,M.useRef)(null),s=(0,M.useRef)(null),c=(0,M.useRef)(!0),[l]=(0,M.useState)(j),[u,d]=(0,M.useState)(0),[f,p]=(0,M.useState)(0),[m,h]=(0,M.useState)(null),[g,v]=(0,M.useState)(!1),[b,x]=(0,M.useState)(!0),[S,C]=(0,M.useState)(null),[w,T]=(0,M.useState)(1),[E,D]=(0,M.useState)(!1),[O,k]=(0,M.useState)(1),[I,z]=(0,M.useState)(N),[H,U]=(0,M.useState)(!1),[W,G]=(0,M.useState)({width:0,height:0}),[K,q]=(0,M.useState)(null),J=n===`transcode`,Y=J?ee(e,t,u,l):A(e,t),X=J?r:m,ie=S??(J?u+f:f);(0,M.useEffect)(()=>{p(0),x(!0),q(null)},[Y]),(0,M.useEffect)(()=>{d(0),h(null),z(N)},[e,n]),(0,M.useEffect)(()=>{let e=s.current;e&&(e.volume=w,e.muted=E)},[w,E]),(0,M.useEffect)(()=>{let e=s.current;e&&(e.playbackRate=O)},[O,Y]),(0,M.useEffect)(()=>{let n=s.current,r=()=>{J&&te(e,t,l)};return window.addEventListener(`pagehide`,r),()=>{window.removeEventListener(`pagehide`,r),n&&!n.isConnected&&(n.pause(),n.removeAttribute(`src`),n.load(),r())}},[e,t,J,l]),(0,M.useEffect)(()=>{let e=()=>U(document.fullscreenElement===a.current);return document.addEventListener(`fullscreenchange`,e),()=>document.removeEventListener(`fullscreenchange`,e)},[]),(0,M.useEffect)(()=>{let e=o.current;if(!e)return;let t=new ResizeObserver(()=>G({width:e.clientWidth,height:e.clientHeight}));return t.observe(e),()=>t.disconnect()},[]);let Z=(0,M.useCallback)(e=>{let t=s.current,n=Math.max(0,X?Math.min(e,X-.5):e);if(C(null),!J){t&&(t.currentTime=n);return}Math.abs(n-(u+(t?.currentTime??0)))<.5||d(n)},[X,J,u]),Q=(0,M.useMemo)(()=>({togglePlay:()=>{let e=s.current;e&&(c.current=e.paused,e.paused?e.play().catch(()=>{}):e.pause())},seekBy:e=>Z((J?u:0)+(s.current?.currentTime??0)+e),toggleFullscreen:()=>{document.fullscreenElement?document.exitFullscreen():a.current?.requestFullscreen?.()},toggleMute:()=>D(e=>!e),volumeBy:e=>{D(!1),T(t=>Math.min(1,Math.max(0,Math.round((t+e)*100)/100)))},speedStep:e=>k(t=>{let n=V.indexOf(t);return V[Math.min(V.length-1,Math.max(0,(n===-1?3:n)+e))]??1}),rotate:e=>z(t=>e===1?P(t):F(t))}),[Z,J,u]),ae=ne(Q),$=R(I,W),oe=()=>{q(null),d(e=>e+.001)};return(0,B.jsxs)(`div`,{ref:a,"data-testid":`video-player`,tabIndex:0,onKeyDown:ae,className:`flex flex-col h-full bg-black outline-none focus-visible:ring-1 focus-visible:ring-primary/60`,children:[(0,B.jsxs)(`div`,{ref:o,className:`relative flex-1 min-h-0 flex items-center justify-center overflow-hidden`,onClick:e=>{a.current?.focus(),e.detail===1&&Q.togglePlay()},onDoubleClick:Q.toggleFullscreen,children:[(0,B.jsx)(`video`,{ref:s,src:Y,autoPlay:!0,playsInline:!0,preload:J?`auto`:`metadata`,style:{transform:L(I),maxWidth:$.maxWidth||void 0,maxHeight:$.maxHeight||void 0},onLoadedMetadata:e=>{let t=e.currentTarget;t.playbackRate=O,t.volume=w,t.muted=E,!J&&Number.isFinite(t.duration)&&h(t.duration),J&&!c.current&&t.pause()},onPlay:()=>v(!0),onPause:()=>v(!1),onWaiting:()=>x(!0),onPlaying:()=>x(!1),onCanPlay:()=>x(!1),onTimeUpdate:e=>p(e.currentTarget.currentTime),onEnded:()=>{v(!1),c.current=!1},onError:()=>{J?q(`Transcoding failed. ffmpeg may have stopped or the file is corrupt.`):i?.()}}),b&&!K&&(0,B.jsx)(_,{className:`absolute size-8 animate-spin text-white/80 pointer-events-none`}),K&&(0,B.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center gap-3 bg-black/85 text-text-secondary p-4 text-center`,onClick:e=>e.stopPropagation(),onDoubleClick:e=>e.stopPropagation(),children:[(0,B.jsx)(`p`,{className:`text-sm`,children:K}),(0,B.jsx)(y,{variant:`outline`,size:`sm`,className:`h-11 px-4`,onClick:oe,children:`Retry`})]})]}),(0,B.jsx)(re,{playing:g,position:ie,duration:X,volume:w,muted:E,speed:O,transform:I,fullscreen:H,onTogglePlay:Q.togglePlay,onScrub:C,onSeek:Z,onVolume:e=>{T(e),D(e===0)},onToggleMute:Q.toggleMute,onSpeed:k,onRotate:Q.rotate,onFlipH:()=>z(e=>({...e,flipH:!e.flipH})),onFlipV:()=>z(e=>({...e,flipV:!e.flipV})),onResetTransform:()=>z(N),onToggleFullscreen:Q.toggleFullscreen})]})}var G=new Set([`mp4`,`m4v`,`webm`,`ogg`,`ogv`,`mov`]);function K({filePath:e,projectName:t}){let n=O(e),[r,i]=(0,M.useState)(()=>G.has(n)?{kind:`native`}:{kind:`probing`});return(0,M.useEffect)(()=>{i(G.has(O(e))?{kind:`native`}:{kind:`probing`})},[e]),(0,M.useEffect)(()=>{if(r.kind!==`probing`)return;let n=!1;return k(e,t).then(e=>{n||i(e.transcodable?{kind:`transcode`,probe:e}:{kind:`unsupported`,probe:e})}).catch(()=>{n||i({kind:`unsupported`,probe:null})}),()=>{n=!0}},[r.kind,e,t]),r.kind===`probing`?(0,B.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,B.jsx)(_,{className:`size-5 animate-spin text-text-subtle`})}):r.kind===`transcode`?(0,B.jsx)(W,{filePath:e,projectName:t,mode:`transcode`,probeDuration:r.probe.duration}):r.kind===`unsupported`?(0,B.jsx)(q,{filePath:e,projectName:t,probe:r.probe}):(0,B.jsx)(W,{filePath:e,projectName:t,mode:`native`,onNativeError:()=>i({kind:`probing`})})}function q({filePath:e,projectName:t,probe:n}){let r=[n?.video?.codec,n?.audio?.codec].filter(Boolean).join(` + `);return(0,B.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-3 text-text-secondary p-6 text-center`,children:[(0,B.jsx)(f,{className:`size-10 text-text-subtle`}),(0,B.jsxs)(`p`,{className:`text-sm`,children:[`This video cannot be played in the browser`,r?` (${r})`:``,`.`]}),(0,B.jsxs)(`p`,{className:`text-xs text-text-subtle max-w-sm`,children:[`Install `,(0,B.jsx)(`code`,{children:`ffmpeg`}),` on the PPM server (e.g. `,(0,B.jsx)(`code`,{children:`winget install ffmpeg`}),`, `,(0,B.jsx)(`code`,{children:`brew install ffmpeg`}),`,`,` `,(0,B.jsx)(`code`,{children:`apt install ffmpeg`}),`) and restart PPM to transcode it on the fly.`]}),(0,B.jsx)(y,{asChild:!0,variant:`outline`,size:`sm`,className:`h-11 px-4`,children:(0,B.jsxs)(`a`,{href:`${A(e,t)}&download=true`,download:!0,children:[(0,B.jsx)(g,{className:`size-4 mr-2`}),` Download file`]})})]})}export{K as VideoPreview};
@@ -1 +1 @@
1
- import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{C as t,S as n}from"./vendor-markdown-QKPNiWEd.js";import"./vendor-ui-P9Ym7hCv.js";import{Mr as r,st as i,un as a,w as o,xn as s}from"./icons-CO_II6D-.js";import{O as c,r as l}from"./api-client-F5Zi1sR0.js";import{t as u}from"./settings-store-3jIBB8gx.js";import{n as d}from"./utils-btZ8C8-R.js";import{t as f}from"./button-CsmGH5xa.js";import{t as p}from"./separator-B0xYRplF.js";var m=e(t(),1),h=n(),g={binary:`Downloading whisper.cpp`,model:`Downloading the model`,vad:`Downloading the voice detector`,verify:`Checking it runs here`},_=e=>`${Math.round(e/1e6)} MB`;function v(){let e=u(e=>e.voiceEngine),t=u(e=>e.setVoiceEngine),[n,s]=(0,m.useState)(null),[v,b]=(0,m.useState)(null),[x,S]=(0,m.useState)(!1),C=(0,m.useRef)(null),w=(0,m.useCallback)(async()=>{try{let e=await l.get(`/api/speech/status`);s(e),b(t=>t??e.model?.id??e.models.at(-1)?.id??null)}catch{}},[]);(0,m.useEffect)(()=>{w()},[w]);let T=!!n?.install&&!n.install.done;(0,m.useEffect)(()=>{if(T)return C.current=setTimeout(()=>void w(),700),()=>{C.current&&clearTimeout(C.current)}},[T,n,w]),(0,m.useEffect)(()=>{n&&!n.ready&&e===`whisper`&&t(`browser`)},[n,e,t]);let E=async()=>{if(v){S(!0);try{await l.post(`/api/speech/install`,{model:v}),await w()}catch(e){c.error(`Could not start the install`,{description:e instanceof Error?e.message:String(e)})}finally{S(!1)}}},D=async()=>{S(!0);try{await l.post(`/api/speech/uninstall`),t(`browser`),await w()}catch(e){c.error(`Could not remove Whisper`,{description:e instanceof Error?e.message:String(e)})}finally{S(!1)}},O=n?.install??null,k=O&&O.totalBytes>0?Math.round(O.receivedBytes/O.totalBytes*100):null,A=typeof window<`u`&&!window.isSecureContext;return(0,h.jsxs)(`div`,{className:`space-y-6`,children:[(0,h.jsxs)(`section`,{className:`space-y-3`,children:[(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`h3`,{className:`text-sm font-medium`,children:`Speech to text`}),(0,h.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`What the mic button in the chat box uses. This device only.`})]}),(0,h.jsxs)(`div`,{className:`flex flex-col sm:flex-row gap-2`,children:[(0,h.jsx)(y,{label:`Browser`,note:`Text appears as you speak. Chrome, Edge and Safari only — the audio goes to their servers.`,value:`browser`,current:e,onChange:t}),n?.ready&&(0,h.jsx)(y,{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:t})]}),A&&(0,h.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,h.jsx)(p,{}),(0,h.jsxs)(`section`,{className:`space-y-3`,children:[(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`h3`,{className:`text-sm font-medium`,children:`Whisper on this host`}),(0,h.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n?.ready?`Installed — whisper.cpp ${n.version}, model ${n.model?.label}.`:`Runs speech to text on the machine PPM is installed on. Nothing is sent to a cloud service.`})]}),n&&!n.installable&&(0,h.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,h.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5`,children:n.installHint??`whisper-cli on PATH`})]}),O&&!O.done&&(0,h.jsxs)(`div`,{className:`space-y-2`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,h.jsx)(a,{className:`size-3.5 animate-spin`}),(0,h.jsxs)(`span`,{children:[g[O.phase],k===null?`…`:` — ${k}%`]})]}),(0,h.jsx)(`div`,{className:`h-1.5 w-full overflow-hidden rounded-full bg-muted`,children:(0,h.jsx)(`div`,{className:`h-full bg-primary transition-[width]`,style:{width:`${k??0}%`}})})]}),O?.error&&(0,h.jsx)(`p`,{className:`text-xs text-error`,children:O.error}),n?.installable&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`div`,{className:`space-y-2`,children:n.models.map(e=>{let t=v===e.id,r=n.model?.id===e.id;return(0,h.jsxs)(`button`,{type:`button`,onClick:()=>b(e.id),className:d(`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,h.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,h.jsx)(`span`,{className:`text-sm font-medium`,children:e.label}),(0,h.jsxs)(`span`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[r&&(0,h.jsx)(o,{className:`size-3.5 text-success`}),_(e.bytes)]})]}),(0,h.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.note})]},e.id)})}),(0,h.jsxs)(`div`,{className:`flex flex-col sm:flex-row gap-2`,children:[(0,h.jsxs)(f,{onClick:E,disabled:x||T||!v||n.model?.id===v,className:`flex-1 gap-2 cursor-pointer`,children:[(0,h.jsx)(i,{className:`size-4`}),n.model?n.model.id===v?`Installed`:`Switch to ${n.models.find(e=>e.id===v)?.label}`:`Install`]}),(n.model||n.binary?.source===`bundled`)&&(0,h.jsxs)(f,{variant:`outline`,onClick:D,disabled:x||T,className:`gap-2 cursor-pointer text-error`,children:[(0,h.jsx)(r,{className:`size-4`}),`Remove`]})]})]})]})]})}function y({label:e,note:t,value:n,current:r,onChange:i}){return(0,h.jsxs)(`button`,{type:`button`,onClick:()=>i(n),className:d(`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,h.jsxs)(`span`,{className:`flex items-center gap-2 text-sm font-medium`,children:[(0,h.jsx)(s,{className:`size-4`}),e]}),(0,h.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:t})]})}export{v as VoiceSettingsSection};
1
+ import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{C as t,S as n}from"./vendor-markdown-QKPNiWEd.js";import"./vendor-ui-P9Ym7hCv.js";import{Mr as r,st as i,un as a,w as o,xn as s}from"./icons-CO_II6D-.js";import{O as c,r as l}from"./api-client-F5Zi1sR0.js";import{t as u}from"./settings-store-DIV25PM_.js";import{n as d}from"./utils-btZ8C8-R.js";import{t as f}from"./button-CsmGH5xa.js";import{t as p}from"./separator-B0xYRplF.js";var m=e(t(),1),h=n(),g={binary:`Downloading whisper.cpp`,model:`Downloading the model`,vad:`Downloading the voice detector`,verify:`Checking it runs here`},_=e=>`${Math.round(e/1e6)} MB`;function v(){let e=u(e=>e.voiceEngine),t=u(e=>e.setVoiceEngine),[n,s]=(0,m.useState)(null),[v,b]=(0,m.useState)(null),[x,S]=(0,m.useState)(!1),C=(0,m.useRef)(null),w=(0,m.useCallback)(async()=>{try{let e=await l.get(`/api/speech/status`);s(e),b(t=>t??e.model?.id??e.models.at(-1)?.id??null)}catch{}},[]);(0,m.useEffect)(()=>{w()},[w]);let T=!!n?.install&&!n.install.done;(0,m.useEffect)(()=>{if(T)return C.current=setTimeout(()=>void w(),700),()=>{C.current&&clearTimeout(C.current)}},[T,n,w]),(0,m.useEffect)(()=>{n&&!n.ready&&e===`whisper`&&t(`browser`)},[n,e,t]);let E=async()=>{if(v){S(!0);try{await l.post(`/api/speech/install`,{model:v}),await w()}catch(e){c.error(`Could not start the install`,{description:e instanceof Error?e.message:String(e)})}finally{S(!1)}}},D=async()=>{S(!0);try{await l.post(`/api/speech/uninstall`),t(`browser`),await w()}catch(e){c.error(`Could not remove Whisper`,{description:e instanceof Error?e.message:String(e)})}finally{S(!1)}},O=n?.install??null,k=O&&O.totalBytes>0?Math.round(O.receivedBytes/O.totalBytes*100):null,A=typeof window<`u`&&!window.isSecureContext;return(0,h.jsxs)(`div`,{className:`space-y-6`,children:[(0,h.jsxs)(`section`,{className:`space-y-3`,children:[(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`h3`,{className:`text-sm font-medium`,children:`Speech to text`}),(0,h.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`What the mic button in the chat box uses. This device only.`})]}),(0,h.jsxs)(`div`,{className:`flex flex-col sm:flex-row gap-2`,children:[(0,h.jsx)(y,{label:`Browser`,note:`Text appears as you speak. Chrome, Edge and Safari only — the audio goes to their servers.`,value:`browser`,current:e,onChange:t}),n?.ready&&(0,h.jsx)(y,{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:t})]}),A&&(0,h.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,h.jsx)(p,{}),(0,h.jsxs)(`section`,{className:`space-y-3`,children:[(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`h3`,{className:`text-sm font-medium`,children:`Whisper on this host`}),(0,h.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n?.ready?`Installed — whisper.cpp ${n.version}, model ${n.model?.label}.`:`Runs speech to text on the machine PPM is installed on. Nothing is sent to a cloud service.`})]}),n&&!n.installable&&(0,h.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,h.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5`,children:n.installHint??`whisper-cli on PATH`})]}),O&&!O.done&&(0,h.jsxs)(`div`,{className:`space-y-2`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,h.jsx)(a,{className:`size-3.5 animate-spin`}),(0,h.jsxs)(`span`,{children:[g[O.phase],k===null?`…`:` — ${k}%`]})]}),(0,h.jsx)(`div`,{className:`h-1.5 w-full overflow-hidden rounded-full bg-muted`,children:(0,h.jsx)(`div`,{className:`h-full bg-primary transition-[width]`,style:{width:`${k??0}%`}})})]}),O?.error&&(0,h.jsx)(`p`,{className:`text-xs text-error`,children:O.error}),n?.installable&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`div`,{className:`space-y-2`,children:n.models.map(e=>{let t=v===e.id,r=n.model?.id===e.id;return(0,h.jsxs)(`button`,{type:`button`,onClick:()=>b(e.id),className:d(`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,h.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,h.jsx)(`span`,{className:`text-sm font-medium`,children:e.label}),(0,h.jsxs)(`span`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[r&&(0,h.jsx)(o,{className:`size-3.5 text-success`}),_(e.bytes)]})]}),(0,h.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.note})]},e.id)})}),(0,h.jsxs)(`div`,{className:`flex flex-col sm:flex-row gap-2`,children:[(0,h.jsxs)(f,{onClick:E,disabled:x||T||!v||n.model?.id===v,className:`flex-1 gap-2 cursor-pointer`,children:[(0,h.jsx)(i,{className:`size-4`}),n.model?n.model.id===v?`Installed`:`Switch to ${n.models.find(e=>e.id===v)?.label}`:`Install`]}),(n.model||n.binary?.source===`bundled`)&&(0,h.jsxs)(f,{variant:`outline`,onClick:D,disabled:x||T,className:`gap-2 cursor-pointer text-error`,children:[(0,h.jsx)(r,{className:`size-4`}),`Remove`]})]})]})]})]})}function y({label:e,note:t,value:n,current:r,onChange:i}){return(0,h.jsxs)(`button`,{type:`button`,onClick:()=>i(n),className:d(`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,h.jsxs)(`span`,{className:`flex items-center gap-2 text-sm font-medium`,children:[(0,h.jsx)(s,{className:`size-4`}),e]}),(0,h.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:t})]})}export{v as VoiceSettingsSection};
@@ -1 +1 @@
1
- import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{C as t}from"./vendor-markdown-QKPNiWEd.js";import{T as n}from"./panel-store-DrSH3Nhp.js";var r=e(t(),1),i=new Map,a=new Map,o=new Set;function s(e,t){t?i.set(e,t):i.delete(e);for(let e of o)e()}function c(e,t=2e3){let n=p(e);return n?Promise.resolve(n):new Promise(n=>{let r=e=>{o.delete(i),clearTimeout(a),n(e)},i=()=>{let t=p(e);t&&r(t)},a=setTimeout(()=>r(null),t);o.add(i)})}var l=new Set;function u(e){l.add(e)}function d(e){return l.has(e)}function f(e){l.delete(e)}function p(e){return i.get(e)??null}function m(e,t){if((a.get(e)??null)!==t){t?a.set(e,t):a.delete(e);for(let e of o)e()}}function h(e){return e?a.get(e)??null:null}function g(e){return o.add(e),()=>{o.delete(e)}}function _(e){return(0,r.useSyncExternalStore)(g,(0,r.useCallback)(()=>h(e),[e]))}function v(e){return _(n(e))?.pipWindow.document.body}export{m as a,c,s as i,h as l,d as n,v as o,u as r,_ as s,f as t,p as u};
1
+ import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{C as t}from"./vendor-markdown-QKPNiWEd.js";import{T as n}from"./panel-store-1X6yM3XZ.js";var r=e(t(),1),i=new Map,a=new Map,o=new Set;function s(e,t){t?i.set(e,t):i.delete(e);for(let e of o)e()}function c(e,t=2e3){let n=p(e);return n?Promise.resolve(n):new Promise(n=>{let r=e=>{o.delete(i),clearTimeout(a),n(e)},i=()=>{let t=p(e);t&&r(t)},a=setTimeout(()=>r(null),t);o.add(i)})}var l=new Set;function u(e){l.add(e)}function d(e){return l.has(e)}function f(e){l.delete(e)}function p(e){return i.get(e)??null}function m(e,t){if((a.get(e)??null)!==t){t?a.set(e,t):a.delete(e);for(let e of o)e()}}function h(e){return e?a.get(e)??null:null}function g(e){return o.add(e),()=>{o.delete(e)}}function _(e){return(0,r.useSyncExternalStore)(g,(0,r.useCallback)(()=>h(e),[e]))}function v(e){return _(n(e))?.pipWindow.document.body}export{m as a,c,s as i,h as l,d as n,v as o,u as r,_ as s,f as t,p as u};
@@ -0,0 +1 @@
1
+ import{t as e}from"./react-CzUPVyyG.js";var t=[`n`,`s`,`e`,`w`,`ne`,`nw`,`se`,`sw`],n={w:360,h:240},r={w:880,h:560},i=48,a=780,o=(e,t,n)=>Math.min(n,Math.max(t,e));function s(e){return 30+o(Math.trunc(e),0,8)}function c(e,t){let r=Math.max(n.w,Math.min(e.w,Math.max(t.w,n.w))),i=Math.max(n.h,Math.min(e.h,Math.max(t.h,n.h))),a=o(e.x,48-r,Math.max(48-r,t.w-48)),s=o(e.y,0,Math.max(0,t.h-48));return{x:Math.round(a),y:Math.round(s),w:Math.round(r),h:Math.round(i)}}function l(e,t,r,i,a=n){let{x:o,y:s,w:c,h:l}=e;if(t.includes(`e`))c=Math.max(a.w,e.w+r);else if(t.includes(`w`)){let t=e.x+e.w;c=Math.max(a.w,e.w-r),o=t-c}if(t.includes(`s`))l=Math.max(a.h,e.h+i);else if(t.includes(`n`)){let t=e.y+e.h;l=Math.max(a.h,e.h-i),s=t-l}return{x:o,y:s,w:c,h:l}}function u(e,t){let a=Math.min(r.w,Math.max(n.w,t.w-i*2)),o=Math.min(r.h,Math.max(n.h,t.h-i*2)),s=e.length%8;return c({x:i+s*24,y:i+s*24,w:a,h:o},t)}function d(e,t){let r=Math.min(t.h-i*2,a),o=Math.max(n.w,Math.round(r*9/16)),s=e.length%8;return c({x:t.w-i-o-s*24,y:i+s*24,w:o,h:r},t)}function f(e,t,n,r){return c({...e,x:e.x+t,y:e.y+n},r)}var p=[`explorer`,`agent-session`,`system-monitor`,`tab-host`,`remote-desktop`,`settings`],m=`ppm-windows`,h=p.filter(e=>e!==`agent-session`),g=[`normal`,`maximized`,`minimized`];function _(e){if(!e||typeof e!=`object`)return!1;let t=e;return[`x`,`y`,`w`,`h`].every(e=>typeof t[e]==`number`&&Number.isFinite(t[e]))}function v(e){if(e===void 0)return!0;if(!e||typeof e!=`object`||Array.isArray(e))return!1;try{return JSON.stringify(e),!0}catch{return!1}}function y(e){return v(e.payload)?{id:e.id,kind:e.kind,rect:e.rect,state:e.state,payload:e.payload}:null}function b(e){try{let t=[...e].sort((e,t)=>e.rank-t.rank).map(y).filter(e=>e!==null);t.length===0?localStorage.removeItem(m):localStorage.setItem(m,JSON.stringify(t))}catch{}}function x(e){let t=null;try{t=localStorage.getItem(m)}catch{return[]}if(!t)return[];let n;try{n=JSON.parse(t)}catch{return[]}if(!Array.isArray(n))return[];let r=[];for(let t of n){if(!t||typeof t!=`object`)continue;let n=t;if(typeof n.id!=`string`||!h.includes(n.kind)||!_(n.rect)||!v(n.payload))continue;let i=g.includes(n.state)?n.state:`normal`;r.push({id:n.id,kind:n.kind,rect:c(n.rect,e),state:i,payload:n.payload})}return r}var S={w:1280,h:800},C=e=>Object.values(e).sort((e,t)=>e.rank-t.rank);function w(e){let t={};return e.forEach((e,n)=>{t[e.id]=e.rank===n?e:{...e,rank:n}}),t}function T(e){b(Object.values(e))}function E(){return`win-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}var D=e((e,t)=>({windows:{},bounds:S,restored:!1,open:(n,r,i)=>{let{windows:a,bounds:o}=t(),s=C(a);if(s.length>=8){let e=s[0];return t().focus(e.id),e.id}let l=E(),d=i?c(i,o):u(s.map(e=>e.rect),o),f=w([...s,{id:l,kind:n,rect:d,rank:s.length,state:`normal`,payload:r}]);return e({windows:f}),T(f),l},close:n=>{let{windows:r}=t();if(!r[n])return;let i=w(C(r).filter(e=>e.id!==n));e({windows:i}),T(i)},focus:n=>{let{windows:r}=t(),i=r[n];if(!i)return;let a=C(r);if(a[a.length-1]?.id===n)return;let o=w([...a.filter(e=>e.id!==n),i]);e({windows:o}),T(o)},move:(n,r)=>{let{windows:i,bounds:a}=t(),o=i[n];if(!o)return;let s=c({...o.rect,...r},a),l={...i,[n]:{...o,rect:s}};e({windows:l}),T(l)},resize:(n,r)=>{let{windows:i,bounds:a}=t(),o=i[n];if(!o)return;let s={...i,[n]:{...o,rect:c(r,a)}};e({windows:s}),T(s)},setState:(n,r)=>{let{windows:i}=t(),a=i[n];if(!a||a.state===r)return;let o={...i,[n]:{...a,state:r}};e({windows:o}),T(o)},setPayload:(n,r)=>{let{windows:i}=t(),a=i[n];if(!a)return;let o={...a.payload,...r};if(Object.entries(o).every(([e,t])=>a.payload?.[e]===t)&&Object.keys(o).length===Object.keys(a.payload??{}).length)return;let s={...i,[n]:{...a,payload:o}};e({windows:s}),T(s)},setBounds:n=>{let r=t();if(r.bounds.w===n.w&&r.bounds.h===n.h)return;let i={};for(let e of Object.values(r.windows)){let t=c(e.rect,n);i[e.id]=t.x===e.rect.x&&t.y===e.rect.y&&t.w===e.rect.w&&t.h===e.rect.h?e:{...e,rect:t}}e({bounds:n,windows:i})},restoreAll:n=>{t().restored||e({bounds:n,windows:w(x(n).slice(0,8).map((e,t)=>({id:e.id,kind:e.kind,rect:e.rect,rank:t,state:e.state,payload:e.payload}))),restored:!0})}}));function O(e){return C(e)}export{c as a,s as c,l as i,O as n,f as o,t as r,d as s,D as t};
@@ -9,7 +9,7 @@
9
9
  <link rel="preconnect" href="https://fonts.googleapis.com" />
10
10
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
11
11
  <link href="https://fonts.googleapis.com/css2?family=Geist+Mono:wght@400;500;600;700&family=Geist:wght@400;500;600;700&display=swap" rel="stylesheet" />
12
- <script type="module" crossorigin src="/assets/index-DQCw6d-2.js"></script>
12
+ <script type="module" crossorigin src="/assets/index-CIscPw4g.js"></script>
13
13
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-C5c2KzVm.js">
14
14
  <link rel="modulepreload" crossorigin href="/assets/preload-helper-BEFjQwLd.js">
15
15
  <link rel="modulepreload" crossorigin href="/assets/vendor-markdown-QKPNiWEd.js">
@@ -19,12 +19,12 @@
19
19
  <link rel="modulepreload" crossorigin href="/assets/createLucideIcon-DBXq3G0e.js">
20
20
  <link rel="modulepreload" crossorigin href="/assets/api-client-F5Zi1sR0.js">
21
21
  <link rel="modulepreload" crossorigin href="/assets/react-CzUPVyyG.js">
22
- <link rel="modulepreload" crossorigin href="/assets/window-store-B4cbZ5rr.js">
22
+ <link rel="modulepreload" crossorigin href="/assets/window-store-vo1N70nK.js">
23
23
  <link rel="modulepreload" crossorigin href="/assets/project-store-CCimwgGF.js">
24
- <link rel="modulepreload" crossorigin href="/assets/panel-store-DrSH3Nhp.js">
25
- <link rel="modulepreload" crossorigin href="/assets/settings-store-3jIBB8gx.js">
24
+ <link rel="modulepreload" crossorigin href="/assets/panel-store-1X6yM3XZ.js">
25
+ <link rel="modulepreload" crossorigin href="/assets/settings-store-DIV25PM_.js">
26
26
  <link rel="modulepreload" crossorigin href="/assets/file-store-DCU7_YyB.js">
27
- <link rel="modulepreload" crossorigin href="/assets/window-pip-registry-dxrBFfkP.js">
27
+ <link rel="modulepreload" crossorigin href="/assets/window-pip-registry-Bl--fK8-.js">
28
28
  <link rel="modulepreload" crossorigin href="/assets/portal-container-context-NFSuymMu.js">
29
29
  <link rel="modulepreload" crossorigin href="/assets/icons-CO_II6D-.js">
30
30
  <link rel="modulepreload" crossorigin href="/assets/dialog-z8PLkL8n.js">
@@ -42,7 +42,7 @@
42
42
  <link rel="modulepreload" crossorigin href="/assets/format-date-Fd9tpNaw.js">
43
43
  <link rel="modulepreload" crossorigin href="/assets/git-repo-store-CdoOpvmf.js">
44
44
  <link rel="modulepreload" crossorigin href="/assets/ws-auth-J3hw0Mhc.js">
45
- <link rel="modulepreload" crossorigin href="/assets/tab-store-CUPgQIQz.js">
45
+ <link rel="modulepreload" crossorigin href="/assets/tab-store-D33icgdA.js">
46
46
  <link rel="modulepreload" crossorigin href="/assets/apply-theme-aVoqSG0I.js">
47
47
  <link rel="modulepreload" crossorigin href="/assets/resolve-theme-B87m6l4i.js">
48
48
  <link rel="stylesheet" crossorigin href="/assets/index-BmsPSBtF.css">
Binary file
Binary file
package/dist/web/sw.js CHANGED
@@ -1 +1 @@
1
- try{self[`workbox:core:7.3.0`]&&_()}catch{}var e=(e,...t)=>{let n=e;return t.length>0&&(n+=` :: ${JSON.stringify(t)}`),n},t=class extends Error{constructor(t,n){let r=e(t,n);super(r),this.name=t,this.details=n}},n={googleAnalytics:`googleAnalytics`,precache:`precache-v2`,prefix:`workbox`,runtime:`runtime`,suffix:typeof registration<`u`?registration.scope:``},r=e=>[n.prefix,e,n.suffix].filter(e=>e&&e.length>0).join(`-`),i=e=>{for(let t of Object.keys(n))e(t)},a={updateDetails:e=>{i(t=>{typeof e[t]==`string`&&(n[t]=e[t])})},getGoogleAnalyticsName:e=>e||r(n.googleAnalytics),getPrecacheName:e=>e||r(n.precache),getPrefix:()=>n.prefix,getRuntimeName:e=>e||r(n.runtime),getSuffix:()=>n.suffix};function o(e,t){let n=t();return e.waitUntil(n),n}try{self[`workbox:precaching:7.3.0`]&&_()}catch{}var s=`__WB_REVISION__`;function c(e){if(!e)throw new t(`add-to-cache-list-unexpected-type`,{entry:e});if(typeof e==`string`){let t=new URL(e,location.href);return{cacheKey:t.href,url:t.href}}let{revision:n,url:r}=e;if(!r)throw new t(`add-to-cache-list-unexpected-type`,{entry:e});if(!n){let e=new URL(r,location.href);return{cacheKey:e.href,url:e.href}}let i=new URL(r,location.href),a=new URL(r,location.href);return i.searchParams.set(s,n),{cacheKey:i.href,url:a.href}}var l=class{constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async({request:e,state:t})=>{t&&(t.originalRequest=e)},this.cachedResponseWillBeUsed=async({event:e,state:t,cachedResponse:n})=>{if(e.type===`install`&&t&&t.originalRequest&&t.originalRequest instanceof Request){let e=t.originalRequest.url;n?this.notUpdatedURLs.push(e):this.updatedURLs.push(e)}return n}}},u=class{constructor({precacheController:e}){this.cacheKeyWillBeUsed=async({request:e,params:t})=>{let n=t?.cacheKey||this._precacheController.getCacheKeyForURL(e.url);return n?new Request(n,{headers:e.headers}):e},this._precacheController=e}},d;function f(){if(d===void 0){let e=new Response(``);if(`body`in e)try{new Response(e.body),d=!0}catch{d=!1}d=!1}return d}async function p(e,n){let r=null;if(e.url&&(r=new URL(e.url).origin),r!==self.location.origin)throw new t(`cross-origin-copy-response`,{origin:r});let i=e.clone(),a={headers:new Headers(i.headers),status:i.status,statusText:i.statusText},o=n?n(a):a,s=f()?i.body:await i.blob();return new Response(s,o)}var m=e=>new URL(String(e),location.href).href.replace(RegExp(`^${location.origin}`),``);function h(e,t){let n=new URL(e);for(let e of t)n.searchParams.delete(e);return n.href}async function g(e,t,n,r){let i=h(t.url,n);if(t.url===i)return e.match(t,r);let a=Object.assign(Object.assign({},r),{ignoreSearch:!0}),o=await e.keys(t,a);for(let t of o)if(i===h(t.url,n))return e.match(t,r)}var v=class{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}},y=new Set;async function b(){for(let e of y)await e()}function x(e){return new Promise(t=>setTimeout(t,e))}try{self[`workbox:strategies:7.3.0`]&&_()}catch{}function S(e){return typeof e==`string`?new Request(e):e}var C=class{constructor(e,t){this._cacheKeys={},Object.assign(this,t),this.event=t.event,this._strategy=e,this._handlerDeferred=new v,this._extendLifetimePromises=[],this._plugins=[...e.plugins],this._pluginStateMap=new Map;for(let e of this._plugins)this._pluginStateMap.set(e,{});this.event.waitUntil(this._handlerDeferred.promise)}async fetch(e){let{event:n}=this,r=S(e);if(r.mode===`navigate`&&n instanceof FetchEvent&&n.preloadResponse){let e=await n.preloadResponse;if(e)return e}let i=this.hasCallback(`fetchDidFail`)?r.clone():null;try{for(let e of this.iterateCallbacks(`requestWillFetch`))r=await e({request:r.clone(),event:n})}catch(e){if(e instanceof Error)throw new t(`plugin-error-request-will-fetch`,{thrownErrorMessage:e.message})}let a=r.clone();try{let e;e=await fetch(r,r.mode===`navigate`?void 0:this._strategy.fetchOptions);for(let t of this.iterateCallbacks(`fetchDidSucceed`))e=await t({event:n,request:a,response:e});return e}catch(e){throw i&&await this.runCallbacks(`fetchDidFail`,{error:e,event:n,originalRequest:i.clone(),request:a.clone()}),e}}async fetchAndCachePut(e){let t=await this.fetch(e),n=t.clone();return this.waitUntil(this.cachePut(e,n)),t}async cacheMatch(e){let t=S(e),n,{cacheName:r,matchOptions:i}=this._strategy,a=await this.getCacheKey(t,`read`),o=Object.assign(Object.assign({},i),{cacheName:r});n=await caches.match(a,o);for(let e of this.iterateCallbacks(`cachedResponseWillBeUsed`))n=await e({cacheName:r,matchOptions:i,cachedResponse:n,request:a,event:this.event})||void 0;return n}async cachePut(e,n){let r=S(e);await x(0);let i=await this.getCacheKey(r,`write`);if(!n)throw new t(`cache-put-with-no-response`,{url:m(i.url)});let a=await this._ensureResponseSafeToCache(n);if(!a)return!1;let{cacheName:o,matchOptions:s}=this._strategy,c=await self.caches.open(o),l=this.hasCallback(`cacheDidUpdate`),u=l?await g(c,i.clone(),[`__WB_REVISION__`],s):null;try{await c.put(i,l?a.clone():a)}catch(e){if(e instanceof Error)throw e.name===`QuotaExceededError`&&await b(),e}for(let e of this.iterateCallbacks(`cacheDidUpdate`))await e({cacheName:o,oldResponse:u,newResponse:a.clone(),request:i,event:this.event});return!0}async getCacheKey(e,t){let n=`${e.url} | ${t}`;if(!this._cacheKeys[n]){let r=e;for(let e of this.iterateCallbacks(`cacheKeyWillBeUsed`))r=S(await e({mode:t,request:r,event:this.event,params:this.params}));this._cacheKeys[n]=r}return this._cacheKeys[n]}hasCallback(e){for(let t of this._strategy.plugins)if(e in t)return!0;return!1}async runCallbacks(e,t){for(let n of this.iterateCallbacks(e))await n(t)}*iterateCallbacks(e){for(let t of this._strategy.plugins)if(typeof t[e]==`function`){let n=this._pluginStateMap.get(t);yield r=>{let i=Object.assign(Object.assign({},r),{state:n});return t[e](i)}}}waitUntil(e){return this._extendLifetimePromises.push(e),e}async doneWaiting(){for(;this._extendLifetimePromises.length;){let e=this._extendLifetimePromises.splice(0),t=(await Promise.allSettled(e)).find(e=>e.status===`rejected`);if(t)throw t.reason}}destroy(){this._handlerDeferred.resolve(null)}async _ensureResponseSafeToCache(e){let t=e,n=!1;for(let e of this.iterateCallbacks(`cacheWillUpdate`))if(t=await e({request:this.request,response:t,event:this.event})||void 0,n=!0,!t)break;return n||t&&t.status!==200&&(t=void 0),t}},w=class{constructor(e={}){this.cacheName=a.getRuntimeName(e.cacheName),this.plugins=e.plugins||[],this.fetchOptions=e.fetchOptions,this.matchOptions=e.matchOptions}handle(e){let[t]=this.handleAll(e);return t}handleAll(e){e instanceof FetchEvent&&(e={event:e,request:e.request});let t=e.event,n=typeof e.request==`string`?new Request(e.request):e.request,r=`params`in e?e.params:void 0,i=new C(this,{event:t,request:n,params:r}),a=this._getResponse(i,n,t);return[a,this._awaitComplete(a,i,n,t)]}async _getResponse(e,n,r){await e.runCallbacks(`handlerWillStart`,{event:r,request:n});let i;try{if(i=await this._handle(n,e),!i||i.type===`error`)throw new t(`no-response`,{url:n.url})}catch(t){if(t instanceof Error){for(let a of e.iterateCallbacks(`handlerDidError`))if(i=await a({error:t,event:r,request:n}),i)break}if(!i)throw t}for(let t of e.iterateCallbacks(`handlerWillRespond`))i=await t({event:r,request:n,response:i});return i}async _awaitComplete(e,t,n,r){let i,a;try{i=await e}catch{}try{await t.runCallbacks(`handlerDidRespond`,{event:r,request:n,response:i}),await t.doneWaiting()}catch(e){e instanceof Error&&(a=e)}if(await t.runCallbacks(`handlerDidComplete`,{event:r,request:n,response:i,error:a}),t.destroy(),a)throw a}},T=class e extends w{constructor(t={}){t.cacheName=a.getPrecacheName(t.cacheName),super(t),this._fallbackToNetwork=t.fallbackToNetwork!==!1,this.plugins.push(e.copyRedirectedCacheableResponsesPlugin)}async _handle(e,t){return await t.cacheMatch(e)||(t.event&&t.event.type===`install`?await this._handleInstall(e,t):await this._handleFetch(e,t))}async _handleFetch(e,n){let r,i=n.params||{};if(this._fallbackToNetwork){let t=i.integrity,a=e.integrity,o=!a||a===t;r=await n.fetch(new Request(e,{integrity:e.mode===`no-cors`?void 0:a||t})),t&&o&&e.mode!==`no-cors`&&(this._useDefaultCacheabilityPluginIfNeeded(),await n.cachePut(e,r.clone()))}else throw new t(`missing-precache-entry`,{cacheName:this.cacheName,url:e.url});return r}async _handleInstall(e,n){this._useDefaultCacheabilityPluginIfNeeded();let r=await n.fetch(e);if(!await n.cachePut(e,r.clone()))throw new t(`bad-precaching-response`,{url:e.url,status:r.status});return r}_useDefaultCacheabilityPluginIfNeeded(){let t=null,n=0;for(let[r,i]of this.plugins.entries())i!==e.copyRedirectedCacheableResponsesPlugin&&(i===e.defaultPrecacheCacheabilityPlugin&&(t=r),i.cacheWillUpdate&&n++);n===0?this.plugins.push(e.defaultPrecacheCacheabilityPlugin):n>1&&t!==null&&this.plugins.splice(t,1)}};T.defaultPrecacheCacheabilityPlugin={async cacheWillUpdate({response:e}){return!e||e.status>=400?null:e}},T.copyRedirectedCacheableResponsesPlugin={async cacheWillUpdate({response:e}){return e.redirected?await p(e):e}};var E=class{constructor({cacheName:e,plugins:t=[],fallbackToNetwork:n=!0}={}){this._urlsToCacheKeys=new Map,this._urlsToCacheModes=new Map,this._cacheKeysToIntegrities=new Map,this._strategy=new T({cacheName:a.getPrecacheName(e),plugins:[...t,new u({precacheController:this})],fallbackToNetwork:n}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this._strategy}precache(e){this.addToCacheList(e),this._installAndActiveListenersAdded||=(self.addEventListener(`install`,this.install),self.addEventListener(`activate`,this.activate),!0)}addToCacheList(e){let n=[];for(let r of e){typeof r==`string`?n.push(r):r&&r.revision===void 0&&n.push(r.url);let{cacheKey:e,url:i}=c(r),a=typeof r!=`string`&&r.revision?`reload`:`default`;if(this._urlsToCacheKeys.has(i)&&this._urlsToCacheKeys.get(i)!==e)throw new t(`add-to-cache-list-conflicting-entries`,{firstEntry:this._urlsToCacheKeys.get(i),secondEntry:e});if(typeof r!=`string`&&r.integrity){if(this._cacheKeysToIntegrities.has(e)&&this._cacheKeysToIntegrities.get(e)!==r.integrity)throw new t(`add-to-cache-list-conflicting-integrities`,{url:i});this._cacheKeysToIntegrities.set(e,r.integrity)}if(this._urlsToCacheKeys.set(i,e),this._urlsToCacheModes.set(i,a),n.length>0){let e=`Workbox is precaching URLs without revision info: ${n.join(`, `)}\nThis is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(e)}}}install(e){return o(e,async()=>{let t=new l;this.strategy.plugins.push(t);for(let[t,n]of this._urlsToCacheKeys){let r=this._cacheKeysToIntegrities.get(n),i=this._urlsToCacheModes.get(t),a=new Request(t,{integrity:r,cache:i,credentials:`same-origin`});await Promise.all(this.strategy.handleAll({params:{cacheKey:n},request:a,event:e}))}let{updatedURLs:n,notUpdatedURLs:r}=t;return{updatedURLs:n,notUpdatedURLs:r}})}activate(e){return o(e,async()=>{let e=await self.caches.open(this.strategy.cacheName),t=await e.keys(),n=new Set(this._urlsToCacheKeys.values()),r=[];for(let i of t)n.has(i.url)||(await e.delete(i),r.push(i.url));return{deletedURLs:r}})}getURLsToCacheKeys(){return this._urlsToCacheKeys}getCachedURLs(){return[...this._urlsToCacheKeys.keys()]}getCacheKeyForURL(e){let t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}getIntegrityForCacheKey(e){return this._cacheKeysToIntegrities.get(e)}async matchPrecache(e){let t=e instanceof Request?e.url:e,n=this.getCacheKeyForURL(t);if(n)return(await self.caches.open(this.strategy.cacheName)).match(n)}createHandlerBoundToURL(e){let n=this.getCacheKeyForURL(e);if(!n)throw new t(`non-precached-url`,{url:e});return t=>(t.request=new Request(e),t.params=Object.assign({cacheKey:n},t.params),this.strategy.handle(t))}},D,O=()=>(D||=new E,D);try{self[`workbox:routing:7.3.0`]&&_()}catch{}var k=e=>e&&typeof e==`object`?e:{handle:e},A=class{constructor(e,t,n=`GET`){this.handler=k(t),this.match=e,this.method=n}setCatchHandler(e){this.catchHandler=k(e)}},j=class extends A{constructor(e,t,n){super(({url:t})=>{let n=e.exec(t.href);if(n&&!(t.origin!==location.origin&&n.index!==0))return n.slice(1)},t,n)}},M=class{constructor(){this._routes=new Map,this._defaultHandlerMap=new Map}get routes(){return this._routes}addFetchListener(){self.addEventListener(`fetch`,(e=>{let{request:t}=e,n=this.handleRequest({request:t,event:e});n&&e.respondWith(n)}))}addCacheListener(){self.addEventListener(`message`,(e=>{if(e.data&&e.data.type===`CACHE_URLS`){let{payload:t}=e.data,n=Promise.all(t.urlsToCache.map(t=>{typeof t==`string`&&(t=[t]);let n=new Request(...t);return this.handleRequest({request:n,event:e})}));e.waitUntil(n),e.ports&&e.ports[0]&&n.then(()=>e.ports[0].postMessage(!0))}}))}handleRequest({request:e,event:t}){let n=new URL(e.url,location.href);if(!n.protocol.startsWith(`http`))return;let r=n.origin===location.origin,{params:i,route:a}=this.findMatchingRoute({event:t,request:e,sameOrigin:r,url:n}),o=a&&a.handler,s=e.method;if(!o&&this._defaultHandlerMap.has(s)&&(o=this._defaultHandlerMap.get(s)),!o)return;let c;try{c=o.handle({url:n,request:e,event:t,params:i})}catch(e){c=Promise.reject(e)}let l=a&&a.catchHandler;return c instanceof Promise&&(this._catchHandler||l)&&(c=c.catch(async r=>{if(l)try{return await l.handle({url:n,request:e,event:t,params:i})}catch(e){e instanceof Error&&(r=e)}if(this._catchHandler)return this._catchHandler.handle({url:n,request:e,event:t});throw r})),c}findMatchingRoute({url:e,sameOrigin:t,request:n,event:r}){let i=this._routes.get(n.method)||[];for(let a of i){let i,o=a.match({url:e,sameOrigin:t,request:n,event:r});if(o)return i=o,(Array.isArray(i)&&i.length===0||o.constructor===Object&&Object.keys(o).length===0||typeof o==`boolean`)&&(i=void 0),{route:a,params:i}}return{}}setDefaultHandler(e,t=`GET`){this._defaultHandlerMap.set(t,k(e))}setCatchHandler(e){this._catchHandler=k(e)}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(e){if(!this._routes.has(e.method))throw new t(`unregister-route-but-not-found-with-method`,{method:e.method});let n=this._routes.get(e.method).indexOf(e);if(n>-1)this._routes.get(e.method).splice(n,1);else throw new t(`unregister-route-route-not-registered`)}},N,P=()=>(N||(N=new M,N.addFetchListener(),N.addCacheListener()),N);function F(e,n,r){let i;if(typeof e==`string`){let t=new URL(e,location.href);i=new A(({url:e})=>e.href===t.href,n,r)}else if(e instanceof RegExp)i=new j(e,n,r);else if(typeof e==`function`)i=new A(e,n,r);else if(e instanceof A)i=e;else throw new t(`unsupported-route-type`,{moduleName:`workbox-routing`,funcName:`registerRoute`,paramName:`capture`});return P().registerRoute(i),i}function I(e,t=[]){for(let n of[...e.searchParams.keys()])t.some(e=>e.test(n))&&e.searchParams.delete(n);return e}function*L(e,{ignoreURLParametersMatching:t=[/^utm_/,/^fbclid$/],directoryIndex:n=`index.html`,cleanURLs:r=!0,urlManipulation:i}={}){let a=new URL(e,location.href);a.hash=``,yield a.href;let o=I(a,t);if(yield o.href,n&&o.pathname.endsWith(`/`)){let e=new URL(o.href);e.pathname+=n,yield e.href}if(r){let e=new URL(o.href);e.pathname+=`.html`,yield e.href}if(i){let e=i({url:a});for(let t of e)yield t.href}}var R=class extends A{constructor(e,t){super(({request:n})=>{let r=e.getURLsToCacheKeys();for(let i of L(n.url,t)){let t=r.get(i);if(t)return{cacheKey:t,integrity:e.getIntegrityForCacheKey(t)}}},e.strategy)}};function z(e){F(new R(O(),e))}var B=`-precache-`,V=async(e,t=B)=>{let n=(await self.caches.keys()).filter(n=>n.includes(t)&&n.includes(self.registration.scope)&&n!==e);return await Promise.all(n.map(e=>self.caches.delete(e))),n};function H(){self.addEventListener(`activate`,(e=>{let t=a.getPrecacheName();e.waitUntil(V(t).then(e=>{}))}))}function U(e){O().precache(e)}function W(e,t){U(e),z(t)}var G=class extends w{async _handle(e,n){let r=await n.cacheMatch(e),i;if(!r)try{r=await n.fetchAndCachePut(e)}catch(e){e instanceof Error&&(i=e)}if(!r)throw new t(`no-response`,{url:e.url,error:i});return r}};W([{"revision":"5f35d30a107ac968c976563255137da9","url":"index.html"},{"revision":"26dccd02a2ef7522892015154f5e3680","url":"manifest.webmanifest"},{"revision":"a0fb34fc84eb148d51812cd62669f20d","url":"icon-512.svg"},{"revision":"a0fb34fc84eb148d51812cd62669f20d","url":"icon-192.svg"},{"revision":null,"url":"assets/index-DQCw6d-2.js"},{"revision":null,"url":"assets/index-BmsPSBtF.css"},{"revision":"a0fb34fc84eb148d51812cd62669f20d","url":"icon-192.svg"},{"revision":"a0fb34fc84eb148d51812cd62669f20d","url":"icon-512.svg"},{"revision":"26dccd02a2ef7522892015154f5e3680","url":"manifest.webmanifest"}]),H();var K=e=>(e.headers.get(`content-type`)??``).startsWith(`text/html`);F(({url:e})=>e.pathname.startsWith(`/assets/`),new G({cacheName:`ppm-assets`,plugins:[{cacheWillUpdate:async({response:e})=>K(e)?null:e,cachedResponseWillBeUsed:async({cachedResponse:e})=>e&&K(e)?null:e}]})),self.skipWaiting(),self.addEventListener(`activate`,()=>{self.clients.claim()});
1
+ try{self[`workbox:core:7.3.0`]&&_()}catch{}var e=(e,...t)=>{let n=e;return t.length>0&&(n+=` :: ${JSON.stringify(t)}`),n},t=class extends Error{constructor(t,n){let r=e(t,n);super(r),this.name=t,this.details=n}},n={googleAnalytics:`googleAnalytics`,precache:`precache-v2`,prefix:`workbox`,runtime:`runtime`,suffix:typeof registration<`u`?registration.scope:``},r=e=>[n.prefix,e,n.suffix].filter(e=>e&&e.length>0).join(`-`),i=e=>{for(let t of Object.keys(n))e(t)},a={updateDetails:e=>{i(t=>{typeof e[t]==`string`&&(n[t]=e[t])})},getGoogleAnalyticsName:e=>e||r(n.googleAnalytics),getPrecacheName:e=>e||r(n.precache),getPrefix:()=>n.prefix,getRuntimeName:e=>e||r(n.runtime),getSuffix:()=>n.suffix};function o(e,t){let n=t();return e.waitUntil(n),n}try{self[`workbox:precaching:7.3.0`]&&_()}catch{}var s=`__WB_REVISION__`;function c(e){if(!e)throw new t(`add-to-cache-list-unexpected-type`,{entry:e});if(typeof e==`string`){let t=new URL(e,location.href);return{cacheKey:t.href,url:t.href}}let{revision:n,url:r}=e;if(!r)throw new t(`add-to-cache-list-unexpected-type`,{entry:e});if(!n){let e=new URL(r,location.href);return{cacheKey:e.href,url:e.href}}let i=new URL(r,location.href),a=new URL(r,location.href);return i.searchParams.set(s,n),{cacheKey:i.href,url:a.href}}var l=class{constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async({request:e,state:t})=>{t&&(t.originalRequest=e)},this.cachedResponseWillBeUsed=async({event:e,state:t,cachedResponse:n})=>{if(e.type===`install`&&t&&t.originalRequest&&t.originalRequest instanceof Request){let e=t.originalRequest.url;n?this.notUpdatedURLs.push(e):this.updatedURLs.push(e)}return n}}},u=class{constructor({precacheController:e}){this.cacheKeyWillBeUsed=async({request:e,params:t})=>{let n=t?.cacheKey||this._precacheController.getCacheKeyForURL(e.url);return n?new Request(n,{headers:e.headers}):e},this._precacheController=e}},d;function f(){if(d===void 0){let e=new Response(``);if(`body`in e)try{new Response(e.body),d=!0}catch{d=!1}d=!1}return d}async function p(e,n){let r=null;if(e.url&&(r=new URL(e.url).origin),r!==self.location.origin)throw new t(`cross-origin-copy-response`,{origin:r});let i=e.clone(),a={headers:new Headers(i.headers),status:i.status,statusText:i.statusText},o=n?n(a):a,s=f()?i.body:await i.blob();return new Response(s,o)}var m=e=>new URL(String(e),location.href).href.replace(RegExp(`^${location.origin}`),``);function h(e,t){let n=new URL(e);for(let e of t)n.searchParams.delete(e);return n.href}async function g(e,t,n,r){let i=h(t.url,n);if(t.url===i)return e.match(t,r);let a=Object.assign(Object.assign({},r),{ignoreSearch:!0}),o=await e.keys(t,a);for(let t of o)if(i===h(t.url,n))return e.match(t,r)}var v=class{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}},y=new Set;async function b(){for(let e of y)await e()}function x(e){return new Promise(t=>setTimeout(t,e))}try{self[`workbox:strategies:7.3.0`]&&_()}catch{}function S(e){return typeof e==`string`?new Request(e):e}var C=class{constructor(e,t){this._cacheKeys={},Object.assign(this,t),this.event=t.event,this._strategy=e,this._handlerDeferred=new v,this._extendLifetimePromises=[],this._plugins=[...e.plugins],this._pluginStateMap=new Map;for(let e of this._plugins)this._pluginStateMap.set(e,{});this.event.waitUntil(this._handlerDeferred.promise)}async fetch(e){let{event:n}=this,r=S(e);if(r.mode===`navigate`&&n instanceof FetchEvent&&n.preloadResponse){let e=await n.preloadResponse;if(e)return e}let i=this.hasCallback(`fetchDidFail`)?r.clone():null;try{for(let e of this.iterateCallbacks(`requestWillFetch`))r=await e({request:r.clone(),event:n})}catch(e){if(e instanceof Error)throw new t(`plugin-error-request-will-fetch`,{thrownErrorMessage:e.message})}let a=r.clone();try{let e;e=await fetch(r,r.mode===`navigate`?void 0:this._strategy.fetchOptions);for(let t of this.iterateCallbacks(`fetchDidSucceed`))e=await t({event:n,request:a,response:e});return e}catch(e){throw i&&await this.runCallbacks(`fetchDidFail`,{error:e,event:n,originalRequest:i.clone(),request:a.clone()}),e}}async fetchAndCachePut(e){let t=await this.fetch(e),n=t.clone();return this.waitUntil(this.cachePut(e,n)),t}async cacheMatch(e){let t=S(e),n,{cacheName:r,matchOptions:i}=this._strategy,a=await this.getCacheKey(t,`read`),o=Object.assign(Object.assign({},i),{cacheName:r});n=await caches.match(a,o);for(let e of this.iterateCallbacks(`cachedResponseWillBeUsed`))n=await e({cacheName:r,matchOptions:i,cachedResponse:n,request:a,event:this.event})||void 0;return n}async cachePut(e,n){let r=S(e);await x(0);let i=await this.getCacheKey(r,`write`);if(!n)throw new t(`cache-put-with-no-response`,{url:m(i.url)});let a=await this._ensureResponseSafeToCache(n);if(!a)return!1;let{cacheName:o,matchOptions:s}=this._strategy,c=await self.caches.open(o),l=this.hasCallback(`cacheDidUpdate`),u=l?await g(c,i.clone(),[`__WB_REVISION__`],s):null;try{await c.put(i,l?a.clone():a)}catch(e){if(e instanceof Error)throw e.name===`QuotaExceededError`&&await b(),e}for(let e of this.iterateCallbacks(`cacheDidUpdate`))await e({cacheName:o,oldResponse:u,newResponse:a.clone(),request:i,event:this.event});return!0}async getCacheKey(e,t){let n=`${e.url} | ${t}`;if(!this._cacheKeys[n]){let r=e;for(let e of this.iterateCallbacks(`cacheKeyWillBeUsed`))r=S(await e({mode:t,request:r,event:this.event,params:this.params}));this._cacheKeys[n]=r}return this._cacheKeys[n]}hasCallback(e){for(let t of this._strategy.plugins)if(e in t)return!0;return!1}async runCallbacks(e,t){for(let n of this.iterateCallbacks(e))await n(t)}*iterateCallbacks(e){for(let t of this._strategy.plugins)if(typeof t[e]==`function`){let n=this._pluginStateMap.get(t);yield r=>{let i=Object.assign(Object.assign({},r),{state:n});return t[e](i)}}}waitUntil(e){return this._extendLifetimePromises.push(e),e}async doneWaiting(){for(;this._extendLifetimePromises.length;){let e=this._extendLifetimePromises.splice(0),t=(await Promise.allSettled(e)).find(e=>e.status===`rejected`);if(t)throw t.reason}}destroy(){this._handlerDeferred.resolve(null)}async _ensureResponseSafeToCache(e){let t=e,n=!1;for(let e of this.iterateCallbacks(`cacheWillUpdate`))if(t=await e({request:this.request,response:t,event:this.event})||void 0,n=!0,!t)break;return n||t&&t.status!==200&&(t=void 0),t}},w=class{constructor(e={}){this.cacheName=a.getRuntimeName(e.cacheName),this.plugins=e.plugins||[],this.fetchOptions=e.fetchOptions,this.matchOptions=e.matchOptions}handle(e){let[t]=this.handleAll(e);return t}handleAll(e){e instanceof FetchEvent&&(e={event:e,request:e.request});let t=e.event,n=typeof e.request==`string`?new Request(e.request):e.request,r=`params`in e?e.params:void 0,i=new C(this,{event:t,request:n,params:r}),a=this._getResponse(i,n,t);return[a,this._awaitComplete(a,i,n,t)]}async _getResponse(e,n,r){await e.runCallbacks(`handlerWillStart`,{event:r,request:n});let i;try{if(i=await this._handle(n,e),!i||i.type===`error`)throw new t(`no-response`,{url:n.url})}catch(t){if(t instanceof Error){for(let a of e.iterateCallbacks(`handlerDidError`))if(i=await a({error:t,event:r,request:n}),i)break}if(!i)throw t}for(let t of e.iterateCallbacks(`handlerWillRespond`))i=await t({event:r,request:n,response:i});return i}async _awaitComplete(e,t,n,r){let i,a;try{i=await e}catch{}try{await t.runCallbacks(`handlerDidRespond`,{event:r,request:n,response:i}),await t.doneWaiting()}catch(e){e instanceof Error&&(a=e)}if(await t.runCallbacks(`handlerDidComplete`,{event:r,request:n,response:i,error:a}),t.destroy(),a)throw a}},T=class e extends w{constructor(t={}){t.cacheName=a.getPrecacheName(t.cacheName),super(t),this._fallbackToNetwork=t.fallbackToNetwork!==!1,this.plugins.push(e.copyRedirectedCacheableResponsesPlugin)}async _handle(e,t){return await t.cacheMatch(e)||(t.event&&t.event.type===`install`?await this._handleInstall(e,t):await this._handleFetch(e,t))}async _handleFetch(e,n){let r,i=n.params||{};if(this._fallbackToNetwork){let t=i.integrity,a=e.integrity,o=!a||a===t;r=await n.fetch(new Request(e,{integrity:e.mode===`no-cors`?void 0:a||t})),t&&o&&e.mode!==`no-cors`&&(this._useDefaultCacheabilityPluginIfNeeded(),await n.cachePut(e,r.clone()))}else throw new t(`missing-precache-entry`,{cacheName:this.cacheName,url:e.url});return r}async _handleInstall(e,n){this._useDefaultCacheabilityPluginIfNeeded();let r=await n.fetch(e);if(!await n.cachePut(e,r.clone()))throw new t(`bad-precaching-response`,{url:e.url,status:r.status});return r}_useDefaultCacheabilityPluginIfNeeded(){let t=null,n=0;for(let[r,i]of this.plugins.entries())i!==e.copyRedirectedCacheableResponsesPlugin&&(i===e.defaultPrecacheCacheabilityPlugin&&(t=r),i.cacheWillUpdate&&n++);n===0?this.plugins.push(e.defaultPrecacheCacheabilityPlugin):n>1&&t!==null&&this.plugins.splice(t,1)}};T.defaultPrecacheCacheabilityPlugin={async cacheWillUpdate({response:e}){return!e||e.status>=400?null:e}},T.copyRedirectedCacheableResponsesPlugin={async cacheWillUpdate({response:e}){return e.redirected?await p(e):e}};var E=class{constructor({cacheName:e,plugins:t=[],fallbackToNetwork:n=!0}={}){this._urlsToCacheKeys=new Map,this._urlsToCacheModes=new Map,this._cacheKeysToIntegrities=new Map,this._strategy=new T({cacheName:a.getPrecacheName(e),plugins:[...t,new u({precacheController:this})],fallbackToNetwork:n}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this._strategy}precache(e){this.addToCacheList(e),this._installAndActiveListenersAdded||=(self.addEventListener(`install`,this.install),self.addEventListener(`activate`,this.activate),!0)}addToCacheList(e){let n=[];for(let r of e){typeof r==`string`?n.push(r):r&&r.revision===void 0&&n.push(r.url);let{cacheKey:e,url:i}=c(r),a=typeof r!=`string`&&r.revision?`reload`:`default`;if(this._urlsToCacheKeys.has(i)&&this._urlsToCacheKeys.get(i)!==e)throw new t(`add-to-cache-list-conflicting-entries`,{firstEntry:this._urlsToCacheKeys.get(i),secondEntry:e});if(typeof r!=`string`&&r.integrity){if(this._cacheKeysToIntegrities.has(e)&&this._cacheKeysToIntegrities.get(e)!==r.integrity)throw new t(`add-to-cache-list-conflicting-integrities`,{url:i});this._cacheKeysToIntegrities.set(e,r.integrity)}if(this._urlsToCacheKeys.set(i,e),this._urlsToCacheModes.set(i,a),n.length>0){let e=`Workbox is precaching URLs without revision info: ${n.join(`, `)}\nThis is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(e)}}}install(e){return o(e,async()=>{let t=new l;this.strategy.plugins.push(t);for(let[t,n]of this._urlsToCacheKeys){let r=this._cacheKeysToIntegrities.get(n),i=this._urlsToCacheModes.get(t),a=new Request(t,{integrity:r,cache:i,credentials:`same-origin`});await Promise.all(this.strategy.handleAll({params:{cacheKey:n},request:a,event:e}))}let{updatedURLs:n,notUpdatedURLs:r}=t;return{updatedURLs:n,notUpdatedURLs:r}})}activate(e){return o(e,async()=>{let e=await self.caches.open(this.strategy.cacheName),t=await e.keys(),n=new Set(this._urlsToCacheKeys.values()),r=[];for(let i of t)n.has(i.url)||(await e.delete(i),r.push(i.url));return{deletedURLs:r}})}getURLsToCacheKeys(){return this._urlsToCacheKeys}getCachedURLs(){return[...this._urlsToCacheKeys.keys()]}getCacheKeyForURL(e){let t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}getIntegrityForCacheKey(e){return this._cacheKeysToIntegrities.get(e)}async matchPrecache(e){let t=e instanceof Request?e.url:e,n=this.getCacheKeyForURL(t);if(n)return(await self.caches.open(this.strategy.cacheName)).match(n)}createHandlerBoundToURL(e){let n=this.getCacheKeyForURL(e);if(!n)throw new t(`non-precached-url`,{url:e});return t=>(t.request=new Request(e),t.params=Object.assign({cacheKey:n},t.params),this.strategy.handle(t))}},D,O=()=>(D||=new E,D);try{self[`workbox:routing:7.3.0`]&&_()}catch{}var k=e=>e&&typeof e==`object`?e:{handle:e},A=class{constructor(e,t,n=`GET`){this.handler=k(t),this.match=e,this.method=n}setCatchHandler(e){this.catchHandler=k(e)}},j=class extends A{constructor(e,t,n){super(({url:t})=>{let n=e.exec(t.href);if(n&&!(t.origin!==location.origin&&n.index!==0))return n.slice(1)},t,n)}},M=class{constructor(){this._routes=new Map,this._defaultHandlerMap=new Map}get routes(){return this._routes}addFetchListener(){self.addEventListener(`fetch`,(e=>{let{request:t}=e,n=this.handleRequest({request:t,event:e});n&&e.respondWith(n)}))}addCacheListener(){self.addEventListener(`message`,(e=>{if(e.data&&e.data.type===`CACHE_URLS`){let{payload:t}=e.data,n=Promise.all(t.urlsToCache.map(t=>{typeof t==`string`&&(t=[t]);let n=new Request(...t);return this.handleRequest({request:n,event:e})}));e.waitUntil(n),e.ports&&e.ports[0]&&n.then(()=>e.ports[0].postMessage(!0))}}))}handleRequest({request:e,event:t}){let n=new URL(e.url,location.href);if(!n.protocol.startsWith(`http`))return;let r=n.origin===location.origin,{params:i,route:a}=this.findMatchingRoute({event:t,request:e,sameOrigin:r,url:n}),o=a&&a.handler,s=e.method;if(!o&&this._defaultHandlerMap.has(s)&&(o=this._defaultHandlerMap.get(s)),!o)return;let c;try{c=o.handle({url:n,request:e,event:t,params:i})}catch(e){c=Promise.reject(e)}let l=a&&a.catchHandler;return c instanceof Promise&&(this._catchHandler||l)&&(c=c.catch(async r=>{if(l)try{return await l.handle({url:n,request:e,event:t,params:i})}catch(e){e instanceof Error&&(r=e)}if(this._catchHandler)return this._catchHandler.handle({url:n,request:e,event:t});throw r})),c}findMatchingRoute({url:e,sameOrigin:t,request:n,event:r}){let i=this._routes.get(n.method)||[];for(let a of i){let i,o=a.match({url:e,sameOrigin:t,request:n,event:r});if(o)return i=o,(Array.isArray(i)&&i.length===0||o.constructor===Object&&Object.keys(o).length===0||typeof o==`boolean`)&&(i=void 0),{route:a,params:i}}return{}}setDefaultHandler(e,t=`GET`){this._defaultHandlerMap.set(t,k(e))}setCatchHandler(e){this._catchHandler=k(e)}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(e){if(!this._routes.has(e.method))throw new t(`unregister-route-but-not-found-with-method`,{method:e.method});let n=this._routes.get(e.method).indexOf(e);if(n>-1)this._routes.get(e.method).splice(n,1);else throw new t(`unregister-route-route-not-registered`)}},N,P=()=>(N||(N=new M,N.addFetchListener(),N.addCacheListener()),N);function F(e,n,r){let i;if(typeof e==`string`){let t=new URL(e,location.href);i=new A(({url:e})=>e.href===t.href,n,r)}else if(e instanceof RegExp)i=new j(e,n,r);else if(typeof e==`function`)i=new A(e,n,r);else if(e instanceof A)i=e;else throw new t(`unsupported-route-type`,{moduleName:`workbox-routing`,funcName:`registerRoute`,paramName:`capture`});return P().registerRoute(i),i}function I(e,t=[]){for(let n of[...e.searchParams.keys()])t.some(e=>e.test(n))&&e.searchParams.delete(n);return e}function*L(e,{ignoreURLParametersMatching:t=[/^utm_/,/^fbclid$/],directoryIndex:n=`index.html`,cleanURLs:r=!0,urlManipulation:i}={}){let a=new URL(e,location.href);a.hash=``,yield a.href;let o=I(a,t);if(yield o.href,n&&o.pathname.endsWith(`/`)){let e=new URL(o.href);e.pathname+=n,yield e.href}if(r){let e=new URL(o.href);e.pathname+=`.html`,yield e.href}if(i){let e=i({url:a});for(let t of e)yield t.href}}var R=class extends A{constructor(e,t){super(({request:n})=>{let r=e.getURLsToCacheKeys();for(let i of L(n.url,t)){let t=r.get(i);if(t)return{cacheKey:t,integrity:e.getIntegrityForCacheKey(t)}}},e.strategy)}};function z(e){F(new R(O(),e))}var B=`-precache-`,V=async(e,t=B)=>{let n=(await self.caches.keys()).filter(n=>n.includes(t)&&n.includes(self.registration.scope)&&n!==e);return await Promise.all(n.map(e=>self.caches.delete(e))),n};function H(){self.addEventListener(`activate`,(e=>{let t=a.getPrecacheName();e.waitUntil(V(t).then(e=>{}))}))}function U(e){O().precache(e)}function W(e,t){U(e),z(t)}var G=class extends w{async _handle(e,n){let r=await n.cacheMatch(e),i;if(!r)try{r=await n.fetchAndCachePut(e)}catch(e){e instanceof Error&&(i=e)}if(!r)throw new t(`no-response`,{url:e.url,error:i});return r}};W([{"revision":"dcd83229010ad993435b42f01f09df78","url":"index.html"},{"revision":"26dccd02a2ef7522892015154f5e3680","url":"manifest.webmanifest"},{"revision":"a0fb34fc84eb148d51812cd62669f20d","url":"icon-512.svg"},{"revision":"a0fb34fc84eb148d51812cd62669f20d","url":"icon-192.svg"},{"revision":null,"url":"assets/index-CIscPw4g.js"},{"revision":null,"url":"assets/index-BmsPSBtF.css"},{"revision":"a0fb34fc84eb148d51812cd62669f20d","url":"icon-192.svg"},{"revision":"a0fb34fc84eb148d51812cd62669f20d","url":"icon-512.svg"},{"revision":"26dccd02a2ef7522892015154f5e3680","url":"manifest.webmanifest"}]),H();var K=e=>(e.headers.get(`content-type`)??``).startsWith(`text/html`);F(({url:e})=>e.pathname.startsWith(`/assets/`),new G({cacheName:`ppm-assets`,plugins:[{cacheWillUpdate:async({response:e})=>K(e)?null:e,cachedResponseWillBeUsed:async({cachedResponse:e})=>e&&K(e)?null:e}]})),self.skipWaiting(),self.addEventListener(`activate`,()=>{self.clients.claim()});
package/dist/web/sw.js.br CHANGED
Binary file
package/dist/web/sw.js.gz CHANGED
Binary file
@@ -15,6 +15,72 @@ results/errors and ignores nested `done` events.
15
15
  This prevents a completed answer from disappearing after reload when a
16
16
  background agent finishes after the root response.
17
17
 
18
+ The live Agent-session window (below) reads a child's rollout through its own
19
+ streaming tail parser instead of this buffered nested-event path — it has no
20
+ notion of whether the root turn is active, since a background agent keeps
21
+ writing long after the root turn finishes. A child rollout carries its own
22
+ `session_meta` header first and its parent's (forked context) second; only the
23
+ first describes the file, and that tail parser ignores every one after it.
24
+
25
+ ## Agent session transcripts
26
+
27
+ Tapping an Agent/Task card, or a named teammate row, opens a floating window
28
+ (a bottom sheet on mobile) that streams that agent's own transcript live and
29
+ independently of the chat turn that spawned it. This runs as its own protocol
30
+ over `/ws/global` (`src/shared/agent-transcript-protocol.ts`), not the chat
31
+ WebSocket, so it keeps following a background agent after the root turn ends
32
+ and works whether or not a chat tab is even mounted.
33
+
34
+ **Ownership before any file is named.** `src/services/agent-transcript/session-ownership.ts`
35
+ proves a requested `(providerId, sessionId)` belongs to the caller's project
36
+ before anything downstream picks a path: a Claude session's JSONL must sit
37
+ under that project's own slug directory (a DB-recorded path is accepted only
38
+ when it independently names the same project), and a Codex session must be
39
+ found through the existing fail-closed `cwd`-checked rollout search. Every file
40
+ this flow reads afterward is realpath-contained under the provider's root. A
41
+ client names only a project, a session id and a `source` (a card id or
42
+ teammate handle) — never a path or byte range.
43
+
44
+ **Sources per provider.** `agent-transcript-sources.ts` turns an owned session
45
+ plus a `source` into the file(s) the hub may read: a Claude card's own
46
+ transcript and its recorded nested descendants; a Codex card's rollout,
47
+ accepted only when its `session_meta.parent_thread_id` chain reaches the
48
+ owning session; a teammate's newest transcript, pinned to the project the same
49
+ way a session id is (a team is itself a session). Resolutions are cached
50
+ briefly per (session, card/member) and re-derived on that cadence, so a
51
+ descendant spawned after the window opened is picked up without reopening it.
52
+
53
+ **The hub.** One hub per `(providerId, sessionId)` (`agent-transcript-hub.ts`,
54
+ `agent-transcript-session-hub.ts`) owns every transcript and activity
55
+ subscription for that session. A tick reads each subscribed file from its
56
+ last-consumed byte offset, decodes only whole lines, and pages a large backlog
57
+ rather than reading or parsing it all at once; a subscription's own pace slows
58
+ once its files stop growing, and a hub with nothing subscribed tears itself
59
+ down.
60
+
61
+ **Protocol.** `agent-transcript:subscribe`/`unsubscribe` carry one card's or
62
+ teammate's steps; `agent-activity:subscribe`/`unsubscribe` carry the
63
+ running-agents bar's "who is working right now" feed, independent of any
64
+ window being open. A cursor is a byte offset per file the server itself
65
+ derived on an earlier response — never a client-named range — and
66
+ reconnecting resumes from the client's last cursor with no gap and no
67
+ duplicate, across however many backlog pages that takes. A `reset` flag tells
68
+ the client to discard everything for that subscription instead of appending,
69
+ for the rare case where the file itself rewrote its own history (a
70
+ truncated/rotated Claude transcript, a Codex compaction or rollback). Every
71
+ error the client can see is one of four fixed codes — never a path or
72
+ exception text.
73
+
74
+ **Fallback.** A window opens with whatever steps chat already holds in memory
75
+ (`agent-session-fallback-store.ts`) and shows them immediately; they are
76
+ replaced the moment the hub's first real response names a readable file, and
77
+ stay as the shown view — marked offline — when the source never resolves to
78
+ one at all (an old session, or a transcript that never existed).
79
+
80
+ **Liveness.** "Running" is derived only from whether the underlying file(s)
81
+ are still growing, never from in-memory chat state: a replayed old session
82
+ reads as finished even though its cards are still visible in the transcript.
83
+
18
84
  ## Codex daily guard for weekly-only accounts
19
85
 
20
86
  Daily guard spreads a seven-day quota window across five weekdays: each weekday
@@ -475,7 +475,7 @@ pointer-up that still arrives after a mid-gesture window close (e.g. dragging by
475
475
  that closes the frame).
476
476
 
477
477
  **One chrome, every kind.** `WindowSkinChrome` (`window-skin-chrome.tsx`) is the titlebar every
478
- window kind — explorer, team-member session, system monitor, detached tab — renders: it resolves
478
+ window kind — explorer, agent-session, system monitor, detached tab — renders: it resolves
479
479
  the active OS skin via `useExplorerSkin()` (Settings override, else host platform; Linux → macOS)
480
480
  and delegates to that skin's `WindowsWindowChrome` / `MacosWindowChrome`
481
481
  (`src/web/components/os-explorer/skins/`), scoped entirely through `[data-skin="windows"|"macos"]`
@@ -496,6 +496,18 @@ style mirroring, key forwarding, resize signalling) apply to whichever window ki
496
496
  the slot — a tab-host window is only the one kind whose body is itself a portal target for another
497
497
  component (`TabPool`).
498
498
 
499
+ **Agent session windows.** `agent-session` (renamed from `team-member` — it now also covers a
500
+ card with no teammate handle at all) streams one agent's or teammate's transcript live; see
501
+ [Agent session transcripts](ai-chat-and-providers.md#agent-session-transcripts) for the hub behind
502
+ it. It spawns a portrait 9:16 rect pinned to the top-right (`portraitSpawnRect`,
503
+ `window-geometry.ts`) instead of the landscape cascade every other kind uses — a step list reads
504
+ top-to-bottom, so portrait wastes less of the window on line wrapping — and cascades the same way
505
+ once more than one is open. Opening a session already showing in a window focuses that window
506
+ instead of spawning a duplicate; at the window cap, the oldest `agent-session` window is closed to
507
+ make room instead of leaving the request refused or evicting some unrelated window still in use,
508
+ and the open is refused only when no `agent-session` window exists to close. Its body is never
509
+ restored on reload (see Persistence below).
510
+
499
511
  #### Tab-host windows (detaching a tab into its own window)
500
512
 
501
513
  - **Off-grid panel.** Detaching creates `` `__win__:${windowId}` `` (`windowPanelId()`,
@@ -527,8 +539,8 @@ component (`TabPool`).
527
539
  key (`stores/window-panel-persistence.ts`), separate from the per-project `ppm-panels-*` blob and
528
540
  not synced to the server — the same limitation window geometry (`ppm-windows`) already has.
529
541
  `WINDOW_KINDS` (`window-store-types.ts`) is the single list both the window store and
530
- `window-persistence.ts` filter against; `team-member` is excluded from restore because its body
531
- streams a live subagent session that cannot survive a reload.
542
+ `window-persistence.ts` filter against; `agent-session` is excluded from restore because its
543
+ body streams a live subagent session that cannot survive a reload.
532
544
  - **Reconcile.** The two halves persist separately, so a reload can restore one without the other.
533
545
  `reconcileTabHostWindows` (`stores/window-panel-reconcile.ts`), run once per project via
534
546
  `useWindowPanelReconcile()` after the window layer restores, and unconditionally below `md` (the
@@ -99,7 +99,7 @@ These rules MUST be followed when creating or modifying any UI component. PPM is
99
99
  ## Floating Windows
100
100
 
101
101
  Desktop-only window manager (`src/web/components/floating-window/`), hosting the OS File Explorer,
102
- team-member sessions, the System Monitor, and detached tabs (`tab-host`). Every kind shares one
102
+ agent sessions, the System Monitor, and detached tabs (`tab-host`). Every kind shares one
103
103
  titlebar chrome — `WindowSkinChrome` resolves the active OS skin (Settings override, else host
104
104
  platform) and renders it, whatever the window's `kind` — and one PiP capability owned by the frame,
105
105
  not by any one kind. Any future floating-window feature must follow the same contract:
@@ -131,6 +131,11 @@ not by any one kind. Any future floating-window feature must follow the same con
131
131
  every skin renders the same PiP button, absent (not disabled, never a dead control that only
132
132
  explains itself) on browsers without `documentPictureInPicture`. The "Bring back" control shown
133
133
  while a window plays in PiP is a full ≥44×44px touch target like any other primary action.
134
+ - **Portrait default for reading windows**: a window whose body is a live, scrolling read-only
135
+ feed (an agent/teammate's transcript) spawns portrait (9:16), pinned top-right, instead of the
136
+ landscape cascade every other kind uses — a step list reads top-to-bottom and wastes width in
137
+ landscape. Any future "reading" kind should follow suit; a workspace kind (explorer, terminal,
138
+ editor) keeps the landscape default.
134
139
  - **Tab-host windows** (a tab detached from its panel, plus its optional PiP step) follow the same
135
140
  desktop-only rule as every other kind: below `md`, both detach items are hidden from the tab
136
141
  context menu and any already-detached tabs reconcile back into the grid — a windowed tab is
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hienlh/ppm",
3
- "version": "0.23.8",
3
+ "version": "0.23.10",
4
4
  "description": "Personal Project Manager — mobile-first web IDE with AI assistance",
5
5
  "author": "hienlh",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -48,7 +48,7 @@ function safeParseArgs(raw: unknown): Record<string, unknown> {
48
48
  }
49
49
 
50
50
  /** rollout `function_call` (OpenAI Responses format) → PPM tool_use. */
51
- function fnCallToToolUse(p: Record<string, unknown>): ChatEvent {
51
+ export function fnCallToToolUse(p: Record<string, unknown>): ChatEvent {
52
52
  const args = safeParseArgs(p.arguments);
53
53
  const command = typeof args.command === "string" ? args.command : "";
54
54
  const callId = typeof p.call_id === "string" ? p.call_id : undefined;
@@ -60,7 +60,7 @@ function fnCallToToolUse(p: Record<string, unknown>): ChatEvent {
60
60
  }
61
61
 
62
62
  /** rollout `custom_tool_call` (apply_patch / custom tools) → PPM tool_use. */
63
- function customToolCallToToolUse(p: Record<string, unknown>): ChatEvent {
63
+ export function customToolCallToToolUse(p: Record<string, unknown>): ChatEvent {
64
64
  const callId = typeof p.call_id === "string" ? p.call_id : undefined;
65
65
  if (p.name === "apply_patch" && typeof p.input === "string") {
66
66
  const changes = parseApplyPatch(p.input);
@@ -70,7 +70,7 @@ function customToolCallToToolUse(p: Record<string, unknown>): ChatEvent {
70
70
  }
71
71
 
72
72
  /** Unknown `*_call` record → generic visible tool_use (never dropped). */
73
- function genericCallToToolUse(p: Record<string, unknown>): ChatEvent {
73
+ export function genericCallToToolUse(p: Record<string, unknown>): ChatEvent {
74
74
  const callId = typeof p.call_id === "string" ? p.call_id : undefined;
75
75
  const tool = String(p.name ?? p.type ?? "tool");
76
76
  const input = p.input ?? safeParseArgs(p.arguments);
@@ -78,7 +78,7 @@ function genericCallToToolUse(p: Record<string, unknown>): ChatEvent {
78
78
  }
79
79
 
80
80
  /** rollout `function_call_output` / `custom_tool_call_output` → PPM tool_result. */
81
- function fnOutputToToolResult(p: Record<string, unknown>): ChatEvent {
81
+ export function fnOutputToToolResult(p: Record<string, unknown>): ChatEvent {
82
82
  const output = typeof p.output === "string" ? p.output : JSON.stringify(p.output ?? "");
83
83
  const m = /exit code:\s*(\d+)/i.exec(output);
84
84
  return {
@@ -86,7 +86,7 @@ const CODEX_SESSIONS_DIR = join(homedir(), ".codex", "sessions");
86
86
  * made a switched session come back empty and silently start over as a new
87
87
  * thread, since resume is only attempted when a rollout is found.
88
88
  */
89
- function codexSessionsDirs(sessionId?: string): string[] {
89
+ export function codexSessionsDirs(sessionId?: string): string[] {
90
90
  const dirs: string[] = [];
91
91
  const boundId = sessionId ? getSessionCodexAccount(sessionId) : null;
92
92
  const accounts = listCodexAccounts();