@hienlh/ppm 0.23.22 → 0.23.24

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 (463) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/CLAUDE.md +3 -1
  3. package/README.md +1 -1
  4. package/assets/skills/ppm/SKILL.md +1 -1
  5. package/assets/skills/ppm/references/http-api.md +2 -1
  6. package/dist/web/assets/{accounts-settings-section-CiNmIj02.js → accounts-settings-section-Cg-LncY6.js} +1 -1
  7. package/dist/web/assets/accounts-settings-section-Cg-LncY6.js.br +0 -0
  8. package/dist/web/assets/accounts-settings-section-Cg-LncY6.js.gz +0 -0
  9. package/dist/web/assets/{agent-session-sheet-DRR36PDA.js → agent-session-sheet-DMdV8GOu.js} +2 -2
  10. package/dist/web/assets/agent-session-sheet-DMdV8GOu.js.br +0 -0
  11. package/dist/web/assets/agent-session-sheet-DMdV8GOu.js.gz +0 -0
  12. package/dist/web/assets/{agent-session-window-content-DMhy16BM.js → agent-session-window-content-CYg58J-V.js} +1 -1
  13. package/dist/web/assets/agent-session-window-content-CYg58J-V.js.br +0 -0
  14. package/dist/web/assets/agent-session-window-content-CYg58J-V.js.gz +0 -0
  15. package/dist/web/assets/{ai-resource-editor-BG8boPw7.js → ai-resource-editor-BvEnn0Z_.js} +1 -1
  16. package/dist/web/assets/ai-resource-editor-BvEnn0Z_.js.br +0 -0
  17. package/dist/web/assets/ai-resource-editor-BvEnn0Z_.js.gz +0 -0
  18. package/dist/web/assets/{ai-settings-section-De5dYWlC.js → ai-settings-section-Bo-nf2rY.js} +1 -1
  19. package/dist/web/assets/ai-settings-section-DAqiu_11.js +1 -0
  20. package/dist/web/assets/ai-settings-section-DAqiu_11.js.br +0 -0
  21. package/dist/web/assets/ai-settings-section-DAqiu_11.js.gz +0 -0
  22. package/dist/web/assets/{android-tab-lHDxD93G.js → android-tab-C-wmlFc0.js} +1 -1
  23. package/dist/web/assets/android-tab-C-wmlFc0.js.br +0 -0
  24. package/dist/web/assets/android-tab-C-wmlFc0.js.gz +0 -0
  25. package/dist/web/assets/{appearance-settings-section-DO-ZyoMj.js → appearance-settings-section-CYqX6BGh.js} +1 -1
  26. package/dist/web/assets/appearance-settings-section-CYqX6BGh.js.br +0 -0
  27. package/dist/web/assets/appearance-settings-section-CYqX6BGh.js.gz +0 -0
  28. package/dist/web/assets/{apps-panel-CH-0CHYY.js → apps-panel-D1VTBxgC.js} +1 -1
  29. package/dist/web/assets/apps-panel-D1VTBxgC.js.br +0 -0
  30. package/dist/web/assets/apps-panel-D1VTBxgC.js.gz +0 -0
  31. package/dist/web/assets/{branch-review-tab-CdGtvekz.js → branch-review-tab-BG6vxSsC.js} +1 -1
  32. package/dist/web/assets/branch-review-tab-BG6vxSsC.js.br +0 -0
  33. package/dist/web/assets/branch-review-tab-BG6vxSsC.js.gz +0 -0
  34. package/dist/web/assets/chat-tab-BAwGLGyR.js +19 -0
  35. package/dist/web/assets/chat-tab-BAwGLGyR.js.br +0 -0
  36. package/dist/web/assets/chat-tab-BAwGLGyR.js.gz +0 -0
  37. package/dist/web/assets/{chat-tab-DMqWnFIo.js → chat-tab-BJ0Mi2sd.js} +1 -1
  38. package/dist/web/assets/chat-tab-BJ0Mi2sd.js.br +0 -0
  39. package/dist/web/assets/chat-tab-BJ0Mi2sd.js.gz +0 -0
  40. package/dist/web/assets/{code-editor-BCv8ONNS.js → code-editor-DuwbwTpM.js} +4 -4
  41. package/dist/web/assets/code-editor-DuwbwTpM.js.br +0 -0
  42. package/dist/web/assets/code-editor-DuwbwTpM.js.gz +0 -0
  43. package/dist/web/assets/{codex-reset-credit-button-CGMbIHak.js → codex-reset-credit-button-tIwfnf2G.js} +1 -1
  44. package/dist/web/assets/codex-reset-credit-button-tIwfnf2G.js.br +0 -0
  45. package/dist/web/assets/{codex-reset-credit-button-CGMbIHak.js.gz → codex-reset-credit-button-tIwfnf2G.js.gz} +0 -0
  46. package/dist/web/assets/{conflict-editor-3WmzqBlW.js → conflict-editor-D2n-hQqs.js} +1 -1
  47. package/dist/web/assets/conflict-editor-D2n-hQqs.js.br +0 -0
  48. package/dist/web/assets/conflict-editor-D2n-hQqs.js.gz +0 -0
  49. package/dist/web/assets/{connection-form-tab-BoWucvAe.js → connection-form-tab-DYqPNq_-.js} +1 -1
  50. package/dist/web/assets/connection-form-tab-DYqPNq_-.js.br +0 -0
  51. package/dist/web/assets/connection-form-tab-DYqPNq_-.js.gz +0 -0
  52. package/dist/web/assets/{csv-preview-BCgGsy7F.js → csv-preview-Xh3Z6BS5.js} +1 -1
  53. package/dist/web/assets/csv-preview-Xh3Z6BS5.js.br +0 -0
  54. package/dist/web/assets/csv-preview-Xh3Z6BS5.js.gz +0 -0
  55. package/dist/web/assets/{db-tab-parts-o6QMHBbA.js → db-tab-parts-Dqnb3GCP.js} +1 -1
  56. package/dist/web/assets/db-tab-parts-Dqnb3GCP.js.br +0 -0
  57. package/dist/web/assets/db-tab-parts-Dqnb3GCP.js.gz +0 -0
  58. package/dist/web/assets/{design-settings-section-seo6SdSk.js → design-settings-section-DNNWgxF9.js} +1 -1
  59. package/dist/web/assets/design-settings-section-DNNWgxF9.js.br +0 -0
  60. package/dist/web/assets/design-settings-section-DNNWgxF9.js.gz +0 -0
  61. package/dist/web/assets/{design-tab-B-f_b2LM.js → design-tab-BoAdSpZZ.js} +1 -1
  62. package/dist/web/assets/design-tab-BoAdSpZZ.js.br +0 -0
  63. package/dist/web/assets/design-tab-BoAdSpZZ.js.gz +0 -0
  64. package/dist/web/assets/{designs-sidebar-panel-CVT_TQP7.js → designs-sidebar-panel-BKw7HFAz.js} +1 -1
  65. package/dist/web/assets/designs-sidebar-panel-BKw7HFAz.js.br +0 -0
  66. package/dist/web/assets/designs-sidebar-panel-BKw7HFAz.js.gz +0 -0
  67. package/dist/web/assets/{diff-viewer-y9uBp_8u.js → diff-viewer-CRmfCAZX.js} +1 -1
  68. package/dist/web/assets/diff-viewer-CRmfCAZX.js.br +0 -0
  69. package/dist/web/assets/diff-viewer-CRmfCAZX.js.gz +0 -0
  70. package/dist/web/assets/{docx-preview-Dn_x3Inm.js → docx-preview-zIrtL09u.js} +1 -1
  71. package/dist/web/assets/docx-preview-zIrtL09u.js.br +0 -0
  72. package/dist/web/assets/docx-preview-zIrtL09u.js.gz +0 -0
  73. package/dist/web/assets/{editor-dialog-BwNXSajD.js → editor-dialog-jMYvXVla.js} +1 -1
  74. package/dist/web/assets/editor-dialog-jMYvXVla.js.br +0 -0
  75. package/dist/web/assets/editor-dialog-jMYvXVla.js.gz +0 -0
  76. package/dist/web/assets/{editor-language-service-XA_TnPLN.js → editor-language-service-Yb-61Bro.js} +1 -1
  77. package/dist/web/assets/editor-language-service-Yb-61Bro.js.br +0 -0
  78. package/dist/web/assets/editor-language-service-Yb-61Bro.js.gz +0 -0
  79. package/dist/web/assets/{explorer-body-DukR7zM9.js → explorer-body-C6qKehmd.js} +1 -1
  80. package/dist/web/assets/explorer-body-C6qKehmd.js.br +0 -0
  81. package/dist/web/assets/explorer-body-C6qKehmd.js.gz +0 -0
  82. package/dist/web/assets/{explorer-window-content-BjTZ44S3.js → explorer-window-content-B9P8grrY.js} +1 -1
  83. package/dist/web/assets/explorer-window-content-B9P8grrY.js.br +0 -0
  84. package/dist/web/assets/explorer-window-content-B9P8grrY.js.gz +0 -0
  85. package/dist/web/assets/{extension-manager-section-C4WD1BPQ.js → extension-manager-section-C45v1QtG.js} +1 -1
  86. package/dist/web/assets/extension-manager-section-C45v1QtG.js.br +0 -0
  87. package/dist/web/assets/extension-manager-section-C45v1QtG.js.gz +0 -0
  88. package/dist/web/assets/{extension-webview-CV2ujflc.js → extension-webview-DIxM-xkH.js} +1 -1
  89. package/dist/web/assets/extension-webview-DIxM-xkH.js.br +0 -0
  90. package/dist/web/assets/extension-webview-DIxM-xkH.js.gz +0 -0
  91. package/dist/web/assets/{files-settings-section-hS5ixQ8o.js → files-settings-section-DeVlzKXd.js} +1 -1
  92. package/dist/web/assets/files-settings-section-DeVlzKXd.js.br +0 -0
  93. package/dist/web/assets/files-settings-section-DeVlzKXd.js.gz +0 -0
  94. package/dist/web/assets/format-date-CkyHzZLA.js +1 -0
  95. package/dist/web/assets/{general-settings-section-BnKYY0AA.js → general-settings-section-CLVDIEym.js} +1 -1
  96. package/dist/web/assets/general-settings-section-CLVDIEym.js.br +0 -0
  97. package/dist/web/assets/general-settings-section-CLVDIEym.js.gz +0 -0
  98. package/dist/web/assets/{git-log-panel-JiWfR5xv.js → git-log-panel-D3Q9NRll.js} +1 -1
  99. package/dist/web/assets/git-log-panel-D3Q9NRll.js.br +0 -0
  100. package/dist/web/assets/git-log-panel-D3Q9NRll.js.gz +0 -0
  101. package/dist/web/assets/{git-review-tab-DgvcY__Q.js → git-review-tab-ORgiYbva.js} +1 -1
  102. package/dist/web/assets/git-review-tab-ORgiYbva.js.br +0 -0
  103. package/dist/web/assets/git-review-tab-ORgiYbva.js.gz +0 -0
  104. package/dist/web/assets/{glide-data-grid-r1MKxDjz.js → glide-data-grid-CtWl1BTk.js} +1 -1
  105. package/dist/web/assets/glide-data-grid-CtWl1BTk.js.br +0 -0
  106. package/dist/web/assets/glide-data-grid-CtWl1BTk.js.gz +0 -0
  107. package/dist/web/assets/{grid-save-dialog-Fa0yA-Ep.js → grid-save-dialog-eV25Mqpg.js} +1 -1
  108. package/dist/web/assets/grid-save-dialog-eV25Mqpg.js.br +0 -0
  109. package/dist/web/assets/grid-save-dialog-eV25Mqpg.js.gz +0 -0
  110. package/dist/web/assets/{group-chat-tab-B2Q8yqSX.js → group-chat-tab-CYmbYXN2.js} +1 -1
  111. package/dist/web/assets/group-chat-tab-CYmbYXN2.js.br +0 -0
  112. package/dist/web/assets/group-chat-tab-CYmbYXN2.js.gz +0 -0
  113. package/dist/web/assets/{impexp-tab-B8Ht4l32.js → impexp-tab-D2OKxpFq.js} +1 -1
  114. package/dist/web/assets/impexp-tab-D2OKxpFq.js.br +0 -0
  115. package/dist/web/assets/impexp-tab-D2OKxpFq.js.gz +0 -0
  116. package/dist/web/assets/{index-BtAn_krv.js → index-D8QDpdgs.js} +7 -7
  117. package/dist/web/assets/index-D8QDpdgs.js.br +0 -0
  118. package/dist/web/assets/index-D8QDpdgs.js.gz +0 -0
  119. package/dist/web/assets/{jira-watcher-section--ibKZfBs.js → jira-watcher-section-B3OaMlim.js} +1 -1
  120. package/dist/web/assets/{keybindings-store-Cwxl4tHv.js → keybindings-store-C_aRhBu4.js} +1 -1
  121. package/dist/web/assets/{keyboard-shortcuts-section-aoiLpWwf.js → keyboard-shortcuts-section-DXRyKrSy.js} +1 -1
  122. package/dist/web/assets/keyboard-shortcuts-section-DXRyKrSy.js.br +0 -0
  123. package/dist/web/assets/keyboard-shortcuts-section-DXRyKrSy.js.gz +0 -0
  124. package/dist/web/assets/{language-servers-section-BkGAezo6.js → language-servers-section-BTs9iuZc.js} +2 -2
  125. package/dist/web/assets/language-servers-section-BTs9iuZc.js.br +0 -0
  126. package/dist/web/assets/language-servers-section-BTs9iuZc.js.gz +0 -0
  127. package/dist/web/assets/{logs-app-DYgPtmjm.js → logs-app-BlhVTOYN.js} +1 -1
  128. package/dist/web/assets/logs-app-BlhVTOYN.js.br +0 -0
  129. package/dist/web/assets/logs-app-BlhVTOYN.js.gz +0 -0
  130. package/dist/web/assets/{logs-tab-BbDosK63.js → logs-tab-kqNARbz0.js} +1 -1
  131. package/dist/web/assets/{logs-window-content-CEXAyv-f.js → logs-window-content-UUCJJCqG.js} +1 -1
  132. package/dist/web/assets/{lsp-client-CIcphNmU.js → lsp-client-BTlK_8lb.js} +1 -1
  133. package/dist/web/assets/lsp-client-BTlK_8lb.js.br +0 -0
  134. package/dist/web/assets/lsp-client-BTlK_8lb.js.gz +0 -0
  135. package/dist/web/assets/{markdown-renderer-BNzQeoAO.js → markdown-renderer-ClGxDien.js} +1 -1
  136. package/dist/web/assets/{markdown-renderer-dk1w3goH.js → markdown-renderer-DpsToFFB.js} +1 -1
  137. package/dist/web/assets/markdown-renderer-DpsToFFB.js.br +0 -0
  138. package/dist/web/assets/markdown-renderer-DpsToFFB.js.gz +0 -0
  139. package/dist/web/assets/{mobile-explorer-sheet-D4lPZQZc.js → mobile-explorer-sheet-CybJbScN.js} +1 -1
  140. package/dist/web/assets/mobile-explorer-sheet-CybJbScN.js.br +0 -0
  141. package/dist/web/assets/mobile-explorer-sheet-CybJbScN.js.gz +0 -0
  142. package/dist/web/assets/{new-design-dialog-CIq7xspW.js → new-design-dialog-9WTgcJoj.js} +1 -1
  143. package/dist/web/assets/new-design-dialog-9WTgcJoj.js.br +0 -0
  144. package/dist/web/assets/new-design-dialog-9WTgcJoj.js.gz +0 -0
  145. package/dist/web/assets/{notification-store-Rv36noYX.js → notification-store-CPVq5ec5.js} +1 -1
  146. package/dist/web/assets/{notifications-settings-section-CoWMtXCC.js → notifications-settings-section-xrYII-pL.js} +1 -1
  147. package/dist/web/assets/notifications-settings-section-xrYII-pL.js.br +0 -0
  148. package/dist/web/assets/notifications-settings-section-xrYII-pL.js.gz +0 -0
  149. package/dist/web/assets/{ppmbot-settings-section-Ct0UwA6T.js → ppmbot-settings-section-Bc46iDP9.js} +1 -1
  150. package/dist/web/assets/ppmbot-settings-section-Bc46iDP9.js.br +0 -0
  151. package/dist/web/assets/ppmbot-settings-section-Bc46iDP9.js.gz +0 -0
  152. package/dist/web/assets/{problems-panel-D-HT-0PE.js → problems-panel-D49-Xkzd.js} +1 -1
  153. package/dist/web/assets/problems-panel-D49-Xkzd.js.br +0 -0
  154. package/dist/web/assets/problems-panel-D49-Xkzd.js.gz +0 -0
  155. package/dist/web/assets/{process-table-CXN0s4Pq.js → process-table-NxYTZ0n9.js} +1 -1
  156. package/dist/web/assets/process-table-NxYTZ0n9.js.br +0 -0
  157. package/dist/web/assets/process-table-NxYTZ0n9.js.gz +0 -0
  158. package/dist/web/assets/{proxy-settings-section-e6WWzP8n.js → proxy-settings-section-Exx7cQc4.js} +1 -1
  159. package/dist/web/assets/proxy-settings-section-Exx7cQc4.js.br +0 -0
  160. package/dist/web/assets/proxy-settings-section-Exx7cQc4.js.gz +0 -0
  161. package/dist/web/assets/{query-tab-C7C67t8F.js → query-tab-BWtJPuxw.js} +1 -1
  162. package/dist/web/assets/query-tab-BWtJPuxw.js.br +0 -0
  163. package/dist/web/assets/query-tab-BWtJPuxw.js.gz +0 -0
  164. package/dist/web/assets/{remote-access-settings-section-gGoATCF9.js → remote-access-settings-section-C4K__DNW.js} +1 -1
  165. package/dist/web/assets/remote-access-settings-section-C4K__DNW.js.br +0 -0
  166. package/dist/web/assets/remote-access-settings-section-C4K__DNW.js.gz +0 -0
  167. package/dist/web/assets/{remote-desktop-clipboard-notice-D5KjvMZx.js → remote-desktop-clipboard-notice-DQyysBwL.js} +1 -1
  168. package/dist/web/assets/remote-desktop-clipboard-notice-DQyysBwL.js.br +0 -0
  169. package/dist/web/assets/remote-desktop-clipboard-notice-DQyysBwL.js.gz +0 -0
  170. package/dist/web/assets/{remote-desktop-mobile-sheet-CY_DsGXZ.js → remote-desktop-mobile-sheet-DZtEFmgf.js} +2 -2
  171. package/dist/web/assets/remote-desktop-mobile-sheet-DZtEFmgf.js.br +0 -0
  172. package/dist/web/assets/remote-desktop-mobile-sheet-DZtEFmgf.js.gz +0 -0
  173. package/dist/web/assets/{remote-desktop-mobile-view-DdpI-RF8.js → remote-desktop-mobile-view-VW7HdPUX.js} +1 -1
  174. package/dist/web/assets/remote-desktop-mobile-view-VW7HdPUX.js.br +0 -0
  175. package/dist/web/assets/{remote-desktop-mobile-view-DdpI-RF8.js.gz → remote-desktop-mobile-view-VW7HdPUX.js.gz} +0 -0
  176. package/dist/web/assets/{remote-desktop-readiness-gate-WIyCCAv5.js → remote-desktop-readiness-gate-B3tuP9Kt.js} +1 -1
  177. package/dist/web/assets/remote-desktop-readiness-gate-B3tuP9Kt.js.br +0 -0
  178. package/dist/web/assets/remote-desktop-readiness-gate-B3tuP9Kt.js.gz +0 -0
  179. package/dist/web/assets/{remote-desktop-window-content-BMORZLZt.js → remote-desktop-window-content-n0NoDCaE.js} +1 -1
  180. package/dist/web/assets/remote-desktop-window-content-n0NoDCaE.js.br +0 -0
  181. package/dist/web/assets/remote-desktop-window-content-n0NoDCaE.js.gz +0 -0
  182. package/dist/web/assets/{rename-object-dialog-pIgWe_AL.js → rename-object-dialog-rLTW4A55.js} +1 -1
  183. package/dist/web/assets/rename-object-dialog-rLTW4A55.js.br +0 -0
  184. package/dist/web/assets/rename-object-dialog-rLTW4A55.js.gz +0 -0
  185. package/dist/web/assets/{review-code-oTNcTYlI.js → review-code-DNfsaNO1.js} +1 -1
  186. package/dist/web/assets/review-code-DNfsaNO1.js.br +0 -0
  187. package/dist/web/assets/review-code-DNfsaNO1.js.gz +0 -0
  188. package/dist/web/assets/{save-as-dialog-CnPLGTaL.js → save-as-dialog-BSz8WrNZ.js} +1 -1
  189. package/dist/web/assets/save-as-dialog-BSz8WrNZ.js.br +0 -0
  190. package/dist/web/assets/save-as-dialog-BSz8WrNZ.js.gz +0 -0
  191. package/dist/web/assets/{schedules-settings-section-CREqHG_i.js → schedules-settings-section-DqUZ-H2K.js} +1 -1
  192. package/dist/web/assets/schedules-settings-section-DqUZ-H2K.js.br +0 -0
  193. package/dist/web/assets/schedules-settings-section-DqUZ-H2K.js.gz +0 -0
  194. package/dist/web/assets/{session-review-tab-nFVJYYJH.js → session-review-tab-DKtrFb9y.js} +1 -1
  195. package/dist/web/assets/session-review-tab-DKtrFb9y.js.br +0 -0
  196. package/dist/web/assets/session-review-tab-DKtrFb9y.js.gz +0 -0
  197. package/dist/web/assets/{settings-body-DNzH0wOQ.js → settings-body-C42xA9Dw.js} +1 -1
  198. package/dist/web/assets/settings-body-C42xA9Dw.js.br +0 -0
  199. package/dist/web/assets/settings-body-C42xA9Dw.js.gz +0 -0
  200. package/dist/web/assets/{settings-rows-D02_4sDY.js → settings-rows-C7ZatT9O.js} +1 -1
  201. package/dist/web/assets/settings-rows-C7ZatT9O.js.br +0 -0
  202. package/dist/web/assets/settings-rows-C7ZatT9O.js.gz +0 -0
  203. package/dist/web/assets/{settings-section-content-DWopMfmq.js → settings-section-content-B_iXJpcK.js} +2 -2
  204. package/dist/web/assets/settings-section-content-B_iXJpcK.js.br +0 -0
  205. package/dist/web/assets/settings-section-content-B_iXJpcK.js.gz +0 -0
  206. package/dist/web/assets/settings-section-content-rxfQEQ66.js +1 -0
  207. package/dist/web/assets/{settings-tab-Cg0v5kO7.js → settings-tab-PRw6OpEb.js} +1 -1
  208. package/dist/web/assets/{settings-window-content-CqhwxJJn.js → settings-window-content-WITQsGfW.js} +1 -1
  209. package/dist/web/assets/{slash-command-picker-Bcizxvbh.js → slash-command-picker-DmDs8nOj.js} +1 -1
  210. package/dist/web/assets/slash-command-picker-DmDs8nOj.js.br +0 -0
  211. package/dist/web/assets/slash-command-picker-DmDs8nOj.js.gz +0 -0
  212. package/dist/web/assets/{sql-object-tab-b1Z2zVBm.js → sql-object-tab-D6P4hzkb.js} +1 -1
  213. package/dist/web/assets/sql-object-tab-D6P4hzkb.js.br +0 -0
  214. package/dist/web/assets/sql-object-tab-D6P4hzkb.js.gz +0 -0
  215. package/dist/web/assets/{sqlite-viewer-DhPv28tq.js → sqlite-viewer-mUitnzHB.js} +1 -1
  216. package/dist/web/assets/sqlite-viewer-mUitnzHB.js.br +0 -0
  217. package/dist/web/assets/sqlite-viewer-mUitnzHB.js.gz +0 -0
  218. package/dist/web/assets/{structure-save-dialog-sGUpqs8D.js → structure-save-dialog-CmbNlmBY.js} +1 -1
  219. package/dist/web/assets/structure-save-dialog-CmbNlmBY.js.br +0 -0
  220. package/dist/web/assets/structure-save-dialog-CmbNlmBY.js.gz +0 -0
  221. package/dist/web/assets/{structure-tab-Bo2OmDOc.js → structure-tab-DCPNuFTe.js} +1 -1
  222. package/dist/web/assets/structure-tab-DCPNuFTe.js.br +0 -0
  223. package/dist/web/assets/structure-tab-DCPNuFTe.js.gz +0 -0
  224. package/dist/web/assets/{system-monitor-body-C475Et9u.js → system-monitor-body-BhxyqSqu.js} +2 -2
  225. package/dist/web/assets/system-monitor-body-BhxyqSqu.js.br +0 -0
  226. package/dist/web/assets/system-monitor-body-BhxyqSqu.js.gz +0 -0
  227. package/dist/web/assets/{system-monitor-tab-Cm52yoW8.js → system-monitor-tab-B_miogQI.js} +1 -1
  228. package/dist/web/assets/{system-monitor-window-content-YYsGHxZF.js → system-monitor-window-content-8IogR6tR.js} +1 -1
  229. package/dist/web/assets/{tab-host-window-content-BKI6QoDa.js → tab-host-window-content-BWHQjgWZ.js} +1 -1
  230. package/dist/web/assets/tab-host-window-content-BWHQjgWZ.js.br +0 -0
  231. package/dist/web/assets/tab-host-window-content-BWHQjgWZ.js.gz +0 -0
  232. package/dist/web/assets/{table-tab-D-nKWMJR.js → table-tab-E3YMueu_.js} +1 -1
  233. package/dist/web/assets/table-tab-E3YMueu_.js.br +0 -0
  234. package/dist/web/assets/{table-tab-D-nKWMJR.js.gz → table-tab-E3YMueu_.js.gz} +0 -0
  235. package/dist/web/assets/{telegram-bot-token-field-BeNS2X2k.js → telegram-bot-token-field-CwW24m62.js} +1 -1
  236. package/dist/web/assets/telegram-bot-token-field-CwW24m62.js.br +0 -0
  237. package/dist/web/assets/telegram-bot-token-field-CwW24m62.js.gz +0 -0
  238. package/dist/web/assets/{terminal-tab-BbP753Ab.js → terminal-tab-BAe5cWEL.js} +1 -1
  239. package/dist/web/assets/terminal-tab-BAe5cWEL.js.br +0 -0
  240. package/dist/web/assets/terminal-tab-BAe5cWEL.js.gz +0 -0
  241. package/dist/web/assets/{tool-cards-Dh8Ekn2W.js → tool-cards-DrCiSH2r.js} +2 -2
  242. package/dist/web/assets/tool-cards-DrCiSH2r.js.br +0 -0
  243. package/dist/web/assets/tool-cards-DrCiSH2r.js.gz +0 -0
  244. package/dist/web/assets/{tools-settings-section-DGZRIULE.js → tools-settings-section-S-vBr2af.js} +1 -1
  245. package/dist/web/assets/tools-settings-section-S-vBr2af.js.br +0 -0
  246. package/dist/web/assets/tools-settings-section-S-vBr2af.js.gz +0 -0
  247. package/dist/web/assets/{use-inline-blame-BxwM-Wkj.js → use-inline-blame-BzVaaCCt.js} +1 -1
  248. package/dist/web/assets/use-inline-blame-BzVaaCCt.js.br +0 -0
  249. package/dist/web/assets/use-inline-blame-BzVaaCCt.js.gz +0 -0
  250. package/dist/web/assets/{use-lsp-BqvwRKmM.js → use-lsp-BwDL9Fqk.js} +1 -1
  251. package/dist/web/assets/use-lsp-BwDL9Fqk.js.br +0 -0
  252. package/dist/web/assets/use-lsp-BwDL9Fqk.js.gz +0 -0
  253. package/dist/web/assets/{use-monaco-theme-DU0EpDHH.js → use-monaco-theme-DljSc3Xo.js} +1 -1
  254. package/dist/web/assets/{use-process-kill-CVN_c4KF.js → use-process-kill-YDcDqDtG.js} +1 -1
  255. package/dist/web/assets/use-process-kill-YDcDqDtG.js.br +0 -0
  256. package/dist/web/assets/use-process-kill-YDcDqDtG.js.gz +0 -0
  257. package/dist/web/assets/{use-sql-schema-info-C0wBmR6-.js → use-sql-schema-info-cAI0vn7d.js} +1 -1
  258. package/dist/web/assets/use-sql-schema-info-cAI0vn7d.js.br +0 -0
  259. package/dist/web/assets/use-sql-schema-info-cAI0vn7d.js.gz +0 -0
  260. package/dist/web/assets/{use-websocket-K0OUXbbY.js → use-websocket-Djo_ruX_.js} +1 -1
  261. package/dist/web/assets/{web-preview-tab-DOgLv8Gt.js → web-preview-tab-DXy0hRef.js} +1 -1
  262. package/dist/web/assets/web-preview-tab-DXy0hRef.js.br +0 -0
  263. package/dist/web/assets/web-preview-tab-DXy0hRef.js.gz +0 -0
  264. package/dist/web/index.html +2 -2
  265. package/dist/web/index.html.br +0 -0
  266. package/dist/web/index.html.gz +0 -0
  267. package/dist/web/sw.js +1 -1
  268. package/dist/web/sw.js.br +0 -0
  269. package/dist/web/sw.js.gz +0 -0
  270. package/docs/architecture/ai-chat-and-providers.md +29 -0
  271. package/docs/lessons-learned.md +14 -4
  272. package/package.json +1 -1
  273. package/src/providers/claude-agent-sdk-query-options.ts +13 -2
  274. package/src/providers/claude-agent-sdk.ts +112 -30
  275. package/src/providers/claude-approval-queue.ts +75 -0
  276. package/src/providers/claude-effort-status.ts +211 -0
  277. package/src/server/routes/chat.ts +17 -0
  278. package/src/server/routes/settings.ts +16 -0
  279. package/src/server/ws/chat-effort-status.ts +73 -0
  280. package/src/server/ws/chat.ts +30 -3
  281. package/src/shared/effort-status.ts +128 -0
  282. package/src/types/api.ts +3 -1
  283. package/src/types/chat.ts +8 -0
  284. package/src/web/components/chat/chat-scroll-nav.tsx +12 -8
  285. package/src/web/components/chat/chat-tab.tsx +15 -11
  286. package/src/web/components/chat/message-action-bar.tsx +19 -4
  287. package/src/web/components/chat/message-input.tsx +6 -0
  288. package/src/web/components/chat/message-list.tsx +55 -21
  289. package/src/web/components/chat/message-user-bubble.tsx +2 -2
  290. package/src/web/components/chat/model-thinking-selector-helpers.ts +79 -0
  291. package/src/web/components/chat/model-thinking-selector.tsx +36 -10
  292. package/src/web/components/chat/session-changes-context.tsx +29 -1
  293. package/src/web/components/layout/reparenting-tab.tsx +53 -14
  294. package/src/web/components/settings/ai-settings-section.tsx +32 -0
  295. package/src/web/hooks/use-chat.ts +16 -0
  296. package/src/web/hooks/use-effort-status.ts +46 -0
  297. package/src/web/hooks/use-relative-time-tick.ts +35 -0
  298. package/src/web/hooks/use-session-file-changes.ts +5 -1
  299. package/src/web/hooks/use-tab-overflow.ts +26 -13
  300. package/src/web/lib/format-date.ts +6 -1
  301. package/dist/web/assets/accounts-settings-section-CiNmIj02.js.br +0 -0
  302. package/dist/web/assets/accounts-settings-section-CiNmIj02.js.gz +0 -0
  303. package/dist/web/assets/agent-session-sheet-DRR36PDA.js.br +0 -0
  304. package/dist/web/assets/agent-session-sheet-DRR36PDA.js.gz +0 -0
  305. package/dist/web/assets/agent-session-window-content-DMhy16BM.js.br +0 -0
  306. package/dist/web/assets/agent-session-window-content-DMhy16BM.js.gz +0 -0
  307. package/dist/web/assets/ai-resource-editor-BG8boPw7.js.br +0 -0
  308. package/dist/web/assets/ai-resource-editor-BG8boPw7.js.gz +0 -0
  309. package/dist/web/assets/ai-settings-section-DMGM1hYx.js +0 -1
  310. package/dist/web/assets/ai-settings-section-DMGM1hYx.js.br +0 -0
  311. package/dist/web/assets/ai-settings-section-DMGM1hYx.js.gz +0 -0
  312. package/dist/web/assets/android-tab-lHDxD93G.js.br +0 -0
  313. package/dist/web/assets/android-tab-lHDxD93G.js.gz +0 -0
  314. package/dist/web/assets/appearance-settings-section-DO-ZyoMj.js.br +0 -0
  315. package/dist/web/assets/appearance-settings-section-DO-ZyoMj.js.gz +0 -0
  316. package/dist/web/assets/apps-panel-CH-0CHYY.js.br +0 -0
  317. package/dist/web/assets/apps-panel-CH-0CHYY.js.gz +0 -0
  318. package/dist/web/assets/branch-review-tab-CdGtvekz.js.br +0 -0
  319. package/dist/web/assets/branch-review-tab-CdGtvekz.js.gz +0 -0
  320. package/dist/web/assets/chat-tab-DMqWnFIo.js.br +0 -0
  321. package/dist/web/assets/chat-tab-DMqWnFIo.js.gz +0 -0
  322. package/dist/web/assets/chat-tab-DzWpwPFb.js +0 -19
  323. package/dist/web/assets/chat-tab-DzWpwPFb.js.br +0 -0
  324. package/dist/web/assets/chat-tab-DzWpwPFb.js.gz +0 -0
  325. package/dist/web/assets/code-editor-BCv8ONNS.js.br +0 -0
  326. package/dist/web/assets/code-editor-BCv8ONNS.js.gz +0 -0
  327. package/dist/web/assets/codex-reset-credit-button-CGMbIHak.js.br +0 -0
  328. package/dist/web/assets/conflict-editor-3WmzqBlW.js.br +0 -0
  329. package/dist/web/assets/conflict-editor-3WmzqBlW.js.gz +0 -0
  330. package/dist/web/assets/connection-form-tab-BoWucvAe.js.br +0 -0
  331. package/dist/web/assets/connection-form-tab-BoWucvAe.js.gz +0 -0
  332. package/dist/web/assets/csv-preview-BCgGsy7F.js.br +0 -0
  333. package/dist/web/assets/csv-preview-BCgGsy7F.js.gz +0 -0
  334. package/dist/web/assets/db-tab-parts-o6QMHBbA.js.br +0 -0
  335. package/dist/web/assets/db-tab-parts-o6QMHBbA.js.gz +0 -0
  336. package/dist/web/assets/design-settings-section-seo6SdSk.js.br +0 -0
  337. package/dist/web/assets/design-settings-section-seo6SdSk.js.gz +0 -0
  338. package/dist/web/assets/design-tab-B-f_b2LM.js.br +0 -0
  339. package/dist/web/assets/design-tab-B-f_b2LM.js.gz +0 -0
  340. package/dist/web/assets/designs-sidebar-panel-CVT_TQP7.js.br +0 -0
  341. package/dist/web/assets/designs-sidebar-panel-CVT_TQP7.js.gz +0 -0
  342. package/dist/web/assets/diff-viewer-y9uBp_8u.js.br +0 -0
  343. package/dist/web/assets/diff-viewer-y9uBp_8u.js.gz +0 -0
  344. package/dist/web/assets/docx-preview-Dn_x3Inm.js.br +0 -0
  345. package/dist/web/assets/docx-preview-Dn_x3Inm.js.gz +0 -0
  346. package/dist/web/assets/editor-dialog-BwNXSajD.js.br +0 -0
  347. package/dist/web/assets/editor-dialog-BwNXSajD.js.gz +0 -0
  348. package/dist/web/assets/editor-language-service-XA_TnPLN.js.br +0 -0
  349. package/dist/web/assets/editor-language-service-XA_TnPLN.js.gz +0 -0
  350. package/dist/web/assets/explorer-body-DukR7zM9.js.br +0 -0
  351. package/dist/web/assets/explorer-body-DukR7zM9.js.gz +0 -0
  352. package/dist/web/assets/explorer-window-content-BjTZ44S3.js.br +0 -0
  353. package/dist/web/assets/explorer-window-content-BjTZ44S3.js.gz +0 -0
  354. package/dist/web/assets/extension-manager-section-C4WD1BPQ.js.br +0 -0
  355. package/dist/web/assets/extension-manager-section-C4WD1BPQ.js.gz +0 -0
  356. package/dist/web/assets/extension-webview-CV2ujflc.js.br +0 -0
  357. package/dist/web/assets/extension-webview-CV2ujflc.js.gz +0 -0
  358. package/dist/web/assets/files-settings-section-hS5ixQ8o.js.br +0 -0
  359. package/dist/web/assets/files-settings-section-hS5ixQ8o.js.gz +0 -0
  360. package/dist/web/assets/format-date-CSHaU2wN.js +0 -1
  361. package/dist/web/assets/general-settings-section-BnKYY0AA.js.br +0 -0
  362. package/dist/web/assets/general-settings-section-BnKYY0AA.js.gz +0 -0
  363. package/dist/web/assets/git-log-panel-JiWfR5xv.js.br +0 -0
  364. package/dist/web/assets/git-log-panel-JiWfR5xv.js.gz +0 -0
  365. package/dist/web/assets/git-review-tab-DgvcY__Q.js.br +0 -0
  366. package/dist/web/assets/git-review-tab-DgvcY__Q.js.gz +0 -0
  367. package/dist/web/assets/glide-data-grid-r1MKxDjz.js.br +0 -0
  368. package/dist/web/assets/glide-data-grid-r1MKxDjz.js.gz +0 -0
  369. package/dist/web/assets/grid-save-dialog-Fa0yA-Ep.js.br +0 -0
  370. package/dist/web/assets/grid-save-dialog-Fa0yA-Ep.js.gz +0 -0
  371. package/dist/web/assets/group-chat-tab-B2Q8yqSX.js.br +0 -0
  372. package/dist/web/assets/group-chat-tab-B2Q8yqSX.js.gz +0 -0
  373. package/dist/web/assets/impexp-tab-B8Ht4l32.js.br +0 -0
  374. package/dist/web/assets/impexp-tab-B8Ht4l32.js.gz +0 -0
  375. package/dist/web/assets/index-BtAn_krv.js.br +0 -0
  376. package/dist/web/assets/index-BtAn_krv.js.gz +0 -0
  377. package/dist/web/assets/keyboard-shortcuts-section-aoiLpWwf.js.br +0 -0
  378. package/dist/web/assets/keyboard-shortcuts-section-aoiLpWwf.js.gz +0 -0
  379. package/dist/web/assets/language-servers-section-BkGAezo6.js.br +0 -0
  380. package/dist/web/assets/language-servers-section-BkGAezo6.js.gz +0 -0
  381. package/dist/web/assets/logs-app-DYgPtmjm.js.br +0 -0
  382. package/dist/web/assets/logs-app-DYgPtmjm.js.gz +0 -0
  383. package/dist/web/assets/lsp-client-CIcphNmU.js.br +0 -0
  384. package/dist/web/assets/lsp-client-CIcphNmU.js.gz +0 -0
  385. package/dist/web/assets/markdown-renderer-dk1w3goH.js.br +0 -0
  386. package/dist/web/assets/markdown-renderer-dk1w3goH.js.gz +0 -0
  387. package/dist/web/assets/mobile-explorer-sheet-D4lPZQZc.js.br +0 -0
  388. package/dist/web/assets/mobile-explorer-sheet-D4lPZQZc.js.gz +0 -0
  389. package/dist/web/assets/new-design-dialog-CIq7xspW.js.br +0 -0
  390. package/dist/web/assets/new-design-dialog-CIq7xspW.js.gz +0 -0
  391. package/dist/web/assets/notifications-settings-section-CoWMtXCC.js.br +0 -0
  392. package/dist/web/assets/notifications-settings-section-CoWMtXCC.js.gz +0 -0
  393. package/dist/web/assets/ppmbot-settings-section-Ct0UwA6T.js.br +0 -0
  394. package/dist/web/assets/ppmbot-settings-section-Ct0UwA6T.js.gz +0 -0
  395. package/dist/web/assets/problems-panel-D-HT-0PE.js.br +0 -0
  396. package/dist/web/assets/problems-panel-D-HT-0PE.js.gz +0 -0
  397. package/dist/web/assets/process-table-CXN0s4Pq.js.br +0 -0
  398. package/dist/web/assets/process-table-CXN0s4Pq.js.gz +0 -0
  399. package/dist/web/assets/proxy-settings-section-e6WWzP8n.js.br +0 -0
  400. package/dist/web/assets/proxy-settings-section-e6WWzP8n.js.gz +0 -0
  401. package/dist/web/assets/query-tab-C7C67t8F.js.br +0 -0
  402. package/dist/web/assets/query-tab-C7C67t8F.js.gz +0 -0
  403. package/dist/web/assets/remote-access-settings-section-gGoATCF9.js.br +0 -0
  404. package/dist/web/assets/remote-access-settings-section-gGoATCF9.js.gz +0 -0
  405. package/dist/web/assets/remote-desktop-clipboard-notice-D5KjvMZx.js.br +0 -0
  406. package/dist/web/assets/remote-desktop-clipboard-notice-D5KjvMZx.js.gz +0 -0
  407. package/dist/web/assets/remote-desktop-mobile-sheet-CY_DsGXZ.js.br +0 -0
  408. package/dist/web/assets/remote-desktop-mobile-sheet-CY_DsGXZ.js.gz +0 -0
  409. package/dist/web/assets/remote-desktop-mobile-view-DdpI-RF8.js.br +0 -0
  410. package/dist/web/assets/remote-desktop-readiness-gate-WIyCCAv5.js.br +0 -0
  411. package/dist/web/assets/remote-desktop-readiness-gate-WIyCCAv5.js.gz +0 -0
  412. package/dist/web/assets/remote-desktop-window-content-BMORZLZt.js.br +0 -0
  413. package/dist/web/assets/remote-desktop-window-content-BMORZLZt.js.gz +0 -0
  414. package/dist/web/assets/rename-object-dialog-pIgWe_AL.js.br +0 -0
  415. package/dist/web/assets/rename-object-dialog-pIgWe_AL.js.gz +0 -0
  416. package/dist/web/assets/review-code-oTNcTYlI.js.br +0 -0
  417. package/dist/web/assets/review-code-oTNcTYlI.js.gz +0 -0
  418. package/dist/web/assets/save-as-dialog-CnPLGTaL.js.br +0 -0
  419. package/dist/web/assets/save-as-dialog-CnPLGTaL.js.gz +0 -0
  420. package/dist/web/assets/schedules-settings-section-CREqHG_i.js.br +0 -0
  421. package/dist/web/assets/schedules-settings-section-CREqHG_i.js.gz +0 -0
  422. package/dist/web/assets/session-review-tab-nFVJYYJH.js.br +0 -0
  423. package/dist/web/assets/session-review-tab-nFVJYYJH.js.gz +0 -0
  424. package/dist/web/assets/settings-body-DNzH0wOQ.js.br +0 -0
  425. package/dist/web/assets/settings-body-DNzH0wOQ.js.gz +0 -0
  426. package/dist/web/assets/settings-rows-D02_4sDY.js.br +0 -0
  427. package/dist/web/assets/settings-rows-D02_4sDY.js.gz +0 -0
  428. package/dist/web/assets/settings-section-content-BYW_9mHv.js +0 -1
  429. package/dist/web/assets/settings-section-content-DWopMfmq.js.br +0 -0
  430. package/dist/web/assets/settings-section-content-DWopMfmq.js.gz +0 -0
  431. package/dist/web/assets/slash-command-picker-Bcizxvbh.js.br +0 -0
  432. package/dist/web/assets/slash-command-picker-Bcizxvbh.js.gz +0 -0
  433. package/dist/web/assets/sql-object-tab-b1Z2zVBm.js.br +0 -0
  434. package/dist/web/assets/sql-object-tab-b1Z2zVBm.js.gz +0 -0
  435. package/dist/web/assets/sqlite-viewer-DhPv28tq.js.br +0 -0
  436. package/dist/web/assets/sqlite-viewer-DhPv28tq.js.gz +0 -0
  437. package/dist/web/assets/structure-save-dialog-sGUpqs8D.js.br +0 -0
  438. package/dist/web/assets/structure-save-dialog-sGUpqs8D.js.gz +0 -0
  439. package/dist/web/assets/structure-tab-Bo2OmDOc.js.br +0 -0
  440. package/dist/web/assets/structure-tab-Bo2OmDOc.js.gz +0 -0
  441. package/dist/web/assets/system-monitor-body-C475Et9u.js.br +0 -0
  442. package/dist/web/assets/system-monitor-body-C475Et9u.js.gz +0 -0
  443. package/dist/web/assets/tab-host-window-content-BKI6QoDa.js.br +0 -0
  444. package/dist/web/assets/tab-host-window-content-BKI6QoDa.js.gz +0 -0
  445. package/dist/web/assets/table-tab-D-nKWMJR.js.br +0 -0
  446. package/dist/web/assets/telegram-bot-token-field-BeNS2X2k.js.br +0 -0
  447. package/dist/web/assets/telegram-bot-token-field-BeNS2X2k.js.gz +0 -0
  448. package/dist/web/assets/terminal-tab-BbP753Ab.js.br +0 -0
  449. package/dist/web/assets/terminal-tab-BbP753Ab.js.gz +0 -0
  450. package/dist/web/assets/tool-cards-Dh8Ekn2W.js.br +0 -0
  451. package/dist/web/assets/tool-cards-Dh8Ekn2W.js.gz +0 -0
  452. package/dist/web/assets/tools-settings-section-DGZRIULE.js.br +0 -0
  453. package/dist/web/assets/tools-settings-section-DGZRIULE.js.gz +0 -0
  454. package/dist/web/assets/use-inline-blame-BxwM-Wkj.js.br +0 -0
  455. package/dist/web/assets/use-inline-blame-BxwM-Wkj.js.gz +0 -0
  456. package/dist/web/assets/use-lsp-BqvwRKmM.js.br +0 -0
  457. package/dist/web/assets/use-lsp-BqvwRKmM.js.gz +0 -0
  458. package/dist/web/assets/use-process-kill-CVN_c4KF.js.br +0 -0
  459. package/dist/web/assets/use-process-kill-CVN_c4KF.js.gz +0 -0
  460. package/dist/web/assets/use-sql-schema-info-C0wBmR6-.js.br +0 -0
  461. package/dist/web/assets/use-sql-schema-info-C0wBmR6-.js.gz +0 -0
  462. package/dist/web/assets/web-preview-tab-DOgLv8Gt.js.br +0 -0
  463. package/dist/web/assets/web-preview-tab-DOgLv8Gt.js.gz +0 -0
@@ -1 +1 @@
1
- import{E as e}from"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import"./api-client-xQDlhUTu.js";import{t}from"./settings-store-B4mLp19V.js";import{Kn as n,oi as r}from"./index-BtAn_krv.js";var i=e();function a(){let{jiraEnabled:e,setJiraEnabled:a}=t(r(e=>({jiraEnabled:e.jiraEnabled,setJiraEnabled:e.setJiraEnabled})));return(0,i.jsxs)(`div`,{className:`space-y-4`,children:[(0,i.jsxs)(`section`,{className:`flex items-center justify-between gap-4`,children:[(0,i.jsxs)(`div`,{className:`min-w-0`,children:[(0,i.jsx)(`p`,{className:`text-sm font-medium`,children:`Jira Watcher`}),(0,i.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Auto-debug Jira tickets`})]}),(0,i.jsx)(n,{checked:e,onCheckedChange:a})]}),(0,i.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e?`Configure projects, watchers, and results in the Jira tab on the sidebar.`:`Enable to add a Jira tab to the sidebar, where projects and watchers are configured.`})]})}export{a as JiraWatcherSection};
1
+ import{E as e}from"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import"./api-client-xQDlhUTu.js";import{t}from"./settings-store-B4mLp19V.js";import{Kn as n,oi as r}from"./index-D8QDpdgs.js";var i=e();function a(){let{jiraEnabled:e,setJiraEnabled:a}=t(r(e=>({jiraEnabled:e.jiraEnabled,setJiraEnabled:e.setJiraEnabled})));return(0,i.jsxs)(`div`,{className:`space-y-4`,children:[(0,i.jsxs)(`section`,{className:`flex items-center justify-between gap-4`,children:[(0,i.jsxs)(`div`,{className:`min-w-0`,children:[(0,i.jsx)(`p`,{className:`text-sm font-medium`,children:`Jira Watcher`}),(0,i.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Auto-debug Jira tickets`})]}),(0,i.jsx)(n,{checked:e,onCheckedChange:a})]}),(0,i.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e?`Configure projects, watchers, and results in the Jira tab on the sidebar.`:`Enable to add a Jira tab to the sidebar, where projects and watchers are configured.`})]})}export{a as JiraWatcherSection};
@@ -1 +1 @@
1
- import"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import"./api-client-xQDlhUTu.js";import{Ti as e}from"./index-BtAn_krv.js";export{e as useKeybindingsStore};
1
+ import"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import"./api-client-xQDlhUTu.js";import{Ti as e}from"./index-D8QDpdgs.js";export{e as useKeybindingsStore};
@@ -1 +1 @@
1
- import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import{Cn as r,fr as i,gr as a,r as o}from"./icons-BwyIKaTT.js";import"./api-client-xQDlhUTu.js";import{t as s}from"./button-C9ZXWb3b.js";import{Si as c,Ti as l,bi as u,vi as d,yi as f}from"./index-BtAn_krv.js";var p=e(t(),1),m=n(),h=[{key:`general`,label:`General`},{key:`tabs`,label:`Tabs`},{key:`projects`,label:`Projects`}],g=[`Ctrl+T`,`Ctrl+W`,`Ctrl+N`,`Ctrl+Tab`,`Ctrl+L`,`Ctrl+H`,`Ctrl+J`,`F5`,`Ctrl+R`,`Ctrl+Shift+I`,`Ctrl+Shift+J`];function _({actionId:e,combo:t,locked:n}){let[i,a]=(0,p.useState)(!1),o=l(e=>e.setBinding),s=(0,p.useRef)(null),d=(0,p.useCallback)(t=>{if(t.preventDefault(),t.stopPropagation(),t.key===`Escape`){a(!1);return}let n=u(t);n&&(o(e,n),a(!1))},[e,o]);return(0,p.useEffect)(()=>{if(i)return document.addEventListener(`keydown`,d,!0),()=>document.removeEventListener(`keydown`,d,!0)},[i,d]),(0,p.useEffect)(()=>{if(!i)return;let e=e=>{s.current&&!s.current.contains(e.target)&&a(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[i]),n?(0,m.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded border border-border bg-muted px-2 py-0.5 text-[11px] font-mono text-muted-foreground`,children:[(0,m.jsx)(r,{className:`size-2.5`}),c(t)]}):i?(0,m.jsx)(`button`,{ref:s,className:`inline-flex items-center rounded border-2 border-primary bg-primary/10 px-2 py-0.5 text-[11px] font-mono text-primary animate-pulse`,children:`Press keys...`}):(0,m.jsx)(`button`,{ref:s,onClick:()=>a(!0),className:`inline-flex items-center rounded border border-border bg-surface px-2 py-0.5 text-[11px] font-mono text-foreground hover:border-primary hover:bg-primary/5 transition-colors cursor-pointer`,title:`Click to change shortcut`,children:c(t)})}function v(){let{getBinding:e,resetBinding:t,resetAll:n,overrides:r}=l(),c=d(e=>e.contributions),u=c?.keybindings??[],p=c?.commands??[];return(0,m.jsxs)(`div`,{className:`space-y-3`,children:[(0,m.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,m.jsx)(`h3`,{className:`text-xs font-medium text-text-secondary`,children:`Keyboard Shortcuts`}),Object.keys(r).length>0&&(0,m.jsxs)(s,{variant:`ghost`,size:`sm`,className:`h-6 text-[10px] text-muted-foreground`,onClick:n,children:[(0,m.jsx)(a,{className:`size-3 mr-1`}),`Reset all`]})]}),(0,m.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-warning/30 bg-warning/5 px-2.5 py-2`,children:[(0,m.jsx)(o,{className:`size-3.5 text-warning shrink-0 mt-0.5`}),(0,m.jsxs)(`p`,{className:`text-[10px] text-muted-foreground leading-relaxed`,children:[`Some shortcuts (`,g.slice(0,4).join(`, `),`...) are reserved by the browser and cannot be overridden.`]})]}),h.map(n=>{let i=f.filter(e=>e.category===n.key);return i.length===0?null:(0,m.jsxs)(`div`,{className:`space-y-1`,children:[(0,m.jsx)(`span`,{className:`text-[10px] font-medium text-muted-foreground uppercase tracking-wide`,children:n.label}),(0,m.jsx)(`div`,{className:`space-y-0.5`,children:i.map(n=>{let i=e(n.id),o=n.id in r;return(0,m.jsxs)(`div`,{className:`flex items-center justify-between py-1 px-1 rounded hover:bg-surface-elevated/50 transition-colors`,children:[(0,m.jsxs)(`div`,{className:`flex flex-col min-w-0`,children:[(0,m.jsx)(`span`,{className:`text-xs text-foreground`,children:n.label}),n.note&&(0,m.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:n.note})]}),(0,m.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0 ml-2`,children:[(0,m.jsx)(_,{actionId:n.id,combo:i,locked:n.locked}),o&&!n.locked&&(0,m.jsx)(`button`,{onClick:()=>t(n.id),className:`flex items-center justify-center size-5 rounded text-muted-foreground hover:text-foreground hover:bg-surface-elevated transition-colors`,title:`Reset to default`,children:(0,m.jsx)(a,{className:`size-3`})})]})]},n.id)})})]},n.key)}),u.length>0&&(0,m.jsxs)(`div`,{className:`space-y-1`,children:[(0,m.jsx)(`span`,{className:`text-[10px] font-medium text-muted-foreground uppercase tracking-wide`,children:`Extensions`}),(0,m.jsx)(`div`,{className:`space-y-0.5`,children:u.map(n=>{let o=p.find(e=>e.command===n.command)?.title??n.command,s=`ext:${n.command}`,c=e(s)||n.key,l=s in r;return(0,m.jsxs)(`div`,{className:`flex items-center justify-between py-1 px-1 rounded hover:bg-surface-elevated/50 transition-colors`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-1.5 min-w-0`,children:[(0,m.jsx)(i,{className:`size-3 text-muted-foreground shrink-0`}),(0,m.jsx)(`span`,{className:`text-xs text-foreground`,children:o})]}),(0,m.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0 ml-2`,children:[(0,m.jsx)(_,{actionId:s,combo:c}),l&&(0,m.jsx)(`button`,{onClick:()=>t(s),className:`flex items-center justify-center size-5 rounded text-muted-foreground hover:text-foreground hover:bg-surface-elevated transition-colors`,title:`Reset to default`,children:(0,m.jsx)(a,{className:`size-3`})})]})]},s)})})]})]})}export{v as KeyboardShortcutsSection};
1
+ import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import{Cn as r,fr as i,gr as a,r as o}from"./icons-BwyIKaTT.js";import"./api-client-xQDlhUTu.js";import{t as s}from"./button-C9ZXWb3b.js";import{Si as c,Ti as l,bi as u,vi as d,yi as f}from"./index-D8QDpdgs.js";var p=e(t(),1),m=n(),h=[{key:`general`,label:`General`},{key:`tabs`,label:`Tabs`},{key:`projects`,label:`Projects`}],g=[`Ctrl+T`,`Ctrl+W`,`Ctrl+N`,`Ctrl+Tab`,`Ctrl+L`,`Ctrl+H`,`Ctrl+J`,`F5`,`Ctrl+R`,`Ctrl+Shift+I`,`Ctrl+Shift+J`];function _({actionId:e,combo:t,locked:n}){let[i,a]=(0,p.useState)(!1),o=l(e=>e.setBinding),s=(0,p.useRef)(null),d=(0,p.useCallback)(t=>{if(t.preventDefault(),t.stopPropagation(),t.key===`Escape`){a(!1);return}let n=u(t);n&&(o(e,n),a(!1))},[e,o]);return(0,p.useEffect)(()=>{if(i)return document.addEventListener(`keydown`,d,!0),()=>document.removeEventListener(`keydown`,d,!0)},[i,d]),(0,p.useEffect)(()=>{if(!i)return;let e=e=>{s.current&&!s.current.contains(e.target)&&a(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[i]),n?(0,m.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded border border-border bg-muted px-2 py-0.5 text-[11px] font-mono text-muted-foreground`,children:[(0,m.jsx)(r,{className:`size-2.5`}),c(t)]}):i?(0,m.jsx)(`button`,{ref:s,className:`inline-flex items-center rounded border-2 border-primary bg-primary/10 px-2 py-0.5 text-[11px] font-mono text-primary animate-pulse`,children:`Press keys...`}):(0,m.jsx)(`button`,{ref:s,onClick:()=>a(!0),className:`inline-flex items-center rounded border border-border bg-surface px-2 py-0.5 text-[11px] font-mono text-foreground hover:border-primary hover:bg-primary/5 transition-colors cursor-pointer`,title:`Click to change shortcut`,children:c(t)})}function v(){let{getBinding:e,resetBinding:t,resetAll:n,overrides:r}=l(),c=d(e=>e.contributions),u=c?.keybindings??[],p=c?.commands??[];return(0,m.jsxs)(`div`,{className:`space-y-3`,children:[(0,m.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,m.jsx)(`h3`,{className:`text-xs font-medium text-text-secondary`,children:`Keyboard Shortcuts`}),Object.keys(r).length>0&&(0,m.jsxs)(s,{variant:`ghost`,size:`sm`,className:`h-6 text-[10px] text-muted-foreground`,onClick:n,children:[(0,m.jsx)(a,{className:`size-3 mr-1`}),`Reset all`]})]}),(0,m.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-warning/30 bg-warning/5 px-2.5 py-2`,children:[(0,m.jsx)(o,{className:`size-3.5 text-warning shrink-0 mt-0.5`}),(0,m.jsxs)(`p`,{className:`text-[10px] text-muted-foreground leading-relaxed`,children:[`Some shortcuts (`,g.slice(0,4).join(`, `),`...) are reserved by the browser and cannot be overridden.`]})]}),h.map(n=>{let i=f.filter(e=>e.category===n.key);return i.length===0?null:(0,m.jsxs)(`div`,{className:`space-y-1`,children:[(0,m.jsx)(`span`,{className:`text-[10px] font-medium text-muted-foreground uppercase tracking-wide`,children:n.label}),(0,m.jsx)(`div`,{className:`space-y-0.5`,children:i.map(n=>{let i=e(n.id),o=n.id in r;return(0,m.jsxs)(`div`,{className:`flex items-center justify-between py-1 px-1 rounded hover:bg-surface-elevated/50 transition-colors`,children:[(0,m.jsxs)(`div`,{className:`flex flex-col min-w-0`,children:[(0,m.jsx)(`span`,{className:`text-xs text-foreground`,children:n.label}),n.note&&(0,m.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:n.note})]}),(0,m.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0 ml-2`,children:[(0,m.jsx)(_,{actionId:n.id,combo:i,locked:n.locked}),o&&!n.locked&&(0,m.jsx)(`button`,{onClick:()=>t(n.id),className:`flex items-center justify-center size-5 rounded text-muted-foreground hover:text-foreground hover:bg-surface-elevated transition-colors`,title:`Reset to default`,children:(0,m.jsx)(a,{className:`size-3`})})]})]},n.id)})})]},n.key)}),u.length>0&&(0,m.jsxs)(`div`,{className:`space-y-1`,children:[(0,m.jsx)(`span`,{className:`text-[10px] font-medium text-muted-foreground uppercase tracking-wide`,children:`Extensions`}),(0,m.jsx)(`div`,{className:`space-y-0.5`,children:u.map(n=>{let o=p.find(e=>e.command===n.command)?.title??n.command,s=`ext:${n.command}`,c=e(s)||n.key,l=s in r;return(0,m.jsxs)(`div`,{className:`flex items-center justify-between py-1 px-1 rounded hover:bg-surface-elevated/50 transition-colors`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-1.5 min-w-0`,children:[(0,m.jsx)(i,{className:`size-3 text-muted-foreground shrink-0`}),(0,m.jsx)(`span`,{className:`text-xs text-foreground`,children:o})]}),(0,m.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0 ml-2`,children:[(0,m.jsx)(_,{actionId:s,combo:c}),l&&(0,m.jsx)(`button`,{onClick:()=>t(s),className:`flex items-center justify-center size-5 rounded text-muted-foreground hover:text-foreground hover:bg-surface-elevated transition-colors`,title:`Reset to default`,children:(0,m.jsx)(a,{className:`size-3`})})]})]},s)})})]})]})}export{v as KeyboardShortcutsSection};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/lsp-client-CIcphNmU.js","assets/rolldown-runtime-C5c2KzVm.js","assets/index-BtAn_krv.js","assets/preload-helper-CM8YhcCa.js","assets/vendor-ui-BTSIXzhZ.js","assets/vendor-markdown-C-P1aR4p.js","assets/button-C9ZXWb3b.js","assets/utils-Bslrbb-G.js","assets/createLucideIcon-D9_fdOKS.js","assets/file-diff-CcDhJkXB.js","assets/git-commit-horizontal-BPdj2L1i.js","assets/api-client-xQDlhUTu.js","assets/react-BZ0kba1-.js","assets/open-db-tabs-CtWIWHOa.js","assets/window-store-DqX_qmkQ.js","assets/panel-store-BJhazigC.js","assets/session-list-sync-triggers-DtJI5KF0.js","assets/project-store-BLGl9IAO.js","assets/project-framework-store-DwLxaRan.js","assets/explorer-model-BtJN4MZ9.js","assets/db-sidebar-reveal-_qw0CliT.js","assets/settings-store-B4mLp19V.js","assets/use-is-mobile-VRV9eZy1.js","assets/db-types-CNhENouW.js","assets/tab-store-D5I52eLN.js","assets/use-db-driver-installed-anzWkGi5.js","assets/impexp-state-BWKOuRGj.js","assets/file-store-BQ41vIs5.js","assets/sql-identifiers-DDISwQor.js","assets/db-explorer-store-BmpvDHz6.js","assets/onboarding-quick-orientation-CTHtIRib.js","assets/dialog-Dn_2tuYa.js","assets/portal-container-context-NBi-KGK0.js","assets/icons-BwyIKaTT.js","assets/format-file-meta-DdYtk07C.js","assets/fs-api-CFtQzsIJ.js","assets/open-settings-EXR4zoZG.js","assets/settings-categories-Ajj4ui27.js","assets/adaptive-context-menu-C4jNSORA.js","assets/context-menu-BCuZYfWC.js","assets/mobile-bottom-sheet-DArbIyrD.js","assets/use-visual-viewport-MmugpRg-.js","assets/dropdown-menu-BQidk_OJ.js","assets/input-C3oVNCMq.js","assets/scroll-area-DOlQJGZp.js","assets/start-ellipsis-CU8GkxaV.js","assets/chat-preparation-cache-190LLyy7.js","assets/clipboard-D-VCry-F.js","assets/file-icons-JInFtBVl.js","assets/format-date-CSHaU2wN.js","assets/git-repo-store-CKB5fdNP.js","assets/patch-tab-metadata-C92YkrRX.js","assets/ws-auth-CbF6GqxP.js","assets/apply-theme-ORrEdHKT.js","assets/resolve-theme-BqoL27BW.js","assets/index-BACBJm4i.css"])))=>i.map(i=>d[i]);
2
- import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import{A as r,Kr as i,ht as a,pi as o,ut as s,xn as c}from"./icons-BwyIKaTT.js";import{k as l,r as u}from"./api-client-xQDlhUTu.js";import{t as d}from"./settings-store-B4mLp19V.js";import{t as f}from"./preload-helper-CM8YhcCa.js";import"./portal-container-context-NBi-KGK0.js";import{n as p}from"./use-is-mobile-VRV9eZy1.js";import{t as m}from"./button-C9ZXWb3b.js";import{a as h,n as g,o as _,t as v}from"./dialog-Dn_2tuYa.js";import{t as y}from"./mobile-bottom-sheet-DArbIyrD.js";import"./use-visual-viewport-MmugpRg-.js";import{Kn as b,R as x}from"./index-BtAn_krv.js";import{t as S}from"./separator-DmU9aJwq.js";var C=e(t(),1),w=n();function T(){let[e,t]=(0,C.useState)(null),[n,r]=(0,C.useState)(!0),[i,a]=(0,C.useState)(null),[s,m]=(0,C.useState)(null),[h,g]=(0,C.useState)(null),_=d(e=>e.lspEnabled),v=d(e=>e.setLspEnabled),y=p(),T=x(),D=(0,C.useCallback)(async()=>{try{t(await u.get(`/api/lsp/servers`))}catch(e){console.error(`Failed to load language servers:`,e)}finally{r(!1)}},[]);(0,C.useEffect)(()=>{D()},[D]);let k=async e=>{a(e.id);try{await u.post(`/api/lsp/install`,{serverId:e.id}),l.success(`Installed ${e.displayName}`),await D(),(await f(()=>import(`./lsp-client-CIcphNmU.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55]))).retryUnavailableLspDocuments()}catch(t){l.error(t instanceof Error?t.message:`Could not install ${e.displayName}`)}finally{a(null)}},A=async e=>{g(null),m(e.id);try{await u.post(`/api/lsp/uninstall`,{serverId:e.id}),l.success(`Removed ${[e.displayName,...e.alsoRemoves??[]].join(`, `)}`),await D()}catch(t){l.error(t instanceof Error?t.message:`Could not remove ${e.displayName}`)}finally{m(null)}};if(n)return(0,w.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,w.jsx)(c,{className:`size-4 animate-spin text-muted-foreground`})});let j=e?.servers??[],M=new Set((e?.running??[]).map(e=>e.serverId)),N=i!==null||s!==null,P=j.filter(e=>e.installed).length;return(0,w.jsxs)(`div`,{className:`space-y-4`,children:[(0,w.jsxs)(`section`,{className:`flex items-center justify-between gap-4`,children:[(0,w.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,w.jsx)(o,{className:`size-4 text-muted-foreground shrink-0`}),(0,w.jsxs)(`div`,{className:`min-w-0`,children:[(0,w.jsx)(`p`,{className:`text-sm font-medium`,children:`Language Server`}),(0,w.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:T?`Off on a touch device — it runs a server process per project`:`Completions, hover, F12, rename and quick fix (this device)`})]})]}),(0,w.jsx)(b,{checked:_&&!T,disabled:T,onCheckedChange:v})]}),(0,w.jsx)(S,{}),(0,w.jsxs)(`section`,{className:`space-y-2`,children:[(0,w.jsxs)(`h3`,{className:`text-xs font-medium text-muted-foreground`,children:[`Servers (`,P,` of `,j.length,` installed)`]}),(0,w.jsxs)(`p`,{className:`text-[11px] text-muted-foreground`,children:[`PPM installs into `,(0,w.jsx)(`span`,{className:`font-mono`,children:e?.installDir}),`, so nothing you installed yourself changes — and Remove undoes exactly that, which is why a server PPM did not put there has no Remove. rust-analyzer is the exception: it is a rustup component, added to and removed from this machine's default toolchain. A server only starts when a file it serves is open.`]}),(0,w.jsx)(`div`,{className:`space-y-1`,children:j.map(e=>(0,w.jsx)(E,{server:e,running:M.has(e.id),installing:i===e.id,removing:s===e.id,busy:N,isMobile:y,onInstall:()=>k(e),onRemove:()=>g(e)},e.id))})]}),h&&(0,w.jsx)(O,{server:h,onConfirm:()=>A(h),onCancel:()=>g(null)})]})}function E({server:e,running:t,installing:n,removing:o,busy:s,isMobile:l,onInstall:u,onRemove:d}){return(0,w.jsxs)(`div`,{className:`flex items-center gap-2 px-2.5 py-2 rounded-lg bg-muted/50`,children:[(0,w.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,w.jsxs)(`p`,{className:`text-xs font-medium truncate`,children:[e.displayName,t&&(0,w.jsx)(`span`,{className:`ml-1.5 text-[11px] text-success`,children:`running`})]}),(0,w.jsx)(`p`,{className:`text-[11px] text-muted-foreground truncate`,children:e.languages.join(`, `)})]}),e.installed?(0,w.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0`,children:[(0,w.jsxs)(`span`,{className:`flex items-center gap-1 text-[11px] text-muted-foreground`,children:[(0,w.jsx)(r,{className:`size-3.5 text-success`}),D(e.origin)]}),e.removable&&(0,w.jsx)(m,{variant:`ghost`,size:`icon`,disabled:s,onClick:d,title:`Remove ${e.displayName}`,"aria-label":`Remove ${e.displayName}`,className:`text-error cursor-pointer ${l?`size-11`:`size-8`}`,children:o?(0,w.jsx)(c,{className:`size-3.5 animate-spin`}):(0,w.jsx)(i,{className:`size-3.5`})})]}):e.installable?(0,w.jsxs)(m,{variant:`outline`,size:`sm`,disabled:s,onClick:u,className:`text-xs px-3 gap-1 cursor-pointer shrink-0 ${l?`min-h-11`:`h-8`}`,children:[n?(0,w.jsx)(c,{className:`size-3 animate-spin`}):(0,w.jsx)(a,{className:`size-3`}),`Install`]}):(0,w.jsx)(A,{hint:e.installHint,isMobile:l})]})}function D(e){switch(e){case`project`:return`In project`;case`path`:return`On PATH`;case`bundled`:return`Bundled`;default:return`Installed`}}function O({server:e,onConfirm:t,onCancel:n}){let r=p(),i=e.alsoRemoves??[],a=(0,w.jsxs)(`div`,{className:`space-y-4`,"data-testid":`lsp-remove-confirm`,children:[(0,w.jsxs)(`p`,{className:`text-sm`,children:[`Remove `,(0,w.jsx)(`span`,{className:`font-medium`,children:e.displayName}),`?`]}),i.length>0&&(0,w.jsxs)(`p`,{className:`text-xs text-error`,children:[i.join(` and `),` `,i.length>1?`come`:`comes`,` from the same npm package, so`,` `,i.length>1?`they go`:`it goes`,` too.`]}),(0,w.jsx)(`p`,{className:`text-xs text-text-subtle`,children:k(e.installWith)}),(0,w.jsxs)(`div`,{className:`flex flex-col-reverse md:flex-row gap-2 md:justify-end pt-2`,children:[(0,w.jsx)(m,{variant:`outline`,onClick:n,className:`min-h-11 cursor-pointer`,children:`Cancel`}),(0,w.jsx)(m,{variant:`destructive`,autoFocus:!1,onClick:t,className:`min-h-11 cursor-pointer`,children:`Remove`})]})]});return r?(0,w.jsx)(y,{open:!0,onClose:n,children:(0,w.jsxs)(`div`,{className:`px-4 pb-4`,children:[(0,w.jsxs)(`h2`,{className:`text-base font-semibold mb-3`,children:[`Remove `,e.displayName]}),a]})}):(0,w.jsx)(v,{open:!0,onOpenChange:e=>{e||n()},children:(0,w.jsxs)(g,{className:`sm:max-w-sm`,children:[(0,w.jsx)(h,{children:(0,w.jsxs)(_,{className:`text-sm`,children:[`Remove `,e.displayName]})}),a]})})}function k(e){switch(e){case`rustup`:return`Runs rustup component remove, so it leaves this machine's default toolchain rather than a folder of PPM's. Installing it again is one press of the button.`;case`go`:return`Deletes the binary PPM built in its own folder. Anything in your own GOBIN is untouched.`;case`download`:return`Deletes the release PPM downloaded into its own folder. A copy you installed yourself is untouched.`;case`gem`:return`Deletes the gems PPM installed into its own folder. Your own Ruby and its gems are untouched.`;default:return`Runs bun remove in PPM's own folder. Nothing you installed yourself changes, and a server already running keeps running until its last editor closes.`}}function A({hint:e,isMobile:t}){let[n,i]=(0,C.useState)(!1);return(0,w.jsxs)(`button`,{type:`button`,title:e,onClick:()=>{navigator.clipboard?.writeText(e).then(()=>{i(!0),setTimeout(()=>i(!1),1500)})},className:`flex items-center gap-1.5 max-w-40 sm:max-w-64 rounded border border-border px-2 font-mono text-[11px] text-muted-foreground hover:bg-muted active:scale-[0.99] transition cursor-pointer shrink-0 ${t?`min-h-11`:`py-1`}`,children:[(0,w.jsx)(`span`,{className:`truncate`,children:e}),n?(0,w.jsx)(r,{className:`size-3 shrink-0 text-success`}):(0,w.jsx)(s,{className:`size-3 shrink-0 opacity-60`})]})}export{T as LanguageServersSection};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/lsp-client-BTlK_8lb.js","assets/rolldown-runtime-C5c2KzVm.js","assets/index-D8QDpdgs.js","assets/preload-helper-CM8YhcCa.js","assets/vendor-ui-BTSIXzhZ.js","assets/vendor-markdown-C-P1aR4p.js","assets/button-C9ZXWb3b.js","assets/utils-Bslrbb-G.js","assets/createLucideIcon-D9_fdOKS.js","assets/file-diff-CcDhJkXB.js","assets/git-commit-horizontal-BPdj2L1i.js","assets/api-client-xQDlhUTu.js","assets/react-BZ0kba1-.js","assets/open-db-tabs-CtWIWHOa.js","assets/window-store-DqX_qmkQ.js","assets/panel-store-BJhazigC.js","assets/session-list-sync-triggers-DtJI5KF0.js","assets/project-store-BLGl9IAO.js","assets/project-framework-store-DwLxaRan.js","assets/explorer-model-BtJN4MZ9.js","assets/db-sidebar-reveal-_qw0CliT.js","assets/settings-store-B4mLp19V.js","assets/use-is-mobile-VRV9eZy1.js","assets/db-types-CNhENouW.js","assets/tab-store-D5I52eLN.js","assets/use-db-driver-installed-anzWkGi5.js","assets/impexp-state-BWKOuRGj.js","assets/file-store-BQ41vIs5.js","assets/sql-identifiers-DDISwQor.js","assets/db-explorer-store-BmpvDHz6.js","assets/onboarding-quick-orientation-CTHtIRib.js","assets/dialog-Dn_2tuYa.js","assets/portal-container-context-NBi-KGK0.js","assets/icons-BwyIKaTT.js","assets/format-file-meta-DdYtk07C.js","assets/fs-api-CFtQzsIJ.js","assets/open-settings-EXR4zoZG.js","assets/settings-categories-Ajj4ui27.js","assets/adaptive-context-menu-C4jNSORA.js","assets/context-menu-BCuZYfWC.js","assets/mobile-bottom-sheet-DArbIyrD.js","assets/use-visual-viewport-MmugpRg-.js","assets/dropdown-menu-BQidk_OJ.js","assets/input-C3oVNCMq.js","assets/scroll-area-DOlQJGZp.js","assets/start-ellipsis-CU8GkxaV.js","assets/chat-preparation-cache-190LLyy7.js","assets/clipboard-D-VCry-F.js","assets/file-icons-JInFtBVl.js","assets/format-date-CkyHzZLA.js","assets/git-repo-store-CKB5fdNP.js","assets/patch-tab-metadata-C92YkrRX.js","assets/ws-auth-CbF6GqxP.js","assets/apply-theme-ORrEdHKT.js","assets/resolve-theme-BqoL27BW.js","assets/index-BACBJm4i.css"])))=>i.map(i=>d[i]);
2
+ import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import{A as r,Kr as i,ht as a,pi as o,ut as s,xn as c}from"./icons-BwyIKaTT.js";import{k as l,r as u}from"./api-client-xQDlhUTu.js";import{t as d}from"./settings-store-B4mLp19V.js";import{t as f}from"./preload-helper-CM8YhcCa.js";import"./portal-container-context-NBi-KGK0.js";import{n as p}from"./use-is-mobile-VRV9eZy1.js";import{t as m}from"./button-C9ZXWb3b.js";import{a as h,n as g,o as _,t as v}from"./dialog-Dn_2tuYa.js";import{t as y}from"./mobile-bottom-sheet-DArbIyrD.js";import"./use-visual-viewport-MmugpRg-.js";import{Kn as b,R as x}from"./index-D8QDpdgs.js";import{t as S}from"./separator-DmU9aJwq.js";var C=e(t(),1),w=n();function T(){let[e,t]=(0,C.useState)(null),[n,r]=(0,C.useState)(!0),[i,a]=(0,C.useState)(null),[s,m]=(0,C.useState)(null),[h,g]=(0,C.useState)(null),_=d(e=>e.lspEnabled),v=d(e=>e.setLspEnabled),y=p(),T=x(),D=(0,C.useCallback)(async()=>{try{t(await u.get(`/api/lsp/servers`))}catch(e){console.error(`Failed to load language servers:`,e)}finally{r(!1)}},[]);(0,C.useEffect)(()=>{D()},[D]);let k=async e=>{a(e.id);try{await u.post(`/api/lsp/install`,{serverId:e.id}),l.success(`Installed ${e.displayName}`),await D(),(await f(()=>import(`./lsp-client-BTlK_8lb.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55]))).retryUnavailableLspDocuments()}catch(t){l.error(t instanceof Error?t.message:`Could not install ${e.displayName}`)}finally{a(null)}},A=async e=>{g(null),m(e.id);try{await u.post(`/api/lsp/uninstall`,{serverId:e.id}),l.success(`Removed ${[e.displayName,...e.alsoRemoves??[]].join(`, `)}`),await D()}catch(t){l.error(t instanceof Error?t.message:`Could not remove ${e.displayName}`)}finally{m(null)}};if(n)return(0,w.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,w.jsx)(c,{className:`size-4 animate-spin text-muted-foreground`})});let j=e?.servers??[],M=new Set((e?.running??[]).map(e=>e.serverId)),N=i!==null||s!==null,P=j.filter(e=>e.installed).length;return(0,w.jsxs)(`div`,{className:`space-y-4`,children:[(0,w.jsxs)(`section`,{className:`flex items-center justify-between gap-4`,children:[(0,w.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,w.jsx)(o,{className:`size-4 text-muted-foreground shrink-0`}),(0,w.jsxs)(`div`,{className:`min-w-0`,children:[(0,w.jsx)(`p`,{className:`text-sm font-medium`,children:`Language Server`}),(0,w.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:T?`Off on a touch device — it runs a server process per project`:`Completions, hover, F12, rename and quick fix (this device)`})]})]}),(0,w.jsx)(b,{checked:_&&!T,disabled:T,onCheckedChange:v})]}),(0,w.jsx)(S,{}),(0,w.jsxs)(`section`,{className:`space-y-2`,children:[(0,w.jsxs)(`h3`,{className:`text-xs font-medium text-muted-foreground`,children:[`Servers (`,P,` of `,j.length,` installed)`]}),(0,w.jsxs)(`p`,{className:`text-[11px] text-muted-foreground`,children:[`PPM installs into `,(0,w.jsx)(`span`,{className:`font-mono`,children:e?.installDir}),`, so nothing you installed yourself changes — and Remove undoes exactly that, which is why a server PPM did not put there has no Remove. rust-analyzer is the exception: it is a rustup component, added to and removed from this machine's default toolchain. A server only starts when a file it serves is open.`]}),(0,w.jsx)(`div`,{className:`space-y-1`,children:j.map(e=>(0,w.jsx)(E,{server:e,running:M.has(e.id),installing:i===e.id,removing:s===e.id,busy:N,isMobile:y,onInstall:()=>k(e),onRemove:()=>g(e)},e.id))})]}),h&&(0,w.jsx)(O,{server:h,onConfirm:()=>A(h),onCancel:()=>g(null)})]})}function E({server:e,running:t,installing:n,removing:o,busy:s,isMobile:l,onInstall:u,onRemove:d}){return(0,w.jsxs)(`div`,{className:`flex items-center gap-2 px-2.5 py-2 rounded-lg bg-muted/50`,children:[(0,w.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,w.jsxs)(`p`,{className:`text-xs font-medium truncate`,children:[e.displayName,t&&(0,w.jsx)(`span`,{className:`ml-1.5 text-[11px] text-success`,children:`running`})]}),(0,w.jsx)(`p`,{className:`text-[11px] text-muted-foreground truncate`,children:e.languages.join(`, `)})]}),e.installed?(0,w.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0`,children:[(0,w.jsxs)(`span`,{className:`flex items-center gap-1 text-[11px] text-muted-foreground`,children:[(0,w.jsx)(r,{className:`size-3.5 text-success`}),D(e.origin)]}),e.removable&&(0,w.jsx)(m,{variant:`ghost`,size:`icon`,disabled:s,onClick:d,title:`Remove ${e.displayName}`,"aria-label":`Remove ${e.displayName}`,className:`text-error cursor-pointer ${l?`size-11`:`size-8`}`,children:o?(0,w.jsx)(c,{className:`size-3.5 animate-spin`}):(0,w.jsx)(i,{className:`size-3.5`})})]}):e.installable?(0,w.jsxs)(m,{variant:`outline`,size:`sm`,disabled:s,onClick:u,className:`text-xs px-3 gap-1 cursor-pointer shrink-0 ${l?`min-h-11`:`h-8`}`,children:[n?(0,w.jsx)(c,{className:`size-3 animate-spin`}):(0,w.jsx)(a,{className:`size-3`}),`Install`]}):(0,w.jsx)(A,{hint:e.installHint,isMobile:l})]})}function D(e){switch(e){case`project`:return`In project`;case`path`:return`On PATH`;case`bundled`:return`Bundled`;default:return`Installed`}}function O({server:e,onConfirm:t,onCancel:n}){let r=p(),i=e.alsoRemoves??[],a=(0,w.jsxs)(`div`,{className:`space-y-4`,"data-testid":`lsp-remove-confirm`,children:[(0,w.jsxs)(`p`,{className:`text-sm`,children:[`Remove `,(0,w.jsx)(`span`,{className:`font-medium`,children:e.displayName}),`?`]}),i.length>0&&(0,w.jsxs)(`p`,{className:`text-xs text-error`,children:[i.join(` and `),` `,i.length>1?`come`:`comes`,` from the same npm package, so`,` `,i.length>1?`they go`:`it goes`,` too.`]}),(0,w.jsx)(`p`,{className:`text-xs text-text-subtle`,children:k(e.installWith)}),(0,w.jsxs)(`div`,{className:`flex flex-col-reverse md:flex-row gap-2 md:justify-end pt-2`,children:[(0,w.jsx)(m,{variant:`outline`,onClick:n,className:`min-h-11 cursor-pointer`,children:`Cancel`}),(0,w.jsx)(m,{variant:`destructive`,autoFocus:!1,onClick:t,className:`min-h-11 cursor-pointer`,children:`Remove`})]})]});return r?(0,w.jsx)(y,{open:!0,onClose:n,children:(0,w.jsxs)(`div`,{className:`px-4 pb-4`,children:[(0,w.jsxs)(`h2`,{className:`text-base font-semibold mb-3`,children:[`Remove `,e.displayName]}),a]})}):(0,w.jsx)(v,{open:!0,onOpenChange:e=>{e||n()},children:(0,w.jsxs)(g,{className:`sm:max-w-sm`,children:[(0,w.jsx)(h,{children:(0,w.jsxs)(_,{className:`text-sm`,children:[`Remove `,e.displayName]})}),a]})})}function k(e){switch(e){case`rustup`:return`Runs rustup component remove, so it leaves this machine's default toolchain rather than a folder of PPM's. Installing it again is one press of the button.`;case`go`:return`Deletes the binary PPM built in its own folder. Anything in your own GOBIN is untouched.`;case`download`:return`Deletes the release PPM downloaded into its own folder. A copy you installed yourself is untouched.`;case`gem`:return`Deletes the gems PPM installed into its own folder. Your own Ruby and its gems are untouched.`;default:return`Runs bun remove in PPM's own folder. Nothing you installed yourself changes, and a server already running keeps running until its last editor closes.`}}function A({hint:e,isMobile:t}){let[n,i]=(0,C.useState)(!1);return(0,w.jsxs)(`button`,{type:`button`,title:e,onClick:()=>{navigator.clipboard?.writeText(e).then(()=>{i(!0),setTimeout(()=>i(!1),1500)})},className:`flex items-center gap-1.5 max-w-40 sm:max-w-64 rounded border border-border px-2 font-mono text-[11px] text-muted-foreground hover:bg-muted active:scale-[0.99] transition cursor-pointer shrink-0 ${t?`min-h-11`:`py-1`}`,children:[(0,w.jsx)(`span`,{className:`truncate`,children:e}),n?(0,w.jsx)(r,{className:`size-3 shrink-0 text-success`}):(0,w.jsx)(s,{className:`size-3 shrink-0 opacity-60`})]})}export{T as LanguageServersSection};
@@ -1,4 +1,4 @@
1
- import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-C-P1aR4p.js";import{$ as r,A as i,An as a,Cn as o,Cr as s,D as c,Dr as l,Ft as u,Gt as d,Hr as f,M as p,O as m,P as h,Vn as g,ai as _,br as v,c as ee,cr as y,dn as b,er as x,fr as S,gt as C,hr as te,ht as w,jn as T,jr as E,kr as D,li as O,m as k,nt as A,o as j,on as M,or as ne,qr as N,si as P,t as F,tt as re,ut as ie,vt as I,w as ae,xn as oe,xr as L}from"./icons-BwyIKaTT.js";import{k as R}from"./api-client-xQDlhUTu.js";import{t as z}from"./react-BZ0kba1-.js";import{t as B}from"./settings-store-B4mLp19V.js";import{n as V}from"./utils-Bslrbb-G.js";import{r as se,t as ce}from"./panel-store-BJhazigC.js";import{i as H}from"./project-store-BLGl9IAO.js";import{r as U}from"./clipboard-D-VCry-F.js";import{t as W}from"./button-C9ZXWb3b.js";import{a as G,i as K,l as le,m as ue,r as de,t as fe}from"./dropdown-menu-BQidk_OJ.js";import{t as q}from"./mobile-bottom-sheet-DArbIyrD.js";import{$t as pe,At as me,Bt as J,Ct as he,Dt as Y,Et as ge,F as _e,Ft as ve,Gt as ye,Ht as be,I as xe,It as Se,Ji as Ce,Jt as we,Ki as Te,Kn as Ee,Kt as De,Lt as Oe,Mt as ke,Nt as Ae,Ot as je,Pt as X,Qt as Me,Rt as Ne,St as Pe,Tt as Fe,Ut as Ie,Vt as Le,Wt as Re,Xt as ze,Yt as Be,Zt as Ve,_t as He,ai as Ue,at as We,bt as Ge,en as Ke,gt as qe,jt as Je,kt as Ye,nn as Xe,on as Ze,qi as Qe,qt as $e,rn as et,tn as tt,vt as nt,wt as rt,xt as it,yt as at,zt as ot}from"./index-BtAn_krv.js";import{i as st,r as ct}from"./send-to-chat-CWV1qd3c.js";import{t as lt}from"./code-fence-BK57HRhJ.js";var ut=/\b[a-z0-9]+(?:-[a-z0-9]+)+\.trycloudflare\.com\b/gi,dt=[/()\b(?:sk-[\w-]{20,}|gh[pousr]_[A-Za-z0-9]{30,}|github_pat_\w{30,}|eyJ[\w-]{8,}\.eyJ[\w-]{8,}\.[\w-]*)/g,/(\d{6,}:)[\w-]{30,}/g,/(:\/\/[^/\s:@]*:)[^@\s/\u0001]+(?=@)/g,/([?&#][\w.-]*(?:token|key|secret|passw|auth|code|state|ticket|sig|credential)[\w.-]*=)[^&#\s"'<>[\]\u0001]+/gi,/(\b(?:proxy-)?authorization["']?\s*[:=]\s*["']?)(?:(?:basic|bearer|digest|token)\s+)?[^\s"',;\u0001]+/gi,/(\b(?:set-)?cookie["']?\s*[:=]\s*["']?)(?=[^\s=;"']+=)[^\r\n"'\u0001]+/gi,/(\bbearer\s+)[^\s"',;[\]\u0001]+/gi,/((?:token|secret|passw(?:or)?d|api[_-]?key|access[_-]?key|private[_-]?key)["']?\s*[:=]\s*["']?)[^\s"'&,;)}[\]\u0001]+/gi],ft=/(?:\/home\/|\/Users\/)[^/\s"'`]+|[A-Za-z]:(?:\\{1,2}|\/)Users(?:\\{1,2}|\/)[^\\/\s"'`]+/gi,pt=/[\w.+-]+@[\w-]+(?:\.[\w-]+)+/g,mt=/\b([0-9a-f]{8})-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi;function ht(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function gt(e,t,n=!1){let r=e=>n?`\u0001${e}\u0002`:e,i=e.replace(ut,()=>r(`<tunnel>.trycloudflare.com`));for(let e of dt)i=i.replace(e,(e,t)=>`${t}${r(`[REDACTED]`)}`);t.home&&(i=i.replace(ft,()=>r(`~`))),t.email&&(i=i.replace(pt,()=>r(`<email>`))),t.chats&&(i=i.replace(mt,(e,t)=>r(t)));let a=(t.projects??[]).filter(e=>e.trim().length>=3);if(a.length){let e=RegExp(`(?<![\\w-])(?:${a.map(ht).sort((e,t)=>t.length-e.length).join(`|`)})(?![\\w-])`,`gi`);i=i.replace(e,()=>r(`<project>`))}return i}function _t(e){return[`secrets`,e.home&&`home paths`,e.email&&`emails`,e.chats&&`chat ids`,e.projects?.length&&`project names`].filter(e=>!!e)}var vt=8192,yt=[0,5,20];function bt(e){let t=e.ctx&&e.around?Ye(e.around.before.slice(-e.ctx)):[],n=e.ctx&&e.around?Ye(e.around.after.slice(0,e.ctx)):[];return[...t.map(e=>({row:e,ctx:!0})),...e.rows.map(e=>({row:e,ctx:!1})),...n.map(e=>({row:e,ctx:!0}))]}function xt(e){return e.rows.reduce((e,t)=>e+t.count,0)}function St(e){let t=new Set(e.map(e=>e.src));return t.size===1?[...t][0]:`all`}var Ct=e=>new Date(e).toISOString().slice(11,19);function wt(e){let t=e.rows[0],n=e.rows[e.rows.length-1],r=t&&n?` · ${Ct(t.entry.ts)}–${Ct(n.lastTs)} UTC`:``;return`${we(e.src)}${r}`}function Tt(e){return bt(e).map(e=>ze(e.row.entry,e.row.count))}function Et({fields:e,snippets:t,environment:n,redact:r,mark:i=!1}){let a=e=>gt(e,r,i),o=[`### What happened`,a(e.what.trim())||`_Not filled in_`,``,`### Steps to reproduce`,a(e.steps.trim())||`_Not filled in_`,``];if(e.expected.trim()&&o.push(`### Expected`,a(e.expected.trim()),``),t.length){o.push(`### Log lines`);for(let e of t){let t=Tt(e).map(a),n=lt(t.join(`
1
+ import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-C-P1aR4p.js";import{$ as r,A as i,An as a,Cn as o,Cr as s,D as c,Dr as l,Ft as u,Gt as d,Hr as f,M as p,O as m,P as h,Vn as g,ai as _,br as v,c as ee,cr as y,dn as b,er as x,fr as S,gt as C,hr as te,ht as w,jn as T,jr as E,kr as D,li as O,m as k,nt as A,o as j,on as M,or as ne,qr as N,si as P,t as F,tt as re,ut as ie,vt as I,w as ae,xn as oe,xr as L}from"./icons-BwyIKaTT.js";import{k as R}from"./api-client-xQDlhUTu.js";import{t as z}from"./react-BZ0kba1-.js";import{t as B}from"./settings-store-B4mLp19V.js";import{n as V}from"./utils-Bslrbb-G.js";import{r as se,t as ce}from"./panel-store-BJhazigC.js";import{i as H}from"./project-store-BLGl9IAO.js";import{r as U}from"./clipboard-D-VCry-F.js";import{t as W}from"./button-C9ZXWb3b.js";import{a as G,i as K,l as le,m as ue,r as de,t as fe}from"./dropdown-menu-BQidk_OJ.js";import{t as q}from"./mobile-bottom-sheet-DArbIyrD.js";import{$t as pe,At as me,Bt as J,Ct as he,Dt as Y,Et as ge,F as _e,Ft as ve,Gt as ye,Ht as be,I as xe,It as Se,Ji as Ce,Jt as we,Ki as Te,Kn as Ee,Kt as De,Lt as Oe,Mt as ke,Nt as Ae,Ot as je,Pt as X,Qt as Me,Rt as Ne,St as Pe,Tt as Fe,Ut as Ie,Vt as Le,Wt as Re,Xt as ze,Yt as Be,Zt as Ve,_t as He,ai as Ue,at as We,bt as Ge,en as Ke,gt as qe,jt as Je,kt as Ye,nn as Xe,on as Ze,qi as Qe,qt as $e,rn as et,tn as tt,vt as nt,wt as rt,xt as it,yt as at,zt as ot}from"./index-D8QDpdgs.js";import{i as st,r as ct}from"./send-to-chat-CWV1qd3c.js";import{t as lt}from"./code-fence-BK57HRhJ.js";var ut=/\b[a-z0-9]+(?:-[a-z0-9]+)+\.trycloudflare\.com\b/gi,dt=[/()\b(?:sk-[\w-]{20,}|gh[pousr]_[A-Za-z0-9]{30,}|github_pat_\w{30,}|eyJ[\w-]{8,}\.eyJ[\w-]{8,}\.[\w-]*)/g,/(\d{6,}:)[\w-]{30,}/g,/(:\/\/[^/\s:@]*:)[^@\s/\u0001]+(?=@)/g,/([?&#][\w.-]*(?:token|key|secret|passw|auth|code|state|ticket|sig|credential)[\w.-]*=)[^&#\s"'<>[\]\u0001]+/gi,/(\b(?:proxy-)?authorization["']?\s*[:=]\s*["']?)(?:(?:basic|bearer|digest|token)\s+)?[^\s"',;\u0001]+/gi,/(\b(?:set-)?cookie["']?\s*[:=]\s*["']?)(?=[^\s=;"']+=)[^\r\n"'\u0001]+/gi,/(\bbearer\s+)[^\s"',;[\]\u0001]+/gi,/((?:token|secret|passw(?:or)?d|api[_-]?key|access[_-]?key|private[_-]?key)["']?\s*[:=]\s*["']?)[^\s"'&,;)}[\]\u0001]+/gi],ft=/(?:\/home\/|\/Users\/)[^/\s"'`]+|[A-Za-z]:(?:\\{1,2}|\/)Users(?:\\{1,2}|\/)[^\\/\s"'`]+/gi,pt=/[\w.+-]+@[\w-]+(?:\.[\w-]+)+/g,mt=/\b([0-9a-f]{8})-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi;function ht(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function gt(e,t,n=!1){let r=e=>n?`\u0001${e}\u0002`:e,i=e.replace(ut,()=>r(`<tunnel>.trycloudflare.com`));for(let e of dt)i=i.replace(e,(e,t)=>`${t}${r(`[REDACTED]`)}`);t.home&&(i=i.replace(ft,()=>r(`~`))),t.email&&(i=i.replace(pt,()=>r(`<email>`))),t.chats&&(i=i.replace(mt,(e,t)=>r(t)));let a=(t.projects??[]).filter(e=>e.trim().length>=3);if(a.length){let e=RegExp(`(?<![\\w-])(?:${a.map(ht).sort((e,t)=>t.length-e.length).join(`|`)})(?![\\w-])`,`gi`);i=i.replace(e,()=>r(`<project>`))}return i}function _t(e){return[`secrets`,e.home&&`home paths`,e.email&&`emails`,e.chats&&`chat ids`,e.projects?.length&&`project names`].filter(e=>!!e)}var vt=8192,yt=[0,5,20];function bt(e){let t=e.ctx&&e.around?Ye(e.around.before.slice(-e.ctx)):[],n=e.ctx&&e.around?Ye(e.around.after.slice(0,e.ctx)):[];return[...t.map(e=>({row:e,ctx:!0})),...e.rows.map(e=>({row:e,ctx:!1})),...n.map(e=>({row:e,ctx:!0}))]}function xt(e){return e.rows.reduce((e,t)=>e+t.count,0)}function St(e){let t=new Set(e.map(e=>e.src));return t.size===1?[...t][0]:`all`}var Ct=e=>new Date(e).toISOString().slice(11,19);function wt(e){let t=e.rows[0],n=e.rows[e.rows.length-1],r=t&&n?` · ${Ct(t.entry.ts)}–${Ct(n.lastTs)} UTC`:``;return`${we(e.src)}${r}`}function Tt(e){return bt(e).map(e=>ze(e.row.entry,e.row.count))}function Et({fields:e,snippets:t,environment:n,redact:r,mark:i=!1}){let a=e=>gt(e,r,i),o=[`### What happened`,a(e.what.trim())||`_Not filled in_`,``,`### Steps to reproduce`,a(e.steps.trim())||`_Not filled in_`,``];if(e.expected.trim()&&o.push(`### Expected`,a(e.expected.trim()),``),t.length){o.push(`### Log lines`);for(let e of t){let t=Tt(e).map(a),n=lt(t.join(`
2
2
  `)),r=xt(e);o.push(``,`<details><summary>${wt(e)} · ${X(r,`line`)}${e.ctx?` and ${e.ctx} around`:``}</summary>`,``,n,...t,n,`</details>`)}o.push(``)}return n.length&&o.push(`### Environment`,...n.map(([e,t])=>`- ${e}: ${a(t)}`),``),o.push(`<sub>Sent from PPM → Logs. Removed before sending: ${_t(r).join(`, `)}.</sub>`),o.join(`
3
3
  `)}function Dt(e,t,n){let r=[`title=${encodeURIComponent(e)}`];return t.length&&r.push(`labels=${encodeURIComponent(t.join(`,`))}`),n!==null&&r.push(`body=${encodeURIComponent(n)}`),`https://github.com/${pe}/issues/new?${r.join(`&`)}`}function Ot(e,t){return`# ${e.trim()||`Bug report`}\n\n${t}`}var Z=e(t(),1),kt=500,At=2e4,jt=4e3,Mt=0,Nt=null,Pt=()=>xe(JSON.stringify({type:Ke}));function Ft(){return Mt++===0&&(Pt(),Nt=_e(Pt)),()=>{--Mt>0||(Nt?.(),Nt=null,xe(JSON.stringify({type:tt})))}}function It(e,t){return JSON.stringify([e.src,e.levels,e.tagsOff,e.q,e.regex,e.caseSensitive,e.chat,t])}function Lt(e){let t={};for(let[n,r]of Object.entries(e))t[n]={...r,tags:r.tags.map(e=>[e[0],e[1]])};return t}function Rt(e,t,n,r){let i=e.meta;if(!i||!t.length)return e;let a={...i.titles,...n},o=new Set(e.entries.slice(-jt).map(e=>e.id)),s=t.filter(e=>e.ts>=i.fromTs&&!o.has(e.id));if(!s.length)return e;let c=Lt(i.stats);ye(c,s);let l=De(r),u=s.filter(e=>Be(e,r,l,a)),d=i.chats.map(e=>({...e}));for(let e of s){if(!e.sid)continue;let t=d.find(t=>t.sid===e.sid);t?(t.count++,t.last=e.ts):d.unshift({sid:e.sid,title:a[e.sid]??null,count:1,last:e.ts})}let f=u.length?e.entries.concat(u):e.entries,p=i.hasMore;return f.length>At&&(f=f.slice(-At),p=!0),{...e,entries:f,meta:{...i,stats:c,chats:d,titles:a,matched:i.matched+u.length,inRange:i.inRange+s.filter(e=>r.src===`all`||e.src===r.src).length,hasMore:p},batch:u.length?{seq:(e.batch?.seq??0)+1,count:u.length}:e.batch}}function zt(e,t,n){let r=It(e,t),[i,a]=(0,Z.useState)({key:r,entries:[],meta:null,loading:!0,loadingEarlier:!1,error:null,batch:null}),[o,s]=(0,Z.useState)(0),[c,l]=(0,Z.useState)(0),u=(0,Z.useRef)(e);u.current=e;let d=(0,Z.useRef)(i);d.current=i;let f=(0,Z.useRef)(n);f.current=n;let p=(0,Z.useRef)(e.q),m=(0,Z.useRef)(null),h=(0,Z.useRef)({entries:[],titles:{}});(0,Z.useEffect)(()=>Ft(),[]),(0,Z.useEffect)(()=>_e(()=>s(e=>e+1)),[]),(0,Z.useEffect)(()=>{let n=new AbortController;m.current={entries:[],titles:{}},h.current={entries:[],titles:{}},l(0),a(e=>({...e,key:r,loading:!0,error:null}));let i=e.q===p.current?0:250;p.current=e.q;let o=setTimeout(()=>{Pe({...e,range:t,from:Se(t,Date.now()),limit:kt},n.signal).then(t=>{if(n.signal.aborted)return;let{entries:i,...o}=t,s=m.current??{entries:[],titles:{}};m.current=null,a(Rt({key:r,entries:i,meta:o,loading:!1,loadingEarlier:!1,error:null,batch:null},s.entries,s.titles,e))}).catch(e=>{n.signal.aborted||(m.current=null,a(t=>({...t,key:r,loading:!1,error:e instanceof Error?e.message:String(e)})))})},i);return()=>{clearTimeout(o),n.abort()}},[r,o]),(0,Z.useEffect)(()=>{let e=e=>{let t=e.detail;if(t?.entries?.length){if(m.current){m.current.entries.push(...t.entries),Object.assign(m.current.titles,t.titles);return}if(f.current){h.current.entries.push(...t.entries),Object.assign(h.current.titles,t.titles);let e=u.current,n=De(e),r={...d.current.meta?.titles,...h.current.titles};l(i=>i+t.entries.filter(t=>Be(t,e,n,r)).length);return}a(e=>Rt(e,t.entries,t.titles??{},u.current))}};return window.addEventListener(`logs:lines`,e),()=>window.removeEventListener(`logs:lines`,e)},[]),(0,Z.useEffect)(()=>{if(n)return;let{entries:e,titles:t}=h.current;h.current={entries:[],titles:{}},l(0),e.length&&a(n=>Rt(n,e,t,u.current))},[n]);let g=(0,Z.useCallback)(async e=>{let n=d.current;if(!n.meta?.hasMore||n.loadingEarlier||n.loading||!n.entries.length)return!1;let r=n.key;a(e=>({...e,loadingEarlier:!0}));try{let i=await Pe({...u.current,range:t,from:n.meta.fromTs,before:n.entries[0].id,limit:kt,...e?{reach:e}:{}}),o=d.current;if(o.key!==r||!o.meta)return a(e=>({...e,loadingEarlier:!1})),!1;let s=new Set(o.entries.slice(0,jt).map(e=>e.id)),c=i.entries.filter(e=>!s.has(e.id));return a(e=>e.key!==r||!e.meta?{...e,loadingEarlier:!1}:{...e,entries:c.concat(e.entries),meta:{...e.meta,hasMore:i.hasMore,titles:{...i.titles,...e.meta.titles},reachMissed:i.reachMissed},loadingEarlier:!1}),c.length>0}catch{return a(e=>({...e,loadingEarlier:!1})),!1}},[t]),_=(0,Z.useCallback)(()=>s(e=>e+1),[]);return(0,Z.useMemo)(()=>({...i,pausedCount:c,loadEarlier:g,reload:_}),[i,c,g,_])}function Bt(){let[e,t]=(0,Z.useState)(null),[n,r]=(0,Z.useState)(null),i=(0,Z.useCallback)(async()=>{try{t(await it()),r(null)}catch(e){r(e instanceof Error?e.message:String(e))}},[]);return(0,Z.useEffect)(()=>{i();let e=()=>void i();return window.addEventListener(Me,e),()=>window.removeEventListener(Me,e)},[i]),{data:e,error:n,analyze:(0,Z.useCallback)(async e=>{t(e=>e&&{...e,running:!0,error:null}),await qe(e)},[]),setAuto:(0,Z.useCallback)(async e=>{t(t=>t&&{...t,auto:e}),await Fe(e),await i()},[i]),setDismissed:(0,Z.useCallback)(async(e,n)=>{t(t=>t&&{...t,issues:t.issues.map(t=>t.id===e?{...t,dismissed:n}:t)}),await He(e,n)},[]),undismissAll:(0,Z.useCallback)(async()=>{t(e=>e&&{...e,issues:e.issues.map(e=>({...e,dismissed:!1}))}),await ge()},[])}}var Vt=null;function Ht(){return Vt??=Ge().then(e=>[...e,[`Browser`,We(navigator.userAgent)]]).catch(e=>{throw Vt=null,e}),Vt}var Ut=0,Wt={title:``,labels:[],what:``,steps:``,expected:``},Gt=(e,t)=>e.length===t.length&&e.every((e,n)=>e.key===t[n].key&&e.count===t[n].count),Kt=z((e,t)=>({snippets:[],fields:Wt,status:`none`,stale:!1,fresh:!1,error:null,model:null,basis:0,view:`write`,envOff:[],priv:{home:!0,email:!0,chats:!0,projects:!1},add:n=>{if(!n.length||t().snippets.some(e=>Gt(e.rows,n)))return!1;let r=n.map(e=>e.entry),i={id:`s${++Ut}`,src:St(r),rows:n,ctx:0,around:null};return e(e=>({snippets:[...e.snippets,i],stale:e.status===`done`})),!0},remove:n=>{let r=t().snippets.findIndex(e=>e.id===n);if(r<0)return null;let i=t().snippets[r];return e(e=>({snippets:e.snippets.filter(e=>e.id!==n),stale:e.status===`done`})),{snippet:i,index:r}},restore:(t,n)=>{e(e=>{let r=e.snippets.slice();return r.splice(Math.min(n,r.length),0,t),{snippets:r}})},setContext:async(n,r)=>{e(e=>({snippets:e.snippets.map(e=>e.id===n?{...e,ctx:r}:e)}));let i=t().snippets.find(e=>e.id===n);if(!r||!i||i.around)return;let a=i.rows.flatMap(e=>e.ids);try{let t=await at([a[0],a[a.length-1]],20,i.src);e(e=>({snippets:e.snippets.map(e=>e.id===n?{...e,around:t}:e)}))}catch{}},setFields:t=>e(e=>({fields:{...e.fields,...t}})),setView:t=>e({view:t}),toggleEnv:t=>e(e=>({envOff:e.envOff.includes(t)?e.envOff.filter(e=>e!==t):[...e.envOff,t]})),togglePriv:t=>e(e=>({priv:{...e.priv,[t]:!e.priv[t]}})),draft:async()=>{let{snippets:n,status:r}=t();if(!(!n.length||r===`drafting`)){e({status:`drafting`,view:`write`,error:null});try{let r=(await Ht().catch(()=>[])).filter(([e])=>!t().envOff.includes(e)),i=await nt({snippets:n.map(e=>({label:wt(e),lines:Tt(e)})),environment:r});e({status:`done`,fields:{title:i.title,labels:i.labels,what:i.what,steps:i.steps,expected:i.expected},model:i.model,basis:n.reduce((e,t)=>e+xt(t),0),stale:!1,fresh:!0}),setTimeout(()=>e({fresh:!1}),900)}catch(t){e(e=>({status:e.model?`done`:`none`,error:t instanceof Error?t.message:String(t)}))}}}})),Q=n(),qt={all:b,ai:ae,shell:f,server:F,ext:S,files:u,auto:m,tunnel:A,browser:d},Jt={debug:`DEBUG`,info:`INFO`,warn:`WARN`,error:`ERROR`,fatal:`FATAL`};function Yt({text:e,re:t}){return t?(0,Q.jsx)(Q.Fragment,{children:ot(e,t).map((e,t)=>e.hit?(0,Q.jsx)(`mark`,{className:`lg-hit`,children:e.text},t):(0,Q.jsx)(Z.Fragment,{children:e.text},t))}):(0,Q.jsx)(Q.Fragment,{children:e})}function Xt({msg:e,re:t,titles:n,onChat:r}){return(0,Q.jsx)(Q.Fragment,{children:Ae(e).map((e,i)=>{if(e.kind===`chat`){let t=n[e.sid]??e.sid.slice(0,8);return r?(0,Q.jsx)(`button`,{type:`button`,className:`lg-sess`,title:`Show only this chat · ${e.sid}`,onClick:()=>r(e.sid),children:t},i):(0,Q.jsx)(`span`,{className:`lg-sess`,children:t},i)}return e.kind===`quote`?(0,Q.jsx)(`span`,{className:`q`,children:(0,Q.jsx)(Yt,{text:e.text,re:t})},i):e.kind===`key`?(0,Q.jsx)(`span`,{className:`k`,children:(0,Q.jsx)(Yt,{text:e.text,re:t})},i):(0,Q.jsx)(Yt,{text:e.text,re:t},i)})})}var Zt=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/g;function Qt({row:e,utc:t,ctx:n,trim:r}){let i=e.entry,a=i.msg.replace(Zt,e=>e.slice(0,8)),o=r&&a.length>150?`${a.slice(0,149)}…`:a;return(0,Q.jsxs)(`div`,{className:n?`r ctx`:`r`,children:[(0,Q.jsx)(`span`,{className:`t`,children:je(i.ts,t)}),` `,(0,Q.jsx)(`span`,{className:i.lv,children:Jt[i.lv].padEnd(5,` `)}),` `,(0,Q.jsx)(`span`,{className:`g`,children:i.tag}),` `,o,e.count>1&&(0,Q.jsx)(`span`,{className:`t`,children:` ×${e.count}`}),!!i.more?.length&&(0,Q.jsx)(`span`,{className:`t`,children:` +${i.more.length} lines`})]})}function $t({paused:e,pending:t}){return(0,Q.jsxs)(`span`,{className:`flex items-center gap-1.5 whitespace-nowrap text-[10px] text-text-subtle`,"data-testid":`logs-live`,children:[e?(0,Q.jsx)(x,{className:`size-3 text-warning`}):(0,Q.jsx)(_,{className:`size-3 text-success`}),(0,Q.jsx)(`span`,{children:e?`Paused${t?` · ${t.toLocaleString(`en-US`)} new`:``}`:`Live`})]})}function en({title:e,children:t}){return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`lg-sheet-sec`,children:e}),(0,Q.jsx)(`div`,{className:`lg-sheet-chips`,children:t})]})}var $={keys:new Set,anchor:null,cursor:null};function tn(e){return{keys:new Set([e]),anchor:e,cursor:e}}function nn(e,t,n,r=!1){let i=e.anchor??n,a=Je(t,i,n);return{keys:new Set(r?[...e.keys,...a]:a),anchor:i,cursor:n}}function rn(e,t){let n=new Set(e.keys);return n.has(t)?n.delete(t):n.add(t),{keys:n,anchor:t,cursor:t}}function an(e,t){return t.keys.size?e.filter(e=>t.keys.has(e.key)):[]}function on(e,t){let n=e.levels;return!n.error||!n.warn||!n.info||n.debug||!!e.chat||!!e.q||e.tagsOff.length>0||t!==`1h`}var sn=e=>e.reduce((e,t)=>e+t.count,0),cn=e=>e.map(e=>ze(e.entry,e.count)).join(`
4
4
  `);async function ln(e){e.length&&(await U(cn(e))?R.success(`Copied ${X(sn(e),`line`)}`):R.error(`Could not copy the lines`))}function un(){let e=ct();if(e)return Object.values(ce.getState().panels).flatMap(e=>e.tabs).find(t=>t.id===e)}function dn(e,t){if(!e.length)return;let n=[...new Set(e.map(e=>we(e.entry.src)))].join(`, `),r=cn(e),i=lt(r);st({text:`Selected lines from the PPM logs (${n})\n${i}\n${r}\n${i}`,label:`Log selection`,newTab:t,asContext:!0})}function fn(e,t,n=!1){return e.length?Kt.getState().add([...e])?(n||R.success(`Added ${X(sn(e),`line`)} to the report`,t?{action:{label:`Open`,onClick:t}}:void 0),!0):(n||R(`These lines are already in the report`),!1):!1}var pn=e=>String(e).padStart(2,`0`);function mn(e){if(!e.length)return;let t=new Date,n=`ppm-logs-${t.getFullYear()}${pn(t.getMonth()+1)}${pn(t.getDate())}-${pn(t.getHours())}${pn(t.getMinutes())}.log`,r=URL.createObjectURL(new Blob([`${cn(e)}\n`],{type:`application/octet-stream`})),i=document.createElement(`a`);i.href=r,i.download=n,i.rel=`noopener`,i.style.display=`none`,document.body.appendChild(i),i.click(),i.remove(),setTimeout(()=>URL.revokeObjectURL(r),1e4),R.success(`Saved ${n} with ${X(sn(e),`line`)}`)}var hn=24,gn=200;function _n(e,{follow:t,setFollow:n,feed:r,size:i,virtualizer:a,keep:o}){let s=(0,Z.useRef)(0),[c,l]=(0,Z.useState)(0),u=(0,Z.useCallback)((e=gn)=>{s.current=performance.now()+e},[]),d=(0,Z.useCallback)(()=>{let t=e.current;t&&(u(),t.scrollTop=t.scrollHeight)},[e,u]);(0,Z.useLayoutEffect)(()=>{let e=o.current;if(e!=null&&!t){let{count:t,getItemKey:n}=a.options;for(let r=0;r<t;r++)if(n(r)===e){u(),a.scrollToIndex(r,{align:`start`});break}}return()=>{let e=a.getVirtualItemForOffset(a.scrollOffset??0);o.current=e?String(e.key):null}},[]),(0,Z.useLayoutEffect)(()=>{t&&d()},[t,i,d]),(0,Z.useEffect)(()=>l(0),[r.key]),(0,Z.useEffect)(()=>{t&&l(0)},[t]);let f=r.batch;return(0,Z.useEffect)(()=>{f&&!t&&l(e=>e+f.count)},[f?.seq]),{newCount:c,onScroll:(0,Z.useCallback)(()=>{let r=e.current;if(!r||performance.now()<s.current)return;let i=r.scrollHeight-r.scrollTop-r.clientHeight<hn;i!==t&&n(i)},[e,t,n]),ownScroll:u}}var vn=`flex items-center gap-1 whitespace-nowrap rounded bg-surface-elevated text-text-primary transition-colors hover:bg-primary hover:text-primary-foreground active:bg-primary active:text-primary-foreground px-2 py-0.5 text-xs`,yn=5,bn={ai:`sdk, chat, usage, accounts`,shell:`bash-spy, bg-shell, terminal`,server:`supervisor, startup, stderr`,ext:`extensions, language servers`,files:`file-watcher, file-index, git`,auto:`scheduler, ppmbot, jira`,tunnel:`cloudflared.log`,browser:`Console`};function xn(e,t){return e?t===`all`?Object.values(e).reduce((e,t)=>({total:e.total+t.total,err:e.err+t.err,warn:e.warn+t.warn}),{total:0,err:0,warn:0}):e[t]:{total:0,err:0,warn:0}}function Sn(e,t,n){if(e===`tunnel`)return`cloudflared.log`;if(e===`browser`)return n?`Console · ${X(n.browserDevices,`device`)}`:bn.browser;let r=t?.[e]?.tags.slice(0,3).map(e=>e[0]);return r?.length?r.join(`, `):bn[e]}function Cn(e,t){return t?e===`all`?`ppm.log, cloudflared.log, ${X(t.browserDevices,`browser`)}`:e===`tunnel`?t.cloudflaredPath?`cloudflared.log · ${Y(t.cloudflaredBytes)}`:`no cloudflared.log yet`:e===`browser`?`browser consoles · ${X(t.browserDevices,`device`)}`:`ppm.log · ${Y(t.ppmLogBytes)}`:``}function wn({src:e,files:t}){return e===`tunnel`?t.cloudflaredPath?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`b`,{children:t.cloudflaredPath}),(0,Q.jsx)(`br`,{}),`Written by cloudflared itself, to the second.`]}):(0,Q.jsx)(Q.Fragment,{children:`No cloudflared.log yet. It appears once a tunnel has run.`}):e===`browser`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`b`,{children:`Browser consoles`}),(0,Q.jsx)(`br`,{}),`Sent by every open PPM tab and kept `,X(t.browserRetentionDays,`day`),`.`]}):e===`all`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`b`,{children:t.ppmLogPath}),` and its `,X(t.rotatedFiles,`older file`),`, `,(0,Q.jsx)(`b`,{children:`cloudflared.log`}),` and `,X(t.browserDevices,`browser`),`, merged by time.`]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`b`,{children:t.ppmLogPath}),(0,Q.jsx)(`br`,{}),Y(t.ppmLogBytes),` of `,Y(t.capBytes),`. When full it becomes ppm.log.1; `,t.generations,` files are kept.`]})}var Tn=(0,Z.memo)(function({row:e,index:t,selected:n,cursor:r,flash:i,open:a,utc:o,re:s,titles:c,onChat:l,onToggleMore:u,measure:d}){let f=e.entry,p=f.more?.length??0;return(0,Q.jsxs)(`div`,{ref:d,"data-index":t,"data-key":e.key,role:`option`,"aria-selected":n,className:V(`lg-row`,$e(f.lv)===`error`&&`err`,n&&`sel`,r&&`cur`,i&&`flash`),children:[(0,Q.jsx)(`span`,{className:`lg-mark`}),(0,Q.jsx)(`span`,{className:`lg-t`,children:je(f.ts,o)}),(0,Q.jsx)(`span`,{className:`lg-lv ${f.lv}`,children:Jt[f.lv]}),(0,Q.jsx)(`span`,{className:`lg-tg`,title:f.tag,children:f.tag}),(0,Q.jsxs)(`span`,{className:`lg-m`,children:[(0,Q.jsx)(Xt,{msg:f.msg,re:s,titles:c,onChat:l}),e.count>1&&(0,Q.jsxs)(`span`,{className:`lg-x`,title:`The same line ${e.count} times in a row`,children:[`×`,e.count.toLocaleString(`en-US`)]}),p>0&&(0,Q.jsx)(`button`,{type:`button`,className:`lg-pchip`,onClick:()=>u(e.key),children:a?`Hide lines`:`+${X(p,`line`)}`})]}),a&&p>0&&(0,Q.jsx)(`div`,{className:`lg-more`,children:(0,Q.jsx)(Yt,{text:f.more.join(`
@@ -1 +1 @@
1
- import{E as e}from"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import"./icons-BwyIKaTT.js";import"./api-client-xQDlhUTu.js";import"./settings-store-B4mLp19V.js";import"./portal-container-context-NBi-KGK0.js";import"./window-store-DqX_qmkQ.js";import"./panel-store-BJhazigC.js";import"./project-store-BLGl9IAO.js";import"./project-framework-store-DwLxaRan.js";import"./session-list-sync-triggers-DtJI5KF0.js";import"./tab-store-D5I52eLN.js";import"./use-is-mobile-VRV9eZy1.js";import"./button-C9ZXWb3b.js";import"./dropdown-menu-BQidk_OJ.js";import"./mobile-bottom-sheet-DArbIyrD.js";import"./use-visual-viewport-MmugpRg-.js";import"./send-to-chat-CWV1qd3c.js";import{t}from"./logs-app-DYgPtmjm.js";var n=e(),r=()=>(0,n.jsx)(t,{mode:`phone`});export{r as LogsTab};
1
+ import{E as e}from"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import"./icons-BwyIKaTT.js";import"./api-client-xQDlhUTu.js";import"./settings-store-B4mLp19V.js";import"./portal-container-context-NBi-KGK0.js";import"./window-store-DqX_qmkQ.js";import"./panel-store-BJhazigC.js";import"./project-store-BLGl9IAO.js";import"./project-framework-store-DwLxaRan.js";import"./session-list-sync-triggers-DtJI5KF0.js";import"./tab-store-D5I52eLN.js";import"./use-is-mobile-VRV9eZy1.js";import"./button-C9ZXWb3b.js";import"./dropdown-menu-BQidk_OJ.js";import"./mobile-bottom-sheet-DArbIyrD.js";import"./use-visual-viewport-MmugpRg-.js";import"./send-to-chat-CWV1qd3c.js";import{t}from"./logs-app-BlhVTOYN.js";var n=e(),r=()=>(0,n.jsx)(t,{mode:`phone`});export{r as LogsTab};
@@ -1 +1 @@
1
- import{E as e}from"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import"./icons-BwyIKaTT.js";import"./api-client-xQDlhUTu.js";import"./settings-store-B4mLp19V.js";import"./portal-container-context-NBi-KGK0.js";import{n as t}from"./window-store-DqX_qmkQ.js";import"./panel-store-BJhazigC.js";import"./project-store-BLGl9IAO.js";import"./project-framework-store-DwLxaRan.js";import"./session-list-sync-triggers-DtJI5KF0.js";import"./tab-store-D5I52eLN.js";import"./use-is-mobile-VRV9eZy1.js";import"./button-C9ZXWb3b.js";import"./dropdown-menu-BQidk_OJ.js";import"./mobile-bottom-sheet-DArbIyrD.js";import"./use-visual-viewport-MmugpRg-.js";import{an as n}from"./index-BtAn_krv.js";import"./send-to-chat-CWV1qd3c.js";import{t as r}from"./logs-app-DYgPtmjm.js";var i=e();function a({id:e,payload:a}){let o=t(e=>e.setPayload);return(0,i.jsx)(r,{mode:`window`,initialView:n(a?.view),onViewChange:t=>o(e,{view:t})})}export{a as default};
1
+ import{E as e}from"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import"./icons-BwyIKaTT.js";import"./api-client-xQDlhUTu.js";import"./settings-store-B4mLp19V.js";import"./portal-container-context-NBi-KGK0.js";import{n as t}from"./window-store-DqX_qmkQ.js";import"./panel-store-BJhazigC.js";import"./project-store-BLGl9IAO.js";import"./project-framework-store-DwLxaRan.js";import"./session-list-sync-triggers-DtJI5KF0.js";import"./tab-store-D5I52eLN.js";import"./use-is-mobile-VRV9eZy1.js";import"./button-C9ZXWb3b.js";import"./dropdown-menu-BQidk_OJ.js";import"./mobile-bottom-sheet-DArbIyrD.js";import"./use-visual-viewport-MmugpRg-.js";import{an as n}from"./index-D8QDpdgs.js";import"./send-to-chat-CWV1qd3c.js";import{t as r}from"./logs-app-BlhVTOYN.js";var i=e();function a({id:e,payload:a}){let o=t(e=>e.setPayload);return(0,i.jsx)(r,{mode:`window`,initialView:n(a?.view),onViewChange:t=>o(e,{view:t})})}export{a as default};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-C5c2KzVm.js";import{L as t}from"./index-BtAn_krv.js";var n=e({LspConnection:()=>a,acquireLspConnection:()=>s,releaseLspConnection:()=>l,retryUnavailableLspDocuments:()=>c}),r=15e3;function i(e){clearTimeout(e.timer),e.detach?.()}var a=class{ws;docs=new Map;pending=new Map;notificationListeners=new Set;statusListeners=new Set;nextId=1;constructor(e){this.projectName=e,this.ws=new t(`/ws/project/${encodeURIComponent(e)}/lsp`),this.ws.onMessage(e=>this.receive(e)),this.ws.connect()}open(e,t){this.docs.set(e,{source:t,status:{state:`opening`}}),this.setStatus(e,{state:`opening`}),this.sendOpen(e)}sendOpen(e){let t=this.docs.get(e);t&&this.send({t:`open`,path:e,version:t.source.getVersion(),text:t.source.getText(),clientUri:t.source.clientUri})}close(e){this.docs.delete(e)&&this.send({t:`close`,path:e})}change(e,t,n){this.docs.has(e)&&this.send({t:`change`,path:e,version:t,changes:n})}save(e,t){this.docs.has(e)&&this.send({t:`save`,path:e,text:t})}statusOf(e){return this.docs.get(e)?.status}retryUnavailable(){for(let[e,t]of this.docs)t.status.state===`unavailable`&&(this.setStatus(e,{state:`opening`}),this.sendOpen(e))}request(e,t,n,i={}){let a=this.docs.get(e);if(!a||a.status.state!==`ready`)return Promise.reject(Error(`No language server is ready for ${e}`));let{timeoutMs:o=r,signal:s}=i;if(s?.aborted)return Promise.reject(Error(`${t} was cancelled`));let c=this.nextId++;return new Promise((r,i)=>{let a=setTimeout(()=>{this.pending.delete(c),this.send({t:`cancel`,id:c}),i(Error(`${t} timed out`))},o),l=()=>{this.pending.delete(c)&&(clearTimeout(a),this.send({t:`cancel`,id:c}),i(Error(`${t} was cancelled`)))};s?.addEventListener(`abort`,l,{once:!0}),this.pending.set(c,{resolve:r,reject:i,timer:a,detach:s?()=>s.removeEventListener(`abort`,l):void 0}),this.send({t:`request`,id:c,path:e,method:t,params:n})})}onNotification(e){return this.notificationListeners.add(e),()=>this.notificationListeners.delete(e)}onStatus(e){return this.statusListeners.add(e),()=>this.statusListeners.delete(e)}send(e){this.ws.send(JSON.stringify(e))}receive(e){let t;try{t=JSON.parse(typeof e.data==`string`?e.data:``)}catch{return}switch(t.t){case`hello`:for(let e of this.docs.keys())this.sendOpen(e);break;case`ready`:this.setStatus(String(t.path),{state:`ready`,languageId:String(t.languageId),server:t.server,projectPath:String(t.projectPath??``),capabilities:t.capabilities??{}});break;case`unavailable`:this.setStatus(String(t.path),{state:`unavailable`,reason:String(t.reason),server:t.server??null,message:String(t.message)});break;case`resync`:{let e=String(t.path),n=this.docs.get(e);n&&this.send({t:`change`,path:e,version:n.source.getVersion(),text:n.source.getText()});break}case`response`:{let e=this.pending.get(Number(t.id));if(!e)return;i(e),this.pending.delete(Number(t.id)),e.resolve(t.result);break}case`error`:{let e=this.pending.get(Number(t.id));if(!e)return;i(e),this.pending.delete(Number(t.id)),e.reject(Error(String(t.message)));break}case`notification`:for(let e of this.notificationListeners)e(String(t.method),t.params);break}}setStatus(e,t){let n=this.docs.get(e);n&&(n.status=t);for(let n of this.statusListeners)n(e,t)}dispose(){for(let e of this.pending.values())i(e),e.reject(Error(`The language server connection was closed`));this.pending.clear(),this.docs.clear(),this.notificationListeners.clear(),this.statusListeners.clear(),this.ws.disconnect()}},o=new Map;function s(e){let t=o.get(e);if(t)return t.holders++,t.connection;let n=new a(e);return o.set(e,{connection:n,holders:1}),n}function c(){for(let e of o.values())e.connection.retryUnavailable()}function l(e){let t=o.get(e);return!t||(t.holders--,t.holders>0)?!1:(o.delete(e),t.connection.dispose(),!0)}export{c as i,n,l as r,s as t};
1
+ import{r as e}from"./rolldown-runtime-C5c2KzVm.js";import{L as t}from"./index-D8QDpdgs.js";var n=e({LspConnection:()=>a,acquireLspConnection:()=>s,releaseLspConnection:()=>l,retryUnavailableLspDocuments:()=>c}),r=15e3;function i(e){clearTimeout(e.timer),e.detach?.()}var a=class{ws;docs=new Map;pending=new Map;notificationListeners=new Set;statusListeners=new Set;nextId=1;constructor(e){this.projectName=e,this.ws=new t(`/ws/project/${encodeURIComponent(e)}/lsp`),this.ws.onMessage(e=>this.receive(e)),this.ws.connect()}open(e,t){this.docs.set(e,{source:t,status:{state:`opening`}}),this.setStatus(e,{state:`opening`}),this.sendOpen(e)}sendOpen(e){let t=this.docs.get(e);t&&this.send({t:`open`,path:e,version:t.source.getVersion(),text:t.source.getText(),clientUri:t.source.clientUri})}close(e){this.docs.delete(e)&&this.send({t:`close`,path:e})}change(e,t,n){this.docs.has(e)&&this.send({t:`change`,path:e,version:t,changes:n})}save(e,t){this.docs.has(e)&&this.send({t:`save`,path:e,text:t})}statusOf(e){return this.docs.get(e)?.status}retryUnavailable(){for(let[e,t]of this.docs)t.status.state===`unavailable`&&(this.setStatus(e,{state:`opening`}),this.sendOpen(e))}request(e,t,n,i={}){let a=this.docs.get(e);if(!a||a.status.state!==`ready`)return Promise.reject(Error(`No language server is ready for ${e}`));let{timeoutMs:o=r,signal:s}=i;if(s?.aborted)return Promise.reject(Error(`${t} was cancelled`));let c=this.nextId++;return new Promise((r,i)=>{let a=setTimeout(()=>{this.pending.delete(c),this.send({t:`cancel`,id:c}),i(Error(`${t} timed out`))},o),l=()=>{this.pending.delete(c)&&(clearTimeout(a),this.send({t:`cancel`,id:c}),i(Error(`${t} was cancelled`)))};s?.addEventListener(`abort`,l,{once:!0}),this.pending.set(c,{resolve:r,reject:i,timer:a,detach:s?()=>s.removeEventListener(`abort`,l):void 0}),this.send({t:`request`,id:c,path:e,method:t,params:n})})}onNotification(e){return this.notificationListeners.add(e),()=>this.notificationListeners.delete(e)}onStatus(e){return this.statusListeners.add(e),()=>this.statusListeners.delete(e)}send(e){this.ws.send(JSON.stringify(e))}receive(e){let t;try{t=JSON.parse(typeof e.data==`string`?e.data:``)}catch{return}switch(t.t){case`hello`:for(let e of this.docs.keys())this.sendOpen(e);break;case`ready`:this.setStatus(String(t.path),{state:`ready`,languageId:String(t.languageId),server:t.server,projectPath:String(t.projectPath??``),capabilities:t.capabilities??{}});break;case`unavailable`:this.setStatus(String(t.path),{state:`unavailable`,reason:String(t.reason),server:t.server??null,message:String(t.message)});break;case`resync`:{let e=String(t.path),n=this.docs.get(e);n&&this.send({t:`change`,path:e,version:n.source.getVersion(),text:n.source.getText()});break}case`response`:{let e=this.pending.get(Number(t.id));if(!e)return;i(e),this.pending.delete(Number(t.id)),e.resolve(t.result);break}case`error`:{let e=this.pending.get(Number(t.id));if(!e)return;i(e),this.pending.delete(Number(t.id)),e.reject(Error(String(t.message)));break}case`notification`:for(let e of this.notificationListeners)e(String(t.method),t.params);break}}setStatus(e,t){let n=this.docs.get(e);n&&(n.status=t);for(let n of this.statusListeners)n(e,t)}dispose(){for(let e of this.pending.values())i(e),e.reject(Error(`The language server connection was closed`));this.pending.clear(),this.docs.clear(),this.notificationListeners.clear(),this.statusListeners.clear(),this.ws.disconnect()}},o=new Map;function s(e){let t=o.get(e);if(t)return t.holders++,t.connection;let n=new a(e);return o.set(e,{connection:n,holders:1}),n}function c(){for(let e of o.values())e.connection.retryUnavailable()}function l(e){let t=o.get(e);return!t||(t.holders--,t.holders>0)?!1:(o.delete(e),t.connection.dispose(),!0)}export{c as i,n,l as r,s as t};
@@ -1 +1 @@
1
- import"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import"./icons-BwyIKaTT.js";import"./api-client-xQDlhUTu.js";import"./settings-store-B4mLp19V.js";import"./window-store-DqX_qmkQ.js";import"./panel-store-BJhazigC.js";import"./project-store-BLGl9IAO.js";import"./project-framework-store-DwLxaRan.js";import"./session-list-sync-triggers-DtJI5KF0.js";import"./tab-store-D5I52eLN.js";import"./file-store-BQ41vIs5.js";import"./use-is-mobile-VRV9eZy1.js";import"./settings-categories-Ajj4ui27.js";import"./open-settings-EXR4zoZG.js";import"./git-repo-store-CKB5fdNP.js";import"./fs-api-CFtQzsIJ.js";import"./lib-5Chotbwm.js";import{t as e}from"./markdown-renderer-dk1w3goH.js";import"./run-in-terminal-ujoc25vj.js";export{e as MarkdownRenderer};
1
+ import"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import"./icons-BwyIKaTT.js";import"./api-client-xQDlhUTu.js";import"./settings-store-B4mLp19V.js";import"./window-store-DqX_qmkQ.js";import"./panel-store-BJhazigC.js";import"./project-store-BLGl9IAO.js";import"./project-framework-store-DwLxaRan.js";import"./session-list-sync-triggers-DtJI5KF0.js";import"./tab-store-D5I52eLN.js";import"./file-store-BQ41vIs5.js";import"./use-is-mobile-VRV9eZy1.js";import"./settings-categories-Ajj4ui27.js";import"./open-settings-EXR4zoZG.js";import"./git-repo-store-CKB5fdNP.js";import"./fs-api-CFtQzsIJ.js";import"./lib-5Chotbwm.js";import{t as e}from"./markdown-renderer-DpsToFFB.js";import"./run-in-terminal-ujoc25vj.js";export{e as MarkdownRenderer};
@@ -1,4 +1,4 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mermaid.core-DNHX7DSU.js","assets/preload-helper-CM8YhcCa.js","assets/dist-ChawRilJ.js","assets/rolldown-runtime-C5c2KzVm.js","assets/chunk-PU5JKC2W-DJY3yjhJ.js","assets/src-C1GX5Kxw.js","assets/chunk-GEFDOKGD-DnsnpeGb.js","assets/math-iYw0Gln4.js","assets/chunk-7R4GIKGN-vQspoIwd.js","assets/isArrayLikeObject-DHTG10am.js","assets/marked.esm-jqwIt-AK.js","assets/isEmpty-dcb0OVvj.js","assets/chunk-GLR3WWYH-Co8QL50g.js","assets/chunk-KYZI473N-B6LAvX90.js","assets/chunk-PQ6SQG4A-B9GHRcOM.js","assets/chunk-YBOYWFTD-DVV5zPYi.js","assets/rough.esm-DK8Fp44C.js","assets/chunk-O4XLMI2P-DeFJl-l6.js","assets/line-DXN3CJk7.js","assets/path-z62pEMqs.js","assets/array-BQrdK5nm.js","assets/chunk-MX3YWQON-EGGLXe7u.js","assets/chunk-HHEYEP7N-CErk3LHZ.js","assets/chunk-XPW4576I-CYBtYKPi.js"])))=>i.map(i=>d[i]);
2
- import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{C as t,D as n,E as r,T as i,a,b as o,c as s,d as c,f as l,i as u,l as d,n as ee,o as te,r as ne,s as re,t as f,v as p,w as m,x as ie}from"./vendor-markdown-C-P1aR4p.js";import{a as h}from"./api-client-xQDlhUTu.js";import{t as ae}from"./preload-helper-CM8YhcCa.js";import{t as g}from"./utils-Bslrbb-G.js";import{i as oe}from"./project-store-BLGl9IAO.js";import{t as _}from"./tab-store-D5I52eLN.js";import{i as se,o as ce,t as v}from"./file-store-BQ41vIs5.js";import{r as le}from"./clipboard-D-VCry-F.js";import{n as y}from"./fs-api-CFtQzsIJ.js";import{$ as ue,M as de,Q as fe,Ur as pe,Z as b,_i as me,it as he,j as ge,n as _e,r as ve,rt as x,t as ye}from"./index-BtAn_krv.js";import{r as be,t as xe}from"./image-gallery-BuxSgBug.js";import{a as S,c as C,l as Se,n as w,o as T,s as E,t as Ce}from"./lib-5Chotbwm.js";import{r as D}from"./run-in-terminal-ujoc25vj.js";function O(e){u(e,[/\r?\n|\r/g,k])}function k(){return{type:`break`}}function A(){return function(e){O(e)}}var we={},Te={}.hasOwnProperty,j=x(`type`,{handlers:{root:De,element:Me,text:Ae,comment:je,doctype:ke}});function Ee(e,n){let r=(n||we).space;return j(e,r===`svg`?m:t)}function De(e,t){let n={nodeName:`#document`,mode:(e.data||{}).quirksMode?`quirks`:`no-quirks`,childNodes:[]};return n.childNodes=M(e.children,n,t),N(e,n),n}function Oe(e,t){let n={nodeName:`#document-fragment`,childNodes:[]};return n.childNodes=M(e.children,n,t),N(e,n),n}function ke(e){let t={nodeName:`#documentType`,name:`html`,publicId:``,systemId:``,parentNode:null};return N(e,t),t}function Ae(e){let t={nodeName:`#text`,value:e.value,parentNode:null};return N(e,t),t}function je(e){let t={nodeName:`#comment`,data:e.value,parentNode:null};return N(e,t),t}function Me(e,t){let n=t,r=n;e.type===`element`&&e.tagName.toLowerCase()===`svg`&&n.space===`html`&&(r=m);let i=[],a;if(e.properties){for(a in e.properties)if(a!==`children`&&Te.call(e.properties,a)){let t=Ne(r,a,e.properties[a]);t&&i.push(t)}}let o=r.space;p(o);let s={nodeName:e.tagName,tagName:e.tagName,attrs:i,namespaceURI:l[o],childNodes:[],parentNode:null};return s.childNodes=M(e.children,s,r),N(e,s),e.tagName===`template`&&e.content&&(s.content=Oe(e.content,r)),s}function Ne(e,t,n){let r=i(e,t);if(n===!1||n==null||typeof n==`number`&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?ie(n):o(n));let a={name:r.attribute,value:n===!0?``:String(n)};if(r.space&&r.space!==`html`&&r.space!==`svg`){let e=a.name.indexOf(`:`);e<0?a.prefix=``:(a.name=a.name.slice(e+1),a.prefix=r.attribute.slice(0,e)),a.namespace=l[r.space]}return a}function M(e,t,n){let r=-1,i=[];if(e)for(;++r<e.length;){let a=j(e[r],n);a.parentNode=t,i.push(a)}return i}function N(e,t){let n=e.position;n&&n.start&&n.end&&(p(typeof n.start.offset==`number`),p(typeof n.end.offset==`number`),t.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}var Pe=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,Fe=new Set([`mdxFlowExpression`,`mdxJsxFlowElement`,`mdxJsxTextElement`,`mdxTextExpression`,`mdxjsEsm`]),P={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function F(e,t){let n=Ge(e),r=x(`type`,{handlers:{root:Ie,element:Le,text:Re,comment:L,doctype:ze,raw:Ve},unknown:He}),i={parser:n?new S(P):S.getFragmentParser(void 0,P),handle(e){r(e,i)},stitches:!1,options:t||{}};r(e,i),R(i,d());let a=Se(n?i.parser.document:i.parser.getFragment(),{file:i.options.file});return i.stitches&&re(a,`comment`,function(e,t,n){let r=e;if(r.value.stitch&&n&&t!==void 0){let e=n.children;return e[t]=r.value.stitch,t}}),a.type===`root`&&a.children.length===1&&a.children[0].type===e.type?a.children[0]:a}function I(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function Ie(e,t){I(e.children,t)}function Le(e,t){Ue(e,t),I(e.children,t),We(e,t)}function Re(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);let n={type:C.CHARACTER,chars:e.value,location:B(e)};R(t,d(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function ze(e,t){let n={type:C.DOCTYPE,name:`html`,forceQuirks:!1,publicId:``,systemId:``,location:B(e)};R(t,d(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function Be(e,t){t.stitches=!0;let n=Ke(e);`children`in e&&`children`in n&&(n.children=F({type:`root`,children:e.children},t.options).children),L({type:`comment`,value:{stitch:n}},t)}function L(e,t){let n=e.value,r={type:C.COMMENT,data:n,location:B(e)};R(t,d(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function Ve(e,t){if(t.parser.tokenizer.preprocessor.html=``,t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,z(t,d(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(Pe,`&lt;$1$2`):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;let e=t.parser.tokenizer._consume();t.parser.tokenizer._callState(e)}}function He(e,t){let n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))Be(n,t);else{let e=``;throw Fe.has(n.type)&&(e=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),Error("Cannot compile `"+n.type+"` node"+e)}}function R(e,t){z(e,t);let n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=T.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:``,value:``}}function z(e,t){if(t&&t.offset!==void 0){let n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function Ue(e,t){let n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===T.PLAINTEXT)return;R(t,d(e));let r=t.parser.openElements.current,i=`namespaceURI`in r?r.namespaceURI:l.html;i===l.html&&n===`svg`&&(i=l.svg);let a=Ee({...e,children:[]},{space:i===l.svg?`svg`:`html`}),o={type:C.START_TAG,tagName:n,tagID:E(n),selfClosing:!1,ackSelfClosing:!1,attrs:`attrs`in a?a.attrs:[],location:B(e)};t.parser.currentToken=o,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function We(e,t){let n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&he.includes(n)||t.parser.tokenizer.state===T.PLAINTEXT)return;R(t,s(e));let r={type:C.END_TAG,tagName:n,tagID:E(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:B(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===T.RCDATA||t.parser.tokenizer.state===T.RAWTEXT||t.parser.tokenizer.state===T.SCRIPT_DATA)&&(t.parser.tokenizer.state=T.DATA)}function Ge(e){let t=e.type===`root`?e.children[0]:e;return!!(t&&(t.type===`doctype`||t.type===`element`&&t.tagName.toLowerCase()===`html`))}function B(e){let t=d(e)||{line:void 0,column:void 0,offset:void 0},n=s(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function Ke(e){return`children`in e?c({...e,children:[]}):c(e)}function qe(e){return function(t,n){return F(t,{...e,file:n})}}var V=`$$`,Je=[{open:`\\[`,close:`\\]`,allowNewline:!0},{open:`\\(`,close:`\\)`,allowNewline:!1}];function Ye(e){let t=[],n=``,r=0,i=-1,a=0;for(let o of e.split(`
2
+ import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{C as t,D as n,E as r,T as i,a,b as o,c as s,d as c,f as l,i as u,l as d,n as ee,o as te,r as ne,s as re,t as f,v as p,w as m,x as ie}from"./vendor-markdown-C-P1aR4p.js";import{a as h}from"./api-client-xQDlhUTu.js";import{t as ae}from"./preload-helper-CM8YhcCa.js";import{t as g}from"./utils-Bslrbb-G.js";import{i as oe}from"./project-store-BLGl9IAO.js";import{t as _}from"./tab-store-D5I52eLN.js";import{i as se,o as ce,t as v}from"./file-store-BQ41vIs5.js";import{r as le}from"./clipboard-D-VCry-F.js";import{n as y}from"./fs-api-CFtQzsIJ.js";import{$ as ue,M as de,Q as fe,Ur as pe,Z as b,_i as me,it as he,j as ge,n as _e,r as ve,rt as x,t as ye}from"./index-D8QDpdgs.js";import{r as be,t as xe}from"./image-gallery-BuxSgBug.js";import{a as S,c as C,l as Se,n as w,o as T,s as E,t as Ce}from"./lib-5Chotbwm.js";import{r as D}from"./run-in-terminal-ujoc25vj.js";function O(e){u(e,[/\r?\n|\r/g,k])}function k(){return{type:`break`}}function A(){return function(e){O(e)}}var we={},Te={}.hasOwnProperty,j=x(`type`,{handlers:{root:De,element:Me,text:Ae,comment:je,doctype:ke}});function Ee(e,n){let r=(n||we).space;return j(e,r===`svg`?m:t)}function De(e,t){let n={nodeName:`#document`,mode:(e.data||{}).quirksMode?`quirks`:`no-quirks`,childNodes:[]};return n.childNodes=M(e.children,n,t),N(e,n),n}function Oe(e,t){let n={nodeName:`#document-fragment`,childNodes:[]};return n.childNodes=M(e.children,n,t),N(e,n),n}function ke(e){let t={nodeName:`#documentType`,name:`html`,publicId:``,systemId:``,parentNode:null};return N(e,t),t}function Ae(e){let t={nodeName:`#text`,value:e.value,parentNode:null};return N(e,t),t}function je(e){let t={nodeName:`#comment`,data:e.value,parentNode:null};return N(e,t),t}function Me(e,t){let n=t,r=n;e.type===`element`&&e.tagName.toLowerCase()===`svg`&&n.space===`html`&&(r=m);let i=[],a;if(e.properties){for(a in e.properties)if(a!==`children`&&Te.call(e.properties,a)){let t=Ne(r,a,e.properties[a]);t&&i.push(t)}}let o=r.space;p(o);let s={nodeName:e.tagName,tagName:e.tagName,attrs:i,namespaceURI:l[o],childNodes:[],parentNode:null};return s.childNodes=M(e.children,s,r),N(e,s),e.tagName===`template`&&e.content&&(s.content=Oe(e.content,r)),s}function Ne(e,t,n){let r=i(e,t);if(n===!1||n==null||typeof n==`number`&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?ie(n):o(n));let a={name:r.attribute,value:n===!0?``:String(n)};if(r.space&&r.space!==`html`&&r.space!==`svg`){let e=a.name.indexOf(`:`);e<0?a.prefix=``:(a.name=a.name.slice(e+1),a.prefix=r.attribute.slice(0,e)),a.namespace=l[r.space]}return a}function M(e,t,n){let r=-1,i=[];if(e)for(;++r<e.length;){let a=j(e[r],n);a.parentNode=t,i.push(a)}return i}function N(e,t){let n=e.position;n&&n.start&&n.end&&(p(typeof n.start.offset==`number`),p(typeof n.end.offset==`number`),t.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}var Pe=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,Fe=new Set([`mdxFlowExpression`,`mdxJsxFlowElement`,`mdxJsxTextElement`,`mdxTextExpression`,`mdxjsEsm`]),P={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function F(e,t){let n=Ge(e),r=x(`type`,{handlers:{root:Ie,element:Le,text:Re,comment:L,doctype:ze,raw:Ve},unknown:He}),i={parser:n?new S(P):S.getFragmentParser(void 0,P),handle(e){r(e,i)},stitches:!1,options:t||{}};r(e,i),R(i,d());let a=Se(n?i.parser.document:i.parser.getFragment(),{file:i.options.file});return i.stitches&&re(a,`comment`,function(e,t,n){let r=e;if(r.value.stitch&&n&&t!==void 0){let e=n.children;return e[t]=r.value.stitch,t}}),a.type===`root`&&a.children.length===1&&a.children[0].type===e.type?a.children[0]:a}function I(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function Ie(e,t){I(e.children,t)}function Le(e,t){Ue(e,t),I(e.children,t),We(e,t)}function Re(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);let n={type:C.CHARACTER,chars:e.value,location:B(e)};R(t,d(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function ze(e,t){let n={type:C.DOCTYPE,name:`html`,forceQuirks:!1,publicId:``,systemId:``,location:B(e)};R(t,d(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function Be(e,t){t.stitches=!0;let n=Ke(e);`children`in e&&`children`in n&&(n.children=F({type:`root`,children:e.children},t.options).children),L({type:`comment`,value:{stitch:n}},t)}function L(e,t){let n=e.value,r={type:C.COMMENT,data:n,location:B(e)};R(t,d(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function Ve(e,t){if(t.parser.tokenizer.preprocessor.html=``,t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,z(t,d(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(Pe,`&lt;$1$2`):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;let e=t.parser.tokenizer._consume();t.parser.tokenizer._callState(e)}}function He(e,t){let n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))Be(n,t);else{let e=``;throw Fe.has(n.type)&&(e=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),Error("Cannot compile `"+n.type+"` node"+e)}}function R(e,t){z(e,t);let n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=T.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:``,value:``}}function z(e,t){if(t&&t.offset!==void 0){let n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function Ue(e,t){let n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===T.PLAINTEXT)return;R(t,d(e));let r=t.parser.openElements.current,i=`namespaceURI`in r?r.namespaceURI:l.html;i===l.html&&n===`svg`&&(i=l.svg);let a=Ee({...e,children:[]},{space:i===l.svg?`svg`:`html`}),o={type:C.START_TAG,tagName:n,tagID:E(n),selfClosing:!1,ackSelfClosing:!1,attrs:`attrs`in a?a.attrs:[],location:B(e)};t.parser.currentToken=o,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function We(e,t){let n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&he.includes(n)||t.parser.tokenizer.state===T.PLAINTEXT)return;R(t,s(e));let r={type:C.END_TAG,tagName:n,tagID:E(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:B(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===T.RCDATA||t.parser.tokenizer.state===T.RAWTEXT||t.parser.tokenizer.state===T.SCRIPT_DATA)&&(t.parser.tokenizer.state=T.DATA)}function Ge(e){let t=e.type===`root`?e.children[0]:e;return!!(t&&(t.type===`doctype`||t.type===`element`&&t.tagName.toLowerCase()===`html`))}function B(e){let t=d(e)||{line:void 0,column:void 0,offset:void 0},n=s(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function Ke(e){return`children`in e?c({...e,children:[]}):c(e)}function qe(e){return function(t,n){return F(t,{...e,file:n})}}var V=`$$`,Je=[{open:`\\[`,close:`\\]`,allowNewline:!0},{open:`\\(`,close:`\\)`,allowNewline:!1}];function Ye(e){let t=[],n=``,r=0,i=-1,a=0;for(let o of e.split(`
3
3
  `)){let e=a+o.length,s=/^ {0,3}(`{3,}|~{3,})/.exec(o);i>=0?s&&s[1][0]===n&&s[1].length>=r&&/^ {0,3}[`~]+[ \t]*$/.test(o)&&(t.push([i,e]),i=-1):s&&(n=s[1][0],r=s[1].length,i=a),a=e+1}return i>=0&&t.push([i,e.length]),t}function Xe(e,t){let n=[],r=0;for(;r<e.length;){let i=t.find(([e,t])=>r>=e&&r<t);if(i){r=i[1];continue}if(e[r]!=="`"){r++;continue}let a=0;for(;e[r+a]==="`";)a++;let o=r+a,s=-1;for(;o<e.length;){if(e[o]!=="`"){o++;continue}let t=0;for(;e[o+t]==="`";)t++;if(t===a){s=o+t;break}o+=t}if(s<0){r+=a;continue}n.push([r,s]),r=s}return n}function Ze(e){if(!e.includes(`\\[`)&&!e.includes(`\\(`))return e;let t=Ye(e),n=[...t,...Xe(e,t)],r=e=>n.some(([t,n])=>e>=t&&e<n),i=``,a=0;for(;a<e.length;){let t=n.find(([e,t])=>a>=e&&a<t);if(t){i+=e.slice(a,t[1]),a=t[1];continue}let o=Je.find(t=>e.startsWith(t.open,a));if(!o||e[a-1]===`\\`){i+=e[a],a++;continue}let s=a+o.open.length,c=o.allowNewline?e.length:Qe(e,`
4
4
  `,s),l=-1;for(let t=s;t<=c-o.close.length;t++)if(e.startsWith(o.close,t)&&!r(t)){l=t;break}if(l<0){i+=e[a],a++;continue}i+=V+e.slice(s,l)+V,a=l+o.close.length}return i}function Qe(e,t,n){let r=e.indexOf(t,n);return r<0?e.length:r}var H=e(n(),1),$e=RegExp(`\\.(ts|tsx|js|jsx|mjs|cjs|py|json|md|mdx|yaml|yml|toml|css|scss|less|html|htm|sh|bash|zsh|go|rs|sql|rb|java|kt|swift|c|cpp|h|hpp|cs|vue|svelte|txt|env|cfg|conf|ini|xml|csv|log|dockerfile|makefile|gradle|output)$`,`i`),et=/[*?{}\[\]]/,U=/^(\/|[A-Za-z]:[/\\])/;function tt(e){return U.test(e)||W(e)?e:te(e)}function W(e){if(!e||e.startsWith(`#`)||/[?*\u0000-\u001f]/.test(e))return null;let t=e;if(/^file:/i.test(t)){let e=t.match(/^file:\/\/(?:localhost)?(\/.*)$/i);if(!e)return null;t=e[1]}let n=de(t);if(!n)return null;let r=n.line?n.path:n.path.split(`#`)[0];try{r=decodeURIComponent(r)}catch{return null}return!r||/[\u0000-\u001f\u007f]/.test(r)||/^[\\/]{2}/.test(r)||/^[a-z][a-z\d+.-]*:/i.test(r)&&!/^[a-z]:[/\\]/i.test(r)?null:(r=r.replace(/^\/([a-z]:[/\\])/i,`$1`),{path:r,line:n.line})}var G=(0,H.createContext)(null),K=()=>(0,H.useContext)(G);function q(e,t){return e.flatMap(e=>[...e.name===t?[e.path]:[],...q(e.children??[],t)])}function nt(e){let t=_(e=>e.openTab),n=_(e=>e.updateTab);return(0,H.useCallback)(async(r,i)=>{if(!r)return;let a=()=>me(ge(r,i));if(/\.output$/.test(r)){let e=ye.getState(),t=e.findByOutput(r);if(t){e.openPanel(t.shellId);return}}let o=oe.getState().projects.find(t=>t.name===e)?.path,s=/^(\/|[a-z]:[/\\]|~(?:[/\\]|$))/i.test(r),c=s?r:o?v(o,r):null;if(!c){a();return}let l=async r=>{let s=await y.stat(r);for(let e=0;s.kind===`symlink`&&s.target&&e<8;e++){let e=s.target,t=s.path.slice(0,s.path.length-s.name.length);s=await y.stat(/^(\/|[a-z]:[/\\])/i.test(e)?e:v(t,e))}if(s.kind===`directory`){await pe(s.path);return}if(s.kind!==`file`){a();return}let c=o?se(o,s.path):null,l={filePath:c??s.path};e&&(l.projectName=e),i&&Object.assign(l,{lineNumber:i.start,endLine:i.end,revealAt:Date.now()});let u=t({type:`editor`,title:s.name,metadata:l,projectId:c===null?null:e??null,closable:!0});i&&u&&n(u,{metadata:l})};try{await l(c)}catch{if(!s&&!/[/\\]/.test(r)&&o){let e=q(ce.getState().tree,g(r));if(e.length===1)try{await l(v(o,e[0]));return}catch{}}a()}},[e,t,n])}var J=r();function rt(e,t,n){let[r,i]=(0,H.useState)(()=>n?fe(e,t):null);return(0,H.useEffect)(()=>{if(!n){i(null);return}let r=!1;b();let a=()=>{b(),ue(e,t).then(e=>{r||i(e)}).catch(()=>{r||i(null)})};a();let o=()=>{a()};return window.addEventListener(`ppm:shiki-theme-change`,o),()=>{r=!0,window.removeEventListener(`ppm:shiki-theme-change`,o)}},[e,t,n]),r}var it=/^(sequenceDiagram|flowchart|graph\s|classDiagram|stateDiagram|erDiagram|journey|gantt|pie|quadrantChart|requirementDiagram|gitGraph|mindmap|timeline|sankey|xychart|block-beta|packet-beta|architecture-beta|kanban)\b/,Y=null;function at(){return Y||=ae(()=>import(`./mermaid.core-DNHX7DSU.js`).then(e=>(e.default.initialize({startOnLoad:!1,theme:`default`,securityLevel:`strict`,fontFamily:`ui-sans-serif, system-ui, sans-serif`}),e.default)),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23])),Y}function X(e){return e?e.type===`text`?e.value??``:e.children?e.children.map(X).join(``):``:``}function ot({children:e,node:t,...n}){let{codeActions:r,projectName:i,isStreaming:a}=K(),o=t?.children?.[0],s=(o?.properties?.className??[]).find(e=>e.startsWith(`language-`))?.replace(`language-`,``),c=X(o);if(s===`mermaid`||!s&&it.test(c.trim()))return(0,J.jsx)(lt,{source:c.trim()});let l=/^(bash|sh|shell|zsh)$/.test(s||``)||!s&&c.startsWith(`$`),u=rt(c,s,!a),d=(0,H.useMemo)(()=>u?{__html:u}:null,[u]);return(0,J.jsxs)(`div`,{className:`relative group`,children:[d?(0,J.jsx)(`div`,{className:`shiki-block`,dangerouslySetInnerHTML:d}):(0,J.jsx)(`pre`,{...n,children:e}),r&&(0,J.jsxs)(`div`,{className:`code-actions absolute top-1 right-1 flex gap-1`,children:[(0,J.jsx)(Q,{title:`Copy`,icon:(0,J.jsx)(ut,{}),activeIcon:(0,J.jsx)(dt,{}),onClick:()=>void le(c)}),l&&i&&(0,J.jsx)(Q,{title:`Send to terminal`,icon:(0,J.jsx)(ft,{}),onClick:()=>D(c,i)})]})]})}var st=/^(.+?):(\d+)(?:-(\d+))?$/;function Z(e){return!!e&&!e.includes(` `)&&!et.test(e)&&$e.test(e)}function ct({className:e,children:t,node:n,...r}){let{openFileOrSearch:i}=K();if(e)return(0,J.jsx)(`code`,{className:e,...r,children:t});let a=String(t??``).trim(),o=null,s,c=a.match(st);if(c&&Z(c[1])?(o=c[1],s={start:Number(c[2]),end:c[3]?Number(c[3]):void 0}):Z(a)&&(o=a),o){let e=o;return(0,J.jsx)(`code`,{onClick:()=>i(e,s),style:{cursor:`pointer`,textDecoration:`underline`,textDecorationStyle:`dotted`},...r,children:t})}return(0,J.jsx)(`code`,{...r,children:t})}function lt({source:e}){let{openDiagramOverlay:t}=K(),[n,r]=(0,H.useState)(null),i=(0,H.useMemo)(()=>n?{__html:n}:null,[n]);return(0,H.useEffect)(()=>{let t=!1,n=`mermaid-${Math.random().toString(36).slice(2,9)}`;return at().then(async i=>{if(!await i.parse(e,{suppressErrors:!0}))throw Error(`invalid mermaid syntax`);let{svg:a}=await i.render(n,e);t||r(a)}).catch(()=>{document.getElementById(n)?.remove(),document.getElementById(`d${n}`)?.remove()}),()=>{t=!0}},[e]),!n||!i?(0,J.jsx)(`pre`,{children:(0,J.jsx)(`code`,{children:e})}):(0,J.jsxs)(`div`,{className:`mermaid-diagram group relative cursor-pointer rounded-lg border border-border bg-white dark:bg-panel-2 p-3 overflow-x-auto my-2`,onClick:()=>t(n),children:[(0,J.jsx)(`div`,{dangerouslySetInnerHTML:i}),(0,J.jsx)(`div`,{className:`absolute top-2 right-2 flex items-center gap-1 px-2 py-1 rounded bg-black/60 text-white text-xs can-hover:opacity-0 can-hover:group-hover:opacity-100 transition-opacity pointer-events-none`,children:`Click to expand`})]})}function Q({title:e,icon:t,activeIcon:n,onClick:r}){let[i,a]=(0,H.useState)(!1);return(0,J.jsx)(`button`,{className:`flex items-center justify-center size-6 rounded bg-surface-elevated/80 hover:bg-surface-elevated text-text-secondary hover:text-text-primary transition-colors border border-border/50`,title:e,onClick:()=>{r(),n&&(a(!0),setTimeout(()=>a(!1),2e3))},children:i&&n?n:t})}var ut=()=>(0,J.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,J.jsx)(`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}),(0,J.jsx)(`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`})]}),dt=()=>(0,J.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,J.jsx)(`polyline`,{points:`20 6 9 17 4 12`})}),ft=()=>(0,J.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,J.jsx)(`polyline`,{points:`4 17 10 11 4 5`}),(0,J.jsx)(`line`,{x1:`12`,y1:`19`,x2:`20`,y2:`19`})]}),pt={...w,strip:[...w.strip??[],`style`],tagNames:[...w.tagNames??[],`abbr`,`mark`,`small`,`u`],ancestors:{...w.ancestors,source:[`picture`]},attributes:{...w.attributes,code:[[`className`,/^language-./,`math-inline`,`math-display`]]},protocols:{cite:[`http`,`https`],longDesc:[`http`,`https`]}},mt=w.clobberPrefix??`user-content-`;function $(e){let t=e.tagName===`a`?e.properties?.href:void 0;typeof t==`string`&&t.length>1&&t.startsWith(`#`)&&(e.properties.href=`#${mt}${t.slice(1)}`),e.children?.forEach($)}function ht(){return e=>$(e)}var gt={clobberPrefix:``},_t=[[ne,{singleTilde:!1}],[ee,{singleDollarTextMath:!1}],A],vt=[qe,[Ce,pt],ht,f],yt=[f],bt={a:St,img:Ct,pre:ot,code:ct,table:wt};function xt({content:e,projectName:t,className:n=``,codeActions:r=!1,isStreaming:i=!1,rawHtml:o=!0}){let s=ve(e=>e.open),c=_e(e=>e.open),l=nt(t),u=(0,H.useMemo)(()=>Ze(e),[e]),d=(0,H.useMemo)(()=>({projectName:t,codeActions:r,isStreaming:i,openFileOrSearch:l,openImageOverlay:s,openDiagramOverlay:c}),[t,r,i,l,s,c]);return(0,J.jsx)(G.Provider,{value:d,children:(0,J.jsx)(`div`,{className:`markdown-content prose-sm ${i?`is-streaming`:``} ${n}`,children:(0,J.jsx)(a,{remarkPlugins:_t,rehypePlugins:o?vt:yt,remarkRehypeOptions:o?gt:void 0,urlTransform:tt,components:bt,children:u})})})}function St({href:e,children:t,node:n,...r}){let{openFileOrSearch:i}=K();if(e?.match(/^(https?:)?\/\//i))return(0,J.jsx)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,...r,children:t});let a=e?W(e):null;return a?(0,J.jsx)(`a`,{href:e,onClick:e=>{e.preventDefault(),i(a.path,a.line)},...r,children:t}):(0,J.jsx)(`a`,{href:e,...r,children:t})}function Ct({src:e,alt:t,node:n,...r}){let{openImageOverlay:i}=K(),[a,o]=(0,H.useState)(null),[s,c]=(0,H.useState)(!1);(0,H.useEffect)(()=>{if(!e||!U.test(e))return;c(!0);let t=!1,n=null,r=h();return fetch(`/api/fs/raw?path=${encodeURIComponent(e)}`,{headers:r?{Authorization:`Bearer ${r}`}:{}}).then(e=>{if(!e.ok)throw Error();return e.blob()}).then(e=>{t||(n=URL.createObjectURL(e),o(n),c(!1))}).catch(()=>{t||c(!1)}),()=>{t=!0,n&&URL.revokeObjectURL(n)}},[e]);let l=a||e||``,u=t||(e?g(e):``);return(0,J.jsx)(`img`,{src:l,alt:u,[xe]:``,onClick:e=>l&&i(l,u,be(e.currentTarget)),className:`max-h-[400px] max-w-full object-contain rounded-md border border-border cursor-pointer`,style:{opacity:s?.3:1,minHeight:s?48:void 0,minWidth:s?48:void 0},...r})}function wt({children:e,node:t,...n}){return(0,J.jsx)(`div`,{className:`table-scroll-wrapper overflow-x-auto`,children:(0,J.jsx)(`table`,{...n,children:e})})}export{xt as t};
@@ -1 +1 @@
1
- import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import"./icons-BwyIKaTT.js";import{t as r}from"./explorer-body-DukR7zM9.js";import"./api-client-xQDlhUTu.js";import"./settings-store-B4mLp19V.js";import"./portal-container-context-NBi-KGK0.js";import"./window-store-DqX_qmkQ.js";import"./panel-store-BJhazigC.js";import"./project-store-BLGl9IAO.js";import"./project-framework-store-DwLxaRan.js";import"./session-list-sync-triggers-DtJI5KF0.js";import"./tab-store-D5I52eLN.js";import"./context-menu-BCuZYfWC.js";import"./file-store-BQ41vIs5.js";import"./use-is-mobile-VRV9eZy1.js";import"./button-C9ZXWb3b.js";import"./dialog-Dn_2tuYa.js";import"./file-icons-JInFtBVl.js";import"./dropdown-menu-BQidk_OJ.js";import{t as i}from"./mobile-bottom-sheet-DArbIyrD.js";import"./use-visual-viewport-MmugpRg-.js";import"./adaptive-context-menu-C4jNSORA.js";import"./fs-api-CFtQzsIJ.js";import"./format-file-meta-DdYtk07C.js";import{Gr as a,Wr as o,ni as s}from"./index-BtAn_krv.js";var c=e(t(),1),l=n();function u(){let e=a(e=>e.isOpen),t=a(e=>e.close),n=a(e=>e.setSelectMode),u=s(e=>e.slices[o]?.path),d=s(e=>e.slices[o]?.inlineEdit?.kind===`rename`);(0,c.useEffect)(()=>{n(!1)},[u,n]);let f=e=>{d&&e.stopPropagation()};return e?(0,l.jsx)(i,{open:e,onClose:t,zIndex:45,className:`flex h-[var(--sheet-vh)] flex-col p-0`,children:(0,l.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,onTouchStart:f,onTouchMove:f,children:u?(0,l.jsx)(r,{windowId:o,initialPath:u,variant:`sheet`}):(0,l.jsx)(`div`,{className:`flex flex-1 items-center justify-center text-sm text-text-2`,children:`Loading…`})})}):null}export{u as MobileExplorerSheet};
1
+ import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import"./icons-BwyIKaTT.js";import{t as r}from"./explorer-body-C6qKehmd.js";import"./api-client-xQDlhUTu.js";import"./settings-store-B4mLp19V.js";import"./portal-container-context-NBi-KGK0.js";import"./window-store-DqX_qmkQ.js";import"./panel-store-BJhazigC.js";import"./project-store-BLGl9IAO.js";import"./project-framework-store-DwLxaRan.js";import"./session-list-sync-triggers-DtJI5KF0.js";import"./tab-store-D5I52eLN.js";import"./context-menu-BCuZYfWC.js";import"./file-store-BQ41vIs5.js";import"./use-is-mobile-VRV9eZy1.js";import"./button-C9ZXWb3b.js";import"./dialog-Dn_2tuYa.js";import"./file-icons-JInFtBVl.js";import"./dropdown-menu-BQidk_OJ.js";import{t as i}from"./mobile-bottom-sheet-DArbIyrD.js";import"./use-visual-viewport-MmugpRg-.js";import"./adaptive-context-menu-C4jNSORA.js";import"./fs-api-CFtQzsIJ.js";import"./format-file-meta-DdYtk07C.js";import{Gr as a,Wr as o,ni as s}from"./index-D8QDpdgs.js";var c=e(t(),1),l=n();function u(){let e=a(e=>e.isOpen),t=a(e=>e.close),n=a(e=>e.setSelectMode),u=s(e=>e.slices[o]?.path),d=s(e=>e.slices[o]?.inlineEdit?.kind===`rename`);(0,c.useEffect)(()=>{n(!1)},[u,n]);let f=e=>{d&&e.stopPropagation()};return e?(0,l.jsx)(i,{open:e,onClose:t,zIndex:45,className:`flex h-[var(--sheet-vh)] flex-col p-0`,children:(0,l.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,onTouchStart:f,onTouchMove:f,children:u?(0,l.jsx)(r,{windowId:o,initialPath:u,variant:`sheet`}):(0,l.jsx)(`div`,{className:`flex flex-1 items-center justify-center text-sm text-text-2`,children:`Loading…`})})}):null}export{u as MobileExplorerSheet};
@@ -1 +1 @@
1
- import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import{ur as r,xn as i,xt as a}from"./icons-BwyIKaTT.js";import"./api-client-xQDlhUTu.js";import"./settings-store-B4mLp19V.js";import{n as o}from"./utils-Bslrbb-G.js";import"./portal-container-context-NBi-KGK0.js";import"./window-store-DqX_qmkQ.js";import{n as s}from"./panel-store-BJhazigC.js";import"./project-store-BLGl9IAO.js";import"./project-framework-store-DwLxaRan.js";import"./session-list-sync-triggers-DtJI5KF0.js";import"./tab-store-D5I52eLN.js";import"./chat-preparation-cache-190LLyy7.js";import"./use-is-mobile-VRV9eZy1.js";import"./settings-categories-Ajj4ui27.js";import{t as c}from"./open-settings-EXR4zoZG.js";import{t as l}from"./button-C9ZXWb3b.js";import"./dialog-Dn_2tuYa.js";import"./patch-tab-metadata-C92YkrRX.js";import"./mobile-bottom-sheet-DArbIyrD.js";import"./use-visual-viewport-MmugpRg-.js";import{E as u,S as d,b as f,ci as p}from"./index-BtAn_krv.js";import{a as m}from"./api-settings-vmIRFNwZ.js";import{s as h,t as g}from"./design-responsive-dialog-MAFgVOmv.js";import{i as _,l as v,n as y,u as b}from"./design-skill-suggestion-Dmmg_ap5.js";var x=e(t(),1),S=`ppm-design-last-system:`;function C(e){try{return localStorage.getItem(S+e)}catch{return null}}function w(e,t){try{localStorage.setItem(S+e,t)}catch{}}var T=n(),E=120,D=[{id:`page`,label:`Page`,hint:`A page, screen or prototype`,icon:a},{id:`slides`,label:`Slides`,hint:`A 1280×720 slide deck`,icon:r}];function O({projectName:e,onClose:t}){let[n,r]=(0,x.useState)(``),[a,S]=(0,x.useState)(`page`),[O,k]=(0,x.useState)(null),[A,j]=(0,x.useState)(``),[M,N]=(0,x.useState)(null),[P,F]=(0,x.useState)(`default`),[I,L]=(0,x.useState)(null),[R,z]=(0,x.useState)(!1);(0,x.useEffect)(()=>{let t=!1;return Promise.all([u(e),m().catch(()=>null)]).then(([e,n])=>{if(t)return;k(e);let r=n?s(n):void 0;j((e.find(e=>e.id===r)??e[0])?.id??``)}).catch(e=>{t||(k([]),L(e.message||`Could not load providers`))}),h(e).then(n=>{if(t)return;N(n);let r=C(e);F(r&&n.some(e=>e.id===r)?r:n[0]?.id??`default`)}).catch(()=>{t||N([])}),()=>{t=!0}},[e]);let[B,V]=(0,x.useState)(!1);(0,x.useEffect)(()=>{let t=!1;return v(e).then(e=>{let n=b(e);t||V(n.length>0&&_(e.instructions,n))}).catch(()=>{}),()=>{t=!0}},[e]);let H=n.trim(),U=!!H&&!!A&&!!M&&!R,W=async()=>{if(U){z(!0),L(null);try{let n=await d(e,{title:H,kind:a,system:P});w(e,P),f(e),p({projectName:e,slug:n.slug,title:n.title,providerId:A,fresh:!0}),t()}catch(e){L(e.message||`Could not create the design`),z(!1)}}};return(0,T.jsx)(g,{open:!0,onClose:()=>{R||t()},title:`New design`,description:`The AI builds it in designs/ in this project, with a live preview beside the chat.`,footer:(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(l,{variant:`outline`,onClick:t,disabled:R,children:`Cancel`}),(0,T.jsxs)(l,{onClick:()=>void W(),disabled:!U,children:[R&&(0,T.jsx)(i,{className:`size-4 animate-spin`}),` Create`]})]}),children:(0,T.jsxs)(`form`,{className:`flex flex-col gap-4`,onSubmit:e=>{e.preventDefault(),W()},children:[(0,T.jsxs)(`label`,{className:`flex flex-col gap-1 text-xs font-medium text-text-secondary`,children:[`Title`,(0,T.jsx)(`input`,{autoFocus:!0,value:n,maxLength:E,onChange:e=>r(e.target.value),placeholder:`e.g. Pricing page`,className:`min-h-11 w-full rounded-md border border-border bg-background px-3 text-sm text-foreground placeholder:text-text-subtle focus:outline-none focus:ring-1 focus:ring-primary md:min-h-9`})]}),(0,T.jsx)(`div`,{role:`radiogroup`,"aria-label":`Kind`,className:`grid grid-cols-2 gap-2`,children:D.map(e=>(0,T.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":a===e.id,onClick:()=>S(e.id),className:o(`flex min-h-14 flex-col items-start gap-0.5 rounded-md border p-2 text-left`,a===e.id?`border-primary`:`border-border`),children:[(0,T.jsxs)(`span`,{className:`flex items-center gap-1.5 text-sm font-medium`,children:[(0,T.jsx)(e.icon,{className:`size-4`}),` `,e.label]}),(0,T.jsx)(`span`,{className:`text-xs text-text-subtle`,children:e.hint})]},e.id))}),M&&M.length>1&&(0,T.jsxs)(`label`,{className:`flex flex-col gap-1 text-xs font-medium text-text-secondary`,children:[`Which app is this for?`,(0,T.jsx)(`select`,{value:P,onChange:e=>F(e.target.value),className:`min-h-11 w-full rounded-md border border-border bg-background px-2 text-sm text-foreground md:min-h-9`,children:M.map(e=>(0,T.jsx)(`option`,{value:e.id,children:e.label},e.id))})]}),(0,T.jsxs)(`label`,{className:`flex flex-col gap-1 text-xs font-medium text-text-secondary`,children:[`AI provider`,O===null?(0,T.jsxs)(`span`,{className:`flex min-h-11 items-center gap-2 text-sm text-text-subtle`,children:[(0,T.jsx)(i,{className:`size-4 animate-spin`}),` Loading…`]}):O.length===0?(0,T.jsx)(`span`,{className:`text-sm text-text-subtle`,children:`No configured provider can run design sessions. Enable Claude or Codex in Settings.`}):(0,T.jsx)(`select`,{value:A,onChange:e=>j(e.target.value),className:`min-h-11 w-full rounded-md border border-border bg-background px-2 text-sm text-foreground md:min-h-9`,children:O.map(e=>(0,T.jsx)(`option`,{value:e.id,children:e.name},e.id))})]}),B&&(0,T.jsx)(y,{onOpenSettings:()=>{t(),c(`design`)}}),I&&(0,T.jsx)(`p`,{className:`text-xs text-destructive`,role:`alert`,children:I})]})})}export{O as NewDesignDialog};
1
+ import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import{ur as r,xn as i,xt as a}from"./icons-BwyIKaTT.js";import"./api-client-xQDlhUTu.js";import"./settings-store-B4mLp19V.js";import{n as o}from"./utils-Bslrbb-G.js";import"./portal-container-context-NBi-KGK0.js";import"./window-store-DqX_qmkQ.js";import{n as s}from"./panel-store-BJhazigC.js";import"./project-store-BLGl9IAO.js";import"./project-framework-store-DwLxaRan.js";import"./session-list-sync-triggers-DtJI5KF0.js";import"./tab-store-D5I52eLN.js";import"./chat-preparation-cache-190LLyy7.js";import"./use-is-mobile-VRV9eZy1.js";import"./settings-categories-Ajj4ui27.js";import{t as c}from"./open-settings-EXR4zoZG.js";import{t as l}from"./button-C9ZXWb3b.js";import"./dialog-Dn_2tuYa.js";import"./patch-tab-metadata-C92YkrRX.js";import"./mobile-bottom-sheet-DArbIyrD.js";import"./use-visual-viewport-MmugpRg-.js";import{E as u,S as d,b as f,ci as p}from"./index-D8QDpdgs.js";import{a as m}from"./api-settings-vmIRFNwZ.js";import{s as h,t as g}from"./design-responsive-dialog-MAFgVOmv.js";import{i as _,l as v,n as y,u as b}from"./design-skill-suggestion-Dmmg_ap5.js";var x=e(t(),1),S=`ppm-design-last-system:`;function C(e){try{return localStorage.getItem(S+e)}catch{return null}}function w(e,t){try{localStorage.setItem(S+e,t)}catch{}}var T=n(),E=120,D=[{id:`page`,label:`Page`,hint:`A page, screen or prototype`,icon:a},{id:`slides`,label:`Slides`,hint:`A 1280×720 slide deck`,icon:r}];function O({projectName:e,onClose:t}){let[n,r]=(0,x.useState)(``),[a,S]=(0,x.useState)(`page`),[O,k]=(0,x.useState)(null),[A,j]=(0,x.useState)(``),[M,N]=(0,x.useState)(null),[P,F]=(0,x.useState)(`default`),[I,L]=(0,x.useState)(null),[R,z]=(0,x.useState)(!1);(0,x.useEffect)(()=>{let t=!1;return Promise.all([u(e),m().catch(()=>null)]).then(([e,n])=>{if(t)return;k(e);let r=n?s(n):void 0;j((e.find(e=>e.id===r)??e[0])?.id??``)}).catch(e=>{t||(k([]),L(e.message||`Could not load providers`))}),h(e).then(n=>{if(t)return;N(n);let r=C(e);F(r&&n.some(e=>e.id===r)?r:n[0]?.id??`default`)}).catch(()=>{t||N([])}),()=>{t=!0}},[e]);let[B,V]=(0,x.useState)(!1);(0,x.useEffect)(()=>{let t=!1;return v(e).then(e=>{let n=b(e);t||V(n.length>0&&_(e.instructions,n))}).catch(()=>{}),()=>{t=!0}},[e]);let H=n.trim(),U=!!H&&!!A&&!!M&&!R,W=async()=>{if(U){z(!0),L(null);try{let n=await d(e,{title:H,kind:a,system:P});w(e,P),f(e),p({projectName:e,slug:n.slug,title:n.title,providerId:A,fresh:!0}),t()}catch(e){L(e.message||`Could not create the design`),z(!1)}}};return(0,T.jsx)(g,{open:!0,onClose:()=>{R||t()},title:`New design`,description:`The AI builds it in designs/ in this project, with a live preview beside the chat.`,footer:(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(l,{variant:`outline`,onClick:t,disabled:R,children:`Cancel`}),(0,T.jsxs)(l,{onClick:()=>void W(),disabled:!U,children:[R&&(0,T.jsx)(i,{className:`size-4 animate-spin`}),` Create`]})]}),children:(0,T.jsxs)(`form`,{className:`flex flex-col gap-4`,onSubmit:e=>{e.preventDefault(),W()},children:[(0,T.jsxs)(`label`,{className:`flex flex-col gap-1 text-xs font-medium text-text-secondary`,children:[`Title`,(0,T.jsx)(`input`,{autoFocus:!0,value:n,maxLength:E,onChange:e=>r(e.target.value),placeholder:`e.g. Pricing page`,className:`min-h-11 w-full rounded-md border border-border bg-background px-3 text-sm text-foreground placeholder:text-text-subtle focus:outline-none focus:ring-1 focus:ring-primary md:min-h-9`})]}),(0,T.jsx)(`div`,{role:`radiogroup`,"aria-label":`Kind`,className:`grid grid-cols-2 gap-2`,children:D.map(e=>(0,T.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":a===e.id,onClick:()=>S(e.id),className:o(`flex min-h-14 flex-col items-start gap-0.5 rounded-md border p-2 text-left`,a===e.id?`border-primary`:`border-border`),children:[(0,T.jsxs)(`span`,{className:`flex items-center gap-1.5 text-sm font-medium`,children:[(0,T.jsx)(e.icon,{className:`size-4`}),` `,e.label]}),(0,T.jsx)(`span`,{className:`text-xs text-text-subtle`,children:e.hint})]},e.id))}),M&&M.length>1&&(0,T.jsxs)(`label`,{className:`flex flex-col gap-1 text-xs font-medium text-text-secondary`,children:[`Which app is this for?`,(0,T.jsx)(`select`,{value:P,onChange:e=>F(e.target.value),className:`min-h-11 w-full rounded-md border border-border bg-background px-2 text-sm text-foreground md:min-h-9`,children:M.map(e=>(0,T.jsx)(`option`,{value:e.id,children:e.label},e.id))})]}),(0,T.jsxs)(`label`,{className:`flex flex-col gap-1 text-xs font-medium text-text-secondary`,children:[`AI provider`,O===null?(0,T.jsxs)(`span`,{className:`flex min-h-11 items-center gap-2 text-sm text-text-subtle`,children:[(0,T.jsx)(i,{className:`size-4 animate-spin`}),` Loading…`]}):O.length===0?(0,T.jsx)(`span`,{className:`text-sm text-text-subtle`,children:`No configured provider can run design sessions. Enable Claude or Codex in Settings.`}):(0,T.jsx)(`select`,{value:A,onChange:e=>j(e.target.value),className:`min-h-11 w-full rounded-md border border-border bg-background px-2 text-sm text-foreground md:min-h-9`,children:O.map(e=>(0,T.jsx)(`option`,{value:e.id,children:e.name},e.id))})]}),B&&(0,T.jsx)(y,{onOpenSettings:()=>{t(),c(`design`)}}),I&&(0,T.jsx)(`p`,{className:`text-xs text-destructive`,role:`alert`,children:I})]})})}export{O as NewDesignDialog};
@@ -1 +1 @@
1
- import"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import"./api-client-xQDlhUTu.js";import{Ri as e}from"./index-BtAn_krv.js";export{e as useNotificationStore};
1
+ import"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import"./api-client-xQDlhUTu.js";import{Ri as e}from"./index-D8QDpdgs.js";export{e as useNotificationStore};
@@ -1 +1 @@
1
- import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import{Ar as r,Kr as i,Ln as a,P as o,Sr as s,gt as c,xn as l}from"./icons-BwyIKaTT.js";import{k as u,r as d}from"./api-client-xQDlhUTu.js";import{n as f}from"./utils-Bslrbb-G.js";import{t as p}from"./format-date-CSHaU2wN.js";import{n as m,t as h}from"./button-C9ZXWb3b.js";import{t as g}from"./input-C3oVNCMq.js";import{t as _}from"./separator-DmU9aJwq.js";import{n as v,r as y,t as b}from"./settings-rows-D02_4sDY.js";import{i as x,n as S,r as C,t as w}from"./telegram-bot-token-field-BeNS2X2k.js";var T=e(t(),1),E=`Notifications are blocked for this site. Allow them in the browser's site settings, then turn this on again.`;function D(e){return e.secure?e.ios&&!e.standalone?{state:`unavailable`,message:`On iPhone and iPad, push works only in PPM added to the Home Screen: tap Share → Add to Home Screen, open PPM from there, then turn this on.`}:!e.serviceWorker||!e.pushManager||!e.notification?e.browser===`Firefox`&&e.serviceWorker&&e.notification?{state:`unavailable`,message:`Push is turned off in this browser. Open about:config, set dom.push.enabled to true, then restart the browser.`}:{state:`unavailable`,message:`This browser cannot receive push notifications.`}:e.permission===`denied`?{state:`blocked`,message:E}:{state:`available`}:{state:`unavailable`,message:`Push needs PPM on HTTPS or localhost. Browsers turn it off on a plain HTTP address like this one.`}}var O=6e4;function k(e,t){let n,r=new Promise((e,r)=>{n=setTimeout(()=>r(new DOMException(`The push service did not answer.`,`TimeoutError`)),t)});return Promise.race([e,r]).finally(()=>clearTimeout(n))}var A={Brave:`Google`,Chrome:`Google`,Firefox:`Mozilla`,Safari:`Apple`};function j(e,t){let{name:n,message:r}=t??{};if(n!==`AbortError`&&n!==`TimeoutError`)return null;if(e===`Brave`&&n===`AbortError`)return`Brave keeps push off until you allow it: open brave://settings/privacy, turn on “Use Google services for push messaging”, restart Brave, then turn this on again.`;let i=A[e],a=i?`${i}'s push service`:`its push service`,o=n===`TimeoutError`?`got no answer from ${a} within a minute`:`could not register with ${a}`,s=n===`AbortError`&&typeof r==`string`&&r?` (${r})`:``;return`${e===`Browser`?`This browser`:e} ${o}${s}. A firewall, VPN, DNS filter or ad blocker may be blocking it${i?``:`, or push is turned off in this browser`}. Telegram and ntfy below work without it.`}function ee(e,t,n){return/iPhone|iPad|iPod/.test(e)||t===`MacIntel`&&n>1}function M(e){return/Edg(A|iOS)?\//.test(e)?`Edge`:/OPR\//.test(e)?`Opera`:/SamsungBrowser\//.test(e)?`Samsung Internet`:/Firefox\/|FxiOS\//.test(e)?`Firefox`:/Chrome\/|CriOS\//.test(e)?`Chrome`:/Safari\//.test(e)?`Safari`:`Browser`}function N(e,t=!1,n=M(e)){let r=/Android/.test(e)?`Android`:/iPhone|iPod/.test(e)?`iPhone`:/iPad/.test(e)||t?`iPad`:/Mac OS X/.test(e)?`macOS`:/Windows/.test(e)?`Windows`:/CrOS/.test(e)?`ChromeOS`:/Linux/.test(e)?`Linux`:``;return r?`${n} on ${r}`:n}function P(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(Math.ceil(e.length/4)*4,`=`),n=atob(t),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return r}function F(e){let t=``;for(let n of e)t+=String.fromCharCode(n);return btoa(t).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}function te(){return navigator.platform===`MacIntel`&&navigator.maxTouchPoints>1}function I(){if(`brave`in navigator)return`Brave`;let e=M(navigator.userAgent),t=navigator.userAgentData?.brands;return e===`Chrome`&&t&&!t.some(e=>e.brand===`Google Chrome`)?`Browser`:e}function L(){return D({secure:window.isSecureContext,serviceWorker:`serviceWorker`in navigator,pushManager:`PushManager`in window,notification:`Notification`in window,ios:ee(navigator.userAgent,navigator.platform,navigator.maxTouchPoints),standalone:window.matchMedia?.(`(display-mode: standalone)`).matches||navigator.standalone===!0,permission:`Notification`in window?Notification.permission:null,browser:I()})}function R(){return N(navigator.userAgent,te(),`brave`in navigator?`Brave`:void 0)}async function z(){return L().state===`unavailable`?null:await(await navigator.serviceWorker.getRegistration())?.pushManager.getSubscription()??null}function B(e,t){let n=e.options.applicationServerKey;return!!n&&F(new Uint8Array(n))===t}async function ne(e){let t=await Notification.requestPermission();if(t!==`granted`)throw Error(t===`denied`?E:`Notifications were not allowed.`);if(!await navigator.serviceWorker.getRegistration())throw Error(`PPM's service worker is not running on this page, so it cannot receive push.`);let n=await navigator.serviceWorker.ready,r=await n.pushManager.getSubscription();r&&!B(r,e)&&(await d.post(`/api/notifications/push/unsubscribe`,{endpoint:r.endpoint}).catch(()=>{}),await r.unsubscribe(),r=null);try{r??=await k(n.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:P(e)}),O)}catch(e){let t=j(I(),e);throw t?Error(t):e}return d.post(`/api/notifications/push/subscribe`,{subscription:r.toJSON(),label:R(),origin:window.location.origin})}async function re(){let e=await z();if(e)try{await d.post(`/api/notifications/push/unsubscribe`,{endpoint:e.endpoint})}finally{await e.unsubscribe()}}var ie=[`done`,`approval_request`,`question`,`schedule`,`jira`,`design_review`],V=[{seconds:0,label:`Right away`},{seconds:30,label:`After 30 seconds`},{seconds:60,label:`After 1 minute`},{seconds:120,label:`After 2 minutes`},{seconds:300,label:`After 5 minutes`}],H={done:{label:`Chat finished`,note:`The AI finished answering.`},approval_request:{label:`Needs approval`,note:`A tool is waiting for your permission.`},question:{label:`AI has a question`,note:`The AI asked you something and is waiting.`},schedule:{label:`Scheduled run finished`,note:`A schedule completed or failed.`},jira:{label:`Jira`,note:`A watcher found new issues, or a debug run finished.`},design_review:{label:`Reviewer comments`,note:`Someone commented on a design you shared.`}};function U(e,t){return{events:{...e.events,...t.events??{}},delay_seconds:t.delay_seconds??e.delay_seconds,telegram:t.telegram??e.telegram,ntfy:t.ntfy??e.ntfy}}function W(e){let t=e.trim();if(!t)return null;try{let e=new URL(/^[a-z][a-z0-9+.-]*:\/\//i.test(t)?t:`https://${t}`);return e.protocol!==`https:`&&e.protocol!==`http:`||!e.hostname||e.username||e.password?null:`${e.origin}${e.pathname.replace(/\/+$/,``)}`}catch{return null}}var G=n(),K=`https://ntfy.sh`;function q(){let e=crypto.getRandomValues(new Uint8Array(12));return`ppm-${Array.from(e,e=>`abcdefghijklmnopqrstuvwxyz0123456789`[e%36]).join(``)}`}function J(e){try{return new URL(e).host}catch{return e}}function ae({status:e,onSaved:t,onRemove:n}){let r=(0,T.useId)(),i=(0,T.useId)(),a=(0,T.useId)(),[s,l]=(0,T.useState)(e.server||K),[u,p]=(0,T.useState)(()=>e.topic||q()),[_,v]=(0,T.useState)(``),[y,b]=(0,T.useState)(!1),[x,S]=(0,T.useState)(null),[C,w]=(0,T.useState)(!e.configured),E=W(s),D=e.tokenSet&&E===e.server,O=!e.configured||E!==e.server||u.trim()!==e.topic||_.trim()!==``,k=e=>t=>{e(t.target.value),S(null)},A=async()=>{b(!0),S(null);try{let e=await d.put(`/api/notifications/ntfy`,{server:s,topic:u,..._.trim()?{token:_.trim()}:{}});v(``),w(!1),t(e)}catch(e){S(e instanceof Error?e.message:String(e))}finally{b(!1)}};return(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsxs)(`form`,{className:`space-y-3`,onSubmit:e=>{e.preventDefault(),A()},children:[(0,G.jsx)(Y,{id:r,label:`Server`,children:(0,G.jsx)(g,{id:r,inputMode:`url`,autoCapitalize:`none`,autoCorrect:`off`,autoComplete:`off`,spellCheck:!1,placeholder:K,value:s,onChange:k(l),className:`h-11 w-full text-sm md:h-9`})}),(0,G.jsx)(Y,{id:i,label:`Topic`,children:(0,G.jsx)(g,{id:i,autoCapitalize:`none`,autoCorrect:`off`,autoComplete:`off`,spellCheck:!1,value:u,onChange:k(p),className:`h-11 w-full font-mono text-sm md:h-9`})}),(0,G.jsx)(Y,{id:a,label:`Access token — only if the server requires sign-in`,children:(0,G.jsx)(g,{id:a,type:`password`,autoComplete:`off`,spellCheck:!1,placeholder:D?`•••••• (saved)`:`tk_…`,value:_,onChange:k(v),className:`h-11 w-full font-mono text-sm md:h-9`})}),e.tokenSet&&!D&&!_.trim()&&(0,G.jsxs)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:[`The saved token is for `,J(e.server),` and is not sent to another server.`]}),x&&(0,G.jsx)(`p`,{className:`text-xs text-error`,children:x}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row`,children:[(0,G.jsx)(h,{type:`submit`,disabled:y||!O,className:`min-h-11 cursor-pointer md:min-h-9`,children:y?`Checking…`:`Save`}),e.configured&&(0,G.jsx)(h,{type:`button`,variant:`ghost`,onClick:n,className:`min-h-11 cursor-pointer text-error hover:text-error md:min-h-9`,children:`Remove ntfy`})]})]}),(0,G.jsxs)(`button`,{type:`button`,onClick:()=>w(e=>!e),"aria-expanded":C,className:`flex min-h-11 cursor-pointer items-center gap-1 text-xs text-primary md:min-h-8`,children:[(0,G.jsx)(o,{className:f(`size-3.5 transition-transform`,!C&&`-rotate-90`)}),`How to set up ntfy`]}),C&&(0,G.jsxs)(`div`,{className:`space-y-3 rounded-lg border border-border px-4 py-3`,children:[(0,G.jsxs)(`ol`,{className:`list-decimal space-y-1.5 pl-4 text-sm leading-relaxed`,children:[(0,G.jsx)(`li`,{children:`Install the ntfy app on your phone, or open the server in a browser.`}),(0,G.jsxs)(`li`,{children:[`Subscribe to the topic above. For a server other than ntfy.sh, turn on `,(0,G.jsx)(`b`,{children:`Use another server`}),` and enter its address.`]}),(0,G.jsxs)(`li`,{children:[`If the server asks you to sign in, create a token in its web app under `,(0,G.jsx)(`b`,{children:`Account → Access tokens`}),` and paste it above. Its user needs permission to publish to the topic.`]}),(0,G.jsx)(`li`,{children:`Save, then send a test.`})]}),(0,G.jsxs)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:[`On ntfy.sh anyone who knows a topic's name can read it, so keep the name hard to guess. An iPhone gets instant alerts from a server of your own only when that server sets`,` `,(0,G.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5`,children:`upstream-base-url: "https://ntfy.sh"`}),`.`]}),(0,G.jsxs)(`a`,{href:`https://docs.ntfy.sh/subscribe/phone/`,target:`_blank`,rel:`noopener noreferrer`,className:f(m({variant:`outline`}),`min-h-11 w-full gap-2 md:min-h-9 sm:w-auto`),children:[`The ntfy app guide`,(0,G.jsx)(c,{className:`size-3.5`})]})]})]})}function Y({id:e,label:t,children:n}){return(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(`label`,{htmlFor:e,className:`text-xs text-muted-foreground`,children:t}),n]})}var X=e=>e instanceof Error?e.message:String(e),Z=e=>p(new Date(e).toISOString());function oe(){let[e,t]=(0,T.useState)(null),[n,r]=(0,T.useState)(null),i=(0,T.useCallback)(async()=>{try{t(await d.get(`/api/notifications/settings`)),r(null)}catch(e){r(X(e))}},[]);(0,T.useEffect)(()=>{i()},[i]);let a=(0,T.useCallback)(async e=>{t(t=>t&&U(t,e));try{await d.put(`/api/notifications/settings`,e)}catch(e){u.error(`Could not save`,{description:X(e)}),await i()}},[i]);return e?(0,G.jsxs)(`div`,{className:`space-y-6`,children:[(0,G.jsx)(se,{settings:e,update:a}),(0,G.jsx)(_,{}),(0,G.jsx)(ce,{}),(0,G.jsx)(_,{}),(0,G.jsx)(le,{settings:e,update:a}),(0,G.jsx)(_,{}),(0,G.jsx)($,{settings:e,update:a})]}):(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n??`Loading…`})}function se({settings:e,update:t}){let n=(0,T.useId)(),r=V.some(t=>t.seconds===e.delay_seconds)?V:[...V,{seconds:e.delay_seconds,label:`After ${e.delay_seconds} seconds`}];return(0,G.jsxs)(`section`,{className:`space-y-3`,children:[(0,G.jsx)(v,{title:`When to notify`,children:`For every channel below, on every device.`}),(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(`label`,{htmlFor:n,className:`text-xs text-muted-foreground`,children:`Send a notification`}),(0,G.jsx)(`select`,{id:n,value:e.delay_seconds,onChange:e=>void t({delay_seconds:Number(e.target.value)}),className:`h-11 w-full rounded-md border border-input bg-background px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring md:h-9`,children:r.map(e=>(0,G.jsx)(`option`,{value:e.seconds,children:e.label},e.seconds))}),(0,G.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:e.delay_seconds===0?`Sent the moment it happens, even while you are looking at the chat.`:`Sent only if the chat is still unread by then. Opening it in PPM on any device cancels the notification, and so does answering an approval.`})]}),(0,G.jsx)(`div`,{className:`divide-y divide-border rounded-lg border border-border`,children:ie.map(n=>(0,G.jsx)(y,{label:H[n].label,note:H[n].note,checked:e.events[n],onChange:e=>void t({events:{[n]:e}})},n))})]})}function ce(){let[e,t]=(0,T.useState)(null),[n,o]=(0,T.useState)(null),[c,f]=(0,T.useState)(null),[p,m]=(0,T.useState)(!1),[h,g]=(0,T.useState)(!1),[_,x]=(0,T.useState)(null),[S,C]=(0,T.useState)(null),w=L(),E=(0,T.useCallback)(async()=>{try{let[e,n]=await Promise.all([d.get(`/api/notifications/push`),z().catch(()=>null)]);t(e),o(n),f(null)}catch(e){f(X(e))}},[]);(0,T.useEffect)(()=>{E()},[E]);let D=n&&e&&B(n,e.publicKey)?e.devices.find(e=>e.endpoint===n.endpoint)??null:null,O=async t=>{if(e){m(!0),g(t),x(null);try{t?(await ne(e.publicKey),u.success(`Push is on for this device`)):await re()}catch(e){t?x(X(e)):u.error(`Could not turn push off`,{description:X(e)})}finally{m(!1),g(!1),await E()}}},k=async e=>{C(e.id);try{await d.post(`/api/notifications/push/test`,{id:e.id}),u.success(`Test sent to ${e.label}`)}catch(e){u.error(`Test not delivered`,{description:X(e)})}finally{C(null),await E()}},A=async e=>{if(e.id===D?.id)return O(!1);try{await d.post(`/api/notifications/push/unsubscribe`,{id:e.id})}catch(e){u.error(`Could not remove it`,{description:X(e)})}finally{await E()}},j=w.state===`unavailable`||w.state===`blocked`&&!D;return(0,G.jsxs)(`section`,{className:`space-y-3`,children:[(0,G.jsx)(v,{title:`Push notifications`,children:`Alerts on this phone or computer, even with PPM closed. Turn it on in each browser that should get them.`}),(0,G.jsx)(`div`,{className:`rounded-lg border border-border`,children:(0,G.jsx)(y,{label:`This device`,note:R(),checked:!!D,disabled:p||!e||j,onChange:e=>void O(e)})}),w.state!==`available`&&(0,G.jsx)(`p`,{className:`text-xs leading-relaxed text-warning`,children:w.message}),h&&(0,G.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:`Waiting for the browser's push service. Just after the browser starts, this can take up to a minute.`}),_&&(0,G.jsx)(`p`,{className:`break-words text-xs leading-relaxed text-error`,children:_}),c&&(0,G.jsx)(`p`,{className:`text-xs text-error`,children:c}),e&&e.devices.length>0&&(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Receiving push`}),(0,G.jsx)(`ul`,{className:`divide-y divide-border rounded-lg border border-border`,children:e.devices.map(e=>(0,G.jsxs)(`li`,{className:`flex items-center gap-3 py-1.5 pl-4 pr-1`,children:[(0,G.jsx)(/Android|iPhone|iPad/.test(e.label)?r:a,{className:`size-4 shrink-0 text-muted-foreground`}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`p`,{className:`flex min-w-0 items-center gap-1.5 text-sm`,children:[(0,G.jsx)(`span`,{className:`truncate`,children:e.label}),e.id===D?.id&&(0,G.jsx)(`span`,{className:`shrink-0 rounded bg-primary/10 px-1.5 py-0.5 text-[10px] text-primary`,children:`This device`})]}),(0,G.jsxs)(`p`,{className:`truncate text-xs text-muted-foreground`,children:[Q(e.origin),` · `,e.lastSuccessAt?`delivered ${Z(e.lastSuccessAt)}`:`added ${Z(e.createdAt)}`]}),e.lastError&&(0,G.jsx)(`p`,{className:`break-words text-xs text-error`,children:e.lastError})]}),(0,G.jsx)(b,{label:`Send a test to ${e.label}`,disabled:S!==null,onClick:()=>void k(e),children:S===e.id?(0,G.jsx)(l,{className:`size-4 animate-spin`}):(0,G.jsx)(s,{className:`size-4`})}),(0,G.jsx)(b,{label:`Stop push to ${e.label}`,danger:!0,disabled:p,onClick:()=>void A(e),children:(0,G.jsx)(i,{className:`size-4`})})]},e.id))})]})]})}function Q(e){try{return new URL(e).host}catch{return e}}function le({settings:e,update:t}){let[n,r]=(0,T.useState)(null),[i,a]=(0,T.useState)(null),[o,c]=(0,T.useState)(!1),f=(0,T.useCallback)(async()=>{try{let e=await d.get(`/api/notifications/telegram`);return r(e),a(null),e}catch(e){return a(X(e)),null}},[]);(0,T.useEffect)(()=>{f()},[f]);let{link:p,starting:m,connect:g,cancel:_}=x(`/api/notifications/telegram/connect`,n,f),b=async e=>{try{await d.del(`/api/notifications/telegram/chats/${encodeURIComponent(e.chatId)}`),u.success(`Disconnected ${e.name}`,{description:`It no longer gets alerts.`})}catch(e){u.error(`Could not disconnect`,{description:X(e)})}finally{await f()}},E=async()=>{c(!0);try{await d.post(`/api/settings/telegram/test`,{}),u.success(`Test sent to Telegram`)}catch(e){u.error(`Test not delivered`,{description:X(e)})}finally{c(!1)}},D=n?.chats??[];return(0,G.jsxs)(`section`,{className:`space-y-3`,children:[(0,G.jsx)(v,{title:`Telegram`,children:`Alerts in a chat with your own Telegram bot. A chat connected here gets alerts and nothing else — PPMBot has its own bot and chats.`}),i&&(0,G.jsx)(`p`,{className:`text-xs text-error`,children:i}),n?.configured&&(0,G.jsxs)(G.Fragment,{children:[n.sharedWithPPMBot&&(0,G.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:`PPMBot answers through this bot too, so alerts arrive in your PPMBot chats. Give PPMBot a bot of its own in Settings → PPMBot to keep them apart.`}),(0,G.jsx)(`div`,{className:`rounded-lg border border-border`,children:(0,G.jsx)(y,{label:`Send notifications to Telegram`,note:D.length===0?`No chat connected yet`:D.length===1?`1 chat connected`:`${D.length} chats connected`,checked:e.telegram,onChange:e=>void t({telegram:e})})}),(0,G.jsx)(C,{chats:D,onDisconnect:e=>void b(e)}),p?(0,G.jsx)(S,{link:p,botUsername:n.botUsername,error:n.connect.error,onCancel:()=>void _()}):(0,G.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row`,children:[(0,G.jsxs)(h,{onClick:()=>void g(),disabled:m,className:`min-h-11 cursor-pointer gap-2 md:min-h-9`,children:[m?(0,G.jsx)(l,{className:`size-4 animate-spin`}):(0,G.jsx)(s,{className:`size-4`}),D.length===0?`Connect Telegram`:`Connect another chat`]}),D.length>0&&(0,G.jsx)(h,{variant:`outline`,onClick:()=>void E(),disabled:o,className:`min-h-11 cursor-pointer md:min-h-9`,children:o?`Sending…`:`Send a test`})]})]}),n&&(0,G.jsx)(w,{configured:n.configured,botUsername:n.botUsername,onSaved:()=>void f()})]})}function $({settings:e,update:t}){let[n,r]=(0,T.useState)(null),[i,a]=(0,T.useState)(null),[o,s]=(0,T.useState)(!1),l=(0,T.useCallback)(async()=>{try{r(await d.get(`/api/notifications/ntfy`)),a(null)}catch(e){a(X(e))}},[]);(0,T.useEffect)(()=>{l()},[l]);let p=async()=>{s(!0);try{await d.post(`/api/notifications/ntfy/test`,{}),u.success(`Test sent to ntfy`)}catch(e){u.error(`Test not delivered`,{description:X(e)})}finally{s(!1)}},g=async()=>{try{await d.del(`/api/notifications/ntfy`),u.success(`ntfy removed`)}catch(e){u.error(`Could not remove ntfy`,{description:X(e)})}finally{await l()}};return(0,G.jsxs)(`section`,{className:`space-y-3`,children:[(0,G.jsx)(v,{title:`ntfy`,children:`Alerts through an ntfy server — ntfy.sh or one of your own — on every phone and computer subscribed to your topic.`}),i&&(0,G.jsx)(`p`,{className:`text-xs text-error`,children:i}),n?.configured&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`rounded-lg border border-border`,children:(0,G.jsx)(y,{label:`Send notifications to ntfy`,note:(0,G.jsxs)(G.Fragment,{children:[`Topic `,(0,G.jsx)(`span`,{className:`font-mono`,children:n.topic}),` on `,Q(n.server)]}),checked:e.ntfy,onChange:e=>void t({ntfy:e})})}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row`,children:[(0,G.jsx)(h,{variant:`outline`,onClick:()=>void p(),disabled:o,className:`min-h-11 cursor-pointer md:min-h-9`,children:o?`Sending…`:`Send a test`}),(0,G.jsxs)(`a`,{href:`${n.server}/${n.topic}`,target:`_blank`,rel:`noopener noreferrer`,className:f(m({variant:`outline`}),`min-h-11 gap-2 md:min-h-9`),children:[`Open the topic`,(0,G.jsx)(c,{className:`size-3.5`})]})]})]}),n&&(0,G.jsx)(ae,{status:n,onSaved:r,onRemove:()=>void g()},`${n.server}/${n.topic}`)]})}export{oe as NotificationsSettingsSection};
1
+ import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import{Ar as r,Kr as i,Ln as a,P as o,Sr as s,gt as c,xn as l}from"./icons-BwyIKaTT.js";import{k as u,r as d}from"./api-client-xQDlhUTu.js";import{n as f}from"./utils-Bslrbb-G.js";import{t as p}from"./format-date-CkyHzZLA.js";import{n as m,t as h}from"./button-C9ZXWb3b.js";import{t as g}from"./input-C3oVNCMq.js";import{t as _}from"./separator-DmU9aJwq.js";import{n as v,r as y,t as b}from"./settings-rows-C7ZatT9O.js";import{i as x,n as S,r as C,t as w}from"./telegram-bot-token-field-CwW24m62.js";var T=e(t(),1),E=`Notifications are blocked for this site. Allow them in the browser's site settings, then turn this on again.`;function D(e){return e.secure?e.ios&&!e.standalone?{state:`unavailable`,message:`On iPhone and iPad, push works only in PPM added to the Home Screen: tap Share → Add to Home Screen, open PPM from there, then turn this on.`}:!e.serviceWorker||!e.pushManager||!e.notification?e.browser===`Firefox`&&e.serviceWorker&&e.notification?{state:`unavailable`,message:`Push is turned off in this browser. Open about:config, set dom.push.enabled to true, then restart the browser.`}:{state:`unavailable`,message:`This browser cannot receive push notifications.`}:e.permission===`denied`?{state:`blocked`,message:E}:{state:`available`}:{state:`unavailable`,message:`Push needs PPM on HTTPS or localhost. Browsers turn it off on a plain HTTP address like this one.`}}var O=6e4;function k(e,t){let n,r=new Promise((e,r)=>{n=setTimeout(()=>r(new DOMException(`The push service did not answer.`,`TimeoutError`)),t)});return Promise.race([e,r]).finally(()=>clearTimeout(n))}var A={Brave:`Google`,Chrome:`Google`,Firefox:`Mozilla`,Safari:`Apple`};function j(e,t){let{name:n,message:r}=t??{};if(n!==`AbortError`&&n!==`TimeoutError`)return null;if(e===`Brave`&&n===`AbortError`)return`Brave keeps push off until you allow it: open brave://settings/privacy, turn on “Use Google services for push messaging”, restart Brave, then turn this on again.`;let i=A[e],a=i?`${i}'s push service`:`its push service`,o=n===`TimeoutError`?`got no answer from ${a} within a minute`:`could not register with ${a}`,s=n===`AbortError`&&typeof r==`string`&&r?` (${r})`:``;return`${e===`Browser`?`This browser`:e} ${o}${s}. A firewall, VPN, DNS filter or ad blocker may be blocking it${i?``:`, or push is turned off in this browser`}. Telegram and ntfy below work without it.`}function ee(e,t,n){return/iPhone|iPad|iPod/.test(e)||t===`MacIntel`&&n>1}function M(e){return/Edg(A|iOS)?\//.test(e)?`Edge`:/OPR\//.test(e)?`Opera`:/SamsungBrowser\//.test(e)?`Samsung Internet`:/Firefox\/|FxiOS\//.test(e)?`Firefox`:/Chrome\/|CriOS\//.test(e)?`Chrome`:/Safari\//.test(e)?`Safari`:`Browser`}function N(e,t=!1,n=M(e)){let r=/Android/.test(e)?`Android`:/iPhone|iPod/.test(e)?`iPhone`:/iPad/.test(e)||t?`iPad`:/Mac OS X/.test(e)?`macOS`:/Windows/.test(e)?`Windows`:/CrOS/.test(e)?`ChromeOS`:/Linux/.test(e)?`Linux`:``;return r?`${n} on ${r}`:n}function P(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(Math.ceil(e.length/4)*4,`=`),n=atob(t),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return r}function F(e){let t=``;for(let n of e)t+=String.fromCharCode(n);return btoa(t).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}function te(){return navigator.platform===`MacIntel`&&navigator.maxTouchPoints>1}function I(){if(`brave`in navigator)return`Brave`;let e=M(navigator.userAgent),t=navigator.userAgentData?.brands;return e===`Chrome`&&t&&!t.some(e=>e.brand===`Google Chrome`)?`Browser`:e}function L(){return D({secure:window.isSecureContext,serviceWorker:`serviceWorker`in navigator,pushManager:`PushManager`in window,notification:`Notification`in window,ios:ee(navigator.userAgent,navigator.platform,navigator.maxTouchPoints),standalone:window.matchMedia?.(`(display-mode: standalone)`).matches||navigator.standalone===!0,permission:`Notification`in window?Notification.permission:null,browser:I()})}function R(){return N(navigator.userAgent,te(),`brave`in navigator?`Brave`:void 0)}async function z(){return L().state===`unavailable`?null:await(await navigator.serviceWorker.getRegistration())?.pushManager.getSubscription()??null}function B(e,t){let n=e.options.applicationServerKey;return!!n&&F(new Uint8Array(n))===t}async function ne(e){let t=await Notification.requestPermission();if(t!==`granted`)throw Error(t===`denied`?E:`Notifications were not allowed.`);if(!await navigator.serviceWorker.getRegistration())throw Error(`PPM's service worker is not running on this page, so it cannot receive push.`);let n=await navigator.serviceWorker.ready,r=await n.pushManager.getSubscription();r&&!B(r,e)&&(await d.post(`/api/notifications/push/unsubscribe`,{endpoint:r.endpoint}).catch(()=>{}),await r.unsubscribe(),r=null);try{r??=await k(n.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:P(e)}),O)}catch(e){let t=j(I(),e);throw t?Error(t):e}return d.post(`/api/notifications/push/subscribe`,{subscription:r.toJSON(),label:R(),origin:window.location.origin})}async function re(){let e=await z();if(e)try{await d.post(`/api/notifications/push/unsubscribe`,{endpoint:e.endpoint})}finally{await e.unsubscribe()}}var ie=[`done`,`approval_request`,`question`,`schedule`,`jira`,`design_review`],V=[{seconds:0,label:`Right away`},{seconds:30,label:`After 30 seconds`},{seconds:60,label:`After 1 minute`},{seconds:120,label:`After 2 minutes`},{seconds:300,label:`After 5 minutes`}],H={done:{label:`Chat finished`,note:`The AI finished answering.`},approval_request:{label:`Needs approval`,note:`A tool is waiting for your permission.`},question:{label:`AI has a question`,note:`The AI asked you something and is waiting.`},schedule:{label:`Scheduled run finished`,note:`A schedule completed or failed.`},jira:{label:`Jira`,note:`A watcher found new issues, or a debug run finished.`},design_review:{label:`Reviewer comments`,note:`Someone commented on a design you shared.`}};function U(e,t){return{events:{...e.events,...t.events??{}},delay_seconds:t.delay_seconds??e.delay_seconds,telegram:t.telegram??e.telegram,ntfy:t.ntfy??e.ntfy}}function W(e){let t=e.trim();if(!t)return null;try{let e=new URL(/^[a-z][a-z0-9+.-]*:\/\//i.test(t)?t:`https://${t}`);return e.protocol!==`https:`&&e.protocol!==`http:`||!e.hostname||e.username||e.password?null:`${e.origin}${e.pathname.replace(/\/+$/,``)}`}catch{return null}}var G=n(),K=`https://ntfy.sh`;function q(){let e=crypto.getRandomValues(new Uint8Array(12));return`ppm-${Array.from(e,e=>`abcdefghijklmnopqrstuvwxyz0123456789`[e%36]).join(``)}`}function J(e){try{return new URL(e).host}catch{return e}}function ae({status:e,onSaved:t,onRemove:n}){let r=(0,T.useId)(),i=(0,T.useId)(),a=(0,T.useId)(),[s,l]=(0,T.useState)(e.server||K),[u,p]=(0,T.useState)(()=>e.topic||q()),[_,v]=(0,T.useState)(``),[y,b]=(0,T.useState)(!1),[x,S]=(0,T.useState)(null),[C,w]=(0,T.useState)(!e.configured),E=W(s),D=e.tokenSet&&E===e.server,O=!e.configured||E!==e.server||u.trim()!==e.topic||_.trim()!==``,k=e=>t=>{e(t.target.value),S(null)},A=async()=>{b(!0),S(null);try{let e=await d.put(`/api/notifications/ntfy`,{server:s,topic:u,..._.trim()?{token:_.trim()}:{}});v(``),w(!1),t(e)}catch(e){S(e instanceof Error?e.message:String(e))}finally{b(!1)}};return(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsxs)(`form`,{className:`space-y-3`,onSubmit:e=>{e.preventDefault(),A()},children:[(0,G.jsx)(Y,{id:r,label:`Server`,children:(0,G.jsx)(g,{id:r,inputMode:`url`,autoCapitalize:`none`,autoCorrect:`off`,autoComplete:`off`,spellCheck:!1,placeholder:K,value:s,onChange:k(l),className:`h-11 w-full text-sm md:h-9`})}),(0,G.jsx)(Y,{id:i,label:`Topic`,children:(0,G.jsx)(g,{id:i,autoCapitalize:`none`,autoCorrect:`off`,autoComplete:`off`,spellCheck:!1,value:u,onChange:k(p),className:`h-11 w-full font-mono text-sm md:h-9`})}),(0,G.jsx)(Y,{id:a,label:`Access token — only if the server requires sign-in`,children:(0,G.jsx)(g,{id:a,type:`password`,autoComplete:`off`,spellCheck:!1,placeholder:D?`•••••• (saved)`:`tk_…`,value:_,onChange:k(v),className:`h-11 w-full font-mono text-sm md:h-9`})}),e.tokenSet&&!D&&!_.trim()&&(0,G.jsxs)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:[`The saved token is for `,J(e.server),` and is not sent to another server.`]}),x&&(0,G.jsx)(`p`,{className:`text-xs text-error`,children:x}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row`,children:[(0,G.jsx)(h,{type:`submit`,disabled:y||!O,className:`min-h-11 cursor-pointer md:min-h-9`,children:y?`Checking…`:`Save`}),e.configured&&(0,G.jsx)(h,{type:`button`,variant:`ghost`,onClick:n,className:`min-h-11 cursor-pointer text-error hover:text-error md:min-h-9`,children:`Remove ntfy`})]})]}),(0,G.jsxs)(`button`,{type:`button`,onClick:()=>w(e=>!e),"aria-expanded":C,className:`flex min-h-11 cursor-pointer items-center gap-1 text-xs text-primary md:min-h-8`,children:[(0,G.jsx)(o,{className:f(`size-3.5 transition-transform`,!C&&`-rotate-90`)}),`How to set up ntfy`]}),C&&(0,G.jsxs)(`div`,{className:`space-y-3 rounded-lg border border-border px-4 py-3`,children:[(0,G.jsxs)(`ol`,{className:`list-decimal space-y-1.5 pl-4 text-sm leading-relaxed`,children:[(0,G.jsx)(`li`,{children:`Install the ntfy app on your phone, or open the server in a browser.`}),(0,G.jsxs)(`li`,{children:[`Subscribe to the topic above. For a server other than ntfy.sh, turn on `,(0,G.jsx)(`b`,{children:`Use another server`}),` and enter its address.`]}),(0,G.jsxs)(`li`,{children:[`If the server asks you to sign in, create a token in its web app under `,(0,G.jsx)(`b`,{children:`Account → Access tokens`}),` and paste it above. Its user needs permission to publish to the topic.`]}),(0,G.jsx)(`li`,{children:`Save, then send a test.`})]}),(0,G.jsxs)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:[`On ntfy.sh anyone who knows a topic's name can read it, so keep the name hard to guess. An iPhone gets instant alerts from a server of your own only when that server sets`,` `,(0,G.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5`,children:`upstream-base-url: "https://ntfy.sh"`}),`.`]}),(0,G.jsxs)(`a`,{href:`https://docs.ntfy.sh/subscribe/phone/`,target:`_blank`,rel:`noopener noreferrer`,className:f(m({variant:`outline`}),`min-h-11 w-full gap-2 md:min-h-9 sm:w-auto`),children:[`The ntfy app guide`,(0,G.jsx)(c,{className:`size-3.5`})]})]})]})}function Y({id:e,label:t,children:n}){return(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(`label`,{htmlFor:e,className:`text-xs text-muted-foreground`,children:t}),n]})}var X=e=>e instanceof Error?e.message:String(e),Z=e=>p(new Date(e).toISOString());function oe(){let[e,t]=(0,T.useState)(null),[n,r]=(0,T.useState)(null),i=(0,T.useCallback)(async()=>{try{t(await d.get(`/api/notifications/settings`)),r(null)}catch(e){r(X(e))}},[]);(0,T.useEffect)(()=>{i()},[i]);let a=(0,T.useCallback)(async e=>{t(t=>t&&U(t,e));try{await d.put(`/api/notifications/settings`,e)}catch(e){u.error(`Could not save`,{description:X(e)}),await i()}},[i]);return e?(0,G.jsxs)(`div`,{className:`space-y-6`,children:[(0,G.jsx)(se,{settings:e,update:a}),(0,G.jsx)(_,{}),(0,G.jsx)(ce,{}),(0,G.jsx)(_,{}),(0,G.jsx)(le,{settings:e,update:a}),(0,G.jsx)(_,{}),(0,G.jsx)($,{settings:e,update:a})]}):(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n??`Loading…`})}function se({settings:e,update:t}){let n=(0,T.useId)(),r=V.some(t=>t.seconds===e.delay_seconds)?V:[...V,{seconds:e.delay_seconds,label:`After ${e.delay_seconds} seconds`}];return(0,G.jsxs)(`section`,{className:`space-y-3`,children:[(0,G.jsx)(v,{title:`When to notify`,children:`For every channel below, on every device.`}),(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(`label`,{htmlFor:n,className:`text-xs text-muted-foreground`,children:`Send a notification`}),(0,G.jsx)(`select`,{id:n,value:e.delay_seconds,onChange:e=>void t({delay_seconds:Number(e.target.value)}),className:`h-11 w-full rounded-md border border-input bg-background px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring md:h-9`,children:r.map(e=>(0,G.jsx)(`option`,{value:e.seconds,children:e.label},e.seconds))}),(0,G.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:e.delay_seconds===0?`Sent the moment it happens, even while you are looking at the chat.`:`Sent only if the chat is still unread by then. Opening it in PPM on any device cancels the notification, and so does answering an approval.`})]}),(0,G.jsx)(`div`,{className:`divide-y divide-border rounded-lg border border-border`,children:ie.map(n=>(0,G.jsx)(y,{label:H[n].label,note:H[n].note,checked:e.events[n],onChange:e=>void t({events:{[n]:e}})},n))})]})}function ce(){let[e,t]=(0,T.useState)(null),[n,o]=(0,T.useState)(null),[c,f]=(0,T.useState)(null),[p,m]=(0,T.useState)(!1),[h,g]=(0,T.useState)(!1),[_,x]=(0,T.useState)(null),[S,C]=(0,T.useState)(null),w=L(),E=(0,T.useCallback)(async()=>{try{let[e,n]=await Promise.all([d.get(`/api/notifications/push`),z().catch(()=>null)]);t(e),o(n),f(null)}catch(e){f(X(e))}},[]);(0,T.useEffect)(()=>{E()},[E]);let D=n&&e&&B(n,e.publicKey)?e.devices.find(e=>e.endpoint===n.endpoint)??null:null,O=async t=>{if(e){m(!0),g(t),x(null);try{t?(await ne(e.publicKey),u.success(`Push is on for this device`)):await re()}catch(e){t?x(X(e)):u.error(`Could not turn push off`,{description:X(e)})}finally{m(!1),g(!1),await E()}}},k=async e=>{C(e.id);try{await d.post(`/api/notifications/push/test`,{id:e.id}),u.success(`Test sent to ${e.label}`)}catch(e){u.error(`Test not delivered`,{description:X(e)})}finally{C(null),await E()}},A=async e=>{if(e.id===D?.id)return O(!1);try{await d.post(`/api/notifications/push/unsubscribe`,{id:e.id})}catch(e){u.error(`Could not remove it`,{description:X(e)})}finally{await E()}},j=w.state===`unavailable`||w.state===`blocked`&&!D;return(0,G.jsxs)(`section`,{className:`space-y-3`,children:[(0,G.jsx)(v,{title:`Push notifications`,children:`Alerts on this phone or computer, even with PPM closed. Turn it on in each browser that should get them.`}),(0,G.jsx)(`div`,{className:`rounded-lg border border-border`,children:(0,G.jsx)(y,{label:`This device`,note:R(),checked:!!D,disabled:p||!e||j,onChange:e=>void O(e)})}),w.state!==`available`&&(0,G.jsx)(`p`,{className:`text-xs leading-relaxed text-warning`,children:w.message}),h&&(0,G.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:`Waiting for the browser's push service. Just after the browser starts, this can take up to a minute.`}),_&&(0,G.jsx)(`p`,{className:`break-words text-xs leading-relaxed text-error`,children:_}),c&&(0,G.jsx)(`p`,{className:`text-xs text-error`,children:c}),e&&e.devices.length>0&&(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Receiving push`}),(0,G.jsx)(`ul`,{className:`divide-y divide-border rounded-lg border border-border`,children:e.devices.map(e=>(0,G.jsxs)(`li`,{className:`flex items-center gap-3 py-1.5 pl-4 pr-1`,children:[(0,G.jsx)(/Android|iPhone|iPad/.test(e.label)?r:a,{className:`size-4 shrink-0 text-muted-foreground`}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`p`,{className:`flex min-w-0 items-center gap-1.5 text-sm`,children:[(0,G.jsx)(`span`,{className:`truncate`,children:e.label}),e.id===D?.id&&(0,G.jsx)(`span`,{className:`shrink-0 rounded bg-primary/10 px-1.5 py-0.5 text-[10px] text-primary`,children:`This device`})]}),(0,G.jsxs)(`p`,{className:`truncate text-xs text-muted-foreground`,children:[Q(e.origin),` · `,e.lastSuccessAt?`delivered ${Z(e.lastSuccessAt)}`:`added ${Z(e.createdAt)}`]}),e.lastError&&(0,G.jsx)(`p`,{className:`break-words text-xs text-error`,children:e.lastError})]}),(0,G.jsx)(b,{label:`Send a test to ${e.label}`,disabled:S!==null,onClick:()=>void k(e),children:S===e.id?(0,G.jsx)(l,{className:`size-4 animate-spin`}):(0,G.jsx)(s,{className:`size-4`})}),(0,G.jsx)(b,{label:`Stop push to ${e.label}`,danger:!0,disabled:p,onClick:()=>void A(e),children:(0,G.jsx)(i,{className:`size-4`})})]},e.id))})]})]})}function Q(e){try{return new URL(e).host}catch{return e}}function le({settings:e,update:t}){let[n,r]=(0,T.useState)(null),[i,a]=(0,T.useState)(null),[o,c]=(0,T.useState)(!1),f=(0,T.useCallback)(async()=>{try{let e=await d.get(`/api/notifications/telegram`);return r(e),a(null),e}catch(e){return a(X(e)),null}},[]);(0,T.useEffect)(()=>{f()},[f]);let{link:p,starting:m,connect:g,cancel:_}=x(`/api/notifications/telegram/connect`,n,f),b=async e=>{try{await d.del(`/api/notifications/telegram/chats/${encodeURIComponent(e.chatId)}`),u.success(`Disconnected ${e.name}`,{description:`It no longer gets alerts.`})}catch(e){u.error(`Could not disconnect`,{description:X(e)})}finally{await f()}},E=async()=>{c(!0);try{await d.post(`/api/settings/telegram/test`,{}),u.success(`Test sent to Telegram`)}catch(e){u.error(`Test not delivered`,{description:X(e)})}finally{c(!1)}},D=n?.chats??[];return(0,G.jsxs)(`section`,{className:`space-y-3`,children:[(0,G.jsx)(v,{title:`Telegram`,children:`Alerts in a chat with your own Telegram bot. A chat connected here gets alerts and nothing else — PPMBot has its own bot and chats.`}),i&&(0,G.jsx)(`p`,{className:`text-xs text-error`,children:i}),n?.configured&&(0,G.jsxs)(G.Fragment,{children:[n.sharedWithPPMBot&&(0,G.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:`PPMBot answers through this bot too, so alerts arrive in your PPMBot chats. Give PPMBot a bot of its own in Settings → PPMBot to keep them apart.`}),(0,G.jsx)(`div`,{className:`rounded-lg border border-border`,children:(0,G.jsx)(y,{label:`Send notifications to Telegram`,note:D.length===0?`No chat connected yet`:D.length===1?`1 chat connected`:`${D.length} chats connected`,checked:e.telegram,onChange:e=>void t({telegram:e})})}),(0,G.jsx)(C,{chats:D,onDisconnect:e=>void b(e)}),p?(0,G.jsx)(S,{link:p,botUsername:n.botUsername,error:n.connect.error,onCancel:()=>void _()}):(0,G.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row`,children:[(0,G.jsxs)(h,{onClick:()=>void g(),disabled:m,className:`min-h-11 cursor-pointer gap-2 md:min-h-9`,children:[m?(0,G.jsx)(l,{className:`size-4 animate-spin`}):(0,G.jsx)(s,{className:`size-4`}),D.length===0?`Connect Telegram`:`Connect another chat`]}),D.length>0&&(0,G.jsx)(h,{variant:`outline`,onClick:()=>void E(),disabled:o,className:`min-h-11 cursor-pointer md:min-h-9`,children:o?`Sending…`:`Send a test`})]})]}),n&&(0,G.jsx)(w,{configured:n.configured,botUsername:n.botUsername,onSaved:()=>void f()})]})}function $({settings:e,update:t}){let[n,r]=(0,T.useState)(null),[i,a]=(0,T.useState)(null),[o,s]=(0,T.useState)(!1),l=(0,T.useCallback)(async()=>{try{r(await d.get(`/api/notifications/ntfy`)),a(null)}catch(e){a(X(e))}},[]);(0,T.useEffect)(()=>{l()},[l]);let p=async()=>{s(!0);try{await d.post(`/api/notifications/ntfy/test`,{}),u.success(`Test sent to ntfy`)}catch(e){u.error(`Test not delivered`,{description:X(e)})}finally{s(!1)}},g=async()=>{try{await d.del(`/api/notifications/ntfy`),u.success(`ntfy removed`)}catch(e){u.error(`Could not remove ntfy`,{description:X(e)})}finally{await l()}};return(0,G.jsxs)(`section`,{className:`space-y-3`,children:[(0,G.jsx)(v,{title:`ntfy`,children:`Alerts through an ntfy server — ntfy.sh or one of your own — on every phone and computer subscribed to your topic.`}),i&&(0,G.jsx)(`p`,{className:`text-xs text-error`,children:i}),n?.configured&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`rounded-lg border border-border`,children:(0,G.jsx)(y,{label:`Send notifications to ntfy`,note:(0,G.jsxs)(G.Fragment,{children:[`Topic `,(0,G.jsx)(`span`,{className:`font-mono`,children:n.topic}),` on `,Q(n.server)]}),checked:e.ntfy,onChange:e=>void t({ntfy:e})})}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row`,children:[(0,G.jsx)(h,{variant:`outline`,onClick:()=>void p(),disabled:o,className:`min-h-11 cursor-pointer md:min-h-9`,children:o?`Sending…`:`Send a test`}),(0,G.jsxs)(`a`,{href:`${n.server}/${n.topic}`,target:`_blank`,rel:`noopener noreferrer`,className:f(m({variant:`outline`}),`min-h-11 gap-2 md:min-h-9`),children:[`Open the topic`,(0,G.jsx)(c,{className:`size-3.5`})]})]})]}),n&&(0,G.jsx)(ae,{status:n,onSaved:r,onRemove:()=>void g()},`${n.server}/${n.topic}`)]})}export{oe as NotificationsSettingsSection};
@@ -1 +1 @@
1
- import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import{E as r,Kr as i,Sr as a,hr as o,qr as s,xn as c}from"./icons-BwyIKaTT.js";import{k as l,r as u}from"./api-client-xQDlhUTu.js";import{t as d}from"./button-C9ZXWb3b.js";import{t as f}from"./input-C3oVNCMq.js";import{Kn as p}from"./index-BtAn_krv.js";import{t as m}from"./separator-DmU9aJwq.js";import{n as h,r as g}from"./settings-rows-D02_4sDY.js";import{i as _,n as v,r as y,t as b}from"./telegram-bot-token-field-BeNS2X2k.js";var x=e(t(),1),S=n(),C=e=>e instanceof Error?e.message:String(e);function w(e){return e.running?e.botUsername?`Answering as @${e.botUsername}`:`Running`:e.enabled?`Turned on, but not running — check the bot token`:`Off`}function T(){let[e,t]=(0,x.useState)(null),[n,r]=(0,x.useState)(null),[i,o]=(0,x.useState)(!1),f=(0,x.useCallback)(async()=>{try{let e=await u.get(`/api/settings/clawbot/telegram`);return t(e),r(null),e}catch(e){return r(C(e)),null}},[]);(0,x.useEffect)(()=>{f()},[f]);let{link:p,starting:m,connect:T,cancel:E}=_(`/api/settings/clawbot/telegram/connect`,e,f),D=async e=>{o(!0),t(t=>t&&{...t,enabled:e});try{await u.put(`/api/settings/clawbot`,{enabled:e})}catch(t){l.error(e?`Could not turn PPMBot on`:`Could not turn PPMBot off`,{description:C(t)})}finally{o(!1),await f()}},O=async e=>{try{await u.del(`/api/settings/clawbot/paired/${encodeURIComponent(e.chatId)}`),l.success(`Disconnected ${e.name}`,{description:`It can no longer use PPMBot.`})}catch(e){l.error(`Could not disconnect`,{description:C(e)})}finally{await f()}},k=e?.chats??[];return(0,S.jsxs)(`section`,{className:`space-y-3`,children:[(0,S.jsx)(h,{title:`Telegram`,children:`Chat with PPMBot through a Telegram bot of its own. A chat connected here can run tasks on this machine, so connect only your own.`}),n&&(0,S.jsx)(`p`,{className:`text-xs text-error`,children:n}),e?.configured&&(0,S.jsxs)(S.Fragment,{children:[e.sharedWithNotifications&&(0,S.jsxs)(`p`,{className:`flex gap-2 rounded-lg border border-warning/40 px-3 py-2 text-xs leading-relaxed`,children:[(0,S.jsx)(s,{className:`mt-0.5 size-3.5 shrink-0 text-warning`}),(0,S.jsx)(`span`,{children:`Notifications use this bot too, so alerts arrive in your PPMBot chats. Paste a new bot's token below to give PPMBot its own.`})]}),(0,S.jsx)(`div`,{className:`rounded-lg border border-border`,children:(0,S.jsx)(g,{label:`Turn on PPMBot`,note:w(e),checked:e.enabled,disabled:i,onChange:e=>void D(e)})}),k.length>0&&(0,S.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,S.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Chats that can use PPMBot`}),(0,S.jsx)(y,{chats:k,onDisconnect:e=>void O(e)})]}),p?(0,S.jsx)(v,{link:p,botUsername:e.botUsername,error:e.connect.error,onCancel:()=>void E()}):(0,S.jsxs)(d,{onClick:()=>void T(),disabled:m,className:`min-h-11 w-full cursor-pointer gap-2 sm:w-auto md:min-h-9`,children:[m?(0,S.jsx)(c,{className:`size-4 animate-spin`}):(0,S.jsx)(a,{className:`size-4`}),k.length===0?`Connect Telegram`:`Connect another chat`]})]}),e&&!e.configured&&(0,S.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:`Create a new bot for PPMBot rather than reusing the one in Settings → Notifications, so alerts stay out of your PPMBot chats.`}),e&&(0,S.jsx)(b,{endpoint:`/api/settings/clawbot/telegram`,usernameExample:`my_ppm_assistant_bot`,configured:e.configured,botUsername:e.botUsername,onSaved:()=>void f()})]})}function E(){let[e,t]=(0,x.useState)(null),[n,a]=(0,x.useState)(!1),[s,c]=(0,x.useState)(null),[l,h]=(0,x.useState)(``),[g,_]=(0,x.useState)(!0),[v,y]=(0,x.useState)(!1),[b,C]=(0,x.useState)(2e3),[w,E]=(0,x.useState)([]),[D,O]=(0,x.useState)(`_global`),[k,A]=(0,x.useState)([]),j=(0,x.useRef)(void 0),M=(0,x.useCallback)(async(e=D)=>{try{E(await u.get(`/api/settings/clawbot/memories?project=${encodeURIComponent(e)}`))}catch{}},[D]),N=(0,x.useCallback)(async()=>{try{A(await u.get(`/api/settings/clawbot/tasks?limit=20`))}catch{}},[]),P=async e=>{try{await u.del(`/api/settings/clawbot/memories/${e}`),E(t=>t.filter(t=>t.id!==e))}catch{}};(0,x.useEffect)(()=>(u.get(`/api/settings/clawbot`).then(e=>{t(e),h(e.system_prompt),_(e.show_tool_calls),y(e.show_thinking),C(e.debounce_ms)}).catch(()=>{}),M(`_global`),N(),j.current=setInterval(N,1e4),()=>{j.current&&clearInterval(j.current)}),[M,N]);let F=async()=>{a(!0),c(null);try{let e={system_prompt:l,show_tool_calls:g,show_thinking:v,debounce_ms:b};t(await u.put(`/api/settings/clawbot`,e)),c({type:`ok`,msg:`Saved`})}catch(e){c({type:`err`,msg:e.message})}finally{a(!1)}};if(!e)return(0,S.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Loading...`});let I={pending:`⏳`,running:`🔄`,completed:`✅`,failed:`❌`,timeout:`⏱`},L={running:`text-primary`,completed:`text-success`,failed:`text-destructive`,timeout:`text-warning`};return(0,S.jsxs)(`div`,{className:`space-y-4`,children:[(0,S.jsx)(T,{}),(0,S.jsx)(m,{}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,S.jsx)(`p`,{className:`text-xs font-medium`,children:`Delegated Tasks`}),(0,S.jsx)(d,{variant:`ghost`,size:`sm`,className:`h-6 w-6 p-0 cursor-pointer`,onClick:N,children:(0,S.jsx)(o,{className:`size-3`})})]}),k.length===0?(0,S.jsx)(`p`,{className:`text-[10px] text-muted-foreground italic`,children:`No delegated tasks yet. The coordinator will create tasks when you ask it to work on a project.`}):(0,S.jsx)(`div`,{className:`space-y-1 max-h-[200px] overflow-y-auto`,children:k.map(e=>{let t=e.completed_at?`${Math.round((e.completed_at-e.created_at)/60)}m`:`${Math.round((Date.now()/1e3-e.created_at)/60)}m`;return(0,S.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border p-2 text-[11px]`,children:[(0,S.jsx)(`span`,{className:L[e.status]??``,children:I[e.status]??`?`}),(0,S.jsx)(`span`,{className:`font-medium shrink-0`,children:e.project_name}),(0,S.jsx)(`span`,{className:`truncate text-muted-foreground flex-1`,children:e.prompt.slice(0,60)}),(0,S.jsx)(`span`,{className:`text-[10px] text-muted-foreground shrink-0`,children:t})]},e.id)})})]}),(0,S.jsx)(m,{}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,S.jsx)(r,{className:`size-3.5 text-muted-foreground`}),(0,S.jsx)(`p`,{className:`text-xs font-medium`,children:`Memory & Identity`})]}),(0,S.jsx)(d,{variant:`ghost`,size:`sm`,className:`h-6 w-6 p-0 cursor-pointer`,onClick:()=>M(D),children:(0,S.jsx)(o,{className:`size-3`})})]}),(0,S.jsx)(`p`,{className:`text-[10px] text-muted-foreground`,children:`Facts the bot remembers across sessions. Use /remember on Telegram to add, or delete here.`}),w.length===0?(0,S.jsx)(`p`,{className:`text-[10px] text-muted-foreground italic`,children:`No memories stored yet. Send /start on Telegram and introduce yourself.`}):(0,S.jsx)(`div`,{className:`space-y-1 max-h-[200px] overflow-y-auto`,children:w.map(e=>(0,S.jsxs)(`div`,{className:`flex items-start justify-between rounded-md border p-2 gap-1`,children:[(0,S.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,S.jsx)(`p`,{className:`text-[11px] break-words`,children:e.content}),(0,S.jsxs)(`p`,{className:`text-[10px] text-muted-foreground`,children:[e.category,` · `,e.project]})]}),(0,S.jsx)(d,{variant:`ghost`,size:`sm`,className:`h-6 w-6 p-0 text-destructive hover:text-destructive cursor-pointer shrink-0`,onClick:()=>P(e.id),children:(0,S.jsx)(i,{className:`size-3`})})]},e.id))})]}),(0,S.jsx)(m,{}),(0,S.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,S.jsx)(`label`,{className:`text-[11px] text-muted-foreground`,children:`Custom Instructions`}),(0,S.jsx)(`textarea`,{placeholder:`Additional instructions for the coordinator (optional)...`,value:l,onChange:e=>h(e.target.value),className:`flex w-full rounded-md border border-input bg-background px-3 py-2 text-xs min-h-[60px] resize-y ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,rows:3}),(0,S.jsx)(`p`,{className:`text-[10px] text-muted-foreground`,children:`Extra instructions added to the coordinator identity. Leave empty to use defaults from coordinator.md.`})]}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,S.jsx)(`p`,{className:`text-xs`,children:`Show tool calls`}),(0,S.jsx)(p,{checked:g,onCheckedChange:_})]}),(0,S.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,S.jsx)(`p`,{className:`text-xs`,children:`Show thinking`}),(0,S.jsx)(p,{checked:v,onCheckedChange:y})]})]}),(0,S.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,S.jsx)(`label`,{className:`text-[11px] text-muted-foreground`,children:`Debounce (ms)`}),(0,S.jsx)(f,{type:`number`,min:0,max:3e4,step:500,value:b,onChange:e=>C(Number(e.target.value)),className:`h-7 text-xs w-24`}),(0,S.jsx)(`p`,{className:`text-[10px] text-muted-foreground`,children:`Merge rapid messages within this window. 0 = no debounce.`})]}),(0,S.jsx)(d,{variant:`default`,size:`sm`,className:`h-8 text-xs w-full cursor-pointer`,disabled:n,onClick:F,children:n?`Saving...`:`Save`}),s&&(0,S.jsx)(`p`,{className:`text-[11px] ${s.type===`ok`?`text-success`:`text-destructive`}`,children:s.msg})]})}export{E as PPMBotSettingsSection};
1
+ import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import{E as r,Kr as i,Sr as a,hr as o,qr as s,xn as c}from"./icons-BwyIKaTT.js";import{k as l,r as u}from"./api-client-xQDlhUTu.js";import{t as d}from"./button-C9ZXWb3b.js";import{t as f}from"./input-C3oVNCMq.js";import{Kn as p}from"./index-D8QDpdgs.js";import{t as m}from"./separator-DmU9aJwq.js";import{n as h,r as g}from"./settings-rows-C7ZatT9O.js";import{i as _,n as v,r as y,t as b}from"./telegram-bot-token-field-CwW24m62.js";var x=e(t(),1),S=n(),C=e=>e instanceof Error?e.message:String(e);function w(e){return e.running?e.botUsername?`Answering as @${e.botUsername}`:`Running`:e.enabled?`Turned on, but not running — check the bot token`:`Off`}function T(){let[e,t]=(0,x.useState)(null),[n,r]=(0,x.useState)(null),[i,o]=(0,x.useState)(!1),f=(0,x.useCallback)(async()=>{try{let e=await u.get(`/api/settings/clawbot/telegram`);return t(e),r(null),e}catch(e){return r(C(e)),null}},[]);(0,x.useEffect)(()=>{f()},[f]);let{link:p,starting:m,connect:T,cancel:E}=_(`/api/settings/clawbot/telegram/connect`,e,f),D=async e=>{o(!0),t(t=>t&&{...t,enabled:e});try{await u.put(`/api/settings/clawbot`,{enabled:e})}catch(t){l.error(e?`Could not turn PPMBot on`:`Could not turn PPMBot off`,{description:C(t)})}finally{o(!1),await f()}},O=async e=>{try{await u.del(`/api/settings/clawbot/paired/${encodeURIComponent(e.chatId)}`),l.success(`Disconnected ${e.name}`,{description:`It can no longer use PPMBot.`})}catch(e){l.error(`Could not disconnect`,{description:C(e)})}finally{await f()}},k=e?.chats??[];return(0,S.jsxs)(`section`,{className:`space-y-3`,children:[(0,S.jsx)(h,{title:`Telegram`,children:`Chat with PPMBot through a Telegram bot of its own. A chat connected here can run tasks on this machine, so connect only your own.`}),n&&(0,S.jsx)(`p`,{className:`text-xs text-error`,children:n}),e?.configured&&(0,S.jsxs)(S.Fragment,{children:[e.sharedWithNotifications&&(0,S.jsxs)(`p`,{className:`flex gap-2 rounded-lg border border-warning/40 px-3 py-2 text-xs leading-relaxed`,children:[(0,S.jsx)(s,{className:`mt-0.5 size-3.5 shrink-0 text-warning`}),(0,S.jsx)(`span`,{children:`Notifications use this bot too, so alerts arrive in your PPMBot chats. Paste a new bot's token below to give PPMBot its own.`})]}),(0,S.jsx)(`div`,{className:`rounded-lg border border-border`,children:(0,S.jsx)(g,{label:`Turn on PPMBot`,note:w(e),checked:e.enabled,disabled:i,onChange:e=>void D(e)})}),k.length>0&&(0,S.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,S.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Chats that can use PPMBot`}),(0,S.jsx)(y,{chats:k,onDisconnect:e=>void O(e)})]}),p?(0,S.jsx)(v,{link:p,botUsername:e.botUsername,error:e.connect.error,onCancel:()=>void E()}):(0,S.jsxs)(d,{onClick:()=>void T(),disabled:m,className:`min-h-11 w-full cursor-pointer gap-2 sm:w-auto md:min-h-9`,children:[m?(0,S.jsx)(c,{className:`size-4 animate-spin`}):(0,S.jsx)(a,{className:`size-4`}),k.length===0?`Connect Telegram`:`Connect another chat`]})]}),e&&!e.configured&&(0,S.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:`Create a new bot for PPMBot rather than reusing the one in Settings → Notifications, so alerts stay out of your PPMBot chats.`}),e&&(0,S.jsx)(b,{endpoint:`/api/settings/clawbot/telegram`,usernameExample:`my_ppm_assistant_bot`,configured:e.configured,botUsername:e.botUsername,onSaved:()=>void f()})]})}function E(){let[e,t]=(0,x.useState)(null),[n,a]=(0,x.useState)(!1),[s,c]=(0,x.useState)(null),[l,h]=(0,x.useState)(``),[g,_]=(0,x.useState)(!0),[v,y]=(0,x.useState)(!1),[b,C]=(0,x.useState)(2e3),[w,E]=(0,x.useState)([]),[D,O]=(0,x.useState)(`_global`),[k,A]=(0,x.useState)([]),j=(0,x.useRef)(void 0),M=(0,x.useCallback)(async(e=D)=>{try{E(await u.get(`/api/settings/clawbot/memories?project=${encodeURIComponent(e)}`))}catch{}},[D]),N=(0,x.useCallback)(async()=>{try{A(await u.get(`/api/settings/clawbot/tasks?limit=20`))}catch{}},[]),P=async e=>{try{await u.del(`/api/settings/clawbot/memories/${e}`),E(t=>t.filter(t=>t.id!==e))}catch{}};(0,x.useEffect)(()=>(u.get(`/api/settings/clawbot`).then(e=>{t(e),h(e.system_prompt),_(e.show_tool_calls),y(e.show_thinking),C(e.debounce_ms)}).catch(()=>{}),M(`_global`),N(),j.current=setInterval(N,1e4),()=>{j.current&&clearInterval(j.current)}),[M,N]);let F=async()=>{a(!0),c(null);try{let e={system_prompt:l,show_tool_calls:g,show_thinking:v,debounce_ms:b};t(await u.put(`/api/settings/clawbot`,e)),c({type:`ok`,msg:`Saved`})}catch(e){c({type:`err`,msg:e.message})}finally{a(!1)}};if(!e)return(0,S.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Loading...`});let I={pending:`⏳`,running:`🔄`,completed:`✅`,failed:`❌`,timeout:`⏱`},L={running:`text-primary`,completed:`text-success`,failed:`text-destructive`,timeout:`text-warning`};return(0,S.jsxs)(`div`,{className:`space-y-4`,children:[(0,S.jsx)(T,{}),(0,S.jsx)(m,{}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,S.jsx)(`p`,{className:`text-xs font-medium`,children:`Delegated Tasks`}),(0,S.jsx)(d,{variant:`ghost`,size:`sm`,className:`h-6 w-6 p-0 cursor-pointer`,onClick:N,children:(0,S.jsx)(o,{className:`size-3`})})]}),k.length===0?(0,S.jsx)(`p`,{className:`text-[10px] text-muted-foreground italic`,children:`No delegated tasks yet. The coordinator will create tasks when you ask it to work on a project.`}):(0,S.jsx)(`div`,{className:`space-y-1 max-h-[200px] overflow-y-auto`,children:k.map(e=>{let t=e.completed_at?`${Math.round((e.completed_at-e.created_at)/60)}m`:`${Math.round((Date.now()/1e3-e.created_at)/60)}m`;return(0,S.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border p-2 text-[11px]`,children:[(0,S.jsx)(`span`,{className:L[e.status]??``,children:I[e.status]??`?`}),(0,S.jsx)(`span`,{className:`font-medium shrink-0`,children:e.project_name}),(0,S.jsx)(`span`,{className:`truncate text-muted-foreground flex-1`,children:e.prompt.slice(0,60)}),(0,S.jsx)(`span`,{className:`text-[10px] text-muted-foreground shrink-0`,children:t})]},e.id)})})]}),(0,S.jsx)(m,{}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,S.jsx)(r,{className:`size-3.5 text-muted-foreground`}),(0,S.jsx)(`p`,{className:`text-xs font-medium`,children:`Memory & Identity`})]}),(0,S.jsx)(d,{variant:`ghost`,size:`sm`,className:`h-6 w-6 p-0 cursor-pointer`,onClick:()=>M(D),children:(0,S.jsx)(o,{className:`size-3`})})]}),(0,S.jsx)(`p`,{className:`text-[10px] text-muted-foreground`,children:`Facts the bot remembers across sessions. Use /remember on Telegram to add, or delete here.`}),w.length===0?(0,S.jsx)(`p`,{className:`text-[10px] text-muted-foreground italic`,children:`No memories stored yet. Send /start on Telegram and introduce yourself.`}):(0,S.jsx)(`div`,{className:`space-y-1 max-h-[200px] overflow-y-auto`,children:w.map(e=>(0,S.jsxs)(`div`,{className:`flex items-start justify-between rounded-md border p-2 gap-1`,children:[(0,S.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,S.jsx)(`p`,{className:`text-[11px] break-words`,children:e.content}),(0,S.jsxs)(`p`,{className:`text-[10px] text-muted-foreground`,children:[e.category,` · `,e.project]})]}),(0,S.jsx)(d,{variant:`ghost`,size:`sm`,className:`h-6 w-6 p-0 text-destructive hover:text-destructive cursor-pointer shrink-0`,onClick:()=>P(e.id),children:(0,S.jsx)(i,{className:`size-3`})})]},e.id))})]}),(0,S.jsx)(m,{}),(0,S.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,S.jsx)(`label`,{className:`text-[11px] text-muted-foreground`,children:`Custom Instructions`}),(0,S.jsx)(`textarea`,{placeholder:`Additional instructions for the coordinator (optional)...`,value:l,onChange:e=>h(e.target.value),className:`flex w-full rounded-md border border-input bg-background px-3 py-2 text-xs min-h-[60px] resize-y ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,rows:3}),(0,S.jsx)(`p`,{className:`text-[10px] text-muted-foreground`,children:`Extra instructions added to the coordinator identity. Leave empty to use defaults from coordinator.md.`})]}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,S.jsx)(`p`,{className:`text-xs`,children:`Show tool calls`}),(0,S.jsx)(p,{checked:g,onCheckedChange:_})]}),(0,S.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,S.jsx)(`p`,{className:`text-xs`,children:`Show thinking`}),(0,S.jsx)(p,{checked:v,onCheckedChange:y})]})]}),(0,S.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,S.jsx)(`label`,{className:`text-[11px] text-muted-foreground`,children:`Debounce (ms)`}),(0,S.jsx)(f,{type:`number`,min:0,max:3e4,step:500,value:b,onChange:e=>C(Number(e.target.value)),className:`h-7 text-xs w-24`}),(0,S.jsx)(`p`,{className:`text-[10px] text-muted-foreground`,children:`Merge rapid messages within this window. 0 = no debounce.`})]}),(0,S.jsx)(d,{variant:`default`,size:`sm`,className:`h-8 text-xs w-full cursor-pointer`,disabled:n,onClick:F,children:n?`Saving...`:`Save`}),s&&(0,S.jsx)(`p`,{className:`text-[11px] ${s.type===`ok`?`text-success`:`text-destructive`}`,children:s.msg})]})}export{E as PPMBotSettingsSection};
@@ -1 +1 @@
1
- import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import{L as r,P as i,X as a,on as o,pn as s,r as c}from"./icons-BwyIKaTT.js";import"./api-client-xQDlhUTu.js";import{n as l}from"./utils-Bslrbb-G.js";import"./window-store-DqX_qmkQ.js";import{t as u}from"./panel-store-BJhazigC.js";import{i as d}from"./project-store-BLGl9IAO.js";import"./project-framework-store-DwLxaRan.js";import"./session-list-sync-triggers-DtJI5KF0.js";import{n as f}from"./use-is-mobile-VRV9eZy1.js";import{n as p}from"./file-icons-JInFtBVl.js";import{dt as m,ft as h,mt as g,oi as _,pt as v,ut as y}from"./index-BtAn_krv.js";var b=e(t(),1),x=n();function S(){let e=g(_(e=>e.files)),t=d(e=>e.activeProject?.name??null),n=f(),[o,s]=(0,b.useState)(new Set),[S,D]=(0,b.useState)(``),O=(0,b.useMemo)(()=>y(e,t),[e,t]),k=(0,b.useMemo)(()=>{let e=v(O),t=S.trim().toLowerCase();return t?e.map(e=>({...e,diagnostics:e.filePath.toLowerCase().includes(t)?e.diagnostics:e.diagnostics.filter(e=>C(e,t))})).filter(e=>e.diagnostics.length>0):e},[O,S]),A=(0,b.useMemo)(()=>m(O),[O]),j=k.reduce((e,t)=>e+t.diagnostics.length,0);function M(e,t){let{grid:n,focusedPanelId:r,openTab:i}=u.getState(),a=n.flat(),o=a.includes(r)?r:a[0];i({type:`editor`,title:e.filePath.split(`/`).pop()??e.filePath,metadata:{filePath:e.filePath,projectName:e.projectName,lineNumber:t.range.start.line+1},projectId:e.projectName,closable:!0},o)}function N(e){s(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}return Object.keys(O).length===0?(0,x.jsxs)(`div`,{className:`p-4 space-y-2`,children:[(0,x.jsx)(`p`,{className:`text-xs text-text-subtle`,children:`No problems have been detected in the open files.`}),(0,x.jsx)(`p`,{className:`text-[11px] text-text-subtle/70 leading-relaxed`,children:`Diagnostics come from the language server for each file you open, so a file that has never been opened is not checked.`})]}):(0,x.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,x.jsxs)(`div`,{className:`shrink-0 p-2 space-y-2 border-b border-border-soft`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-3 text-[11px] text-text-3`,children:[(0,x.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,x.jsx)(a,{className:`size-3 text-error`}),A.errors]}),(0,x.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,x.jsx)(c,{className:`size-3 text-warning`}),A.warnings]}),(0,x.jsxs)(`span`,{className:`ml-auto text-text-subtle`,children:[k.length,` file`,k.length===1?``:`s`]})]}),(0,x.jsx)(`input`,{value:S,onChange:e=>D(e.target.value),placeholder:`Filter problems`,className:l(`w-full rounded border border-border bg-surface px-2 text-xs outline-none focus:border-primary`,n?`min-h-11`:`py-1`)})]}),(0,x.jsxs)(`div`,{className:`flex-1 overflow-y-auto min-h-0`,children:[j===0&&(0,x.jsxs)(`p`,{className:`p-4 text-xs text-text-subtle`,children:[`No problems match “`,S.trim(),`”.`]}),k.map(e=>{let t=h(e.projectName,e.filePath),a=o.has(t);return(0,x.jsxs)(`div`,{children:[(0,x.jsxs)(`button`,{type:`button`,onClick:()=>N(t),className:l(`w-full flex items-center gap-1 px-2 text-left hover:bg-surface-elevated transition-colors`,n?`min-h-11`:`py-1`),children:[a?(0,x.jsx)(r,{className:`size-3 shrink-0 text-text-subtle`}):(0,x.jsx)(i,{className:`size-3 shrink-0 text-text-subtle`}),(0,x.jsx)(p,{name:e.filePath,className:`size-3.5`}),(0,x.jsx)(`span`,{className:`text-xs truncate`,children:e.filePath.split(`/`).pop()}),(0,x.jsx)(`span`,{className:`text-[10px] text-text-subtle truncate min-w-0`,children:E(e.filePath)}),(0,x.jsx)(`span`,{className:`ml-auto shrink-0 rounded-full bg-surface-elevated px-1.5 text-[10px] text-text-3`,children:e.diagnostics.length})]}),!a&&e.diagnostics.map((t,r)=>(0,x.jsxs)(`button`,{type:`button`,onClick:()=>M(e,t),title:t.message,className:l(`w-full flex items-start gap-1.5 pl-6 pr-2 text-left hover:bg-surface-elevated transition-colors`,n?`min-h-11 py-2`:`py-0.5`),children:[(0,x.jsx)(w,{severity:t.severity}),(0,x.jsx)(`span`,{className:l(`flex-1 min-w-0 text-xs text-text-2`,n?`break-words`:`truncate`),children:t.message}),(0,x.jsxs)(`span`,{className:`shrink-0 text-[10px] text-text-subtle font-mono pt-px`,children:[T(t),t.range.start.line+1,`:`,t.range.start.character+1]})]},`${t.range.start.line}:${t.range.start.character}:${r}`))]},t)})]})]})}function C(e,t){return e.message.toLowerCase().includes(t)||(e.source?.toLowerCase().includes(t)??!1)||String(e.code??``).toLowerCase().includes(t)}function w({severity:e}){return e===2?(0,x.jsx)(c,{className:`size-3 shrink-0 text-warning mt-px`}):e===3?(0,x.jsx)(o,{className:`size-3 shrink-0 text-info mt-px`}):e===4?(0,x.jsx)(s,{className:`size-3 shrink-0 text-text-subtle mt-px`}):(0,x.jsx)(a,{className:`size-3 shrink-0 text-error mt-px`})}function T(e){return e.source?e.code===void 0?`${e.source} `:`${e.source}(${e.code}) `:``}function E(e){let t=e.lastIndexOf(`/`);return t<0?``:e.slice(0,t)}export{S as ProblemsPanel};
1
+ import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import{L as r,P as i,X as a,on as o,pn as s,r as c}from"./icons-BwyIKaTT.js";import"./api-client-xQDlhUTu.js";import{n as l}from"./utils-Bslrbb-G.js";import"./window-store-DqX_qmkQ.js";import{t as u}from"./panel-store-BJhazigC.js";import{i as d}from"./project-store-BLGl9IAO.js";import"./project-framework-store-DwLxaRan.js";import"./session-list-sync-triggers-DtJI5KF0.js";import{n as f}from"./use-is-mobile-VRV9eZy1.js";import{n as p}from"./file-icons-JInFtBVl.js";import{dt as m,ft as h,mt as g,oi as _,pt as v,ut as y}from"./index-D8QDpdgs.js";var b=e(t(),1),x=n();function S(){let e=g(_(e=>e.files)),t=d(e=>e.activeProject?.name??null),n=f(),[o,s]=(0,b.useState)(new Set),[S,D]=(0,b.useState)(``),O=(0,b.useMemo)(()=>y(e,t),[e,t]),k=(0,b.useMemo)(()=>{let e=v(O),t=S.trim().toLowerCase();return t?e.map(e=>({...e,diagnostics:e.filePath.toLowerCase().includes(t)?e.diagnostics:e.diagnostics.filter(e=>C(e,t))})).filter(e=>e.diagnostics.length>0):e},[O,S]),A=(0,b.useMemo)(()=>m(O),[O]),j=k.reduce((e,t)=>e+t.diagnostics.length,0);function M(e,t){let{grid:n,focusedPanelId:r,openTab:i}=u.getState(),a=n.flat(),o=a.includes(r)?r:a[0];i({type:`editor`,title:e.filePath.split(`/`).pop()??e.filePath,metadata:{filePath:e.filePath,projectName:e.projectName,lineNumber:t.range.start.line+1},projectId:e.projectName,closable:!0},o)}function N(e){s(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}return Object.keys(O).length===0?(0,x.jsxs)(`div`,{className:`p-4 space-y-2`,children:[(0,x.jsx)(`p`,{className:`text-xs text-text-subtle`,children:`No problems have been detected in the open files.`}),(0,x.jsx)(`p`,{className:`text-[11px] text-text-subtle/70 leading-relaxed`,children:`Diagnostics come from the language server for each file you open, so a file that has never been opened is not checked.`})]}):(0,x.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,x.jsxs)(`div`,{className:`shrink-0 p-2 space-y-2 border-b border-border-soft`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-3 text-[11px] text-text-3`,children:[(0,x.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,x.jsx)(a,{className:`size-3 text-error`}),A.errors]}),(0,x.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,x.jsx)(c,{className:`size-3 text-warning`}),A.warnings]}),(0,x.jsxs)(`span`,{className:`ml-auto text-text-subtle`,children:[k.length,` file`,k.length===1?``:`s`]})]}),(0,x.jsx)(`input`,{value:S,onChange:e=>D(e.target.value),placeholder:`Filter problems`,className:l(`w-full rounded border border-border bg-surface px-2 text-xs outline-none focus:border-primary`,n?`min-h-11`:`py-1`)})]}),(0,x.jsxs)(`div`,{className:`flex-1 overflow-y-auto min-h-0`,children:[j===0&&(0,x.jsxs)(`p`,{className:`p-4 text-xs text-text-subtle`,children:[`No problems match “`,S.trim(),`”.`]}),k.map(e=>{let t=h(e.projectName,e.filePath),a=o.has(t);return(0,x.jsxs)(`div`,{children:[(0,x.jsxs)(`button`,{type:`button`,onClick:()=>N(t),className:l(`w-full flex items-center gap-1 px-2 text-left hover:bg-surface-elevated transition-colors`,n?`min-h-11`:`py-1`),children:[a?(0,x.jsx)(r,{className:`size-3 shrink-0 text-text-subtle`}):(0,x.jsx)(i,{className:`size-3 shrink-0 text-text-subtle`}),(0,x.jsx)(p,{name:e.filePath,className:`size-3.5`}),(0,x.jsx)(`span`,{className:`text-xs truncate`,children:e.filePath.split(`/`).pop()}),(0,x.jsx)(`span`,{className:`text-[10px] text-text-subtle truncate min-w-0`,children:E(e.filePath)}),(0,x.jsx)(`span`,{className:`ml-auto shrink-0 rounded-full bg-surface-elevated px-1.5 text-[10px] text-text-3`,children:e.diagnostics.length})]}),!a&&e.diagnostics.map((t,r)=>(0,x.jsxs)(`button`,{type:`button`,onClick:()=>M(e,t),title:t.message,className:l(`w-full flex items-start gap-1.5 pl-6 pr-2 text-left hover:bg-surface-elevated transition-colors`,n?`min-h-11 py-2`:`py-0.5`),children:[(0,x.jsx)(w,{severity:t.severity}),(0,x.jsx)(`span`,{className:l(`flex-1 min-w-0 text-xs text-text-2`,n?`break-words`:`truncate`),children:t.message}),(0,x.jsxs)(`span`,{className:`shrink-0 text-[10px] text-text-subtle font-mono pt-px`,children:[T(t),t.range.start.line+1,`:`,t.range.start.character+1]})]},`${t.range.start.line}:${t.range.start.character}:${r}`))]},t)})]})]})}function C(e,t){return e.message.toLowerCase().includes(t)||(e.source?.toLowerCase().includes(t)??!1)||String(e.code??``).toLowerCase().includes(t)}function w({severity:e}){return e===2?(0,x.jsx)(c,{className:`size-3 shrink-0 text-warning mt-px`}):e===3?(0,x.jsx)(o,{className:`size-3 shrink-0 text-info mt-px`}):e===4?(0,x.jsx)(s,{className:`size-3 shrink-0 text-text-subtle mt-px`}):(0,x.jsx)(a,{className:`size-3 shrink-0 text-error mt-px`})}function T(e){return e.source?e.code===void 0?`${e.source} `:`${e.source}(${e.code}) `:``}function E(e){let t=e.lastIndexOf(`/`);return t<0?``:e.slice(0,t)}export{S as ProblemsPanel};