@hienlh/ppm 0.25.8 → 0.25.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/CLAUDE.md +2 -1
- package/assets/skills/ppm/SKILL.md +1 -1
- package/assets/skills/ppm/references/http-api.md +5 -1
- package/dist/web/assets/{accounts-settings-section-CJpMzwRN.js → accounts-settings-section-DhBlsQzP.js} +1 -1
- package/dist/web/assets/accounts-settings-section-DhBlsQzP.js.br +0 -0
- package/dist/web/assets/accounts-settings-section-DhBlsQzP.js.gz +0 -0
- package/dist/web/assets/{agent-session-sheet-FInwTnf_.js → agent-session-sheet-2HfUDC-0.js} +2 -2
- package/dist/web/assets/agent-session-sheet-2HfUDC-0.js.br +0 -0
- package/dist/web/assets/agent-session-sheet-2HfUDC-0.js.gz +0 -0
- package/dist/web/assets/{agent-session-window-content-Ct6ZHTtp.js → agent-session-window-content-D37AX2th.js} +1 -1
- package/dist/web/assets/agent-session-window-content-D37AX2th.js.br +0 -0
- package/dist/web/assets/agent-session-window-content-D37AX2th.js.gz +0 -0
- package/dist/web/assets/{ai-resource-editor-CNhRBVzA.js → ai-resource-editor-DgkupdEI.js} +1 -1
- package/dist/web/assets/ai-resource-editor-DgkupdEI.js.br +0 -0
- package/dist/web/assets/ai-resource-editor-DgkupdEI.js.gz +0 -0
- package/dist/web/assets/{ai-settings-section-BuEmNuZv.js → ai-settings-section-Bs_mVtS1.js} +1 -1
- package/dist/web/assets/ai-settings-section-Bs_mVtS1.js.br +0 -0
- package/dist/web/assets/ai-settings-section-Bs_mVtS1.js.gz +0 -0
- package/dist/web/assets/{ai-settings-section-BGocvC5p.js → ai-settings-section-Ck4dnd02.js} +1 -1
- package/dist/web/assets/ai-settings-section-Ck4dnd02.js.br +0 -0
- package/dist/web/assets/ai-settings-section-Ck4dnd02.js.gz +0 -0
- package/dist/web/assets/{android-tab-BbqO4tTg.js → android-tab-BpxQioxH.js} +1 -1
- package/dist/web/assets/android-tab-BpxQioxH.js.br +0 -0
- package/dist/web/assets/android-tab-BpxQioxH.js.gz +0 -0
- package/dist/web/assets/{antigravity-usage-view-BBxDn7OP.js → antigravity-usage-view-xdhN5XdB.js} +1 -1
- package/dist/web/assets/antigravity-usage-view-xdhN5XdB.js.br +0 -0
- package/dist/web/assets/antigravity-usage-view-xdhN5XdB.js.gz +0 -0
- package/dist/web/assets/{appearance-settings-section-CAh8nPhs.js → appearance-settings-section-DOaGMSCI.js} +1 -1
- package/dist/web/assets/appearance-settings-section-DOaGMSCI.js.br +0 -0
- package/dist/web/assets/appearance-settings-section-DOaGMSCI.js.gz +0 -0
- package/dist/web/assets/{apps-panel-Dof7DwAj.js → apps-panel-DRpPppmQ.js} +1 -1
- package/dist/web/assets/apps-panel-DRpPppmQ.js.br +0 -0
- package/dist/web/assets/apps-panel-DRpPppmQ.js.gz +0 -0
- package/dist/web/assets/{assistant-name-store-D5teXZ9K.js → assistant-name-store-DSoH_0w2.js} +1 -1
- package/dist/web/assets/assistant-name-store-DSoH_0w2.js.br +0 -0
- package/dist/web/assets/assistant-name-store-DSoH_0w2.js.gz +0 -0
- package/dist/web/assets/{assistant-settings-BvOjO9ir.js → assistant-settings-DjNfKU_I.js} +1 -1
- package/dist/web/assets/assistant-settings-DjNfKU_I.js.br +0 -0
- package/dist/web/assets/assistant-settings-DjNfKU_I.js.gz +0 -0
- package/dist/web/assets/{assistant-settings-section-DDFHPVIR.js → assistant-settings-section-CspPAsYK.js} +1 -1
- package/dist/web/assets/assistant-settings-section-CspPAsYK.js.br +0 -0
- package/dist/web/assets/assistant-settings-section-CspPAsYK.js.gz +0 -0
- package/dist/web/assets/{assistant-tab-CFDxGZDa.js → assistant-tab-B-nFPdEz.js} +1 -1
- package/dist/web/assets/assistant-tab-B-nFPdEz.js.br +0 -0
- package/dist/web/assets/assistant-tab-B-nFPdEz.js.gz +0 -0
- package/dist/web/assets/{background-output-store-CYu95pMo.js → background-output-store-Cqsu1Pe8.js} +1 -1
- package/dist/web/assets/background-output-store-Cqsu1Pe8.js.br +0 -0
- package/dist/web/assets/background-output-store-Cqsu1Pe8.js.gz +0 -0
- package/dist/web/assets/{branch-review-tab-DmD06w26.js → branch-review-tab-WfOaOP_G.js} +1 -1
- package/dist/web/assets/branch-review-tab-WfOaOP_G.js.br +0 -0
- package/dist/web/assets/branch-review-tab-WfOaOP_G.js.gz +0 -0
- package/dist/web/assets/{build-message-with-attachments-CaOUFGji.js → build-message-with-attachments-Ct69HqZU.js} +1 -1
- package/dist/web/assets/build-message-with-attachments-Ct69HqZU.js.br +0 -0
- package/dist/web/assets/build-message-with-attachments-Ct69HqZU.js.gz +0 -0
- package/dist/web/assets/chat-tab-DVqxIrOQ.js +1 -0
- package/dist/web/assets/chat-tab-DVqxIrOQ.js.br +0 -0
- package/dist/web/assets/chat-tab-DVqxIrOQ.js.gz +0 -0
- package/dist/web/assets/{chat-tab-BfB-YkvJ.js → chat-tab-HgJWDRBc.js} +7 -7
- package/dist/web/assets/chat-tab-HgJWDRBc.js.br +0 -0
- package/dist/web/assets/chat-tab-HgJWDRBc.js.gz +0 -0
- package/dist/web/assets/{close-window-xumIsJ3C.js → close-window-Dq__FGE2.js} +1 -1
- package/dist/web/assets/{code-editor-wq1uUv3e.js → code-editor-BaR3rDbO.js} +4 -4
- package/dist/web/assets/code-editor-BaR3rDbO.js.br +0 -0
- package/dist/web/assets/code-editor-BaR3rDbO.js.gz +0 -0
- package/dist/web/assets/{conflict-editor-3dvOYhsg.js → conflict-editor-nXN6-RxH.js} +1 -1
- package/dist/web/assets/conflict-editor-nXN6-RxH.js.br +0 -0
- package/dist/web/assets/conflict-editor-nXN6-RxH.js.gz +0 -0
- package/dist/web/assets/{connection-form-tab--411MxSo.js → connection-form-tab-D92Gz678.js} +1 -1
- package/dist/web/assets/connection-form-tab-D92Gz678.js.br +0 -0
- package/dist/web/assets/connection-form-tab-D92Gz678.js.gz +0 -0
- package/dist/web/assets/{csv-preview-B8kSkU3R.js → csv-preview-lwYkZ9cg.js} +1 -1
- package/dist/web/assets/csv-preview-lwYkZ9cg.js.br +0 -0
- package/dist/web/assets/csv-preview-lwYkZ9cg.js.gz +0 -0
- package/dist/web/assets/{database-drivers-section-BRIzMorf.js → database-drivers-section-CltuRsxs.js} +1 -1
- package/dist/web/assets/database-drivers-section-CltuRsxs.js.br +0 -0
- package/dist/web/assets/database-drivers-section-CltuRsxs.js.gz +0 -0
- package/dist/web/assets/{db-connection-config-sCgRWO6g.js → db-connection-config-BHSrmiMw.js} +1 -1
- package/dist/web/assets/db-connection-config-BHSrmiMw.js.br +0 -0
- package/dist/web/assets/db-connection-config-BHSrmiMw.js.gz +0 -0
- package/dist/web/assets/{db-explorer-store-DIVU5YE1.js → db-explorer-store-DAKKs0KL.js} +1 -1
- package/dist/web/assets/db-explorer-store-DAKKs0KL.js.br +0 -0
- package/dist/web/assets/db-explorer-store-DAKKs0KL.js.gz +0 -0
- package/dist/web/assets/{db-tab-parts-Db6dNGCV.js → db-tab-parts-Dy3kOGYH.js} +1 -1
- package/dist/web/assets/db-tab-parts-Dy3kOGYH.js.br +0 -0
- package/dist/web/assets/db-tab-parts-Dy3kOGYH.js.gz +0 -0
- package/dist/web/assets/{design-settings-section-DTWDBysp.js → design-settings-section-jPJjJWJh.js} +1 -1
- package/dist/web/assets/design-settings-section-jPJjJWJh.js.br +0 -0
- package/dist/web/assets/design-settings-section-jPJjJWJh.js.gz +0 -0
- package/dist/web/assets/{design-tab-DzFFWqgU.js → design-tab-CGW8BijH.js} +1 -1
- package/dist/web/assets/design-tab-CGW8BijH.js.br +0 -0
- package/dist/web/assets/design-tab-CGW8BijH.js.gz +0 -0
- package/dist/web/assets/{designs-sidebar-panel-MPtHF-kA.js → designs-sidebar-panel-QrVE8jSE.js} +1 -1
- package/dist/web/assets/designs-sidebar-panel-QrVE8jSE.js.br +0 -0
- package/dist/web/assets/designs-sidebar-panel-QrVE8jSE.js.gz +0 -0
- package/dist/web/assets/{diff-viewer-6H5Jl2t8.js → diff-viewer-CCQdWctH.js} +1 -1
- package/dist/web/assets/diff-viewer-CCQdWctH.js.br +0 -0
- package/dist/web/assets/diff-viewer-CCQdWctH.js.gz +0 -0
- package/dist/web/assets/{docx-preview-Bhk0VwBH.js → docx-preview-CVU5A7EZ.js} +1 -1
- package/dist/web/assets/docx-preview-CVU5A7EZ.js.br +0 -0
- package/dist/web/assets/docx-preview-CVU5A7EZ.js.gz +0 -0
- package/dist/web/assets/{editor-dialog-C3yeHsGp.js → editor-dialog-6ncYhc1Z.js} +1 -1
- package/dist/web/assets/editor-dialog-6ncYhc1Z.js.br +0 -0
- package/dist/web/assets/editor-dialog-6ncYhc1Z.js.gz +0 -0
- package/dist/web/assets/{editor-language-service-BKV35pp_.js → editor-language-service-ChXwk6wX.js} +1 -1
- package/dist/web/assets/editor-language-service-ChXwk6wX.js.br +0 -0
- package/dist/web/assets/editor-language-service-ChXwk6wX.js.gz +0 -0
- package/dist/web/assets/{explorer-body-CX65jdUB.js → explorer-body-7Br-CQoY.js} +1 -1
- package/dist/web/assets/explorer-body-7Br-CQoY.js.br +0 -0
- package/dist/web/assets/explorer-body-7Br-CQoY.js.gz +0 -0
- package/dist/web/assets/{explorer-model-CHQNPtY-.js → explorer-model-RlqYdmjO.js} +1 -1
- package/dist/web/assets/explorer-model-RlqYdmjO.js.br +0 -0
- package/dist/web/assets/explorer-model-RlqYdmjO.js.gz +0 -0
- package/dist/web/assets/{explorer-window-content-DSY92TDq.js → explorer-window-content-4vGpVPQM.js} +1 -1
- package/dist/web/assets/explorer-window-content-4vGpVPQM.js.br +0 -0
- package/dist/web/assets/explorer-window-content-4vGpVPQM.js.gz +0 -0
- package/dist/web/assets/{extension-manager-section-BipKy2Rw.js → extension-manager-section-CanZCuQR.js} +1 -1
- package/dist/web/assets/extension-manager-section-CanZCuQR.js.br +0 -0
- package/dist/web/assets/extension-manager-section-CanZCuQR.js.gz +0 -0
- package/dist/web/assets/{extension-webview-DFWHAUUH.js → extension-webview-ARXd_mtd.js} +1 -1
- package/dist/web/assets/extension-webview-ARXd_mtd.js.br +0 -0
- package/dist/web/assets/extension-webview-ARXd_mtd.js.gz +0 -0
- package/dist/web/assets/{files-settings-section-BDrlGgwW.js → files-settings-section-Cib0msno.js} +1 -1
- package/dist/web/assets/files-settings-section-Cib0msno.js.br +0 -0
- package/dist/web/assets/files-settings-section-Cib0msno.js.gz +0 -0
- package/dist/web/assets/{general-settings-section-CHVQSPfM.js → general-settings-section-BN6oaQ92.js} +1 -1
- package/dist/web/assets/general-settings-section-BN6oaQ92.js.br +0 -0
- package/dist/web/assets/general-settings-section-BN6oaQ92.js.gz +0 -0
- package/dist/web/assets/{git-log-panel-1v7JOQMr.js → git-log-panel-eXoJomtc.js} +1 -1
- package/dist/web/assets/git-log-panel-eXoJomtc.js.br +0 -0
- package/dist/web/assets/git-log-panel-eXoJomtc.js.gz +0 -0
- package/dist/web/assets/{git-review-tab-DwB7zqOw.js → git-review-tab-BiD3RJB8.js} +1 -1
- package/dist/web/assets/git-review-tab-BiD3RJB8.js.br +0 -0
- package/dist/web/assets/git-review-tab-BiD3RJB8.js.gz +0 -0
- package/dist/web/assets/{glide-data-grid-CL9ERRkH.js → glide-data-grid-Bz-vsE_o.js} +1 -1
- package/dist/web/assets/glide-data-grid-Bz-vsE_o.js.br +0 -0
- package/dist/web/assets/glide-data-grid-Bz-vsE_o.js.gz +0 -0
- package/dist/web/assets/{grid-save-dialog-CK2kug73.js → grid-save-dialog-CPRtoshz.js} +1 -1
- package/dist/web/assets/grid-save-dialog-CPRtoshz.js.br +0 -0
- package/dist/web/assets/grid-save-dialog-CPRtoshz.js.gz +0 -0
- package/dist/web/assets/{group-chat-tab-CRtOsmm6.js → group-chat-tab-CeWhfzpc.js} +1 -1
- package/dist/web/assets/group-chat-tab-CeWhfzpc.js.br +0 -0
- package/dist/web/assets/group-chat-tab-CeWhfzpc.js.gz +0 -0
- package/dist/web/assets/{impexp-tab-D7iyg3Xr.js → impexp-tab-CHTpOlnv.js} +1 -1
- package/dist/web/assets/impexp-tab-CHTpOlnv.js.br +0 -0
- package/dist/web/assets/impexp-tab-CHTpOlnv.js.gz +0 -0
- package/dist/web/assets/index--wNHkCER.css +1 -0
- package/dist/web/assets/index--wNHkCER.css.br +0 -0
- package/dist/web/assets/index--wNHkCER.css.gz +0 -0
- package/dist/web/assets/{index-rFeA9cN0.js → index-Dh1mYjGB.js} +6 -6
- package/dist/web/assets/index-Dh1mYjGB.js.br +0 -0
- package/dist/web/assets/index-Dh1mYjGB.js.gz +0 -0
- package/dist/web/assets/{jira-watcher-section-BoYMt11_.js → jira-watcher-section-O1pqq3r-.js} +1 -1
- package/dist/web/assets/{keyboard-shortcuts-section-BDTcp2Mp.js → keyboard-shortcuts-section-BkM6WVw7.js} +1 -1
- package/dist/web/assets/keyboard-shortcuts-section-BkM6WVw7.js.br +0 -0
- package/dist/web/assets/keyboard-shortcuts-section-BkM6WVw7.js.gz +0 -0
- package/dist/web/assets/{language-servers-section-D4ohb6fF.js → language-servers-section-C30YGy0O.js} +2 -2
- package/dist/web/assets/language-servers-section-C30YGy0O.js.br +0 -0
- package/dist/web/assets/language-servers-section-C30YGy0O.js.gz +0 -0
- package/dist/web/assets/{logs-app-DTLXuUwz.js → logs-app-APP6HqFH.js} +1 -1
- package/dist/web/assets/logs-app-APP6HqFH.js.br +0 -0
- package/dist/web/assets/logs-app-APP6HqFH.js.gz +0 -0
- package/dist/web/assets/logs-tab-CtIfyNVb.js +1 -0
- package/dist/web/assets/{logs-window-content-BQg5LdB4.js → logs-window-content-DK-vD9MT.js} +1 -1
- package/dist/web/assets/{lsp-client-DbxW8RE8.js → lsp-client-BxakJW6N.js} +1 -1
- package/dist/web/assets/lsp-client-BxakJW6N.js.br +0 -0
- package/dist/web/assets/lsp-client-BxakJW6N.js.gz +0 -0
- package/dist/web/assets/markdown-renderer-DFsnIuyJ.js +1 -0
- package/dist/web/assets/markdown-renderer-DFsnIuyJ.js.br +0 -0
- package/dist/web/assets/markdown-renderer-DFsnIuyJ.js.gz +0 -0
- package/dist/web/assets/{markdown-renderer-EpZgAvPW.js → markdown-renderer-zFXR5DWA.js} +1 -1
- package/dist/web/assets/markdown-renderer-zFXR5DWA.js.br +0 -0
- package/dist/web/assets/markdown-renderer-zFXR5DWA.js.gz +0 -0
- package/dist/web/assets/{mobile-explorer-sheet-2gso3b7e.js → mobile-explorer-sheet-COJvYEed.js} +1 -1
- package/dist/web/assets/mobile-explorer-sheet-COJvYEed.js.br +0 -0
- package/dist/web/assets/mobile-explorer-sheet-COJvYEed.js.gz +0 -0
- package/dist/web/assets/{model-thinking-selector-helpers-BR5Y_oCs.js → model-thinking-selector-helpers-Dn3xr9jh.js} +1 -1
- package/dist/web/assets/model-thinking-selector-helpers-Dn3xr9jh.js.br +0 -0
- package/dist/web/assets/model-thinking-selector-helpers-Dn3xr9jh.js.gz +0 -0
- package/dist/web/assets/{new-design-dialog-Djulr0aD.js → new-design-dialog-Dz-RwGZ8.js} +1 -1
- package/dist/web/assets/new-design-dialog-Dz-RwGZ8.js.br +0 -0
- package/dist/web/assets/new-design-dialog-Dz-RwGZ8.js.gz +0 -0
- package/dist/web/assets/{notifications-settings-section-C5VPaRfs.js → notifications-settings-section-DGgHD7TI.js} +1 -1
- package/dist/web/assets/notifications-settings-section-DGgHD7TI.js.br +0 -0
- package/dist/web/assets/notifications-settings-section-DGgHD7TI.js.gz +0 -0
- package/dist/web/assets/{onboarding-entry-B6iyOCP1.js → onboarding-entry-DSHiWY-1.js} +1 -1
- package/dist/web/assets/onboarding-entry-DSHiWY-1.js.br +0 -0
- package/dist/web/assets/onboarding-entry-DSHiWY-1.js.gz +0 -0
- package/dist/web/assets/{open-assistant-B3VjLarr.js → open-assistant-DFwSXZhe.js} +1 -1
- package/dist/web/assets/open-assistant-DFwSXZhe.js.br +0 -0
- package/dist/web/assets/open-assistant-DFwSXZhe.js.gz +0 -0
- package/dist/web/assets/open-assistant-Dpnb3wdw.js +1 -0
- package/dist/web/assets/{open-db-tabs-CZCVwLtY.js → open-db-tabs-CBwb8PII.js} +1 -1
- package/dist/web/assets/open-db-tabs-CBwb8PII.js.br +0 -0
- package/dist/web/assets/open-db-tabs-CBwb8PII.js.gz +0 -0
- package/dist/web/assets/{open-logs-B8h-9fK0.js → open-logs-DeqC63FG.js} +1 -1
- package/dist/web/assets/open-manager-chat-Bz5dVmhs.js +1 -0
- package/dist/web/assets/{open-manager-chat-AREyrwCV.js → open-manager-chat-Cjyg1epx.js} +1 -1
- package/dist/web/assets/open-manager-chat-Cjyg1epx.js.br +0 -0
- package/dist/web/assets/open-manager-chat-Cjyg1epx.js.gz +0 -0
- package/dist/web/assets/{open-ppm-tab-Ycg95vdE.js → open-ppm-tab-CsbF9oE1.js} +1 -1
- package/dist/web/assets/open-ppm-tab-CsbF9oE1.js.br +0 -0
- package/dist/web/assets/open-ppm-tab-CsbF9oE1.js.gz +0 -0
- package/dist/web/assets/{open-settings-BJGUPvOw.js → open-settings-B4ZjUYGC.js} +1 -1
- package/dist/web/assets/{open-settings-kdMfXpHq.js → open-settings-BhfeWCNQ.js} +1 -1
- package/dist/web/assets/{panel-store-CBSQTnq9.js → panel-store-C8BMiE6r.js} +1 -1
- package/dist/web/assets/panel-store-C8BMiE6r.js.br +0 -0
- package/dist/web/assets/panel-store-C8BMiE6r.js.gz +0 -0
- package/dist/web/assets/{patch-tab-metadata-jquPSDfD.js → patch-tab-metadata-Dedq9hZv.js} +1 -1
- package/dist/web/assets/{performance-panel-vtfFrYmB.js → performance-panel-CCQnvwJ7.js} +1 -1
- package/dist/web/assets/performance-panel-CCQnvwJ7.js.br +0 -0
- package/dist/web/assets/performance-panel-CCQnvwJ7.js.gz +0 -0
- package/dist/web/assets/{ppm-tools-DkXwX2Et.js → ppm-tools-BPerUg3f.js} +1 -1
- package/dist/web/assets/ppm-tools-BPerUg3f.js.br +0 -0
- package/dist/web/assets/ppm-tools-BPerUg3f.js.gz +0 -0
- package/dist/web/assets/{problems-panel-ty4WAeub.js → problems-panel-VmQUHLZv.js} +1 -1
- package/dist/web/assets/problems-panel-VmQUHLZv.js.br +0 -0
- package/dist/web/assets/problems-panel-VmQUHLZv.js.gz +0 -0
- package/dist/web/assets/{process-table-Dk-9ohXl.js → process-table-DPuXZ6CK.js} +1 -1
- package/dist/web/assets/process-table-DPuXZ6CK.js.br +0 -0
- package/dist/web/assets/process-table-DPuXZ6CK.js.gz +0 -0
- package/dist/web/assets/{proxy-settings-section-CpmKuU96.js → proxy-settings-section-DdPyGg2u.js} +1 -1
- package/dist/web/assets/proxy-settings-section-DdPyGg2u.js.br +0 -0
- package/dist/web/assets/proxy-settings-section-DdPyGg2u.js.gz +0 -0
- package/dist/web/assets/{query-tab-BRkozohy.js → query-tab-BXbngz82.js} +1 -1
- package/dist/web/assets/query-tab-BXbngz82.js.br +0 -0
- package/dist/web/assets/query-tab-BXbngz82.js.gz +0 -0
- package/dist/web/assets/release-notes-window-content-C-PC0q7L.js +1 -0
- package/dist/web/assets/{remote-access-settings-section-C40hJCpz.js → remote-access-settings-section-D1R8jvN9.js} +1 -1
- package/dist/web/assets/remote-access-settings-section-D1R8jvN9.js.br +0 -0
- package/dist/web/assets/remote-access-settings-section-D1R8jvN9.js.gz +0 -0
- package/dist/web/assets/{remote-access-tab-store-DxDHebNj.js → remote-access-tab-store-CG1VJnPs.js} +1 -1
- package/dist/web/assets/{remote-desktop-clipboard-notice-DBKfzIao.js → remote-desktop-clipboard-notice-B0MnrjM4.js} +1 -1
- package/dist/web/assets/remote-desktop-clipboard-notice-B0MnrjM4.js.br +0 -0
- package/dist/web/assets/remote-desktop-clipboard-notice-B0MnrjM4.js.gz +0 -0
- package/dist/web/assets/{remote-desktop-mobile-sheet-DH12hzq0.js → remote-desktop-mobile-sheet-D38sSjuc.js} +2 -2
- package/dist/web/assets/remote-desktop-mobile-sheet-D38sSjuc.js.br +0 -0
- package/dist/web/assets/remote-desktop-mobile-sheet-D38sSjuc.js.gz +0 -0
- package/dist/web/assets/{remote-desktop-mobile-view-G7lonBBK.js → remote-desktop-mobile-view-D-pa1C4C.js} +1 -1
- package/dist/web/assets/remote-desktop-mobile-view-D-pa1C4C.js.br +0 -0
- package/dist/web/assets/remote-desktop-mobile-view-D-pa1C4C.js.gz +0 -0
- package/dist/web/assets/{remote-desktop-readiness-gate-CEnwbi9-.js → remote-desktop-readiness-gate-DCpDGAtF.js} +1 -1
- package/dist/web/assets/remote-desktop-readiness-gate-DCpDGAtF.js.br +0 -0
- package/dist/web/assets/remote-desktop-readiness-gate-DCpDGAtF.js.gz +0 -0
- package/dist/web/assets/{remote-desktop-window-content-DRoq0Doz.js → remote-desktop-window-content-CKHxtiHU.js} +1 -1
- package/dist/web/assets/remote-desktop-window-content-CKHxtiHU.js.br +0 -0
- package/dist/web/assets/remote-desktop-window-content-CKHxtiHU.js.gz +0 -0
- package/dist/web/assets/{rename-object-dialog-B4_M7kq7.js → rename-object-dialog-1taaGARn.js} +1 -1
- package/dist/web/assets/rename-object-dialog-1taaGARn.js.br +0 -0
- package/dist/web/assets/rename-object-dialog-1taaGARn.js.gz +0 -0
- package/dist/web/assets/{review-address-setup-Dr0-k8Ii.js → review-address-setup-BRFEv3UA.js} +1 -1
- package/dist/web/assets/review-address-setup-BRFEv3UA.js.br +0 -0
- package/dist/web/assets/review-address-setup-BRFEv3UA.js.gz +0 -0
- package/dist/web/assets/{review-code-BiqpKBwR.js → review-code-A6WVkP7z.js} +1 -1
- package/dist/web/assets/review-code-A6WVkP7z.js.br +0 -0
- package/dist/web/assets/review-code-A6WVkP7z.js.gz +0 -0
- package/dist/web/assets/{run-in-terminal-sraD6sWh.js → run-in-terminal-BnEB05OP.js} +1 -1
- package/dist/web/assets/{run-in-terminal-button-BFs3ncra.js → run-in-terminal-button-BJ3UIUws.js} +1 -1
- package/dist/web/assets/{save-as-dialog-DNBlWN4R.js → save-as-dialog-BMv5KHbl.js} +1 -1
- package/dist/web/assets/save-as-dialog-BMv5KHbl.js.br +0 -0
- package/dist/web/assets/save-as-dialog-BMv5KHbl.js.gz +0 -0
- package/dist/web/assets/{schedule-script-editor-JYIGILyl.js → schedule-script-editor-CuLx2MPo.js} +1 -1
- package/dist/web/assets/schedule-script-editor-CuLx2MPo.js.br +0 -0
- package/dist/web/assets/schedule-script-editor-CuLx2MPo.js.gz +0 -0
- package/dist/web/assets/{schedules-settings-section-BqKUZ8se.js → schedules-settings-section-BGcUBTRM.js} +3 -3
- package/dist/web/assets/schedules-settings-section-BGcUBTRM.js.br +0 -0
- package/dist/web/assets/schedules-settings-section-BGcUBTRM.js.gz +0 -0
- package/dist/web/assets/{send-to-chat-bbnVuPiz.js → send-to-chat-B06CjX1D.js} +1 -1
- package/dist/web/assets/send-to-chat-B06CjX1D.js.br +0 -0
- package/dist/web/assets/send-to-chat-B06CjX1D.js.gz +0 -0
- package/dist/web/assets/{session-changes-chip-DfOeZz3v.js → session-changes-chip-68_naS4f.js} +1 -1
- package/dist/web/assets/session-changes-chip-68_naS4f.js.br +0 -0
- package/dist/web/assets/session-changes-chip-68_naS4f.js.gz +0 -0
- package/dist/web/assets/session-collab-9n55N5Yi.js +1 -0
- package/dist/web/assets/{session-collab-client-DOUeHjr_.js → session-collab-client-C4uwh8A0.js} +2 -2
- package/dist/web/assets/session-collab-client-C4uwh8A0.js.br +0 -0
- package/dist/web/assets/session-collab-client-C4uwh8A0.js.gz +0 -0
- package/dist/web/assets/{session-review-tab-BZ3jPhrf.js → session-review-tab-BdH44KcC.js} +1 -1
- package/dist/web/assets/session-review-tab-BdH44KcC.js.br +0 -0
- package/dist/web/assets/session-review-tab-BdH44KcC.js.gz +0 -0
- package/dist/web/assets/{session-turns-Bl6ccivQ.js → session-turns-DEshbSCb.js} +1 -1
- package/dist/web/assets/session-turns-DEshbSCb.js.br +0 -0
- package/dist/web/assets/session-turns-DEshbSCb.js.gz +0 -0
- package/dist/web/assets/{settings-body-OVphMQRm.js → settings-body-BYkCIY46.js} +1 -1
- package/dist/web/assets/settings-body-BYkCIY46.js.br +0 -0
- package/dist/web/assets/settings-body-BYkCIY46.js.gz +0 -0
- package/dist/web/assets/{settings-rows-BqVoWUah.js → settings-rows-BABnqdiK.js} +1 -1
- package/dist/web/assets/settings-rows-BABnqdiK.js.br +0 -0
- package/dist/web/assets/settings-rows-BABnqdiK.js.gz +0 -0
- package/dist/web/assets/{settings-section-content-Dv75IMdD.js → settings-section-content-DoJCTLK4.js} +1 -1
- package/dist/web/assets/{settings-section-content-BOGhX0Gc.js → settings-section-content-lSCLLiRK.js} +2 -2
- package/dist/web/assets/settings-section-content-lSCLLiRK.js.br +0 -0
- package/dist/web/assets/settings-section-content-lSCLLiRK.js.gz +0 -0
- package/dist/web/assets/{settings-store-DbEIO8Ou.js → settings-store-DjuCPpqK.js} +1 -1
- package/dist/web/assets/settings-store-DjuCPpqK.js.br +0 -0
- package/dist/web/assets/settings-store-DjuCPpqK.js.gz +0 -0
- package/dist/web/assets/{settings-tab-omkNFzAB.js → settings-tab-BSQfIEPz.js} +1 -1
- package/dist/web/assets/{settings-window-content-CmNMpFk1.js → settings-window-content-Cxaw8e78.js} +1 -1
- package/dist/web/assets/{sql-object-tab-DnZb8XeX.js → sql-object-tab-BseOvGuw.js} +1 -1
- package/dist/web/assets/sql-object-tab-BseOvGuw.js.br +0 -0
- package/dist/web/assets/sql-object-tab-BseOvGuw.js.gz +0 -0
- package/dist/web/assets/{sqlite-viewer-C_LN_liu.js → sqlite-viewer-BK112-XZ.js} +1 -1
- package/dist/web/assets/sqlite-viewer-BK112-XZ.js.br +0 -0
- package/dist/web/assets/sqlite-viewer-BK112-XZ.js.gz +0 -0
- package/dist/web/assets/{storage-settings-section-DjVmPPsq.js → storage-settings-section-BnqKLxgx.js} +1 -1
- package/dist/web/assets/storage-settings-section-BnqKLxgx.js.br +0 -0
- package/dist/web/assets/storage-settings-section-BnqKLxgx.js.gz +0 -0
- package/dist/web/assets/{structure-save-dialog-CPihivr8.js → structure-save-dialog-DG7OENmO.js} +1 -1
- package/dist/web/assets/structure-save-dialog-DG7OENmO.js.br +0 -0
- package/dist/web/assets/structure-save-dialog-DG7OENmO.js.gz +0 -0
- package/dist/web/assets/{structure-tab-TiVBWIsX.js → structure-tab-DrI9AgAe.js} +1 -1
- package/dist/web/assets/structure-tab-DrI9AgAe.js.br +0 -0
- package/dist/web/assets/structure-tab-DrI9AgAe.js.gz +0 -0
- package/dist/web/assets/{system-monitor-body-CXOMCVD1.js → system-monitor-body-BRg06F77.js} +2 -2
- package/dist/web/assets/system-monitor-body-BRg06F77.js.br +0 -0
- package/dist/web/assets/system-monitor-body-BRg06F77.js.gz +0 -0
- package/dist/web/assets/system-monitor-tab-BpOpuLL9.js +1 -0
- package/dist/web/assets/{system-monitor-window-content-BfcvuXt-.js → system-monitor-window-content-KfkaVpDc.js} +1 -1
- package/dist/web/assets/{tab-host-window-content-C3z9ouJg.js → tab-host-window-content-Cd5tvEFg.js} +1 -1
- package/dist/web/assets/tab-host-window-content-Cd5tvEFg.js.br +0 -0
- package/dist/web/assets/tab-host-window-content-Cd5tvEFg.js.gz +0 -0
- package/dist/web/assets/{tab-store-CiT16Eol.js → tab-store-QBa8a8Ea.js} +1 -1
- package/dist/web/assets/{table-tab-IgNEY_LZ.js → table-tab-CD7Qac-8.js} +1 -1
- package/dist/web/assets/table-tab-CD7Qac-8.js.br +0 -0
- package/dist/web/assets/table-tab-CD7Qac-8.js.gz +0 -0
- package/dist/web/assets/{telegram-bot-token-field-BibezKpI.js → telegram-bot-token-field-C41HjvH4.js} +1 -1
- package/dist/web/assets/telegram-bot-token-field-C41HjvH4.js.br +0 -0
- package/dist/web/assets/telegram-bot-token-field-C41HjvH4.js.gz +0 -0
- package/dist/web/assets/{terminal-tab-C9bsg88-.js → terminal-tab-Vb7aINIY.js} +1 -1
- package/dist/web/assets/terminal-tab-Vb7aINIY.js.br +0 -0
- package/dist/web/assets/terminal-tab-Vb7aINIY.js.gz +0 -0
- package/dist/web/assets/{tool-cards-DUKn_XTY.js → tool-cards-BdQzObMQ.js} +3 -3
- package/dist/web/assets/tool-cards-BdQzObMQ.js.br +0 -0
- package/dist/web/assets/tool-cards-BdQzObMQ.js.gz +0 -0
- package/dist/web/assets/{tools-settings-section-BWP7lR_H.js → tools-settings-section-OY7q-Zhf.js} +1 -1
- package/dist/web/assets/tools-settings-section-OY7q-Zhf.js.br +0 -0
- package/dist/web/assets/tools-settings-section-OY7q-Zhf.js.gz +0 -0
- package/dist/web/assets/{use-assistant-sessions-DwnkM0MT.js → use-assistant-sessions-3oXMiFYH.js} +1 -1
- package/dist/web/assets/use-assistant-sessions-3oXMiFYH.js.br +0 -0
- package/dist/web/assets/use-assistant-sessions-3oXMiFYH.js.gz +0 -0
- package/dist/web/assets/{use-assistant-telegram-binding-BElVy80Y.js → use-assistant-telegram-binding-6aINJEG2.js} +1 -1
- package/dist/web/assets/use-assistant-telegram-binding-6aINJEG2.js.br +0 -0
- package/dist/web/assets/use-assistant-telegram-binding-6aINJEG2.js.gz +0 -0
- package/dist/web/assets/{use-db-read-CVKBGcwR.js → use-db-read-CYyXlrHg.js} +1 -1
- package/dist/web/assets/use-db-read-CYyXlrHg.js.br +0 -0
- package/dist/web/assets/use-db-read-CYyXlrHg.js.gz +0 -0
- package/dist/web/assets/{use-db-tab-Dqt-fdlx.js → use-db-tab-CJCQHAda.js} +1 -1
- package/dist/web/assets/use-db-tab-CJCQHAda.js.br +0 -0
- package/dist/web/assets/use-db-tab-CJCQHAda.js.gz +0 -0
- package/dist/web/assets/{use-inline-blame-B5Y2JpMW.js → use-inline-blame-Bq7r7fR2.js} +1 -1
- package/dist/web/assets/use-inline-blame-Bq7r7fR2.js.br +0 -0
- package/dist/web/assets/use-inline-blame-Bq7r7fR2.js.gz +0 -0
- package/dist/web/assets/{use-lsp-CX8DCsdI.js → use-lsp-COwyy852.js} +1 -1
- package/dist/web/assets/use-lsp-COwyy852.js.br +0 -0
- package/dist/web/assets/use-lsp-COwyy852.js.gz +0 -0
- package/dist/web/assets/{use-monaco-theme-D7J2RPBT.js → use-monaco-theme-ADh3jLKW.js} +1 -1
- package/dist/web/assets/{use-process-kill-DroUSw5r.js → use-process-kill-DKxuw25F.js} +1 -1
- package/dist/web/assets/use-process-kill-DKxuw25F.js.br +0 -0
- package/dist/web/assets/use-process-kill-DKxuw25F.js.gz +0 -0
- package/dist/web/assets/{use-sql-schema-info-wl-EurBd.js → use-sql-schema-info-CIzHL0f_.js} +1 -1
- package/dist/web/assets/use-sql-schema-info-CIzHL0f_.js.br +0 -0
- package/dist/web/assets/use-sql-schema-info-CIzHL0f_.js.gz +0 -0
- package/dist/web/assets/{use-websocket-Bd1Zw6mK.js → use-websocket-D3WN8hb_.js} +1 -1
- package/dist/web/assets/{user-message-parse-yeAjynUW.js → user-message-parse-CfOxGzPd.js} +1 -1
- package/dist/web/assets/user-message-parse-CfOxGzPd.js.br +0 -0
- package/dist/web/assets/user-message-parse-CfOxGzPd.js.gz +0 -0
- package/dist/web/assets/{voice-settings-section-B4fxNTf6.js → voice-settings-section-ow83QJOS.js} +1 -1
- package/dist/web/assets/voice-settings-section-ow83QJOS.js.br +0 -0
- package/dist/web/assets/voice-settings-section-ow83QJOS.js.gz +0 -0
- package/dist/web/assets/{web-preview-tab-C5yXS9An.js → web-preview-tab-CStu-3Sp.js} +1 -1
- package/dist/web/assets/web-preview-tab-CStu-3Sp.js.br +0 -0
- package/dist/web/assets/web-preview-tab-CStu-3Sp.js.gz +0 -0
- package/dist/web/assets/{xlsx-preview-CstDrlVE.js → xlsx-preview-BlU_ki6D.js} +1 -1
- package/dist/web/assets/xlsx-preview-BlU_ki6D.js.br +0 -0
- package/dist/web/assets/xlsx-preview-BlU_ki6D.js.gz +0 -0
- package/dist/web/index.html +26 -26
- package/dist/web/index.html.br +0 -0
- package/dist/web/index.html.gz +0 -0
- package/dist/web/sw.js +1 -1
- package/dist/web/sw.js.br +0 -0
- package/dist/web/sw.js.gz +0 -0
- package/docs/architecture/ai-chat-and-providers.md +41 -6
- package/docs/architecture/ppm-assistant.md +74 -1
- package/package.json +1 -1
- package/src/server/index.ts +4 -0
- package/src/server/routes/design-shots.ts +27 -0
- package/src/server/ws/chat-inject.ts +3 -4
- package/src/server/ws/chat-user-words.ts +9 -1
- package/src/server/ws/chat.ts +28 -0
- package/src/services/assistant-cards/assistant-cards-db.ts +43 -3
- package/src/services/assistant-cards/assistant-cards-outbound-db.ts +14 -3
- package/src/services/assistant-cards/assistant-cards-startup.ts +3 -0
- package/src/services/assistant-cards/assistant-cards.service.ts +18 -3
- package/src/services/assistant-cards/card-reply-actions.ts +15 -2
- package/src/services/assistant-cards/card-reply-followup-tracker.ts +403 -0
- package/src/services/assistant-cards/card-reply-followup.ts +121 -0
- package/src/services/assistant-cards/forward-verbatim-env.ts +2 -0
- package/src/services/assistant-cards/forward-verbatim.ts +29 -5
- package/src/services/assistant-cards/manager-report-env.ts +7 -0
- package/src/services/assistant-cards/manager-report-tool.ts +35 -2
- package/src/services/assistant-managers/manager-context-entry.ts +18 -0
- package/src/services/assistant-telegram/assistant-telegram-card-followups.ts +134 -0
- package/src/services/assistant-telegram/assistant-telegram-card-kinds.ts +5 -0
- package/src/services/assistant-telegram/assistant-telegram-card-photos.ts +51 -0
- package/src/services/assistant-telegram/assistant-telegram-card-replies.ts +11 -4
- package/src/services/assistant-telegram/assistant-telegram-followup-format.ts +81 -0
- package/src/services/assistant-telegram/assistant-telegram-manager-cards.ts +8 -1
- package/src/services/assistant-telegram/assistant-telegram.service.ts +5 -0
- package/src/services/chat-control/collab-deciding-input.ts +14 -0
- package/src/services/design/shots/design-shots.service.ts +247 -0
- package/src/services/design/shots/headless-browser.ts +280 -0
- package/src/services/notification-format.ts +1 -0
- package/src/services/session-collab/collab-caller-policy.ts +3 -2
- package/src/services/session-collab/collab-context.ts +42 -6
- package/src/services/session-collab/collab-create.ts +37 -19
- package/src/services/session-collab/collab-deliver.ts +30 -5
- package/src/services/session-collab/collab-design-shot.ts +86 -0
- package/src/services/session-collab/collab-env.ts +25 -7
- package/src/services/session-collab/session-collab-endpoint.ts +3 -1
- package/src/services/session-collab/session-collab-tool.ts +13 -2
- package/src/services/telegram/telegram-bot-client.ts +79 -0
- package/src/shared/assistant-cards.ts +28 -0
- package/src/shared/assistant-limits.ts +13 -0
- package/src/shared/chat-from-session.ts +10 -1
- package/src/shared/session-collab.ts +5 -1
- package/src/web/components/assistant/cards/card-images.tsx +65 -0
- package/src/web/components/assistant/cards/card-shell.tsx +12 -0
- package/src/web/components/assistant/cards/decision-card.tsx +2 -0
- package/src/web/components/assistant/cards/outcome-card.tsx +2 -0
- package/src/web/components/chat/collab-approval-card.tsx +6 -0
- package/src/web/components/settings/tools-settings-section.tsx +4 -0
- package/src/web/lib/session-collab-tool-call.ts +4 -3
- package/dist/web/assets/accounts-settings-section-CJpMzwRN.js.br +0 -0
- package/dist/web/assets/accounts-settings-section-CJpMzwRN.js.gz +0 -0
- package/dist/web/assets/agent-session-sheet-FInwTnf_.js.br +0 -0
- package/dist/web/assets/agent-session-sheet-FInwTnf_.js.gz +0 -0
- package/dist/web/assets/agent-session-window-content-Ct6ZHTtp.js.br +0 -0
- package/dist/web/assets/agent-session-window-content-Ct6ZHTtp.js.gz +0 -0
- package/dist/web/assets/ai-resource-editor-CNhRBVzA.js.br +0 -0
- package/dist/web/assets/ai-resource-editor-CNhRBVzA.js.gz +0 -0
- package/dist/web/assets/ai-settings-section-BGocvC5p.js.br +0 -0
- package/dist/web/assets/ai-settings-section-BGocvC5p.js.gz +0 -0
- package/dist/web/assets/ai-settings-section-BuEmNuZv.js.br +0 -0
- package/dist/web/assets/ai-settings-section-BuEmNuZv.js.gz +0 -0
- package/dist/web/assets/android-tab-BbqO4tTg.js.br +0 -0
- package/dist/web/assets/android-tab-BbqO4tTg.js.gz +0 -0
- package/dist/web/assets/antigravity-usage-view-BBxDn7OP.js.br +0 -0
- package/dist/web/assets/antigravity-usage-view-BBxDn7OP.js.gz +0 -0
- package/dist/web/assets/appearance-settings-section-CAh8nPhs.js.br +0 -0
- package/dist/web/assets/appearance-settings-section-CAh8nPhs.js.gz +0 -0
- package/dist/web/assets/apps-panel-Dof7DwAj.js.br +0 -0
- package/dist/web/assets/apps-panel-Dof7DwAj.js.gz +0 -0
- package/dist/web/assets/assistant-name-store-D5teXZ9K.js.br +0 -0
- package/dist/web/assets/assistant-name-store-D5teXZ9K.js.gz +0 -0
- package/dist/web/assets/assistant-settings-BvOjO9ir.js.br +0 -0
- package/dist/web/assets/assistant-settings-BvOjO9ir.js.gz +0 -0
- package/dist/web/assets/assistant-settings-section-DDFHPVIR.js.br +0 -0
- package/dist/web/assets/assistant-settings-section-DDFHPVIR.js.gz +0 -0
- package/dist/web/assets/assistant-tab-CFDxGZDa.js.br +0 -0
- package/dist/web/assets/assistant-tab-CFDxGZDa.js.gz +0 -0
- package/dist/web/assets/background-output-store-CYu95pMo.js.br +0 -0
- package/dist/web/assets/background-output-store-CYu95pMo.js.gz +0 -0
- package/dist/web/assets/branch-review-tab-DmD06w26.js.br +0 -0
- package/dist/web/assets/branch-review-tab-DmD06w26.js.gz +0 -0
- package/dist/web/assets/build-message-with-attachments-CaOUFGji.js.br +0 -0
- package/dist/web/assets/build-message-with-attachments-CaOUFGji.js.gz +0 -0
- package/dist/web/assets/chat-tab-BfB-YkvJ.js.br +0 -0
- package/dist/web/assets/chat-tab-BfB-YkvJ.js.gz +0 -0
- package/dist/web/assets/chat-tab-Cy8oEjQj.js +0 -1
- package/dist/web/assets/chat-tab-Cy8oEjQj.js.br +0 -0
- package/dist/web/assets/chat-tab-Cy8oEjQj.js.gz +0 -0
- package/dist/web/assets/code-editor-wq1uUv3e.js.br +0 -0
- package/dist/web/assets/code-editor-wq1uUv3e.js.gz +0 -0
- package/dist/web/assets/conflict-editor-3dvOYhsg.js.br +0 -0
- package/dist/web/assets/conflict-editor-3dvOYhsg.js.gz +0 -0
- package/dist/web/assets/connection-form-tab--411MxSo.js.br +0 -0
- package/dist/web/assets/connection-form-tab--411MxSo.js.gz +0 -0
- package/dist/web/assets/csv-preview-B8kSkU3R.js.br +0 -0
- package/dist/web/assets/csv-preview-B8kSkU3R.js.gz +0 -0
- package/dist/web/assets/database-drivers-section-BRIzMorf.js.br +0 -0
- package/dist/web/assets/database-drivers-section-BRIzMorf.js.gz +0 -0
- package/dist/web/assets/db-connection-config-sCgRWO6g.js.br +0 -0
- package/dist/web/assets/db-connection-config-sCgRWO6g.js.gz +0 -0
- package/dist/web/assets/db-explorer-store-DIVU5YE1.js.br +0 -0
- package/dist/web/assets/db-explorer-store-DIVU5YE1.js.gz +0 -0
- package/dist/web/assets/db-tab-parts-Db6dNGCV.js.br +0 -0
- package/dist/web/assets/db-tab-parts-Db6dNGCV.js.gz +0 -0
- package/dist/web/assets/design-settings-section-DTWDBysp.js.br +0 -0
- package/dist/web/assets/design-settings-section-DTWDBysp.js.gz +0 -0
- package/dist/web/assets/design-tab-DzFFWqgU.js.br +0 -0
- package/dist/web/assets/design-tab-DzFFWqgU.js.gz +0 -0
- package/dist/web/assets/designs-sidebar-panel-MPtHF-kA.js.br +0 -0
- package/dist/web/assets/designs-sidebar-panel-MPtHF-kA.js.gz +0 -0
- package/dist/web/assets/diff-viewer-6H5Jl2t8.js.br +0 -0
- package/dist/web/assets/diff-viewer-6H5Jl2t8.js.gz +0 -0
- package/dist/web/assets/docx-preview-Bhk0VwBH.js.br +0 -0
- package/dist/web/assets/docx-preview-Bhk0VwBH.js.gz +0 -0
- package/dist/web/assets/editor-dialog-C3yeHsGp.js.br +0 -0
- package/dist/web/assets/editor-dialog-C3yeHsGp.js.gz +0 -0
- package/dist/web/assets/editor-language-service-BKV35pp_.js.br +0 -0
- package/dist/web/assets/editor-language-service-BKV35pp_.js.gz +0 -0
- package/dist/web/assets/explorer-body-CX65jdUB.js.br +0 -0
- package/dist/web/assets/explorer-body-CX65jdUB.js.gz +0 -0
- package/dist/web/assets/explorer-model-CHQNPtY-.js.br +0 -0
- package/dist/web/assets/explorer-model-CHQNPtY-.js.gz +0 -0
- package/dist/web/assets/explorer-window-content-DSY92TDq.js.br +0 -0
- package/dist/web/assets/explorer-window-content-DSY92TDq.js.gz +0 -0
- package/dist/web/assets/extension-manager-section-BipKy2Rw.js.br +0 -0
- package/dist/web/assets/extension-manager-section-BipKy2Rw.js.gz +0 -0
- package/dist/web/assets/extension-webview-DFWHAUUH.js.br +0 -0
- package/dist/web/assets/extension-webview-DFWHAUUH.js.gz +0 -0
- package/dist/web/assets/files-settings-section-BDrlGgwW.js.br +0 -0
- package/dist/web/assets/files-settings-section-BDrlGgwW.js.gz +0 -0
- package/dist/web/assets/general-settings-section-CHVQSPfM.js.br +0 -0
- package/dist/web/assets/general-settings-section-CHVQSPfM.js.gz +0 -0
- package/dist/web/assets/git-log-panel-1v7JOQMr.js.br +0 -0
- package/dist/web/assets/git-log-panel-1v7JOQMr.js.gz +0 -0
- package/dist/web/assets/git-review-tab-DwB7zqOw.js.br +0 -0
- package/dist/web/assets/git-review-tab-DwB7zqOw.js.gz +0 -0
- package/dist/web/assets/glide-data-grid-CL9ERRkH.js.br +0 -0
- package/dist/web/assets/glide-data-grid-CL9ERRkH.js.gz +0 -0
- package/dist/web/assets/grid-save-dialog-CK2kug73.js.br +0 -0
- package/dist/web/assets/grid-save-dialog-CK2kug73.js.gz +0 -0
- package/dist/web/assets/group-chat-tab-CRtOsmm6.js.br +0 -0
- package/dist/web/assets/group-chat-tab-CRtOsmm6.js.gz +0 -0
- package/dist/web/assets/impexp-tab-D7iyg3Xr.js.br +0 -0
- package/dist/web/assets/impexp-tab-D7iyg3Xr.js.gz +0 -0
- package/dist/web/assets/index-B28_HhQI.css +0 -1
- package/dist/web/assets/index-B28_HhQI.css.br +0 -0
- package/dist/web/assets/index-B28_HhQI.css.gz +0 -0
- package/dist/web/assets/index-rFeA9cN0.js.br +0 -0
- package/dist/web/assets/index-rFeA9cN0.js.gz +0 -0
- package/dist/web/assets/keyboard-shortcuts-section-BDTcp2Mp.js.br +0 -0
- package/dist/web/assets/keyboard-shortcuts-section-BDTcp2Mp.js.gz +0 -0
- package/dist/web/assets/language-servers-section-D4ohb6fF.js.br +0 -0
- package/dist/web/assets/language-servers-section-D4ohb6fF.js.gz +0 -0
- package/dist/web/assets/logs-app-DTLXuUwz.js.br +0 -0
- package/dist/web/assets/logs-app-DTLXuUwz.js.gz +0 -0
- package/dist/web/assets/logs-tab-CBPgD74S.js +0 -1
- package/dist/web/assets/lsp-client-DbxW8RE8.js.br +0 -0
- package/dist/web/assets/lsp-client-DbxW8RE8.js.gz +0 -0
- package/dist/web/assets/markdown-renderer-BLotknvo.js +0 -1
- package/dist/web/assets/markdown-renderer-BLotknvo.js.br +0 -0
- package/dist/web/assets/markdown-renderer-BLotknvo.js.gz +0 -0
- package/dist/web/assets/markdown-renderer-EpZgAvPW.js.br +0 -0
- package/dist/web/assets/markdown-renderer-EpZgAvPW.js.gz +0 -0
- package/dist/web/assets/mobile-explorer-sheet-2gso3b7e.js.br +0 -0
- package/dist/web/assets/mobile-explorer-sheet-2gso3b7e.js.gz +0 -0
- package/dist/web/assets/model-thinking-selector-helpers-BR5Y_oCs.js.br +0 -0
- package/dist/web/assets/model-thinking-selector-helpers-BR5Y_oCs.js.gz +0 -0
- package/dist/web/assets/new-design-dialog-Djulr0aD.js.br +0 -0
- package/dist/web/assets/new-design-dialog-Djulr0aD.js.gz +0 -0
- package/dist/web/assets/notifications-settings-section-C5VPaRfs.js.br +0 -0
- package/dist/web/assets/notifications-settings-section-C5VPaRfs.js.gz +0 -0
- package/dist/web/assets/onboarding-entry-B6iyOCP1.js.br +0 -0
- package/dist/web/assets/onboarding-entry-B6iyOCP1.js.gz +0 -0
- package/dist/web/assets/open-assistant-B3VjLarr.js.br +0 -0
- package/dist/web/assets/open-assistant-B3VjLarr.js.gz +0 -0
- package/dist/web/assets/open-assistant-DVw1LOlL.js +0 -1
- package/dist/web/assets/open-db-tabs-CZCVwLtY.js.br +0 -0
- package/dist/web/assets/open-db-tabs-CZCVwLtY.js.gz +0 -0
- package/dist/web/assets/open-manager-chat-AREyrwCV.js.br +0 -0
- package/dist/web/assets/open-manager-chat-AREyrwCV.js.gz +0 -0
- package/dist/web/assets/open-manager-chat-BDcdRhCP.js +0 -1
- package/dist/web/assets/open-ppm-tab-Ycg95vdE.js.br +0 -0
- package/dist/web/assets/open-ppm-tab-Ycg95vdE.js.gz +0 -0
- package/dist/web/assets/panel-store-CBSQTnq9.js.br +0 -0
- package/dist/web/assets/panel-store-CBSQTnq9.js.gz +0 -0
- package/dist/web/assets/performance-panel-vtfFrYmB.js.br +0 -0
- package/dist/web/assets/performance-panel-vtfFrYmB.js.gz +0 -0
- package/dist/web/assets/ppm-tools-DkXwX2Et.js.br +0 -0
- package/dist/web/assets/ppm-tools-DkXwX2Et.js.gz +0 -0
- package/dist/web/assets/problems-panel-ty4WAeub.js.br +0 -0
- package/dist/web/assets/problems-panel-ty4WAeub.js.gz +0 -0
- package/dist/web/assets/process-table-Dk-9ohXl.js.br +0 -0
- package/dist/web/assets/process-table-Dk-9ohXl.js.gz +0 -0
- package/dist/web/assets/proxy-settings-section-CpmKuU96.js.br +0 -0
- package/dist/web/assets/proxy-settings-section-CpmKuU96.js.gz +0 -0
- package/dist/web/assets/query-tab-BRkozohy.js.br +0 -0
- package/dist/web/assets/query-tab-BRkozohy.js.gz +0 -0
- package/dist/web/assets/release-notes-window-content-D4jEU3wD.js +0 -1
- package/dist/web/assets/remote-access-settings-section-C40hJCpz.js.br +0 -0
- package/dist/web/assets/remote-access-settings-section-C40hJCpz.js.gz +0 -0
- package/dist/web/assets/remote-desktop-clipboard-notice-DBKfzIao.js.br +0 -0
- package/dist/web/assets/remote-desktop-clipboard-notice-DBKfzIao.js.gz +0 -0
- package/dist/web/assets/remote-desktop-mobile-sheet-DH12hzq0.js.br +0 -0
- package/dist/web/assets/remote-desktop-mobile-sheet-DH12hzq0.js.gz +0 -0
- package/dist/web/assets/remote-desktop-mobile-view-G7lonBBK.js.br +0 -0
- package/dist/web/assets/remote-desktop-mobile-view-G7lonBBK.js.gz +0 -0
- package/dist/web/assets/remote-desktop-readiness-gate-CEnwbi9-.js.br +0 -0
- package/dist/web/assets/remote-desktop-readiness-gate-CEnwbi9-.js.gz +0 -0
- package/dist/web/assets/remote-desktop-window-content-DRoq0Doz.js.br +0 -0
- package/dist/web/assets/remote-desktop-window-content-DRoq0Doz.js.gz +0 -0
- package/dist/web/assets/rename-object-dialog-B4_M7kq7.js.br +0 -0
- package/dist/web/assets/rename-object-dialog-B4_M7kq7.js.gz +0 -0
- package/dist/web/assets/review-address-setup-Dr0-k8Ii.js.br +0 -0
- package/dist/web/assets/review-address-setup-Dr0-k8Ii.js.gz +0 -0
- package/dist/web/assets/review-code-BiqpKBwR.js.br +0 -0
- package/dist/web/assets/review-code-BiqpKBwR.js.gz +0 -0
- package/dist/web/assets/save-as-dialog-DNBlWN4R.js.br +0 -0
- package/dist/web/assets/save-as-dialog-DNBlWN4R.js.gz +0 -0
- package/dist/web/assets/schedule-script-editor-JYIGILyl.js.br +0 -0
- package/dist/web/assets/schedule-script-editor-JYIGILyl.js.gz +0 -0
- package/dist/web/assets/schedules-settings-section-BqKUZ8se.js.br +0 -0
- package/dist/web/assets/schedules-settings-section-BqKUZ8se.js.gz +0 -0
- package/dist/web/assets/send-to-chat-bbnVuPiz.js.br +0 -0
- package/dist/web/assets/send-to-chat-bbnVuPiz.js.gz +0 -0
- package/dist/web/assets/session-changes-chip-DfOeZz3v.js.br +0 -0
- package/dist/web/assets/session-changes-chip-DfOeZz3v.js.gz +0 -0
- package/dist/web/assets/session-collab-client-DOUeHjr_.js.br +0 -0
- package/dist/web/assets/session-collab-client-DOUeHjr_.js.gz +0 -0
- package/dist/web/assets/session-collab-rL-aatJP.js +0 -1
- package/dist/web/assets/session-review-tab-BZ3jPhrf.js.br +0 -0
- package/dist/web/assets/session-review-tab-BZ3jPhrf.js.gz +0 -0
- package/dist/web/assets/session-turns-Bl6ccivQ.js.br +0 -0
- package/dist/web/assets/session-turns-Bl6ccivQ.js.gz +0 -0
- package/dist/web/assets/settings-body-OVphMQRm.js.br +0 -0
- package/dist/web/assets/settings-body-OVphMQRm.js.gz +0 -0
- package/dist/web/assets/settings-rows-BqVoWUah.js.br +0 -0
- package/dist/web/assets/settings-rows-BqVoWUah.js.gz +0 -0
- package/dist/web/assets/settings-section-content-BOGhX0Gc.js.br +0 -0
- package/dist/web/assets/settings-section-content-BOGhX0Gc.js.gz +0 -0
- package/dist/web/assets/settings-store-DbEIO8Ou.js.br +0 -0
- package/dist/web/assets/settings-store-DbEIO8Ou.js.gz +0 -0
- package/dist/web/assets/sql-object-tab-DnZb8XeX.js.br +0 -0
- package/dist/web/assets/sql-object-tab-DnZb8XeX.js.gz +0 -0
- package/dist/web/assets/sqlite-viewer-C_LN_liu.js.br +0 -0
- package/dist/web/assets/sqlite-viewer-C_LN_liu.js.gz +0 -0
- package/dist/web/assets/storage-settings-section-DjVmPPsq.js.br +0 -0
- package/dist/web/assets/storage-settings-section-DjVmPPsq.js.gz +0 -0
- package/dist/web/assets/structure-save-dialog-CPihivr8.js.br +0 -0
- package/dist/web/assets/structure-save-dialog-CPihivr8.js.gz +0 -0
- package/dist/web/assets/structure-tab-TiVBWIsX.js.br +0 -0
- package/dist/web/assets/structure-tab-TiVBWIsX.js.gz +0 -0
- package/dist/web/assets/system-monitor-body-CXOMCVD1.js.br +0 -0
- package/dist/web/assets/system-monitor-body-CXOMCVD1.js.gz +0 -0
- package/dist/web/assets/system-monitor-tab-C8pbRhyF.js +0 -1
- package/dist/web/assets/tab-host-window-content-C3z9ouJg.js.br +0 -0
- package/dist/web/assets/tab-host-window-content-C3z9ouJg.js.gz +0 -0
- package/dist/web/assets/table-tab-IgNEY_LZ.js.br +0 -0
- package/dist/web/assets/table-tab-IgNEY_LZ.js.gz +0 -0
- package/dist/web/assets/telegram-bot-token-field-BibezKpI.js.br +0 -0
- package/dist/web/assets/telegram-bot-token-field-BibezKpI.js.gz +0 -0
- package/dist/web/assets/terminal-tab-C9bsg88-.js.br +0 -0
- package/dist/web/assets/terminal-tab-C9bsg88-.js.gz +0 -0
- package/dist/web/assets/tool-cards-DUKn_XTY.js.br +0 -0
- package/dist/web/assets/tool-cards-DUKn_XTY.js.gz +0 -0
- package/dist/web/assets/tools-settings-section-BWP7lR_H.js.br +0 -0
- package/dist/web/assets/tools-settings-section-BWP7lR_H.js.gz +0 -0
- package/dist/web/assets/use-assistant-sessions-DwnkM0MT.js.br +0 -0
- package/dist/web/assets/use-assistant-sessions-DwnkM0MT.js.gz +0 -0
- package/dist/web/assets/use-assistant-telegram-binding-BElVy80Y.js.br +0 -0
- package/dist/web/assets/use-assistant-telegram-binding-BElVy80Y.js.gz +0 -0
- package/dist/web/assets/use-db-read-CVKBGcwR.js.br +0 -0
- package/dist/web/assets/use-db-read-CVKBGcwR.js.gz +0 -0
- package/dist/web/assets/use-db-tab-Dqt-fdlx.js.br +0 -0
- package/dist/web/assets/use-db-tab-Dqt-fdlx.js.gz +0 -0
- package/dist/web/assets/use-inline-blame-B5Y2JpMW.js.br +0 -0
- package/dist/web/assets/use-inline-blame-B5Y2JpMW.js.gz +0 -0
- package/dist/web/assets/use-lsp-CX8DCsdI.js.br +0 -0
- package/dist/web/assets/use-lsp-CX8DCsdI.js.gz +0 -0
- package/dist/web/assets/use-process-kill-DroUSw5r.js.br +0 -0
- package/dist/web/assets/use-process-kill-DroUSw5r.js.gz +0 -0
- package/dist/web/assets/use-sql-schema-info-wl-EurBd.js.br +0 -0
- package/dist/web/assets/use-sql-schema-info-wl-EurBd.js.gz +0 -0
- package/dist/web/assets/user-message-parse-yeAjynUW.js.br +0 -0
- package/dist/web/assets/user-message-parse-yeAjynUW.js.gz +0 -0
- package/dist/web/assets/voice-settings-section-B4fxNTf6.js.br +0 -0
- package/dist/web/assets/voice-settings-section-B4fxNTf6.js.gz +0 -0
- package/dist/web/assets/web-preview-tab-C5yXS9An.js.br +0 -0
- package/dist/web/assets/web-preview-tab-C5yXS9An.js.gz +0 -0
- package/dist/web/assets/xlsx-preview-CstDrlVE.js.br +0 -0
- package/dist/web/assets/xlsx-preview-CstDrlVE.js.gz +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.25.9] - 2026-11-15
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- **Open a Design chat from any chat**: `create_session` takes a design, and `send_to_session` reaches Design chats; the Design tab shows those messages live.
|
|
8
|
+
- **`design_screenshot`** photographs a design's variants, and a manager's card can carry them, sent to Telegram as photos.
|
|
9
|
+
- **A manager's answer to your card reply comes back where you replied**, under the card on Telegram or in PPM, even while Telegram is quiet.
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- **A card reply that asks a question or rests on a wrong assumption is not an OK**: every manager answers it and asks again with a new card.
|
|
14
|
+
|
|
3
15
|
## [0.25.8] - 2026-11-15
|
|
4
16
|
|
|
5
17
|
### Added
|
package/CLAUDE.md
CHANGED
|
@@ -293,6 +293,7 @@ Related: `configService.save()`/`set()` throw when `load()` has not run, because
|
|
|
293
293
|
- **An Assistant → session message keeps origin `session`**: main's guards key on that origin — waiting for a starting consumer, the refusal of a provider that cannot take a mid-turn message, from-session decoding — and a new origin would skip all three silently. The sender is marked in the from-session block (`kind: "assistant"`), and the manager-only provenance block decodes only on such a message.
|
|
294
294
|
- **A `permissionMode` sent with a server-side message into an existing chat overwrites that chat's own mode**: a mode on `chatControl().sendUserMessage` starts the chat's subprocess in it (`liveMode`), and every later turn of that subprocess, the user's included, runs in it. A server sender that means "in the chat's own mode" must send none — the old prompt schedule sent `bypassPermissions` by default. `chatControl` refuses one outright for origin `schedule`.
|
|
295
295
|
- **Only the server writes `ppm-…-v1` blocks**: `<ppm-assistant-provenance-v1>` and `<ppm-user-words-v1>` are encoded by the server alone (`forward-verbatim.ts` for the user's words, with a source test for a second writer); every other door — a session-tool body, every `report_to_assistant` field, Telegram text including the user's own forwards, notebook text and the rules file — breaks their markers, and `deliverToSession` defuses any PPM-looking tag (`neutralizePpmTags`), because a model reads them loosely.
|
|
296
|
+
- **The manager's answer to a card reply is the turn its client id names, never "the next turn end" — and Claude never names a reply pushed into a running turn**: words forwarded from a card can be queued behind a running turn, and a schedule or another chat's message can run turns in between, so the next `turn_ended` of the manager chat is often someone else's answer. `forwardUserWords` chooses the `card-<uuid>` id *before* the send (a provider can name the turn before `deliverUserWords` returns) and `card-reply-followup-tracker.ts` waits for the `turn_started` carrying it. The bundled CLI runs `UserPromptSubmit` only for a prompt that opens a turn, so an `inserted` reply is never named: it is judged **once**, at the first turn end after it went in, and answered after the 3 s grace only if the chat is idle and `liveState().turnId` is still that turn — any turn PPM started in between sends nothing (`turnId` moves only for prompts PPM pushed; a task-notification or CLI-continuation turn leaves it unchanged, but what is sent is still the snapshot of the first turn end, so no later turn's text can leak), because a re-judged later turn once sent a schedule's answer to the user's phone. The answer is every top-level block from the reply on: a turn that opened no card sends every block in order; in one that did, lines that only confirm a tool call ("Card sent.") are dropped and other short lines only beside a longer block (a short real answer after the card, "Được anh.", must survive), and the last block is kept whole under the cap. A stopped or failed turn sends no text (a Telegram reply gets one "stopped" line) — and a Stop on the first turn of a fresh Claude subprocess arrives as `outcome: "done"` with `cancelledBy` set, which counts as stopped. Each reply resolves its chat id once (`canonical` is a database lookup) and the stream path asks a set, since every event of every chat passes through it. A reply typed on Telegram rings for 30 min after it whatever "quiet while I'm at PPM" says (`assistant-telegram-card-followups.ts`). A reply or a bare OK to the answer's message goes to the card replied to, never to a new card the answer named: routing it there let an "ok, noted" on a "stopped" notice or on a card held in quiet hours approve a decision the user never saw.
|
|
296
297
|
- **The e2e image runs Node 20 and ships no browser**: `ppm-e2e-chromium` has no global `WebSocket` and no `node:sqlite` in Node (a script that needs them runs only on Node 22.5+, so the manager-loop e2e types into chats through a fixture route instead), and `playwright-core` must be launched with `executablePath: process.env.PPM_PLAYWRIGHT_EXECUTABLE`. Two traps for any scripted fixture as well: the chat composer holds a phone and a desktop `textarea[aria-label="Message"]`, so select `:visible`; and "Set as manager chat" finds a chat with no provider row through the Claude provider's `getSessionInfoById`, which a scripted provider must implement or the dialog says "No Claude chat with that id".
|
|
297
298
|
- **use-stick-to-bottom watches the content, not the container, and reads every unexplained upward scroll as the reader**: when the chat's scroller gets taller while following (the composer shrinking after a multi-line message, the queue stack or a footer bar going away, a phone keyboard closing), the browser clamps `scrollTop` to the new maximum. The library's scroll handler sees `scrollTop` decrease with no content resize to explain it and escapes the lock, although the view is still at the bottom, so the reply grows out of sight until the reader scrolls down. The clamp's scroll event can arrive before or after the container's ResizeObserver report, depending on whether a layout was forced earlier. `message-list.tsx` re-locks from both ends, 2 ms after the event, i.e. after the library's own 1 ms look. Step 7 of `tests/e2e/chat-queue-e2e.mjs` fails without it (gap 150 px). Its wheel handler never fires here: it walks up to an element whose computed `overflow` is exactly `auto`/`scroll`, and the chat's `overflow-x-hidden overflow-y-auto` computes to `hidden auto`.
|
|
298
299
|
- **A design kit carries the app shell's `html, body` rules, and with a long page they stop the wheel**: PPM's own `overscroll-behavior: none` + `height: 100dvh` came along into `designs/kit/app.css`. A design overrides the height with `body { overflow: auto }`, which makes `body` a scroll container with nothing to scroll, and under `none` Chrome passes no wheel on from it to the viewport. The scrollbar still drags, so "it scrolls" passes a click test. `SCROLL_CHAIN_STYLE` (`preview/design-preview-html.ts`) goes after the bridge on every canvas and reviewer page. Headless Chromium hides scrollbars unless launched without `--hide-scrollbars`, and the bug only shows with the kit's CSS loaded: a copied design without `systems/`, `system-default/` and `kit/` scrolls fine.
|
|
@@ -381,7 +382,7 @@ Before planning or implementing a new feature, read `docs/project-roadmap.md` to
|
|
|
381
382
|
- `src/services/db-ai-tools/` — the AI chat's database tools, `db_query` (read-only), `open_query` (a Query tab holding a script the user runs) and `db_execute` (a change, once, after the user approves it with PPM's password), on the saved connections with *Available to the AI chat* on, each tool on or off in Settings → Tools (`ai.ppm_tools`, all three on by default; `src/shared/ppm-tools.ts`). `db_query` names only the change tools that are on (`dbChangeHint`). `/api/db-tools-mcp` (`db-ai-tools-endpoint.ts`, mounted before auth) is built like `/api/tab-tools-mcp`: `mcp-http-endpoint.ts` + per-session tokens (`db-ai-tools-tokens.ts`). `db-ai-tools-tool.ts` holds the tool definitions and limits, `db-ai-connections.ts` which connections (light on purpose: `chat.service.ts` imports it, and the CLI loads `chat.service.ts`), `db-ai-target.ts` the adapter config with the *tool's* `readonly`, `db-ai-run.ts` the runs (`QueryScriptRun` for reads, `runApprovedScript` for one approved transaction), `db-ai-format.ts` rows as fenced untrusted data, `db-approval-broker.ts` the wait for the user's answer. Shared names and the approval's shape in `src/shared/db-ai-tools.ts`; the password check in `src/services/ppm-password.ts`. Chat side: `announcePpmApproval` / `ppmApprovalResolved` in `src/server/ws/chat.ts`, onto the session's approval slot (`chat-pending-approval.ts`, origin `ppm`; shared with the session tools' cards through `chat-ppm-approvals.ts`); the answer route `POST /api/db/ai-approvals/:requestId` in `src/server/routes/database.ts`. Browser: `src/web/components/chat/db-execute-approval-card.tsx`, `db-tool-card.tsx` + `src/web/lib/db-tool-call.ts`, `openAiQueryTab` in `src/web/lib/open-ai-tab.ts`, and the Query tab's *Run with write access (once)* (`write-once-dialog.tsx`, `writeOnce` on `/query/script`). Docs `docs/architecture/ai-chat-and-providers.md` → AI database tools; e2e `PPM_PLAYWRIGHT_MODULE=<playwright>/index.mjs node tests/e2e/ai-db-tools-e2e.mjs` (scripted provider in `tests/e2e/fixtures/db-tools-server.ts`; `PPM_DB_TOOLS_WEB_DIR` reuses a scratch build).
|
|
382
383
|
- `src/services/agent-transcript/` — one hub per `(providerId, sessionId)` streaming an Agent card's or teammate's own transcript live over `/ws/global`, independent of the chat WebSocket and of whether the root turn is still running. `session-ownership.ts` proves the session belongs to the caller's project before any file is named; `agent-transcript-sources.ts` resolves a card/teammate to the exact file(s), including Codex descendants via `session_meta.parent_thread_id`; `agent-transcript-session-hub.ts` + `agent-transcript-hub.ts` are the per-session tail/page/cursor loop, `agent-transcript-session-hub-activity.ts` the separate "who is running" feed. Protocol in `src/shared/agent-transcript-protocol.ts`; UI entry points `src/web/components/chat/{agent-card-summary,agent-session-window-content,agent-session-sheet,running-agents-bar}.tsx` via `use-agent-session-stream.ts`/`use-agent-activity.ts`; docs `docs/architecture/ai-chat-and-providers.md` → Agent session transcripts
|
|
383
384
|
- `src/services/notification.service.ts` — notifications, configured in Settings → Notifications. `broadcast(type, payload, { stillUnseen })` drops a switched-off event, waits `delay_seconds` (one pending per session: a newer event replaces it) and sends only if `stillUnseen()` still holds — the chat is still unread, and for an approval the same request is still pending (`src/server/ws/chat.ts`); schedules and Jira pass none and always send. `deliver` fans out to push, Telegram and ntfy, plus PPM Cloud's `sendNotification`, which is inert in the server process because that connection lives in the supervisor. Settings shape and defaults in `src/shared/notification-settings.ts`, text and links in `notification-format.ts`. Push is standard Web Push with no dependency, `src/services/web-push/` (VAPID ES256 + RFC 8291 aes128gcm on WebCrypto; keys and subscriptions are the config rows `web_push_vapid` / `web_push_subscriptions` and never reach a browser); the browser half is `src/web/sw.ts` (`push`, and `notificationclick` → `src/web/sw-notification-click.ts`, which hands the session to an open window through `src/web/hooks/use-notification-clicks.ts`) and `src/web/lib/web-push-{support,client}.ts`. Telegram sends through `telegram-notification.service.ts` to the chats in the `telegram_notify_chats` config row, and to nobody else: the PPM Assistant's Telegram side has a bot and chats of its own (`telegram-bots.ts` — the `ppmbot_telegram` row and `clawbot_paired_chats`, names kept from PPMBot so nobody reconnects; both rows sit outside `CONFIG_TABLE_KEYS` like the VAPID key, and an install that shared one bot is split once, on first read). The one-tap Connect link is `telegram-connect.service.ts`, one per bot owner, which polls a bot itself unless the Assistant's Telegram bridge is reading that bot (`assistantBridgeReading`; Telegram allows one `getUpdates` reader per bot; the bots are compared by id, the digits before the token's colon). Every Telegram call goes through `src/services/telegram/` (one Bot API client whose base URL can be overridden only to a loopback address, and the Telegram HTML formatter), faked in tests by `tests/helpers/fake-telegram-bot-api.ts`. ntfy is `ntfy-notification.service.ts`: one JSON publish per notification (the header form cannot carry a non-ASCII title), the config row `ntfy` with its token in `SECRET_CONFIG_KEYS`, dropped when Settings saves a different server so it is not sent to the new one (`PUT /ntfy`; `ppm config set ntfy.server` does not drop it). Both channels take their link back into PPM from `notification-link.ts`: the tunnel URL, else the Tailscale Service address, else localhost — never the LAN address, which is plain HTTP on an insecure origin where the browser withholds every permission PPM asks for. Routes `src/server/routes/notifications.ts` (`/api/notifications/*`), UI `src/web/components/settings/notifications-settings-section.tsx` + `telegram-bot-token-field.tsx` + `ntfy-server-form.tsx`, fake ntfy for tests `tests/helpers/fake-ntfy-server.ts`
|
|
384
|
-
- `src/services/session-collab/` + `src/server/ws/chat-inject.ts` — session collaboration: a chat's AI opens other PPM sessions and messages any session of its project through `create_session`, `send_to_session` and `session_status` on `/api/sessions-mcp` (MCP server `ppm-sessions` / Codex `ppm_sessions`, mounted before auth, per-session capability tokens in `session-collab-tokens.ts`, minted by `chatService.prepareSendOptions`; never for design
|
|
385
|
+
- `src/services/session-collab/` + `src/server/ws/chat-inject.ts` — session collaboration: a chat's AI opens other PPM sessions and messages any session of its project through `create_session`, `send_to_session` and `session_status` on `/api/sessions-mcp` (MCP server `ppm-sessions` / Codex `ppm_sessions`, mounted before auth, per-session capability tokens in `session-collab-tokens.ts`, minted by `chatService.prepareSendOptions`; never for Design chats, which may still be created with `create_session { design }` and messaged — they answer in their reply, which a wait hands back). `design_screenshot` on the same server renders a design's variants to PNG with a headless Chrome/Edge on the host (`src/services/design/shots/`, DevTools over `--remote-debugging-pipe` except on Windows where Bun cannot pass the pipe fds, kept 7 days, served at `/api/design-shots/<id>.png` behind the login), and `report_to_assistant { images }` puts them on a card that Telegram gets as photos (`assistant-telegram-card-photos.ts`); e2e `tests/e2e/collab-design-sessions-e2e.mjs`. `session-collab-endpoint.ts` resolves the caller from its token to its canonical id and project, then rate-limits (`collab-rate-limit.ts`) and dispatches to `collab-create.ts` / `collab-send.ts` / `collab-status.ts`; the rules take one `CollabEnv` (`collab-context.ts`, production `collab-env.ts`) so they are unit-tested without a server. `collab-waits.ts` is the wait registry (first of reply / turn end / timeout / cancel wins), `collab-approval-broker.ts` the create, pair-limit and escalation cards (answered at `POST /api/sessions-collab/approvals/:id`, shown through the generalized slot in `src/server/ws/chat-ppm-approvals.ts`), `pair-counter.ts` the per-pair counts and grants (sidecar `<ppm dir>/session-collab/pairs.json`), `session-links.service.ts` the `spawned_by`/`spawn_depth` columns and `linkedSessions()`. `chat-inject.ts`'s `deliverToSession` is the server's own door into a session — the browser path's `ensureSessionEntry`/`submitToSession` under the same per-session lock — reporting `inserted`/`queued`/`started` truthfully; no route exposes it. Shared shapes `src/shared/session-collab.ts`, settings `src/shared/session-collab-settings.ts` (`ai.session_collab`), the message block `src/shared/chat-from-session.ts`; routes `src/server/routes/session-collab.ts` (approvals, `…/sessions/:id/links`, `…/stop-children`). UI `src/web/components/chat/{from-session-bubble,session-collab-tool-card,linked-sessions-bar,linked-session-chip,spawned-session-badge,collab-approval-card}.tsx`, state `src/web/stores/session-collab-store.ts` + `src/web/hooks/use-linked-sessions.ts`. Docs `docs/architecture/ai-chat-and-providers.md` → Session collaboration; e2e `tests/e2e/session-collab-e2e.mjs` (run it in the image from `tests/e2e/docker/Dockerfile`)
|
|
385
386
|
- `src/services/session-turns/` — cross-session turn references: one chat points at single turns of other Claude/Codex sessions (chips) and its AI reads them (`search_sessions`, `list_session_turns`, `read_session_turns` on `/api/tab-tools-mcp`). `session-turn-index.service.ts` resolves a session only through `assertSessionInProject` and scans it incrementally (`turn-index-claude.ts`, `turn-index-codex.ts`, cached by `turn-index-cache.ts`), `session-turn-reader.ts` reads turns by byte range and answers `stale` rather than another turn, `stamp-message-turns.ts` puts `turnId`/`turnN` on every history message, `turn-grant-ledger.ts` is the only thing that lets the AI read another project's turn (written by the chat socket from a browser send's `turnRefs`, `<ppm dir>/session-turn-grants/`), `turn-access.ts` enforces it, `turn-render.ts` renders a turn without raw tool output, `session-search.ts` searches `search-index-v3.db`. Routes `src/server/routes/chat-session-turns.ts` (`/turns`, `/turns/:turnId`) and `chat-turn-window.ts` (`/turn-window`); the tools in `src/services/tab-tools-mcp/session-history-*.ts`; block codec `src/shared/chat-turn-ref.ts` + `chat-message-blocks.ts`; real-prompt predicate `src/shared/user-prompt-kind.ts`. UI: `copy-turn-link-button.tsx`, `turn-ref-chip.tsx`, `use-composer-turn-refs.ts`, `turn-binding-store.ts`, `open-turn-ref.ts`, and the history window (`chat-history-window.tsx`, `use-history-window.ts`, `use-scroll-anchor-pin.ts`, `use-chat-turn-jump.ts`). Docs `docs/architecture/ai-chat-and-providers.md` → Session turn references and `workspace-and-ui.md` → Turn links, chips and the history window; e2e `PPM_PLAYWRIGHT_MODULE=<playwright-core>/index.mjs node tests/e2e/session-turn-refs-e2e.mjs`
|
|
386
387
|
- `src/services/feature-intros.service.ts` — the tour's "PPM has new features" step: a new feature that stays off until the install says Turn on or Turn off, asked once per install, not per browser. The registry is `FEATURE_INTROS` in `src/shared/feature-intros.ts` (adding a feature is one entry with a new, never-reused `id`); the state is the config key `feature_intros` behind `/api/feature-intros` (`src/server/routes/feature-intros.ts`), and every change goes out as `feature-intros:changed` on `/ws/global`. The answer itself is explicit switches in `ai.ppm_tools`: `ppmToolOn` keeps an introduced feature's tools off until one of its switches is set, so every server path agrees with no extra state, and a switch saved in Settings → Tools counts as the answer. An install is "in use" once it has a chat session (projects do not count: `ppm init` adds every git repo it finds); an install in use gets the step at once and no basic-tour offer, a new one after its tour. One skip counts per feature per 12 hours, three leave it off and NEW in Settings → Tools, and a late answer never overwrites a feature already decided. UI `src/web/components/onboarding/onboarding-feature-intro.tsx` (mounted by `onboarding-root.tsx`), `src/web/stores/feature-intros-store.ts`, `src/web/lib/onboarding/feature-intros-client.ts`, `src/web/components/settings/use-new-feature-tools.ts`; docs `docs/architecture/workspace-and-ui.md` → "PPM has new features"; e2e `node tests/e2e/feature-intros-e2e.mjs` (capped Docker image, one fresh install per scenario). An e2e fixture that seeds a project or chat must answer the question at startup (`answerFeatureIntro(id, …)`), or the step covers what it clicks
|
|
387
388
|
- `src/services/session-file-baselines/` — the session review (the changes chip in the chat footer and the block-by-block Review tab): `session-file-baselines.service.ts` keeps each file's state from before the session's first write (`<ppm dir>/session-baselines/<session id>/`, first capture wins, 5 MB cap, credential paths never copied, 30-day prune), `session-file-changes.service.ts` compares it with the disk (git HEAD only as a fallback inside the project), keeps each session's list between asks to work out again only the files whose `stat` stamp moved, and pushes the rows of a file a call just wrote (`session-file-writes.ts`, `session:file-changes` on `/ws/global`), `reverse-unified-diff.ts` works a Codex patch's "before" out, `shell-change-tracker.ts` brackets each Claude shell command with `git status`, `session-review-marks.ts` keeps what the user marked reviewed (a snapshot per file under `<session dir>/reviewed/`, written only at the version the browser showed; a file changed after its mark is diffed against the mark). Blocks are cut by `src/shared/review-blocks.ts`, shared because the server cuts them again from the disk before acting on a key the browser sent; `session-review-blocks.ts` records the kept ones per base hash, and `session-review-actions.ts` keeps, reopens and reverts blocks or whole files on disk (`/file-changes/answer`, refused as `stale` unless the file is at the version drawn) and undoes any answer all-or-nothing from its journal (`/file-changes/undo`). `session-file-history.ts` logs each file's state just before and after every call that writes it (`<session dir>/history/`, as line deltas), `session-file-blame.ts` replays that log to name the calls behind each block, and `session-turn-revert.ts` puts a turn's calls back where their lines are still intact (`/file-changes/revert-turn`: a preview first, then `stale` unless every file is at the previewed version). Captured by the Claude PreToolUse file-write hook and the shell hooks around each `Bash` call (`buildToolHooks` in `claude-agent-sdk-query-options.ts`) and by `codex-file-baselines.ts`. Routes `src/server/routes/chat-file-changes.ts`, shapes `src/shared/session-file-changes.ts`; UI `src/web/components/chat/session-changes-chip.tsx` + `session-change-row.tsx`, and `src/web/components/session-review/` (`review-desktop.tsx`, `review-phone.tsx` below `md`, `review-code.tsx` for the blocks and their turn chips, `review-tokens.tsx` for shiki colours), the chat's per-answer pill and tray `src/web/components/chat/turn-change-{rollup,tray,sheet,review}.tsx` over `src/web/hooks/use-turn-review.ts` + `src/web/lib/turn-review.ts` (the list reaches them through `session-changes-context.tsx`), turns from `src/web/lib/session-turns.ts` through `src/web/stores/session-turns-store.ts` (published by the chat, read by `use-session-turns.ts` when no chat is open), Show in chat through `src/web/stores/chat-jump-store.ts`, state `src/web/hooks/use-session-review.ts` over the pure `src/web/lib/session-review-model.ts`, data `src/web/hooks/use-session-file-changes.ts` + `src/web/lib/session-file-changes{,-client}.ts`; docs `docs/architecture/session-changes-and-review.md`; e2e `bun tests/e2e/session-changes-e2e.mjs`
|
|
@@ -83,4 +83,4 @@ This skill covers the `ppm` CLI, its HTTP API, and its config DB. It does **not*
|
|
|
83
83
|
- Third-party extensions (inspect via `ppm ext list`).
|
|
84
84
|
- The Claude Agent SDK internals (separate skill).
|
|
85
85
|
|
|
86
|
-
<!-- Generated for PPM v0.25.
|
|
86
|
+
<!-- Generated for PPM v0.25.9 at build time. Re-run `ppm export skill --install` to refresh. -->
|
|
@@ -246,6 +246,10 @@ JSON responses are wrapped: `{ "ok": true, "data": … }` or `{ "ok": false, "er
|
|
|
246
246
|
|
|
247
247
|
- `GET /api/design-shares/address`
|
|
248
248
|
|
|
249
|
+
## /api/design-shots
|
|
250
|
+
|
|
251
|
+
- `GET /api/design-shots/:file`
|
|
252
|
+
|
|
249
253
|
## /api/extensions
|
|
250
254
|
|
|
251
255
|
- `POST /api/extensions/commands/execute`
|
|
@@ -843,4 +847,4 @@ Authenticate with `?token=<token>` (see Authentication).
|
|
|
843
847
|
- `/ws/android`
|
|
844
848
|
- `/ws/project/<project>/<type>/<id>` — `<type>`: `terminal`, `chat`, `group`, `lsp` (for `chat`, `<id>` is the session id)
|
|
845
849
|
|
|
846
|
-
<!-- Generated from src/server/routes/ for PPM v0.25.
|
|
850
|
+
<!-- Generated from src/server/routes/ for PPM v0.25.9 -->
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-WX6NXGTJ.js";import"./vendor-ui-XWGn718B.js";import{At as r,J as i,Qr as a,Sn as o,_r as s,gr as c,gt as l,ht as u,lr as d,qr as f,ui as p,un as m,ut as h,wn as g,wr as _}from"./icons-CXY5ue_g.js";import{a as v,r as y}from"./api-client-vI7TyFOL.js";import{n as b}from"./utils-DMiycH3O.js";import"./portal-container-context-tAk8C8AE.js";import{i as x,n as S,t as C}from"./tooltip-CCx1ynhU.js";import{t as w}from"./mobile-bottom-sheet-CR0IYSBI.js";import"./use-visual-viewport-CFeFggvP.js";import{n as T}from"./use-is-mobile-_O8suyE-.js";import{r as E,t as D}from"./button-BCTqB-tu.js";import{a as O,i as k,n as A,o as j,r as M,t as N}from"./dialog-CoO-z2qj.js";import"./chat-preparation-cache-BjKMLTNJ.js";import"./provider-logos-m5ZC_yzc.js";import{t as P}from"./provider-selector-DcPsEA72.js";import{r as F}from"./clipboard-SyUe4kh-.js";import{t as I}from"./input-CcBfRi6-.js";import{S as L,a as R,b as z,g as B,h as ee,m as te,o as ne,r as V,v as re,y as H}from"./api-settings-D4cXrjrY.js";import{Fn as ie,In as ae,Ln as U,Mn as W,Nn as G,Pn as K,vr as q}from"./index-rFeA9cN0.js";import{C as oe,_ as J,a as se,b as ce,c as le,d as ue,f as Y,g as de,i as X,l as fe,m as Z,n as pe,o as me,p as he,r as ge,s as _e,t as ve,v as ye}from"./antigravity-usage-view-BBxDn7OP.js";var Q=e(t(),1),$=n(),be=[`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`,`Sun`],xe=Array.from({length:24},(e,t)=>t);function Se(e,t){let n=Array.from({length:7},()=>Array.from({length:24},()=>({sum:0,count:0,avg:0})));for(let r of e){let e=t===`5h`?r.five_hour_util:r.weekly_util;if(e==null)continue;let i=new Date(r.recorded_at+(r.recorded_at.endsWith(`Z`)?``:`Z`)),a=(i.getDay()+6)%7,o=i.getHours();n[a][o].sum+=e,n[a][o].count+=1}for(let e of n)for(let t of e)t.avg=t.count>0?t.sum/t.count:0;return n}function Ce(e){return e.map(e=>{let t=e.reduce((e,t)=>e+t.sum,0),n=e.reduce((e,t)=>e+t.count,0);return n>0?t/n:0})}function we(e){return xe.map(t=>{let n=0,r=0;for(let i of e)n+=i[t].sum,r+=i[t].count;return r>0?n/r:0})}function Te(e){return e===0?`bg-surface-elevated`:e<.3?`bg-success/30`:e<.5?`bg-success/60`:e<.7?`bg-warning/50`:e<.9?`bg-warning/80`:`bg-error/80`}function Ee(e){return e<.3?`bg-success`:e<.7?`bg-warning`:`bg-error`}function De({accountId:e}){let[t,n]=(0,Q.useState)(null),[r,i]=(0,Q.useState)(!0),[a,s]=(0,Q.useState)(`5h`);(0,Q.useEffect)(()=>{i(!0),te(e).then(n).catch(()=>n([])).finally(()=>i(!1))},[e]);let c=(0,Q.useMemo)(()=>t?Se(t,a):null,[t,a]),l=(0,Q.useMemo)(()=>c?Ce(c):[],[c]),u=(0,Q.useMemo)(()=>c?we(c):[],[c]),d=Math.max(...l,.01);if(Math.max(...u,.01),r)return(0,$.jsx)(`div`,{className:`flex items-center justify-center py-3`,children:(0,$.jsx)(o,{className:`size-3 animate-spin text-text-subtle`})});if(!t||t.length===0)return(0,$.jsx)(`div`,{className:`text-[10px] text-text-subtle py-2 text-center`,children:`No usage history yet`});let f=t.length,p=new Set(t.map(e=>new Date(e.recorded_at+(e.recorded_at.endsWith(`Z`)?``:`Z`)).toDateString())).size;return(0,$.jsxs)(`div`,{className:`mt-2 space-y-2`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,$.jsx)(`span`,{className:`text-[10px] font-medium text-text-subtle`,children:`Usage Pattern (7d)`}),(0,$.jsxs)(`div`,{className:`flex gap-0.5 text-[9px]`,children:[(0,$.jsx)(`button`,{onClick:()=>s(`5h`),className:`px-1.5 py-0.5 rounded cursor-pointer transition-colors ${a===`5h`?`bg-primary/15 text-primary`:`text-text-subtle hover:text-text-secondary`}`,title:`5-hour rolling window limit — resets every 5 hours`,children:`5h`}),(0,$.jsx)(`button`,{onClick:()=>s(`weekly`),className:`px-1.5 py-0.5 rounded cursor-pointer transition-colors ${a===`weekly`?`bg-primary/15 text-primary`:`text-text-subtle hover:text-text-secondary`}`,title:`Weekly limit — resets every 7 days`,children:`Wk`})]})]}),(0,$.jsxs)(`p`,{className:`text-[9px] text-text-subtle leading-tight`,children:[`Avg `,a===`5h`?`5-hour`:`weekly`,` limit usage over `,p,`d (`,f,` samples). Higher % = closer to rate limit. Hover cells for details.`]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`span`,{className:`text-[9px] text-text-subtle`,children:`Avg usage by day of week`}),(0,$.jsx)(`div`,{className:`flex flex-col gap-[2px] mt-0.5`,children:be.map((e,t)=>{let n=l[t]??0;return(0,$.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,$.jsx)(`span`,{className:`text-[8px] text-text-subtle w-5 shrink-0 text-right tabular-nums`,children:e}),(0,$.jsx)(`div`,{className:`flex-1 h-2.5 bg-surface-elevated rounded-sm overflow-hidden`,children:(0,$.jsx)(`div`,{className:`h-full rounded-sm transition-all ${Ee(n)}`,style:{width:`${Math.round(n/d*100)}%`}})}),(0,$.jsxs)(`span`,{className:`text-[8px] text-text-subtle w-6 shrink-0 text-right tabular-nums`,children:[Math.round(n*100),`%`]})]},e)})})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`span`,{className:`text-[9px] text-text-subtle`,children:`Avg usage by hour (0h-23h)`}),(0,$.jsx)(`div`,{className:`flex gap-[1px] mt-0.5`,children:xe.map(e=>{let t=u[e]??0;return(0,$.jsxs)(`div`,{className:`flex-1 flex flex-col items-center gap-[1px]`,children:[(0,$.jsx)(`div`,{className:`w-full aspect-square rounded-[2px] ${Te(t)}`,title:`${e}:00 — avg ${Math.round(t*100)}% usage`}),e%6==0&&(0,$.jsx)(`span`,{className:`text-[7px] text-text-subtle tabular-nums`,children:e})]},e)})})]}),c&&(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`span`,{className:`text-[9px] text-text-subtle`,children:`Day x Hour heatmap`}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-[1px] mt-0.5`,children:[be.map((e,t)=>(0,$.jsxs)(`div`,{className:`flex items-center gap-[1px]`,children:[(0,$.jsx)(`span`,{className:`text-[7px] text-text-subtle w-4 shrink-0 text-right`,children:e.charAt(0)}),xe.map(n=>{let r=c[t][n];return(0,$.jsx)(`div`,{className:`flex-1 aspect-square rounded-[1px] ${Te(r.avg)}`,title:`${e} ${n}:00 — ${r.count>0?`avg ${Math.round(r.avg*100)}% (${r.count} samples)`:`no data`}`},n)})]},e)),(0,$.jsxs)(`div`,{className:`flex items-center gap-[1px]`,children:[(0,$.jsx)(`span`,{className:`w-4 shrink-0`}),xe.map(e=>(0,$.jsx)(`div`,{className:`flex-1 text-center`,children:e%6==0&&(0,$.jsx)(`span`,{className:`text-[7px] text-text-subtle tabular-nums`,children:e})},e))]})]})]}),(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[8px] text-text-subtle`,children:[(0,$.jsx)(`span`,{children:`Low`}),(0,$.jsxs)(`div`,{className:`flex gap-[2px]`,children:[(0,$.jsx)(`div`,{className:`size-2 rounded-[1px] bg-success/30`}),(0,$.jsx)(`div`,{className:`size-2 rounded-[1px] bg-success/60`}),(0,$.jsx)(`div`,{className:`size-2 rounded-[1px] bg-warning/50`}),(0,$.jsx)(`div`,{className:`size-2 rounded-[1px] bg-warning/80`}),(0,$.jsx)(`div`,{className:`size-2 rounded-[1px] bg-error/80`})]}),(0,$.jsx)(`span`,{children:`High`}),(0,$.jsx)(`span`,{className:`ml-1`,children:`|`}),(0,$.jsx)(`div`,{className:`size-2 rounded-[1px] bg-surface-elevated border border-border/30`}),(0,$.jsx)(`span`,{children:`No data`})]})]})}function Oe({profile:e,accountId:t,onClose:n}){let r=[[`Name`,e.account?.display_name],[`Email`,e.account?.email],[`Org`,e.organization?.name],[`Type`,e.organization?.organization_type],[`Tier`,e.organization?.rate_limit_tier],[`Status`,e.organization?.subscription_status]];return(0,$.jsxs)(`section`,{className:`space-y-2 border-t border-border pt-3`,"data-testid":`account-profile-panel`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,$.jsx)(`h3`,{className:`text-sm font-medium`,children:`Profile`}),(0,$.jsx)(`button`,{className:`p-2 text-muted-foreground hover:text-foreground cursor-pointer`,onClick:n,"aria-label":`Close profile`,children:(0,$.jsx)(p,{className:`size-4`})})]}),(0,$.jsx)(`div`,{className:`grid grid-cols-[80px_1fr] gap-x-3 gap-y-1 text-xs`,children:r.map(([e,t])=>t?(0,$.jsxs)(`span`,{className:`contents`,children:[(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:e}),(0,$.jsx)(`span`,{className:`break-all`,children:t})]},e):null)}),(0,$.jsx)(De,{accountId:t})]})}function ke({display:e,onConfirm:t,onCancel:n}){let r=T(),i=(0,$.jsxs)(`div`,{className:`space-y-4`,"data-testid":`account-delete-confirm`,children:[(0,$.jsxs)(`p`,{className:`text-sm`,children:[`Remove `,(0,$.jsx)(`span`,{className:`font-medium`,children:e}),`?`]}),(0,$.jsx)(`p`,{className:`text-xs text-text-subtle`,children:`The stored token is deleted from this machine. Any export you already made keeps working.`}),(0,$.jsxs)(`div`,{className:`flex flex-col-reverse md:flex-row gap-2 md:justify-end pt-2`,children:[(0,$.jsx)(D,{variant:`outline`,onClick:n,className:`min-h-11`,children:`Cancel`}),(0,$.jsx)(D,{variant:`destructive`,autoFocus:!1,onClick:t,className:`min-h-11`,children:`Remove account`})]})]});return r?(0,$.jsx)(w,{open:!0,onClose:n,children:(0,$.jsxs)(`div`,{className:`px-4 pb-4`,children:[(0,$.jsx)(`h2`,{className:`text-base font-semibold mb-3`,children:`Remove account`}),i]})}):(0,$.jsx)(N,{open:!0,onOpenChange:e=>{e||n()},children:(0,$.jsxs)(A,{className:`sm:max-w-sm`,children:[(0,$.jsx)(O,{children:(0,$.jsx)(j,{className:`text-sm`,children:`Remove account`})}),i]})})}var Ae=80;function je({current:e,onSave:t,onCancel:n}){let r=T(),[i,a]=(0,Q.useState)(e),[s,c]=(0,Q.useState)(!1),[l,u]=(0,Q.useState)(null),d=i.trim(),f=!!d&&d!==e&&!s,p=async()=>{if(f){c(!0),u(null);try{await t(d)}catch(e){u(e.message||`Could not rename the account`),c(!1)}}},m=()=>{s||n()},h=(0,$.jsxs)(`form`,{className:`space-y-4`,"data-testid":`account-rename-dialog`,onSubmit:e=>{e.preventDefault(),p()},children:[(0,$.jsx)(I,{autoFocus:!0,value:i,maxLength:Ae,onChange:e=>a(e.target.value),placeholder:`e.g. Personal, Work`,"aria-label":`Account name`,className:`min-h-11 text-sm md:min-h-9`}),l&&(0,$.jsx)(`p`,{className:`text-xs text-error`,role:`alert`,children:l}),(0,$.jsxs)(`div`,{className:`flex flex-col-reverse md:flex-row gap-2 md:justify-end`,children:[(0,$.jsx)(D,{type:`button`,variant:`outline`,onClick:m,disabled:s,className:`min-h-11 md:min-h-9`,children:`Cancel`}),(0,$.jsxs)(D,{type:`submit`,disabled:!f,className:`min-h-11 md:min-h-9`,children:[s&&(0,$.jsx)(o,{className:`size-4 animate-spin`}),` Save`]})]})]});return r?(0,$.jsx)(w,{open:!0,onClose:m,children:(0,$.jsxs)(`div`,{className:`px-4 pb-4`,children:[(0,$.jsx)(`h2`,{className:`text-base font-semibold mb-3`,children:`Rename account`}),h]})}):(0,$.jsx)(N,{open:!0,onOpenChange:e=>{e||m()},children:(0,$.jsxs)(A,{className:`sm:max-w-sm`,children:[(0,$.jsx)(O,{children:(0,$.jsx)(j,{className:`text-sm`,children:`Rename account`})}),h]})})}function Me(e){let t=new Blob([e],{type:`application/json`}),n=document.createElement(`a`);n.href=URL.createObjectURL(t),n.download=`ppm-accounts-backup.json`,n.click(),URL.revokeObjectURL(n.href)}function Ne({open:e,onOpenChange:t,accounts:n,preselectId:r,onMessage:i}){let a=n.filter(e=>e.hasRefreshToken),[s,c]=(0,Q.useState)(new Set),[l,d]=(0,Q.useState)(``),[f,p]=(0,Q.useState)(!1),[m,_]=(0,Q.useState)(!1),[y,b]=(0,Q.useState)(!1),[x,S]=(0,Q.useState)(!1);e&&!x&&(c(r?new Set([r]):new Set(a.map(e=>e.id))),S(!0)),!e&&x&&S(!1);function C(){t(!1),d(``),p(!1),_(!1)}async function w(e){if(s.size===0)return;b(!0);let t=l.trim()||`ppm-hienlh`;try{let n={"Content-Type":`application/json`},r=v();r&&(n.Authorization=`Bearer ${r}`);let a=await fetch(`/api/accounts/export`,{method:`POST`,headers:n,body:JSON.stringify({password:t,accountIds:[...s],includeRefreshToken:f,refreshBeforeExport:m})});if(!a.ok){let e=await a.json();throw Error(e.error??`Export failed: ${a.status}`)}let o=await a.text();e&&await F(o)?i?.(`Backup copied to clipboard!`):(Me(o),i?.(`Backup downloaded.`)),C()}catch{}b(!1)}let T=s.size>0&&!y;return(0,$.jsx)(N,{open:e,onOpenChange:e=>{e||C()},children:(0,$.jsxs)(A,{className:`sm:max-w-md`,children:[(0,$.jsxs)(O,{children:[(0,$.jsxs)(j,{className:`text-sm flex items-center gap-1.5`,children:[(0,$.jsx)(g,{className:`size-3.5`}),` Export Accounts`]}),(0,$.jsx)(M,{className:`text-xs`,children:`Select accounts and set a password to protect the backup.`})]}),(0,$.jsxs)(`div`,{className:`space-y-3`,children:[(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between mb-1`,children:[(0,$.jsx)(`p`,{className:`text-[11px] font-medium text-muted-foreground`,children:`Accounts to export`}),(0,$.jsx)(`button`,{className:`text-[10px] text-primary hover:underline cursor-pointer`,onClick:()=>c(s.size===a.length?new Set:new Set(a.map(e=>e.id))),children:s.size===a.length?`Deselect all`:`Select all`})]}),a.length===0?(0,$.jsx)(`p`,{className:`text-[10px] text-muted-foreground p-2 border rounded`,children:`No exportable accounts.`}):(0,$.jsx)(`div`,{className:`max-h-36 overflow-y-auto space-y-1 border rounded p-2`,children:a.map(e=>(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`input`,{type:`checkbox`,id:`exp-${e.id}`,checked:s.has(e.id),onChange:t=>{let n=new Set(s);t.target.checked?n.add(e.id):n.delete(e.id),c(n)},className:`size-3.5 accent-primary cursor-pointer`}),(0,$.jsx)(`label`,{htmlFor:`exp-${e.id}`,className:`text-xs cursor-pointer truncate`,children:e.label??e.email??e.id.slice(0,8)})]},e.id))})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsxs)(q,{className:`text-xs`,children:[`Password `,(0,$.jsx)(`span`,{className:`text-muted-foreground font-normal`,children:`(optional)`})]}),(0,$.jsx)(I,{type:`password`,placeholder:`Leave empty for default`,value:l,onChange:e=>d(e.target.value),className:`text-xs h-8`,autoComplete:`new-password`})]}),(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`input`,{type:`checkbox`,id:`exp-full`,checked:f,onChange:e=>p(e.target.checked),className:`size-3.5 accent-primary cursor-pointer`}),(0,$.jsx)(`label`,{htmlFor:`exp-full`,className:`text-[11px] cursor-pointer`,children:`Include refresh tokens (full transfer)`})]}),(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`input`,{type:`checkbox`,id:`exp-refresh`,checked:m,onChange:e=>_(e.target.checked),className:`size-3.5 accent-primary cursor-pointer`}),(0,$.jsx)(`label`,{htmlFor:`exp-refresh`,className:`text-[11px] cursor-pointer`,children:`Refresh tokens before export`})]}),f?(0,$.jsxs)(`div`,{className:`rounded-md border border-error/30 bg-error/5 p-2.5`,children:[(0,$.jsx)(`p`,{className:`text-[10px] font-medium text-error`,children:`Full transfer — source accounts will expire`}),(0,$.jsx)(`p`,{className:`text-[10px] text-muted-foreground`,children:`Refresh tokens included. Source machine expires in ~1h after target refreshes.`})]}):m?(0,$.jsx)(`div`,{className:`rounded-md border border-warning/30 bg-warning/5 p-2.5`,children:(0,$.jsx)(`p`,{className:`text-[10px] font-medium text-warning`,children:`Refresh before export — invalidates previous shares`})}):(0,$.jsx)(`div`,{className:`rounded-md border border-success/30 bg-success/5 p-2.5`,children:(0,$.jsx)(`p`,{className:`text-[10px] font-medium text-success`,children:`Share current token (safe)`})}),(0,$.jsx)(`p`,{className:`text-[10px] text-muted-foreground`,children:`Encrypted with AES-256-GCM + scrypt.`})]}),(0,$.jsxs)(k,{className:`gap-1.5 flex-col sm:flex-row`,children:[(0,$.jsx)(D,{size:`sm`,variant:`outline`,className:`text-xs h-7 cursor-pointer`,onClick:C,children:`Cancel`}),(0,$.jsxs)(D,{size:`sm`,variant:`outline`,className:`text-xs h-7 cursor-pointer`,disabled:!T,onClick:()=>w(!0),children:[(0,$.jsx)(h,{className:`size-3 mr-1`}),` Copy`]}),(0,$.jsx)(D,{size:`sm`,className:`text-xs h-7 cursor-pointer`,disabled:!T,onClick:()=>w(!1),children:y?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(o,{className:`size-3 animate-spin mr-1`}),` Exporting...`]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(u,{className:`size-3 mr-1`}),` Download`]})})]})]})})}function Pe({open:e,onOpenChange:t,onSuccess:n}){let[r,i]=(0,Q.useState)(``),[a,s]=(0,Q.useState)(``),[c,l]=(0,Q.useState)(!1),[u,d]=(0,Q.useState)(null);function f(){t(!1),i(``),s(``),d(null)}async function p(){if(r.trim()){l(!0),d(null);try{let e=await ee({data:r.trim(),password:a.trim()||`ppm-hienlh`});f(),n(`Imported ${e.imported} account(s)`)}catch(e){d(e.message||`Import failed`)}l(!1)}}return(0,$.jsx)(N,{open:e,onOpenChange:e=>{e||f()},children:(0,$.jsxs)(A,{className:`sm:max-w-md`,children:[(0,$.jsxs)(O,{children:[(0,$.jsxs)(j,{className:`text-sm flex items-center gap-1.5`,children:[(0,$.jsx)(g,{className:`size-3.5`}),` Import Accounts`]}),(0,$.jsx)(M,{className:`text-xs`,children:`Paste backup data and enter the export password. Imported accounts are temporary (~1h).`})]}),(0,$.jsxs)(`div`,{className:`space-y-3`,children:[(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(q,{className:`text-xs`,children:`Backup data`}),(0,$.jsx)(`textarea`,{value:r,onChange:e=>i(e.target.value),placeholder:`Paste backup JSON here...`,rows:4,className:`w-full text-xs p-2 rounded border border-border bg-background font-mono resize-none focus:outline-none focus:ring-1 focus:ring-primary`})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsxs)(q,{className:`text-xs`,children:[`Password `,(0,$.jsx)(`span`,{className:`text-muted-foreground font-normal`,children:`(optional)`})]}),(0,$.jsx)(I,{type:`password`,placeholder:`Leave empty for default`,value:a,onChange:e=>s(e.target.value),className:`text-xs h-8`,autoComplete:`current-password`})]})]}),u&&(0,$.jsx)(`div`,{className:`text-[11px] p-2 rounded bg-error/10 text-error`,children:u}),(0,$.jsxs)(k,{children:[(0,$.jsx)(D,{size:`sm`,variant:`outline`,className:`text-xs h-7 cursor-pointer`,onClick:f,children:`Cancel`}),(0,$.jsx)(D,{size:`sm`,className:`text-xs h-7 cursor-pointer`,disabled:!r.trim()||c,onClick:p,children:c?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(o,{className:`size-3 animate-spin mr-1`}),` Importing...`]}):`Import`})]})]})})}var Fe=typeof window<`u`?window.matchMedia(`(min-width: 768px)`):null;function Ie(e){return Fe?.addEventListener(`change`,e),()=>Fe?.removeEventListener(`change`,e)}function Le(){return Fe?.matches??!0}function Re(){let[e,t]=(0,Q.useState)(null),[n,r]=(0,Q.useState)(!0);return(0,Q.useEffect)(()=>{r(!0),ne().then(t).finally(()=>r(!1))},[]),n?(0,$.jsx)(`p`,{className:`text-xs text-text-subtle py-4 text-center`,children:`Loading...`}):e?(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(`label`,{className:`text-xs font-medium text-text-primary`,children:`Rotation Strategy`}),(0,$.jsxs)(W,{value:e.strategy,onValueChange:async e=>{t(await L({strategy:e}))},children:[(0,$.jsx)(ie,{className:`w-full h-9 text-xs`,children:(0,$.jsx)(ae,{})}),(0,$.jsxs)(G,{children:[(0,$.jsx)(K,{value:`round-robin`,children:`Round-robin`}),(0,$.jsx)(K,{value:`fill-first`,children:`Fill-first`}),(0,$.jsx)(K,{value:`lowest-usage`,children:`Lowest usage`})]})]}),(0,$.jsxs)(`p`,{className:`text-[10px] text-text-subtle`,children:[e.strategy===`round-robin`&&`Cycles through accounts evenly`,e.strategy===`fill-first`&&`Uses one account until its limit, then moves on`,e.strategy===`lowest-usage`&&`Picks the account with the lowest current usage`]})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(`label`,{className:`text-xs font-medium text-text-primary`,children:`Max Retry`}),(0,$.jsx)(`input`,{type:`number`,min:0,value:e.maxRetry,className:`w-full h-9 text-xs border rounded-md px-3 bg-background`,onChange:async e=>{let n=parseInt(e.target.value,10);!isNaN(n)&&n>=0&&t(await L({maxRetry:n}))}}),(0,$.jsx)(`p`,{className:`text-[10px] text-text-subtle`,children:`How many accounts to try on failure. 0 = try all available accounts.`})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5 border-t border-border pt-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,$.jsx)(`label`,{className:`text-xs font-medium text-text-primary`,children:`Cooldown parking`}),(0,$.jsx)(U,{checked:e.cooldownEnabled,onCheckedChange:async e=>{t(await L({cooldownEnabled:e}))}})]}),(0,$.jsx)(`p`,{className:`text-[10px] text-text-subtle`,children:`Park a failing account (rate limit / usage limit / auth error) until it recovers. Off: accounts stay selectable — rotation still skips accounts already ≥95% on the 5-hour limit.`})]}),(0,$.jsxs)(`div`,{className:`flex items-center justify-between text-xs border-t border-border pt-3`,children:[(0,$.jsx)(`span`,{className:`text-text-subtle`,children:`Active accounts`}),(0,$.jsx)(`span`,{className:`font-medium text-text-primary`,children:e.activeCount})]})]}):(0,$.jsx)(`p`,{className:`text-xs text-text-subtle py-4 text-center`,children:`Failed to load settings`})}function ze({open:e,onOpenChange:t}){let n=(0,Q.useSyncExternalStore)(Ie,Le);return e?n?(0,$.jsx)(N,{open:e,onOpenChange:t,children:(0,$.jsxs)(A,{className:`sm:max-w-sm`,children:[(0,$.jsx)(O,{children:(0,$.jsxs)(j,{className:`text-sm flex items-center gap-2`,children:[(0,$.jsx)(_,{className:`size-4`}),` Rotation & Retry`]})}),(0,$.jsx)(Re,{})]})}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{className:`fixed inset-0 z-50 transition-opacity duration-200 opacity-100`,onClick:()=>t(!1),style:{backgroundColor:`rgba(0,0,0,0.5)`}}),(0,$.jsxs)(`div`,{className:b(`fixed bottom-0 left-0 right-0 z-50 bg-background rounded-t-2xl border-t border-border shadow-2xl`,`transition-transform duration-300 ease-out max-h-[85vh] overflow-y-auto`,`translate-y-0`),children:[(0,$.jsx)(`div`,{className:`flex justify-center pt-3 pb-1`,children:(0,$.jsx)(`div`,{className:`w-10 h-1 rounded-full bg-border`})}),(0,$.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-2 border-b border-border`,children:[(0,$.jsxs)(`span`,{className:`text-sm font-semibold flex items-center gap-2`,children:[(0,$.jsx)(_,{className:`size-4`}),` Rotation & Retry`]}),(0,$.jsx)(`button`,{onClick:()=>t(!1),className:`flex items-center justify-center size-7 rounded-md hover:bg-surface-elevated transition-colors`,children:(0,$.jsx)(p,{className:`size-4`})})]}),(0,$.jsx)(`div`,{className:`px-4 py-4 pb-8`,children:(0,$.jsx)(Re,{})})]})]}):null}var Be=E(`inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2`,{variants:{variant:{default:`border-transparent bg-primary text-primary-foreground shadow`,secondary:`border-transparent bg-secondary text-secondary-foreground`,destructive:`border-transparent bg-destructive text-destructive-foreground shadow`,outline:`text-foreground`}},defaultVariants:{variant:`default`}});function Ve({className:e,variant:t,...n}){return(0,$.jsx)(`div`,{className:b(Be({variant:t}),e),...n})}function He(e){let t=Math.floor(Date.now()/1e3);return e>t?`${Math.floor((e-t)/60)}m`:`exp`}function Ue({accounts:e}){let[t,n]=(0,Q.useState)([]),[r,i]=(0,Q.useState)(!1),[a,s]=(0,Q.useState)(!1),[c,l]=(0,Q.useState)(new Map),u=e.filter(e=>e.hasRefreshToken);async function d(){if(u.length!==0){i(!0);try{let e=await H(u.map(e=>e.id),a);n(t=>[...t,{round:t.length+1,time:new Date().toLocaleTimeString(),includeRefresh:a,items:e}])}catch{}i(!1)}}async function f(e,t){l(t=>new Map(t).set(e,{loading:!0}));try{let n=await z(t);l(t=>new Map(t).set(e,{loading:!1,...n}))}catch(t){l(n=>new Map(n).set(e,{loading:!1,status:`error`,error:t.message}))}}function p(e,t){return[{key:`r${e.round}-pre-${t.id}`,label:`Pre-export`,token:t.preExportTokenFull,preview:t.preExportToken,expires:t.preExportExpires},{key:`r${e.round}-exp-${t.id}`,label:`Exported`,token:t.exportedTokenFull,preview:t.exportedToken,expires:t.exportedExpires},{key:`r${e.round}-post-${t.id}`,label:`Post-export`,token:t.postExportTokenFull,preview:t.postExportToken,expires:t.postExportExpires}]}function m(){for(let e of t)for(let t of e.items)for(let n of p(e,t))n.token&&f(n.key,n.token)}return(0,$.jsxs)(`section`,{className:`border-t pt-4 space-y-2`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,$.jsx)(`p`,{className:`text-xs font-medium`,children:`Simulate export`}),t.length>0&&(0,$.jsxs)(`span`,{className:`text-[10px] text-muted-foreground`,children:[t.length,` round(s)`]})]}),(0,$.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Every run appends a round. Earlier rounds are kept so tokens can be compared across runs.`}),u.length===0?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No OAuth account with a refresh token to export.`}):(0,$.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,$.jsx)(U,{id:`sim-include-refresh`,checked:a,onCheckedChange:s,className:`cursor-pointer`}),(0,$.jsx)(q,{htmlFor:`sim-include-refresh`,className:`text-[11px] cursor-pointer`,children:`Include refresh tokens`})]}),(0,$.jsx)(D,{size:`sm`,className:`h-7 text-xs cursor-pointer`,disabled:r,onClick:()=>void d(),children:r?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(o,{className:`size-3 animate-spin mr-1`}),` Exporting...`]}):`Run export #${t.length+1}`})]}),t.length>0&&(0,$.jsxs)(`div`,{className:`space-y-3`,children:[(0,$.jsxs)(D,{size:`sm`,variant:`outline`,className:`w-full h-7 text-[11px] cursor-pointer`,onClick:m,children:[`Test all tokens (`,t.reduce((e,t)=>e+t.items.length*3,0),`)`]}),t.map(e=>(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsxs)(`p`,{className:`text-xs font-medium text-primary`,children:[`Round #`,e.round]}),(0,$.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:e.time}),(0,$.jsx)(Ve,{variant:e.includeRefresh?`destructive`:`secondary`,className:`text-[9px] px-1 py-0`,children:e.includeRefresh?`with refresh`:`access only`})]}),e.items.map(t=>(0,$.jsxs)(`div`,{className:`p-2 rounded-lg border bg-card space-y-1.5`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`text-[11px] font-medium`,children:t.label??t.email??t.id.slice(0,8)}),t.tokenChanged&&(0,$.jsx)(Ve,{variant:`secondary`,className:`text-[9px] px-1 py-0`,children:`DB token changed`})]}),p(e,t).map(e=>{let t=c.get(e.key);return(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[11px]`,children:[(0,$.jsx)(`span`,{className:`w-20 shrink-0 text-muted-foreground text-[10px]`,children:e.label}),(0,$.jsx)(`code`,{className:`flex-1 truncate font-mono text-[10px] bg-muted px-1 rounded`,children:e.preview??`N/A`}),e.expires&&(0,$.jsx)(`span`,{className:`text-[10px] text-muted-foreground shrink-0`,children:He(e.expires)}),e.token?(0,$.jsx)(D,{size:`sm`,variant:`outline`,className:`h-6 text-[10px] px-1.5 cursor-pointer shrink-0`,disabled:t?.loading,onClick:()=>void f(e.key,e.token),children:t?.loading?(0,$.jsx)(o,{className:`size-3 animate-spin`}):`Test`}):(0,$.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:`-`}),t&&!t.loading&&(0,$.jsx)(`span`,{className:`text-[10px] font-medium shrink-0 ${t.status?.startsWith(`valid`)?`text-success`:`text-error`}`,children:t.status})]},e.key)})]},`r${e.round}-${t.id}`))]},e.round))]})]})}function We(e){let t=Math.floor(Date.now()/1e3),n=Math.floor(Math.abs(e-t)/60);return e>t?`${n}m left`:`expired ${n}m ago`}function Ge({open:e,onOpenChange:t,accounts:n}){let[i,a]=(0,Q.useState)(new Map),[s,c]=(0,Q.useState)(!1);async function l(e){a(t=>new Map(t).set(e,{loading:!0}));try{let t=await re(e,s);a(n=>new Map(n).set(e,{loading:!1,result:t}))}catch(t){a(n=>new Map(n).set(e,{loading:!1,error:t.message}))}}function u(){for(let e of n.filter(e=>e.expiresAt!==null))l(e.id)}return(0,$.jsx)(N,{open:e,onOpenChange:t,children:(0,$.jsxs)(A,{className:`sm:max-w-xl max-h-[85vh] flex flex-col`,children:[(0,$.jsxs)(O,{children:[(0,$.jsxs)(j,{className:`text-sm flex items-center gap-1.5`,children:[(0,$.jsx)(r,{className:`size-4`}),` Token Test`]}),(0,$.jsx)(M,{className:`text-xs`,children:`Probe stored tokens for validity. Nothing is modified.`})]}),(0,$.jsxs)(`div`,{className:`space-y-4 overflow-y-auto flex-1 pr-1`,children:[(0,$.jsxs)(`section`,{className:`space-y-2`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,$.jsx)(`p`,{className:`text-xs font-medium`,children:`Current tokens`}),(0,$.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,$.jsx)(U,{id:`token-test-refresh`,checked:s,onCheckedChange:c,className:`cursor-pointer`}),(0,$.jsx)(q,{htmlFor:`token-test-refresh`,className:`text-[11px] cursor-pointer`,children:`Also test refresh`})]}),(0,$.jsx)(D,{size:`sm`,variant:`outline`,className:`h-7 text-xs cursor-pointer`,onClick:u,children:`Test all`})]})]}),n.length===0&&(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No accounts to test.`}),(0,$.jsx)(`div`,{className:`space-y-1.5`,children:n.map(e=>{let t=i.get(e.id),n=t?.result?.accessToken.status;return(0,$.jsxs)(`div`,{className:`p-2 rounded border bg-card space-y-1`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`span`,{className:`text-xs font-medium truncate block`,children:e.label??e.email??e.id.slice(0,8)}),e.expiresAt&&(0,$.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:We(e.expiresAt)})]}),(0,$.jsx)(D,{size:`sm`,variant:`outline`,className:`h-7 text-xs cursor-pointer shrink-0`,disabled:t?.loading,onClick:()=>void l(e.id),children:t?.loading?(0,$.jsx)(o,{className:`size-3 animate-spin`}):`Test`})]}),t&&!t.loading&&(0,$.jsxs)(`div`,{className:`text-[11px] pl-2 border-l-2 border-muted`,children:[t.error&&(0,$.jsx)(`p`,{className:`text-error`,children:t.error}),n&&(0,$.jsxs)(`span`,{className:n.startsWith(`valid`)?`text-success`:`text-error`,children:[n,t.result?.accessToken.code?` (${t.result.accessToken.code})`:``]})]})]},e.id)})})]}),(0,$.jsx)(Ue,{accounts:n})]}),(0,$.jsx)(k,{children:(0,$.jsx)(D,{size:`sm`,variant:`outline`,className:`text-xs cursor-pointer`,onClick:()=>t(!1),children:`Close`})})]})})}function Ke(){let{usages:e,accounts:t,activeAccountId:n,initialLoading:i,refreshing:s,flashIds:c,reload:l}=he(),[f,p]=(0,Q.useState)(null),[h,g]=(0,Q.useState)(null),[v,y]=(0,Q.useState)(null),[b,x]=(0,Q.useState)(null),[S,C]=(0,Q.useState)(null),[w,T]=(0,Q.useState)(null),[E,O]=(0,Q.useState)(null),[k,A]=(0,Q.useState)(void 0);function j(e){l(),e&&p(e)}async function M(e,t){g(e);try{await B(e,{status:t===`disabled`?`active`:`disabled`})}catch(e){p(e.message)}g(null),l()}async function N(){if(v){try{await V(v.id),p(`Account "${v.display}" removed.`),l()}catch(e){p(`Failed to remove: ${e.message}`)}y(null)}}async function P(e){b&&(await B(b.id,{label:e}),x(null),p(`Account renamed to "${e}".`),l())}let F=new Map(t.map(e=>[e.id,e])),I=e[0]?.usage.lastFetchedAt;return(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsx)(_e,{description:`Connect multiple Claude accounts. PPM rotates between them automatically to avoid rate limits.`,onRefresh:()=>void l(),refreshing:s,disabled:i,actions:(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(D,{size:`sm`,className:`cursor-pointer gap-1.5`,onClick:()=>{A(void 0),O(`add`)},children:[(0,$.jsx)(d,{className:`size-4`}),` Add account`]}),(0,$.jsxs)(D,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>{T(null),O(`export`)},children:[(0,$.jsx)(u,{className:`size-4`}),` Export`]}),(0,$.jsxs)(D,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>O(`import`),children:[(0,$.jsx)(a,{className:`size-4`}),` Import`]}),(0,$.jsxs)(D,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>O(`rotation`),children:[(0,$.jsx)(_,{className:`size-4`}),` Rotation`]}),(0,$.jsxs)(D,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>O(`token-test`),children:[(0,$.jsx)(r,{className:`size-4`}),` Token test`]})]})}),(0,$.jsx)(le,{message:f,onDismiss:()=>p(null)}),(0,$.jsxs)(`section`,{className:`space-y-2`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,$.jsx)(`h3`,{className:`text-sm font-medium`,children:`Accounts`}),I&&(0,$.jsxs)(`span`,{className:`text-[10px] text-muted-foreground`,children:[`usage `,ce(new Date(I).getTime())]})]}),i?(0,$.jsxs)(`div`,{className:`flex items-center gap-2 py-6 text-xs text-muted-foreground`,children:[(0,$.jsx)(o,{className:`size-4 animate-spin`}),` Loading accounts...`]}):e.length===0?(0,$.jsxs)(`div`,{className:`flex flex-col items-center gap-2 py-8 text-center`,children:[(0,$.jsx)(m,{className:`size-5 text-muted-foreground`}),(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No accounts connected yet.`}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Add one to start using PPM.`})]}):(0,$.jsx)(se,{children:e.map(e=>(0,$.jsx)(ge,{layout:`strip`,entry:e,isActive:e.accountId===n,accountInfo:F.get(e.accountId),onToggle:M,toggling:h===e.accountId,onDelete:(e,t)=>y({id:e,display:t}),onRename:(e,t)=>x({id:e,current:t}),onExport:e=>{T(e),O(`export`)},onViewProfile:(e,t)=>C({profile:e,accountId:t}),onReauth:()=>{A({id:e.accountId,label:e.accountLabel??e.accountId.slice(0,8)}),O(`add`)},flash:c.has(e.accountId)},e.accountId))})]}),S&&(0,$.jsx)(Oe,{profile:S.profile,accountId:S.accountId,onClose:()=>C(null)}),v&&(0,$.jsx)(ke,{display:v.display,onConfirm:()=>void N(),onCancel:()=>y(null)}),b&&(0,$.jsx)(je,{current:b.current,onSave:P,onCancel:()=>x(null)}),(0,$.jsx)(ye,{open:E===`add`,onOpenChange:e=>{O(e?`add`:null),e||A(void 0)},onSuccess:j,signInAgainFor:k}),(0,$.jsx)(Ne,{open:E===`export`,onOpenChange:e=>{O(e?`export`:null),e||T(null)},accounts:t,preselectId:w,onMessage:p}),(0,$.jsx)(Pe,{open:E===`import`,onOpenChange:e=>O(e?`import`:null),onSuccess:j}),(0,$.jsx)(ze,{open:E===`rotation`,onOpenChange:e=>O(e?`rotation`:null)}),(0,$.jsx)(Ge,{open:E===`token-test`,onOpenChange:e=>O(e?`token-test`:null),accounts:t})]})}function qe({mode:e,onOpenChange:t,password:n,onPasswordChange:r,busy:i,onExport:s,onImport:c,error:l}){let d=(0,Q.useRef)(null),f=e===`export`;return(0,$.jsx)(N,{open:e!==null,onOpenChange:t,children:(0,$.jsxs)(A,{className:`sm:max-w-md`,children:[(0,$.jsxs)(O,{children:[(0,$.jsxs)(j,{className:`text-sm flex items-center gap-1.5`,children:[(0,$.jsx)(g,{className:`size-4`}),` `,f?`Export Codex Accounts`:`Import Codex Accounts`]}),(0,$.jsx)(M,{className:`text-xs leading-relaxed`,children:f?`Writes a password-encrypted file containing each account's login.`:`Reads a backup file. The password must be the one it was exported with.`})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(q,{htmlFor:`codex-backup-password`,className:`text-xs`,children:`Password`}),(0,$.jsx)(I,{id:`codex-backup-password`,type:`password`,placeholder:f?`Choose a password`:`Password used for the export`,value:n,onChange:e=>r(e.target.value),className:`text-xs`,autoComplete:f?`new-password`:`current-password`}),(0,$.jsx)(`p`,{className:`text-[10px] text-muted-foreground`,children:`A backup holds full logins — keep the file and its password together.`})]}),l&&(0,$.jsx)(`div`,{className:`text-[11px] p-2 rounded bg-error/10 text-error`,children:l}),(0,$.jsx)(`input`,{ref:d,type:`file`,accept:`application/json,.json`,className:`hidden`,onChange:e=>{let t=e.target.files?.[0];e.target.value=``,t&&c(t)}}),(0,$.jsxs)(k,{children:[(0,$.jsx)(D,{size:`sm`,variant:`outline`,className:`text-xs cursor-pointer`,onClick:()=>t(!1),children:`Cancel`}),(0,$.jsxs)(D,{size:`sm`,className:`text-xs cursor-pointer gap-1.5`,disabled:!n.trim()||i,onClick:()=>f?s():d.current?.click(),children:[i?(0,$.jsx)(o,{className:`size-3.5 animate-spin`}):f?(0,$.jsx)(u,{className:`size-3.5`}):(0,$.jsx)(a,{className:`size-3.5`}),f?`Download backup`:`Choose file`]})]})]})})}var Je=[{value:`round-robin`,label:`Round-robin`,hint:`Take the next account each time.`},{value:`fill-first`,label:`Fill-first`,hint:`Stay on one account until it runs out.`},{value:`lowest-usage`,label:`Lowest usage`,hint:`Pick whichever has the most left.`}];function Ye({open:e,onOpenChange:t,strategy:n,onChange:r}){return(0,$.jsx)(N,{open:e,onOpenChange:t,children:(0,$.jsxs)(A,{className:`sm:max-w-md`,children:[(0,$.jsxs)(O,{children:[(0,$.jsx)(j,{className:`text-sm`,children:`Codex Rotation`}),(0,$.jsx)(M,{className:`text-xs leading-relaxed`,children:`How a new chat chooses among your Codex accounts.`})]}),(0,$.jsx)(`div`,{className:`space-y-2`,children:Je.map(e=>(0,$.jsxs)(`button`,{type:`button`,onClick:()=>r(e.value),"aria-current":n===e.value?`true`:void 0,className:b(`w-full text-left rounded-md border px-3 py-2.5 min-h-11 cursor-pointer transition-colors`,n===e.value?`border-primary bg-primary/10`:`border-border hover:bg-accent/50 active:bg-accent`),children:[(0,$.jsx)(`p`,{className:`text-sm font-medium`,children:e.label}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.hint})]},e.value))}),(0,$.jsx)(k,{children:(0,$.jsx)(D,{size:`sm`,variant:`outline`,className:`text-xs cursor-pointer`,onClick:()=>t(!1),children:`Done`})})]})})}function Xe(e){return e==null?null:Math.round(e*100)}function Ze({usage:e}){let t=e.session==null&&e.weekly==null;return(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(t||e.session!=null)&&(0,$.jsx)(ue,{label:`5-Hour Session`,pct:Xe(e.fiveHour),reset:oe(e.session),resetsAt:e.session?.resetsAt}),(t||e.weekly!=null)&&(0,$.jsx)(ue,{label:`Weekly`,pct:Xe(e.sevenDay),reset:oe(e.weekly),resetsAt:e.weekly?.resetsAt})]})}function Qe(e){let t=e=>Math.round((e??0)*100)>=100;return t(e.session?.utilization)||t(e.weekly?.utilization)}function $e(e){return Qe(e)&&(e.resetCredits?.available??0)>0}var et={reset:e=>`${e}: limits reset to 0%. The weekly reset date now counts from your next use.`,nothingToReset:e=>`${e}: nothing needed resetting, so the reset was kept.`,noCredit:e=>`${e} has no free reset left.`,alreadyRedeemed:e=>`${e}: that reset had already been used.`};function tt(e){return e?new Date(e).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`}):null}function nt({account:e,usage:t,onDone:n}){let r=T(),[i,a]=(0,Q.useState)(!1),[c,l]=(0,Q.useState)(!1);if(!$e(t))return null;let u=t.resetCredits;async function d(){l(!0);try{let t=await y.post(`/api/codex-accounts/${e.id}/reset-credit`);n(et[t.outcome]?.(e.label)??`${e.label}: ${t.outcome}`)}catch(e){n(e.message||`Could not use the reset`)}finally{l(!1),a(!1)}}let f=tt(t.weekly?.resetsAt),p=tt(u.nextExpiresAt),m=(0,$.jsxs)(`div`,{className:`space-y-3`,"data-testid":`codex-reset-credit-confirm`,children:[(0,$.jsxs)(`p`,{className:`text-sm`,children:[`Use 1 of `,(0,$.jsx)(`span`,{className:`font-medium`,children:e.label}),`'s `,u.available,` free reset`,u.available===1?``:`s`,`?`]}),(0,$.jsxs)(`ul`,{className:`text-xs text-text-secondary space-y-1.5 list-disc pl-4`,children:[(0,$.jsxs)(`li`,{children:[u.title??`Full reset`,`: the 5-hour and weekly usage go back to 0% now.`]}),(0,$.jsxs)(`li`,{children:[`The weekly reset date moves: the next one is about 7 days after you continue using Codex`,f?`, not ${f} as now`:``,`. You do not also get that one.`]}),p&&(0,$.jsxs)(`li`,{children:[`This spends the reset that expires first (`,p,`).`]})]}),(0,$.jsxs)(`div`,{className:`flex flex-col-reverse md:flex-row gap-2 md:justify-end pt-1`,children:[(0,$.jsx)(D,{variant:`outline`,onClick:()=>a(!1),disabled:c,className:`min-h-11`,children:`Keep it`}),(0,$.jsxs)(D,{onClick:()=>void d(),disabled:c,className:`min-h-11 gap-1.5`,children:[c?(0,$.jsx)(o,{className:`size-4 animate-spin`}):(0,$.jsx)(s,{className:`size-4`}),`Use reset`]})]})]});return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(D,{size:`sm`,variant:`outline`,className:`min-h-11 md:min-h-0 md:h-7 gap-1 px-2 text-[11px] cursor-pointer border-primary/40 text-primary`,onClick:()=>a(!0),disabled:c,children:[(0,$.jsx)(s,{className:`size-3.5`}),` Use reset`]}),i&&(r?(0,$.jsx)(w,{open:!0,onClose:()=>{c||a(!1)},children:(0,$.jsxs)(`div`,{className:`px-4 pb-4`,children:[(0,$.jsx)(`h2`,{className:`text-base font-semibold mb-3`,children:`Use a free reset`}),m]})}):(0,$.jsx)(N,{open:!0,onOpenChange:e=>{!e&&!c&&a(!1)},children:(0,$.jsxs)(A,{className:`sm:max-w-sm`,children:[(0,$.jsx)(O,{children:(0,$.jsx)(j,{className:`text-sm`,children:`Use a free reset`})}),m]})}))]})}var rt=1440*60*1e3,it=7,at=5;function ot(e,t=Date.now()){if(!e||e.windowHours!==168)return null;let n=new Date(e.resetsAt).getTime();if(!Number.isFinite(t)||!Number.isFinite(n)||n<=t)return null;let r=n-it*rt;if(t<r)return null;let i=Math.min(it-1,Math.floor((t-r)/rt)),a=0;for(let e=0;e<=i;e++){let t=new Date(r+e*rt).getUTCDay();t!==0&&t!==6&&a++}let o=a/at;return{day:a,cap:o,used:e.utilization,blocked:e.utilization>=o}}function st(){let[e,t]=(0,Q.useState)(null),n=de(()=>t(null)),[r,s]=(0,Q.useState)(null);return(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsx)(_e,{description:(0,$.jsxs)($.Fragment,{children:[`Each Codex account keeps its own login (`,(0,$.jsx)(`code`,{children:`CODEX_HOME`}),`). One is picked per chat by the rotation setting.`]}),onRefresh:()=>void n.load(),refreshing:n.loading,actions:(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(D,{size:`sm`,className:`cursor-pointer gap-1.5`,onClick:()=>t(`add`),children:[(0,$.jsx)(d,{className:`size-4`}),` Add account`]}),(0,$.jsxs)(D,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>t(`export`),children:[(0,$.jsx)(u,{className:`size-4`}),` Export`]}),(0,$.jsxs)(D,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>t(`import`),children:[(0,$.jsx)(a,{className:`size-4`}),` Import`]}),(0,$.jsxs)(D,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>t(`rotation`),children:[(0,$.jsx)(_,{className:`size-4`}),` Rotation`]})]})}),(0,$.jsx)(le,{message:n.msg??n.err,onDismiss:()=>{n.setMsg(null),n.setErr(null)}}),(0,$.jsxs)(`section`,{className:`space-y-2`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,$.jsx)(`h3`,{className:`text-sm font-medium`,children:`Codex Accounts`}),(0,$.jsx)(`span`,{className:`text-[10px] text-muted-foreground capitalize`,children:n.strategy.replace(`-`,` `)})]}),n.loading&&n.accounts.length===0?(0,$.jsxs)(`div`,{className:`flex items-center gap-2 py-6 text-xs text-muted-foreground`,children:[(0,$.jsx)(o,{className:`size-4 animate-spin`}),` Loading accounts...`]}):n.accounts.length===0?(0,$.jsxs)(`div`,{className:`flex flex-col items-center gap-2 py-8 text-center`,children:[(0,$.jsx)(m,{className:`size-5 text-muted-foreground`}),(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No Codex accounts yet.`}),(0,$.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Chats use your default `,(0,$.jsx)(`code`,{children:`~/.codex`}),` login until you add one.`]})]}):(0,$.jsx)(se,{children:n.accounts.map(e=>{let t=n.usages[e.id]??{};return(0,$.jsxs)(me,{dense:!0,className:`min-w-[300px] shrink-0 snap-start${e.signedOut?` opacity-60`:``}`,"data-testid":`account-card`,"data-account-id":e.id,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`text-sm font-medium truncate flex-1 min-w-0`,children:e.label}),e.signedOut&&(0,$.jsx)(fe,{className:`text-[10px] text-error shrink-0 font-medium`,hint:`Codex rejected this account's login (revoked or expired), so no turn can run on it and it is skipped. The usage shown is the last reading. Click to sign in again — the account keeps its settings and chats.`,onClick:e.type===`chatgpt`?()=>s(e):void 0,children:`Sign in again`}),(0,$.jsx)(`span`,{className:`text-[10px] uppercase tracking-wide text-text-subtle border border-border rounded px-1 shrink-0`,children:e.type}),Y(e.planType)&&(0,$.jsx)(`span`,{className:`text-[10px] text-text-subtle shrink-0`,children:Y(e.planType)}),(0,$.jsx)(U,{checked:e.status!==`disabled`,onCheckedChange:()=>void n.toggle(e.id,e.status??`active`),disabled:n.toggling.has(e.id),"aria-label":e.status===`disabled`?`Enable account`:`Disable account`,className:`cursor-pointer shrink-0`}),(0,$.jsxs)(C,{children:[(0,$.jsx)(x,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,onClick:()=>void n.remove(e.id),"aria-label":`Remove account`,className:`p-2 rounded cursor-pointer text-text-subtle hover:text-error hover:bg-surface-elevated transition-colors shrink-0`,children:(0,$.jsx)(f,{className:`size-4`})})}),(0,$.jsx)(S,{side:`top`,children:`Remove account`})]})]}),(0,$.jsx)(Ze,{usage:t}),t.resetCredits&&(0,$.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap text-[10px] text-text-subtle`,children:[(0,$.jsx)(X,{credits:t.resetCredits}),(0,$.jsx)(nt,{account:e,usage:t,onDone:e=>{n.setMsg(e),n.load()}})]}),t.session==null&&(()=>{let r=ot(t.weekly);return r?(0,$.jsxs)(`div`,{className:`flex min-h-12 items-center justify-between gap-3 rounded-md border px-2.5 py-1.5 ${e.dailyGuardEnabled&&r.blocked?`border-error/40 bg-error/5`:`border-border/50 bg-surface/40`}`,children:[(0,$.jsxs)(`div`,{className:`min-w-0 space-y-0.5`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-medium ${e.dailyGuardEnabled&&r.blocked?`text-error`:`text-text-secondary`}`,children:[(0,$.jsx)(`span`,{children:`Daily guard`}),(0,$.jsxs)(C,{children:[(0,$.jsx)(x,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,"aria-label":`About Daily guard`,className:`text-text-subtle hover:text-text-primary cursor-help`,children:(0,$.jsx)(i,{className:`size-3.5`})})}),(0,$.jsx)(S,{side:`top`,className:`max-w-64 text-xs leading-relaxed`,children:`Spreads the weekly quota across five weekdays, adding 20% per weekday. Weekend slots keep the previous cap; unused allowance carries forward. Daily slots start at the reset time and use UTC weekdays. Turn it off any time to use the remaining quota freely.`})]})]}),(0,$.jsx)(`p`,{className:`text-[10px] tabular-nums ${e.dailyGuardEnabled&&r.blocked?`text-error`:`text-text-subtle`}`,children:e.dailyGuardEnabled&&r.blocked?`${Math.round(r.used*100)}% used / ${Math.round(r.cap*100)}% daily cap. New turns paused.`:`Weekday ${r.day}/5, ${Math.round(r.cap*100)}% daily cap`})]}),(0,$.jsxs)(`span`,{className:`hidden`,title:`Weekday ${r.day}/5: hold weekly usage at or below ${Math.round(r.cap*100)}% to last until reset.`,children:[`Daily guard `,e.dailyGuardEnabled?`· Weekday ${r.day}/5 cap ${Math.round(r.cap*100)}%`:``]}),(0,$.jsx)(U,{checked:!!e.dailyGuardEnabled,onCheckedChange:()=>void n.toggleDailyGuard(e.id,!!e.dailyGuardEnabled),disabled:n.toggling.has(e.id),"aria-label":e.dailyGuardEnabled?`Disable Daily guard`:`Enable Daily guard`,className:`cursor-pointer shrink-0`})]}):null})()]},e.id)})})]}),(0,$.jsx)(J,{open:e===`add`,onOpenChange:e=>{e||n.cancelLogin(),t(e?`add`:null)},label:n.label,onLabelChange:n.setLabel,apiKey:n.apiKey,onApiKeyChange:n.setApiKey,adding:n.adding,onAddApiKey:()=>void n.addApiKey(),deviceWaiting:n.deviceWaiting,onStartDevice:()=>void n.startDevice(),device:n.device,browser:n.browser,onStartBrowser:()=>void n.startBrowser(),loginStarting:n.loginStarting,callbackUrl:n.callbackUrl,onCallbackUrlChange:n.setCallbackUrl,submittingCallback:n.submittingCallback,onSubmitCallback:()=>void n.submitCallback(),error:n.err}),(0,$.jsx)(qe,{mode:e===`export`?`export`:e===`import`?`import`:null,onOpenChange:e=>{e||t(null)},password:n.backupPassword,onPasswordChange:n.setBackupPassword,busy:n.exporting||n.importing,onExport:()=>void n.doExport(),onImport:e=>void n.doImport(e),error:n.err}),r&&(0,$.jsx)(Z,{account:r,onClose:()=>s(null),onDone:()=>void n.load()}),(0,$.jsx)(Ye,{open:e===`rotation`,onOpenChange:e=>t(e?`rotation`:null),strategy:n.strategy,onChange:e=>void n.changeStrategy(e)})]})}var ct=[{value:`round-robin`,label:`Round-robin`,hint:`Take the next account each time.`},{value:`fill-first`,label:`Fill-first`,hint:`Stay on one account until it runs out.`},{value:`lowest-usage`,label:`Lowest usage`,hint:`Pick whichever has the most left.`}];function lt(e){return e==null?null:Math.round(e*100)}function ut(){let[e,t]=(0,Q.useState)([]),[n,r]=(0,Q.useState)(`round-robin`),[i,a]=(0,Q.useState)({}),[s,u]=(0,Q.useState)(!0),[p,h]=(0,Q.useState)(null),[g,v]=(0,Q.useState)(null),[w,T]=(0,Q.useState)(new Set),[E,P]=(0,Q.useState)(null),[F,L]=(0,Q.useState)(null),[R,z]=(0,Q.useState)(``),[B,ee]=(0,Q.useState)(null),[te,ne]=(0,Q.useState)(!1),[V,re]=(0,Q.useState)(``),[H,ie]=(0,Q.useState)(!1),[ae,W]=(0,Q.useState)(null),G=(0,Q.useRef)(0),K=(0,Q.useRef)(!1),J=(0,Q.useRef)(!1),Y=(0,Q.useRef)(null),de=(0,Q.useRef)(null),X=(0,Q.useCallback)(async()=>{u(!0),v(null);try{let e=await y.get(`/api/antigravity-accounts`);t(e.accounts),r(e.strategy),a(await y.get(`/api/antigravity-accounts/usage`))}catch(e){v(e.message)}finally{u(!1)}},[]);(0,Q.useEffect)(()=>{X()},[X]);let fe=(0,Q.useCallback)(()=>{G.current+=1,K.current=!1,J.current=!1,de.current?.(),de.current=null;let e=Y.current;Y.current=null,e&&y.del(`/api/antigravity-accounts/login/${e}`).catch(()=>{})},[]);(0,Q.useEffect)(()=>fe,[fe]);let Z=(0,Q.useCallback)(()=>{fe(),ee(null),ne(!1),re(``),ie(!1)},[fe]),he=(0,Q.useCallback)(()=>{Z(),W(null),z(``),L(null),P(null)},[Z]),ge=(0,Q.useCallback)(e=>{let t=Date.now()+61e4,n=!1,r;de.current=()=>{n=!0,clearTimeout(r)};let i=async()=>{if(n)return;let a=null;try{a=await y.get(`/api/antigravity-accounts/login/${e}/status`)}catch{}if(!n){if(a?.state===`done`){Y.current=null,Z(),W(null),z(``),L(null),P(null),h(`Antigravity Google account connected.`),await X();return}if(a?.state===`error`||Date.now()>t){Y.current=null,Z(),W(a?.state===`error`?a.error??`Login failed.`:`Login timed out.`);return}r=setTimeout(i,2e3)}};i()},[X,Z]),ye=(0,Q.useCallback)(async e=>{if(K.current||Y.current||J.current)return;K.current=!0;let t=++G.current;ne(!0),W(null);try{let n=await y.post(`/api/antigravity-accounts/login`,{...R.trim()?{label:R.trim()}:{},...e?{accountId:e.id}:{}});if(t!==G.current){y.del(`/api/antigravity-accounts/login/${n.id}`).catch(()=>{});return}Y.current=n.id,ee(n),ge(n.id)}catch(e){t===G.current&&W(e.message)}finally{t===G.current&&(K.current=!1,ne(!1))}},[R,ge]),be=(0,Q.useCallback)(async()=>{if(!B||!V.trim()||J.current)return;let e=G.current;J.current=!0,ie(!0),W(null);try{let t=await y.post(`/api/antigravity-accounts/login/${B.id}/callback`,{code:V.trim()});if(e!==G.current)return;if(t?.state===`error`){Y.current=null,Z(),W(t.error??`Login failed.`);return}if(t?.state!==`done`)return;Y.current=null,Z(),z(``),L(null),P(null),h(`Antigravity Google account connected.`),await X()}catch(t){e===G.current&&(Y.current=null,Z(),W(t.message))}finally{e===G.current&&(J.current=!1,ie(!1))}},[B,V,X,Z]),xe=(0,Q.useCallback)(async(e,n)=>{T(t=>new Set(t).add(e)),v(null);try{let r=n===`disabled`?`active`:`disabled`;await y.patch(`/api/antigravity-accounts/${e}`,{status:r}),t(t=>t.map(t=>t.id===e?{...t,status:r}:t))}catch(e){v(e.message)}finally{T(t=>{let n=new Set(t);return n.delete(e),n})}},[]),Se=(0,Q.useCallback)(async e=>{v(null);try{await y.del(`/api/antigravity-accounts/${e}`),t(t=>t.filter(t=>t.id!==e))}catch(e){v(e.message)}},[]),Ce=(0,Q.useCallback)(async e=>{v(null);try{await y.put(`/api/antigravity-accounts/strategy`,{strategy:e}),r(e)}catch(e){v(e.message)}},[]),we=(0,Q.useCallback)(e=>{L(e),z(e.label),P(`add`)},[]);return(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsx)(_e,{description:(0,$.jsxs)($.Fragment,{children:[`Each Antigravity account keeps its own Google OAuth login (`,(0,$.jsx)(`code`,{children:`~/.ppm/antigravity-accounts`}),`) alongside your local IDE login (`,(0,$.jsx)(`code`,{children:`~/.gemini`}),`). One is picked per chat by the rotation setting.`]}),onRefresh:()=>void X(),refreshing:s,actions:(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(D,{size:`sm`,className:`cursor-pointer gap-1.5`,onClick:()=>{L(null),z(``),P(`add`)},children:[(0,$.jsx)(d,{className:`size-4`}),` Add account`]}),(0,$.jsxs)(D,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>P(`rotation`),children:[(0,$.jsx)(_,{className:`size-4`}),` Rotation`]})]})}),(0,$.jsx)(le,{message:p??g,onDismiss:()=>{h(null),v(null)}}),(0,$.jsxs)(`section`,{className:`space-y-2`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,$.jsx)(`h3`,{className:`text-sm font-medium`,children:`Antigravity Accounts`}),(0,$.jsx)(`span`,{className:`text-[10px] text-muted-foreground capitalize`,children:n.replace(`-`,` `)})]}),s&&e.length===0?(0,$.jsxs)(`div`,{className:`flex items-center gap-2 py-6 text-xs text-muted-foreground`,children:[(0,$.jsx)(o,{className:`size-4 animate-spin`}),` Loading accounts...`]}):e.length===0?(0,$.jsxs)(`div`,{className:`flex flex-col items-center gap-2 py-8 text-center`,children:[(0,$.jsx)(m,{className:`size-5 text-muted-foreground`}),(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No Antigravity accounts yet.`}),(0,$.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Click `,(0,$.jsx)(`strong`,{children:`Add account`}),` to sign in with Google, or start Antigravity Desktop to auto-detect your local account.`]})]}):(0,$.jsx)(se,{children:e.map(e=>{let t=ve(i[e.id]??{}),n=t.session==null&&t.weekly==null&&(!t.weeklyScoped||t.weeklyScoped.length===0),r=e.id===`default`;return(0,$.jsxs)(me,{dense:!0,className:`min-w-[320px] shrink-0 snap-start`,"data-testid":`account-card`,"data-account-id":e.id,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,$.jsx)(`div`,{className:`text-sm font-medium truncate`,children:e.label}),e.email&&e.email!==e.label&&(0,$.jsx)(`div`,{className:`text-[11px] text-text-subtle truncate`,children:e.email})]}),(0,$.jsx)(`span`,{className:`text-[10px] uppercase tracking-wide text-text-subtle border border-border rounded px-1 shrink-0`,children:r?`~/.gemini`:`Google`}),e.planType&&(0,$.jsx)(`span`,{className:`text-[10px] font-medium text-primary bg-primary/10 border border-primary/20 rounded px-1.5 py-0.5 shrink-0`,children:e.planType}),(0,$.jsx)(U,{checked:e.status!==`disabled`,onCheckedChange:()=>void xe(e.id,e.status),disabled:w.has(e.id),"aria-label":e.status===`disabled`?`Enable account`:`Disable account`,className:`cursor-pointer shrink-0`}),!r&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(C,{children:[(0,$.jsx)(x,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,onClick:()=>we(e),"aria-label":`Sign in again`,className:`p-1.5 rounded cursor-pointer text-text-subtle hover:text-foreground hover:bg-surface-elevated transition-colors shrink-0`,children:(0,$.jsx)(c,{className:`size-3.5`})})}),(0,$.jsx)(S,{side:`top`,children:`Sign in again`})]}),(0,$.jsxs)(C,{children:[(0,$.jsx)(x,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,onClick:()=>void Se(e.id),"aria-label":`Remove account`,className:`p-1.5 rounded cursor-pointer text-text-subtle hover:text-error hover:bg-surface-elevated transition-colors shrink-0`,children:(0,$.jsx)(f,{className:`size-4`})})}),(0,$.jsx)(S,{side:`top`,children:`Remove account`})]})]})]}),(0,$.jsxs)(`div`,{className:`space-y-2 pt-1`,children:[(n||t.session!=null)&&(0,$.jsx)(ue,{label:`Gemini · 5-Hour Session`,pct:lt(t.fiveHour),reset:oe(t.session),resetsAt:t.session?.resetsAt}),(n||t.weekly!=null)&&(0,$.jsx)(ue,{label:`Gemini · Weekly`,pct:lt(t.sevenDay),reset:oe(t.weekly),resetsAt:t.weekly?.resetsAt}),t.weeklyScoped?.map(e=>(0,$.jsx)(ue,{label:e.label,pct:lt(e.utilization),reset:oe(e),resetsAt:e.resetsAt},e.label))]}),t.lastFetchedAt&&pe(t.lastFetchedAt)&&(0,$.jsxs)(`p`,{className:`text-[10px] text-warning`,children:[`Last read `,ce(Date.parse(t.lastFetchedAt)),`. Neither agy nor the Antigravity app has answered since.`]})]},e.id)})})]}),(0,$.jsx)(N,{open:E===`add`,onOpenChange:e=>{e||he()},children:(0,$.jsxs)(A,{className:`sm:max-w-md max-h-[90dvh] overflow-y-auto`,children:[(0,$.jsxs)(O,{children:[(0,$.jsx)(j,{className:`text-sm`,children:F?`Sign in again — ${F.label}`:`Add Antigravity Account`}),(0,$.jsx)(M,{className:`text-xs leading-relaxed`,children:F?`Sign in with Google to refresh this account's OAuth credentials.`:`Sign in with a Google account using Antigravity's OAuth PKCE flow. Each account is stored in its own isolated directory.`})]}),(0,$.jsxs)(`div`,{className:`space-y-3`,children:[!F&&(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(q,{htmlFor:`agy-label`,className:`text-xs`,children:`Label (optional)`}),(0,$.jsx)(I,{id:`agy-label`,placeholder:`e.g. Personal, Work, Shopee 2`,value:R,onChange:e=>z(e.target.value),disabled:te||H,className:`text-xs`})]}),(0,$.jsxs)(`div`,{className:`rounded-md border p-3 space-y-2.5`,children:[(0,$.jsx)(`p`,{className:`text-[11px] font-medium`,children:`Google OAuth Sign-In`}),B?(0,$.jsxs)(`div`,{className:`space-y-2.5 text-xs`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,$.jsxs)(`a`,{href:B.authUrl,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1.5 font-medium text-primary hover:underline`,children:[(0,$.jsx)(l,{className:`size-3.5`}),` Open Google Sign-In page`]}),(0,$.jsx)(`button`,{type:`button`,onClick:()=>{Z(),W(null)},disabled:H,className:`text-[11px] text-muted-foreground hover:text-foreground underline cursor-pointer`,children:`Start over`})]}),(0,$.jsxs)(`p`,{className:`text-muted-foreground leading-relaxed`,children:[`1. Open the link above and sign in with your Google account.`,(0,$.jsx)(`br`,{}),`2. Copy the authorization code (or the full callback URL) shown after signing in and paste it below:`]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(q,{htmlFor:`agy-auth-code`,className:`text-xs`,children:`Authorization Code or Callback URL`}),(0,$.jsx)(I,{id:`agy-auth-code`,type:`text`,autoComplete:`off`,spellCheck:!1,placeholder:`4/0A... or https://antigravity.google/oauth-callback?code=...`,value:V,onChange:e=>re(e.target.value),disabled:H,className:`text-xs font-mono`})]}),(0,$.jsxs)(D,{size:`sm`,className:`w-full cursor-pointer gap-1.5`,onClick:()=>void be(),disabled:!V.trim()||H,children:[H&&(0,$.jsx)(o,{className:`size-3.5 animate-spin`}),`Verify & Save Account`]})]}):(0,$.jsx)(D,{size:`sm`,className:`w-full cursor-pointer gap-1.5`,onClick:()=>void ye(F),disabled:te,children:te?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(o,{className:`size-4 animate-spin`}),` Generating Google sign-in link...`]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(l,{className:`size-4`}),` Sign in with Google`]})})]})]}),ae&&(0,$.jsx)(`div`,{role:`alert`,className:`text-[11px] p-2 rounded bg-error/10 text-error`,children:ae}),(0,$.jsx)(k,{children:(0,$.jsx)(D,{size:`sm`,variant:`outline`,className:`text-xs cursor-pointer`,onClick:he,children:`Cancel`})})]})}),(0,$.jsx)(N,{open:E===`rotation`,onOpenChange:e=>P(e?`rotation`:null),children:(0,$.jsxs)(A,{className:`sm:max-w-md`,children:[(0,$.jsxs)(O,{children:[(0,$.jsx)(j,{className:`text-sm`,children:`Antigravity Rotation`}),(0,$.jsx)(M,{className:`text-xs leading-relaxed`,children:`How a new chat chooses among your enabled Antigravity accounts.`})]}),(0,$.jsx)(`div`,{className:`space-y-2`,children:ct.map(e=>(0,$.jsxs)(`button`,{type:`button`,onClick:()=>void Ce(e.value),"aria-current":n===e.value?`true`:void 0,className:b(`w-full text-left rounded-md border px-3 py-2.5 min-h-11 cursor-pointer transition-colors`,n===e.value?`border-primary bg-primary/10`:`border-border hover:bg-accent/50 active:bg-accent`),children:[(0,$.jsx)(`p`,{className:`text-sm font-medium`,children:e.label}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.hint})]},e.value))}),(0,$.jsx)(k,{children:(0,$.jsx)(D,{size:`sm`,variant:`outline`,className:`text-xs cursor-pointer`,onClick:()=>P(null),children:`Done`})})]})})]})}var dt=[{id:`claude`,label:`Claude`},{id:`codex`,label:`Codex`},{id:`antigravity`,label:`Antigravity`}];function ft(){let[e,t]=(0,Q.useState)(null),[n,r]=(0,Q.useState)(`claude`);(0,Q.useEffect)(()=>{let e=!1;return R().then(n=>{e||t(new Set(Object.keys(n.providers??{})))}).catch(()=>{e||t(new Set([`claude`]))}),()=>{e=!0}},[]);let i=dt.filter(t=>t.id===`claude`||e?.has(t.id)),a=i.length>1;return(0,$.jsxs)(`div`,{className:`space-y-4`,"data-testid":`accounts-pane`,"data-provider":n,children:[a&&(0,$.jsx)(`div`,{className:`flex gap-1 border-b border-border/50`,children:i.map(e=>(0,$.jsxs)(`button`,{onClick:()=>r(e.id),"data-testid":`accounts-tab-${e.id}`,"aria-current":n===e.id?`page`:void 0,className:`flex items-center gap-1.5 px-3 py-2 text-xs rounded-t transition-colors cursor-pointer ${n===e.id?`text-primary border-b-2 border-primary font-medium`:`text-text-subtle hover:text-text-secondary`}`,children:[(0,$.jsx)(P,{providerId:e.id}),e.label]},e.id))}),e===null&&!a&&(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,$.jsx)(o,{className:`size-3 animate-spin`}),` Checking configured providers...`]}),n===`claude`?(0,$.jsx)(Ke,{}):n===`codex`?(0,$.jsx)(st,{}):(0,$.jsx)(ut,{})]})}export{ft as AccountsSettingsSection};
|
|
1
|
+
import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-WX6NXGTJ.js";import"./vendor-ui-XWGn718B.js";import{At as r,J as i,Qr as a,Sn as o,_r as s,gr as c,gt as l,ht as u,lr as d,qr as f,ui as p,un as m,ut as h,wn as g,wr as _}from"./icons-CXY5ue_g.js";import{a as v,r as y}from"./api-client-vI7TyFOL.js";import{n as b}from"./utils-DMiycH3O.js";import"./portal-container-context-tAk8C8AE.js";import{i as x,n as S,t as C}from"./tooltip-CCx1ynhU.js";import{t as w}from"./mobile-bottom-sheet-CR0IYSBI.js";import"./use-visual-viewport-CFeFggvP.js";import{n as T}from"./use-is-mobile-_O8suyE-.js";import{r as E,t as D}from"./button-BCTqB-tu.js";import{a as O,i as k,n as A,o as j,r as M,t as N}from"./dialog-CoO-z2qj.js";import"./chat-preparation-cache-BjKMLTNJ.js";import"./provider-logos-m5ZC_yzc.js";import{t as P}from"./provider-selector-DcPsEA72.js";import{r as F}from"./clipboard-SyUe4kh-.js";import{t as I}from"./input-CcBfRi6-.js";import{S as L,a as R,b as z,g as B,h as ee,m as te,o as ne,r as V,v as re,y as H}from"./api-settings-D4cXrjrY.js";import{Fn as ie,In as ae,Ln as U,Mn as W,Nn as G,Pn as K,vr as q}from"./index-Dh1mYjGB.js";import{C as oe,_ as J,a as se,b as ce,c as le,d as ue,f as Y,g as de,i as X,l as fe,m as Z,n as pe,o as me,p as he,r as ge,s as _e,t as ve,v as ye}from"./antigravity-usage-view-xdhN5XdB.js";var Q=e(t(),1),$=n(),be=[`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`,`Sun`],xe=Array.from({length:24},(e,t)=>t);function Se(e,t){let n=Array.from({length:7},()=>Array.from({length:24},()=>({sum:0,count:0,avg:0})));for(let r of e){let e=t===`5h`?r.five_hour_util:r.weekly_util;if(e==null)continue;let i=new Date(r.recorded_at+(r.recorded_at.endsWith(`Z`)?``:`Z`)),a=(i.getDay()+6)%7,o=i.getHours();n[a][o].sum+=e,n[a][o].count+=1}for(let e of n)for(let t of e)t.avg=t.count>0?t.sum/t.count:0;return n}function Ce(e){return e.map(e=>{let t=e.reduce((e,t)=>e+t.sum,0),n=e.reduce((e,t)=>e+t.count,0);return n>0?t/n:0})}function we(e){return xe.map(t=>{let n=0,r=0;for(let i of e)n+=i[t].sum,r+=i[t].count;return r>0?n/r:0})}function Te(e){return e===0?`bg-surface-elevated`:e<.3?`bg-success/30`:e<.5?`bg-success/60`:e<.7?`bg-warning/50`:e<.9?`bg-warning/80`:`bg-error/80`}function Ee(e){return e<.3?`bg-success`:e<.7?`bg-warning`:`bg-error`}function De({accountId:e}){let[t,n]=(0,Q.useState)(null),[r,i]=(0,Q.useState)(!0),[a,s]=(0,Q.useState)(`5h`);(0,Q.useEffect)(()=>{i(!0),te(e).then(n).catch(()=>n([])).finally(()=>i(!1))},[e]);let c=(0,Q.useMemo)(()=>t?Se(t,a):null,[t,a]),l=(0,Q.useMemo)(()=>c?Ce(c):[],[c]),u=(0,Q.useMemo)(()=>c?we(c):[],[c]),d=Math.max(...l,.01);if(Math.max(...u,.01),r)return(0,$.jsx)(`div`,{className:`flex items-center justify-center py-3`,children:(0,$.jsx)(o,{className:`size-3 animate-spin text-text-subtle`})});if(!t||t.length===0)return(0,$.jsx)(`div`,{className:`text-[10px] text-text-subtle py-2 text-center`,children:`No usage history yet`});let f=t.length,p=new Set(t.map(e=>new Date(e.recorded_at+(e.recorded_at.endsWith(`Z`)?``:`Z`)).toDateString())).size;return(0,$.jsxs)(`div`,{className:`mt-2 space-y-2`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,$.jsx)(`span`,{className:`text-[10px] font-medium text-text-subtle`,children:`Usage Pattern (7d)`}),(0,$.jsxs)(`div`,{className:`flex gap-0.5 text-[9px]`,children:[(0,$.jsx)(`button`,{onClick:()=>s(`5h`),className:`px-1.5 py-0.5 rounded cursor-pointer transition-colors ${a===`5h`?`bg-primary/15 text-primary`:`text-text-subtle hover:text-text-secondary`}`,title:`5-hour rolling window limit — resets every 5 hours`,children:`5h`}),(0,$.jsx)(`button`,{onClick:()=>s(`weekly`),className:`px-1.5 py-0.5 rounded cursor-pointer transition-colors ${a===`weekly`?`bg-primary/15 text-primary`:`text-text-subtle hover:text-text-secondary`}`,title:`Weekly limit — resets every 7 days`,children:`Wk`})]})]}),(0,$.jsxs)(`p`,{className:`text-[9px] text-text-subtle leading-tight`,children:[`Avg `,a===`5h`?`5-hour`:`weekly`,` limit usage over `,p,`d (`,f,` samples). Higher % = closer to rate limit. Hover cells for details.`]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`span`,{className:`text-[9px] text-text-subtle`,children:`Avg usage by day of week`}),(0,$.jsx)(`div`,{className:`flex flex-col gap-[2px] mt-0.5`,children:be.map((e,t)=>{let n=l[t]??0;return(0,$.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,$.jsx)(`span`,{className:`text-[8px] text-text-subtle w-5 shrink-0 text-right tabular-nums`,children:e}),(0,$.jsx)(`div`,{className:`flex-1 h-2.5 bg-surface-elevated rounded-sm overflow-hidden`,children:(0,$.jsx)(`div`,{className:`h-full rounded-sm transition-all ${Ee(n)}`,style:{width:`${Math.round(n/d*100)}%`}})}),(0,$.jsxs)(`span`,{className:`text-[8px] text-text-subtle w-6 shrink-0 text-right tabular-nums`,children:[Math.round(n*100),`%`]})]},e)})})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`span`,{className:`text-[9px] text-text-subtle`,children:`Avg usage by hour (0h-23h)`}),(0,$.jsx)(`div`,{className:`flex gap-[1px] mt-0.5`,children:xe.map(e=>{let t=u[e]??0;return(0,$.jsxs)(`div`,{className:`flex-1 flex flex-col items-center gap-[1px]`,children:[(0,$.jsx)(`div`,{className:`w-full aspect-square rounded-[2px] ${Te(t)}`,title:`${e}:00 — avg ${Math.round(t*100)}% usage`}),e%6==0&&(0,$.jsx)(`span`,{className:`text-[7px] text-text-subtle tabular-nums`,children:e})]},e)})})]}),c&&(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`span`,{className:`text-[9px] text-text-subtle`,children:`Day x Hour heatmap`}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-[1px] mt-0.5`,children:[be.map((e,t)=>(0,$.jsxs)(`div`,{className:`flex items-center gap-[1px]`,children:[(0,$.jsx)(`span`,{className:`text-[7px] text-text-subtle w-4 shrink-0 text-right`,children:e.charAt(0)}),xe.map(n=>{let r=c[t][n];return(0,$.jsx)(`div`,{className:`flex-1 aspect-square rounded-[1px] ${Te(r.avg)}`,title:`${e} ${n}:00 — ${r.count>0?`avg ${Math.round(r.avg*100)}% (${r.count} samples)`:`no data`}`},n)})]},e)),(0,$.jsxs)(`div`,{className:`flex items-center gap-[1px]`,children:[(0,$.jsx)(`span`,{className:`w-4 shrink-0`}),xe.map(e=>(0,$.jsx)(`div`,{className:`flex-1 text-center`,children:e%6==0&&(0,$.jsx)(`span`,{className:`text-[7px] text-text-subtle tabular-nums`,children:e})},e))]})]})]}),(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[8px] text-text-subtle`,children:[(0,$.jsx)(`span`,{children:`Low`}),(0,$.jsxs)(`div`,{className:`flex gap-[2px]`,children:[(0,$.jsx)(`div`,{className:`size-2 rounded-[1px] bg-success/30`}),(0,$.jsx)(`div`,{className:`size-2 rounded-[1px] bg-success/60`}),(0,$.jsx)(`div`,{className:`size-2 rounded-[1px] bg-warning/50`}),(0,$.jsx)(`div`,{className:`size-2 rounded-[1px] bg-warning/80`}),(0,$.jsx)(`div`,{className:`size-2 rounded-[1px] bg-error/80`})]}),(0,$.jsx)(`span`,{children:`High`}),(0,$.jsx)(`span`,{className:`ml-1`,children:`|`}),(0,$.jsx)(`div`,{className:`size-2 rounded-[1px] bg-surface-elevated border border-border/30`}),(0,$.jsx)(`span`,{children:`No data`})]})]})}function Oe({profile:e,accountId:t,onClose:n}){let r=[[`Name`,e.account?.display_name],[`Email`,e.account?.email],[`Org`,e.organization?.name],[`Type`,e.organization?.organization_type],[`Tier`,e.organization?.rate_limit_tier],[`Status`,e.organization?.subscription_status]];return(0,$.jsxs)(`section`,{className:`space-y-2 border-t border-border pt-3`,"data-testid":`account-profile-panel`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,$.jsx)(`h3`,{className:`text-sm font-medium`,children:`Profile`}),(0,$.jsx)(`button`,{className:`p-2 text-muted-foreground hover:text-foreground cursor-pointer`,onClick:n,"aria-label":`Close profile`,children:(0,$.jsx)(p,{className:`size-4`})})]}),(0,$.jsx)(`div`,{className:`grid grid-cols-[80px_1fr] gap-x-3 gap-y-1 text-xs`,children:r.map(([e,t])=>t?(0,$.jsxs)(`span`,{className:`contents`,children:[(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:e}),(0,$.jsx)(`span`,{className:`break-all`,children:t})]},e):null)}),(0,$.jsx)(De,{accountId:t})]})}function ke({display:e,onConfirm:t,onCancel:n}){let r=T(),i=(0,$.jsxs)(`div`,{className:`space-y-4`,"data-testid":`account-delete-confirm`,children:[(0,$.jsxs)(`p`,{className:`text-sm`,children:[`Remove `,(0,$.jsx)(`span`,{className:`font-medium`,children:e}),`?`]}),(0,$.jsx)(`p`,{className:`text-xs text-text-subtle`,children:`The stored token is deleted from this machine. Any export you already made keeps working.`}),(0,$.jsxs)(`div`,{className:`flex flex-col-reverse md:flex-row gap-2 md:justify-end pt-2`,children:[(0,$.jsx)(D,{variant:`outline`,onClick:n,className:`min-h-11`,children:`Cancel`}),(0,$.jsx)(D,{variant:`destructive`,autoFocus:!1,onClick:t,className:`min-h-11`,children:`Remove account`})]})]});return r?(0,$.jsx)(w,{open:!0,onClose:n,children:(0,$.jsxs)(`div`,{className:`px-4 pb-4`,children:[(0,$.jsx)(`h2`,{className:`text-base font-semibold mb-3`,children:`Remove account`}),i]})}):(0,$.jsx)(N,{open:!0,onOpenChange:e=>{e||n()},children:(0,$.jsxs)(A,{className:`sm:max-w-sm`,children:[(0,$.jsx)(O,{children:(0,$.jsx)(j,{className:`text-sm`,children:`Remove account`})}),i]})})}var Ae=80;function je({current:e,onSave:t,onCancel:n}){let r=T(),[i,a]=(0,Q.useState)(e),[s,c]=(0,Q.useState)(!1),[l,u]=(0,Q.useState)(null),d=i.trim(),f=!!d&&d!==e&&!s,p=async()=>{if(f){c(!0),u(null);try{await t(d)}catch(e){u(e.message||`Could not rename the account`),c(!1)}}},m=()=>{s||n()},h=(0,$.jsxs)(`form`,{className:`space-y-4`,"data-testid":`account-rename-dialog`,onSubmit:e=>{e.preventDefault(),p()},children:[(0,$.jsx)(I,{autoFocus:!0,value:i,maxLength:Ae,onChange:e=>a(e.target.value),placeholder:`e.g. Personal, Work`,"aria-label":`Account name`,className:`min-h-11 text-sm md:min-h-9`}),l&&(0,$.jsx)(`p`,{className:`text-xs text-error`,role:`alert`,children:l}),(0,$.jsxs)(`div`,{className:`flex flex-col-reverse md:flex-row gap-2 md:justify-end`,children:[(0,$.jsx)(D,{type:`button`,variant:`outline`,onClick:m,disabled:s,className:`min-h-11 md:min-h-9`,children:`Cancel`}),(0,$.jsxs)(D,{type:`submit`,disabled:!f,className:`min-h-11 md:min-h-9`,children:[s&&(0,$.jsx)(o,{className:`size-4 animate-spin`}),` Save`]})]})]});return r?(0,$.jsx)(w,{open:!0,onClose:m,children:(0,$.jsxs)(`div`,{className:`px-4 pb-4`,children:[(0,$.jsx)(`h2`,{className:`text-base font-semibold mb-3`,children:`Rename account`}),h]})}):(0,$.jsx)(N,{open:!0,onOpenChange:e=>{e||m()},children:(0,$.jsxs)(A,{className:`sm:max-w-sm`,children:[(0,$.jsx)(O,{children:(0,$.jsx)(j,{className:`text-sm`,children:`Rename account`})}),h]})})}function Me(e){let t=new Blob([e],{type:`application/json`}),n=document.createElement(`a`);n.href=URL.createObjectURL(t),n.download=`ppm-accounts-backup.json`,n.click(),URL.revokeObjectURL(n.href)}function Ne({open:e,onOpenChange:t,accounts:n,preselectId:r,onMessage:i}){let a=n.filter(e=>e.hasRefreshToken),[s,c]=(0,Q.useState)(new Set),[l,d]=(0,Q.useState)(``),[f,p]=(0,Q.useState)(!1),[m,_]=(0,Q.useState)(!1),[y,b]=(0,Q.useState)(!1),[x,S]=(0,Q.useState)(!1);e&&!x&&(c(r?new Set([r]):new Set(a.map(e=>e.id))),S(!0)),!e&&x&&S(!1);function C(){t(!1),d(``),p(!1),_(!1)}async function w(e){if(s.size===0)return;b(!0);let t=l.trim()||`ppm-hienlh`;try{let n={"Content-Type":`application/json`},r=v();r&&(n.Authorization=`Bearer ${r}`);let a=await fetch(`/api/accounts/export`,{method:`POST`,headers:n,body:JSON.stringify({password:t,accountIds:[...s],includeRefreshToken:f,refreshBeforeExport:m})});if(!a.ok){let e=await a.json();throw Error(e.error??`Export failed: ${a.status}`)}let o=await a.text();e&&await F(o)?i?.(`Backup copied to clipboard!`):(Me(o),i?.(`Backup downloaded.`)),C()}catch{}b(!1)}let T=s.size>0&&!y;return(0,$.jsx)(N,{open:e,onOpenChange:e=>{e||C()},children:(0,$.jsxs)(A,{className:`sm:max-w-md`,children:[(0,$.jsxs)(O,{children:[(0,$.jsxs)(j,{className:`text-sm flex items-center gap-1.5`,children:[(0,$.jsx)(g,{className:`size-3.5`}),` Export Accounts`]}),(0,$.jsx)(M,{className:`text-xs`,children:`Select accounts and set a password to protect the backup.`})]}),(0,$.jsxs)(`div`,{className:`space-y-3`,children:[(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between mb-1`,children:[(0,$.jsx)(`p`,{className:`text-[11px] font-medium text-muted-foreground`,children:`Accounts to export`}),(0,$.jsx)(`button`,{className:`text-[10px] text-primary hover:underline cursor-pointer`,onClick:()=>c(s.size===a.length?new Set:new Set(a.map(e=>e.id))),children:s.size===a.length?`Deselect all`:`Select all`})]}),a.length===0?(0,$.jsx)(`p`,{className:`text-[10px] text-muted-foreground p-2 border rounded`,children:`No exportable accounts.`}):(0,$.jsx)(`div`,{className:`max-h-36 overflow-y-auto space-y-1 border rounded p-2`,children:a.map(e=>(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`input`,{type:`checkbox`,id:`exp-${e.id}`,checked:s.has(e.id),onChange:t=>{let n=new Set(s);t.target.checked?n.add(e.id):n.delete(e.id),c(n)},className:`size-3.5 accent-primary cursor-pointer`}),(0,$.jsx)(`label`,{htmlFor:`exp-${e.id}`,className:`text-xs cursor-pointer truncate`,children:e.label??e.email??e.id.slice(0,8)})]},e.id))})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsxs)(q,{className:`text-xs`,children:[`Password `,(0,$.jsx)(`span`,{className:`text-muted-foreground font-normal`,children:`(optional)`})]}),(0,$.jsx)(I,{type:`password`,placeholder:`Leave empty for default`,value:l,onChange:e=>d(e.target.value),className:`text-xs h-8`,autoComplete:`new-password`})]}),(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`input`,{type:`checkbox`,id:`exp-full`,checked:f,onChange:e=>p(e.target.checked),className:`size-3.5 accent-primary cursor-pointer`}),(0,$.jsx)(`label`,{htmlFor:`exp-full`,className:`text-[11px] cursor-pointer`,children:`Include refresh tokens (full transfer)`})]}),(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`input`,{type:`checkbox`,id:`exp-refresh`,checked:m,onChange:e=>_(e.target.checked),className:`size-3.5 accent-primary cursor-pointer`}),(0,$.jsx)(`label`,{htmlFor:`exp-refresh`,className:`text-[11px] cursor-pointer`,children:`Refresh tokens before export`})]}),f?(0,$.jsxs)(`div`,{className:`rounded-md border border-error/30 bg-error/5 p-2.5`,children:[(0,$.jsx)(`p`,{className:`text-[10px] font-medium text-error`,children:`Full transfer — source accounts will expire`}),(0,$.jsx)(`p`,{className:`text-[10px] text-muted-foreground`,children:`Refresh tokens included. Source machine expires in ~1h after target refreshes.`})]}):m?(0,$.jsx)(`div`,{className:`rounded-md border border-warning/30 bg-warning/5 p-2.5`,children:(0,$.jsx)(`p`,{className:`text-[10px] font-medium text-warning`,children:`Refresh before export — invalidates previous shares`})}):(0,$.jsx)(`div`,{className:`rounded-md border border-success/30 bg-success/5 p-2.5`,children:(0,$.jsx)(`p`,{className:`text-[10px] font-medium text-success`,children:`Share current token (safe)`})}),(0,$.jsx)(`p`,{className:`text-[10px] text-muted-foreground`,children:`Encrypted with AES-256-GCM + scrypt.`})]}),(0,$.jsxs)(k,{className:`gap-1.5 flex-col sm:flex-row`,children:[(0,$.jsx)(D,{size:`sm`,variant:`outline`,className:`text-xs h-7 cursor-pointer`,onClick:C,children:`Cancel`}),(0,$.jsxs)(D,{size:`sm`,variant:`outline`,className:`text-xs h-7 cursor-pointer`,disabled:!T,onClick:()=>w(!0),children:[(0,$.jsx)(h,{className:`size-3 mr-1`}),` Copy`]}),(0,$.jsx)(D,{size:`sm`,className:`text-xs h-7 cursor-pointer`,disabled:!T,onClick:()=>w(!1),children:y?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(o,{className:`size-3 animate-spin mr-1`}),` Exporting...`]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(u,{className:`size-3 mr-1`}),` Download`]})})]})]})})}function Pe({open:e,onOpenChange:t,onSuccess:n}){let[r,i]=(0,Q.useState)(``),[a,s]=(0,Q.useState)(``),[c,l]=(0,Q.useState)(!1),[u,d]=(0,Q.useState)(null);function f(){t(!1),i(``),s(``),d(null)}async function p(){if(r.trim()){l(!0),d(null);try{let e=await ee({data:r.trim(),password:a.trim()||`ppm-hienlh`});f(),n(`Imported ${e.imported} account(s)`)}catch(e){d(e.message||`Import failed`)}l(!1)}}return(0,$.jsx)(N,{open:e,onOpenChange:e=>{e||f()},children:(0,$.jsxs)(A,{className:`sm:max-w-md`,children:[(0,$.jsxs)(O,{children:[(0,$.jsxs)(j,{className:`text-sm flex items-center gap-1.5`,children:[(0,$.jsx)(g,{className:`size-3.5`}),` Import Accounts`]}),(0,$.jsx)(M,{className:`text-xs`,children:`Paste backup data and enter the export password. Imported accounts are temporary (~1h).`})]}),(0,$.jsxs)(`div`,{className:`space-y-3`,children:[(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(q,{className:`text-xs`,children:`Backup data`}),(0,$.jsx)(`textarea`,{value:r,onChange:e=>i(e.target.value),placeholder:`Paste backup JSON here...`,rows:4,className:`w-full text-xs p-2 rounded border border-border bg-background font-mono resize-none focus:outline-none focus:ring-1 focus:ring-primary`})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsxs)(q,{className:`text-xs`,children:[`Password `,(0,$.jsx)(`span`,{className:`text-muted-foreground font-normal`,children:`(optional)`})]}),(0,$.jsx)(I,{type:`password`,placeholder:`Leave empty for default`,value:a,onChange:e=>s(e.target.value),className:`text-xs h-8`,autoComplete:`current-password`})]})]}),u&&(0,$.jsx)(`div`,{className:`text-[11px] p-2 rounded bg-error/10 text-error`,children:u}),(0,$.jsxs)(k,{children:[(0,$.jsx)(D,{size:`sm`,variant:`outline`,className:`text-xs h-7 cursor-pointer`,onClick:f,children:`Cancel`}),(0,$.jsx)(D,{size:`sm`,className:`text-xs h-7 cursor-pointer`,disabled:!r.trim()||c,onClick:p,children:c?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(o,{className:`size-3 animate-spin mr-1`}),` Importing...`]}):`Import`})]})]})})}var Fe=typeof window<`u`?window.matchMedia(`(min-width: 768px)`):null;function Ie(e){return Fe?.addEventListener(`change`,e),()=>Fe?.removeEventListener(`change`,e)}function Le(){return Fe?.matches??!0}function Re(){let[e,t]=(0,Q.useState)(null),[n,r]=(0,Q.useState)(!0);return(0,Q.useEffect)(()=>{r(!0),ne().then(t).finally(()=>r(!1))},[]),n?(0,$.jsx)(`p`,{className:`text-xs text-text-subtle py-4 text-center`,children:`Loading...`}):e?(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(`label`,{className:`text-xs font-medium text-text-primary`,children:`Rotation Strategy`}),(0,$.jsxs)(W,{value:e.strategy,onValueChange:async e=>{t(await L({strategy:e}))},children:[(0,$.jsx)(ie,{className:`w-full h-9 text-xs`,children:(0,$.jsx)(ae,{})}),(0,$.jsxs)(G,{children:[(0,$.jsx)(K,{value:`round-robin`,children:`Round-robin`}),(0,$.jsx)(K,{value:`fill-first`,children:`Fill-first`}),(0,$.jsx)(K,{value:`lowest-usage`,children:`Lowest usage`})]})]}),(0,$.jsxs)(`p`,{className:`text-[10px] text-text-subtle`,children:[e.strategy===`round-robin`&&`Cycles through accounts evenly`,e.strategy===`fill-first`&&`Uses one account until its limit, then moves on`,e.strategy===`lowest-usage`&&`Picks the account with the lowest current usage`]})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(`label`,{className:`text-xs font-medium text-text-primary`,children:`Max Retry`}),(0,$.jsx)(`input`,{type:`number`,min:0,value:e.maxRetry,className:`w-full h-9 text-xs border rounded-md px-3 bg-background`,onChange:async e=>{let n=parseInt(e.target.value,10);!isNaN(n)&&n>=0&&t(await L({maxRetry:n}))}}),(0,$.jsx)(`p`,{className:`text-[10px] text-text-subtle`,children:`How many accounts to try on failure. 0 = try all available accounts.`})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5 border-t border-border pt-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,$.jsx)(`label`,{className:`text-xs font-medium text-text-primary`,children:`Cooldown parking`}),(0,$.jsx)(U,{checked:e.cooldownEnabled,onCheckedChange:async e=>{t(await L({cooldownEnabled:e}))}})]}),(0,$.jsx)(`p`,{className:`text-[10px] text-text-subtle`,children:`Park a failing account (rate limit / usage limit / auth error) until it recovers. Off: accounts stay selectable — rotation still skips accounts already ≥95% on the 5-hour limit.`})]}),(0,$.jsxs)(`div`,{className:`flex items-center justify-between text-xs border-t border-border pt-3`,children:[(0,$.jsx)(`span`,{className:`text-text-subtle`,children:`Active accounts`}),(0,$.jsx)(`span`,{className:`font-medium text-text-primary`,children:e.activeCount})]})]}):(0,$.jsx)(`p`,{className:`text-xs text-text-subtle py-4 text-center`,children:`Failed to load settings`})}function ze({open:e,onOpenChange:t}){let n=(0,Q.useSyncExternalStore)(Ie,Le);return e?n?(0,$.jsx)(N,{open:e,onOpenChange:t,children:(0,$.jsxs)(A,{className:`sm:max-w-sm`,children:[(0,$.jsx)(O,{children:(0,$.jsxs)(j,{className:`text-sm flex items-center gap-2`,children:[(0,$.jsx)(_,{className:`size-4`}),` Rotation & Retry`]})}),(0,$.jsx)(Re,{})]})}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{className:`fixed inset-0 z-50 transition-opacity duration-200 opacity-100`,onClick:()=>t(!1),style:{backgroundColor:`rgba(0,0,0,0.5)`}}),(0,$.jsxs)(`div`,{className:b(`fixed bottom-0 left-0 right-0 z-50 bg-background rounded-t-2xl border-t border-border shadow-2xl`,`transition-transform duration-300 ease-out max-h-[85vh] overflow-y-auto`,`translate-y-0`),children:[(0,$.jsx)(`div`,{className:`flex justify-center pt-3 pb-1`,children:(0,$.jsx)(`div`,{className:`w-10 h-1 rounded-full bg-border`})}),(0,$.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-2 border-b border-border`,children:[(0,$.jsxs)(`span`,{className:`text-sm font-semibold flex items-center gap-2`,children:[(0,$.jsx)(_,{className:`size-4`}),` Rotation & Retry`]}),(0,$.jsx)(`button`,{onClick:()=>t(!1),className:`flex items-center justify-center size-7 rounded-md hover:bg-surface-elevated transition-colors`,children:(0,$.jsx)(p,{className:`size-4`})})]}),(0,$.jsx)(`div`,{className:`px-4 py-4 pb-8`,children:(0,$.jsx)(Re,{})})]})]}):null}var Be=E(`inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2`,{variants:{variant:{default:`border-transparent bg-primary text-primary-foreground shadow`,secondary:`border-transparent bg-secondary text-secondary-foreground`,destructive:`border-transparent bg-destructive text-destructive-foreground shadow`,outline:`text-foreground`}},defaultVariants:{variant:`default`}});function Ve({className:e,variant:t,...n}){return(0,$.jsx)(`div`,{className:b(Be({variant:t}),e),...n})}function He(e){let t=Math.floor(Date.now()/1e3);return e>t?`${Math.floor((e-t)/60)}m`:`exp`}function Ue({accounts:e}){let[t,n]=(0,Q.useState)([]),[r,i]=(0,Q.useState)(!1),[a,s]=(0,Q.useState)(!1),[c,l]=(0,Q.useState)(new Map),u=e.filter(e=>e.hasRefreshToken);async function d(){if(u.length!==0){i(!0);try{let e=await H(u.map(e=>e.id),a);n(t=>[...t,{round:t.length+1,time:new Date().toLocaleTimeString(),includeRefresh:a,items:e}])}catch{}i(!1)}}async function f(e,t){l(t=>new Map(t).set(e,{loading:!0}));try{let n=await z(t);l(t=>new Map(t).set(e,{loading:!1,...n}))}catch(t){l(n=>new Map(n).set(e,{loading:!1,status:`error`,error:t.message}))}}function p(e,t){return[{key:`r${e.round}-pre-${t.id}`,label:`Pre-export`,token:t.preExportTokenFull,preview:t.preExportToken,expires:t.preExportExpires},{key:`r${e.round}-exp-${t.id}`,label:`Exported`,token:t.exportedTokenFull,preview:t.exportedToken,expires:t.exportedExpires},{key:`r${e.round}-post-${t.id}`,label:`Post-export`,token:t.postExportTokenFull,preview:t.postExportToken,expires:t.postExportExpires}]}function m(){for(let e of t)for(let t of e.items)for(let n of p(e,t))n.token&&f(n.key,n.token)}return(0,$.jsxs)(`section`,{className:`border-t pt-4 space-y-2`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,$.jsx)(`p`,{className:`text-xs font-medium`,children:`Simulate export`}),t.length>0&&(0,$.jsxs)(`span`,{className:`text-[10px] text-muted-foreground`,children:[t.length,` round(s)`]})]}),(0,$.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Every run appends a round. Earlier rounds are kept so tokens can be compared across runs.`}),u.length===0?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No OAuth account with a refresh token to export.`}):(0,$.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,$.jsx)(U,{id:`sim-include-refresh`,checked:a,onCheckedChange:s,className:`cursor-pointer`}),(0,$.jsx)(q,{htmlFor:`sim-include-refresh`,className:`text-[11px] cursor-pointer`,children:`Include refresh tokens`})]}),(0,$.jsx)(D,{size:`sm`,className:`h-7 text-xs cursor-pointer`,disabled:r,onClick:()=>void d(),children:r?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(o,{className:`size-3 animate-spin mr-1`}),` Exporting...`]}):`Run export #${t.length+1}`})]}),t.length>0&&(0,$.jsxs)(`div`,{className:`space-y-3`,children:[(0,$.jsxs)(D,{size:`sm`,variant:`outline`,className:`w-full h-7 text-[11px] cursor-pointer`,onClick:m,children:[`Test all tokens (`,t.reduce((e,t)=>e+t.items.length*3,0),`)`]}),t.map(e=>(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsxs)(`p`,{className:`text-xs font-medium text-primary`,children:[`Round #`,e.round]}),(0,$.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:e.time}),(0,$.jsx)(Ve,{variant:e.includeRefresh?`destructive`:`secondary`,className:`text-[9px] px-1 py-0`,children:e.includeRefresh?`with refresh`:`access only`})]}),e.items.map(t=>(0,$.jsxs)(`div`,{className:`p-2 rounded-lg border bg-card space-y-1.5`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`text-[11px] font-medium`,children:t.label??t.email??t.id.slice(0,8)}),t.tokenChanged&&(0,$.jsx)(Ve,{variant:`secondary`,className:`text-[9px] px-1 py-0`,children:`DB token changed`})]}),p(e,t).map(e=>{let t=c.get(e.key);return(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[11px]`,children:[(0,$.jsx)(`span`,{className:`w-20 shrink-0 text-muted-foreground text-[10px]`,children:e.label}),(0,$.jsx)(`code`,{className:`flex-1 truncate font-mono text-[10px] bg-muted px-1 rounded`,children:e.preview??`N/A`}),e.expires&&(0,$.jsx)(`span`,{className:`text-[10px] text-muted-foreground shrink-0`,children:He(e.expires)}),e.token?(0,$.jsx)(D,{size:`sm`,variant:`outline`,className:`h-6 text-[10px] px-1.5 cursor-pointer shrink-0`,disabled:t?.loading,onClick:()=>void f(e.key,e.token),children:t?.loading?(0,$.jsx)(o,{className:`size-3 animate-spin`}):`Test`}):(0,$.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:`-`}),t&&!t.loading&&(0,$.jsx)(`span`,{className:`text-[10px] font-medium shrink-0 ${t.status?.startsWith(`valid`)?`text-success`:`text-error`}`,children:t.status})]},e.key)})]},`r${e.round}-${t.id}`))]},e.round))]})]})}function We(e){let t=Math.floor(Date.now()/1e3),n=Math.floor(Math.abs(e-t)/60);return e>t?`${n}m left`:`expired ${n}m ago`}function Ge({open:e,onOpenChange:t,accounts:n}){let[i,a]=(0,Q.useState)(new Map),[s,c]=(0,Q.useState)(!1);async function l(e){a(t=>new Map(t).set(e,{loading:!0}));try{let t=await re(e,s);a(n=>new Map(n).set(e,{loading:!1,result:t}))}catch(t){a(n=>new Map(n).set(e,{loading:!1,error:t.message}))}}function u(){for(let e of n.filter(e=>e.expiresAt!==null))l(e.id)}return(0,$.jsx)(N,{open:e,onOpenChange:t,children:(0,$.jsxs)(A,{className:`sm:max-w-xl max-h-[85vh] flex flex-col`,children:[(0,$.jsxs)(O,{children:[(0,$.jsxs)(j,{className:`text-sm flex items-center gap-1.5`,children:[(0,$.jsx)(r,{className:`size-4`}),` Token Test`]}),(0,$.jsx)(M,{className:`text-xs`,children:`Probe stored tokens for validity. Nothing is modified.`})]}),(0,$.jsxs)(`div`,{className:`space-y-4 overflow-y-auto flex-1 pr-1`,children:[(0,$.jsxs)(`section`,{className:`space-y-2`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,$.jsx)(`p`,{className:`text-xs font-medium`,children:`Current tokens`}),(0,$.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,$.jsx)(U,{id:`token-test-refresh`,checked:s,onCheckedChange:c,className:`cursor-pointer`}),(0,$.jsx)(q,{htmlFor:`token-test-refresh`,className:`text-[11px] cursor-pointer`,children:`Also test refresh`})]}),(0,$.jsx)(D,{size:`sm`,variant:`outline`,className:`h-7 text-xs cursor-pointer`,onClick:u,children:`Test all`})]})]}),n.length===0&&(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No accounts to test.`}),(0,$.jsx)(`div`,{className:`space-y-1.5`,children:n.map(e=>{let t=i.get(e.id),n=t?.result?.accessToken.status;return(0,$.jsxs)(`div`,{className:`p-2 rounded border bg-card space-y-1`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`span`,{className:`text-xs font-medium truncate block`,children:e.label??e.email??e.id.slice(0,8)}),e.expiresAt&&(0,$.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:We(e.expiresAt)})]}),(0,$.jsx)(D,{size:`sm`,variant:`outline`,className:`h-7 text-xs cursor-pointer shrink-0`,disabled:t?.loading,onClick:()=>void l(e.id),children:t?.loading?(0,$.jsx)(o,{className:`size-3 animate-spin`}):`Test`})]}),t&&!t.loading&&(0,$.jsxs)(`div`,{className:`text-[11px] pl-2 border-l-2 border-muted`,children:[t.error&&(0,$.jsx)(`p`,{className:`text-error`,children:t.error}),n&&(0,$.jsxs)(`span`,{className:n.startsWith(`valid`)?`text-success`:`text-error`,children:[n,t.result?.accessToken.code?` (${t.result.accessToken.code})`:``]})]})]},e.id)})})]}),(0,$.jsx)(Ue,{accounts:n})]}),(0,$.jsx)(k,{children:(0,$.jsx)(D,{size:`sm`,variant:`outline`,className:`text-xs cursor-pointer`,onClick:()=>t(!1),children:`Close`})})]})})}function Ke(){let{usages:e,accounts:t,activeAccountId:n,initialLoading:i,refreshing:s,flashIds:c,reload:l}=he(),[f,p]=(0,Q.useState)(null),[h,g]=(0,Q.useState)(null),[v,y]=(0,Q.useState)(null),[b,x]=(0,Q.useState)(null),[S,C]=(0,Q.useState)(null),[w,T]=(0,Q.useState)(null),[E,O]=(0,Q.useState)(null),[k,A]=(0,Q.useState)(void 0);function j(e){l(),e&&p(e)}async function M(e,t){g(e);try{await B(e,{status:t===`disabled`?`active`:`disabled`})}catch(e){p(e.message)}g(null),l()}async function N(){if(v){try{await V(v.id),p(`Account "${v.display}" removed.`),l()}catch(e){p(`Failed to remove: ${e.message}`)}y(null)}}async function P(e){b&&(await B(b.id,{label:e}),x(null),p(`Account renamed to "${e}".`),l())}let F=new Map(t.map(e=>[e.id,e])),I=e[0]?.usage.lastFetchedAt;return(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsx)(_e,{description:`Connect multiple Claude accounts. PPM rotates between them automatically to avoid rate limits.`,onRefresh:()=>void l(),refreshing:s,disabled:i,actions:(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(D,{size:`sm`,className:`cursor-pointer gap-1.5`,onClick:()=>{A(void 0),O(`add`)},children:[(0,$.jsx)(d,{className:`size-4`}),` Add account`]}),(0,$.jsxs)(D,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>{T(null),O(`export`)},children:[(0,$.jsx)(u,{className:`size-4`}),` Export`]}),(0,$.jsxs)(D,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>O(`import`),children:[(0,$.jsx)(a,{className:`size-4`}),` Import`]}),(0,$.jsxs)(D,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>O(`rotation`),children:[(0,$.jsx)(_,{className:`size-4`}),` Rotation`]}),(0,$.jsxs)(D,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>O(`token-test`),children:[(0,$.jsx)(r,{className:`size-4`}),` Token test`]})]})}),(0,$.jsx)(le,{message:f,onDismiss:()=>p(null)}),(0,$.jsxs)(`section`,{className:`space-y-2`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,$.jsx)(`h3`,{className:`text-sm font-medium`,children:`Accounts`}),I&&(0,$.jsxs)(`span`,{className:`text-[10px] text-muted-foreground`,children:[`usage `,ce(new Date(I).getTime())]})]}),i?(0,$.jsxs)(`div`,{className:`flex items-center gap-2 py-6 text-xs text-muted-foreground`,children:[(0,$.jsx)(o,{className:`size-4 animate-spin`}),` Loading accounts...`]}):e.length===0?(0,$.jsxs)(`div`,{className:`flex flex-col items-center gap-2 py-8 text-center`,children:[(0,$.jsx)(m,{className:`size-5 text-muted-foreground`}),(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No accounts connected yet.`}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Add one to start using PPM.`})]}):(0,$.jsx)(se,{children:e.map(e=>(0,$.jsx)(ge,{layout:`strip`,entry:e,isActive:e.accountId===n,accountInfo:F.get(e.accountId),onToggle:M,toggling:h===e.accountId,onDelete:(e,t)=>y({id:e,display:t}),onRename:(e,t)=>x({id:e,current:t}),onExport:e=>{T(e),O(`export`)},onViewProfile:(e,t)=>C({profile:e,accountId:t}),onReauth:()=>{A({id:e.accountId,label:e.accountLabel??e.accountId.slice(0,8)}),O(`add`)},flash:c.has(e.accountId)},e.accountId))})]}),S&&(0,$.jsx)(Oe,{profile:S.profile,accountId:S.accountId,onClose:()=>C(null)}),v&&(0,$.jsx)(ke,{display:v.display,onConfirm:()=>void N(),onCancel:()=>y(null)}),b&&(0,$.jsx)(je,{current:b.current,onSave:P,onCancel:()=>x(null)}),(0,$.jsx)(ye,{open:E===`add`,onOpenChange:e=>{O(e?`add`:null),e||A(void 0)},onSuccess:j,signInAgainFor:k}),(0,$.jsx)(Ne,{open:E===`export`,onOpenChange:e=>{O(e?`export`:null),e||T(null)},accounts:t,preselectId:w,onMessage:p}),(0,$.jsx)(Pe,{open:E===`import`,onOpenChange:e=>O(e?`import`:null),onSuccess:j}),(0,$.jsx)(ze,{open:E===`rotation`,onOpenChange:e=>O(e?`rotation`:null)}),(0,$.jsx)(Ge,{open:E===`token-test`,onOpenChange:e=>O(e?`token-test`:null),accounts:t})]})}function qe({mode:e,onOpenChange:t,password:n,onPasswordChange:r,busy:i,onExport:s,onImport:c,error:l}){let d=(0,Q.useRef)(null),f=e===`export`;return(0,$.jsx)(N,{open:e!==null,onOpenChange:t,children:(0,$.jsxs)(A,{className:`sm:max-w-md`,children:[(0,$.jsxs)(O,{children:[(0,$.jsxs)(j,{className:`text-sm flex items-center gap-1.5`,children:[(0,$.jsx)(g,{className:`size-4`}),` `,f?`Export Codex Accounts`:`Import Codex Accounts`]}),(0,$.jsx)(M,{className:`text-xs leading-relaxed`,children:f?`Writes a password-encrypted file containing each account's login.`:`Reads a backup file. The password must be the one it was exported with.`})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(q,{htmlFor:`codex-backup-password`,className:`text-xs`,children:`Password`}),(0,$.jsx)(I,{id:`codex-backup-password`,type:`password`,placeholder:f?`Choose a password`:`Password used for the export`,value:n,onChange:e=>r(e.target.value),className:`text-xs`,autoComplete:f?`new-password`:`current-password`}),(0,$.jsx)(`p`,{className:`text-[10px] text-muted-foreground`,children:`A backup holds full logins — keep the file and its password together.`})]}),l&&(0,$.jsx)(`div`,{className:`text-[11px] p-2 rounded bg-error/10 text-error`,children:l}),(0,$.jsx)(`input`,{ref:d,type:`file`,accept:`application/json,.json`,className:`hidden`,onChange:e=>{let t=e.target.files?.[0];e.target.value=``,t&&c(t)}}),(0,$.jsxs)(k,{children:[(0,$.jsx)(D,{size:`sm`,variant:`outline`,className:`text-xs cursor-pointer`,onClick:()=>t(!1),children:`Cancel`}),(0,$.jsxs)(D,{size:`sm`,className:`text-xs cursor-pointer gap-1.5`,disabled:!n.trim()||i,onClick:()=>f?s():d.current?.click(),children:[i?(0,$.jsx)(o,{className:`size-3.5 animate-spin`}):f?(0,$.jsx)(u,{className:`size-3.5`}):(0,$.jsx)(a,{className:`size-3.5`}),f?`Download backup`:`Choose file`]})]})]})})}var Je=[{value:`round-robin`,label:`Round-robin`,hint:`Take the next account each time.`},{value:`fill-first`,label:`Fill-first`,hint:`Stay on one account until it runs out.`},{value:`lowest-usage`,label:`Lowest usage`,hint:`Pick whichever has the most left.`}];function Ye({open:e,onOpenChange:t,strategy:n,onChange:r}){return(0,$.jsx)(N,{open:e,onOpenChange:t,children:(0,$.jsxs)(A,{className:`sm:max-w-md`,children:[(0,$.jsxs)(O,{children:[(0,$.jsx)(j,{className:`text-sm`,children:`Codex Rotation`}),(0,$.jsx)(M,{className:`text-xs leading-relaxed`,children:`How a new chat chooses among your Codex accounts.`})]}),(0,$.jsx)(`div`,{className:`space-y-2`,children:Je.map(e=>(0,$.jsxs)(`button`,{type:`button`,onClick:()=>r(e.value),"aria-current":n===e.value?`true`:void 0,className:b(`w-full text-left rounded-md border px-3 py-2.5 min-h-11 cursor-pointer transition-colors`,n===e.value?`border-primary bg-primary/10`:`border-border hover:bg-accent/50 active:bg-accent`),children:[(0,$.jsx)(`p`,{className:`text-sm font-medium`,children:e.label}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.hint})]},e.value))}),(0,$.jsx)(k,{children:(0,$.jsx)(D,{size:`sm`,variant:`outline`,className:`text-xs cursor-pointer`,onClick:()=>t(!1),children:`Done`})})]})})}function Xe(e){return e==null?null:Math.round(e*100)}function Ze({usage:e}){let t=e.session==null&&e.weekly==null;return(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(t||e.session!=null)&&(0,$.jsx)(ue,{label:`5-Hour Session`,pct:Xe(e.fiveHour),reset:oe(e.session),resetsAt:e.session?.resetsAt}),(t||e.weekly!=null)&&(0,$.jsx)(ue,{label:`Weekly`,pct:Xe(e.sevenDay),reset:oe(e.weekly),resetsAt:e.weekly?.resetsAt})]})}function Qe(e){let t=e=>Math.round((e??0)*100)>=100;return t(e.session?.utilization)||t(e.weekly?.utilization)}function $e(e){return Qe(e)&&(e.resetCredits?.available??0)>0}var et={reset:e=>`${e}: limits reset to 0%. The weekly reset date now counts from your next use.`,nothingToReset:e=>`${e}: nothing needed resetting, so the reset was kept.`,noCredit:e=>`${e} has no free reset left.`,alreadyRedeemed:e=>`${e}: that reset had already been used.`};function tt(e){return e?new Date(e).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`}):null}function nt({account:e,usage:t,onDone:n}){let r=T(),[i,a]=(0,Q.useState)(!1),[c,l]=(0,Q.useState)(!1);if(!$e(t))return null;let u=t.resetCredits;async function d(){l(!0);try{let t=await y.post(`/api/codex-accounts/${e.id}/reset-credit`);n(et[t.outcome]?.(e.label)??`${e.label}: ${t.outcome}`)}catch(e){n(e.message||`Could not use the reset`)}finally{l(!1),a(!1)}}let f=tt(t.weekly?.resetsAt),p=tt(u.nextExpiresAt),m=(0,$.jsxs)(`div`,{className:`space-y-3`,"data-testid":`codex-reset-credit-confirm`,children:[(0,$.jsxs)(`p`,{className:`text-sm`,children:[`Use 1 of `,(0,$.jsx)(`span`,{className:`font-medium`,children:e.label}),`'s `,u.available,` free reset`,u.available===1?``:`s`,`?`]}),(0,$.jsxs)(`ul`,{className:`text-xs text-text-secondary space-y-1.5 list-disc pl-4`,children:[(0,$.jsxs)(`li`,{children:[u.title??`Full reset`,`: the 5-hour and weekly usage go back to 0% now.`]}),(0,$.jsxs)(`li`,{children:[`The weekly reset date moves: the next one is about 7 days after you continue using Codex`,f?`, not ${f} as now`:``,`. You do not also get that one.`]}),p&&(0,$.jsxs)(`li`,{children:[`This spends the reset that expires first (`,p,`).`]})]}),(0,$.jsxs)(`div`,{className:`flex flex-col-reverse md:flex-row gap-2 md:justify-end pt-1`,children:[(0,$.jsx)(D,{variant:`outline`,onClick:()=>a(!1),disabled:c,className:`min-h-11`,children:`Keep it`}),(0,$.jsxs)(D,{onClick:()=>void d(),disabled:c,className:`min-h-11 gap-1.5`,children:[c?(0,$.jsx)(o,{className:`size-4 animate-spin`}):(0,$.jsx)(s,{className:`size-4`}),`Use reset`]})]})]});return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(D,{size:`sm`,variant:`outline`,className:`min-h-11 md:min-h-0 md:h-7 gap-1 px-2 text-[11px] cursor-pointer border-primary/40 text-primary`,onClick:()=>a(!0),disabled:c,children:[(0,$.jsx)(s,{className:`size-3.5`}),` Use reset`]}),i&&(r?(0,$.jsx)(w,{open:!0,onClose:()=>{c||a(!1)},children:(0,$.jsxs)(`div`,{className:`px-4 pb-4`,children:[(0,$.jsx)(`h2`,{className:`text-base font-semibold mb-3`,children:`Use a free reset`}),m]})}):(0,$.jsx)(N,{open:!0,onOpenChange:e=>{!e&&!c&&a(!1)},children:(0,$.jsxs)(A,{className:`sm:max-w-sm`,children:[(0,$.jsx)(O,{children:(0,$.jsx)(j,{className:`text-sm`,children:`Use a free reset`})}),m]})}))]})}var rt=1440*60*1e3,it=7,at=5;function ot(e,t=Date.now()){if(!e||e.windowHours!==168)return null;let n=new Date(e.resetsAt).getTime();if(!Number.isFinite(t)||!Number.isFinite(n)||n<=t)return null;let r=n-it*rt;if(t<r)return null;let i=Math.min(it-1,Math.floor((t-r)/rt)),a=0;for(let e=0;e<=i;e++){let t=new Date(r+e*rt).getUTCDay();t!==0&&t!==6&&a++}let o=a/at;return{day:a,cap:o,used:e.utilization,blocked:e.utilization>=o}}function st(){let[e,t]=(0,Q.useState)(null),n=de(()=>t(null)),[r,s]=(0,Q.useState)(null);return(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsx)(_e,{description:(0,$.jsxs)($.Fragment,{children:[`Each Codex account keeps its own login (`,(0,$.jsx)(`code`,{children:`CODEX_HOME`}),`). One is picked per chat by the rotation setting.`]}),onRefresh:()=>void n.load(),refreshing:n.loading,actions:(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(D,{size:`sm`,className:`cursor-pointer gap-1.5`,onClick:()=>t(`add`),children:[(0,$.jsx)(d,{className:`size-4`}),` Add account`]}),(0,$.jsxs)(D,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>t(`export`),children:[(0,$.jsx)(u,{className:`size-4`}),` Export`]}),(0,$.jsxs)(D,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>t(`import`),children:[(0,$.jsx)(a,{className:`size-4`}),` Import`]}),(0,$.jsxs)(D,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>t(`rotation`),children:[(0,$.jsx)(_,{className:`size-4`}),` Rotation`]})]})}),(0,$.jsx)(le,{message:n.msg??n.err,onDismiss:()=>{n.setMsg(null),n.setErr(null)}}),(0,$.jsxs)(`section`,{className:`space-y-2`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,$.jsx)(`h3`,{className:`text-sm font-medium`,children:`Codex Accounts`}),(0,$.jsx)(`span`,{className:`text-[10px] text-muted-foreground capitalize`,children:n.strategy.replace(`-`,` `)})]}),n.loading&&n.accounts.length===0?(0,$.jsxs)(`div`,{className:`flex items-center gap-2 py-6 text-xs text-muted-foreground`,children:[(0,$.jsx)(o,{className:`size-4 animate-spin`}),` Loading accounts...`]}):n.accounts.length===0?(0,$.jsxs)(`div`,{className:`flex flex-col items-center gap-2 py-8 text-center`,children:[(0,$.jsx)(m,{className:`size-5 text-muted-foreground`}),(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No Codex accounts yet.`}),(0,$.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Chats use your default `,(0,$.jsx)(`code`,{children:`~/.codex`}),` login until you add one.`]})]}):(0,$.jsx)(se,{children:n.accounts.map(e=>{let t=n.usages[e.id]??{};return(0,$.jsxs)(me,{dense:!0,className:`min-w-[300px] shrink-0 snap-start${e.signedOut?` opacity-60`:``}`,"data-testid":`account-card`,"data-account-id":e.id,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`text-sm font-medium truncate flex-1 min-w-0`,children:e.label}),e.signedOut&&(0,$.jsx)(fe,{className:`text-[10px] text-error shrink-0 font-medium`,hint:`Codex rejected this account's login (revoked or expired), so no turn can run on it and it is skipped. The usage shown is the last reading. Click to sign in again — the account keeps its settings and chats.`,onClick:e.type===`chatgpt`?()=>s(e):void 0,children:`Sign in again`}),(0,$.jsx)(`span`,{className:`text-[10px] uppercase tracking-wide text-text-subtle border border-border rounded px-1 shrink-0`,children:e.type}),Y(e.planType)&&(0,$.jsx)(`span`,{className:`text-[10px] text-text-subtle shrink-0`,children:Y(e.planType)}),(0,$.jsx)(U,{checked:e.status!==`disabled`,onCheckedChange:()=>void n.toggle(e.id,e.status??`active`),disabled:n.toggling.has(e.id),"aria-label":e.status===`disabled`?`Enable account`:`Disable account`,className:`cursor-pointer shrink-0`}),(0,$.jsxs)(C,{children:[(0,$.jsx)(x,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,onClick:()=>void n.remove(e.id),"aria-label":`Remove account`,className:`p-2 rounded cursor-pointer text-text-subtle hover:text-error hover:bg-surface-elevated transition-colors shrink-0`,children:(0,$.jsx)(f,{className:`size-4`})})}),(0,$.jsx)(S,{side:`top`,children:`Remove account`})]})]}),(0,$.jsx)(Ze,{usage:t}),t.resetCredits&&(0,$.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap text-[10px] text-text-subtle`,children:[(0,$.jsx)(X,{credits:t.resetCredits}),(0,$.jsx)(nt,{account:e,usage:t,onDone:e=>{n.setMsg(e),n.load()}})]}),t.session==null&&(()=>{let r=ot(t.weekly);return r?(0,$.jsxs)(`div`,{className:`flex min-h-12 items-center justify-between gap-3 rounded-md border px-2.5 py-1.5 ${e.dailyGuardEnabled&&r.blocked?`border-error/40 bg-error/5`:`border-border/50 bg-surface/40`}`,children:[(0,$.jsxs)(`div`,{className:`min-w-0 space-y-0.5`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-medium ${e.dailyGuardEnabled&&r.blocked?`text-error`:`text-text-secondary`}`,children:[(0,$.jsx)(`span`,{children:`Daily guard`}),(0,$.jsxs)(C,{children:[(0,$.jsx)(x,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,"aria-label":`About Daily guard`,className:`text-text-subtle hover:text-text-primary cursor-help`,children:(0,$.jsx)(i,{className:`size-3.5`})})}),(0,$.jsx)(S,{side:`top`,className:`max-w-64 text-xs leading-relaxed`,children:`Spreads the weekly quota across five weekdays, adding 20% per weekday. Weekend slots keep the previous cap; unused allowance carries forward. Daily slots start at the reset time and use UTC weekdays. Turn it off any time to use the remaining quota freely.`})]})]}),(0,$.jsx)(`p`,{className:`text-[10px] tabular-nums ${e.dailyGuardEnabled&&r.blocked?`text-error`:`text-text-subtle`}`,children:e.dailyGuardEnabled&&r.blocked?`${Math.round(r.used*100)}% used / ${Math.round(r.cap*100)}% daily cap. New turns paused.`:`Weekday ${r.day}/5, ${Math.round(r.cap*100)}% daily cap`})]}),(0,$.jsxs)(`span`,{className:`hidden`,title:`Weekday ${r.day}/5: hold weekly usage at or below ${Math.round(r.cap*100)}% to last until reset.`,children:[`Daily guard `,e.dailyGuardEnabled?`· Weekday ${r.day}/5 cap ${Math.round(r.cap*100)}%`:``]}),(0,$.jsx)(U,{checked:!!e.dailyGuardEnabled,onCheckedChange:()=>void n.toggleDailyGuard(e.id,!!e.dailyGuardEnabled),disabled:n.toggling.has(e.id),"aria-label":e.dailyGuardEnabled?`Disable Daily guard`:`Enable Daily guard`,className:`cursor-pointer shrink-0`})]}):null})()]},e.id)})})]}),(0,$.jsx)(J,{open:e===`add`,onOpenChange:e=>{e||n.cancelLogin(),t(e?`add`:null)},label:n.label,onLabelChange:n.setLabel,apiKey:n.apiKey,onApiKeyChange:n.setApiKey,adding:n.adding,onAddApiKey:()=>void n.addApiKey(),deviceWaiting:n.deviceWaiting,onStartDevice:()=>void n.startDevice(),device:n.device,browser:n.browser,onStartBrowser:()=>void n.startBrowser(),loginStarting:n.loginStarting,callbackUrl:n.callbackUrl,onCallbackUrlChange:n.setCallbackUrl,submittingCallback:n.submittingCallback,onSubmitCallback:()=>void n.submitCallback(),error:n.err}),(0,$.jsx)(qe,{mode:e===`export`?`export`:e===`import`?`import`:null,onOpenChange:e=>{e||t(null)},password:n.backupPassword,onPasswordChange:n.setBackupPassword,busy:n.exporting||n.importing,onExport:()=>void n.doExport(),onImport:e=>void n.doImport(e),error:n.err}),r&&(0,$.jsx)(Z,{account:r,onClose:()=>s(null),onDone:()=>void n.load()}),(0,$.jsx)(Ye,{open:e===`rotation`,onOpenChange:e=>t(e?`rotation`:null),strategy:n.strategy,onChange:e=>void n.changeStrategy(e)})]})}var ct=[{value:`round-robin`,label:`Round-robin`,hint:`Take the next account each time.`},{value:`fill-first`,label:`Fill-first`,hint:`Stay on one account until it runs out.`},{value:`lowest-usage`,label:`Lowest usage`,hint:`Pick whichever has the most left.`}];function lt(e){return e==null?null:Math.round(e*100)}function ut(){let[e,t]=(0,Q.useState)([]),[n,r]=(0,Q.useState)(`round-robin`),[i,a]=(0,Q.useState)({}),[s,u]=(0,Q.useState)(!0),[p,h]=(0,Q.useState)(null),[g,v]=(0,Q.useState)(null),[w,T]=(0,Q.useState)(new Set),[E,P]=(0,Q.useState)(null),[F,L]=(0,Q.useState)(null),[R,z]=(0,Q.useState)(``),[B,ee]=(0,Q.useState)(null),[te,ne]=(0,Q.useState)(!1),[V,re]=(0,Q.useState)(``),[H,ie]=(0,Q.useState)(!1),[ae,W]=(0,Q.useState)(null),G=(0,Q.useRef)(0),K=(0,Q.useRef)(!1),J=(0,Q.useRef)(!1),Y=(0,Q.useRef)(null),de=(0,Q.useRef)(null),X=(0,Q.useCallback)(async()=>{u(!0),v(null);try{let e=await y.get(`/api/antigravity-accounts`);t(e.accounts),r(e.strategy),a(await y.get(`/api/antigravity-accounts/usage`))}catch(e){v(e.message)}finally{u(!1)}},[]);(0,Q.useEffect)(()=>{X()},[X]);let fe=(0,Q.useCallback)(()=>{G.current+=1,K.current=!1,J.current=!1,de.current?.(),de.current=null;let e=Y.current;Y.current=null,e&&y.del(`/api/antigravity-accounts/login/${e}`).catch(()=>{})},[]);(0,Q.useEffect)(()=>fe,[fe]);let Z=(0,Q.useCallback)(()=>{fe(),ee(null),ne(!1),re(``),ie(!1)},[fe]),he=(0,Q.useCallback)(()=>{Z(),W(null),z(``),L(null),P(null)},[Z]),ge=(0,Q.useCallback)(e=>{let t=Date.now()+61e4,n=!1,r;de.current=()=>{n=!0,clearTimeout(r)};let i=async()=>{if(n)return;let a=null;try{a=await y.get(`/api/antigravity-accounts/login/${e}/status`)}catch{}if(!n){if(a?.state===`done`){Y.current=null,Z(),W(null),z(``),L(null),P(null),h(`Antigravity Google account connected.`),await X();return}if(a?.state===`error`||Date.now()>t){Y.current=null,Z(),W(a?.state===`error`?a.error??`Login failed.`:`Login timed out.`);return}r=setTimeout(i,2e3)}};i()},[X,Z]),ye=(0,Q.useCallback)(async e=>{if(K.current||Y.current||J.current)return;K.current=!0;let t=++G.current;ne(!0),W(null);try{let n=await y.post(`/api/antigravity-accounts/login`,{...R.trim()?{label:R.trim()}:{},...e?{accountId:e.id}:{}});if(t!==G.current){y.del(`/api/antigravity-accounts/login/${n.id}`).catch(()=>{});return}Y.current=n.id,ee(n),ge(n.id)}catch(e){t===G.current&&W(e.message)}finally{t===G.current&&(K.current=!1,ne(!1))}},[R,ge]),be=(0,Q.useCallback)(async()=>{if(!B||!V.trim()||J.current)return;let e=G.current;J.current=!0,ie(!0),W(null);try{let t=await y.post(`/api/antigravity-accounts/login/${B.id}/callback`,{code:V.trim()});if(e!==G.current)return;if(t?.state===`error`){Y.current=null,Z(),W(t.error??`Login failed.`);return}if(t?.state!==`done`)return;Y.current=null,Z(),z(``),L(null),P(null),h(`Antigravity Google account connected.`),await X()}catch(t){e===G.current&&(Y.current=null,Z(),W(t.message))}finally{e===G.current&&(J.current=!1,ie(!1))}},[B,V,X,Z]),xe=(0,Q.useCallback)(async(e,n)=>{T(t=>new Set(t).add(e)),v(null);try{let r=n===`disabled`?`active`:`disabled`;await y.patch(`/api/antigravity-accounts/${e}`,{status:r}),t(t=>t.map(t=>t.id===e?{...t,status:r}:t))}catch(e){v(e.message)}finally{T(t=>{let n=new Set(t);return n.delete(e),n})}},[]),Se=(0,Q.useCallback)(async e=>{v(null);try{await y.del(`/api/antigravity-accounts/${e}`),t(t=>t.filter(t=>t.id!==e))}catch(e){v(e.message)}},[]),Ce=(0,Q.useCallback)(async e=>{v(null);try{await y.put(`/api/antigravity-accounts/strategy`,{strategy:e}),r(e)}catch(e){v(e.message)}},[]),we=(0,Q.useCallback)(e=>{L(e),z(e.label),P(`add`)},[]);return(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsx)(_e,{description:(0,$.jsxs)($.Fragment,{children:[`Each Antigravity account keeps its own Google OAuth login (`,(0,$.jsx)(`code`,{children:`~/.ppm/antigravity-accounts`}),`) alongside your local IDE login (`,(0,$.jsx)(`code`,{children:`~/.gemini`}),`). One is picked per chat by the rotation setting.`]}),onRefresh:()=>void X(),refreshing:s,actions:(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(D,{size:`sm`,className:`cursor-pointer gap-1.5`,onClick:()=>{L(null),z(``),P(`add`)},children:[(0,$.jsx)(d,{className:`size-4`}),` Add account`]}),(0,$.jsxs)(D,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>P(`rotation`),children:[(0,$.jsx)(_,{className:`size-4`}),` Rotation`]})]})}),(0,$.jsx)(le,{message:p??g,onDismiss:()=>{h(null),v(null)}}),(0,$.jsxs)(`section`,{className:`space-y-2`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,$.jsx)(`h3`,{className:`text-sm font-medium`,children:`Antigravity Accounts`}),(0,$.jsx)(`span`,{className:`text-[10px] text-muted-foreground capitalize`,children:n.replace(`-`,` `)})]}),s&&e.length===0?(0,$.jsxs)(`div`,{className:`flex items-center gap-2 py-6 text-xs text-muted-foreground`,children:[(0,$.jsx)(o,{className:`size-4 animate-spin`}),` Loading accounts...`]}):e.length===0?(0,$.jsxs)(`div`,{className:`flex flex-col items-center gap-2 py-8 text-center`,children:[(0,$.jsx)(m,{className:`size-5 text-muted-foreground`}),(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No Antigravity accounts yet.`}),(0,$.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Click `,(0,$.jsx)(`strong`,{children:`Add account`}),` to sign in with Google, or start Antigravity Desktop to auto-detect your local account.`]})]}):(0,$.jsx)(se,{children:e.map(e=>{let t=ve(i[e.id]??{}),n=t.session==null&&t.weekly==null&&(!t.weeklyScoped||t.weeklyScoped.length===0),r=e.id===`default`;return(0,$.jsxs)(me,{dense:!0,className:`min-w-[320px] shrink-0 snap-start`,"data-testid":`account-card`,"data-account-id":e.id,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,$.jsx)(`div`,{className:`text-sm font-medium truncate`,children:e.label}),e.email&&e.email!==e.label&&(0,$.jsx)(`div`,{className:`text-[11px] text-text-subtle truncate`,children:e.email})]}),(0,$.jsx)(`span`,{className:`text-[10px] uppercase tracking-wide text-text-subtle border border-border rounded px-1 shrink-0`,children:r?`~/.gemini`:`Google`}),e.planType&&(0,$.jsx)(`span`,{className:`text-[10px] font-medium text-primary bg-primary/10 border border-primary/20 rounded px-1.5 py-0.5 shrink-0`,children:e.planType}),(0,$.jsx)(U,{checked:e.status!==`disabled`,onCheckedChange:()=>void xe(e.id,e.status),disabled:w.has(e.id),"aria-label":e.status===`disabled`?`Enable account`:`Disable account`,className:`cursor-pointer shrink-0`}),!r&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(C,{children:[(0,$.jsx)(x,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,onClick:()=>we(e),"aria-label":`Sign in again`,className:`p-1.5 rounded cursor-pointer text-text-subtle hover:text-foreground hover:bg-surface-elevated transition-colors shrink-0`,children:(0,$.jsx)(c,{className:`size-3.5`})})}),(0,$.jsx)(S,{side:`top`,children:`Sign in again`})]}),(0,$.jsxs)(C,{children:[(0,$.jsx)(x,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,onClick:()=>void Se(e.id),"aria-label":`Remove account`,className:`p-1.5 rounded cursor-pointer text-text-subtle hover:text-error hover:bg-surface-elevated transition-colors shrink-0`,children:(0,$.jsx)(f,{className:`size-4`})})}),(0,$.jsx)(S,{side:`top`,children:`Remove account`})]})]})]}),(0,$.jsxs)(`div`,{className:`space-y-2 pt-1`,children:[(n||t.session!=null)&&(0,$.jsx)(ue,{label:`Gemini · 5-Hour Session`,pct:lt(t.fiveHour),reset:oe(t.session),resetsAt:t.session?.resetsAt}),(n||t.weekly!=null)&&(0,$.jsx)(ue,{label:`Gemini · Weekly`,pct:lt(t.sevenDay),reset:oe(t.weekly),resetsAt:t.weekly?.resetsAt}),t.weeklyScoped?.map(e=>(0,$.jsx)(ue,{label:e.label,pct:lt(e.utilization),reset:oe(e),resetsAt:e.resetsAt},e.label))]}),t.lastFetchedAt&&pe(t.lastFetchedAt)&&(0,$.jsxs)(`p`,{className:`text-[10px] text-warning`,children:[`Last read `,ce(Date.parse(t.lastFetchedAt)),`. Neither agy nor the Antigravity app has answered since.`]})]},e.id)})})]}),(0,$.jsx)(N,{open:E===`add`,onOpenChange:e=>{e||he()},children:(0,$.jsxs)(A,{className:`sm:max-w-md max-h-[90dvh] overflow-y-auto`,children:[(0,$.jsxs)(O,{children:[(0,$.jsx)(j,{className:`text-sm`,children:F?`Sign in again — ${F.label}`:`Add Antigravity Account`}),(0,$.jsx)(M,{className:`text-xs leading-relaxed`,children:F?`Sign in with Google to refresh this account's OAuth credentials.`:`Sign in with a Google account using Antigravity's OAuth PKCE flow. Each account is stored in its own isolated directory.`})]}),(0,$.jsxs)(`div`,{className:`space-y-3`,children:[!F&&(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(q,{htmlFor:`agy-label`,className:`text-xs`,children:`Label (optional)`}),(0,$.jsx)(I,{id:`agy-label`,placeholder:`e.g. Personal, Work, Shopee 2`,value:R,onChange:e=>z(e.target.value),disabled:te||H,className:`text-xs`})]}),(0,$.jsxs)(`div`,{className:`rounded-md border p-3 space-y-2.5`,children:[(0,$.jsx)(`p`,{className:`text-[11px] font-medium`,children:`Google OAuth Sign-In`}),B?(0,$.jsxs)(`div`,{className:`space-y-2.5 text-xs`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,$.jsxs)(`a`,{href:B.authUrl,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1.5 font-medium text-primary hover:underline`,children:[(0,$.jsx)(l,{className:`size-3.5`}),` Open Google Sign-In page`]}),(0,$.jsx)(`button`,{type:`button`,onClick:()=>{Z(),W(null)},disabled:H,className:`text-[11px] text-muted-foreground hover:text-foreground underline cursor-pointer`,children:`Start over`})]}),(0,$.jsxs)(`p`,{className:`text-muted-foreground leading-relaxed`,children:[`1. Open the link above and sign in with your Google account.`,(0,$.jsx)(`br`,{}),`2. Copy the authorization code (or the full callback URL) shown after signing in and paste it below:`]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(q,{htmlFor:`agy-auth-code`,className:`text-xs`,children:`Authorization Code or Callback URL`}),(0,$.jsx)(I,{id:`agy-auth-code`,type:`text`,autoComplete:`off`,spellCheck:!1,placeholder:`4/0A... or https://antigravity.google/oauth-callback?code=...`,value:V,onChange:e=>re(e.target.value),disabled:H,className:`text-xs font-mono`})]}),(0,$.jsxs)(D,{size:`sm`,className:`w-full cursor-pointer gap-1.5`,onClick:()=>void be(),disabled:!V.trim()||H,children:[H&&(0,$.jsx)(o,{className:`size-3.5 animate-spin`}),`Verify & Save Account`]})]}):(0,$.jsx)(D,{size:`sm`,className:`w-full cursor-pointer gap-1.5`,onClick:()=>void ye(F),disabled:te,children:te?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(o,{className:`size-4 animate-spin`}),` Generating Google sign-in link...`]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(l,{className:`size-4`}),` Sign in with Google`]})})]})]}),ae&&(0,$.jsx)(`div`,{role:`alert`,className:`text-[11px] p-2 rounded bg-error/10 text-error`,children:ae}),(0,$.jsx)(k,{children:(0,$.jsx)(D,{size:`sm`,variant:`outline`,className:`text-xs cursor-pointer`,onClick:he,children:`Cancel`})})]})}),(0,$.jsx)(N,{open:E===`rotation`,onOpenChange:e=>P(e?`rotation`:null),children:(0,$.jsxs)(A,{className:`sm:max-w-md`,children:[(0,$.jsxs)(O,{children:[(0,$.jsx)(j,{className:`text-sm`,children:`Antigravity Rotation`}),(0,$.jsx)(M,{className:`text-xs leading-relaxed`,children:`How a new chat chooses among your enabled Antigravity accounts.`})]}),(0,$.jsx)(`div`,{className:`space-y-2`,children:ct.map(e=>(0,$.jsxs)(`button`,{type:`button`,onClick:()=>void Ce(e.value),"aria-current":n===e.value?`true`:void 0,className:b(`w-full text-left rounded-md border px-3 py-2.5 min-h-11 cursor-pointer transition-colors`,n===e.value?`border-primary bg-primary/10`:`border-border hover:bg-accent/50 active:bg-accent`),children:[(0,$.jsx)(`p`,{className:`text-sm font-medium`,children:e.label}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.hint})]},e.value))}),(0,$.jsx)(k,{children:(0,$.jsx)(D,{size:`sm`,variant:`outline`,className:`text-xs cursor-pointer`,onClick:()=>P(null),children:`Done`})})]})})]})}var dt=[{id:`claude`,label:`Claude`},{id:`codex`,label:`Codex`},{id:`antigravity`,label:`Antigravity`}];function ft(){let[e,t]=(0,Q.useState)(null),[n,r]=(0,Q.useState)(`claude`);(0,Q.useEffect)(()=>{let e=!1;return R().then(n=>{e||t(new Set(Object.keys(n.providers??{})))}).catch(()=>{e||t(new Set([`claude`]))}),()=>{e=!0}},[]);let i=dt.filter(t=>t.id===`claude`||e?.has(t.id)),a=i.length>1;return(0,$.jsxs)(`div`,{className:`space-y-4`,"data-testid":`accounts-pane`,"data-provider":n,children:[a&&(0,$.jsx)(`div`,{className:`flex gap-1 border-b border-border/50`,children:i.map(e=>(0,$.jsxs)(`button`,{onClick:()=>r(e.id),"data-testid":`accounts-tab-${e.id}`,"aria-current":n===e.id?`page`:void 0,className:`flex items-center gap-1.5 px-3 py-2 text-xs rounded-t transition-colors cursor-pointer ${n===e.id?`text-primary border-b-2 border-primary font-medium`:`text-text-subtle hover:text-text-secondary`}`,children:[(0,$.jsx)(P,{providerId:e.id}),e.label]},e.id))}),e===null&&!a&&(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,$.jsx)(o,{className:`size-3 animate-spin`}),` Checking configured providers...`]}),n===`claude`?(0,$.jsx)(Ke,{}):n===`codex`?(0,$.jsx)(st,{}):(0,$.jsx)(ut,{})]})}export{ft as AccountsSettingsSection};
|
|
Binary file
|
|
Binary file
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/agent-session-window-content-
|
|
2
|
-
import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-WX6NXGTJ.js";import"./vendor-ui-XWGn718B.js";import{ui as r}from"./icons-CXY5ue_g.js";import{t as i}from"./preload-helper-uTix4PVD.js";import"./portal-container-context-tAk8C8AE.js";import{t as a}from"./mobile-bottom-sheet-CR0IYSBI.js";import"./use-visual-viewport-CFeFggvP.js";import{t as o}from"./agent-session-sheet-store-uxRCMO7m.js";var s=e(t(),1),c=n(),l=(0,s.lazy)(()=>i(()=>import(`./agent-session-window-content-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/agent-session-window-content-D37AX2th.js","assets/rolldown-runtime-C5c2KzVm.js","assets/vendor-ui-XWGn718B.js","assets/vendor-markdown-WX6NXGTJ.js","assets/utils-DMiycH3O.js","assets/libesm-DtVH87tT.js","assets/api-client-vI7TyFOL.js","assets/open-ppm-tab-CsbF9oE1.js","assets/settings-store-DjuCPpqK.js","assets/preload-helper-uTix4PVD.js","assets/react-DcQQAZIk.js","assets/settings-events-DwkLDkzD.js","assets/window-store-CUC3goyK.js","assets/minimal-mode-DDuML1Oi.js","assets/panel-store-C8BMiE6r.js","assets/session-list-sync-triggers-TcIGY5Gf.js","assets/project-store-CqelYf-s.js","assets/project-framework-store-B-WxvTpu.js","assets/open-assistant-DFwSXZhe.js","assets/patch-tab-metadata-Dedq9hZv.js","assets/open-settings-B4ZjUYGC.js","assets/settings-categories-Y3jjEzYq.js","assets/icons-CXY5ue_g.js","assets/use-is-mobile-_O8suyE-.js","assets/tab-store-QBa8a8Ea.js","assets/design-tab-metadata-DfslGXRv.js","assets/chat-jump-store-DinYYGGj.js","assets/tool-cards-BdQzObMQ.js","assets/index-Dh1mYjGB.js","assets/button-BCTqB-tu.js","assets/createLucideIcon-eJ-vX0nK.js","assets/extension-icons-ybU3E-fL.js","assets/git-commit-horizontal-Dd_uNUhV.js","assets/background-output-store-Cqsu1Pe8.js","assets/open-db-tabs-CBwb8PII.js","assets/explorer-model-RlqYdmjO.js","assets/db-connection-config-BHSrmiMw.js","assets/db-types-zK7v68L_.js","assets/db-explorer-store-DAKKs0KL.js","assets/db-drivers-B-KtKQnu.js","assets/open-logs-DeqC63FG.js","assets/use-explorer-open-state-CUkj-Dq5.js","assets/remote-access-tab-store-CG1VJnPs.js","assets/use-is-touch-only-CsQzu0T-.js","assets/git-repo-store-CTm3j9tg.js","assets/extension-store-BA3neLjA.js","assets/keybindings-store-D88QDyfS.js","assets/build-message-with-attachments-Ct69HqZU.js","assets/close-window-Dq__FGE2.js","assets/model-thinking-selector-helpers-Dn3xr9jh.js","assets/dialog-CoO-z2qj.js","assets/portal-container-context-tAk8C8AE.js","assets/input-CcBfRi6-.js","assets/mobile-bottom-sheet-CR0IYSBI.js","assets/use-visual-viewport-CFeFggvP.js","assets/ppm-tools-BPerUg3f.js","assets/tab-open-protocol-BUpI8eRV.js","assets/split-sql-statements-Vmj3uOWf.js","assets/session-collab-9n55N5Yi.js","assets/file-store-D4_OlIcj.js","assets/slash-command-picker-B2ckAVNi.js","assets/user-message-parse-CfOxGzPd.js","assets/assistant-name-store-DSoH_0w2.js","assets/assistant-persona-B781SaSV.js","assets/provider-selector-DcPsEA72.js","assets/chat-preparation-cache-BjKMLTNJ.js","assets/provider-logos-m5ZC_yzc.js","assets/use-coarse-long-press-DK5QuzCK.js","assets/adaptive-context-menu-xX3GYsY2.js","assets/start-ellipsis-BmXdXC0j.js","assets/tooltip-CCx1ynhU.js","assets/api-settings-D4cXrjrY.js","assets/format-date-DJ_k51mc.js","assets/image-gallery-J7t6M0LS.js","assets/session-collab-client-C4uwh8A0.js","assets/send-to-chat-B06CjX1D.js","assets/notification-store-6S918LfB.js","assets/unsaved-grid-rows-store-CVKm9pb0.js","assets/use-assistant-telegram-binding-6aINJEG2.js","assets/impexp-state-XddrW0ht.js","assets/design-canvas-check-DoJFnvkp.js","assets/sql-identifiers-CzF5oBAB.js","assets/format-file-meta-x6OUDfb9.js","assets/fs-api-ZCc4I_Do.js","assets/dropdown-menu-cKkDmlOg.js","assets/scroll-area-DqE4p3pX.js","assets/use-git-repo-B0bQeLpv.js","assets/clipboard-SyUe4kh-.js","assets/file-icons-DFW8l2IL.js","assets/global-ws-channel-C5DnLfQG.js","assets/ws-auth-Bh6IMZdH.js","assets/streaming-store-mU2NFGwZ.js","assets/apply-theme-BU63HGCw.js","assets/resolve-theme-CCeC2iWE.js","assets/index--wNHkCER.css","assets/agent-session-sheet-store-uxRCMO7m.js","assets/image-preview-geometry-RIr_he1m.js","assets/markdown-context-CrpXiAXV.js","assets/use-blob-url-wwGVIzzV.js","assets/html-preview-loads-D-HBaNoF.js"])))=>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-WX6NXGTJ.js";import"./vendor-ui-XWGn718B.js";import{ui as r}from"./icons-CXY5ue_g.js";import{t as i}from"./preload-helper-uTix4PVD.js";import"./portal-container-context-tAk8C8AE.js";import{t as a}from"./mobile-bottom-sheet-CR0IYSBI.js";import"./use-visual-viewport-CFeFggvP.js";import{t as o}from"./agent-session-sheet-store-uxRCMO7m.js";var s=e(t(),1),c=n(),l=(0,s.lazy)(()=>i(()=>import(`./agent-session-window-content-D37AX2th.js`),__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,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99])));function u(){let e=o(e=>e.payload),t=o(e=>e.close);return e?(0,c.jsxs)(a,{open:!0,onClose:t,zIndex:45,className:`flex h-[var(--sheet-vh)] flex-col p-0`,children:[(0,c.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border px-3 py-2 shrink-0`,children:[(0,c.jsx)(`span`,{className:`truncate text-sm font-medium text-text-primary`,children:e.title??`Agent session`}),(0,c.jsx)(`button`,{type:`button`,onClick:t,className:`ml-auto flex size-11 items-center justify-center rounded text-text-secondary hover:text-text-primary`,"aria-label":`Close`,children:(0,c.jsx)(r,{className:`size-5`})})]}),(0,c.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:(0,c.jsx)(s.Suspense,{fallback:(0,c.jsx)(`div`,{className:`p-4 text-sm text-text-2`,children:`Loading…`}),children:(0,c.jsx)(l,{id:`sheet-${e.sessionId}`,payload:e})})})]}):null}export{u as AgentSessionSheet};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import"./settings-store-
|
|
1
|
+
import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import"./settings-store-DjuCPpqK.js";import{D as t,E as n}from"./vendor-markdown-WX6NXGTJ.js";import"./vendor-ui-XWGn718B.js";import{L as r,P as i,Sn as a}from"./icons-CXY5ue_g.js";import{y as o}from"./api-client-vI7TyFOL.js";import{n as s}from"./utils-DMiycH3O.js";import"./window-store-CUC3goyK.js";import"./panel-store-C8BMiE6r.js";import"./project-store-CqelYf-s.js";import"./project-framework-store-B-WxvTpu.js";import"./session-list-sync-triggers-TcIGY5Gf.js";import"./tab-store-QBa8a8Ea.js";import{n as c}from"./use-coarse-long-press-DK5QuzCK.js";import"./chat-jump-store-DinYYGGj.js";import"./use-is-mobile-_O8suyE-.js";import"./settings-categories-Y3jjEzYq.js";import"./open-settings-B4ZjUYGC.js";import"./patch-tab-metadata-Dedq9hZv.js";import"./open-assistant-DFwSXZhe.js";import"./open-ppm-tab-CsbF9oE1.js";import"./session-collab-client-C4uwh8A0.js";import"./session-collab-9n55N5Yi.js";import"./notification-store-6S918LfB.js";import"./chat-preparation-cache-BjKMLTNJ.js";import"./provider-logos-m5ZC_yzc.js";import"./provider-selector-DcPsEA72.js";import"./file-store-D4_OlIcj.js";import"./streaming-store-mU2NFGwZ.js";import"./fs-api-ZCc4I_Do.js";import{n as l,r as u}from"./global-ws-channel-C5DnLfQG.js";import"./image-gallery-J7t6M0LS.js";import"./tab-open-protocol-BUpI8eRV.js";import"./design-canvas-check-DoJFnvkp.js";import{_ as d,a as f,i as p,t as m}from"./tool-cards-BdQzObMQ.js";import"./libesm-DtVH87tT.js";import{t as h}from"./markdown-context-CrpXiAXV.js";import"./use-blob-url-wwGVIzzV.js";import"./agent-session-sheet-store-uxRCMO7m.js";var g=e(t(),1),_=2e3;function v(e,t){let n=t.reset?[]:e.slice();for(let{ev:e,ts:r,k:i,replace:a}of t.events){let t=n.findIndex(e=>e.k===i);if(t!==-1){a&&(n[t]={k:i,ts:r,ev:e});continue}let o=n.length;for(;o>0&&n[o-1].ts>r;)o--;n.splice(o,0,{k:i,ts:r,ev:e})}return n.length>2e3?n.slice(n.length-_):n}function y(){return`ats-${Math.random().toString(36).slice(2,10)}`}function b(e){let{projectName:t,providerId:n,sessionId:r,source:i,fallbackEvents:a}=e,[o,s]=(0,g.useState)([]),[c,d]=(0,g.useState)(!1),[f,p]=(0,g.useState)(!1),[m,h]=(0,g.useState)(!0),[_,b]=(0,g.useState)(null);(0,g.useEffect)(()=>{let e=y(),a=[],o;s([]),d(!1),p(!1),h(!0),b(null);let c=()=>{u(JSON.stringify({type:`agent-transcript:subscribe`,subId:e,projectName:t,providerId:n,sessionId:r,source:i,...o?{cursor:o}:{}}))},f=t=>{let n=t.detail;n.subId===e&&(a=v(a,n),o=n.cursor,s(a),d(n.available),p(n.running),h(!1),b(null))},m=t=>{let n=t.detail;n.subId===e&&(d(!1),h(!1),b(n.code))};window.addEventListener(`agent-transcript:events`,f),window.addEventListener(`agent-transcript:error`,m);let g=l(c);return c(),()=>{window.removeEventListener(`agent-transcript:events`,f),window.removeEventListener(`agent-transcript:error`,m),g(),u(JSON.stringify({type:`agent-transcript:unsubscribe`,subId:e}))}},[JSON.stringify([t,n,r,i])]);let x=(0,g.useMemo)(()=>o.map(e=>e.ev),[o]);return{events:c?x:a??[],available:c,running:f,loading:m,error:_}}var x=n();function S(e){return e.filter(e=>e.type===`tool_use`).length}function C({status:e}){return e===`loading`?null:e===`running`?(0,x.jsxs)(`span`,{className:`flex items-center gap-1 text-[10px] text-primary shrink-0`,children:[(0,x.jsx)(a,{className:`size-2.5 animate-spin`}),` running`]}):e===`failed`?(0,x.jsx)(`span`,{className:`text-[10px] text-error shrink-0`,children:`failed`}):(0,x.jsx)(`span`,{className:`text-[10px] text-success shrink-0`,children:`done`})}function w({payload:e}){let t=e??{},n=t.sessionId?p(t.sessionId,t.source):``,l=f(e=>n?e.entries[n]:void 0),{events:u,available:_,running:v,loading:y,error:w}=b({projectName:t.projectName,providerId:t.providerId,sessionId:t.sessionId,source:t.source,fallbackEvents:l}),[T,E]=(0,g.useState)(!1),D=c(),O=(0,g.useMemo)(()=>S(u),[u]),k=u[u.length-1],A=!v&&!!k&&k.type===`tool_result`&&!!k.isError,j=y?`loading`:v?`running`:A?`failed`:`done`;return(0,x.jsx)(h.Provider,{value:o(t.projectName),children:(0,x.jsxs)(`div`,{className:`flex flex-col h-full min-h-0 bg-surface @container`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-1.5 border-b border-border/30 shrink-0`,children:[(0,x.jsx)(`span`,{className:`truncate text-xs font-medium`,children:t.title??`Agent session`}),u.length>0&&(0,x.jsx)(`span`,{className:`text-[10px] text-text-subtle shrink-0`,children:d(O)}),(0,x.jsx)(C,{status:j}),!_&&!y&&(0,x.jsx)(`span`,{className:`ml-auto text-[10px] text-text-subtle shrink-0`,title:`No live transcript for this session — showing steps already held in memory`,children:`offline`})]}),!!t.prompt&&(0,x.jsxs)(`div`,{className:`border-b border-border/30 shrink-0`,children:[(0,x.jsxs)(`button`,{type:`button`,onClick:()=>E(e=>!e),className:s(`flex w-full items-center gap-1.5 px-3 py-1.5 text-[11px] text-text-subtle hover:text-foreground`,D?`min-h-[44px]`:`min-h-[28px]`),children:[T?(0,x.jsx)(i,{className:`size-3`}):(0,x.jsx)(r,{className:`size-3`}),`Prompt`]}),T&&(0,x.jsx)(`div`,{className:`px-3 pb-2 text-[11px] text-text-secondary whitespace-pre-wrap select-text`,children:t.prompt})]}),y&&u.length===0?(0,x.jsxs)(`div`,{className:`flex-1 flex items-center justify-center gap-2 text-xs text-text-subtle`,children:[(0,x.jsx)(a,{className:`size-3 animate-spin`}),`Loading session…`]}):u.length===0?(0,x.jsx)(`div`,{className:`flex-1 flex items-center justify-center text-xs text-text-subtle px-4 text-center`,children:w?`Could not load this session`:`No recorded steps`}):(0,x.jsx)(m,{events:u,projectName:t.projectName,variant:`window`,className:`flex-1 min-h-0 overflow-y-auto px-3 py-2 space-y-1`})]})})}export{w as default};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import"./settings-store-
|
|
1
|
+
import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import"./settings-store-DjuCPpqK.js";import{D as t,E as n}from"./vendor-markdown-WX6NXGTJ.js";import"./vendor-ui-XWGn718B.js";import{Sn as r,Xr as i,r as a,wn as o,yr as s}from"./icons-CXY5ue_g.js";import{j as c}from"./api-client-vI7TyFOL.js";import{n as l}from"./utils-DMiycH3O.js";import{An as u,Dn as d,G as f,K as p,On as m,jn as h,kn as g}from"./index-Dh1mYjGB.js";import{t as _}from"./use-monaco-theme-ADh3jLKW.js";var v=e(t(),1),y=n();function b({metadata:e}){let t=e?.filePath,n=e?.name,l=e?.resourceType??`skill`,b=e?.scope??`user`,S=e?.readOnly===!0,C=e?.shadowed===!0,w=e?.shadowedBy,T=e?.project??``,[E,D]=(0,v.useState)(``),[O,k]=(0,v.useState)(``),[A,j]=(0,v.useState)(!0),[M,N]=(0,v.useState)(null),[P,F]=(0,v.useState)(!1),I=_(),L=(0,v.useRef)(``),R=E!==O;(0,v.useEffect)(()=>{let e=!1;return j(!0),N(null),u(t,T).then(t=>{e||(D(t.content),k(t.content),L.current=t.content)}).catch(t=>{e||N(t.message)}).finally(()=>{e||j(!1)}),()=>{e=!0}},[t,T]);let z=(0,v.useCallback)(async()=>{if(S||P)return;let e=L.current;if(e!==O){F(!0);try{await h(t,e,T),k(e),D(e),c.success(`Saved`),g.getState().reload()}catch(e){c.error(e.message)}finally{F(!1)}}},[t,T,O,S,P]);(0,v.useEffect)(()=>{let e=e=>{(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`s`&&(e.preventDefault(),z())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[z]);let B=m[l];return(0,y.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border px-3 py-2 shrink-0`,children:[(0,y.jsx)(B,{className:`size-4 text-text-subtle`}),(0,y.jsx)(`span`,{className:`text-sm font-semibold`,children:n}),(0,y.jsx)(d,{scope:b}),R&&!S&&(0,y.jsx)(`span`,{className:`size-1.5 rounded-full bg-primary`,title:`Unsaved changes`}),(0,y.jsx)(`div`,{className:`flex-1`}),(0,y.jsxs)(`span`,{className:`hidden sm:block text-[11px] text-text-subtle`,children:[l,` · markdown`]}),!S&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`button`,{onClick:()=>D(O),disabled:!R||P,className:`flex items-center gap-1 rounded px-2 py-1 text-xs text-text-secondary hover:bg-surface-elevated disabled:opacity-40`,children:[(0,y.jsx)(i,{className:`size-3.5`}),` Revert`]}),(0,y.jsxs)(`button`,{onClick:()=>void z(),disabled:!R||P,className:`flex items-center gap-1 rounded bg-primary px-2.5 py-1 text-xs font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-40`,children:[P?(0,y.jsx)(r,{className:`size-3.5 animate-spin`}):(0,y.jsx)(s,{className:`size-3.5`}),` Save`]})]})]}),S&&(0,y.jsx)(x,{icon:o,tone:`muted`,children:`Bundled resource — read-only. Duplicate it (from the AI Resources panel) to make an editable copy.`}),C&&w&&(0,y.jsxs)(x,{icon:a,tone:`warn`,children:[`This `,l,` is overridden by another “`,w.name,`” from a higher-priority source (`,w.source,`). It is currently inactive.`]}),(0,y.jsx)(`div`,{className:`min-h-0 flex-1`,children:A?(0,y.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,y.jsx)(r,{className:`size-5 animate-spin text-primary`})}):M?(0,y.jsx)(`div`,{className:`p-6 text-center text-sm text-destructive`,children:M}):(0,y.jsx)(p,{beforeMount:f,height:`100%`,language:`markdown`,theme:I,value:E,onChange:e=>{let t=e??``;L.current=t,D(t)},options:{readOnly:S,minimap:{enabled:!1},fontSize:13,wordWrap:`on`,scrollBeyondLastLine:!1,lineNumbers:`on`}})})]})}function x({icon:e,tone:t,children:n}){return(0,y.jsxs)(`div`,{className:l(`flex items-start gap-2 px-3 py-2 text-[12px] shrink-0 border-b border-border`,t===`warn`?`bg-amber-500/10 text-amber-300`:`bg-surface-elevated text-text-secondary`),children:[(0,y.jsx)(e,{className:`mt-0.5 size-3.5 shrink-0`}),(0,y.jsx)(`span`,{children:n})]})}export{b as AiResourceEditor};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./settings-store-
|
|
1
|
+
import"./settings-store-DjuCPpqK.js";import"./vendor-markdown-WX6NXGTJ.js";import"./vendor-ui-XWGn718B.js";import"./icons-CXY5ue_g.js";import"./api-client-vI7TyFOL.js";import"./portal-container-context-tAk8C8AE.js";import"./window-store-CUC3goyK.js";import"./panel-store-C8BMiE6r.js";import"./project-store-CqelYf-s.js";import"./project-framework-store-B-WxvTpu.js";import"./session-list-sync-triggers-TcIGY5Gf.js";import"./tab-store-QBa8a8Ea.js";import"./mobile-bottom-sheet-CR0IYSBI.js";import"./use-visual-viewport-CFeFggvP.js";import"./use-is-mobile-_O8suyE-.js";import"./settings-categories-Y3jjEzYq.js";import"./open-settings-B4ZjUYGC.js";import"./button-BCTqB-tu.js";import"./dialog-CoO-z2qj.js";import"./chat-preparation-cache-BjKMLTNJ.js";import"./provider-logos-m5ZC_yzc.js";import"./provider-selector-DcPsEA72.js";import"./input-CcBfRi6-.js";import"./model-thinking-selector-helpers-Dn3xr9jh.js";import"./api-settings-D4cXrjrY.js";import{t as e}from"./ai-settings-section-Ck4dnd02.js";export{e as AISettingsSection};
|
|
Binary file
|
|
Binary file
|