@hienlh/ppm 0.26.3 → 0.26.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/assets/skills/ppm/SKILL.md +1 -1
- package/assets/skills/ppm/references/http-api.md +1 -1
- package/dist/web/assets/{accounts-settings-section-BUW3FvYI.js → accounts-settings-section-DzPpvEE4.js} +1 -1
- package/dist/web/assets/accounts-settings-section-DzPpvEE4.js.br +0 -0
- package/dist/web/assets/accounts-settings-section-DzPpvEE4.js.gz +0 -0
- package/dist/web/assets/{agent-session-sheet-DE9mSXsQ.js → agent-session-sheet-mZNoQ_0-.js} +2 -2
- package/dist/web/assets/agent-session-sheet-mZNoQ_0-.js.br +0 -0
- package/dist/web/assets/agent-session-sheet-mZNoQ_0-.js.gz +0 -0
- package/dist/web/assets/{agent-session-window-content-D-8ZwMjG.js → agent-session-window-content-S7pnGOje.js} +1 -1
- package/dist/web/assets/agent-session-window-content-S7pnGOje.js.br +0 -0
- package/dist/web/assets/agent-session-window-content-S7pnGOje.js.gz +0 -0
- package/dist/web/assets/{ai-resource-editor-CiirE-S0.js → ai-resource-editor-DM_FzuoP.js} +1 -1
- package/dist/web/assets/ai-resource-editor-DM_FzuoP.js.br +0 -0
- package/dist/web/assets/ai-resource-editor-DM_FzuoP.js.gz +0 -0
- package/dist/web/assets/{ai-settings-section-BXpmDCfh.js → ai-settings-section-BnioFQam.js} +1 -1
- package/dist/web/assets/ai-settings-section-BnioFQam.js.br +0 -0
- package/dist/web/assets/ai-settings-section-BnioFQam.js.gz +0 -0
- package/dist/web/assets/{ai-settings-section-rsUJ2fAW.js → ai-settings-section-CS0mRLnC.js} +1 -1
- package/dist/web/assets/ai-settings-section-CS0mRLnC.js.br +0 -0
- package/dist/web/assets/ai-settings-section-CS0mRLnC.js.gz +0 -0
- package/dist/web/assets/{android-tab-hS_8hNm9.js → android-tab-C_zcY2tt.js} +1 -1
- package/dist/web/assets/android-tab-C_zcY2tt.js.br +0 -0
- package/dist/web/assets/android-tab-C_zcY2tt.js.gz +0 -0
- package/dist/web/assets/{antigravity-usage-view-tUBgZoS7.js → antigravity-usage-view-BRn3t3Rt.js} +1 -1
- package/dist/web/assets/antigravity-usage-view-BRn3t3Rt.js.br +0 -0
- package/dist/web/assets/antigravity-usage-view-BRn3t3Rt.js.gz +0 -0
- package/dist/web/assets/{appearance-settings-section-CY8B5Pnq.js → appearance-settings-section-AUg748n7.js} +1 -1
- package/dist/web/assets/appearance-settings-section-AUg748n7.js.br +0 -0
- package/dist/web/assets/appearance-settings-section-AUg748n7.js.gz +0 -0
- package/dist/web/assets/{apps-panel-C-g9kkUn.js → apps-panel-B8iik86A.js} +1 -1
- package/dist/web/assets/apps-panel-B8iik86A.js.br +0 -0
- package/dist/web/assets/apps-panel-B8iik86A.js.gz +0 -0
- package/dist/web/assets/{assistant-settings-Blv8zRXu.js → assistant-settings-N958CLlM.js} +1 -1
- package/dist/web/assets/assistant-settings-N958CLlM.js.br +0 -0
- package/dist/web/assets/assistant-settings-N958CLlM.js.gz +0 -0
- package/dist/web/assets/{assistant-settings-section-cbS4fpdV.js → assistant-settings-section-DkGHERVW.js} +1 -1
- package/dist/web/assets/assistant-settings-section-DkGHERVW.js.br +0 -0
- package/dist/web/assets/assistant-settings-section-DkGHERVW.js.gz +0 -0
- package/dist/web/assets/assistant-tab-DYsorY1v.js +1 -0
- package/dist/web/assets/assistant-tab-DYsorY1v.js.br +0 -0
- package/dist/web/assets/assistant-tab-DYsorY1v.js.gz +0 -0
- package/dist/web/assets/{branch-review-tab-vFHRNiwF.js → branch-review-tab-B0pseWWO.js} +1 -1
- package/dist/web/assets/branch-review-tab-B0pseWWO.js.br +0 -0
- package/dist/web/assets/branch-review-tab-B0pseWWO.js.gz +0 -0
- package/dist/web/assets/build-message-with-attachments-BD8pfNAU.js +6 -0
- package/dist/web/assets/build-message-with-attachments-BD8pfNAU.js.br +0 -0
- package/dist/web/assets/build-message-with-attachments-BD8pfNAU.js.gz +0 -0
- package/dist/web/assets/chat-tab-Bc-ND7CB.js +15 -0
- package/dist/web/assets/chat-tab-Bc-ND7CB.js.br +0 -0
- package/dist/web/assets/chat-tab-Bc-ND7CB.js.gz +0 -0
- package/dist/web/assets/chat-tab-D9kp388b.js +1 -0
- package/dist/web/assets/chat-tab-D9kp388b.js.br +0 -0
- package/dist/web/assets/chat-tab-D9kp388b.js.gz +0 -0
- package/dist/web/assets/{code-editor-DXIjGY59.js → code-editor-Y0dnrVZr.js} +4 -4
- package/dist/web/assets/code-editor-Y0dnrVZr.js.br +0 -0
- package/dist/web/assets/code-editor-Y0dnrVZr.js.gz +0 -0
- package/dist/web/assets/{conflict-editor-CsH-BAHW.js → conflict-editor-BR6ff7A1.js} +1 -1
- package/dist/web/assets/conflict-editor-BR6ff7A1.js.br +0 -0
- package/dist/web/assets/conflict-editor-BR6ff7A1.js.gz +0 -0
- package/dist/web/assets/{connection-form-tab-D3j6M_os.js → connection-form-tab-CH5iOQJy.js} +1 -1
- package/dist/web/assets/connection-form-tab-CH5iOQJy.js.br +0 -0
- package/dist/web/assets/connection-form-tab-CH5iOQJy.js.gz +0 -0
- package/dist/web/assets/{csv-preview-DdHcWhty.js → csv-preview-Cqct7eHg.js} +1 -1
- package/dist/web/assets/csv-preview-Cqct7eHg.js.br +0 -0
- package/dist/web/assets/{csv-preview-DdHcWhty.js.gz → csv-preview-Cqct7eHg.js.gz} +0 -0
- package/dist/web/assets/{database-drivers-section-Cennf5OS.js → database-drivers-section-C3__-kzI.js} +1 -1
- package/dist/web/assets/database-drivers-section-C3__-kzI.js.br +0 -0
- package/dist/web/assets/database-drivers-section-C3__-kzI.js.gz +0 -0
- package/dist/web/assets/{db-explorer-store-CSQYXHWM.js → db-explorer-store-7E4wPRmw.js} +1 -1
- package/dist/web/assets/db-explorer-store-7E4wPRmw.js.br +0 -0
- package/dist/web/assets/db-explorer-store-7E4wPRmw.js.gz +0 -0
- package/dist/web/assets/{db-sidebar-reveal-7U4GmEXT.js → db-sidebar-reveal-Cdpfmjc_.js} +1 -1
- package/dist/web/assets/{db-tab-parts-BfeOg1Rx.js → db-tab-parts-Cx-a_J-z.js} +1 -1
- package/dist/web/assets/db-tab-parts-Cx-a_J-z.js.br +0 -0
- package/dist/web/assets/db-tab-parts-Cx-a_J-z.js.gz +0 -0
- package/dist/web/assets/{design-settings-section-DkbWZ_7A.js → design-settings-section-CdZdOXlA.js} +1 -1
- package/dist/web/assets/design-settings-section-CdZdOXlA.js.br +0 -0
- package/dist/web/assets/design-settings-section-CdZdOXlA.js.gz +0 -0
- package/dist/web/assets/{design-tab-DTZQ99SA.js → design-tab-CMpH3ug-.js} +1 -1
- package/dist/web/assets/design-tab-CMpH3ug-.js.br +0 -0
- package/dist/web/assets/design-tab-CMpH3ug-.js.gz +0 -0
- package/dist/web/assets/{designs-sidebar-panel-BfZvrNzF.js → designs-sidebar-panel-VkA6HlrG.js} +1 -1
- package/dist/web/assets/designs-sidebar-panel-VkA6HlrG.js.br +0 -0
- package/dist/web/assets/designs-sidebar-panel-VkA6HlrG.js.gz +0 -0
- package/dist/web/assets/{diff-viewer-BoFFjBpW.js → diff-viewer-DAvjuaop.js} +1 -1
- package/dist/web/assets/diff-viewer-DAvjuaop.js.br +0 -0
- package/dist/web/assets/diff-viewer-DAvjuaop.js.gz +0 -0
- package/dist/web/assets/{docx-preview-BsAzyV1m.js → docx-preview-DwQeqPrw.js} +1 -1
- package/dist/web/assets/docx-preview-DwQeqPrw.js.br +0 -0
- package/dist/web/assets/docx-preview-DwQeqPrw.js.gz +0 -0
- package/dist/web/assets/{editor-dialog-CD1jCk-S.js → editor-dialog-BnKwWdeE.js} +1 -1
- package/dist/web/assets/editor-dialog-BnKwWdeE.js.br +0 -0
- package/dist/web/assets/editor-dialog-BnKwWdeE.js.gz +0 -0
- package/dist/web/assets/{editor-language-service-Z4xxeotW.js → editor-language-service-DQRqYFG_.js} +1 -1
- package/dist/web/assets/editor-language-service-DQRqYFG_.js.br +0 -0
- package/dist/web/assets/editor-language-service-DQRqYFG_.js.gz +0 -0
- package/dist/web/assets/{explorer-body-CWLcZe2N.js → explorer-body-B9-sXLXA.js} +1 -1
- package/dist/web/assets/explorer-body-B9-sXLXA.js.br +0 -0
- package/dist/web/assets/explorer-body-B9-sXLXA.js.gz +0 -0
- package/dist/web/assets/{explorer-window-content-CcGxjOVS.js → explorer-window-content-CbEnESfK.js} +1 -1
- package/dist/web/assets/explorer-window-content-CbEnESfK.js.br +0 -0
- package/dist/web/assets/explorer-window-content-CbEnESfK.js.gz +0 -0
- package/dist/web/assets/{extension-manager-section-B1Tjuza9.js → extension-manager-section-Ce9hzBCe.js} +1 -1
- package/dist/web/assets/extension-manager-section-Ce9hzBCe.js.br +0 -0
- package/dist/web/assets/extension-manager-section-Ce9hzBCe.js.gz +0 -0
- package/dist/web/assets/{extension-webview-BxHqNz9L.js → extension-webview-DxDTiDCR.js} +1 -1
- package/dist/web/assets/extension-webview-DxDTiDCR.js.br +0 -0
- package/dist/web/assets/extension-webview-DxDTiDCR.js.gz +0 -0
- package/dist/web/assets/{files-settings-section-u8lbV1nE.js → files-settings-section-BS0zuVqG.js} +1 -1
- package/dist/web/assets/files-settings-section-BS0zuVqG.js.br +0 -0
- package/dist/web/assets/files-settings-section-BS0zuVqG.js.gz +0 -0
- package/dist/web/assets/{general-settings-section-DU5XZr8v.js → general-settings-section-C9lb8fDn.js} +1 -1
- package/dist/web/assets/general-settings-section-C9lb8fDn.js.br +0 -0
- package/dist/web/assets/general-settings-section-C9lb8fDn.js.gz +0 -0
- package/dist/web/assets/{git-log-panel--9jb3RCc.js → git-log-panel-DTOckDyE.js} +1 -1
- package/dist/web/assets/git-log-panel-DTOckDyE.js.br +0 -0
- package/dist/web/assets/git-log-panel-DTOckDyE.js.gz +0 -0
- package/dist/web/assets/{git-review-tab-D4k0RiAd.js → git-review-tab-CAzixfPY.js} +1 -1
- package/dist/web/assets/git-review-tab-CAzixfPY.js.br +0 -0
- package/dist/web/assets/git-review-tab-CAzixfPY.js.gz +0 -0
- package/dist/web/assets/{glide-data-grid-g3N1iitm.js → glide-data-grid-CX7tVcCh.js} +1 -1
- package/dist/web/assets/glide-data-grid-CX7tVcCh.js.br +0 -0
- package/dist/web/assets/glide-data-grid-CX7tVcCh.js.gz +0 -0
- package/dist/web/assets/{grid-save-dialog-gaj4IGQb.js → grid-save-dialog-CVeVwYSc.js} +1 -1
- package/dist/web/assets/grid-save-dialog-CVeVwYSc.js.br +0 -0
- package/dist/web/assets/grid-save-dialog-CVeVwYSc.js.gz +0 -0
- package/dist/web/assets/{group-chat-tab-B-snhWLh.js → group-chat-tab-Ckjr6de6.js} +1 -1
- package/dist/web/assets/group-chat-tab-Ckjr6de6.js.br +0 -0
- package/dist/web/assets/group-chat-tab-Ckjr6de6.js.gz +0 -0
- package/dist/web/assets/{impexp-tab-BtzpWCi3.js → impexp-tab-yQWcsUOp.js} +1 -1
- package/dist/web/assets/impexp-tab-yQWcsUOp.js.br +0 -0
- package/dist/web/assets/impexp-tab-yQWcsUOp.js.gz +0 -0
- package/dist/web/assets/{index-CBfcC35Q.js → index-BSg24V-E.js} +9 -9
- package/dist/web/assets/index-BSg24V-E.js.br +0 -0
- package/dist/web/assets/index-BSg24V-E.js.gz +0 -0
- package/dist/web/assets/{index-Rr69OXe2.css → index-ToshlPed.css} +1 -1
- package/dist/web/assets/index-ToshlPed.css.br +0 -0
- package/dist/web/assets/{index-Rr69OXe2.css.gz → index-ToshlPed.css.gz} +0 -0
- package/dist/web/assets/{jira-watcher-section-DmXNTr3Z.js → jira-watcher-section-DHeu2F3O.js} +1 -1
- package/dist/web/assets/{keybindings-store-BKvouBWN.js → keybindings-store-B1uKg0m0.js} +1 -1
- package/dist/web/assets/{keyboard-shortcuts-section-M6MNX8VU.js → keyboard-shortcuts-section-DWx7AmWW.js} +1 -1
- package/dist/web/assets/keyboard-shortcuts-section-DWx7AmWW.js.br +0 -0
- package/dist/web/assets/keyboard-shortcuts-section-DWx7AmWW.js.gz +0 -0
- package/dist/web/assets/{language-servers-section-CX5kGe7g.js → language-servers-section-C_PLyYGW.js} +2 -2
- package/dist/web/assets/language-servers-section-C_PLyYGW.js.br +0 -0
- package/dist/web/assets/language-servers-section-C_PLyYGW.js.gz +0 -0
- package/dist/web/assets/{logs-app-DVcfIo64.js → logs-app-DbYn4ico.js} +1 -1
- package/dist/web/assets/logs-app-DbYn4ico.js.br +0 -0
- package/dist/web/assets/logs-app-DbYn4ico.js.gz +0 -0
- package/dist/web/assets/logs-tab-DFrjC8R3.js +1 -0
- package/dist/web/assets/{logs-window-content-C0E20UIw.js → logs-window-content-D3cZW3Ev.js} +1 -1
- package/dist/web/assets/{lsp-client-BBHANJHR.js → lsp-client-C6E0UPH6.js} +1 -1
- package/dist/web/assets/lsp-client-C6E0UPH6.js.br +0 -0
- package/dist/web/assets/lsp-client-C6E0UPH6.js.gz +0 -0
- package/dist/web/assets/markdown-renderer-BCrWJZDb.js +1 -0
- package/dist/web/assets/markdown-renderer-BCrWJZDb.js.br +0 -0
- package/dist/web/assets/markdown-renderer-BCrWJZDb.js.gz +0 -0
- package/dist/web/assets/{markdown-renderer-DlvlXL4d.js → markdown-renderer-BXMvvu-6.js} +1 -1
- package/dist/web/assets/markdown-renderer-BXMvvu-6.js.br +0 -0
- package/dist/web/assets/markdown-renderer-BXMvvu-6.js.gz +0 -0
- package/dist/web/assets/{mobile-explorer-sheet-oBFCIRs-.js → mobile-explorer-sheet-DDks1_6f.js} +1 -1
- package/dist/web/assets/mobile-explorer-sheet-DDks1_6f.js.br +0 -0
- package/dist/web/assets/mobile-explorer-sheet-DDks1_6f.js.gz +0 -0
- package/dist/web/assets/{model-thinking-selector-helpers-DPdkBluP.js → model-thinking-selector-helpers-YO4fsDZB.js} +1 -1
- package/dist/web/assets/model-thinking-selector-helpers-YO4fsDZB.js.br +0 -0
- package/dist/web/assets/model-thinking-selector-helpers-YO4fsDZB.js.gz +0 -0
- package/dist/web/assets/{new-design-dialog-DWP8y5rK.js → new-design-dialog-BlhpzL8S.js} +1 -1
- package/dist/web/assets/new-design-dialog-BlhpzL8S.js.br +0 -0
- package/dist/web/assets/new-design-dialog-BlhpzL8S.js.gz +0 -0
- package/dist/web/assets/{notifications-settings-section-BnK82iy0.js → notifications-settings-section-DHTNpHi9.js} +1 -1
- package/dist/web/assets/notifications-settings-section-DHTNpHi9.js.br +0 -0
- package/dist/web/assets/notifications-settings-section-DHTNpHi9.js.gz +0 -0
- package/dist/web/assets/{onboarding-entry-CoYI6hRF.js → onboarding-entry-CDgvBJOm.js} +1 -1
- package/dist/web/assets/onboarding-entry-CDgvBJOm.js.br +0 -0
- package/dist/web/assets/onboarding-entry-CDgvBJOm.js.gz +0 -0
- package/dist/web/assets/{open-assistant-CB1cLvbE.js → open-assistant-CHa21Eh2.js} +1 -1
- package/dist/web/assets/open-assistant-CHa21Eh2.js.br +0 -0
- package/dist/web/assets/open-assistant-CHa21Eh2.js.gz +0 -0
- package/dist/web/assets/open-assistant-bCQZMJWm.js +1 -0
- package/dist/web/assets/{open-db-tabs-C5ggIV5e.js → open-db-tabs-cCLNc8t3.js} +1 -1
- package/dist/web/assets/open-db-tabs-cCLNc8t3.js.br +0 -0
- package/dist/web/assets/open-db-tabs-cCLNc8t3.js.gz +0 -0
- package/dist/web/assets/open-manager-chat-7t1iP2A6.js +1 -0
- package/dist/web/assets/{open-manager-chat-D46Nxcd4.js → open-manager-chat-DiBsm_PZ.js} +1 -1
- package/dist/web/assets/open-manager-chat-DiBsm_PZ.js.br +0 -0
- package/dist/web/assets/open-manager-chat-DiBsm_PZ.js.gz +0 -0
- package/dist/web/assets/{open-ppm-tab-CRyNo1gn.js → open-ppm-tab-qhXhECZZ.js} +1 -1
- package/dist/web/assets/open-ppm-tab-qhXhECZZ.js.br +0 -0
- package/dist/web/assets/open-ppm-tab-qhXhECZZ.js.gz +0 -0
- package/dist/web/assets/{open-session-anywhere-BI8RYzf-.js → open-session-anywhere-CqlIjp9x.js} +1 -1
- package/dist/web/assets/{open-settings-BID82XfW.js → open-settings---6fAKtA.js} +1 -1
- package/dist/web/assets/{open-settings-CS_0gr5p.js → open-settings-DGqpDr_G.js} +1 -1
- package/dist/web/assets/open-task-tab-ose_QHSZ.js +1 -0
- package/dist/web/assets/open-task-tab-ose_QHSZ.js.br +0 -0
- package/dist/web/assets/open-task-tab-ose_QHSZ.js.gz +0 -0
- package/dist/web/assets/{panel-store-C0GNabIV.js → panel-store-BQoFgw99.js} +1 -1
- package/dist/web/assets/panel-store-BQoFgw99.js.br +0 -0
- package/dist/web/assets/panel-store-BQoFgw99.js.gz +0 -0
- package/dist/web/assets/{patch-tab-metadata-PJPCxwwz.js → patch-tab-metadata-CXrRmpGg.js} +1 -1
- package/dist/web/assets/{performance-panel-flsCrliq.js → performance-panel-CRksscfZ.js} +1 -1
- package/dist/web/assets/performance-panel-CRksscfZ.js.br +0 -0
- package/dist/web/assets/performance-panel-CRksscfZ.js.gz +0 -0
- package/dist/web/assets/{problems-panel-B8o2xszH.js → problems-panel-Bb7Jtb80.js} +1 -1
- package/dist/web/assets/problems-panel-Bb7Jtb80.js.br +0 -0
- package/dist/web/assets/problems-panel-Bb7Jtb80.js.gz +0 -0
- package/dist/web/assets/{process-table-CXmzFPG4.js → process-table-DT6toGrg.js} +1 -1
- package/dist/web/assets/process-table-DT6toGrg.js.br +0 -0
- package/dist/web/assets/process-table-DT6toGrg.js.gz +0 -0
- package/dist/web/assets/{proxy-settings-section-g-xgCdt6.js → proxy-settings-section-DCvCu4Yp.js} +1 -1
- package/dist/web/assets/proxy-settings-section-DCvCu4Yp.js.br +0 -0
- package/dist/web/assets/proxy-settings-section-DCvCu4Yp.js.gz +0 -0
- package/dist/web/assets/{query-tab-DnAoz2_k.js → query-tab-DQz-y7oh.js} +1 -1
- package/dist/web/assets/query-tab-DQz-y7oh.js.br +0 -0
- package/dist/web/assets/query-tab-DQz-y7oh.js.gz +0 -0
- package/dist/web/assets/release-notes-window-content-B6LDejJd.js +1 -0
- package/dist/web/assets/{remote-access-settings-section-D7_rFUKZ.js → remote-access-settings-section-bjQOl6Kt.js} +1 -1
- package/dist/web/assets/remote-access-settings-section-bjQOl6Kt.js.br +0 -0
- package/dist/web/assets/remote-access-settings-section-bjQOl6Kt.js.gz +0 -0
- package/dist/web/assets/{remote-desktop-clipboard-notice-Dl50TyKl.js → remote-desktop-clipboard-notice-D5x8gAQr.js} +1 -1
- package/dist/web/assets/remote-desktop-clipboard-notice-D5x8gAQr.js.br +0 -0
- package/dist/web/assets/remote-desktop-clipboard-notice-D5x8gAQr.js.gz +0 -0
- package/dist/web/assets/remote-desktop-mobile-sheet-h-fsvmv2.js +2 -0
- package/dist/web/assets/remote-desktop-mobile-sheet-h-fsvmv2.js.br +0 -0
- package/dist/web/assets/remote-desktop-mobile-sheet-h-fsvmv2.js.gz +0 -0
- package/dist/web/assets/{remote-desktop-mobile-view-DYX8GqML.js → remote-desktop-mobile-view-DvnWYsl4.js} +1 -1
- package/dist/web/assets/remote-desktop-mobile-view-DvnWYsl4.js.br +0 -0
- package/dist/web/assets/remote-desktop-mobile-view-DvnWYsl4.js.gz +0 -0
- package/dist/web/assets/{remote-desktop-readiness-gate-CFeLK1WF.js → remote-desktop-readiness-gate-DMcai_-N.js} +1 -1
- package/dist/web/assets/remote-desktop-readiness-gate-DMcai_-N.js.br +0 -0
- package/dist/web/assets/remote-desktop-readiness-gate-DMcai_-N.js.gz +0 -0
- package/dist/web/assets/{remote-desktop-window-content-D1XHyNy4.js → remote-desktop-window-content-Cc2UwFTf.js} +1 -1
- package/dist/web/assets/remote-desktop-window-content-Cc2UwFTf.js.br +0 -0
- package/dist/web/assets/remote-desktop-window-content-Cc2UwFTf.js.gz +0 -0
- package/dist/web/assets/{rename-object-dialog-YtGodmts.js → rename-object-dialog-CfItwpRx.js} +1 -1
- package/dist/web/assets/rename-object-dialog-CfItwpRx.js.br +0 -0
- package/dist/web/assets/rename-object-dialog-CfItwpRx.js.gz +0 -0
- package/dist/web/assets/reveal-task-in-sidebar-CKABgIz0.js +1 -0
- package/dist/web/assets/{review-address-setup-KLxz3sdS.js → review-address-setup-DzyZ0VfT.js} +1 -1
- package/dist/web/assets/review-address-setup-DzyZ0VfT.js.br +0 -0
- package/dist/web/assets/review-address-setup-DzyZ0VfT.js.gz +0 -0
- package/dist/web/assets/{review-code-CLy3nNTG.js → review-code-COG3K0je.js} +1 -1
- package/dist/web/assets/review-code-COG3K0je.js.br +0 -0
- package/dist/web/assets/review-code-COG3K0je.js.gz +0 -0
- package/dist/web/assets/{run-in-terminal-DsOb4BhG.js → run-in-terminal-DcvS5ehD.js} +1 -1
- package/dist/web/assets/{run-in-terminal-button-DLH3ZM-8.js → run-in-terminal-button-BQd94vPt.js} +1 -1
- package/dist/web/assets/{save-as-dialog-B-GbgxIG.js → save-as-dialog-BxZat3fY.js} +1 -1
- package/dist/web/assets/save-as-dialog-BxZat3fY.js.br +0 -0
- package/dist/web/assets/save-as-dialog-BxZat3fY.js.gz +0 -0
- package/dist/web/assets/{schedule-script-editor-Dnq61FQg.js → schedule-script-editor-BF3IogOM.js} +1 -1
- package/dist/web/assets/schedule-script-editor-BF3IogOM.js.br +0 -0
- package/dist/web/assets/schedule-script-editor-BF3IogOM.js.gz +0 -0
- package/dist/web/assets/{schedules-settings-section-BJRkvNGp.js → schedules-settings-section-DX95ucUK.js} +3 -3
- package/dist/web/assets/schedules-settings-section-DX95ucUK.js.br +0 -0
- package/dist/web/assets/schedules-settings-section-DX95ucUK.js.gz +0 -0
- package/dist/web/assets/{send-to-chat-gl6Ijt7q.js → send-to-chat-C9ei4pNF.js} +1 -1
- package/dist/web/assets/send-to-chat-C9ei4pNF.js.br +4 -0
- package/dist/web/assets/send-to-chat-C9ei4pNF.js.gz +0 -0
- package/dist/web/assets/{session-changes-chip-B7yWzsx4.js → session-changes-chip-_ShQheVo.js} +1 -1
- package/dist/web/assets/session-changes-chip-_ShQheVo.js.br +0 -0
- package/dist/web/assets/session-changes-chip-_ShQheVo.js.gz +0 -0
- package/dist/web/assets/{session-collab-client-DSYO0f5h.js → session-collab-client-D5X2PBnh.js} +2 -2
- package/dist/web/assets/session-collab-client-D5X2PBnh.js.br +0 -0
- package/dist/web/assets/session-collab-client-D5X2PBnh.js.gz +0 -0
- package/dist/web/assets/{session-review-tab-DpAIAAxa.js → session-review-tab-BK3O8U24.js} +1 -1
- package/dist/web/assets/session-review-tab-BK3O8U24.js.br +0 -0
- package/dist/web/assets/session-review-tab-BK3O8U24.js.gz +0 -0
- package/dist/web/assets/{session-turns-DL8CSSVk.js → session-turns--Supj9Ct.js} +1 -1
- package/dist/web/assets/session-turns--Supj9Ct.js.br +0 -0
- package/dist/web/assets/session-turns--Supj9Ct.js.gz +0 -0
- package/dist/web/assets/{settings-body-BSiBIOjR.js → settings-body-gsuM695M.js} +1 -1
- package/dist/web/assets/settings-body-gsuM695M.js.br +0 -0
- package/dist/web/assets/settings-body-gsuM695M.js.gz +0 -0
- package/dist/web/assets/{settings-rows-B7tt7BBg.js → settings-rows-DIRv4tbU.js} +1 -1
- package/dist/web/assets/settings-rows-DIRv4tbU.js.br +0 -0
- package/dist/web/assets/settings-rows-DIRv4tbU.js.gz +0 -0
- package/dist/web/assets/{settings-section-content-zGg8FP_S.js → settings-section-content-CR5hgc0X.js} +1 -1
- package/dist/web/assets/{settings-section-content-B5XSC8Xf.js → settings-section-content-DNv2JM1D.js} +2 -2
- package/dist/web/assets/settings-section-content-DNv2JM1D.js.br +0 -0
- package/dist/web/assets/settings-section-content-DNv2JM1D.js.gz +0 -0
- package/dist/web/assets/settings-store-CJhEI7rC.js +54 -0
- package/dist/web/assets/settings-store-CJhEI7rC.js.br +0 -0
- package/dist/web/assets/settings-store-CJhEI7rC.js.gz +0 -0
- package/dist/web/assets/{settings-tab-BZqtYVfG.js → settings-tab-DJXd6PHI.js} +1 -1
- package/dist/web/assets/{settings-window-content-CKh00w1i.js → settings-window-content-KVcywl4e.js} +1 -1
- package/dist/web/assets/{sql-object-tab-Cv73iO7j.js → sql-object-tab-T6Up5CAi.js} +1 -1
- package/dist/web/assets/sql-object-tab-T6Up5CAi.js.br +0 -0
- package/dist/web/assets/sql-object-tab-T6Up5CAi.js.gz +0 -0
- package/dist/web/assets/{sqlite-viewer-CH5MTNud.js → sqlite-viewer-83xE214R.js} +1 -1
- package/dist/web/assets/sqlite-viewer-83xE214R.js.br +0 -0
- package/dist/web/assets/sqlite-viewer-83xE214R.js.gz +0 -0
- package/dist/web/assets/{storage-settings-section-0qfKbJnG.js → storage-settings-section-BkfmjWW9.js} +1 -1
- package/dist/web/assets/storage-settings-section-BkfmjWW9.js.br +0 -0
- package/dist/web/assets/storage-settings-section-BkfmjWW9.js.gz +0 -0
- package/dist/web/assets/{structure-save-dialog-DxnC9cGw.js → structure-save-dialog-BpMzvuM-.js} +1 -1
- package/dist/web/assets/structure-save-dialog-BpMzvuM-.js.br +0 -0
- package/dist/web/assets/structure-save-dialog-BpMzvuM-.js.gz +0 -0
- package/dist/web/assets/{structure-tab-Dx7a03g1.js → structure-tab-BjYcj4Aw.js} +1 -1
- package/dist/web/assets/structure-tab-BjYcj4Aw.js.br +0 -0
- package/dist/web/assets/structure-tab-BjYcj4Aw.js.gz +0 -0
- package/dist/web/assets/{system-monitor-body-CgPHApl8.js → system-monitor-body-B-nCWSuY.js} +2 -2
- package/dist/web/assets/system-monitor-body-B-nCWSuY.js.br +0 -0
- package/dist/web/assets/system-monitor-body-B-nCWSuY.js.gz +0 -0
- package/dist/web/assets/system-monitor-tab-BVwql2mS.js +1 -0
- package/dist/web/assets/{system-monitor-window-content-FGJBuEpF.js → system-monitor-window-content-Q8kvVyO9.js} +1 -1
- package/dist/web/assets/{tab-host-window-content-B9KRmtYw.js → tab-host-window-content-DeSJuKLc.js} +1 -1
- package/dist/web/assets/tab-host-window-content-DeSJuKLc.js.br +0 -0
- package/dist/web/assets/tab-host-window-content-DeSJuKLc.js.gz +0 -0
- package/dist/web/assets/{tab-store-DMnqGbnv.js → tab-store-k-xLBLrE.js} +1 -1
- package/dist/web/assets/{table-tab-eKVVBLb1.js → table-tab-BQrsFqwn.js} +1 -1
- package/dist/web/assets/table-tab-BQrsFqwn.js.br +0 -0
- package/dist/web/assets/table-tab-BQrsFqwn.js.gz +0 -0
- package/dist/web/assets/task-due-label-D-4SlLFl.js +1 -0
- package/dist/web/assets/task-due-label-D-4SlLFl.js.br +0 -0
- package/dist/web/assets/task-due-label-D-4SlLFl.js.gz +0 -0
- package/dist/web/assets/task-status-change-BPAjEn56.js +2 -0
- package/dist/web/assets/task-status-change-BPAjEn56.js.br +0 -0
- package/dist/web/assets/task-status-change-BPAjEn56.js.gz +0 -0
- package/dist/web/assets/task-tab-DSSZqbYI.js +6 -0
- package/dist/web/assets/task-tab-DSSZqbYI.js.br +0 -0
- package/dist/web/assets/task-tab-DSSZqbYI.js.gz +0 -0
- package/dist/web/assets/task-working-session-chip-BXqfk9tz.js +1 -0
- package/dist/web/assets/task-working-session-chip-BXqfk9tz.js.br +0 -0
- package/dist/web/assets/task-working-session-chip-BXqfk9tz.js.gz +0 -0
- package/dist/web/assets/tasks-sidebar-panel-BlItz-Tp.js +1 -0
- package/dist/web/assets/tasks-sidebar-panel-BlItz-Tp.js.br +0 -0
- package/dist/web/assets/tasks-sidebar-panel-BlItz-Tp.js.gz +0 -0
- package/dist/web/assets/{telegram-bot-token-field-CvHHU-eo.js → telegram-bot-token-field--z7zeI0k.js} +1 -1
- package/dist/web/assets/telegram-bot-token-field--z7zeI0k.js.br +0 -0
- package/dist/web/assets/telegram-bot-token-field--z7zeI0k.js.gz +0 -0
- package/dist/web/assets/{terminal-tab-DSNPm0mv.js → terminal-tab-BmFDnvEz.js} +1 -1
- package/dist/web/assets/terminal-tab-BmFDnvEz.js.br +0 -0
- package/dist/web/assets/terminal-tab-BmFDnvEz.js.gz +0 -0
- package/dist/web/assets/{tool-cards-DddePWo-.js → tool-cards-aIpojHIc.js} +3 -3
- package/dist/web/assets/tool-cards-aIpojHIc.js.br +0 -0
- package/dist/web/assets/tool-cards-aIpojHIc.js.gz +0 -0
- package/dist/web/assets/{tools-settings-section-1hGCn85q.js → tools-settings-section-epjGHNbL.js} +1 -1
- package/dist/web/assets/tools-settings-section-epjGHNbL.js.br +0 -0
- package/dist/web/assets/tools-settings-section-epjGHNbL.js.gz +0 -0
- package/dist/web/assets/{use-assistant-sessions-9JvD_HU2.js → use-assistant-sessions-BEUXS-ux.js} +1 -1
- package/dist/web/assets/use-assistant-sessions-BEUXS-ux.js.br +0 -0
- package/dist/web/assets/use-assistant-sessions-BEUXS-ux.js.gz +0 -0
- package/dist/web/assets/{use-db-read-BaoSsG2k.js → use-db-read-B8FAIMpo.js} +1 -1
- package/dist/web/assets/use-db-read-B8FAIMpo.js.br +0 -0
- package/dist/web/assets/use-db-read-B8FAIMpo.js.gz +0 -0
- package/dist/web/assets/{use-db-tab-B598dM7P.js → use-db-tab-BdfyJ2pm.js} +1 -1
- package/dist/web/assets/use-db-tab-BdfyJ2pm.js.br +0 -0
- package/dist/web/assets/use-db-tab-BdfyJ2pm.js.gz +0 -0
- package/dist/web/assets/{use-inline-blame-uBStn3ek.js → use-inline-blame-DkLoOKa8.js} +1 -1
- package/dist/web/assets/use-inline-blame-DkLoOKa8.js.br +0 -0
- package/dist/web/assets/use-inline-blame-DkLoOKa8.js.gz +0 -0
- package/dist/web/assets/{use-lsp-DIOjdwJk.js → use-lsp-CBMVwqi6.js} +1 -1
- package/dist/web/assets/use-lsp-CBMVwqi6.js.br +0 -0
- package/dist/web/assets/use-lsp-CBMVwqi6.js.gz +0 -0
- package/dist/web/assets/{use-monaco-theme-bWSNssWw.js → use-monaco-theme-oiSSC38q.js} +1 -1
- package/dist/web/assets/{use-process-kill-BB1Ch-SN.js → use-process-kill-LxdOw10p.js} +1 -1
- package/dist/web/assets/use-process-kill-LxdOw10p.js.br +0 -0
- package/dist/web/assets/use-process-kill-LxdOw10p.js.gz +0 -0
- package/dist/web/assets/{use-sql-schema-info-COXZ69Bt.js → use-sql-schema-info-IgBy_ATa.js} +1 -1
- package/dist/web/assets/use-sql-schema-info-IgBy_ATa.js.br +0 -0
- package/dist/web/assets/use-sql-schema-info-IgBy_ATa.js.gz +0 -0
- package/dist/web/assets/{use-websocket-hpZ1-OR7.js → use-websocket-CZxe1haU.js} +1 -1
- package/dist/web/assets/{user-message-parse-DR-4mzBm.js → user-message-parse-DtT_XCen.js} +2 -2
- package/dist/web/assets/user-message-parse-DtT_XCen.js.br +0 -0
- package/dist/web/assets/user-message-parse-DtT_XCen.js.gz +0 -0
- package/dist/web/assets/{vault-settings-section-B20o0-gF.js → vault-settings-section-68DjJoAo.js} +1 -1
- package/dist/web/assets/vault-settings-section-68DjJoAo.js.br +0 -0
- package/dist/web/assets/vault-settings-section-68DjJoAo.js.gz +0 -0
- package/dist/web/assets/{voice-settings-section-Du9AcDA_.js → voice-settings-section-Dsh0FHO_.js} +1 -1
- package/dist/web/assets/voice-settings-section-Dsh0FHO_.js.br +0 -0
- package/dist/web/assets/voice-settings-section-Dsh0FHO_.js.gz +0 -0
- package/dist/web/assets/{web-preview-tab-Dxcljg2n.js → web-preview-tab-DUBdQ8EN.js} +1 -1
- package/dist/web/assets/web-preview-tab-DUBdQ8EN.js.br +0 -0
- package/dist/web/assets/web-preview-tab-DUBdQ8EN.js.gz +0 -0
- package/dist/web/assets/{xlsx-preview-B8yK4bqv.js → xlsx-preview-DlzhkVNW.js} +1 -1
- package/dist/web/assets/xlsx-preview-DlzhkVNW.js.br +0 -0
- package/dist/web/assets/xlsx-preview-DlzhkVNW.js.gz +0 -0
- package/dist/web/index.html +19 -19
- 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/ppm-assistant.md +13 -0
- package/docs/architecture/workspace-and-ui.md +16 -0
- package/package.json +1 -1
- package/src/server/ws/chat-user-words.ts +13 -3
- package/src/server/ws/chat.ts +37 -1
- package/src/services/assistant-cards/forward-verbatim.ts +45 -0
- package/src/services/assistant-telegram/assistant-telegram-actions.ts +3 -1
- package/src/services/assistant-telegram/assistant-telegram-inbound.ts +20 -0
- package/src/services/assistant-telegram/assistant-telegram-task-actions.ts +5 -0
- package/src/services/assistant-telegram/assistant-telegram-task-created.ts +8 -0
- package/src/services/assistant-telegram/assistant-telegram-task-message.ts +290 -0
- package/src/services/assistant-telegram/assistant-telegram-tasks-deck-draw.ts +3 -1
- package/src/services/assistant-telegram/assistant-telegram-tasks-deck.ts +8 -0
- package/src/services/assistant-telegram/assistant-telegram.service.ts +14 -2
- package/src/services/ppm-tasks/task-chat-ref.ts +105 -0
- package/src/shared/chat-message-blocks.ts +13 -5
- package/src/shared/chat-task-ref.ts +161 -0
- package/src/shared/user-message-parse.ts +4 -1
- package/src/types/api.ts +3 -1
- package/src/web/components/assistant/cards/card-task-items.tsx +9 -2
- package/src/web/components/chat/chat-tab.tsx +64 -13
- package/src/web/components/chat/message-input.tsx +8 -0
- package/src/web/components/chat/message-user-bubble.tsx +4 -1
- package/src/web/components/chat/task-ref-chip.tsx +62 -0
- package/src/web/components/ppm-tasks/chip/manager-tasks-popover-list.tsx +1 -1
- package/src/web/components/ppm-tasks/mobile/task-detail-mobile-details.tsx +3 -1
- package/src/web/components/ppm-tasks/mobile/task-detail-mobile.tsx +3 -1
- package/src/web/components/ppm-tasks/task-detail-desktop.tsx +3 -1
- package/src/web/components/ppm-tasks/tasks-sidebar-panel.tsx +1 -1
- package/src/web/hooks/use-chat.ts +6 -1
- package/src/web/lib/ppm-tasks/composer-task-chip-logic.ts +66 -0
- package/src/web/lib/ppm-tasks/composer-task-chip.ts +50 -0
- package/src/web/lib/ppm-tasks/open-task-tab.ts +11 -2
- package/dist/web/assets/accounts-settings-section-BUW3FvYI.js.br +0 -0
- package/dist/web/assets/accounts-settings-section-BUW3FvYI.js.gz +0 -0
- package/dist/web/assets/agent-session-sheet-DE9mSXsQ.js.br +0 -0
- package/dist/web/assets/agent-session-sheet-DE9mSXsQ.js.gz +0 -0
- package/dist/web/assets/agent-session-window-content-D-8ZwMjG.js.br +0 -0
- package/dist/web/assets/agent-session-window-content-D-8ZwMjG.js.gz +0 -0
- package/dist/web/assets/ai-resource-editor-CiirE-S0.js.br +0 -0
- package/dist/web/assets/ai-resource-editor-CiirE-S0.js.gz +0 -0
- package/dist/web/assets/ai-settings-section-BXpmDCfh.js.br +0 -0
- package/dist/web/assets/ai-settings-section-BXpmDCfh.js.gz +0 -0
- package/dist/web/assets/ai-settings-section-rsUJ2fAW.js.br +0 -0
- package/dist/web/assets/ai-settings-section-rsUJ2fAW.js.gz +0 -0
- package/dist/web/assets/android-tab-hS_8hNm9.js.br +0 -0
- package/dist/web/assets/android-tab-hS_8hNm9.js.gz +0 -0
- package/dist/web/assets/antigravity-usage-view-tUBgZoS7.js.br +0 -0
- package/dist/web/assets/antigravity-usage-view-tUBgZoS7.js.gz +0 -0
- package/dist/web/assets/appearance-settings-section-CY8B5Pnq.js.br +0 -0
- package/dist/web/assets/appearance-settings-section-CY8B5Pnq.js.gz +0 -0
- package/dist/web/assets/apps-panel-C-g9kkUn.js.br +0 -0
- package/dist/web/assets/apps-panel-C-g9kkUn.js.gz +0 -0
- package/dist/web/assets/assistant-settings-Blv8zRXu.js.br +0 -0
- package/dist/web/assets/assistant-settings-Blv8zRXu.js.gz +0 -0
- package/dist/web/assets/assistant-settings-section-cbS4fpdV.js.br +0 -0
- package/dist/web/assets/assistant-settings-section-cbS4fpdV.js.gz +0 -0
- package/dist/web/assets/assistant-tab-Vql7ePx0.js +0 -1
- package/dist/web/assets/assistant-tab-Vql7ePx0.js.br +0 -0
- package/dist/web/assets/assistant-tab-Vql7ePx0.js.gz +0 -0
- package/dist/web/assets/branch-review-tab-vFHRNiwF.js.br +0 -0
- package/dist/web/assets/branch-review-tab-vFHRNiwF.js.gz +0 -0
- package/dist/web/assets/build-message-with-attachments-Dg_M81-u.js +0 -6
- package/dist/web/assets/build-message-with-attachments-Dg_M81-u.js.br +0 -0
- package/dist/web/assets/build-message-with-attachments-Dg_M81-u.js.gz +0 -0
- package/dist/web/assets/chat-tab-C8sI9pUQ.js +0 -15
- package/dist/web/assets/chat-tab-C8sI9pUQ.js.br +0 -0
- package/dist/web/assets/chat-tab-C8sI9pUQ.js.gz +0 -0
- package/dist/web/assets/chat-tab-NegmFjfO.js +0 -1
- package/dist/web/assets/chat-tab-NegmFjfO.js.br +0 -0
- package/dist/web/assets/chat-tab-NegmFjfO.js.gz +0 -0
- package/dist/web/assets/code-editor-DXIjGY59.js.br +0 -0
- package/dist/web/assets/code-editor-DXIjGY59.js.gz +0 -0
- package/dist/web/assets/conflict-editor-CsH-BAHW.js.br +0 -0
- package/dist/web/assets/conflict-editor-CsH-BAHW.js.gz +0 -0
- package/dist/web/assets/connection-form-tab-D3j6M_os.js.br +0 -0
- package/dist/web/assets/connection-form-tab-D3j6M_os.js.gz +0 -0
- package/dist/web/assets/csv-preview-DdHcWhty.js.br +0 -0
- package/dist/web/assets/database-drivers-section-Cennf5OS.js.br +0 -0
- package/dist/web/assets/database-drivers-section-Cennf5OS.js.gz +0 -0
- package/dist/web/assets/db-explorer-store-CSQYXHWM.js.br +0 -0
- package/dist/web/assets/db-explorer-store-CSQYXHWM.js.gz +0 -0
- package/dist/web/assets/db-tab-parts-BfeOg1Rx.js.br +0 -0
- package/dist/web/assets/db-tab-parts-BfeOg1Rx.js.gz +0 -0
- package/dist/web/assets/design-settings-section-DkbWZ_7A.js.br +0 -0
- package/dist/web/assets/design-settings-section-DkbWZ_7A.js.gz +0 -0
- package/dist/web/assets/design-tab-DTZQ99SA.js.br +0 -0
- package/dist/web/assets/design-tab-DTZQ99SA.js.gz +0 -0
- package/dist/web/assets/designs-sidebar-panel-BfZvrNzF.js.br +0 -0
- package/dist/web/assets/designs-sidebar-panel-BfZvrNzF.js.gz +0 -0
- package/dist/web/assets/diff-viewer-BoFFjBpW.js.br +0 -0
- package/dist/web/assets/diff-viewer-BoFFjBpW.js.gz +0 -0
- package/dist/web/assets/docx-preview-BsAzyV1m.js.br +0 -0
- package/dist/web/assets/docx-preview-BsAzyV1m.js.gz +0 -0
- package/dist/web/assets/editor-dialog-CD1jCk-S.js.br +0 -0
- package/dist/web/assets/editor-dialog-CD1jCk-S.js.gz +0 -0
- package/dist/web/assets/editor-language-service-Z4xxeotW.js.br +0 -0
- package/dist/web/assets/editor-language-service-Z4xxeotW.js.gz +0 -0
- package/dist/web/assets/explorer-body-CWLcZe2N.js.br +0 -0
- package/dist/web/assets/explorer-body-CWLcZe2N.js.gz +0 -0
- package/dist/web/assets/explorer-window-content-CcGxjOVS.js.br +0 -0
- package/dist/web/assets/explorer-window-content-CcGxjOVS.js.gz +0 -0
- package/dist/web/assets/extension-manager-section-B1Tjuza9.js.br +0 -0
- package/dist/web/assets/extension-manager-section-B1Tjuza9.js.gz +0 -0
- package/dist/web/assets/extension-webview-BxHqNz9L.js.br +0 -0
- package/dist/web/assets/extension-webview-BxHqNz9L.js.gz +0 -0
- package/dist/web/assets/files-settings-section-u8lbV1nE.js.br +0 -0
- package/dist/web/assets/files-settings-section-u8lbV1nE.js.gz +0 -0
- package/dist/web/assets/general-settings-section-DU5XZr8v.js.br +0 -0
- package/dist/web/assets/general-settings-section-DU5XZr8v.js.gz +0 -0
- package/dist/web/assets/git-log-panel--9jb3RCc.js.br +0 -0
- package/dist/web/assets/git-log-panel--9jb3RCc.js.gz +0 -0
- package/dist/web/assets/git-review-tab-D4k0RiAd.js.br +0 -0
- package/dist/web/assets/git-review-tab-D4k0RiAd.js.gz +0 -0
- package/dist/web/assets/glide-data-grid-g3N1iitm.js.br +0 -0
- package/dist/web/assets/glide-data-grid-g3N1iitm.js.gz +0 -0
- package/dist/web/assets/grid-save-dialog-gaj4IGQb.js.br +0 -0
- package/dist/web/assets/grid-save-dialog-gaj4IGQb.js.gz +0 -0
- package/dist/web/assets/group-chat-tab-B-snhWLh.js.br +0 -0
- package/dist/web/assets/group-chat-tab-B-snhWLh.js.gz +0 -0
- package/dist/web/assets/impexp-tab-BtzpWCi3.js.br +0 -0
- package/dist/web/assets/impexp-tab-BtzpWCi3.js.gz +0 -0
- package/dist/web/assets/index-CBfcC35Q.js.br +0 -0
- package/dist/web/assets/index-CBfcC35Q.js.gz +0 -0
- package/dist/web/assets/index-Rr69OXe2.css.br +0 -0
- package/dist/web/assets/keyboard-shortcuts-section-M6MNX8VU.js.br +0 -0
- package/dist/web/assets/keyboard-shortcuts-section-M6MNX8VU.js.gz +0 -0
- package/dist/web/assets/language-servers-section-CX5kGe7g.js.br +0 -0
- package/dist/web/assets/language-servers-section-CX5kGe7g.js.gz +0 -0
- package/dist/web/assets/logs-app-DVcfIo64.js.br +0 -0
- package/dist/web/assets/logs-app-DVcfIo64.js.gz +0 -0
- package/dist/web/assets/logs-tab-Cijnl6_3.js +0 -1
- package/dist/web/assets/lsp-client-BBHANJHR.js.br +0 -0
- package/dist/web/assets/lsp-client-BBHANJHR.js.gz +0 -0
- package/dist/web/assets/markdown-renderer-D2aGALxW.js +0 -1
- package/dist/web/assets/markdown-renderer-D2aGALxW.js.br +0 -0
- package/dist/web/assets/markdown-renderer-D2aGALxW.js.gz +0 -0
- package/dist/web/assets/markdown-renderer-DlvlXL4d.js.br +0 -0
- package/dist/web/assets/markdown-renderer-DlvlXL4d.js.gz +0 -0
- package/dist/web/assets/mobile-explorer-sheet-oBFCIRs-.js.br +0 -0
- package/dist/web/assets/mobile-explorer-sheet-oBFCIRs-.js.gz +0 -0
- package/dist/web/assets/model-thinking-selector-helpers-DPdkBluP.js.br +0 -0
- package/dist/web/assets/model-thinking-selector-helpers-DPdkBluP.js.gz +0 -0
- package/dist/web/assets/new-design-dialog-DWP8y5rK.js.br +0 -0
- package/dist/web/assets/new-design-dialog-DWP8y5rK.js.gz +0 -0
- package/dist/web/assets/notifications-settings-section-BnK82iy0.js.br +0 -0
- package/dist/web/assets/notifications-settings-section-BnK82iy0.js.gz +0 -0
- package/dist/web/assets/onboarding-entry-CoYI6hRF.js.br +0 -0
- package/dist/web/assets/onboarding-entry-CoYI6hRF.js.gz +0 -0
- package/dist/web/assets/open-assistant-B3BSkWNm.js +0 -1
- package/dist/web/assets/open-assistant-CB1cLvbE.js.br +0 -0
- package/dist/web/assets/open-assistant-CB1cLvbE.js.gz +0 -0
- package/dist/web/assets/open-db-tabs-C5ggIV5e.js.br +0 -0
- package/dist/web/assets/open-db-tabs-C5ggIV5e.js.gz +0 -0
- package/dist/web/assets/open-manager-chat-BB_yYaHw.js +0 -1
- package/dist/web/assets/open-manager-chat-D46Nxcd4.js.br +0 -0
- package/dist/web/assets/open-manager-chat-D46Nxcd4.js.gz +0 -0
- package/dist/web/assets/open-ppm-tab-CRyNo1gn.js.br +0 -0
- package/dist/web/assets/open-ppm-tab-CRyNo1gn.js.gz +0 -0
- package/dist/web/assets/panel-store-C0GNabIV.js.br +0 -0
- package/dist/web/assets/panel-store-C0GNabIV.js.gz +0 -0
- package/dist/web/assets/performance-panel-flsCrliq.js.br +0 -0
- package/dist/web/assets/performance-panel-flsCrliq.js.gz +0 -0
- package/dist/web/assets/ppm-tasks-store-Cpd3SVhb.js +0 -1
- package/dist/web/assets/ppm-tasks-store-Cpd3SVhb.js.br +0 -0
- package/dist/web/assets/ppm-tasks-store-Cpd3SVhb.js.gz +0 -0
- package/dist/web/assets/problems-panel-B8o2xszH.js.br +0 -0
- package/dist/web/assets/problems-panel-B8o2xszH.js.gz +0 -0
- package/dist/web/assets/process-table-CXmzFPG4.js.br +0 -0
- package/dist/web/assets/process-table-CXmzFPG4.js.gz +0 -0
- package/dist/web/assets/proxy-settings-section-g-xgCdt6.js.br +0 -0
- package/dist/web/assets/proxy-settings-section-g-xgCdt6.js.gz +0 -0
- package/dist/web/assets/query-tab-DnAoz2_k.js.br +0 -0
- package/dist/web/assets/query-tab-DnAoz2_k.js.gz +0 -0
- package/dist/web/assets/release-notes-window-content-UfeArzsD.js +0 -1
- package/dist/web/assets/remote-access-settings-section-D7_rFUKZ.js.br +0 -0
- package/dist/web/assets/remote-access-settings-section-D7_rFUKZ.js.gz +0 -0
- package/dist/web/assets/remote-desktop-clipboard-notice-Dl50TyKl.js.br +0 -0
- package/dist/web/assets/remote-desktop-clipboard-notice-Dl50TyKl.js.gz +0 -0
- package/dist/web/assets/remote-desktop-mobile-sheet-CyDgBJ_x.js +0 -2
- package/dist/web/assets/remote-desktop-mobile-sheet-CyDgBJ_x.js.br +0 -0
- package/dist/web/assets/remote-desktop-mobile-sheet-CyDgBJ_x.js.gz +0 -0
- package/dist/web/assets/remote-desktop-mobile-view-DYX8GqML.js.br +0 -0
- package/dist/web/assets/remote-desktop-mobile-view-DYX8GqML.js.gz +0 -0
- package/dist/web/assets/remote-desktop-readiness-gate-CFeLK1WF.js.br +0 -0
- package/dist/web/assets/remote-desktop-readiness-gate-CFeLK1WF.js.gz +0 -0
- package/dist/web/assets/remote-desktop-window-content-D1XHyNy4.js.br +0 -0
- package/dist/web/assets/remote-desktop-window-content-D1XHyNy4.js.gz +0 -0
- package/dist/web/assets/rename-object-dialog-YtGodmts.js.br +0 -0
- package/dist/web/assets/rename-object-dialog-YtGodmts.js.gz +0 -0
- package/dist/web/assets/reveal-task-in-sidebar-_99w9OOq.js +0 -1
- package/dist/web/assets/review-address-setup-KLxz3sdS.js.br +0 -0
- package/dist/web/assets/review-address-setup-KLxz3sdS.js.gz +0 -0
- package/dist/web/assets/review-code-CLy3nNTG.js.br +0 -0
- package/dist/web/assets/review-code-CLy3nNTG.js.gz +0 -0
- package/dist/web/assets/save-as-dialog-B-GbgxIG.js.br +0 -0
- package/dist/web/assets/save-as-dialog-B-GbgxIG.js.gz +0 -0
- package/dist/web/assets/schedule-script-editor-Dnq61FQg.js.br +0 -0
- package/dist/web/assets/schedule-script-editor-Dnq61FQg.js.gz +0 -0
- package/dist/web/assets/schedules-settings-section-BJRkvNGp.js.br +0 -0
- package/dist/web/assets/schedules-settings-section-BJRkvNGp.js.gz +0 -0
- package/dist/web/assets/send-to-chat-gl6Ijt7q.js.br +0 -0
- package/dist/web/assets/send-to-chat-gl6Ijt7q.js.gz +0 -0
- package/dist/web/assets/session-changes-chip-B7yWzsx4.js.br +0 -0
- package/dist/web/assets/session-changes-chip-B7yWzsx4.js.gz +0 -0
- package/dist/web/assets/session-collab-client-DSYO0f5h.js.br +0 -0
- package/dist/web/assets/session-collab-client-DSYO0f5h.js.gz +0 -0
- package/dist/web/assets/session-review-tab-DpAIAAxa.js.br +0 -0
- package/dist/web/assets/session-review-tab-DpAIAAxa.js.gz +0 -0
- package/dist/web/assets/session-turns-DL8CSSVk.js.br +0 -0
- package/dist/web/assets/session-turns-DL8CSSVk.js.gz +0 -0
- package/dist/web/assets/settings-body-BSiBIOjR.js.br +0 -0
- package/dist/web/assets/settings-body-BSiBIOjR.js.gz +0 -0
- package/dist/web/assets/settings-rows-B7tt7BBg.js.br +0 -0
- package/dist/web/assets/settings-rows-B7tt7BBg.js.gz +0 -0
- package/dist/web/assets/settings-section-content-B5XSC8Xf.js.br +0 -0
- package/dist/web/assets/settings-section-content-B5XSC8Xf.js.gz +0 -0
- package/dist/web/assets/settings-store-BZzqGIIb.js +0 -45
- package/dist/web/assets/settings-store-BZzqGIIb.js.br +0 -0
- package/dist/web/assets/settings-store-BZzqGIIb.js.gz +0 -0
- package/dist/web/assets/sql-object-tab-Cv73iO7j.js.br +0 -0
- package/dist/web/assets/sql-object-tab-Cv73iO7j.js.gz +0 -0
- package/dist/web/assets/sqlite-viewer-CH5MTNud.js.br +0 -0
- package/dist/web/assets/sqlite-viewer-CH5MTNud.js.gz +0 -0
- package/dist/web/assets/storage-settings-section-0qfKbJnG.js.br +0 -0
- package/dist/web/assets/storage-settings-section-0qfKbJnG.js.gz +0 -0
- package/dist/web/assets/structure-save-dialog-DxnC9cGw.js.br +0 -0
- package/dist/web/assets/structure-save-dialog-DxnC9cGw.js.gz +0 -0
- package/dist/web/assets/structure-tab-Dx7a03g1.js.br +0 -0
- package/dist/web/assets/structure-tab-Dx7a03g1.js.gz +0 -0
- package/dist/web/assets/system-monitor-body-CgPHApl8.js.br +0 -0
- package/dist/web/assets/system-monitor-body-CgPHApl8.js.gz +0 -0
- package/dist/web/assets/system-monitor-tab-DUahfnVZ.js +0 -1
- package/dist/web/assets/tab-host-window-content-B9KRmtYw.js.br +0 -0
- package/dist/web/assets/tab-host-window-content-B9KRmtYw.js.gz +0 -0
- package/dist/web/assets/table-tab-eKVVBLb1.js.br +0 -0
- package/dist/web/assets/table-tab-eKVVBLb1.js.gz +0 -0
- package/dist/web/assets/task-due-label-D4Ne7qK5.js +0 -1
- package/dist/web/assets/task-due-label-D4Ne7qK5.js.br +0 -0
- package/dist/web/assets/task-due-label-D4Ne7qK5.js.gz +0 -0
- package/dist/web/assets/task-status-change-_V70PUgs.js +0 -2
- package/dist/web/assets/task-status-change-_V70PUgs.js.br +0 -0
- package/dist/web/assets/task-status-change-_V70PUgs.js.gz +0 -0
- package/dist/web/assets/task-tab-D8-miiso.js +0 -6
- package/dist/web/assets/task-tab-D8-miiso.js.br +0 -0
- package/dist/web/assets/task-tab-D8-miiso.js.gz +0 -0
- package/dist/web/assets/task-working-session-chip-OnkhXkBO.js +0 -1
- package/dist/web/assets/task-working-session-chip-OnkhXkBO.js.br +0 -0
- package/dist/web/assets/task-working-session-chip-OnkhXkBO.js.gz +0 -0
- package/dist/web/assets/tasks-sidebar-panel-dM3AVhnh.js +0 -1
- package/dist/web/assets/tasks-sidebar-panel-dM3AVhnh.js.br +0 -0
- package/dist/web/assets/tasks-sidebar-panel-dM3AVhnh.js.gz +0 -0
- package/dist/web/assets/telegram-bot-token-field-CvHHU-eo.js.br +0 -0
- package/dist/web/assets/telegram-bot-token-field-CvHHU-eo.js.gz +0 -0
- package/dist/web/assets/terminal-tab-DSNPm0mv.js.br +0 -0
- package/dist/web/assets/terminal-tab-DSNPm0mv.js.gz +0 -0
- package/dist/web/assets/tool-cards-DddePWo-.js.br +0 -0
- package/dist/web/assets/tool-cards-DddePWo-.js.gz +0 -0
- package/dist/web/assets/tools-settings-section-1hGCn85q.js.br +0 -0
- package/dist/web/assets/tools-settings-section-1hGCn85q.js.gz +0 -0
- package/dist/web/assets/use-assistant-sessions-9JvD_HU2.js.br +0 -0
- package/dist/web/assets/use-assistant-sessions-9JvD_HU2.js.gz +0 -0
- package/dist/web/assets/use-db-read-BaoSsG2k.js.br +0 -0
- package/dist/web/assets/use-db-read-BaoSsG2k.js.gz +0 -0
- package/dist/web/assets/use-db-tab-B598dM7P.js.br +0 -0
- package/dist/web/assets/use-db-tab-B598dM7P.js.gz +0 -0
- package/dist/web/assets/use-inline-blame-uBStn3ek.js.br +0 -0
- package/dist/web/assets/use-inline-blame-uBStn3ek.js.gz +0 -0
- package/dist/web/assets/use-lsp-DIOjdwJk.js.br +0 -0
- package/dist/web/assets/use-lsp-DIOjdwJk.js.gz +0 -0
- package/dist/web/assets/use-process-kill-BB1Ch-SN.js.br +0 -0
- package/dist/web/assets/use-process-kill-BB1Ch-SN.js.gz +0 -0
- package/dist/web/assets/use-sql-schema-info-COXZ69Bt.js.br +0 -0
- package/dist/web/assets/use-sql-schema-info-COXZ69Bt.js.gz +0 -0
- package/dist/web/assets/user-message-parse-DR-4mzBm.js.br +0 -0
- package/dist/web/assets/user-message-parse-DR-4mzBm.js.gz +0 -0
- package/dist/web/assets/vault-settings-section-B20o0-gF.js.br +0 -0
- package/dist/web/assets/vault-settings-section-B20o0-gF.js.gz +0 -0
- package/dist/web/assets/voice-settings-section-Du9AcDA_.js.br +0 -0
- package/dist/web/assets/voice-settings-section-Du9AcDA_.js.gz +0 -0
- package/dist/web/assets/web-preview-tab-Dxcljg2n.js.br +0 -0
- package/dist/web/assets/web-preview-tab-Dxcljg2n.js.gz +0 -0
- package/dist/web/assets/xlsx-preview-B8yK4bqv.js.br +0 -0
- package/dist/web/assets/xlsx-preview-B8yK4bqv.js.gz +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.26.4] - 2026-11-16
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- **Open chat from a task brings the task along**: the chat's message box shows the task as a chip, and the message you send carries the task's reference, so a chat handling many tasks knows which one you mean.
|
|
8
|
+
- **Message about a task from Telegram**: a "Message about this task" button on `/tasks` cards, and a reply to a task card, send your next message to the chat working on that task.
|
|
9
|
+
|
|
3
10
|
## [0.26.3] - 2026-11-16
|
|
4
11
|
|
|
5
12
|
### Added
|
|
@@ -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.26.
|
|
86
|
+
<!-- Generated for PPM v0.26.4 at build time. Re-run `ppm export skill --install` to refresh. -->
|
|
@@ -885,4 +885,4 @@ Authenticate with `?token=<token>` (see Authentication).
|
|
|
885
885
|
- `/ws/android`
|
|
886
886
|
- `/ws/project/<project>/<type>/<id>` — `<type>`: `terminal`, `chat`, `group`, `lsp` (for `chat`, `<id>` is the session id)
|
|
887
887
|
|
|
888
|
-
<!-- Generated from src/server/routes/ for PPM v0.26.
|
|
888
|
+
<!-- Generated from src/server/routes/ for PPM v0.26.4 -->
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-26eoXJk7.js";import"./vendor-ui-BQzUk4nq.js";import{Cn as r,Dr as i,Tn as a,Y as o,Zr as s,_r as c,_t as l,dn as u,dt as d,gt as f,jt as p,mi as m,ni as h,ur as g,yr as _}from"./icons-hfhCTQ0M.js";import{a as v,r as y}from"./api-client-DoFiqmuL.js";import{n as b}from"./utils-DMiycH3O.js";import"./portal-container-context-C84rlnJ6.js";import{i as x,n as S,t as C}from"./tooltip-CECVgROB.js";import{t as w}from"./mobile-bottom-sheet-C78UMLrn.js";import"./use-visual-viewport-tMLO63yY.js";import{n as T}from"./use-is-mobile-CrfIt67b.js";import{r as E,t as D}from"./button-C3mysyXM.js";import{a as O,i as k,n as A,o as j,r as M,t as N}from"./dialog-BSRMgnPz.js";import"./chat-preparation-cache-CAt_2ozY.js";import"./provider-logos-BFyVx-h_.js";import{t as P}from"./provider-selector-zIMBbNQR.js";import{r as F}from"./clipboard-DIbpm_Vp.js";import{t as I}from"./input-Di0czEal.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-DVS8KyMY.js";import{Bn as ie,In as ae,Ln as U,Rn as W,Sr as G,Vn as K,zn as q}from"./index-CBfcC35Q.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-tUBgZoS7.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),[i,a]=(0,Q.useState)(!0),[o,s]=(0,Q.useState)(`5h`);(0,Q.useEffect)(()=>{a(!0),te(e).then(n).catch(()=>n([])).finally(()=>a(!1))},[e]);let c=(0,Q.useMemo)(()=>t?Se(t,o):null,[t,o]),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),i)return(0,$.jsx)(`div`,{className:`flex items-center justify-center py-3`,children:(0,$.jsx)(r,{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 ${o===`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 ${o===`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 `,o===`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)(m,{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 i=T(),[a,o]=(0,Q.useState)(e),[s,c]=(0,Q.useState)(!1),[l,u]=(0,Q.useState)(null),d=a.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:a,maxLength:Ae,onChange:e=>o(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)(r,{className:`size-4 animate-spin`}),` Save`]})]})]});return i?(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:i,onMessage:o}){let s=n.filter(e=>e.hasRefreshToken),[c,l]=(0,Q.useState)(new Set),[u,p]=(0,Q.useState)(``),[m,h]=(0,Q.useState)(!1),[g,_]=(0,Q.useState)(!1),[y,b]=(0,Q.useState)(!1),[x,S]=(0,Q.useState)(!1);e&&!x&&(l(i?new Set([i]):new Set(s.map(e=>e.id))),S(!0)),!e&&x&&S(!1);function C(){t(!1),p(``),h(!1),_(!1)}async function w(e){if(c.size===0)return;b(!0);let t=u.trim()||`ppm-hienlh`;try{let n={"Content-Type":`application/json`},r=v();r&&(n.Authorization=`Bearer ${r}`);let i=await fetch(`/api/accounts/export`,{method:`POST`,headers:n,body:JSON.stringify({password:t,accountIds:[...c],includeRefreshToken:m,refreshBeforeExport:g})});if(!i.ok){let e=await i.json();throw Error(e.error??`Export failed: ${i.status}`)}let a=await i.text();e&&await F(a)?o?.(`Backup copied to clipboard!`):(Me(a),o?.(`Backup downloaded.`)),C()}catch{}b(!1)}let T=c.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)(a,{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:()=>l(c.size===s.length?new Set:new Set(s.map(e=>e.id))),children:c.size===s.length?`Deselect all`:`Select all`})]}),s.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:s.map(e=>(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`input`,{type:`checkbox`,id:`exp-${e.id}`,checked:c.has(e.id),onChange:t=>{let n=new Set(c);t.target.checked?n.add(e.id):n.delete(e.id),l(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)(G,{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:u,onChange:e=>p(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:m,onChange:e=>h(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:g,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`})]}),m?(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.`})]}):g?(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)(d,{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)(r,{className:`size-3 animate-spin mr-1`}),` Exporting...`]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(f,{className:`size-3 mr-1`}),` Download`]})})]})]})})}function Pe({open:e,onOpenChange:t,onSuccess:n}){let[i,o]=(0,Q.useState)(``),[s,c]=(0,Q.useState)(``),[l,u]=(0,Q.useState)(!1),[d,f]=(0,Q.useState)(null);function p(){t(!1),o(``),c(``),f(null)}async function m(){if(i.trim()){u(!0),f(null);try{let e=await ee({data:i.trim(),password:s.trim()||`ppm-hienlh`});p(),n(`Imported ${e.imported} account(s)`)}catch(e){f(e.message||`Import failed`)}u(!1)}}return(0,$.jsx)(N,{open:e,onOpenChange:e=>{e||p()},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)(a,{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)(G,{className:`text-xs`,children:`Backup data`}),(0,$.jsx)(`textarea`,{value:i,onChange:e=>o(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)(G,{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:s,onChange:e=>c(e.target.value),className:`text-xs h-8`,autoComplete:`current-password`})]})]}),d&&(0,$.jsx)(`div`,{className:`text-[11px] p-2 rounded bg-error/10 text-error`,children:d}),(0,$.jsxs)(k,{children:[(0,$.jsx)(D,{size:`sm`,variant:`outline`,className:`text-xs h-7 cursor-pointer`,onClick:p,children:`Cancel`}),(0,$.jsx)(D,{size:`sm`,className:`text-xs h-7 cursor-pointer`,disabled:!i.trim()||l,onClick:m,children:l?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(r,{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)(ae,{value:e.strategy,onValueChange:async e=>{t(await L({strategy:e}))},children:[(0,$.jsx)(q,{className:`w-full h-9 text-xs`,children:(0,$.jsx)(ie,{})}),(0,$.jsxs)(U,{children:[(0,$.jsx)(W,{value:`round-robin`,children:`Round-robin`}),(0,$.jsx)(W,{value:`fill-first`,children:`Fill-first`}),(0,$.jsx)(W,{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)(K,{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)(i,{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)(i,{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)(m,{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)([]),[i,a]=(0,Q.useState)(!1),[o,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){a(!0);try{let e=await H(u.map(e=>e.id),o);n(t=>[...t,{round:t.length+1,time:new Date().toLocaleTimeString(),includeRefresh:o,items:e}])}catch{}a(!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)(K,{id:`sim-include-refresh`,checked:o,onCheckedChange:s,className:`cursor-pointer`}),(0,$.jsx)(G,{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:i,onClick:()=>void d(),children:i?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(r,{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)(r,{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),[o,s]=(0,Q.useState)(!1);async function c(e){a(t=>new Map(t).set(e,{loading:!0}));try{let t=await re(e,o);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 l(){for(let e of n.filter(e=>e.expiresAt!==null))c(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)(p,{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)(K,{id:`token-test-refresh`,checked:o,onCheckedChange:s,className:`cursor-pointer`}),(0,$.jsx)(G,{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:l,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 c(e.id),children:t?.loading?(0,$.jsx)(r,{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:a,refreshing:o,flashIds:s,reload:c}=he(),[l,d]=(0,Q.useState)(null),[m,_]=(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){c(),e&&d(e)}async function M(e,t){_(e);try{await B(e,{status:t===`disabled`?`active`:`disabled`})}catch(e){d(e.message)}_(null),c()}async function N(){if(v){try{await V(v.id),d(`Account "${v.display}" removed.`),c()}catch(e){d(`Failed to remove: ${e.message}`)}y(null)}}async function P(e){b&&(await B(b.id,{label:e}),x(null),d(`Account renamed to "${e}".`),c())}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 c(),refreshing:o,disabled:a,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)(g,{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)(f,{className:`size-4`}),` Export`]}),(0,$.jsxs)(D,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>O(`import`),children:[(0,$.jsx)(h,{className:`size-4`}),` Import`]}),(0,$.jsxs)(D,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>O(`rotation`),children:[(0,$.jsx)(i,{className:`size-4`}),` Rotation`]}),(0,$.jsxs)(D,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>O(`token-test`),children:[(0,$.jsx)(p,{className:`size-4`}),` Token test`]})]})}),(0,$.jsx)(le,{message:l,onDismiss:()=>d(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())]})]}),a?(0,$.jsxs)(`div`,{className:`flex items-center gap-2 py-6 text-xs text-muted-foreground`,children:[(0,$.jsx)(r,{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)(u,{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:m===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:s.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:d}),(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:i,busy:o,onExport:s,onImport:c,error:l}){let u=(0,Q.useRef)(null),d=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)(a,{className:`size-4`}),` `,d?`Export Codex Accounts`:`Import Codex Accounts`]}),(0,$.jsx)(M,{className:`text-xs leading-relaxed`,children:d?`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)(G,{htmlFor:`codex-backup-password`,className:`text-xs`,children:`Password`}),(0,$.jsx)(I,{id:`codex-backup-password`,type:`password`,placeholder:d?`Choose a password`:`Password used for the export`,value:n,onChange:e=>i(e.target.value),className:`text-xs`,autoComplete:d?`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:u,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()||o,onClick:()=>d?s():u.current?.click(),children:[o?(0,$.jsx)(r,{className:`size-3.5 animate-spin`}):d?(0,$.jsx)(f,{className:`size-3.5`}):(0,$.jsx)(h,{className:`size-3.5`}),d?`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 i=T(),[a,o]=(0,Q.useState)(!1),[s,c]=(0,Q.useState)(!1);if(!$e(t))return null;let l=t.resetCredits;async function u(){c(!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{c(!1),o(!1)}}let d=tt(t.weekly?.resetsAt),f=tt(l.nextExpiresAt),p=(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 `,l.available,` free reset`,l.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:[l.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`,d?`, not ${d} as now`:``,`. You do not also get that one.`]}),f&&(0,$.jsxs)(`li`,{children:[`This spends the reset that expires first (`,f,`).`]})]}),(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:()=>o(!1),disabled:s,className:`min-h-11`,children:`Keep it`}),(0,$.jsxs)(D,{onClick:()=>void u(),disabled:s,className:`min-h-11 gap-1.5`,children:[s?(0,$.jsx)(r,{className:`size-4 animate-spin`}):(0,$.jsx)(_,{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:()=>o(!0),disabled:s,children:[(0,$.jsx)(_,{className:`size-3.5`}),` Use reset`]}),a&&(i?(0,$.jsx)(w,{open:!0,onClose:()=>{s||o(!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`}),p]})}):(0,$.jsx)(N,{open:!0,onOpenChange:e=>{!e&&!s&&o(!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`})}),p]})}))]})}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)),[a,c]=(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)(g,{className:`size-4`}),` Add account`]}),(0,$.jsxs)(D,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>t(`export`),children:[(0,$.jsx)(f,{className:`size-4`}),` Export`]}),(0,$.jsxs)(D,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>t(`import`),children:[(0,$.jsx)(h,{className:`size-4`}),` Import`]}),(0,$.jsxs)(D,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>t(`rotation`),children:[(0,$.jsx)(i,{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)(r,{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)(u,{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`?()=>c(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)(K,{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)(s,{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)(o,{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)(K,{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}),a&&(0,$.jsx)(Z,{account:a,onClose:()=>c(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,a]=(0,Q.useState)(`round-robin`),[o,d]=(0,Q.useState)({}),[f,p]=(0,Q.useState)(!0),[m,h]=(0,Q.useState)(null),[_,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,U]=(0,Q.useState)(null),W=(0,Q.useRef)(0),q=(0,Q.useRef)(!1),J=(0,Q.useRef)(!1),Y=(0,Q.useRef)(null),de=(0,Q.useRef)(null),X=(0,Q.useCallback)(async()=>{p(!0),v(null);try{let e=await y.get(`/api/antigravity-accounts`);t(e.accounts),a(e.strategy),d(await y.get(`/api/antigravity-accounts/usage`))}catch(e){v(e.message)}finally{p(!1)}},[]);(0,Q.useEffect)(()=>{X()},[X]);let fe=(0,Q.useCallback)(()=>{W.current+=1,q.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(),U(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(),U(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(),U(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(q.current||Y.current||J.current)return;q.current=!0;let t=++W.current;ne(!0),U(null);try{let n=await y.post(`/api/antigravity-accounts/login`,{...R.trim()?{label:R.trim()}:{},...e?{accountId:e.id}:{}});if(t!==W.current){y.del(`/api/antigravity-accounts/login/${n.id}`).catch(()=>{});return}Y.current=n.id,ee(n),ge(n.id)}catch(e){t===W.current&&U(e.message)}finally{t===W.current&&(q.current=!1,ne(!1))}},[R,ge]),be=(0,Q.useCallback)(async()=>{if(!B||!V.trim()||J.current)return;let e=W.current;J.current=!0,ie(!0),U(null);try{let t=await y.post(`/api/antigravity-accounts/login/${B.id}/callback`,{code:V.trim()});if(e!==W.current)return;if(t?.state===`error`){Y.current=null,Z(),U(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===W.current&&(Y.current=null,Z(),U(t.message))}finally{e===W.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}),a(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:f,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)(g,{className:`size-4`}),` Add account`]}),(0,$.jsxs)(D,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>P(`rotation`),children:[(0,$.jsx)(i,{className:`size-4`}),` Rotation`]})]})}),(0,$.jsx)(le,{message:m??_,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(`-`,` `)})]}),f&&e.length===0?(0,$.jsxs)(`div`,{className:`flex items-center gap-2 py-6 text-xs text-muted-foreground`,children:[(0,$.jsx)(r,{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)(u,{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(o[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)(K,{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)(s,{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)(G,{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(),U(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)(G,{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)(r,{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)(r,{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,i]=(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 a=dt.filter(t=>t.id===`claude`||e?.has(t.id)),o=a.length>1;return(0,$.jsxs)(`div`,{className:`space-y-4`,"data-testid":`accounts-pane`,"data-provider":n,children:[o&&(0,$.jsx)(`div`,{className:`flex gap-1 border-b border-border/50`,children:a.map(e=>(0,$.jsxs)(`button`,{onClick:()=>i(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&&!o&&(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,$.jsx)(r,{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-26eoXJk7.js";import"./vendor-ui-BQzUk4nq.js";import{Cn as r,Dr as i,Tn as a,Y as o,Zr as s,_r as c,_t as l,dn as u,dt as d,gt as f,jt as p,mi as m,ni as h,ur as g,yr as _}from"./icons-hfhCTQ0M.js";import{a as v,r as y}from"./api-client-DoFiqmuL.js";import{n as b}from"./utils-DMiycH3O.js";import"./portal-container-context-C84rlnJ6.js";import{i as x,n as S,t as C}from"./tooltip-CECVgROB.js";import{t as w}from"./mobile-bottom-sheet-C78UMLrn.js";import"./use-visual-viewport-tMLO63yY.js";import{n as T}from"./use-is-mobile-CrfIt67b.js";import{r as E,t as D}from"./button-C3mysyXM.js";import{a as O,i as k,n as A,o as j,r as M,t as N}from"./dialog-BSRMgnPz.js";import"./chat-preparation-cache-CAt_2ozY.js";import"./provider-logos-BFyVx-h_.js";import{t as P}from"./provider-selector-zIMBbNQR.js";import{r as F}from"./clipboard-DIbpm_Vp.js";import{t as I}from"./input-Di0czEal.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-DVS8KyMY.js";import{Bn as ie,In as ae,Ln as U,Rn as W,Sr as G,Vn as K,zn as q}from"./index-BSg24V-E.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-BRn3t3Rt.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),[i,a]=(0,Q.useState)(!0),[o,s]=(0,Q.useState)(`5h`);(0,Q.useEffect)(()=>{a(!0),te(e).then(n).catch(()=>n([])).finally(()=>a(!1))},[e]);let c=(0,Q.useMemo)(()=>t?Se(t,o):null,[t,o]),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),i)return(0,$.jsx)(`div`,{className:`flex items-center justify-center py-3`,children:(0,$.jsx)(r,{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 ${o===`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 ${o===`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 `,o===`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)(m,{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 i=T(),[a,o]=(0,Q.useState)(e),[s,c]=(0,Q.useState)(!1),[l,u]=(0,Q.useState)(null),d=a.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:a,maxLength:Ae,onChange:e=>o(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)(r,{className:`size-4 animate-spin`}),` Save`]})]})]});return i?(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:i,onMessage:o}){let s=n.filter(e=>e.hasRefreshToken),[c,l]=(0,Q.useState)(new Set),[u,p]=(0,Q.useState)(``),[m,h]=(0,Q.useState)(!1),[g,_]=(0,Q.useState)(!1),[y,b]=(0,Q.useState)(!1),[x,S]=(0,Q.useState)(!1);e&&!x&&(l(i?new Set([i]):new Set(s.map(e=>e.id))),S(!0)),!e&&x&&S(!1);function C(){t(!1),p(``),h(!1),_(!1)}async function w(e){if(c.size===0)return;b(!0);let t=u.trim()||`ppm-hienlh`;try{let n={"Content-Type":`application/json`},r=v();r&&(n.Authorization=`Bearer ${r}`);let i=await fetch(`/api/accounts/export`,{method:`POST`,headers:n,body:JSON.stringify({password:t,accountIds:[...c],includeRefreshToken:m,refreshBeforeExport:g})});if(!i.ok){let e=await i.json();throw Error(e.error??`Export failed: ${i.status}`)}let a=await i.text();e&&await F(a)?o?.(`Backup copied to clipboard!`):(Me(a),o?.(`Backup downloaded.`)),C()}catch{}b(!1)}let T=c.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)(a,{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:()=>l(c.size===s.length?new Set:new Set(s.map(e=>e.id))),children:c.size===s.length?`Deselect all`:`Select all`})]}),s.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:s.map(e=>(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`input`,{type:`checkbox`,id:`exp-${e.id}`,checked:c.has(e.id),onChange:t=>{let n=new Set(c);t.target.checked?n.add(e.id):n.delete(e.id),l(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)(G,{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:u,onChange:e=>p(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:m,onChange:e=>h(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:g,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`})]}),m?(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.`})]}):g?(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)(d,{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)(r,{className:`size-3 animate-spin mr-1`}),` Exporting...`]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(f,{className:`size-3 mr-1`}),` Download`]})})]})]})})}function Pe({open:e,onOpenChange:t,onSuccess:n}){let[i,o]=(0,Q.useState)(``),[s,c]=(0,Q.useState)(``),[l,u]=(0,Q.useState)(!1),[d,f]=(0,Q.useState)(null);function p(){t(!1),o(``),c(``),f(null)}async function m(){if(i.trim()){u(!0),f(null);try{let e=await ee({data:i.trim(),password:s.trim()||`ppm-hienlh`});p(),n(`Imported ${e.imported} account(s)`)}catch(e){f(e.message||`Import failed`)}u(!1)}}return(0,$.jsx)(N,{open:e,onOpenChange:e=>{e||p()},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)(a,{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)(G,{className:`text-xs`,children:`Backup data`}),(0,$.jsx)(`textarea`,{value:i,onChange:e=>o(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)(G,{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:s,onChange:e=>c(e.target.value),className:`text-xs h-8`,autoComplete:`current-password`})]})]}),d&&(0,$.jsx)(`div`,{className:`text-[11px] p-2 rounded bg-error/10 text-error`,children:d}),(0,$.jsxs)(k,{children:[(0,$.jsx)(D,{size:`sm`,variant:`outline`,className:`text-xs h-7 cursor-pointer`,onClick:p,children:`Cancel`}),(0,$.jsx)(D,{size:`sm`,className:`text-xs h-7 cursor-pointer`,disabled:!i.trim()||l,onClick:m,children:l?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(r,{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)(ae,{value:e.strategy,onValueChange:async e=>{t(await L({strategy:e}))},children:[(0,$.jsx)(q,{className:`w-full h-9 text-xs`,children:(0,$.jsx)(ie,{})}),(0,$.jsxs)(U,{children:[(0,$.jsx)(W,{value:`round-robin`,children:`Round-robin`}),(0,$.jsx)(W,{value:`fill-first`,children:`Fill-first`}),(0,$.jsx)(W,{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)(K,{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)(i,{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)(i,{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)(m,{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)([]),[i,a]=(0,Q.useState)(!1),[o,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){a(!0);try{let e=await H(u.map(e=>e.id),o);n(t=>[...t,{round:t.length+1,time:new Date().toLocaleTimeString(),includeRefresh:o,items:e}])}catch{}a(!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)(K,{id:`sim-include-refresh`,checked:o,onCheckedChange:s,className:`cursor-pointer`}),(0,$.jsx)(G,{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:i,onClick:()=>void d(),children:i?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(r,{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)(r,{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),[o,s]=(0,Q.useState)(!1);async function c(e){a(t=>new Map(t).set(e,{loading:!0}));try{let t=await re(e,o);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 l(){for(let e of n.filter(e=>e.expiresAt!==null))c(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)(p,{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)(K,{id:`token-test-refresh`,checked:o,onCheckedChange:s,className:`cursor-pointer`}),(0,$.jsx)(G,{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:l,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 c(e.id),children:t?.loading?(0,$.jsx)(r,{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:a,refreshing:o,flashIds:s,reload:c}=he(),[l,d]=(0,Q.useState)(null),[m,_]=(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){c(),e&&d(e)}async function M(e,t){_(e);try{await B(e,{status:t===`disabled`?`active`:`disabled`})}catch(e){d(e.message)}_(null),c()}async function N(){if(v){try{await V(v.id),d(`Account "${v.display}" removed.`),c()}catch(e){d(`Failed to remove: ${e.message}`)}y(null)}}async function P(e){b&&(await B(b.id,{label:e}),x(null),d(`Account renamed to "${e}".`),c())}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 c(),refreshing:o,disabled:a,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)(g,{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)(f,{className:`size-4`}),` Export`]}),(0,$.jsxs)(D,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>O(`import`),children:[(0,$.jsx)(h,{className:`size-4`}),` Import`]}),(0,$.jsxs)(D,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>O(`rotation`),children:[(0,$.jsx)(i,{className:`size-4`}),` Rotation`]}),(0,$.jsxs)(D,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>O(`token-test`),children:[(0,$.jsx)(p,{className:`size-4`}),` Token test`]})]})}),(0,$.jsx)(le,{message:l,onDismiss:()=>d(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())]})]}),a?(0,$.jsxs)(`div`,{className:`flex items-center gap-2 py-6 text-xs text-muted-foreground`,children:[(0,$.jsx)(r,{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)(u,{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:m===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:s.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:d}),(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:i,busy:o,onExport:s,onImport:c,error:l}){let u=(0,Q.useRef)(null),d=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)(a,{className:`size-4`}),` `,d?`Export Codex Accounts`:`Import Codex Accounts`]}),(0,$.jsx)(M,{className:`text-xs leading-relaxed`,children:d?`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)(G,{htmlFor:`codex-backup-password`,className:`text-xs`,children:`Password`}),(0,$.jsx)(I,{id:`codex-backup-password`,type:`password`,placeholder:d?`Choose a password`:`Password used for the export`,value:n,onChange:e=>i(e.target.value),className:`text-xs`,autoComplete:d?`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:u,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()||o,onClick:()=>d?s():u.current?.click(),children:[o?(0,$.jsx)(r,{className:`size-3.5 animate-spin`}):d?(0,$.jsx)(f,{className:`size-3.5`}):(0,$.jsx)(h,{className:`size-3.5`}),d?`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 i=T(),[a,o]=(0,Q.useState)(!1),[s,c]=(0,Q.useState)(!1);if(!$e(t))return null;let l=t.resetCredits;async function u(){c(!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{c(!1),o(!1)}}let d=tt(t.weekly?.resetsAt),f=tt(l.nextExpiresAt),p=(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 `,l.available,` free reset`,l.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:[l.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`,d?`, not ${d} as now`:``,`. You do not also get that one.`]}),f&&(0,$.jsxs)(`li`,{children:[`This spends the reset that expires first (`,f,`).`]})]}),(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:()=>o(!1),disabled:s,className:`min-h-11`,children:`Keep it`}),(0,$.jsxs)(D,{onClick:()=>void u(),disabled:s,className:`min-h-11 gap-1.5`,children:[s?(0,$.jsx)(r,{className:`size-4 animate-spin`}):(0,$.jsx)(_,{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:()=>o(!0),disabled:s,children:[(0,$.jsx)(_,{className:`size-3.5`}),` Use reset`]}),a&&(i?(0,$.jsx)(w,{open:!0,onClose:()=>{s||o(!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`}),p]})}):(0,$.jsx)(N,{open:!0,onOpenChange:e=>{!e&&!s&&o(!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`})}),p]})}))]})}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)),[a,c]=(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)(g,{className:`size-4`}),` Add account`]}),(0,$.jsxs)(D,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>t(`export`),children:[(0,$.jsx)(f,{className:`size-4`}),` Export`]}),(0,$.jsxs)(D,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>t(`import`),children:[(0,$.jsx)(h,{className:`size-4`}),` Import`]}),(0,$.jsxs)(D,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>t(`rotation`),children:[(0,$.jsx)(i,{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)(r,{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)(u,{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`?()=>c(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)(K,{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)(s,{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)(o,{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)(K,{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}),a&&(0,$.jsx)(Z,{account:a,onClose:()=>c(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,a]=(0,Q.useState)(`round-robin`),[o,d]=(0,Q.useState)({}),[f,p]=(0,Q.useState)(!0),[m,h]=(0,Q.useState)(null),[_,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,U]=(0,Q.useState)(null),W=(0,Q.useRef)(0),q=(0,Q.useRef)(!1),J=(0,Q.useRef)(!1),Y=(0,Q.useRef)(null),de=(0,Q.useRef)(null),X=(0,Q.useCallback)(async()=>{p(!0),v(null);try{let e=await y.get(`/api/antigravity-accounts`);t(e.accounts),a(e.strategy),d(await y.get(`/api/antigravity-accounts/usage`))}catch(e){v(e.message)}finally{p(!1)}},[]);(0,Q.useEffect)(()=>{X()},[X]);let fe=(0,Q.useCallback)(()=>{W.current+=1,q.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(),U(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(),U(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(),U(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(q.current||Y.current||J.current)return;q.current=!0;let t=++W.current;ne(!0),U(null);try{let n=await y.post(`/api/antigravity-accounts/login`,{...R.trim()?{label:R.trim()}:{},...e?{accountId:e.id}:{}});if(t!==W.current){y.del(`/api/antigravity-accounts/login/${n.id}`).catch(()=>{});return}Y.current=n.id,ee(n),ge(n.id)}catch(e){t===W.current&&U(e.message)}finally{t===W.current&&(q.current=!1,ne(!1))}},[R,ge]),be=(0,Q.useCallback)(async()=>{if(!B||!V.trim()||J.current)return;let e=W.current;J.current=!0,ie(!0),U(null);try{let t=await y.post(`/api/antigravity-accounts/login/${B.id}/callback`,{code:V.trim()});if(e!==W.current)return;if(t?.state===`error`){Y.current=null,Z(),U(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===W.current&&(Y.current=null,Z(),U(t.message))}finally{e===W.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}),a(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:f,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)(g,{className:`size-4`}),` Add account`]}),(0,$.jsxs)(D,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>P(`rotation`),children:[(0,$.jsx)(i,{className:`size-4`}),` Rotation`]})]})}),(0,$.jsx)(le,{message:m??_,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(`-`,` `)})]}),f&&e.length===0?(0,$.jsxs)(`div`,{className:`flex items-center gap-2 py-6 text-xs text-muted-foreground`,children:[(0,$.jsx)(r,{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)(u,{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(o[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)(K,{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)(s,{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)(G,{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(),U(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)(G,{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)(r,{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)(r,{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,i]=(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 a=dt.filter(t=>t.id===`claude`||e?.has(t.id)),o=a.length>1;return(0,$.jsxs)(`div`,{className:`space-y-4`,"data-testid":`accounts-pane`,"data-provider":n,children:[o&&(0,$.jsx)(`div`,{className:`flex gap-1 border-b border-border/50`,children:a.map(e=>(0,$.jsxs)(`button`,{onClick:()=>i(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&&!o&&(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,$.jsx)(r,{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-26eoXJk7.js";import"./vendor-ui-BQzUk4nq.js";import{mi as r}from"./icons-hfhCTQ0M.js";import{t as i}from"./preload-helper-uTix4PVD.js";import"./portal-container-context-C84rlnJ6.js";import{t as a}from"./mobile-bottom-sheet-C78UMLrn.js";import"./use-visual-viewport-tMLO63yY.js";import{t as o}from"./agent-session-sheet-store-DelDbJXd.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-S7pnGOje.js","assets/rolldown-runtime-C5c2KzVm.js","assets/vendor-ui-BQzUk4nq.js","assets/vendor-markdown-26eoXJk7.js","assets/utils-DMiycH3O.js","assets/libesm-DtVH87tT.js","assets/api-client-DoFiqmuL.js","assets/open-ppm-tab-qhXhECZZ.js","assets/settings-store-CJhEI7rC.js","assets/preload-helper-uTix4PVD.js","assets/react-BH62_kP1.js","assets/settings-events-DwkLDkzD.js","assets/window-store-1QzckBJA.js","assets/minimal-mode-DDuML1Oi.js","assets/panel-store-BQoFgw99.js","assets/session-list-sync-triggers-B_SrR8hO.js","assets/project-store-k9E6YIHg.js","assets/project-framework-store-BIznvUtQ.js","assets/open-assistant-CHa21Eh2.js","assets/patch-tab-metadata-CXrRmpGg.js","assets/open-settings---6fAKtA.js","assets/settings-categories-CjKXqZKK.js","assets/icons-hfhCTQ0M.js","assets/use-is-mobile-CrfIt67b.js","assets/tab-store-k-xLBLrE.js","assets/design-tab-metadata-DfslGXRv.js","assets/chat-jump-store-BzDl2wpf.js","assets/tool-cards-aIpojHIc.js","assets/index-BSg24V-E.js","assets/button-C3mysyXM.js","assets/createLucideIcon-nOpXneg9.js","assets/extension-icons-D56cmL_2.js","assets/git-commit-horizontal-BJpjDb3H.js","assets/assistant-managers-DYFgCEGr.js","assets/assistant-persona-Dn0nRe_q.js","assets/use-assistant-telegram-binding-DfuJY9Pd.js","assets/open-db-tabs-cCLNc8t3.js","assets/explorer-model-BuBHq46Y.js","assets/db-connection-config-DjqIK5uw.js","assets/db-types-D-trUbBw.js","assets/db-sidebar-reveal-Cdpfmjc_.js","assets/db-drivers-NcWkNWu0.js","assets/impexp-state-DFaGehMQ.js","assets/design-canvas-check-DRWlTBIS.js","assets/model-thinking-selector-helpers-YO4fsDZB.js","assets/dialog-BSRMgnPz.js","assets/portal-container-context-C84rlnJ6.js","assets/input-Di0czEal.js","assets/mobile-bottom-sheet-C78UMLrn.js","assets/use-visual-viewport-tMLO63yY.js","assets/ppm-tools-olEe9Xiu.js","assets/db-ai-tools-DOgXi049.js","assets/split-sql-statements-DgMcB1zg.js","assets/session-collab-mCMnQz56.js","assets/vault-DvIveO2A.js","assets/tab-open-protocol-DFjNpqv_.js","assets/file-store-BbsYlyEM.js","assets/slash-command-picker-D5R51F1L.js","assets/build-message-with-attachments-BD8pfNAU.js","assets/open-task-tab-ose_QHSZ.js","assets/open-session-anywhere-CqlIjp9x.js","assets/user-message-parse-DtT_XCen.js","assets/assistant-name-store-D9zkgy1T.js","assets/use-manager-chats-DloQE714.js","assets/provider-selector-zIMBbNQR.js","assets/chat-preparation-cache-CAt_2ozY.js","assets/provider-logos-BFyVx-h_.js","assets/use-coarse-long-press-r69G14r1.js","assets/adaptive-context-menu-Cky8TTvp.js","assets/start-ellipsis-BpgufTPJ.js","assets/tooltip-CECVgROB.js","assets/api-settings-DVS8KyMY.js","assets/format-date-C63qlpuy.js","assets/image-gallery-Chlu2H-0.js","assets/session-collab-client-D5X2PBnh.js","assets/send-to-chat-C9ei4pNF.js","assets/notification-store-BczhH5US.js","assets/unsaved-grid-rows-store-C9g9C7wO.js","assets/sql-identifiers-cmtkF_ah.js","assets/db-explorer-store-7E4wPRmw.js","assets/use-explorer-open-state-CxxTo9ID.js","assets/format-file-meta-CjoQ8PXt.js","assets/fs-api-VUtjoVhw.js","assets/dropdown-menu-DunCcAgg.js","assets/scroll-area-D_xIjSR_.js","assets/use-git-repo-DbChW1jJ.js","assets/git-repo-store-B3UeBtIm.js","assets/clipboard-DIbpm_Vp.js","assets/file-icons-DnkC6QQW.js","assets/global-ws-channel-t9HqpHqM.js","assets/ws-auth-Dhvll_in.js","assets/streaming-store-CLKwnlo1.js","assets/apply-theme-QslWDaSH.js","assets/resolve-theme-CP16gpcw.js","assets/index-ToshlPed.css","assets/vault-tool-call-DHfCpm4J.js","assets/agent-session-sheet-store-DelDbJXd.js","assets/image-preview-geometry-9OUiZQ2w.js","assets/markdown-context-BTBinZAI.js","assets/use-blob-url-qBEWma-d.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-26eoXJk7.js";import"./vendor-ui-BQzUk4nq.js";import{mi as r}from"./icons-hfhCTQ0M.js";import{t as i}from"./preload-helper-uTix4PVD.js";import"./portal-container-context-C84rlnJ6.js";import{t as a}from"./mobile-bottom-sheet-C78UMLrn.js";import"./use-visual-viewport-tMLO63yY.js";import{t as o}from"./agent-session-sheet-store-DelDbJXd.js";var s=e(t(),1),c=n(),l=(0,s.lazy)(()=>i(()=>import(`./agent-session-window-content-S7pnGOje.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,100])));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-CJhEI7rC.js";import{D as t,E as n}from"./vendor-markdown-26eoXJk7.js";import"./vendor-ui-BQzUk4nq.js";import{Cn as r,F as i,R as a}from"./icons-hfhCTQ0M.js";import{y as o}from"./api-client-DoFiqmuL.js";import{n as s}from"./utils-DMiycH3O.js";import"./window-store-1QzckBJA.js";import"./panel-store-BQoFgw99.js";import"./project-store-k9E6YIHg.js";import"./project-framework-store-BIznvUtQ.js";import"./session-list-sync-triggers-B_SrR8hO.js";import"./tab-store-k-xLBLrE.js";import{n as c}from"./use-coarse-long-press-r69G14r1.js";import"./chat-jump-store-BzDl2wpf.js";import"./use-is-mobile-CrfIt67b.js";import"./settings-categories-CjKXqZKK.js";import"./open-settings---6fAKtA.js";import"./patch-tab-metadata-CXrRmpGg.js";import"./open-assistant-CHa21Eh2.js";import"./open-ppm-tab-qhXhECZZ.js";import"./open-session-anywhere-CqlIjp9x.js";import"./session-collab-client-D5X2PBnh.js";import"./session-collab-mCMnQz56.js";import"./vault-DvIveO2A.js";import"./notification-store-BczhH5US.js";import"./chat-preparation-cache-CAt_2ozY.js";import"./provider-logos-BFyVx-h_.js";import"./provider-selector-zIMBbNQR.js";import"./file-store-BbsYlyEM.js";import"./streaming-store-CLKwnlo1.js";import"./fs-api-VUtjoVhw.js";import{n as l,r as u}from"./global-ws-channel-t9HqpHqM.js";import"./image-gallery-Chlu2H-0.js";import"./design-canvas-check-DRWlTBIS.js";import"./tab-open-protocol-DFjNpqv_.js";import{_ as d,a as f,i as p,t as m}from"./tool-cards-aIpojHIc.js";import"./libesm-DtVH87tT.js";import{t as h}from"./markdown-context-BTBinZAI.js";import"./vault-tool-call-DHfCpm4J.js";import"./use-blob-url-qBEWma-d.js";import"./agent-session-sheet-store-DelDbJXd.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)(r,{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)(a,{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)(r,{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-CJhEI7rC.js";import{D as t,E as n}from"./vendor-markdown-26eoXJk7.js";import"./vendor-ui-BQzUk4nq.js";import{Cn as r,Tn as i,ei as a,r as o,xr as s}from"./icons-hfhCTQ0M.js";import{j as c}from"./api-client-DoFiqmuL.js";import{n as l}from"./utils-DMiycH3O.js";import{Fn as u,K as d,Mn as f,Nn as p,Pn as m,jn as h,q as g}from"./index-BSg24V-E.js";import{t as _}from"./use-monaco-theme-oiSSC38q.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),m(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 u(t,e,T),k(e),D(e),c.success(`Saved`),p.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=f[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)(h,{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)(a,{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:i,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:o,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)(g,{beforeMount:d,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-CJhEI7rC.js";import"./vendor-markdown-26eoXJk7.js";import"./vendor-ui-BQzUk4nq.js";import"./icons-hfhCTQ0M.js";import"./api-client-DoFiqmuL.js";import"./portal-container-context-C84rlnJ6.js";import"./window-store-1QzckBJA.js";import"./panel-store-BQoFgw99.js";import"./project-store-k9E6YIHg.js";import"./project-framework-store-BIznvUtQ.js";import"./session-list-sync-triggers-B_SrR8hO.js";import"./tab-store-k-xLBLrE.js";import"./mobile-bottom-sheet-C78UMLrn.js";import"./use-visual-viewport-tMLO63yY.js";import"./use-is-mobile-CrfIt67b.js";import"./settings-categories-CjKXqZKK.js";import"./open-settings---6fAKtA.js";import"./button-C3mysyXM.js";import"./dialog-BSRMgnPz.js";import"./chat-preparation-cache-CAt_2ozY.js";import"./provider-logos-BFyVx-h_.js";import"./provider-selector-zIMBbNQR.js";import"./input-Di0czEal.js";import"./model-thinking-selector-helpers-YO4fsDZB.js";import"./api-settings-DVS8KyMY.js";import{t as e}from"./ai-settings-section-CS0mRLnC.js";export{e as AISettingsSection};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-26eoXJk7.js";import{Zr as r,_r as i,_t as a,r as o}from"./icons-hfhCTQ0M.js";import{r as s}from"./api-client-DoFiqmuL.js";import{t as c}from"./open-settings-BID82XfW.js";import{t as l}from"./button-C3mysyXM.js";import{t as u}from"./provider-selector-zIMBbNQR.js";import{t as d}from"./input-Di0czEal.js";import{a as f,c as ee,i as te,o as ne,s as re}from"./model-thinking-selector-helpers-DPdkBluP.js";import{a as p,x as ie}from"./api-settings-DVS8KyMY.js";import{An as ae,Bn as m,In as h,Ln as g,Rn as _,Sr as v,Vn as y,zn as b}from"./index-CBfcC35Q.js";import{n as x,t as oe}from"./leftover-processes-BH8AMnPV.js";var S=e(t(),1),C=n(),w=[128e3,272e3,4e5,512e3,872e3,1e6],T=[1e5,2e5,23e4,35e4,45e4,75e4,9e5];function E({id:e,label:t,value:n,presets:r,disabled:i,compact:a,onChange:o}){let[s,c]=(0,S.useState)(!!n&&!r.includes(Number(n))),l=a?`text-[11px]`:`text-sm`;return(0,C.jsxs)(`div`,{className:`space-y-1`,children:[(0,C.jsx)(v,{htmlFor:e,className:l,children:t}),(0,C.jsxs)(`select`,{id:e,value:s?`custom`:n||`default`,disabled:i,"aria-describedby":`codex-context-help`,className:`w-full min-h-11 sm:min-h-0 rounded-md border border-input bg-background px-3 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50 ${a?`h-7`:`h-9`} ${l}`,onChange:e=>{let t=e.target.value;c(t===`custom`),t!==`custom`&&o(t===`default`?``:t)},children:[(0,C.jsx)(`option`,{value:`default`,children:`Codex default`}),r.map(e=>(0,C.jsxs)(`option`,{value:String(e),children:[e===1e6?`1M`:`${e/1e3}K`,` tokens`]},e)),(0,C.jsx)(`option`,{value:`custom`,children:`Custom...`})]}),s&&(0,C.jsx)(d,{id:`${e}-custom`,"aria-label":`Custom ${t.toLowerCase()}`,type:`number`,min:1,step:1,required:!0,value:n,disabled:i,placeholder:`Enter tokens`,"aria-describedby":`codex-context-help`,className:`min-h-11 sm:min-h-0 ${a?`h-7 text-[11px]`:``}`,onChange:e=>o(e.target.value)})]})}function se({config:e,compact:t,saving:n,onSave:r}){let[i,a]=(0,S.useState)(String(e?.model_context_window??``)),[o,s]=(0,S.useState)(String(e?.model_auto_compact_token_limit??``)),[c,l]=(0,S.useState)(null),u=t?`text-[11px]`:`text-sm`,d=t?`text-[9px]`:`text-[11px]`;async function f(e){e.preventDefault();let t=i.trim()?Number(i):null,n=o.trim()?Number(o):null;if([t,n].some(e=>e!==null&&(!Number.isSafeInteger(e)||e<=0))){l(`Enter positive whole numbers of tokens, or leave blank for Codex defaults.`);return}if(t!==null&&n!==null&&n>t){l(`Auto-compact threshold must not exceed the context window.`);return}l(null),await r({model_context_window:t,model_auto_compact_token_limit:n})}return(0,C.jsxs)(`form`,{onSubmit:f,className:`space-y-2 rounded-md border border-border p-3`,children:[(0,C.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2`,children:[(0,C.jsx)(E,{id:`codex-context-window`,label:`Context window (tokens)`,value:i,presets:w,disabled:n,compact:t,onChange:e=>{a(e),l(null)}}),(0,C.jsx)(E,{id:`codex-compact-threshold`,label:`Auto-compact threshold (tokens)`,value:o,presets:T,disabled:n,compact:t,onChange:e=>{s(e),l(null)}})]}),(0,C.jsx)(`p`,{id:`codex-context-help`,className:`${d} text-muted-foreground`,children:`Choose Codex default to use Codex configuration and model defaults, or Custom to enter a value. Presets are shortcuts, not a list of limits supported by your model; increasing these values does not unlock a larger context window. Applies to new sessions and sessions resumed after a PPM restart.`}),c&&(0,C.jsx)(`p`,{role:`alert`,className:`${u} text-error`,children:c}),(0,C.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,C.jsx)(`a`,{href:`https://learn.chatgpt.com/docs/config-file/config-reference`,target:`_blank`,rel:`noreferrer`,className:`${d} text-primary underline`,children:`Codex context documentation`}),(0,C.jsx)(`button`,{type:`submit`,disabled:n,className:`min-h-11 sm:min-h-0 rounded-md border border-border px-3 py-1.5 hover:bg-surface-elevated disabled:opacity-50 ${u}`,children:n?`Saving...`:`Save context settings`})]})]})}var D=[{value:`low`,label:`Low`},{value:`medium`,label:`Medium`},{value:`high`,label:`High`},{value:`xhigh`,label:`Extra`},{value:`max`,label:`Max`}],ce=[{value:`bypassPermissions`,label:`Bypass permissions (default)`},{value:`default`,label:`Ask before edits`},{value:`acceptEdits`,label:`Edit automatically`},{value:`plan`,label:`Plan mode`}],O={claude:`Claude`,cursor:`Cursor`,codex:`Codex`,gemini:`Gemini`,antigravity:`Antigravity`};function k({compact:e}={}){let[t,n]=(0,S.useState)(null),[r,w]=(0,S.useState)(``),[T,E]=(0,S.useState)([]),[k,A]=(0,S.useState)(!1),[j,M]=(0,S.useState)(!1),[N,P]=(0,S.useState)(null),[F,I]=(0,S.useState)(0),[ue,L]=(0,S.useState)([]),[R,z]=(0,S.useState)(!1);(0,S.useEffect)(()=>{p().then(e=>{n(e),w(e.default_provider??`claude`)}).catch(e=>P(e.message))},[]),ae(`ai`,()=>{p().then(e=>{n(e),I(e=>e+1)}).catch(()=>{})}),(0,S.useEffect)(()=>{r&&s.get(`/api/settings/ai/providers/status`).then(L).catch(()=>L([]))},[r]);let B=ue.find(e=>e.id===r&&!e.registered);(0,S.useEffect)(()=>{r&&(A(!0),s.get(`/api/settings/ai/providers/${r}/models`).then(E).catch(()=>E([])).finally(()=>A(!1)))},[r,!B]);let[V,H]=(0,S.useState)(null),U=t?.providers[r]?.model;(0,S.useEffect)(()=>{if(H(null),!r)return;let e=!0,t=U?`?model=${encodeURIComponent(U)}`:``;return s.get(`/api/settings/ai/providers/${r}/effort-status${t}`).then(({status:t})=>{e&&H(t)}).catch(()=>{}),()=>{e=!1}},[r,U]);let de=async()=>{z(!0);try{let e=await s.post(`/api/settings/ai/providers/${r}/probe`);L(t=>t.map(t=>t.id===e.id?e:t))}catch(e){P(e.message)}finally{z(!1)}},W=t?Object.keys(t.providers).filter(e=>e!==`mock`).map(e=>({id:e,name:O[e]??e})):[],G=t?.providers[r],K=G?.type===`agent-sdk`||!G?.type&&r===`claude`,q=te(ne(G?.effort,V),V,G?.model?re(G.model):`the model`),J=async e=>{if(!t)return!1;M(!0),P(null);try{return n(await ie(e)),I(e=>e+1),!0}catch(e){return P(e.message),!1}finally{M(!1)}},Y=(e,t)=>J({providers:{[r]:{[e]:t}}}),X=e?`text-[11px]`:`text-sm`,Z=e?`text-xs`:`text-sm`,fe=e?`space-y-2`:`space-y-4`,Q=e?`space-y-1.5`:`space-y-3`,$=e?`space-y-1`:`space-y-1.5`;if(!t)return(0,C.jsxs)(`div`,{className:Q,children:[(0,C.jsx)(`h3`,{className:`${Z} font-medium text-text-secondary`,children:`AI Settings`}),(0,C.jsx)(`p`,{className:`${X} text-text-subtle`,children:N?`Error: ${N}`:`Loading...`})]});let pe=K?T:[{value:`__default__`,label:`Auto (default)`},...T];return(0,C.jsxs)(`div`,{className:fe,children:[(0,C.jsx)(`h3`,{className:`${Z} font-medium text-text-secondary`,children:`AI Settings`}),(0,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(v,{htmlFor:`ai-new-chat-provider`,className:e?X:void 0,children:`New chat provider`}),(0,C.jsxs)(h,{value:t.new_chat_provider_mode??`default`,disabled:j,onValueChange:e=>J({new_chat_provider_mode:e}),children:[(0,C.jsx)(b,{id:`ai-new-chat-provider`,className:`w-full ${e?`h-7 text-[11px]`:``}`,children:(0,C.jsx)(m,{})}),(0,C.jsxs)(g,{children:[(0,C.jsx)(_,{value:`follow-focus`,children:`Follow last focused chat`}),(0,C.jsx)(_,{value:`default`,children:`Always use default provider`})]})]}),(0,C.jsx)(`p`,{className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:t.new_chat_provider_mode===`follow-focus`?`New tabs follow the last chat you focused in this project, across panels. Existing tabs keep their provider.`:`New tabs always use the default provider. Existing tabs keep their provider.`})]}),(0,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(v,{htmlFor:`ai-default-provider`,className:e?X:void 0,children:`Default provider`}),(0,C.jsxs)(h,{value:t.default_provider,disabled:j,onValueChange:e=>J({default_provider:e}),children:[(0,C.jsx)(b,{id:`ai-default-provider`,className:`w-full ${e?`h-7 text-[11px]`:``}`,children:(0,C.jsx)(m,{})}),(0,C.jsx)(g,{children:W.map(e=>(0,C.jsx)(_,{value:e.id,children:e.name},e.id))})]}),t.new_chat_provider_mode===`follow-focus`&&(0,C.jsx)(`p`,{className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:`Used when no chat has been focused in this project yet.`})]}),(0,C.jsxs)(`div`,{className:`flex items-start justify-between gap-3 rounded-md border border-border p-3`,children:[(0,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(v,{htmlFor:`ai-share-provider-context`,className:e?X:void 0,children:`Share rules and memory between providers`}),(0,C.jsx)(`p`,{id:`ai-share-provider-context-description`,className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:`Share project rules and memory, plus global instruction files, across providers. Applies from the next project-chat message. Turning off keeps context already sent.`})]}),(0,C.jsx)(y,{id:`ai-share-provider-context`,"aria-describedby":`ai-share-provider-context-description`,checked:t.share_provider_context??!0,disabled:j,onCheckedChange:e=>J({share_provider_context:e})})]}),(0,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(v,{htmlFor:`ai-leftover-idle`,className:e?X:void 0,children:`Stop leftover processes after (idle minutes, 0 = log only)`}),(0,C.jsx)(d,{id:`ai-leftover-idle`,type:`number`,min:0,max:oe,defaultValue:x(t),"aria-describedby":`ai-leftover-idle-description`,className:e?`h-7 text-[11px]`:void 0,onBlur:e=>{let n=parseInt(e.target.value),r=isNaN(n)?null:Math.min(Number(e.target.max),Math.max(Number(e.target.min),n));e.target.value=String(r??x(t)),r!==null&&J({leftover_processes_idle_minutes:r})}},`leftover-${F}`),(0,C.jsxs)(`p`,{id:`ai-leftover-idle-description`,className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:[`Servers, emulators and other processes a chat's commands started and left running are stopped once the chat has been idle this long, and at once when the chat is deleted. At 0 nothing is stopped: the server log names what `,30,` idle minutes would have stopped. Linux with systemd only.`]})]}),W.length>1&&(0,C.jsx)(`div`,{className:`flex gap-0.5 border-b border-border/50 -mx-1 px-1`,children:W.map(e=>(0,C.jsxs)(`button`,{onClick:()=>w(e.id),className:`flex items-center gap-1 px-2 py-1 text-[11px] rounded-t transition-colors ${r===e.id?`text-primary border-b-2 border-primary font-medium`:`text-text-subtle hover:text-text-secondary`}`,children:[(0,C.jsx)(u,{providerId:e.id}),(0,C.jsx)(`span`,{className:`capitalize`,children:e.name})]},e.id))}),(0,C.jsxs)(`div`,{className:Q,children:[B&&(0,C.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-warning/30 bg-warning/5 px-2.5 py-2`,children:[(0,C.jsx)(o,{className:`size-3.5 text-warning shrink-0 mt-0.5`}),(0,C.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1.5`,children:[(0,C.jsxs)(`p`,{className:`${X} text-text-secondary`,children:[O[r]??r,` is not available in chat — PPM could not start it.`]}),(0,C.jsx)(`p`,{className:`text-[11px] text-muted-foreground break-words`,children:B.reason}),B.nextProbeAt&&(0,C.jsxs)(`p`,{className:`text-[11px] text-text-subtle`,children:[`Checking again at `,new Date(B.nextProbeAt).toLocaleTimeString()]}),(0,C.jsxs)(l,{variant:`outline`,size:`sm`,onClick:de,disabled:R,className:`gap-1.5 cursor-pointer min-h-11 md:min-h-8`,children:[(0,C.jsx)(i,{className:`size-3.5 ${R?`animate-spin`:``}`}),R?`Checking...`:`Check again`]})]})]}),(r===`codex`||r===`antigravity`)&&(0,C.jsxs)(`button`,{type:`button`,onClick:()=>c(`accounts`),className:`w-full flex items-center justify-between gap-2 rounded-md border border-border px-2.5 py-2 text-left cursor-pointer hover:bg-surface-elevated transition-colors`,children:[(0,C.jsx)(`span`,{className:`${X} text-text-secondary`,children:r===`antigravity`?`Antigravity account & quota`:`Codex accounts & login`}),(0,C.jsx)(a,{className:`size-3.5 text-text-subtle shrink-0`})]}),T.length>0&&(0,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(v,{htmlFor:`ai-model`,className:e?X:void 0,children:`Model`}),(0,C.jsxs)(h,{value:K?G?.model??T[0]?.value:G?.model||`__default__`,onValueChange:e=>Y(`model`,e===`__default__`?void 0:e),disabled:k,children:[(0,C.jsx)(b,{id:`ai-model`,className:`w-full ${e?`h-7 text-[11px]`:``}`,children:(0,C.jsx)(m,{placeholder:k?`Loading models...`:`Select model`})}),(0,C.jsx)(g,{className:`max-h-[300px]`,children:pe.map(e=>(0,C.jsx)(_,{value:e.value,children:e.label},e.value))})]})]}),r===`antigravity`&&(0,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(v,{htmlFor:`ai-antigravity-effort`,className:e?X:void 0,children:`Effort`}),(0,C.jsxs)(h,{value:G?.effort??`high`,onValueChange:e=>Y(`effort`,e),children:[(0,C.jsx)(b,{id:`ai-antigravity-effort`,className:`w-full ${e?`h-7 text-[11px]`:``}`,children:(0,C.jsx)(m,{})}),(0,C.jsx)(g,{children:D.filter(e=>e.value===`low`||e.value===`medium`||e.value===`high`).map(e=>(0,C.jsx)(_,{value:e.value,children:e.label},e.value))})]})]}),r===`codex`&&(0,C.jsx)(se,{config:G,compact:e,saving:j,onSave:e=>J({providers:{codex:e}})},JSON.stringify([G?.model_context_window,G?.model_auto_compact_token_limit])),K&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(v,{htmlFor:`ai-base-url`,className:e?X:void 0,children:`Base URL`}),(0,C.jsx)(d,{id:`ai-base-url`,type:`url`,defaultValue:G?.base_url??``,placeholder:`https://api.anthropic.com (default)`,className:e?`h-7 text-[11px]`:void 0,onBlur:e=>{Y(`base_url`,e.target.value.trim()||void 0)}},`baseurl-${r}-${F}`)]}),(0,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(v,{htmlFor:`ai-api-key`,className:e?X:void 0,children:`API Key / Token`}),(0,C.jsx)(d,{id:`ai-api-key`,type:`password`,defaultValue:G?.api_key??``,placeholder:`sk-ant-... (optional, overrides accounts)`,className:e?`h-7 text-[11px] font-mono`:`font-mono`,onBlur:e=>{let t=e.target.value.trim();t.startsWith(`••••`)||Y(`api_key`,t||void 0)}},`apikey-${r}-${F}`),(0,C.jsx)(`p`,{className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:`Direct API key or OAuth token. Leave empty to use connected accounts.`})]}),(0,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(v,{htmlFor:`ai-effort`,className:e?X:void 0,children:`Effort`}),(0,C.jsxs)(h,{value:G?.effort??`high`,onValueChange:e=>Y(`effort`,e),children:[(0,C.jsx)(b,{id:`ai-effort`,className:`w-full ${e?`h-7 text-[11px]`:``}`,children:(0,C.jsx)(m,{})}),(0,C.jsx)(g,{children:D.map(e=>(0,C.jsx)(_,{value:e.value,children:e.label},e.value))})]}),q&&(0,C.jsxs)(`div`,{role:`note`,className:`flex items-start gap-2 rounded-md border border-warning/30 bg-warning/5 px-2.5 py-2`,children:[(0,C.jsx)(o,{className:`size-3.5 text-warning shrink-0 mt-0.5`}),(0,C.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[(0,C.jsx)(`p`,{className:`${X} text-text-secondary`,children:q.title}),(0,C.jsx)(`p`,{className:`text-[11px] text-muted-foreground break-words`,children:f(q.detail)})]})]})]}),(0,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(v,{htmlFor:`ai-max-turns`,className:e?X:void 0,children:`Max Turns (up to 1000, 0 = no limit)`}),(0,C.jsx)(d,{id:`ai-max-turns`,type:`number`,min:0,max:1e3,defaultValue:G?.max_turns??100,className:e?`h-7 text-[11px]`:void 0,onBlur:e=>{let t=parseInt(e.target.value),n=isNaN(t)?null:Math.min(Number(e.target.max),Math.max(Number(e.target.min),t));e.target.value=String(n??G?.max_turns??100),n!==null&&Y(`max_turns`,n)}},`turns-${r}-${F}`),(G?.max_turns===0||(G?.max_turns??0)>500)&&(0,C.jsxs)(`p`,{className:`flex items-start gap-1.5 ${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:[(0,C.jsx)(o,{className:`size-3 text-warning shrink-0 mt-px`}),`Every step is a paid model call. With a limit this high, or none, a task left running unattended can go on for hours and run up a large bill.`]})]}),(0,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(v,{htmlFor:`ai-budget`,className:e?X:void 0,children:`Max Budget (USD)`}),(0,C.jsx)(d,{id:`ai-budget`,type:`number`,step:.1,min:.01,max:50,defaultValue:G?.max_budget_usd??``,placeholder:`No limit`,className:e?`h-7 text-[11px]`:void 0,onBlur:e=>{let t=parseFloat(e.target.value);Y(`max_budget_usd`,isNaN(t)?void 0:t)}},`budget-${r}-${F}`)]}),(0,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(v,{htmlFor:`ai-thinking`,className:e?X:void 0,children:`Thinking Budget (tokens)`}),(0,C.jsx)(d,{id:`ai-thinking`,type:`number`,min:0,defaultValue:G?.thinking_budget_tokens??``,placeholder:`Adaptive (model decides)`,className:e?`h-7 text-[11px]`:void 0,onBlur:e=>{let t=parseInt(e.target.value);Y(`thinking_budget_tokens`,isNaN(t)?void 0:t)}},`thinking-${r}-${F}`)]}),(0,C.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(v,{htmlFor:`ai-agent-teams`,className:e?X:void 0,children:`Agent Teams`}),(0,C.jsx)(`p`,{className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:`Experimental. Enables multi-agent collaboration with shared tasks and messaging. Uses ~7x more tokens.`})]}),(0,C.jsx)(y,{id:`ai-agent-teams`,checked:G?.agent_teams??!1,onCheckedChange:e=>Y(`agent_teams`,e)})]}),G?.agent_teams&&(0,C.jsx)(le,{compact:e}),(0,C.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(v,{htmlFor:`ai-context-1m`,className:e?X:void 0,children:`1M Context Window`}),(0,C.jsx)(`p`,{className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:`Requires an entitled account (Max/Team/Enterprise) and an Opus 4 / Sonnet 4 model. Other accounts will error.`})]}),(0,C.jsx)(y,{id:`ai-context-1m`,checked:G?.context_1m??!1,onCheckedChange:e=>Y(`context_1m`,e)})]}),(0,C.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(v,{htmlFor:`ai-inherit-mcp`,className:e?X:void 0,children:`Inherit Claude Code MCP`}),(0,C.jsx)(`p`,{className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:`Auto-load MCP servers from Claude Code's ~/.claude.json (global + per-project). Your own MCP servers override inherited ones.`})]}),(0,C.jsx)(y,{id:`ai-inherit-mcp`,checked:G?.inherit_claude_mcp??!0,onCheckedChange:e=>Y(`inherit_claude_mcp`,e)})]}),(0,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(v,{className:e?X:void 0,children:`MCP sign-in`}),(0,C.jsx)(`p`,{className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:`Servers that use OAuth stay unavailable to Claude until someone signs in. Project-scoped servers are listed in the project's AI Resources panel.`}),(0,C.jsx)(`div`,{className:`-mx-2`,children:(0,C.jsx)(ee,{showWhenEmpty:!0})})]})]}),(0,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(v,{htmlFor:`ai-permission-mode`,className:e?X:void 0,children:`Default Permission Mode`}),(0,C.jsxs)(h,{value:G?.permission_mode??`bypassPermissions`,onValueChange:e=>Y(`permission_mode`,e),children:[(0,C.jsx)(b,{id:`ai-permission-mode`,className:`w-full ${e?`h-7 text-[11px]`:``}`,children:(0,C.jsx)(m,{})}),(0,C.jsx)(g,{children:ce.map(e=>(0,C.jsx)(_,{value:e.value,children:e.label},e.value))})]})]}),(0,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(v,{htmlFor:`ai-system-prompt`,className:e?X:void 0,children:`Additional Instructions`}),(0,C.jsx)(`textarea`,{id:`ai-system-prompt`,rows:e?3:4,defaultValue:G?.system_prompt??``,placeholder:`Enter additional instructions for ${r}...`,"aria-describedby":r===`antigravity`?`ai-system-prompt-description`:void 0,className:`w-full rounded-md border border-input bg-background px-3 py-2 ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ${e?`text-[11px]`:`text-sm`}`,onBlur:e=>{Y(`system_prompt`,e.target.value.trim()||void 0)}},`sysprompt-${r}-${F}`),r===`antigravity`&&(0,C.jsx)(`p`,{id:`ai-system-prompt-description`,className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:`Antigravity reads these only when PPM starts a new chat, and a chat keeps the ones it started with.`})]})]}),j&&(0,C.jsx)(`p`,{className:`text-xs text-text-subtle`,children:`Saving...`}),N&&(0,C.jsx)(`p`,{className:`text-xs text-error`,children:N})]})}function le({compact:e}){let[t,n]=(0,S.useState)([]),[a,o]=(0,S.useState)(!1),[c,l]=(0,S.useState)(null),u=(0,S.useCallback)(async()=>{o(!0);try{n(await s.get(`/api/teams`)??[])}catch{}o(!1)},[]);(0,S.useEffect)(()=>{u()},[u]);let d=async e=>{try{await s.del(`/api/teams/${encodeURIComponent(e)}`),n(t=>t.filter(t=>t.name!==e)),l(null)}catch{}};return t.length===0&&!a?null:(0,C.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,C.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,C.jsxs)(v,{className:e?`text-[11px]`:void 0,children:[`Teams (`,t.length,`)`]}),(0,C.jsx)(`button`,{onClick:u,className:`text-text-subtle hover:text-foreground p-1`,"aria-label":`Refresh teams`,children:(0,C.jsx)(i,{className:`size-3 ${a?`animate-spin`:``}`})})]}),t.map(e=>(0,C.jsxs)(`div`,{className:`flex items-center justify-between p-2 rounded bg-surface-elevated text-xs`,children:[(0,C.jsxs)(`div`,{className:`min-w-0`,children:[(0,C.jsx)(`div`,{className:`font-medium truncate`,children:e.name}),e.description&&(0,C.jsx)(`div`,{className:`text-text-subtle truncate`,children:e.description}),(0,C.jsxs)(`div`,{className:`text-text-subtle`,children:[e.members?.length??e.memberCount??0,` members`,e.createdAt?` · ${new Date(e.createdAt).toLocaleDateString()}`:``]})]}),c===e.name?(0,C.jsxs)(`div`,{className:`flex gap-1 shrink-0 ml-2`,children:[(0,C.jsx)(`button`,{onClick:()=>d(e.name),className:`px-2 py-1 bg-error text-white rounded text-[10px]`,children:`Delete`}),(0,C.jsx)(`button`,{onClick:()=>l(null),className:`px-2 py-1 bg-panel-2 text-text rounded text-[10px]`,children:`Cancel`})]}):(0,C.jsx)(`button`,{onClick:()=>l(e.name),className:`shrink-0 text-text-subtle hover:text-error p-1 ml-2`,"aria-label":`Delete team ${e.name}`,children:(0,C.jsx)(r,{className:`size-3.5`})})]},e.name))]})}export{k as t};
|
|
1
|
+
import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-26eoXJk7.js";import{Zr as r,_r as i,_t as a,r as o}from"./icons-hfhCTQ0M.js";import{r as s}from"./api-client-DoFiqmuL.js";import{t as c}from"./open-settings---6fAKtA.js";import{t as l}from"./button-C3mysyXM.js";import{t as u}from"./provider-selector-zIMBbNQR.js";import{t as d}from"./input-Di0czEal.js";import{a as f,c as ee,i as te,o as ne,s as re}from"./model-thinking-selector-helpers-YO4fsDZB.js";import{a as p,x as ie}from"./api-settings-DVS8KyMY.js";import{An as ae,Bn as m,In as h,Ln as g,Rn as _,Sr as v,Vn as y,zn as b}from"./index-BSg24V-E.js";import{n as x,t as oe}from"./leftover-processes-BH8AMnPV.js";var S=e(t(),1),C=n(),w=[128e3,272e3,4e5,512e3,872e3,1e6],T=[1e5,2e5,23e4,35e4,45e4,75e4,9e5];function E({id:e,label:t,value:n,presets:r,disabled:i,compact:a,onChange:o}){let[s,c]=(0,S.useState)(!!n&&!r.includes(Number(n))),l=a?`text-[11px]`:`text-sm`;return(0,C.jsxs)(`div`,{className:`space-y-1`,children:[(0,C.jsx)(v,{htmlFor:e,className:l,children:t}),(0,C.jsxs)(`select`,{id:e,value:s?`custom`:n||`default`,disabled:i,"aria-describedby":`codex-context-help`,className:`w-full min-h-11 sm:min-h-0 rounded-md border border-input bg-background px-3 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50 ${a?`h-7`:`h-9`} ${l}`,onChange:e=>{let t=e.target.value;c(t===`custom`),t!==`custom`&&o(t===`default`?``:t)},children:[(0,C.jsx)(`option`,{value:`default`,children:`Codex default`}),r.map(e=>(0,C.jsxs)(`option`,{value:String(e),children:[e===1e6?`1M`:`${e/1e3}K`,` tokens`]},e)),(0,C.jsx)(`option`,{value:`custom`,children:`Custom...`})]}),s&&(0,C.jsx)(d,{id:`${e}-custom`,"aria-label":`Custom ${t.toLowerCase()}`,type:`number`,min:1,step:1,required:!0,value:n,disabled:i,placeholder:`Enter tokens`,"aria-describedby":`codex-context-help`,className:`min-h-11 sm:min-h-0 ${a?`h-7 text-[11px]`:``}`,onChange:e=>o(e.target.value)})]})}function se({config:e,compact:t,saving:n,onSave:r}){let[i,a]=(0,S.useState)(String(e?.model_context_window??``)),[o,s]=(0,S.useState)(String(e?.model_auto_compact_token_limit??``)),[c,l]=(0,S.useState)(null),u=t?`text-[11px]`:`text-sm`,d=t?`text-[9px]`:`text-[11px]`;async function f(e){e.preventDefault();let t=i.trim()?Number(i):null,n=o.trim()?Number(o):null;if([t,n].some(e=>e!==null&&(!Number.isSafeInteger(e)||e<=0))){l(`Enter positive whole numbers of tokens, or leave blank for Codex defaults.`);return}if(t!==null&&n!==null&&n>t){l(`Auto-compact threshold must not exceed the context window.`);return}l(null),await r({model_context_window:t,model_auto_compact_token_limit:n})}return(0,C.jsxs)(`form`,{onSubmit:f,className:`space-y-2 rounded-md border border-border p-3`,children:[(0,C.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2`,children:[(0,C.jsx)(E,{id:`codex-context-window`,label:`Context window (tokens)`,value:i,presets:w,disabled:n,compact:t,onChange:e=>{a(e),l(null)}}),(0,C.jsx)(E,{id:`codex-compact-threshold`,label:`Auto-compact threshold (tokens)`,value:o,presets:T,disabled:n,compact:t,onChange:e=>{s(e),l(null)}})]}),(0,C.jsx)(`p`,{id:`codex-context-help`,className:`${d} text-muted-foreground`,children:`Choose Codex default to use Codex configuration and model defaults, or Custom to enter a value. Presets are shortcuts, not a list of limits supported by your model; increasing these values does not unlock a larger context window. Applies to new sessions and sessions resumed after a PPM restart.`}),c&&(0,C.jsx)(`p`,{role:`alert`,className:`${u} text-error`,children:c}),(0,C.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,C.jsx)(`a`,{href:`https://learn.chatgpt.com/docs/config-file/config-reference`,target:`_blank`,rel:`noreferrer`,className:`${d} text-primary underline`,children:`Codex context documentation`}),(0,C.jsx)(`button`,{type:`submit`,disabled:n,className:`min-h-11 sm:min-h-0 rounded-md border border-border px-3 py-1.5 hover:bg-surface-elevated disabled:opacity-50 ${u}`,children:n?`Saving...`:`Save context settings`})]})]})}var D=[{value:`low`,label:`Low`},{value:`medium`,label:`Medium`},{value:`high`,label:`High`},{value:`xhigh`,label:`Extra`},{value:`max`,label:`Max`}],ce=[{value:`bypassPermissions`,label:`Bypass permissions (default)`},{value:`default`,label:`Ask before edits`},{value:`acceptEdits`,label:`Edit automatically`},{value:`plan`,label:`Plan mode`}],O={claude:`Claude`,cursor:`Cursor`,codex:`Codex`,gemini:`Gemini`,antigravity:`Antigravity`};function k({compact:e}={}){let[t,n]=(0,S.useState)(null),[r,w]=(0,S.useState)(``),[T,E]=(0,S.useState)([]),[k,A]=(0,S.useState)(!1),[j,M]=(0,S.useState)(!1),[N,P]=(0,S.useState)(null),[F,I]=(0,S.useState)(0),[ue,L]=(0,S.useState)([]),[R,z]=(0,S.useState)(!1);(0,S.useEffect)(()=>{p().then(e=>{n(e),w(e.default_provider??`claude`)}).catch(e=>P(e.message))},[]),ae(`ai`,()=>{p().then(e=>{n(e),I(e=>e+1)}).catch(()=>{})}),(0,S.useEffect)(()=>{r&&s.get(`/api/settings/ai/providers/status`).then(L).catch(()=>L([]))},[r]);let B=ue.find(e=>e.id===r&&!e.registered);(0,S.useEffect)(()=>{r&&(A(!0),s.get(`/api/settings/ai/providers/${r}/models`).then(E).catch(()=>E([])).finally(()=>A(!1)))},[r,!B]);let[V,H]=(0,S.useState)(null),U=t?.providers[r]?.model;(0,S.useEffect)(()=>{if(H(null),!r)return;let e=!0,t=U?`?model=${encodeURIComponent(U)}`:``;return s.get(`/api/settings/ai/providers/${r}/effort-status${t}`).then(({status:t})=>{e&&H(t)}).catch(()=>{}),()=>{e=!1}},[r,U]);let de=async()=>{z(!0);try{let e=await s.post(`/api/settings/ai/providers/${r}/probe`);L(t=>t.map(t=>t.id===e.id?e:t))}catch(e){P(e.message)}finally{z(!1)}},W=t?Object.keys(t.providers).filter(e=>e!==`mock`).map(e=>({id:e,name:O[e]??e})):[],G=t?.providers[r],K=G?.type===`agent-sdk`||!G?.type&&r===`claude`,q=te(ne(G?.effort,V),V,G?.model?re(G.model):`the model`),J=async e=>{if(!t)return!1;M(!0),P(null);try{return n(await ie(e)),I(e=>e+1),!0}catch(e){return P(e.message),!1}finally{M(!1)}},Y=(e,t)=>J({providers:{[r]:{[e]:t}}}),X=e?`text-[11px]`:`text-sm`,Z=e?`text-xs`:`text-sm`,fe=e?`space-y-2`:`space-y-4`,Q=e?`space-y-1.5`:`space-y-3`,$=e?`space-y-1`:`space-y-1.5`;if(!t)return(0,C.jsxs)(`div`,{className:Q,children:[(0,C.jsx)(`h3`,{className:`${Z} font-medium text-text-secondary`,children:`AI Settings`}),(0,C.jsx)(`p`,{className:`${X} text-text-subtle`,children:N?`Error: ${N}`:`Loading...`})]});let pe=K?T:[{value:`__default__`,label:`Auto (default)`},...T];return(0,C.jsxs)(`div`,{className:fe,children:[(0,C.jsx)(`h3`,{className:`${Z} font-medium text-text-secondary`,children:`AI Settings`}),(0,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(v,{htmlFor:`ai-new-chat-provider`,className:e?X:void 0,children:`New chat provider`}),(0,C.jsxs)(h,{value:t.new_chat_provider_mode??`default`,disabled:j,onValueChange:e=>J({new_chat_provider_mode:e}),children:[(0,C.jsx)(b,{id:`ai-new-chat-provider`,className:`w-full ${e?`h-7 text-[11px]`:``}`,children:(0,C.jsx)(m,{})}),(0,C.jsxs)(g,{children:[(0,C.jsx)(_,{value:`follow-focus`,children:`Follow last focused chat`}),(0,C.jsx)(_,{value:`default`,children:`Always use default provider`})]})]}),(0,C.jsx)(`p`,{className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:t.new_chat_provider_mode===`follow-focus`?`New tabs follow the last chat you focused in this project, across panels. Existing tabs keep their provider.`:`New tabs always use the default provider. Existing tabs keep their provider.`})]}),(0,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(v,{htmlFor:`ai-default-provider`,className:e?X:void 0,children:`Default provider`}),(0,C.jsxs)(h,{value:t.default_provider,disabled:j,onValueChange:e=>J({default_provider:e}),children:[(0,C.jsx)(b,{id:`ai-default-provider`,className:`w-full ${e?`h-7 text-[11px]`:``}`,children:(0,C.jsx)(m,{})}),(0,C.jsx)(g,{children:W.map(e=>(0,C.jsx)(_,{value:e.id,children:e.name},e.id))})]}),t.new_chat_provider_mode===`follow-focus`&&(0,C.jsx)(`p`,{className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:`Used when no chat has been focused in this project yet.`})]}),(0,C.jsxs)(`div`,{className:`flex items-start justify-between gap-3 rounded-md border border-border p-3`,children:[(0,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(v,{htmlFor:`ai-share-provider-context`,className:e?X:void 0,children:`Share rules and memory between providers`}),(0,C.jsx)(`p`,{id:`ai-share-provider-context-description`,className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:`Share project rules and memory, plus global instruction files, across providers. Applies from the next project-chat message. Turning off keeps context already sent.`})]}),(0,C.jsx)(y,{id:`ai-share-provider-context`,"aria-describedby":`ai-share-provider-context-description`,checked:t.share_provider_context??!0,disabled:j,onCheckedChange:e=>J({share_provider_context:e})})]}),(0,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(v,{htmlFor:`ai-leftover-idle`,className:e?X:void 0,children:`Stop leftover processes after (idle minutes, 0 = log only)`}),(0,C.jsx)(d,{id:`ai-leftover-idle`,type:`number`,min:0,max:oe,defaultValue:x(t),"aria-describedby":`ai-leftover-idle-description`,className:e?`h-7 text-[11px]`:void 0,onBlur:e=>{let n=parseInt(e.target.value),r=isNaN(n)?null:Math.min(Number(e.target.max),Math.max(Number(e.target.min),n));e.target.value=String(r??x(t)),r!==null&&J({leftover_processes_idle_minutes:r})}},`leftover-${F}`),(0,C.jsxs)(`p`,{id:`ai-leftover-idle-description`,className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:[`Servers, emulators and other processes a chat's commands started and left running are stopped once the chat has been idle this long, and at once when the chat is deleted. At 0 nothing is stopped: the server log names what `,30,` idle minutes would have stopped. Linux with systemd only.`]})]}),W.length>1&&(0,C.jsx)(`div`,{className:`flex gap-0.5 border-b border-border/50 -mx-1 px-1`,children:W.map(e=>(0,C.jsxs)(`button`,{onClick:()=>w(e.id),className:`flex items-center gap-1 px-2 py-1 text-[11px] rounded-t transition-colors ${r===e.id?`text-primary border-b-2 border-primary font-medium`:`text-text-subtle hover:text-text-secondary`}`,children:[(0,C.jsx)(u,{providerId:e.id}),(0,C.jsx)(`span`,{className:`capitalize`,children:e.name})]},e.id))}),(0,C.jsxs)(`div`,{className:Q,children:[B&&(0,C.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-warning/30 bg-warning/5 px-2.5 py-2`,children:[(0,C.jsx)(o,{className:`size-3.5 text-warning shrink-0 mt-0.5`}),(0,C.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1.5`,children:[(0,C.jsxs)(`p`,{className:`${X} text-text-secondary`,children:[O[r]??r,` is not available in chat — PPM could not start it.`]}),(0,C.jsx)(`p`,{className:`text-[11px] text-muted-foreground break-words`,children:B.reason}),B.nextProbeAt&&(0,C.jsxs)(`p`,{className:`text-[11px] text-text-subtle`,children:[`Checking again at `,new Date(B.nextProbeAt).toLocaleTimeString()]}),(0,C.jsxs)(l,{variant:`outline`,size:`sm`,onClick:de,disabled:R,className:`gap-1.5 cursor-pointer min-h-11 md:min-h-8`,children:[(0,C.jsx)(i,{className:`size-3.5 ${R?`animate-spin`:``}`}),R?`Checking...`:`Check again`]})]})]}),(r===`codex`||r===`antigravity`)&&(0,C.jsxs)(`button`,{type:`button`,onClick:()=>c(`accounts`),className:`w-full flex items-center justify-between gap-2 rounded-md border border-border px-2.5 py-2 text-left cursor-pointer hover:bg-surface-elevated transition-colors`,children:[(0,C.jsx)(`span`,{className:`${X} text-text-secondary`,children:r===`antigravity`?`Antigravity account & quota`:`Codex accounts & login`}),(0,C.jsx)(a,{className:`size-3.5 text-text-subtle shrink-0`})]}),T.length>0&&(0,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(v,{htmlFor:`ai-model`,className:e?X:void 0,children:`Model`}),(0,C.jsxs)(h,{value:K?G?.model??T[0]?.value:G?.model||`__default__`,onValueChange:e=>Y(`model`,e===`__default__`?void 0:e),disabled:k,children:[(0,C.jsx)(b,{id:`ai-model`,className:`w-full ${e?`h-7 text-[11px]`:``}`,children:(0,C.jsx)(m,{placeholder:k?`Loading models...`:`Select model`})}),(0,C.jsx)(g,{className:`max-h-[300px]`,children:pe.map(e=>(0,C.jsx)(_,{value:e.value,children:e.label},e.value))})]})]}),r===`antigravity`&&(0,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(v,{htmlFor:`ai-antigravity-effort`,className:e?X:void 0,children:`Effort`}),(0,C.jsxs)(h,{value:G?.effort??`high`,onValueChange:e=>Y(`effort`,e),children:[(0,C.jsx)(b,{id:`ai-antigravity-effort`,className:`w-full ${e?`h-7 text-[11px]`:``}`,children:(0,C.jsx)(m,{})}),(0,C.jsx)(g,{children:D.filter(e=>e.value===`low`||e.value===`medium`||e.value===`high`).map(e=>(0,C.jsx)(_,{value:e.value,children:e.label},e.value))})]})]}),r===`codex`&&(0,C.jsx)(se,{config:G,compact:e,saving:j,onSave:e=>J({providers:{codex:e}})},JSON.stringify([G?.model_context_window,G?.model_auto_compact_token_limit])),K&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(v,{htmlFor:`ai-base-url`,className:e?X:void 0,children:`Base URL`}),(0,C.jsx)(d,{id:`ai-base-url`,type:`url`,defaultValue:G?.base_url??``,placeholder:`https://api.anthropic.com (default)`,className:e?`h-7 text-[11px]`:void 0,onBlur:e=>{Y(`base_url`,e.target.value.trim()||void 0)}},`baseurl-${r}-${F}`)]}),(0,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(v,{htmlFor:`ai-api-key`,className:e?X:void 0,children:`API Key / Token`}),(0,C.jsx)(d,{id:`ai-api-key`,type:`password`,defaultValue:G?.api_key??``,placeholder:`sk-ant-... (optional, overrides accounts)`,className:e?`h-7 text-[11px] font-mono`:`font-mono`,onBlur:e=>{let t=e.target.value.trim();t.startsWith(`••••`)||Y(`api_key`,t||void 0)}},`apikey-${r}-${F}`),(0,C.jsx)(`p`,{className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:`Direct API key or OAuth token. Leave empty to use connected accounts.`})]}),(0,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(v,{htmlFor:`ai-effort`,className:e?X:void 0,children:`Effort`}),(0,C.jsxs)(h,{value:G?.effort??`high`,onValueChange:e=>Y(`effort`,e),children:[(0,C.jsx)(b,{id:`ai-effort`,className:`w-full ${e?`h-7 text-[11px]`:``}`,children:(0,C.jsx)(m,{})}),(0,C.jsx)(g,{children:D.map(e=>(0,C.jsx)(_,{value:e.value,children:e.label},e.value))})]}),q&&(0,C.jsxs)(`div`,{role:`note`,className:`flex items-start gap-2 rounded-md border border-warning/30 bg-warning/5 px-2.5 py-2`,children:[(0,C.jsx)(o,{className:`size-3.5 text-warning shrink-0 mt-0.5`}),(0,C.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[(0,C.jsx)(`p`,{className:`${X} text-text-secondary`,children:q.title}),(0,C.jsx)(`p`,{className:`text-[11px] text-muted-foreground break-words`,children:f(q.detail)})]})]})]}),(0,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(v,{htmlFor:`ai-max-turns`,className:e?X:void 0,children:`Max Turns (up to 1000, 0 = no limit)`}),(0,C.jsx)(d,{id:`ai-max-turns`,type:`number`,min:0,max:1e3,defaultValue:G?.max_turns??100,className:e?`h-7 text-[11px]`:void 0,onBlur:e=>{let t=parseInt(e.target.value),n=isNaN(t)?null:Math.min(Number(e.target.max),Math.max(Number(e.target.min),t));e.target.value=String(n??G?.max_turns??100),n!==null&&Y(`max_turns`,n)}},`turns-${r}-${F}`),(G?.max_turns===0||(G?.max_turns??0)>500)&&(0,C.jsxs)(`p`,{className:`flex items-start gap-1.5 ${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:[(0,C.jsx)(o,{className:`size-3 text-warning shrink-0 mt-px`}),`Every step is a paid model call. With a limit this high, or none, a task left running unattended can go on for hours and run up a large bill.`]})]}),(0,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(v,{htmlFor:`ai-budget`,className:e?X:void 0,children:`Max Budget (USD)`}),(0,C.jsx)(d,{id:`ai-budget`,type:`number`,step:.1,min:.01,max:50,defaultValue:G?.max_budget_usd??``,placeholder:`No limit`,className:e?`h-7 text-[11px]`:void 0,onBlur:e=>{let t=parseFloat(e.target.value);Y(`max_budget_usd`,isNaN(t)?void 0:t)}},`budget-${r}-${F}`)]}),(0,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(v,{htmlFor:`ai-thinking`,className:e?X:void 0,children:`Thinking Budget (tokens)`}),(0,C.jsx)(d,{id:`ai-thinking`,type:`number`,min:0,defaultValue:G?.thinking_budget_tokens??``,placeholder:`Adaptive (model decides)`,className:e?`h-7 text-[11px]`:void 0,onBlur:e=>{let t=parseInt(e.target.value);Y(`thinking_budget_tokens`,isNaN(t)?void 0:t)}},`thinking-${r}-${F}`)]}),(0,C.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(v,{htmlFor:`ai-agent-teams`,className:e?X:void 0,children:`Agent Teams`}),(0,C.jsx)(`p`,{className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:`Experimental. Enables multi-agent collaboration with shared tasks and messaging. Uses ~7x more tokens.`})]}),(0,C.jsx)(y,{id:`ai-agent-teams`,checked:G?.agent_teams??!1,onCheckedChange:e=>Y(`agent_teams`,e)})]}),G?.agent_teams&&(0,C.jsx)(le,{compact:e}),(0,C.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(v,{htmlFor:`ai-context-1m`,className:e?X:void 0,children:`1M Context Window`}),(0,C.jsx)(`p`,{className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:`Requires an entitled account (Max/Team/Enterprise) and an Opus 4 / Sonnet 4 model. Other accounts will error.`})]}),(0,C.jsx)(y,{id:`ai-context-1m`,checked:G?.context_1m??!1,onCheckedChange:e=>Y(`context_1m`,e)})]}),(0,C.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(v,{htmlFor:`ai-inherit-mcp`,className:e?X:void 0,children:`Inherit Claude Code MCP`}),(0,C.jsx)(`p`,{className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:`Auto-load MCP servers from Claude Code's ~/.claude.json (global + per-project). Your own MCP servers override inherited ones.`})]}),(0,C.jsx)(y,{id:`ai-inherit-mcp`,checked:G?.inherit_claude_mcp??!0,onCheckedChange:e=>Y(`inherit_claude_mcp`,e)})]}),(0,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(v,{className:e?X:void 0,children:`MCP sign-in`}),(0,C.jsx)(`p`,{className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:`Servers that use OAuth stay unavailable to Claude until someone signs in. Project-scoped servers are listed in the project's AI Resources panel.`}),(0,C.jsx)(`div`,{className:`-mx-2`,children:(0,C.jsx)(ee,{showWhenEmpty:!0})})]})]}),(0,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(v,{htmlFor:`ai-permission-mode`,className:e?X:void 0,children:`Default Permission Mode`}),(0,C.jsxs)(h,{value:G?.permission_mode??`bypassPermissions`,onValueChange:e=>Y(`permission_mode`,e),children:[(0,C.jsx)(b,{id:`ai-permission-mode`,className:`w-full ${e?`h-7 text-[11px]`:``}`,children:(0,C.jsx)(m,{})}),(0,C.jsx)(g,{children:ce.map(e=>(0,C.jsx)(_,{value:e.value,children:e.label},e.value))})]})]}),(0,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(v,{htmlFor:`ai-system-prompt`,className:e?X:void 0,children:`Additional Instructions`}),(0,C.jsx)(`textarea`,{id:`ai-system-prompt`,rows:e?3:4,defaultValue:G?.system_prompt??``,placeholder:`Enter additional instructions for ${r}...`,"aria-describedby":r===`antigravity`?`ai-system-prompt-description`:void 0,className:`w-full rounded-md border border-input bg-background px-3 py-2 ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ${e?`text-[11px]`:`text-sm`}`,onBlur:e=>{Y(`system_prompt`,e.target.value.trim()||void 0)}},`sysprompt-${r}-${F}`),r===`antigravity`&&(0,C.jsx)(`p`,{id:`ai-system-prompt-description`,className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:`Antigravity reads these only when PPM starts a new chat, and a chat keeps the ones it started with.`})]})]}),j&&(0,C.jsx)(`p`,{className:`text-xs text-text-subtle`,children:`Saving...`}),N&&(0,C.jsx)(`p`,{className:`text-xs text-error`,children:N})]})}function le({compact:e}){let[t,n]=(0,S.useState)([]),[a,o]=(0,S.useState)(!1),[c,l]=(0,S.useState)(null),u=(0,S.useCallback)(async()=>{o(!0);try{n(await s.get(`/api/teams`)??[])}catch{}o(!1)},[]);(0,S.useEffect)(()=>{u()},[u]);let d=async e=>{try{await s.del(`/api/teams/${encodeURIComponent(e)}`),n(t=>t.filter(t=>t.name!==e)),l(null)}catch{}};return t.length===0&&!a?null:(0,C.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,C.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,C.jsxs)(v,{className:e?`text-[11px]`:void 0,children:[`Teams (`,t.length,`)`]}),(0,C.jsx)(`button`,{onClick:u,className:`text-text-subtle hover:text-foreground p-1`,"aria-label":`Refresh teams`,children:(0,C.jsx)(i,{className:`size-3 ${a?`animate-spin`:``}`})})]}),t.map(e=>(0,C.jsxs)(`div`,{className:`flex items-center justify-between p-2 rounded bg-surface-elevated text-xs`,children:[(0,C.jsxs)(`div`,{className:`min-w-0`,children:[(0,C.jsx)(`div`,{className:`font-medium truncate`,children:e.name}),e.description&&(0,C.jsx)(`div`,{className:`text-text-subtle truncate`,children:e.description}),(0,C.jsxs)(`div`,{className:`text-text-subtle`,children:[e.members?.length??e.memberCount??0,` members`,e.createdAt?` · ${new Date(e.createdAt).toLocaleDateString()}`:``]})]}),c===e.name?(0,C.jsxs)(`div`,{className:`flex gap-1 shrink-0 ml-2`,children:[(0,C.jsx)(`button`,{onClick:()=>d(e.name),className:`px-2 py-1 bg-error text-white rounded text-[10px]`,children:`Delete`}),(0,C.jsx)(`button`,{onClick:()=>l(null),className:`px-2 py-1 bg-panel-2 text-text rounded text-[10px]`,children:`Cancel`})]}):(0,C.jsx)(`button`,{onClick:()=>l(e.name),className:`shrink-0 text-text-subtle hover:text-error p-1 ml-2`,"aria-label":`Delete team ${e.name}`,children:(0,C.jsx)(r,{className:`size-3.5`})})]},e.name))]})}export{k as t};
|
|
Binary file
|
|
Binary file
|