@hienlh/ppm 0.23.27 → 0.23.28
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/CLAUDE.md +1 -0
- package/assets/skills/ppm/SKILL.md +1 -1
- package/assets/skills/ppm/references/cli-reference.md +4 -4
- package/assets/skills/ppm/references/http-api.md +1 -1
- package/dist/web/assets/{accounts-settings-section-CZglHifc.js → accounts-settings-section-BpPfPPms.js} +1 -1
- package/dist/web/assets/accounts-settings-section-BpPfPPms.js.br +0 -0
- package/dist/web/assets/accounts-settings-section-BpPfPPms.js.gz +0 -0
- package/dist/web/assets/{agent-session-sheet-B3VLD2H6.js → agent-session-sheet-DzlLsud2.js} +2 -2
- package/dist/web/assets/agent-session-sheet-DzlLsud2.js.br +0 -0
- package/dist/web/assets/agent-session-sheet-DzlLsud2.js.gz +0 -0
- package/dist/web/assets/{agent-session-window-content-HEdIT_LQ.js → agent-session-window-content-Db1N_iji.js} +1 -1
- package/dist/web/assets/agent-session-window-content-Db1N_iji.js.br +0 -0
- package/dist/web/assets/agent-session-window-content-Db1N_iji.js.gz +0 -0
- package/dist/web/assets/{ai-resource-editor-CFbXgGMo.js → ai-resource-editor-BkMMCRXw.js} +1 -1
- package/dist/web/assets/ai-resource-editor-BkMMCRXw.js.br +0 -0
- package/dist/web/assets/ai-resource-editor-BkMMCRXw.js.gz +0 -0
- package/dist/web/assets/{ai-settings-section-BNiVD9D3.js → ai-settings-section-DfsLLATF.js} +1 -1
- package/dist/web/assets/ai-settings-section-DfsLLATF.js.br +0 -0
- package/dist/web/assets/ai-settings-section-DfsLLATF.js.gz +0 -0
- package/dist/web/assets/{ai-settings-section-W0kfADRB.js → ai-settings-section-Kd7dvbpg.js} +1 -1
- package/dist/web/assets/{android-tab-CY3aa_vU.js → android-tab-pF-ccFeQ.js} +1 -1
- package/dist/web/assets/android-tab-pF-ccFeQ.js.br +0 -0
- package/dist/web/assets/android-tab-pF-ccFeQ.js.gz +0 -0
- package/dist/web/assets/{appearance-settings-section-lbtuzecW.js → appearance-settings-section-D0WDuhJ2.js} +1 -1
- package/dist/web/assets/appearance-settings-section-D0WDuhJ2.js.br +0 -0
- package/dist/web/assets/appearance-settings-section-D0WDuhJ2.js.gz +0 -0
- package/dist/web/assets/{apps-panel-CF2mbvVq.js → apps-panel-BxXS0WUD.js} +1 -1
- package/dist/web/assets/apps-panel-BxXS0WUD.js.br +0 -0
- package/dist/web/assets/apps-panel-BxXS0WUD.js.gz +0 -0
- package/dist/web/assets/{branch-review-tab-CR7JnS5x.js → branch-review-tab-0iO--u-m.js} +1 -1
- package/dist/web/assets/branch-review-tab-0iO--u-m.js.br +0 -0
- package/dist/web/assets/branch-review-tab-0iO--u-m.js.gz +0 -0
- package/dist/web/assets/{chat-tab-BCELq4nK.js → chat-tab-B8eIHFK1.js} +1 -1
- package/dist/web/assets/chat-tab-B8eIHFK1.js.br +0 -0
- package/dist/web/assets/chat-tab-B8eIHFK1.js.gz +0 -0
- package/dist/web/assets/{chat-tab-C4aOYSea.js → chat-tab-CmF4QVA9.js} +3 -3
- package/dist/web/assets/chat-tab-CmF4QVA9.js.br +0 -0
- package/dist/web/assets/chat-tab-CmF4QVA9.js.gz +0 -0
- package/dist/web/assets/{code-editor-_axJbYkP.js → code-editor-X--V1VeT.js} +4 -4
- package/dist/web/assets/code-editor-X--V1VeT.js.br +0 -0
- package/dist/web/assets/code-editor-X--V1VeT.js.gz +0 -0
- package/dist/web/assets/codex-reset-credit-button-XC0rCF5U.js +1 -0
- package/dist/web/assets/codex-reset-credit-button-XC0rCF5U.js.br +0 -0
- package/dist/web/assets/codex-reset-credit-button-XC0rCF5U.js.gz +0 -0
- package/dist/web/assets/{conflict-editor-D0AYuLKI.js → conflict-editor-D2hb69oL.js} +1 -1
- package/dist/web/assets/conflict-editor-D2hb69oL.js.br +0 -0
- package/dist/web/assets/conflict-editor-D2hb69oL.js.gz +0 -0
- package/dist/web/assets/{connection-form-tab-C3QyUWnE.js → connection-form-tab-DQMO4qU5.js} +1 -1
- package/dist/web/assets/connection-form-tab-DQMO4qU5.js.br +0 -0
- package/dist/web/assets/{connection-form-tab-C3QyUWnE.js.gz → connection-form-tab-DQMO4qU5.js.gz} +0 -0
- package/dist/web/assets/{csv-preview-CmKkcz4M.js → csv-preview-eY8R-UbG.js} +1 -1
- package/dist/web/assets/csv-preview-eY8R-UbG.js.br +0 -0
- package/dist/web/assets/csv-preview-eY8R-UbG.js.gz +0 -0
- package/dist/web/assets/{db-tab-parts-BXL34wrZ.js → db-tab-parts-C6YcRshd.js} +1 -1
- package/dist/web/assets/db-tab-parts-C6YcRshd.js.br +0 -0
- package/dist/web/assets/db-tab-parts-C6YcRshd.js.gz +0 -0
- package/dist/web/assets/{design-settings-section-DukfVtwP.js → design-settings-section-BgSPZ0kW.js} +1 -1
- package/dist/web/assets/design-settings-section-BgSPZ0kW.js.br +0 -0
- package/dist/web/assets/design-settings-section-BgSPZ0kW.js.gz +0 -0
- package/dist/web/assets/{design-tab-BoPiL2ge.js → design-tab-CHAF9GTs.js} +1 -1
- package/dist/web/assets/design-tab-CHAF9GTs.js.br +0 -0
- package/dist/web/assets/design-tab-CHAF9GTs.js.gz +0 -0
- package/dist/web/assets/{designs-sidebar-panel-BVTqPPzG.js → designs-sidebar-panel-D3WyvAkV.js} +1 -1
- package/dist/web/assets/designs-sidebar-panel-D3WyvAkV.js.br +0 -0
- package/dist/web/assets/designs-sidebar-panel-D3WyvAkV.js.gz +0 -0
- package/dist/web/assets/{diff-viewer-C86mR7vD.js → diff-viewer-Z7U41YSt.js} +1 -1
- package/dist/web/assets/diff-viewer-Z7U41YSt.js.br +0 -0
- package/dist/web/assets/diff-viewer-Z7U41YSt.js.gz +0 -0
- package/dist/web/assets/{docx-preview-B9EhDCMi.js → docx-preview-Dfcjr_SW.js} +1 -1
- package/dist/web/assets/docx-preview-Dfcjr_SW.js.br +0 -0
- package/dist/web/assets/docx-preview-Dfcjr_SW.js.gz +0 -0
- package/dist/web/assets/{editor-dialog-DTDsbJd6.js → editor-dialog-CFKRnl0r.js} +1 -1
- package/dist/web/assets/editor-dialog-CFKRnl0r.js.br +0 -0
- package/dist/web/assets/editor-dialog-CFKRnl0r.js.gz +0 -0
- package/dist/web/assets/{editor-language-service-BtrrQAS2.js → editor-language-service-DF0iZ-oJ.js} +1 -1
- package/dist/web/assets/editor-language-service-DF0iZ-oJ.js.br +0 -0
- package/dist/web/assets/editor-language-service-DF0iZ-oJ.js.gz +0 -0
- package/dist/web/assets/{explorer-body-DLaWmxri.js → explorer-body-CjgqTA5z.js} +1 -1
- package/dist/web/assets/explorer-body-CjgqTA5z.js.br +0 -0
- package/dist/web/assets/explorer-body-CjgqTA5z.js.gz +0 -0
- package/dist/web/assets/{explorer-window-content-CbUIbrzL.js → explorer-window-content-D5lMhuEE.js} +1 -1
- package/dist/web/assets/explorer-window-content-D5lMhuEE.js.br +0 -0
- package/dist/web/assets/explorer-window-content-D5lMhuEE.js.gz +0 -0
- package/dist/web/assets/{extension-manager-section-BpKMyLwI.js → extension-manager-section-vMRBnoJO.js} +1 -1
- package/dist/web/assets/extension-manager-section-vMRBnoJO.js.br +0 -0
- package/dist/web/assets/extension-manager-section-vMRBnoJO.js.gz +0 -0
- package/dist/web/assets/{extension-webview-BGfyaXMI.js → extension-webview-DanhPG0F.js} +1 -1
- package/dist/web/assets/extension-webview-DanhPG0F.js.br +0 -0
- package/dist/web/assets/extension-webview-DanhPG0F.js.gz +0 -0
- package/dist/web/assets/{files-settings-section-CQT9_rX2.js → files-settings-section-C8CYlT-I.js} +1 -1
- package/dist/web/assets/files-settings-section-C8CYlT-I.js.br +0 -0
- package/dist/web/assets/files-settings-section-C8CYlT-I.js.gz +0 -0
- package/dist/web/assets/{general-settings-section-BoQGeqBi.js → general-settings-section-DTpOZJ-p.js} +1 -1
- package/dist/web/assets/general-settings-section-DTpOZJ-p.js.br +0 -0
- package/dist/web/assets/general-settings-section-DTpOZJ-p.js.gz +0 -0
- package/dist/web/assets/{git-log-panel-T8Fzn8-5.js → git-log-panel-ChpHJfMr.js} +1 -1
- package/dist/web/assets/git-log-panel-ChpHJfMr.js.br +0 -0
- package/dist/web/assets/git-log-panel-ChpHJfMr.js.gz +0 -0
- package/dist/web/assets/{git-review-tab-WzuX4Ml9.js → git-review-tab-XCGVDLWC.js} +1 -1
- package/dist/web/assets/git-review-tab-XCGVDLWC.js.br +0 -0
- package/dist/web/assets/git-review-tab-XCGVDLWC.js.gz +0 -0
- package/dist/web/assets/{glide-data-grid-BBzGDYvj.js → glide-data-grid-BIicS817.js} +1 -1
- package/dist/web/assets/glide-data-grid-BIicS817.js.br +0 -0
- package/dist/web/assets/glide-data-grid-BIicS817.js.gz +0 -0
- package/dist/web/assets/{grid-save-dialog-HiqlnSky.js → grid-save-dialog-lH5FqCsy.js} +1 -1
- package/dist/web/assets/grid-save-dialog-lH5FqCsy.js.br +0 -0
- package/dist/web/assets/grid-save-dialog-lH5FqCsy.js.gz +0 -0
- package/dist/web/assets/{group-chat-tab-URU3FCLs.js → group-chat-tab-CJ_oCDXh.js} +1 -1
- package/dist/web/assets/group-chat-tab-CJ_oCDXh.js.br +0 -0
- package/dist/web/assets/group-chat-tab-CJ_oCDXh.js.gz +0 -0
- package/dist/web/assets/{impexp-tab-B0m1Q8ia.js → impexp-tab-DaWPiD5j.js} +1 -1
- package/dist/web/assets/impexp-tab-DaWPiD5j.js.br +0 -0
- package/dist/web/assets/impexp-tab-DaWPiD5j.js.gz +0 -0
- package/dist/web/assets/{index-Vd9Xr54k.js → index-hEtw8BzE.js} +5 -5
- package/dist/web/assets/index-hEtw8BzE.js.br +0 -0
- package/dist/web/assets/index-hEtw8BzE.js.gz +0 -0
- package/dist/web/assets/{jira-watcher-section-CnSTbAF6.js → jira-watcher-section-CwUHMdEh.js} +1 -1
- package/dist/web/assets/{keybindings-store-D_U8jECl.js → keybindings-store-B0yahyjU.js} +1 -1
- package/dist/web/assets/{keyboard-shortcuts-section-CU7JjDsU.js → keyboard-shortcuts-section-wtV3OtKT.js} +1 -1
- package/dist/web/assets/keyboard-shortcuts-section-wtV3OtKT.js.br +0 -0
- package/dist/web/assets/keyboard-shortcuts-section-wtV3OtKT.js.gz +0 -0
- package/dist/web/assets/{language-servers-section-CzUG9H69.js → language-servers-section-Cgq5jqIq.js} +2 -2
- package/dist/web/assets/language-servers-section-Cgq5jqIq.js.br +0 -0
- package/dist/web/assets/language-servers-section-Cgq5jqIq.js.gz +0 -0
- package/dist/web/assets/{logs-app-CDSvyY1H.js → logs-app-DMGSa0EZ.js} +1 -1
- package/dist/web/assets/logs-app-DMGSa0EZ.js.br +0 -0
- package/dist/web/assets/logs-app-DMGSa0EZ.js.gz +0 -0
- package/dist/web/assets/{logs-tab-CQw9vrNw.js → logs-tab-CNAJfY0p.js} +1 -1
- package/dist/web/assets/{logs-window-content-CGvPnPrr.js → logs-window-content-BLZTSzA_.js} +1 -1
- package/dist/web/assets/{lsp-client-CpjPUUYJ.js → lsp-client-DeDps1ff.js} +1 -1
- package/dist/web/assets/lsp-client-DeDps1ff.js.br +0 -0
- package/dist/web/assets/lsp-client-DeDps1ff.js.gz +0 -0
- package/dist/web/assets/{markdown-renderer-DZNMRg6p.js → markdown-renderer-BglemZay.js} +1 -1
- package/dist/web/assets/markdown-renderer-BglemZay.js.br +0 -0
- package/dist/web/assets/markdown-renderer-BglemZay.js.gz +0 -0
- package/dist/web/assets/{markdown-renderer-3ZR2x0CC.js → markdown-renderer-CbMb0KIt.js} +1 -1
- package/dist/web/assets/{mobile-explorer-sheet-D7e-MM6m.js → mobile-explorer-sheet-B-rEK1Rv.js} +1 -1
- package/dist/web/assets/mobile-explorer-sheet-B-rEK1Rv.js.br +0 -0
- package/dist/web/assets/mobile-explorer-sheet-B-rEK1Rv.js.gz +0 -0
- package/dist/web/assets/{new-design-dialog-BthM423i.js → new-design-dialog-MZChmJxx.js} +1 -1
- package/dist/web/assets/new-design-dialog-MZChmJxx.js.br +0 -0
- package/dist/web/assets/new-design-dialog-MZChmJxx.js.gz +0 -0
- package/dist/web/assets/{notification-store-GKweleCQ.js → notification-store-BeHQe3xv.js} +1 -1
- package/dist/web/assets/{notifications-settings-section-TS3gNFcc.js → notifications-settings-section-B3ZivJoQ.js} +1 -1
- package/dist/web/assets/notifications-settings-section-B3ZivJoQ.js.br +0 -0
- package/dist/web/assets/notifications-settings-section-B3ZivJoQ.js.gz +0 -0
- package/dist/web/assets/{ppmbot-settings-section-D8jIlmp8.js → ppmbot-settings-section-DNBoSvo3.js} +1 -1
- package/dist/web/assets/ppmbot-settings-section-DNBoSvo3.js.br +0 -0
- package/dist/web/assets/ppmbot-settings-section-DNBoSvo3.js.gz +0 -0
- package/dist/web/assets/{problems-panel-DjCHA1r5.js → problems-panel-DELXPISU.js} +1 -1
- package/dist/web/assets/problems-panel-DELXPISU.js.br +0 -0
- package/dist/web/assets/problems-panel-DELXPISU.js.gz +0 -0
- package/dist/web/assets/{process-table-BxXEh4tN.js → process-table-DLxTp9xB.js} +1 -1
- package/dist/web/assets/process-table-DLxTp9xB.js.br +0 -0
- package/dist/web/assets/process-table-DLxTp9xB.js.gz +0 -0
- package/dist/web/assets/{proxy-settings-section-B8igco2L.js → proxy-settings-section-Cl0NpYCd.js} +1 -1
- package/dist/web/assets/proxy-settings-section-Cl0NpYCd.js.br +0 -0
- package/dist/web/assets/proxy-settings-section-Cl0NpYCd.js.gz +0 -0
- package/dist/web/assets/{query-tab-DHU3ANHN.js → query-tab-BxeuwVui.js} +1 -1
- package/dist/web/assets/query-tab-BxeuwVui.js.br +0 -0
- package/dist/web/assets/query-tab-BxeuwVui.js.gz +0 -0
- package/dist/web/assets/{release-notes-window-content-B33RDfFY.js → release-notes-window-content-B_D7adpm.js} +1 -1
- package/dist/web/assets/{remote-access-settings-section-CoYQTFKd.js → remote-access-settings-section-D6qVIt6l.js} +1 -1
- package/dist/web/assets/remote-access-settings-section-D6qVIt6l.js.br +0 -0
- package/dist/web/assets/remote-access-settings-section-D6qVIt6l.js.gz +0 -0
- package/dist/web/assets/{remote-desktop-clipboard-notice-Dwn-iV4g.js → remote-desktop-clipboard-notice-BEAcnbOM.js} +1 -1
- package/dist/web/assets/remote-desktop-clipboard-notice-BEAcnbOM.js.br +0 -0
- package/dist/web/assets/remote-desktop-clipboard-notice-BEAcnbOM.js.gz +0 -0
- package/dist/web/assets/{remote-desktop-mobile-sheet-bfKiSG0C.js → remote-desktop-mobile-sheet-CZSaAw0H.js} +2 -2
- package/dist/web/assets/remote-desktop-mobile-sheet-CZSaAw0H.js.br +0 -0
- package/dist/web/assets/remote-desktop-mobile-sheet-CZSaAw0H.js.gz +0 -0
- package/dist/web/assets/{remote-desktop-mobile-view-CV8eHh4A.js → remote-desktop-mobile-view-BfFE873g.js} +1 -1
- package/dist/web/assets/remote-desktop-mobile-view-BfFE873g.js.br +0 -0
- package/dist/web/assets/remote-desktop-mobile-view-BfFE873g.js.gz +0 -0
- package/dist/web/assets/{remote-desktop-readiness-gate-DrSYb_9z.js → remote-desktop-readiness-gate-Q1fu27Au.js} +1 -1
- package/dist/web/assets/remote-desktop-readiness-gate-Q1fu27Au.js.br +0 -0
- package/dist/web/assets/remote-desktop-readiness-gate-Q1fu27Au.js.gz +0 -0
- package/dist/web/assets/{remote-desktop-window-content-CAuxeGbK.js → remote-desktop-window-content-d6jXrRd6.js} +1 -1
- package/dist/web/assets/remote-desktop-window-content-d6jXrRd6.js.br +0 -0
- package/dist/web/assets/remote-desktop-window-content-d6jXrRd6.js.gz +0 -0
- package/dist/web/assets/{rename-object-dialog-BPuh3dAH.js → rename-object-dialog-CuMEO81R.js} +1 -1
- package/dist/web/assets/rename-object-dialog-CuMEO81R.js.br +0 -0
- package/dist/web/assets/rename-object-dialog-CuMEO81R.js.gz +0 -0
- package/dist/web/assets/{review-address-setup-CoI2BGdx.js → review-address-setup-CjK0xtI4.js} +1 -1
- package/dist/web/assets/review-address-setup-CjK0xtI4.js.br +0 -0
- package/dist/web/assets/review-address-setup-CjK0xtI4.js.gz +0 -0
- package/dist/web/assets/{review-code-Dy8y4_17.js → review-code-DhgeQzGz.js} +1 -1
- package/dist/web/assets/review-code-DhgeQzGz.js.br +0 -0
- package/dist/web/assets/review-code-DhgeQzGz.js.gz +0 -0
- package/dist/web/assets/{save-as-dialog-C9OpJz2x.js → save-as-dialog-C7ECuSxR.js} +1 -1
- package/dist/web/assets/save-as-dialog-C7ECuSxR.js.br +0 -0
- package/dist/web/assets/save-as-dialog-C7ECuSxR.js.gz +0 -0
- package/dist/web/assets/{schedule-script-editor--roOsFbc.js → schedule-script-editor-Duwi_hAc.js} +1 -1
- package/dist/web/assets/schedule-script-editor-Duwi_hAc.js.br +0 -0
- package/dist/web/assets/schedule-script-editor-Duwi_hAc.js.gz +0 -0
- package/dist/web/assets/{schedules-settings-section-BTn_NSzU.js → schedules-settings-section-5dlXgx4Z.js} +3 -3
- package/dist/web/assets/schedules-settings-section-5dlXgx4Z.js.br +0 -0
- package/dist/web/assets/schedules-settings-section-5dlXgx4Z.js.gz +0 -0
- package/dist/web/assets/{session-review-tab-fRzyogNH.js → session-review-tab-B57ji6e7.js} +1 -1
- package/dist/web/assets/session-review-tab-B57ji6e7.js.br +0 -0
- package/dist/web/assets/session-review-tab-B57ji6e7.js.gz +0 -0
- package/dist/web/assets/{settings-body-D5pmlFft.js → settings-body-CQQBaAhh.js} +1 -1
- package/dist/web/assets/settings-body-CQQBaAhh.js.br +0 -0
- package/dist/web/assets/settings-body-CQQBaAhh.js.gz +0 -0
- package/dist/web/assets/{settings-rows-VtjChFlm.js → settings-rows-7pRcbnko.js} +1 -1
- package/dist/web/assets/settings-rows-7pRcbnko.js.br +0 -0
- package/dist/web/assets/settings-rows-7pRcbnko.js.gz +0 -0
- package/dist/web/assets/{settings-section-content-BOwSlBkZ.js → settings-section-content-BxrZV4TG.js} +2 -2
- package/dist/web/assets/settings-section-content-BxrZV4TG.js.br +0 -0
- package/dist/web/assets/settings-section-content-BxrZV4TG.js.gz +0 -0
- package/dist/web/assets/{settings-section-content-Ck39TJA7.js → settings-section-content-Cp1L2Ujm.js} +1 -1
- package/dist/web/assets/{settings-tab-A81xb81d.js → settings-tab-DizKbuwq.js} +1 -1
- package/dist/web/assets/{settings-window-content-BCDRi6xS.js → settings-window-content-BPqPZ196.js} +1 -1
- package/dist/web/assets/{slash-command-picker-BKeEykkF.js → slash-command-picker-Tdojfoue.js} +1 -1
- package/dist/web/assets/slash-command-picker-Tdojfoue.js.br +0 -0
- package/dist/web/assets/slash-command-picker-Tdojfoue.js.gz +0 -0
- package/dist/web/assets/{sql-object-tab-I5bl3DVf.js → sql-object-tab-CZtcHAMF.js} +1 -1
- package/dist/web/assets/sql-object-tab-CZtcHAMF.js.br +0 -0
- package/dist/web/assets/sql-object-tab-CZtcHAMF.js.gz +0 -0
- package/dist/web/assets/{sqlite-viewer-ECCCjxdn.js → sqlite-viewer-CCb_rhpZ.js} +1 -1
- package/dist/web/assets/sqlite-viewer-CCb_rhpZ.js.br +0 -0
- package/dist/web/assets/sqlite-viewer-CCb_rhpZ.js.gz +0 -0
- package/dist/web/assets/{structure-save-dialog-DcQdamD3.js → structure-save-dialog-D9naj5dT.js} +1 -1
- package/dist/web/assets/structure-save-dialog-D9naj5dT.js.br +0 -0
- package/dist/web/assets/structure-save-dialog-D9naj5dT.js.gz +0 -0
- package/dist/web/assets/{structure-tab-DyQGhf9t.js → structure-tab-gYa8tU6n.js} +1 -1
- package/dist/web/assets/structure-tab-gYa8tU6n.js.br +0 -0
- package/dist/web/assets/structure-tab-gYa8tU6n.js.gz +0 -0
- package/dist/web/assets/{system-monitor-body-B5AvRT5J.js → system-monitor-body-CeyIOGpH.js} +2 -2
- package/dist/web/assets/system-monitor-body-CeyIOGpH.js.br +0 -0
- package/dist/web/assets/system-monitor-body-CeyIOGpH.js.gz +0 -0
- package/dist/web/assets/{system-monitor-tab-CfwHKQ5k.js → system-monitor-tab-D4M7Peo1.js} +1 -1
- package/dist/web/assets/{system-monitor-window-content-Cvx1V8Mf.js → system-monitor-window-content-B5VTVjWl.js} +1 -1
- package/dist/web/assets/{tab-host-window-content-DqOUHxEL.js → tab-host-window-content-ChUuAIIm.js} +1 -1
- package/dist/web/assets/tab-host-window-content-ChUuAIIm.js.br +0 -0
- package/dist/web/assets/tab-host-window-content-ChUuAIIm.js.gz +0 -0
- package/dist/web/assets/{table-tab-dI8rBbCS.js → table-tab-PG0eKr51.js} +1 -1
- package/dist/web/assets/table-tab-PG0eKr51.js.br +0 -0
- package/dist/web/assets/table-tab-PG0eKr51.js.gz +0 -0
- package/dist/web/assets/{telegram-bot-token-field-DSLtG8vw.js → telegram-bot-token-field-kR3Gia1c.js} +1 -1
- package/dist/web/assets/telegram-bot-token-field-kR3Gia1c.js.br +0 -0
- package/dist/web/assets/telegram-bot-token-field-kR3Gia1c.js.gz +0 -0
- package/dist/web/assets/{terminal-tab-CDg0AHBK.js → terminal-tab-CmmKY_Z9.js} +1 -1
- package/dist/web/assets/terminal-tab-CmmKY_Z9.js.br +0 -0
- package/dist/web/assets/terminal-tab-CmmKY_Z9.js.gz +0 -0
- package/dist/web/assets/{tool-cards-7E0jtwP0.js → tool-cards-72GKNSD3.js} +2 -2
- package/dist/web/assets/tool-cards-72GKNSD3.js.br +0 -0
- package/dist/web/assets/{tool-cards-7E0jtwP0.js.gz → tool-cards-72GKNSD3.js.gz} +0 -0
- package/dist/web/assets/{tools-settings-section-AChVQJyU.js → tools-settings-section-CphfnhQ9.js} +1 -1
- package/dist/web/assets/tools-settings-section-CphfnhQ9.js.br +0 -0
- package/dist/web/assets/tools-settings-section-CphfnhQ9.js.gz +0 -0
- package/dist/web/assets/{use-inline-blame-BvlcOQd9.js → use-inline-blame-CXHYEnbI.js} +1 -1
- package/dist/web/assets/use-inline-blame-CXHYEnbI.js.br +0 -0
- package/dist/web/assets/use-inline-blame-CXHYEnbI.js.gz +0 -0
- package/dist/web/assets/{use-lsp-fLNwD0BI.js → use-lsp-BnUfzZvt.js} +1 -1
- package/dist/web/assets/use-lsp-BnUfzZvt.js.br +0 -0
- package/dist/web/assets/use-lsp-BnUfzZvt.js.gz +0 -0
- package/dist/web/assets/{use-monaco-theme-CbNQ4HnC.js → use-monaco-theme-CftL7YLM.js} +1 -1
- package/dist/web/assets/{use-process-kill-B4Srjl2m.js → use-process-kill-BV2qes3Y.js} +1 -1
- package/dist/web/assets/use-process-kill-BV2qes3Y.js.br +0 -0
- package/dist/web/assets/use-process-kill-BV2qes3Y.js.gz +0 -0
- package/dist/web/assets/{use-sql-schema-info-CqISFaAW.js → use-sql-schema-info-kvFlHYFB.js} +1 -1
- package/dist/web/assets/{use-sql-schema-info-CqISFaAW.js.br → use-sql-schema-info-kvFlHYFB.js.br} +0 -0
- package/dist/web/assets/use-sql-schema-info-kvFlHYFB.js.gz +0 -0
- package/dist/web/assets/{use-websocket-DVJuWhlA.js → use-websocket-BcikOlHe.js} +1 -1
- package/dist/web/assets/{web-preview-tab-CZJAVoVU.js → web-preview-tab-DfKgQQuP.js} +1 -1
- package/dist/web/assets/web-preview-tab-DfKgQQuP.js.br +0 -0
- package/dist/web/assets/web-preview-tab-DfKgQQuP.js.gz +0 -0
- package/dist/web/index.html +1 -1
- 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/package.json +1 -1
- package/src/providers/codex-app-server/codex-history-async.ts +8 -19
- package/src/providers/codex-app-server/codex-history.ts +36 -51
- package/src/providers/codex-app-server/codex-provider.ts +1 -1
- package/src/providers/codex-app-server/codex-rollout-header.ts +40 -0
- package/src/providers/codex-app-server/codex-rollout-index.ts +145 -0
- package/src/web/components/settings/accounts/use-accounts-data.ts +38 -16
- package/dist/web/assets/accounts-settings-section-CZglHifc.js.br +0 -0
- package/dist/web/assets/accounts-settings-section-CZglHifc.js.gz +0 -0
- package/dist/web/assets/agent-session-sheet-B3VLD2H6.js.br +0 -0
- package/dist/web/assets/agent-session-sheet-B3VLD2H6.js.gz +0 -0
- package/dist/web/assets/agent-session-window-content-HEdIT_LQ.js.br +0 -0
- package/dist/web/assets/agent-session-window-content-HEdIT_LQ.js.gz +0 -0
- package/dist/web/assets/ai-resource-editor-CFbXgGMo.js.br +0 -0
- package/dist/web/assets/ai-resource-editor-CFbXgGMo.js.gz +0 -0
- package/dist/web/assets/ai-settings-section-BNiVD9D3.js.br +0 -0
- package/dist/web/assets/ai-settings-section-BNiVD9D3.js.gz +0 -0
- package/dist/web/assets/android-tab-CY3aa_vU.js.br +0 -0
- package/dist/web/assets/android-tab-CY3aa_vU.js.gz +0 -0
- package/dist/web/assets/appearance-settings-section-lbtuzecW.js.br +0 -0
- package/dist/web/assets/appearance-settings-section-lbtuzecW.js.gz +0 -0
- package/dist/web/assets/apps-panel-CF2mbvVq.js.br +0 -0
- package/dist/web/assets/apps-panel-CF2mbvVq.js.gz +0 -0
- package/dist/web/assets/branch-review-tab-CR7JnS5x.js.br +0 -0
- package/dist/web/assets/branch-review-tab-CR7JnS5x.js.gz +0 -0
- package/dist/web/assets/chat-tab-BCELq4nK.js.br +0 -0
- package/dist/web/assets/chat-tab-BCELq4nK.js.gz +0 -0
- package/dist/web/assets/chat-tab-C4aOYSea.js.br +0 -0
- package/dist/web/assets/chat-tab-C4aOYSea.js.gz +0 -0
- package/dist/web/assets/code-editor-_axJbYkP.js.br +0 -0
- package/dist/web/assets/code-editor-_axJbYkP.js.gz +0 -0
- package/dist/web/assets/codex-reset-credit-button-DJQD6NUF.js +0 -1
- package/dist/web/assets/codex-reset-credit-button-DJQD6NUF.js.br +0 -0
- package/dist/web/assets/codex-reset-credit-button-DJQD6NUF.js.gz +0 -0
- package/dist/web/assets/conflict-editor-D0AYuLKI.js.br +0 -0
- package/dist/web/assets/conflict-editor-D0AYuLKI.js.gz +0 -0
- package/dist/web/assets/connection-form-tab-C3QyUWnE.js.br +0 -0
- package/dist/web/assets/csv-preview-CmKkcz4M.js.br +0 -0
- package/dist/web/assets/csv-preview-CmKkcz4M.js.gz +0 -0
- package/dist/web/assets/db-tab-parts-BXL34wrZ.js.br +0 -0
- package/dist/web/assets/db-tab-parts-BXL34wrZ.js.gz +0 -0
- package/dist/web/assets/design-settings-section-DukfVtwP.js.br +0 -0
- package/dist/web/assets/design-settings-section-DukfVtwP.js.gz +0 -0
- package/dist/web/assets/design-tab-BoPiL2ge.js.br +0 -0
- package/dist/web/assets/design-tab-BoPiL2ge.js.gz +0 -0
- package/dist/web/assets/designs-sidebar-panel-BVTqPPzG.js.br +0 -0
- package/dist/web/assets/designs-sidebar-panel-BVTqPPzG.js.gz +0 -0
- package/dist/web/assets/diff-viewer-C86mR7vD.js.br +0 -0
- package/dist/web/assets/diff-viewer-C86mR7vD.js.gz +0 -0
- package/dist/web/assets/docx-preview-B9EhDCMi.js.br +0 -0
- package/dist/web/assets/docx-preview-B9EhDCMi.js.gz +0 -0
- package/dist/web/assets/editor-dialog-DTDsbJd6.js.br +0 -0
- package/dist/web/assets/editor-dialog-DTDsbJd6.js.gz +0 -0
- package/dist/web/assets/editor-language-service-BtrrQAS2.js.br +0 -0
- package/dist/web/assets/editor-language-service-BtrrQAS2.js.gz +0 -0
- package/dist/web/assets/explorer-body-DLaWmxri.js.br +0 -0
- package/dist/web/assets/explorer-body-DLaWmxri.js.gz +0 -0
- package/dist/web/assets/explorer-window-content-CbUIbrzL.js.br +0 -0
- package/dist/web/assets/explorer-window-content-CbUIbrzL.js.gz +0 -0
- package/dist/web/assets/extension-manager-section-BpKMyLwI.js.br +0 -0
- package/dist/web/assets/extension-manager-section-BpKMyLwI.js.gz +0 -0
- package/dist/web/assets/extension-webview-BGfyaXMI.js.br +0 -0
- package/dist/web/assets/extension-webview-BGfyaXMI.js.gz +0 -0
- package/dist/web/assets/files-settings-section-CQT9_rX2.js.br +0 -0
- package/dist/web/assets/files-settings-section-CQT9_rX2.js.gz +0 -0
- package/dist/web/assets/general-settings-section-BoQGeqBi.js.br +0 -0
- package/dist/web/assets/general-settings-section-BoQGeqBi.js.gz +0 -0
- package/dist/web/assets/git-log-panel-T8Fzn8-5.js.br +0 -0
- package/dist/web/assets/git-log-panel-T8Fzn8-5.js.gz +0 -0
- package/dist/web/assets/git-review-tab-WzuX4Ml9.js.br +0 -0
- package/dist/web/assets/git-review-tab-WzuX4Ml9.js.gz +0 -0
- package/dist/web/assets/glide-data-grid-BBzGDYvj.js.br +0 -0
- package/dist/web/assets/glide-data-grid-BBzGDYvj.js.gz +0 -0
- package/dist/web/assets/grid-save-dialog-HiqlnSky.js.br +0 -0
- package/dist/web/assets/grid-save-dialog-HiqlnSky.js.gz +0 -0
- package/dist/web/assets/group-chat-tab-URU3FCLs.js.br +0 -0
- package/dist/web/assets/group-chat-tab-URU3FCLs.js.gz +0 -0
- package/dist/web/assets/impexp-tab-B0m1Q8ia.js.br +0 -0
- package/dist/web/assets/impexp-tab-B0m1Q8ia.js.gz +0 -0
- package/dist/web/assets/index-Vd9Xr54k.js.br +0 -0
- package/dist/web/assets/index-Vd9Xr54k.js.gz +0 -0
- package/dist/web/assets/keyboard-shortcuts-section-CU7JjDsU.js.br +0 -0
- package/dist/web/assets/keyboard-shortcuts-section-CU7JjDsU.js.gz +0 -0
- package/dist/web/assets/language-servers-section-CzUG9H69.js.br +0 -0
- package/dist/web/assets/language-servers-section-CzUG9H69.js.gz +0 -0
- package/dist/web/assets/logs-app-CDSvyY1H.js.br +0 -0
- package/dist/web/assets/logs-app-CDSvyY1H.js.gz +0 -0
- package/dist/web/assets/lsp-client-CpjPUUYJ.js.br +0 -0
- package/dist/web/assets/lsp-client-CpjPUUYJ.js.gz +0 -0
- package/dist/web/assets/markdown-renderer-DZNMRg6p.js.br +0 -0
- package/dist/web/assets/markdown-renderer-DZNMRg6p.js.gz +0 -0
- package/dist/web/assets/mobile-explorer-sheet-D7e-MM6m.js.br +0 -0
- package/dist/web/assets/mobile-explorer-sheet-D7e-MM6m.js.gz +0 -0
- package/dist/web/assets/new-design-dialog-BthM423i.js.br +0 -0
- package/dist/web/assets/new-design-dialog-BthM423i.js.gz +0 -0
- package/dist/web/assets/notifications-settings-section-TS3gNFcc.js.br +0 -0
- package/dist/web/assets/notifications-settings-section-TS3gNFcc.js.gz +0 -0
- package/dist/web/assets/ppmbot-settings-section-D8jIlmp8.js.br +0 -0
- package/dist/web/assets/ppmbot-settings-section-D8jIlmp8.js.gz +0 -0
- package/dist/web/assets/problems-panel-DjCHA1r5.js.br +0 -0
- package/dist/web/assets/problems-panel-DjCHA1r5.js.gz +0 -0
- package/dist/web/assets/process-table-BxXEh4tN.js.br +0 -0
- package/dist/web/assets/process-table-BxXEh4tN.js.gz +0 -0
- package/dist/web/assets/proxy-settings-section-B8igco2L.js.br +0 -0
- package/dist/web/assets/proxy-settings-section-B8igco2L.js.gz +0 -0
- package/dist/web/assets/query-tab-DHU3ANHN.js.br +0 -0
- package/dist/web/assets/query-tab-DHU3ANHN.js.gz +0 -0
- package/dist/web/assets/remote-access-settings-section-CoYQTFKd.js.br +0 -0
- package/dist/web/assets/remote-access-settings-section-CoYQTFKd.js.gz +0 -0
- package/dist/web/assets/remote-desktop-clipboard-notice-Dwn-iV4g.js.br +0 -0
- package/dist/web/assets/remote-desktop-clipboard-notice-Dwn-iV4g.js.gz +0 -0
- package/dist/web/assets/remote-desktop-mobile-sheet-bfKiSG0C.js.br +0 -0
- package/dist/web/assets/remote-desktop-mobile-sheet-bfKiSG0C.js.gz +0 -0
- package/dist/web/assets/remote-desktop-mobile-view-CV8eHh4A.js.br +0 -0
- package/dist/web/assets/remote-desktop-mobile-view-CV8eHh4A.js.gz +0 -0
- package/dist/web/assets/remote-desktop-readiness-gate-DrSYb_9z.js.br +0 -0
- package/dist/web/assets/remote-desktop-readiness-gate-DrSYb_9z.js.gz +0 -0
- package/dist/web/assets/remote-desktop-window-content-CAuxeGbK.js.br +0 -0
- package/dist/web/assets/remote-desktop-window-content-CAuxeGbK.js.gz +0 -0
- package/dist/web/assets/rename-object-dialog-BPuh3dAH.js.br +0 -0
- package/dist/web/assets/rename-object-dialog-BPuh3dAH.js.gz +0 -0
- package/dist/web/assets/review-address-setup-CoI2BGdx.js.br +0 -0
- package/dist/web/assets/review-address-setup-CoI2BGdx.js.gz +0 -0
- package/dist/web/assets/review-code-Dy8y4_17.js.br +0 -0
- package/dist/web/assets/review-code-Dy8y4_17.js.gz +0 -0
- package/dist/web/assets/save-as-dialog-C9OpJz2x.js.br +0 -0
- package/dist/web/assets/save-as-dialog-C9OpJz2x.js.gz +0 -0
- package/dist/web/assets/schedule-script-editor--roOsFbc.js.br +0 -0
- package/dist/web/assets/schedule-script-editor--roOsFbc.js.gz +0 -0
- package/dist/web/assets/schedules-settings-section-BTn_NSzU.js.br +0 -0
- package/dist/web/assets/schedules-settings-section-BTn_NSzU.js.gz +0 -0
- package/dist/web/assets/session-review-tab-fRzyogNH.js.br +0 -0
- package/dist/web/assets/session-review-tab-fRzyogNH.js.gz +0 -0
- package/dist/web/assets/settings-body-D5pmlFft.js.br +0 -0
- package/dist/web/assets/settings-body-D5pmlFft.js.gz +0 -0
- package/dist/web/assets/settings-rows-VtjChFlm.js.br +0 -0
- package/dist/web/assets/settings-rows-VtjChFlm.js.gz +0 -0
- package/dist/web/assets/settings-section-content-BOwSlBkZ.js.br +0 -0
- package/dist/web/assets/settings-section-content-BOwSlBkZ.js.gz +0 -0
- package/dist/web/assets/slash-command-picker-BKeEykkF.js.br +0 -0
- package/dist/web/assets/slash-command-picker-BKeEykkF.js.gz +0 -0
- package/dist/web/assets/sql-object-tab-I5bl3DVf.js.br +0 -0
- package/dist/web/assets/sql-object-tab-I5bl3DVf.js.gz +0 -0
- package/dist/web/assets/sqlite-viewer-ECCCjxdn.js.br +0 -0
- package/dist/web/assets/sqlite-viewer-ECCCjxdn.js.gz +0 -0
- package/dist/web/assets/structure-save-dialog-DcQdamD3.js.br +0 -0
- package/dist/web/assets/structure-save-dialog-DcQdamD3.js.gz +0 -0
- package/dist/web/assets/structure-tab-DyQGhf9t.js.br +0 -0
- package/dist/web/assets/structure-tab-DyQGhf9t.js.gz +0 -0
- package/dist/web/assets/system-monitor-body-B5AvRT5J.js.br +0 -0
- package/dist/web/assets/system-monitor-body-B5AvRT5J.js.gz +0 -0
- package/dist/web/assets/tab-host-window-content-DqOUHxEL.js.br +0 -0
- package/dist/web/assets/tab-host-window-content-DqOUHxEL.js.gz +0 -0
- package/dist/web/assets/table-tab-dI8rBbCS.js.br +0 -0
- package/dist/web/assets/table-tab-dI8rBbCS.js.gz +0 -0
- package/dist/web/assets/telegram-bot-token-field-DSLtG8vw.js.br +0 -0
- package/dist/web/assets/telegram-bot-token-field-DSLtG8vw.js.gz +0 -0
- package/dist/web/assets/terminal-tab-CDg0AHBK.js.br +0 -0
- package/dist/web/assets/terminal-tab-CDg0AHBK.js.gz +0 -0
- package/dist/web/assets/tool-cards-7E0jtwP0.js.br +0 -0
- package/dist/web/assets/tools-settings-section-AChVQJyU.js.br +0 -0
- package/dist/web/assets/tools-settings-section-AChVQJyU.js.gz +0 -0
- package/dist/web/assets/use-inline-blame-BvlcOQd9.js.br +0 -0
- package/dist/web/assets/use-inline-blame-BvlcOQd9.js.gz +0 -0
- package/dist/web/assets/use-lsp-fLNwD0BI.js.br +0 -0
- package/dist/web/assets/use-lsp-fLNwD0BI.js.gz +0 -0
- package/dist/web/assets/use-process-kill-B4Srjl2m.js.br +0 -0
- package/dist/web/assets/use-process-kill-B4Srjl2m.js.gz +0 -0
- package/dist/web/assets/use-sql-schema-info-CqISFaAW.js.gz +0 -0
- package/dist/web/assets/web-preview-tab-CZJAVoVU.js.br +0 -0
- package/dist/web/assets/web-preview-tab-CZJAVoVU.js.gz +0 -0
|
@@ -7,7 +7,8 @@ import { getPpmDir } from "../../services/ppm-dir.ts";
|
|
|
7
7
|
import { redactTruncate } from "./codex-redact.ts";
|
|
8
8
|
import { parseApplyPatch, changeToToolUse } from "./codex-patch.ts";
|
|
9
9
|
import { mapRolloutItem } from "./codex-rollout-items.ts";
|
|
10
|
-
import { completeLines, parseLine,
|
|
10
|
+
import { completeLines, parseLine, rolloutHeaderReads, type RolloutHeader } from "./codex-rollout-header.ts";
|
|
11
|
+
import { indexedRollouts, indexedRolloutTitle } from "./codex-rollout-index.ts";
|
|
11
12
|
import {
|
|
12
13
|
finalAssistantText, subagentToolResult, subagentToolUse, transcriptToEvents,
|
|
13
14
|
type SubagentTranscript,
|
|
@@ -231,44 +232,29 @@ export function* rolloutMessageSteps(text: string, preCompactIndex?: number): Ge
|
|
|
231
232
|
return messages;
|
|
232
233
|
}
|
|
233
234
|
|
|
234
|
-
/** First read of a rollout's head: `session_meta` carries the base instructions, measured at 22–27 KB. */
|
|
235
|
-
const HEADER_FIRST_READ_BYTES = 32 * 1024;
|
|
236
|
-
|
|
237
235
|
/**
|
|
238
236
|
* Read a rollout file's header (session_meta, plus its title when asked) from as little of
|
|
239
|
-
* the file as answers it.
|
|
237
|
+
* the file as answers it — see `rolloutHeaderReads` for the slices it takes.
|
|
240
238
|
*
|
|
241
239
|
* Reading whole files here is what froze the server: identifying one rollout among thousands
|
|
242
240
|
* read every transcript in full (1.8 GB, over a second of synchronous I/O) whenever no file
|
|
243
|
-
* name matched.
|
|
244
|
-
*
|
|
245
|
-
* read never parses a partial record.
|
|
241
|
+
* name matched. This is the synchronous reader, for a single lookup; listing goes through the
|
|
242
|
+
* asynchronous index in `codex-rollout-index.ts`.
|
|
246
243
|
*/
|
|
247
244
|
export function readSessionMeta(
|
|
248
245
|
file: string,
|
|
249
|
-
opts?: { withTitle?: boolean
|
|
246
|
+
opts?: { withTitle?: boolean },
|
|
250
247
|
): RolloutHeader | null {
|
|
251
248
|
let fd: number | undefined;
|
|
252
249
|
try {
|
|
253
250
|
fd = openSync(file, "r");
|
|
254
|
-
const
|
|
255
|
-
let
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
filled += read;
|
|
260
|
-
// A file that shrank under us reads short; stop rather than wait for bytes that are gone.
|
|
261
|
-
const eof = filled >= size || read === 0;
|
|
262
|
-
const header = readRolloutHeader(buffer.toString("utf-8", 0, filled), opts);
|
|
263
|
-
// A header the caller is about to discard needs no title: most rollouts in a shared
|
|
264
|
-
// tree belong to other projects, and a title can sit megabytes in, or nowhere at all.
|
|
265
|
-
const wanted = header && (!opts?.titleIf || opts.titleIf(header));
|
|
266
|
-
const complete = header && (!opts?.withTitle || !wanted || header.title || header.parentThreadId);
|
|
267
|
-
if (complete || eof) return header;
|
|
268
|
-
const grown = Buffer.alloc(Math.min(size, buffer.length * 4));
|
|
269
|
-
buffer.copy(grown, 0, 0, filled);
|
|
270
|
-
buffer = grown;
|
|
251
|
+
const plan = rolloutHeaderReads(fstatSync(fd).size, opts);
|
|
252
|
+
let step = plan.next();
|
|
253
|
+
while (!step.done) {
|
|
254
|
+
const { buffer, offset, length, position } = step.value;
|
|
255
|
+
step = plan.next(readSync(fd, buffer, offset, length, position));
|
|
271
256
|
}
|
|
257
|
+
return step.value;
|
|
272
258
|
} catch { /* unreadable file → excluded (fail-closed) */ }
|
|
273
259
|
finally { if (fd !== undefined) closeSync(fd); }
|
|
274
260
|
return null;
|
|
@@ -304,44 +290,43 @@ function threadIdFromName(file: string): string | null {
|
|
|
304
290
|
* task never appears in its own transcript. Its work shows in the parent, on the
|
|
305
291
|
* Agent card for that spawn.
|
|
306
292
|
*/
|
|
307
|
-
export function listCodexRollouts(
|
|
293
|
+
export async function listCodexRollouts(
|
|
308
294
|
sessionsDir: string,
|
|
309
295
|
requestedCwd: string,
|
|
310
296
|
providerId: string,
|
|
311
297
|
opts?: { limit?: number; offset?: number },
|
|
312
|
-
): SessionInfo[] {
|
|
298
|
+
): Promise<SessionInfo[]> {
|
|
313
299
|
const target = normPath(requestedCwd);
|
|
314
|
-
const
|
|
315
|
-
const sessions: SessionInfo[] = [];
|
|
300
|
+
const matched: Array<{ file: string; session: SessionInfo }> = [];
|
|
316
301
|
|
|
317
|
-
for (const file of
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
});
|
|
322
|
-
if (!meta?.cwd) continue; // fail-closed: no cwd → exclude
|
|
323
|
-
if (normPath(meta.cwd) !== target) continue;
|
|
324
|
-
if (meta.parentThreadId) continue; // one step of another session, not a session
|
|
302
|
+
for (const { file, header, mtimeMs } of await indexedRollouts(sessionsDir)) {
|
|
303
|
+
if (!header?.cwd) continue; // fail-closed: no cwd → exclude
|
|
304
|
+
if (normPath(header.cwd) !== target) continue;
|
|
305
|
+
if (header.parentThreadId) continue; // one step of another session, not a session
|
|
325
306
|
|
|
326
|
-
const id =
|
|
307
|
+
const id = header.id ?? threadIdFromName(file);
|
|
327
308
|
if (!id) continue;
|
|
328
309
|
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
310
|
+
matched.push({
|
|
311
|
+
file,
|
|
312
|
+
session: {
|
|
313
|
+
id,
|
|
314
|
+
providerId,
|
|
315
|
+
title: "Codex session",
|
|
316
|
+
createdAt: header.timestamp ?? new Date().toISOString(),
|
|
317
|
+
updatedAt: new Date(mtimeMs).toISOString(),
|
|
318
|
+
},
|
|
338
319
|
});
|
|
339
320
|
}
|
|
340
321
|
|
|
341
|
-
|
|
322
|
+
matched.sort((a, b) => (b.session.updatedAt ?? "").localeCompare(a.session.updatedAt ?? ""));
|
|
342
323
|
const offset = opts?.offset ?? 0;
|
|
343
|
-
const
|
|
344
|
-
|
|
324
|
+
const page = matched.slice(offset, offset + (opts?.limit ?? matched.length));
|
|
325
|
+
// Titles only for the page: one can sit megabytes into a transcript.
|
|
326
|
+
await Promise.all(page.map(async (m) => {
|
|
327
|
+
m.session.title = (await indexedRolloutTitle(m.file)) ?? m.session.title;
|
|
328
|
+
}));
|
|
329
|
+
return page.map((m) => m.session);
|
|
345
330
|
}
|
|
346
331
|
|
|
347
332
|
/**
|
|
@@ -401,7 +401,7 @@ export class CodexAppServerProvider implements AIProvider {
|
|
|
401
401
|
const seen = new Set<string>();
|
|
402
402
|
const sessions: SessionInfo[] = [];
|
|
403
403
|
for (const sessionsDir of codexSessionsDirs()) {
|
|
404
|
-
for (const s of listCodexRollouts(sessionsDir, dir, this.id, opts)) {
|
|
404
|
+
for (const s of await listCodexRollouts(sessionsDir, dir, this.id, opts)) {
|
|
405
405
|
if (seen.has(s.id)) continue;
|
|
406
406
|
seen.add(s.id);
|
|
407
407
|
sessions.push(s);
|
|
@@ -99,3 +99,43 @@ export function readRolloutHeader(text: string, opts?: { withTitle?: boolean }):
|
|
|
99
99
|
}
|
|
100
100
|
return header;
|
|
101
101
|
}
|
|
102
|
+
|
|
103
|
+
/** First read of a rollout's head: `session_meta` carries the base instructions, measured at 22–27 KB. */
|
|
104
|
+
const HEADER_FIRST_READ_BYTES = 32 * 1024;
|
|
105
|
+
|
|
106
|
+
/** One positional read the header scan asks for; the caller answers with the bytes it got. */
|
|
107
|
+
export interface HeaderRead {
|
|
108
|
+
buffer: Buffer;
|
|
109
|
+
offset: number;
|
|
110
|
+
length: number;
|
|
111
|
+
position: number;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* The reads it takes to answer `readRolloutHeader` for a file of `size` bytes, as a plan any
|
|
116
|
+
* reader can drive — synchronously for a single lookup, asynchronously for the session list,
|
|
117
|
+
* which reads thousands of rollouts and must never hold the event loop while the disk answers.
|
|
118
|
+
*
|
|
119
|
+
* The head is read in growing slices, and a slice's unterminated last line — possibly a split
|
|
120
|
+
* multi-byte character — is dropped by `completeLines`, so a partial read never parses a
|
|
121
|
+
* partial record.
|
|
122
|
+
*/
|
|
123
|
+
export function* rolloutHeaderReads(
|
|
124
|
+
size: number,
|
|
125
|
+
opts?: { withTitle?: boolean },
|
|
126
|
+
): Generator<HeaderRead, RolloutHeader | null, number> {
|
|
127
|
+
let buffer = Buffer.alloc(Math.min(size, HEADER_FIRST_READ_BYTES));
|
|
128
|
+
let filled = 0;
|
|
129
|
+
while (true) {
|
|
130
|
+
const read = yield { buffer, offset: filled, length: buffer.length - filled, position: filled };
|
|
131
|
+
filled += read;
|
|
132
|
+
// A file that shrank under us reads short; stop rather than wait for bytes that are gone.
|
|
133
|
+
const eof = filled >= size || read === 0;
|
|
134
|
+
const header = readRolloutHeader(buffer.toString("utf-8", 0, filled), opts);
|
|
135
|
+
const complete = header && (!opts?.withTitle || header.title || header.parentThreadId);
|
|
136
|
+
if (complete || eof) return header;
|
|
137
|
+
const grown = Buffer.alloc(Math.min(size, buffer.length * 4));
|
|
138
|
+
buffer.copy(grown, 0, 0, filled);
|
|
139
|
+
buffer = grown;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The headers of every rollout in a codex sessions tree, kept between session-list requests.
|
|
3
|
+
*
|
|
4
|
+
* Listing one project's codex sessions means finding which rollouts ran in it, and a sessions
|
|
5
|
+
* tree holds every project's rollouts — on the machine this was measured on, 5,262 files and
|
|
6
|
+
* 5.4 GB across four accounts. Reading their heads synchronously on every list request froze the
|
|
7
|
+
* server for 35–90 s whenever the files had fallen out of the OS cache (10.9 s for one project,
|
|
8
|
+
* and the sidebar asks for two or three at once), which took every other request down with it.
|
|
9
|
+
*
|
|
10
|
+
* So the heads are read once and remembered, keyed by path and re-read only when the file's
|
|
11
|
+
* size or modification time moves; every read is asynchronous, so the disk is waited on by the
|
|
12
|
+
* thread pool rather than by the event loop; and concurrent callers share one pass over a tree.
|
|
13
|
+
*
|
|
14
|
+
* A rollout's head never changes once written — codex appends — so a file that grew keeps the
|
|
15
|
+
* header already read for it unless that header was still missing its title.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { open, readdir, stat } from "node:fs/promises";
|
|
19
|
+
import { join, sep } from "node:path";
|
|
20
|
+
import { rolloutHeaderReads, type RolloutHeader } from "./codex-rollout-header.ts";
|
|
21
|
+
|
|
22
|
+
export interface IndexedRollout {
|
|
23
|
+
file: string;
|
|
24
|
+
header: RolloutHeader | null;
|
|
25
|
+
/** Last modification, which is the session's last activity. */
|
|
26
|
+
mtimeMs: number;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
interface Entry {
|
|
30
|
+
size: number;
|
|
31
|
+
mtimeMs: number;
|
|
32
|
+
header: RolloutHeader | null;
|
|
33
|
+
/** Whether `header.title` has been looked for — it is read only for sessions someone lists. */
|
|
34
|
+
titled: boolean;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** Files read at once. Enough to keep a disk busy without holding thousands of handles. */
|
|
38
|
+
const READ_CONCURRENCY = 16;
|
|
39
|
+
|
|
40
|
+
const entries = new Map<string, Entry>();
|
|
41
|
+
const passes = new Map<string, Promise<IndexedRollout[]>>();
|
|
42
|
+
|
|
43
|
+
/** Every `rollout-*.jsonl` under `dir`, without ever blocking on the disk. */
|
|
44
|
+
export async function listRolloutFiles(dir: string): Promise<string[]> {
|
|
45
|
+
const files: string[] = [];
|
|
46
|
+
let found;
|
|
47
|
+
try { found = await readdir(dir, { withFileTypes: true }); } catch { return files; }
|
|
48
|
+
for (const entry of found) {
|
|
49
|
+
const path = join(dir, entry.name);
|
|
50
|
+
if (entry.isDirectory()) files.push(...await listRolloutFiles(path));
|
|
51
|
+
else if (entry.isFile() && /^rollout-.*\.jsonl$/.test(entry.name)) files.push(path);
|
|
52
|
+
}
|
|
53
|
+
return files;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** `readSessionMeta`, asynchronously: the same slices, read by the thread pool. */
|
|
57
|
+
export async function readRolloutHeaderAsync(
|
|
58
|
+
file: string,
|
|
59
|
+
opts?: { withTitle?: boolean },
|
|
60
|
+
): Promise<RolloutHeader | null> {
|
|
61
|
+
let handle;
|
|
62
|
+
try {
|
|
63
|
+
handle = await open(file, "r");
|
|
64
|
+
const plan = rolloutHeaderReads((await handle.stat()).size, opts);
|
|
65
|
+
let step = plan.next();
|
|
66
|
+
while (!step.done) {
|
|
67
|
+
const { buffer, offset, length, position } = step.value;
|
|
68
|
+
step = plan.next((await handle.read(buffer, offset, length, position)).bytesRead);
|
|
69
|
+
}
|
|
70
|
+
return step.value;
|
|
71
|
+
} catch {
|
|
72
|
+
return null; // unreadable → excluded, fail-closed like every other rollout read
|
|
73
|
+
} finally {
|
|
74
|
+
await handle?.close().catch(() => {});
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
async function refresh(file: string): Promise<IndexedRollout | null> {
|
|
79
|
+
let stamp;
|
|
80
|
+
try { stamp = await stat(file); } catch { entries.delete(file); return null; }
|
|
81
|
+
const known = entries.get(file);
|
|
82
|
+
if (known && known.size === stamp.size && known.mtimeMs === stamp.mtimeMs) {
|
|
83
|
+
return { file, header: known.header, mtimeMs: known.mtimeMs };
|
|
84
|
+
}
|
|
85
|
+
// Appended to since it was read: the head is the same, so only a header that is still
|
|
86
|
+
// waiting for its title — or was never readable — needs reading again.
|
|
87
|
+
if (known?.header && stamp.size >= known.size && (!known.titled || known.header.title)) {
|
|
88
|
+
known.size = stamp.size;
|
|
89
|
+
known.mtimeMs = stamp.mtimeMs;
|
|
90
|
+
return { file, header: known.header, mtimeMs: known.mtimeMs };
|
|
91
|
+
}
|
|
92
|
+
const header = await readRolloutHeaderAsync(file);
|
|
93
|
+
entries.set(file, { size: stamp.size, mtimeMs: stamp.mtimeMs, header, titled: false });
|
|
94
|
+
return { file, header, mtimeMs: stamp.mtimeMs };
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
async function indexTree(dir: string): Promise<IndexedRollout[]> {
|
|
98
|
+
const files = await listRolloutFiles(dir);
|
|
99
|
+
const present = new Set(files);
|
|
100
|
+
const root = join(dir, sep);
|
|
101
|
+
for (const file of entries.keys()) {
|
|
102
|
+
if (file.startsWith(root) && !present.has(file)) entries.delete(file);
|
|
103
|
+
}
|
|
104
|
+
const out: IndexedRollout[] = [];
|
|
105
|
+
let next = 0;
|
|
106
|
+
async function worker() {
|
|
107
|
+
while (next < files.length) {
|
|
108
|
+
const found = await refresh(files[next++]!);
|
|
109
|
+
if (found) out.push(found);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
await Promise.all(Array.from({ length: Math.min(READ_CONCURRENCY, files.length) }, worker));
|
|
113
|
+
return out;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Every rollout under `dir` with its header. Callers arriving while a pass over the same tree
|
|
118
|
+
* is running get that pass rather than starting a second one.
|
|
119
|
+
*/
|
|
120
|
+
export function indexedRollouts(dir: string): Promise<IndexedRollout[]> {
|
|
121
|
+
const running = passes.get(dir);
|
|
122
|
+
if (running) return running;
|
|
123
|
+
const pass = indexTree(dir).finally(() => passes.delete(dir));
|
|
124
|
+
passes.set(dir, pass);
|
|
125
|
+
return pass;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* The opening prompt of a rollout already indexed, read on first ask and remembered. Only the
|
|
130
|
+
* sessions on the page being listed are asked for: a title can sit megabytes into a file.
|
|
131
|
+
*/
|
|
132
|
+
export async function indexedRolloutTitle(file: string): Promise<string | undefined> {
|
|
133
|
+
const entry = entries.get(file);
|
|
134
|
+
if (!entry?.header) return undefined;
|
|
135
|
+
if (entry.titled) return entry.header.title;
|
|
136
|
+
const header = await readRolloutHeaderAsync(file, { withTitle: true });
|
|
137
|
+
if (header) entry.header = header;
|
|
138
|
+
entry.titled = true;
|
|
139
|
+
return entry.header.title;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/** Forget everything indexed. For tests, which write fixtures into reused paths. */
|
|
143
|
+
export function clearRolloutIndex(): void {
|
|
144
|
+
entries.clear();
|
|
145
|
+
}
|
|
@@ -2,8 +2,13 @@
|
|
|
2
2
|
* Loads the three things the accounts pane needs — usages, account records, and which
|
|
3
3
|
* account is active — and tracks which accounts' numbers just changed.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
* upstream API) must not blank the whole pane
|
|
5
|
+
* Each result is applied the moment it lands, on its own: one endpoint failing (usage often
|
|
6
|
+
* does, it depends on an upstream API) must not blank the whole pane, and one that is slow must
|
|
7
|
+
* not hold back the two that answered.
|
|
8
|
+
*
|
|
9
|
+
* The last answer is kept for the next mount. The chat's usage panel is mounted afresh on every
|
|
10
|
+
* open, so without it the panel opened on "Loading..." every time — and stayed there for as long
|
|
11
|
+
* as the server took, which while the server was stalled meant most of a minute.
|
|
7
12
|
*/
|
|
8
13
|
|
|
9
14
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
@@ -28,6 +33,17 @@ export interface AccountsData {
|
|
|
28
33
|
togglingId: string | null;
|
|
29
34
|
}
|
|
30
35
|
|
|
36
|
+
/** What the last load answered, shown straight away by the next component to mount. */
|
|
37
|
+
const lastLoaded: { usages: AccountUsageEntry[] | null; accounts: AccountInfo[]; activeAccountId: string | null } = {
|
|
38
|
+
usages: null, accounts: [], activeAccountId: null,
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* How long a load shows itself as loading. A request still out after this is not abandoned —
|
|
43
|
+
* it lands when it lands — but the panel stops claiming to load and shows what it has.
|
|
44
|
+
*/
|
|
45
|
+
const LOAD_WAIT_MS = 10_000;
|
|
46
|
+
|
|
31
47
|
/** Utilisation across all four buckets, as a comparable string. */
|
|
32
48
|
function utilisationKey(entry: AccountUsageEntry): string {
|
|
33
49
|
const u = entry.usage;
|
|
@@ -38,14 +54,14 @@ function utilisationKey(entry: AccountUsageEntry): string {
|
|
|
38
54
|
}
|
|
39
55
|
|
|
40
56
|
export function useAccountsData(enabled = true): AccountsData {
|
|
41
|
-
const [usages, setUsages] = useState<AccountUsageEntry[]>([]);
|
|
42
|
-
const [accounts, setAccounts] = useState<AccountInfo[]>(
|
|
43
|
-
const [activeAccountId, setActiveAccountId] = useState<string | null>(
|
|
44
|
-
const [initialLoading, setInitialLoading] = useState(
|
|
57
|
+
const [usages, setUsages] = useState<AccountUsageEntry[]>(() => lastLoaded.usages ?? []);
|
|
58
|
+
const [accounts, setAccounts] = useState<AccountInfo[]>(() => lastLoaded.accounts);
|
|
59
|
+
const [activeAccountId, setActiveAccountId] = useState<string | null>(() => lastLoaded.activeAccountId);
|
|
60
|
+
const [initialLoading, setInitialLoading] = useState(() => lastLoaded.usages === null);
|
|
45
61
|
const [refreshing, setRefreshing] = useState(false);
|
|
46
62
|
const [flashIds, setFlashIds] = useState<Set<string>>(new Set());
|
|
47
63
|
const [togglingId, setTogglingId] = useState<string | null>(null);
|
|
48
|
-
const prevUsages = useRef<AccountUsageEntry[]>([]);
|
|
64
|
+
const prevUsages = useRef<AccountUsageEntry[]>(lastLoaded.usages ?? []);
|
|
49
65
|
const flashTimer = useRef<ReturnType<typeof setTimeout>>(undefined);
|
|
50
66
|
|
|
51
67
|
const reload = useCallback(async () => {
|
|
@@ -53,12 +69,7 @@ export function useAccountsData(enabled = true): AccountsData {
|
|
|
53
69
|
if (isRefresh) setRefreshing(true);
|
|
54
70
|
else setInitialLoading(true);
|
|
55
71
|
|
|
56
|
-
const
|
|
57
|
-
getAllAccountUsages(), getAccounts(), getActiveAccount(),
|
|
58
|
-
]);
|
|
59
|
-
|
|
60
|
-
if (u.status === "fulfilled") {
|
|
61
|
-
const next = u.value;
|
|
72
|
+
const applyUsages = (next: AccountUsageEntry[]) => {
|
|
62
73
|
if (isRefresh) {
|
|
63
74
|
const before = new Map(prevUsages.current.map((e) => [e.accountId, utilisationKey(e)]));
|
|
64
75
|
const changed = new Set(
|
|
@@ -71,10 +82,21 @@ export function useAccountsData(enabled = true): AccountsData {
|
|
|
71
82
|
}
|
|
72
83
|
}
|
|
73
84
|
prevUsages.current = next;
|
|
85
|
+
lastLoaded.usages = next;
|
|
74
86
|
setUsages(next);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
const landed = Promise.all([
|
|
90
|
+
getAllAccountUsages().then(applyUsages),
|
|
91
|
+
getAccounts().then((a) => { lastLoaded.accounts = a; setAccounts(a); }),
|
|
92
|
+
getActiveAccount().then((active) => {
|
|
93
|
+
lastLoaded.activeAccountId = active?.id ?? null;
|
|
94
|
+
setActiveAccountId(lastLoaded.activeAccountId);
|
|
95
|
+
}),
|
|
96
|
+
].map((p) => p.catch(() => {})));
|
|
97
|
+
let waited: ReturnType<typeof setTimeout> | undefined;
|
|
98
|
+
await Promise.race([landed, new Promise<void>((done) => { waited = setTimeout(done, LOAD_WAIT_MS); })]);
|
|
99
|
+
clearTimeout(waited);
|
|
78
100
|
|
|
79
101
|
setInitialLoading(false);
|
|
80
102
|
setRefreshing(false);
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-C-P1aR4p.js";import{J as r,Kr as i,Rn as a,_t as o,gr as s,gt as c,hr as l,ht as u,li as d,ln as f,tr as p,xn as m}from"./icons-C1wDt09O.js";import{a as h,n as g,r as _}from"./api-client-BnYFnEfK.js";import{n as v}from"./use-is-mobile-CL2I7hLf.js";import{t as y}from"./button-BHGVTbam.js";import{a as b,i as x,n as S,o as C,r as w,t as T}from"./dialog-DnE192fh.js";import{t as E}from"./mobile-bottom-sheet-M9pZptfh.js";import{t as D}from"./input-CReAuQTF.js";import{Mr as O,Qn as k,Xi as A,Yi as j,Zi as M}from"./index-Vd9Xr54k.js";import{c as N,h as P,i as F,l as I,s as L,t as R,u as z}from"./api-settings-BPIlTiBi.js";function B(e){return e>=90?`text-error`:e>=70?`text-warning`:`text-success`}function V(e){return e>=90?`bg-error`:e>=70?`bg-warning`:`bg-success`}function H(e){if(!e)return null;let t=null;if(e.resetsInMinutes!=null)t=e.resetsInMinutes;else if(e.resetsInHours!=null)t=Math.round(e.resetsInHours*60);else if(e.resetsAt){let n=new Date(e.resetsAt).getTime()-Date.now();t=n>0?Math.ceil(n/6e4):0}if(t==null)return null;if(t<=0)return`now`;let n=Math.floor(t/1440),r=Math.floor(t%1440/60),i=t%60;return n>0?i>0?`${n}d ${r}h ${i}m`:r>0?`${n}d ${r}h`:`${n}d`:r>0?i>0?`${r}h ${i}m`:`${r}h`:`${i}m`}function U(e){if(!e)return null;let t=new Date(e).getTime();return Number.isFinite(t)?new Date(t).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`}):null}function W(e){let t=e-Date.now();if(t<=0)return`expired`;let n=Math.ceil(t/6e4),r=Math.floor(n/60),i=Math.floor(r/24);return i>0?`${i}d ${r%24}h`:r>0?`${r}h ${n%60}m`:`${n}m`}function G(e){if(!e)return{label:`unknown`,tip:`No account info available`,color:`text-text-subtle`};if(!e.expiresAt)return{label:`key`,tip:`API key (no expiry)`,color:`text-text-subtle`};if(e.reauthRequired)return{label:`sign in again`,tip:`Anthropic rejected this account's refresh token. Sign in again to restore it.`,color:`text-error`};let t=e.expiresAt*1e3<Date.now();return t&&e.hasRefreshToken?{label:`expired`,tip:`Token expired but has refresh token — will auto-renew`,color:`text-warning`}:t?{label:`expired`,tip:`Token expired, no refresh token`,color:`text-error`}:e.hasRefreshToken?{label:`long-lived`,tip:`OAuth token with refresh — long-lived`,color:`text-success`}:{label:`temp`,tip:`Temporary token without refresh — will expire`,color:`text-warning`}}function K(e){if(!e)return null;let t=Math.round((Date.now()-e)/1e3);if(t<5)return`just now`;if(t<60)return`${t}s ago`;let n=Math.floor(t/60);if(n<60)return`${n}m ago`;let r=Math.floor(n/60),i=n%60;return r<24?i>0?`${r}h ${i}m ago`:`${r}h ago`:`${Math.floor(r/24)}d ago`}var q=n();function J({label:e,pct:t,reset:n,resetsAt:r}){let i=U(r);return(0,q.jsxs)(`div`,{className:`space-y-1`,"data-testid":`account-usage-bar`,children:[(0,q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,q.jsx)(`span`,{className:`text-xs font-medium text-text-primary`,children:e}),n&&(0,q.jsxs)(j,{children:[(0,q.jsx)(M,{asChild:!0,children:(0,q.jsxs)(`span`,{className:`text-[10px] text-text-subtle cursor-default`,children:[`↻ `,n]})}),(0,q.jsx)(A,{side:`top`,children:i?`Resets ${i}`:`Resets in`})]})]}),(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(`div`,{className:`flex-1 h-2 rounded-full bg-border overflow-hidden`,children:t!=null&&(0,q.jsx)(`div`,{className:`h-full rounded-full transition-all ${V(t)}`,style:{width:`${Math.min(t,100)}%`}})}),(0,q.jsx)(`span`,{className:`text-xs font-medium tabular-nums w-10 text-right ${t==null?`text-text-subtle`:B(t)}`,children:t==null?`—`:`${t}%`})]})]})}function Y({label:e,bucket:t}){return t?(0,q.jsx)(J,{label:e,pct:Math.round(t.utilization*100),reset:H(t),resetsAt:t.resetsAt}):null}function X({hint:e,className:t,children:n,onClick:r}){return(0,q.jsxs)(j,{children:[(0,q.jsx)(M,{asChild:!0,children:(0,q.jsx)(`button`,{type:`button`,onClick:r,className:[r?`relative cursor-pointer rounded px-1 -mx-1 underline decoration-dotted underline-offset-2 hover:bg-error/10 after:absolute after:-inset-x-2 after:-inset-y-3 after:content-['']`:`cursor-help`,`text-left`,t].filter(Boolean).join(` `),children:n})}),(0,q.jsx)(A,{side:`top`,className:`max-w-[260px] text-xs leading-relaxed`,children:e})]})}function Z({description:e,onRefresh:t,refreshing:n,disabled:r,actions:i}){return(0,q.jsxs)(`section`,{className:`space-y-2`,children:[(0,q.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e}),(0,q.jsx)(y,{variant:`ghost`,size:`icon`,className:`size-8 shrink-0 cursor-pointer`,onClick:t,disabled:r||n,title:`Refresh`,"aria-label":`Refresh accounts`,children:(0,q.jsx)(l,{className:`size-4 ${n?`animate-spin`:``}`})})]}),(0,q.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:i})]})}function ee({message:e,onDismiss:t}){return e?(0,q.jsxs)(`div`,{className:`flex items-start gap-2 text-xs p-2 rounded bg-muted`,role:`status`,children:[(0,q.jsx)(`span`,{className:`flex-1`,children:e}),(0,q.jsx)(`button`,{onClick:t,className:`shrink-0 text-muted-foreground hover:text-foreground cursor-pointer`,"aria-label":`Dismiss message`,children:(0,q.jsx)(d,{className:`size-3.5`})})]}):null}function Q({children:e}){return(0,q.jsx)(`div`,{className:`flex gap-2 overflow-x-auto pb-1 -mx-1 px-1 snap-x snap-mandatory scrollbar-thin`,children:e})}function te({active:e,flash:t,dense:n,children:r,...i}){return(0,q.jsx)(`div`,{...i,className:[`rounded-md border transition-colors duration-500`,n?`p-2.5 space-y-1.5`:`p-3 space-y-2`,t?`bg-primary/10 border-primary/40`:``,e?`border-primary/30 bg-primary/5`:`border-border/50`,i.className??``].filter(Boolean).join(` `),children:r})}function ne({buckets:e}){return e?.length?(0,q.jsx)(q.Fragment,{children:e.map(e=>(0,q.jsx)(Y,{label:`Weekly (${e.label})`,bucket:e},e.label))}):null}function re(e){return new Date(e).toLocaleDateString(void 0,{day:`numeric`,month:`short`})}function ie({credits:e}){if(!e)return null;let t=e.available,n=t===0?`No free resets`:`${t} free reset${t===1?``:`s`}`,r=t===0?`Codex has no free rate-limit resets left for this account.`:`Codex has granted this account ${t} free rate-limit reset${t===1?``:`s`}${e.title?` (${e.title})`:``}.${e.nextExpiresAt?` The next one expires on ${new Date(e.nextExpiresAt).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`})}.`:``} A "Use reset" button appears here once a limit is reached; a reset moves the weekly reset date, so spending one earlier wastes it.`;return(0,q.jsxs)(X,{className:`inline-flex items-center gap-1 ${t>0?`text-primary`:``}`,hint:r,children:[(0,q.jsx)(s,{className:`size-3 shrink-0`,"aria-hidden":!0}),n,t>0&&e.nextExpiresAt&&(0,q.jsxs)(`span`,{className:`text-text-subtle`,children:[`· until `,re(e.nextExpiresAt)]})]})}var ae={readOnly:`min-w-[220px]`,withActions:`min-w-[330px]`};function oe({entry:e,isActive:t,accountInfo:n,onToggle:a,toggling:s,onDelete:c,onRename:d,onExport:m,onViewProfile:h,flash:g,onSelect:_,unselectableReason:v,selecting:y,planLabel:b,dailyGuard:x,onDailyGuardToggle:S,dailyGuardToggling:C,reauthHint:w,onReauth:T,resetCredits:E,resetCreditAction:D,layout:O=`list`}){let{usage:N}=e,P=N.session||N.weekly||N.weeklyOpus||N.weeklySonnet||N.weeklyScoped?.length,F=n?.status??e.accountStatus,I=!!(n&&!n.hasRefreshToken&&n.expiresAt&&n.expiresAt<Math.floor(Date.now()/1e3)),L=G(n),R=!!n?.reauthRequired||!!w,z=n?.grantExpiresAt?n.grantExpiresAt*1e3:null,B=!!z&&z-Date.now()<5*864e5,V=!!n&&(L.label===`temp`||L.label===`unknown`||L.label===`expired`&&!I&&!R),H=z?new Date(z).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`}):null,U=!!(a||c||d||m||h),J=I?`Token expired — sign in again`:R?`Sign in again to use this account`:v??null,Z=O===`list`?``:O===`grid`?`flex flex-col justify-evenly overflow-hidden min-h-0`:`shrink-0 snap-start ${U?ae.withActions:ae.readOnly}`;return(0,q.jsxs)(te,{active:t,flash:g,dense:O!==`list`,className:[Z,I||R?`opacity-50`:``].filter(Boolean).join(` `)||void 0,"data-testid":`account-card`,"data-account-id":e.accountId,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(`span`,{className:`text-sm font-medium truncate flex-1 min-w-0`,children:e.accountLabel??e.accountId.slice(0,8)}),t&&(0,q.jsx)(X,{className:`text-[10px] text-primary shrink-0 font-medium`,hint:`The next turn will run on this account.`,children:`Active`}),_&&!t&&(0,q.jsxs)(j,{children:[(0,q.jsx)(M,{asChild:!0,children:(0,q.jsx)(`button`,{type:`button`,onClick:()=>_(e.accountId),disabled:y,className:[`shrink-0 rounded px-1.5 py-0.5 text-[10px] font-medium transition-colors cursor-pointer disabled:cursor-wait`,J?`text-text-subtle hover:text-error hover:bg-error/10`:`text-text-secondary hover:text-foreground hover:bg-surface-elevated`].join(` `),children:y?`Switching…`:`Use`})}),(0,q.jsx)(A,{side:`top`,children:J??`Use this account for this chat`})]}),I&&(0,q.jsx)(X,{className:`text-[10px] text-error shrink-0 font-medium`,hint:`This token has expired and carries no refresh token, so nothing can renew it. Sign in again to replace it.`,onClick:T?()=>T(e.accountId):void 0,children:`Expired`}),R&&!I&&(0,q.jsx)(X,{className:`text-[10px] text-error shrink-0 font-medium`,hint:w??`Anthropic rejected this account's refresh token, so no turn can run on it. Signing in again is the only thing that restores it.`,onClick:T?()=>T(e.accountId):void 0,children:`Sign in again`}),!e.isOAuth&&!I&&(0,q.jsx)(X,{className:`text-[10px] text-text-subtle shrink-0`,hint:`A static API key rather than a sign-in: nothing to expire and nothing to renew.`,children:`API key`}),b&&(0,q.jsx)(X,{className:`text-[10px] uppercase tracking-wide text-text-subtle shrink-0`,hint:`The subscription this account is on. It decides which quota windows the account has — some plans have a weekly limit and no shorter one.`,children:b}),(0,q.jsxs)(`div`,{className:`flex items-center gap-0.5 shrink-0`,children:[d&&(0,q.jsxs)(j,{children:[(0,q.jsx)(M,{asChild:!0,children:(0,q.jsx)(`button`,{className:`p-2 rounded cursor-pointer text-text-subtle hover:text-foreground hover:bg-surface-elevated transition-colors`,onClick:()=>d(e.accountId,e.accountLabel??``),"aria-label":`Rename account`,children:(0,q.jsx)(p,{className:`size-4`})})}),(0,q.jsx)(A,{side:`top`,children:`Rename account`})]}),!I&&h&&n?.profileData&&(0,q.jsxs)(j,{children:[(0,q.jsx)(M,{asChild:!0,children:(0,q.jsx)(`button`,{className:`p-2 rounded cursor-pointer text-text-subtle hover:text-foreground hover:bg-surface-elevated transition-colors`,onClick:()=>h(n.profileData,e.accountId),"aria-label":`View profile`,children:(0,q.jsx)(o,{className:`size-4`})})}),(0,q.jsx)(A,{side:`top`,children:`View profile`})]}),!I&&m&&e.isOAuth&&(0,q.jsxs)(j,{children:[(0,q.jsx)(M,{asChild:!0,children:(0,q.jsx)(`button`,{className:`p-2 rounded cursor-pointer text-text-subtle hover:text-primary hover:bg-surface-elevated transition-colors`,onClick:()=>m(e.accountId),"aria-label":`Export this account`,children:(0,q.jsx)(u,{className:`size-4`})})}),(0,q.jsx)(A,{side:`top`,children:`Export this account`})]}),!I&&a&&(0,q.jsx)(k,{checked:F!==`disabled`,onCheckedChange:()=>a(e.accountId,F),disabled:s||F===`cooldown`,"aria-label":F===`disabled`?`Enable account`:`Disable account`,className:`cursor-pointer relative before:absolute before:content-[''] before:-inset-y-3 before:-inset-x-0.5`}),c&&(0,q.jsxs)(j,{children:[(0,q.jsx)(M,{asChild:!0,children:(0,q.jsx)(`button`,{className:`p-2 rounded cursor-pointer text-text-subtle hover:text-error hover:bg-surface-elevated transition-colors`,onClick:()=>c(e.accountId,e.accountLabel??e.accountId.slice(0,8)),"aria-label":`Remove account`,children:(0,q.jsx)(i,{className:`size-4`})})}),(0,q.jsx)(A,{side:`top`,children:`Remove account`})]})]})]}),P?(0,q.jsxs)(`div`,{className:`space-y-2`,children:[(0,q.jsx)(Y,{label:`5-Hour Session`,bucket:N.session}),(0,q.jsx)(Y,{label:`Weekly`,bucket:N.weekly}),(0,q.jsx)(Y,{label:`Weekly (Opus)`,bucket:N.weeklyOpus}),(0,q.jsx)(Y,{label:`Weekly (Sonnet)`,bucket:N.weeklySonnet}),(0,q.jsx)(ne,{buckets:N.weeklyScoped})]}):(0,q.jsx)(`p`,{className:`text-xs text-text-subtle`,children:e.isOAuth?`No usage data yet`:`Usage tracking not available for API keys`}),x&&(0,q.jsxs)(`div`,{className:`flex min-h-12 items-center justify-between gap-3 rounded-md border px-2.5 py-1.5 ${x.enabled&&x.state.blocked?`border-error/40 bg-error/5`:`border-border/50 bg-surface/40`}`,children:[(0,q.jsxs)(`div`,{className:`min-w-0 space-y-0.5`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-medium ${x.enabled&&x.state.blocked?`text-error`:`text-text-secondary`}`,children:[(0,q.jsx)(`span`,{children:`Daily guard`}),(0,q.jsxs)(j,{children:[(0,q.jsx)(M,{asChild:!0,children:(0,q.jsx)(`button`,{type:`button`,"aria-label":`About Daily guard`,className:`text-text-subtle hover:text-text-primary cursor-help`,children:(0,q.jsx)(r,{className:`size-3.5`})})}),(0,q.jsx)(A,{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.`})]})]}),(0,q.jsx)(`p`,{className:`text-[10px] tabular-nums ${x.enabled&&x.state.blocked?`text-error`:`text-text-subtle`}`,children:x.enabled&&x.state.blocked?`${Math.round(x.state.used*100)}% used / ${Math.round(x.state.cap*100)}% daily cap. New turns paused.`:`Weekday ${x.state.day}/5, ${Math.round(x.state.cap*100)}% daily cap`})]}),S&&(0,q.jsx)(k,{checked:x.enabled,onCheckedChange:S,disabled:C,"aria-label":x.enabled?`Disable Daily guard`:`Enable Daily guard`,className:`cursor-pointer shrink-0`})]}),(0,q.jsxs)(`div`,{className:`flex items-center gap-2 text-[10px] text-text-subtle flex-wrap`,children:[(0,q.jsx)(ie,{credits:E}),D,N.lastFetchedAt&&(0,q.jsxs)(X,{className:`inline-flex items-center gap-1`,hint:`Usage last read from Anthropic on ${new Date(N.lastFetchedAt).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`})}. The bars above are only as current as this.`,children:[(0,q.jsx)(l,{className:`size-3 shrink-0`,"aria-hidden":!0}),K(new Date(N.lastFetchedAt).getTime())]}),z&&!R&&(0,q.jsxs)(X,{className:[`inline-flex items-center gap-1`,B?`text-warning`:``].filter(Boolean).join(` `),hint:`Sign-in stops working on ${H}. Anthropic ends every sign-in on a fixed schedule from the day it was made, whether or not the account gets used — refreshing does not extend it. After that the account fails until you sign in again.`,children:[(0,q.jsx)(f,{className:`size-3 shrink-0`,"aria-hidden":!0}),`sign-in `,W(z)]}),V&&(0,q.jsxs)(X,{className:L.color,hint:L.tip,children:[`© `,L.label]})]})]})}var $=e(t(),1);function se(e){let t=e.usage;return[t.session?.utilization,t.weekly?.utilization,t.weeklyOpus?.utilization,t.weeklySonnet?.utilization,...(t.weeklyScoped??[]).map(e=>`${e.label}:${e.utilization}`)].join(`|`)}function ce(e=!0){let[t,n]=(0,$.useState)([]),[r,i]=(0,$.useState)([]),[a,o]=(0,$.useState)(null),[s,c]=(0,$.useState)(!0),[l,u]=(0,$.useState)(!1),[d,f]=(0,$.useState)(new Set),[p,m]=(0,$.useState)(null),h=(0,$.useRef)([]),g=(0,$.useRef)(void 0),_=(0,$.useCallback)(async()=>{let e=h.current.length>0;e?u(!0):c(!0);let[t,r,a]=await Promise.allSettled([I(),L(),N()]);if(t.status===`fulfilled`){let r=t.value;if(e){let e=new Map(h.current.map(e=>[e.accountId,se(e)])),t=new Set(r.filter(t=>e.get(t.accountId)!==se(t)).map(e=>e.accountId));t.size>0&&(f(t),clearTimeout(g.current),g.current=setTimeout(()=>f(new Set),1500))}h.current=r,n(r)}r.status===`fulfilled`&&i(r.value),a.status===`fulfilled`&&o(a.value?.id??null),c(!1),u(!1)},[]),v=(0,$.useCallback)(async(e,t)=>{m(e);let n=null;try{await P(e,{status:t===`disabled`?`active`:`disabled`})}catch(e){n=e.message}return m(null),await _(),n},[_]);return(0,$.useEffect)(()=>(e&&_(),()=>clearTimeout(g.current)),[e,_]),{usages:t,accounts:r,activeAccountId:a,initialLoading:s,refreshing:l,flashIds:d,reload:_,toggle:v,togglingId:p}}function le({open:e,onOpenChange:t,onSuccess:n,signInAgainFor:r}){let[i,a]=(0,$.useState)(``),[o,s]=(0,$.useState)(``),[c,l]=(0,$.useState)(!1),[u,d]=(0,$.useState)(null),[f,p]=(0,$.useState)(null),[h,_]=(0,$.useState)(``),[v,E]=(0,$.useState)(!1),[k,A]=(0,$.useState)(`idle`);function j(){p(null),_(``),A(`idle`),d(null)}function M(){t(!1),j(),a(``),s(``),d(null)}async function N(){E(!0),d(null);try{let{url:e,state:t}=await z();p(t),A(`waiting`),window.open(e,`_blank`)}catch(e){d(e.message)}E(!1)}async function P(){if(!(!h.trim()||!f)){E(!0),d(null);try{let e=await F(h.trim(),f);M(),r&&e&&e.id!==r.id?n(`Signed in to ${e.email||e.label||e.id.slice(0,8)}, not ${r.label}. ${r.label} is still signed out — click "Sign in again" on it to fix it.`):n(e?.status===`disabled`?`Signed in. This account is still disabled — enable it to use it.`:`Account connected via OAuth!`)}catch(e){e instanceof g&&e.status===410&&j(),d(e.message)}E(!1)}}async function I(){if(i.trim()){l(!0),d(null);try{let e=await R({apiKey:i.trim(),label:o.trim()||void 0});M(),n(e?.status===`disabled`?`Token updated. This account is still disabled — enable it to use it.`:`Account added!`)}catch(e){d(e.message)}l(!1)}}let L=i.trim()?i.trim().startsWith(`sk-ant-oat`)?`OAuth token (Claude Max/Pro)`:i.trim().startsWith(`sk-ant-api`)?`API key`:`Unknown format`:``;return(0,q.jsx)(T,{open:e,onOpenChange:e=>{e||M()},children:(0,q.jsxs)(S,{className:`sm:max-w-md`,children:[(0,q.jsxs)(b,{children:[(0,q.jsx)(C,{className:`text-sm`,children:r?`Sign in again — ${r.label}`:`Add Claude Account`}),(0,q.jsx)(w,{className:`text-xs leading-relaxed`,children:r?`Log in with the same Claude account. PPM matches it by email and renews the existing card instead of adding a new one.`:`Connect via OAuth (recommended) or paste a token manually.`})]}),(0,q.jsxs)(`div`,{className:`space-y-3`,children:[(0,q.jsxs)(`div`,{className:`rounded-md border p-3 space-y-2`,children:[(0,q.jsx)(`p`,{className:`text-[11px] font-medium`,children:`Recommended: Login with Claude`}),k===`idle`?(0,q.jsx)(y,{size:`sm`,className:`w-full h-8 text-xs`,onClick:N,disabled:v,children:v?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(m,{className:`size-3 animate-spin mr-1`}),` Opening...`]}):`Login with Claude`}):(0,q.jsxs)(`div`,{className:`space-y-2`,children:[(0,q.jsx)(`p`,{className:`text-[10px] text-muted-foreground`,children:`Authorize in the opened tab, then paste the code:`}),(0,q.jsx)(D,{placeholder:`Paste code here...`,value:h,onChange:e=>_(e.target.value),className:`text-xs h-8 font-mono`,autoFocus:!0}),(0,q.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,q.jsx)(y,{size:`sm`,className:`flex-1 h-7 text-xs`,onClick:P,disabled:!h.trim()||v,children:v?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(m,{className:`size-3 animate-spin mr-1`}),` Connecting...`]}):`Connect`}),(0,q.jsx)(y,{size:`sm`,variant:`ghost`,className:`h-7 text-xs`,onClick:j,children:`Cancel`})]})]})]}),(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(`div`,{className:`flex-1 border-t`}),(0,q.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:`or paste token`}),(0,q.jsx)(`div`,{className:`flex-1 border-t`})]}),(0,q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,q.jsx)(O,{htmlFor:`add-token`,className:`text-xs`,children:`Token`}),(0,q.jsx)(D,{id:`add-token`,type:`password`,placeholder:`sk-ant-...`,value:i,onChange:e=>a(e.target.value),className:`text-xs h-8 font-mono`}),L&&(0,q.jsxs)(`p`,{className:`text-[10px] text-muted-foreground`,children:[`Detected: `,L]})]}),(0,q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,q.jsx)(O,{htmlFor:`add-label`,className:`text-xs`,children:`Label (optional)`}),(0,q.jsx)(D,{id:`add-label`,placeholder:`e.g. Personal, Work`,value:o,onChange:e=>s(e.target.value),className:`text-xs h-8`})]})]}),u&&(0,q.jsx)(`div`,{className:`text-[11px] p-2 rounded bg-error/10 text-error`,children:u}),(0,q.jsxs)(x,{children:[(0,q.jsx)(y,{size:`sm`,variant:`outline`,className:`text-xs h-7`,onClick:M,children:`Cancel`}),(0,q.jsx)(y,{size:`sm`,className:`text-xs h-7`,onClick:I,disabled:!i.trim()||c,children:c?`Adding...`:`Add Token`})]})]})})}function ue(e){return e?.trim()?{free:`ChatGPT Free`,go:`ChatGPT Go`,plus:`ChatGPT Plus`,pro:`ChatGPT Pro`,team:`ChatGPT Team`,business:`ChatGPT Business`,self_serve_business_prolite:`ChatGPT Business`,enterprise:`ChatGPT Enterprise`,edu:`ChatGPT Edu`}[e.trim().toLowerCase()]??e:null}var de=1440*60*1e3,fe=7,pe=5;function me(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-fe*de;if(t<r)return null;let i=Math.min(fe-1,Math.floor((t-r)/de)),a=0;for(let e=0;e<=i;e++){let t=new Date(r+e*de).getUTCDay();t!==0&&t!==6&&a++}let o=a/pe;return{day:a,cap:o,used:e.utilization,blocked:e.utilization>=o}}var he=`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.`,ge=2e3,_e=21e4;function ve(e){let[t,n]=(0,$.useState)([]),[r,i]=(0,$.useState)(`round-robin`),[a,o]=(0,$.useState)({}),[s,c]=(0,$.useState)(!1),[l,u]=(0,$.useState)(new Set),[d,f]=(0,$.useState)(``),[p,m]=(0,$.useState)(``),[g,v]=(0,$.useState)(!1),[y,b]=(0,$.useState)(null),[x,S]=(0,$.useState)(null),[C,w]=(0,$.useState)(!1),[T,E]=(0,$.useState)(null),[D,O]=(0,$.useState)(!1),[k,A]=(0,$.useState)(``),[j,M]=(0,$.useState)(!1),[N,P]=(0,$.useState)(``),[F,I]=(0,$.useState)(!1),[L,R]=(0,$.useState)(!1),[z,B]=(0,$.useState)(null),V=(0,$.useRef)(null),H=(0,$.useRef)(null),U=(0,$.useRef)(0),W=(0,$.useRef)(!1),G=(0,$.useRef)(!1),K=(0,$.useRef)(!1),q=(0,$.useRef)(e);q.current=e;let J=(0,$.useCallback)(async()=>{c(!0);try{let e=await _.get(`/api/codex-accounts`);n(e.accounts),i(e.strategy),_.get(`/api/codex-accounts/usage`).then(o).catch(()=>{})}finally{c(!1)}},[]);(0,$.useEffect)(()=>{J()},[J]);let Y=async()=>{if(!(!d.trim()||G.current||W.current||H.current)){G.current=!0,v(!0),b(null);try{await _.post(`/api/codex-accounts/api-key`,{apiKey:d.trim(),label:p.trim()||void 0}),f(``),m(``),e(),await J()}catch(e){b(e.message)}finally{G.current=!1,v(!1)}}},X=(0,$.useCallback)(()=>{U.current+=1,W.current=!1,K.current=!1,V.current?.(),V.current=null;let e=H.current;H.current=null,e&&_.del(`/api/codex-accounts/${e.method}-login/${e.id}`).catch(()=>{})},[]),Z=(0,$.useCallback)(()=>{X(),S(null),w(!1),E(null),O(!1),A(``),M(!1)},[X]),ee=(0,$.useCallback)((e,t)=>{let n=Date.now()+(t===`browser`?61e4:_e),r=!1,i;V.current=()=>{r=!0,clearTimeout(i)};let a=async()=>{if(r)return;let o=null;try{o=await _.get(`/api/codex-accounts/${t}-login/${e}/status`)}catch{}if(!r){if(o?.state===`done`){Z(),m(``),q.current(),await J();return}if(o?.state===`error`||Date.now()>n){Z(),b(o?.state===`error`?o.error:`${t===`browser`?`Browser`:`Device`} login timed out.`);return}i=setTimeout(a,ge)}};a()},[Z,J]);(0,$.useEffect)(()=>X,[X]);let Q=async(e,t)=>{if(W.current||H.current||G.current)return;W.current=!0;let n=++U.current;O(!0),b(null);try{let r=await _.post(`/api/codex-accounts/${e}-login`,{label:p.trim()||void 0,...t?{accountId:t}:{}});if(n!==U.current){_.del(`/api/codex-accounts/${e}-login/${r.id}`).catch(()=>{});return}H.current={id:r.id,method:e},e===`device`?(S(r),w(!0)):E(r),ee(r.id,e)}catch(e){n===U.current&&b(e.message)}finally{n===U.current&&(W.current=!1,O(!1))}};return{accounts:t,strategy:r,usages:a,loading:s,apiKey:d,setApiKey:f,label:p,setLabel:m,adding:g,err:y,setErr:b,device:x,deviceWaiting:C,backupPassword:N,setBackupPassword:P,exporting:F,importing:L,msg:z,setMsg:B,toggling:l,load:J,addApiKey:Y,startDevice:e=>Q(`device`,e),startBrowser:e=>Q(`browser`,e),browser:T,loginStarting:D,callbackUrl:k,setCallbackUrl:A,submittingCallback:j,submitCallback:async()=>{let e=H.current;if(e?.method!==`browser`||!k.trim()||K.current)return;let t=U.current;K.current=!0,M(!0),b(null);let n=k.trim();A(``);try{await _.post(`/api/codex-accounts/browser-login/${e.id}/callback`,{callbackUrl:n})}catch(e){t===U.current&&b(e.message)}finally{t===U.current&&(K.current=!1,M(!1))}},cancelLogin:Z,remove:async e=>{await _.del(`/api/codex-accounts/${e}`),await J()},toggle:async(e,t)=>{let n=t===`disabled`?`active`:`disabled`;u(t=>new Set(t).add(e)),b(null);try{await _.patch(`/api/codex-accounts/${e}`,{status:n}),await J()}catch(e){b(e.message||`Could not change the account`)}finally{u(t=>{let n=new Set(t);return n.delete(e),n})}},toggleDailyGuard:async(e,t)=>{u(t=>new Set(t).add(e)),b(null);try{await _.patch(`/api/codex-accounts/${e}`,{dailyGuardEnabled:!t}),await J()}catch(e){b(e.message||`Could not change Daily guard`)}finally{u(t=>{let n=new Set(t);return n.delete(e),n})}},changeStrategy:async e=>{i(e);try{await _.put(`/api/codex-accounts/strategy`,{strategy:e})}catch{}},doExport:async()=>{if(!N.trim()){b(`Set a backup password first.`);return}I(!0),b(null),B(null);try{let t={"Content-Type":`application/json`},n=h();n&&(t.Authorization=`Bearer ${n}`);let r=await fetch(`/api/codex-accounts/export`,{method:`POST`,headers:t,body:JSON.stringify({password:N})});if(!r.ok){let e=await r.json().catch(()=>({}));throw Error(e.error??`Export failed: ${r.status}`)}let i=await r.text(),a=new Blob([i],{type:`application/json`}),o=document.createElement(`a`);o.href=URL.createObjectURL(a),o.download=`ppm-codex-accounts-backup.json`,o.click(),URL.revokeObjectURL(o.href),B(`Backup downloaded.`),e()}catch(e){b(e.message)}finally{I(!1)}},doImport:async t=>{if(!N.trim()){b(`Enter the backup password first.`);return}R(!0),b(null),B(null);try{let n=await t.text(),r=await _.post(`/api/codex-accounts/import`,{data:n,password:N});B(`Imported ${r.imported}${r.skipped?`, skipped ${r.skipped}`:``}.`),e(),await J()}catch(e){b(e.message)}finally{R(!1)}}}}function ye({open:e,onOpenChange:t,label:n,onLabelChange:r,apiKey:i,onApiKeyChange:o,adding:s,onAddApiKey:l,deviceWaiting:u,onStartDevice:d,device:p,error:h,browser:g,onStartBrowser:_,loginStarting:v,callbackUrl:E,onCallbackUrlChange:k,submittingCallback:A,onSubmitCallback:j,reloginLabel:M}){let N=v||u||!!g||s;return(0,q.jsx)(T,{open:e,onOpenChange:t,children:(0,q.jsxs)(S,{className:`sm:max-w-md max-h-[90dvh] overflow-y-auto`,children:[(0,q.jsxs)(b,{children:[(0,q.jsx)(C,{className:`text-sm`,children:M?`Sign in again — ${M}`:`Add Codex Account`}),(0,q.jsx)(w,{className:`text-xs leading-relaxed`,children:M?`Sign in with ChatGPT to renew this account. It keeps its name, its settings and the chats bound to it.`:`Choose browser login, a device code, or an OpenAI API key.`})]}),(0,q.jsxs)(`div`,{className:`space-y-3`,children:[!M&&(0,q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,q.jsx)(O,{htmlFor:`codex-label`,className:`text-xs`,children:`Label (optional)`}),(0,q.jsx)(D,{id:`codex-label`,placeholder:`e.g. Personal, Work`,value:n,onChange:e=>r(e.target.value),disabled:N,className:`text-xs`})]}),(0,q.jsxs)(`div`,{className:`rounded-md border p-3 space-y-2`,children:[(0,q.jsx)(`p`,{className:`text-[11px] font-medium`,children:`Browser login`}),(0,q.jsxs)(y,{size:`sm`,className:`w-full cursor-pointer gap-1.5`,onClick:_,disabled:N,children:[(0,q.jsx)(c,{className:`size-4`}),` Sign in with browser`]}),g&&(0,q.jsxs)(`div`,{className:`space-y-2 text-xs`,children:[(0,q.jsxs)(`a`,{href:g.authUrl,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 text-primary hover:underline`,children:[(0,q.jsx)(c,{className:`size-3`}),` Open ChatGPT sign-in`]}),(0,q.jsx)(`p`,{children:`Sign in, then copy the full localhost callback URL from the address bar and paste it below. On a phone, copy it even if the page fails to load.`}),(0,q.jsx)(O,{htmlFor:`codex-callback-url`,children:`Callback URL`}),(0,q.jsx)(D,{id:`codex-callback-url`,type:`password`,autoComplete:`off`,spellCheck:!1,placeholder:`http://localhost:.../auth/callback?...`,value:E,onChange:e=>k(e.target.value),disabled:A}),(0,q.jsxs)(y,{size:`sm`,onClick:j,disabled:!E.trim()||A,children:[A&&(0,q.jsx)(m,{className:`size-3 animate-spin`}),` Submit callback URL`]}),(0,q.jsxs)(`p`,{role:`status`,className:`flex items-center gap-1.5 text-muted-foreground`,children:[(0,q.jsx)(m,{className:`size-3 animate-spin`}),` Waiting for authorization. This may complete automatically on this computer.`]})]})]}),(0,q.jsxs)(`div`,{className:`rounded-md border p-3 space-y-2`,children:[(0,q.jsx)(`p`,{className:`text-[11px] font-medium`,children:`Device code`}),(0,q.jsx)(y,{size:`sm`,className:`w-full cursor-pointer gap-1.5`,onClick:d,disabled:N,children:u?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(m,{className:`size-4 animate-spin`}),` Waiting for authorization...`]}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(a,{className:`size-4`}),` Sign in with device code`]})}),p&&(0,q.jsxs)(`div`,{className:`rounded-md border border-primary/40 bg-primary/10 p-2.5 space-y-1.5`,children:[(0,q.jsx)(`p`,{className:`text-[11px]`,children:`Enter this code to authorize:`}),(0,q.jsx)(`div`,{className:`font-mono text-lg tracking-widest`,children:p.userCode}),(0,q.jsxs)(`a`,{href:p.verificationUrl,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 text-primary hover:underline text-[11px]`,children:[(0,q.jsx)(c,{className:`size-3`}),` `,p.verificationUrl]})]})]}),!M&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(`div`,{className:`flex-1 border-t`}),(0,q.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:`or paste an API key`}),(0,q.jsx)(`div`,{className:`flex-1 border-t`})]}),(0,q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,q.jsx)(O,{htmlFor:`codex-api-key`,className:`text-xs`,children:`OpenAI API key`}),(0,q.jsx)(D,{id:`codex-api-key`,type:`password`,placeholder:`sk-...`,value:i,onChange:e=>o(e.target.value),className:`text-xs font-mono`})]})]})]}),v&&(0,q.jsx)(`p`,{role:`status`,className:`text-xs`,children:`Starting login...`}),h&&(0,q.jsx)(`div`,{role:`alert`,className:`text-[11px] p-2 rounded bg-error/10 text-error`,children:h}),(0,q.jsxs)(x,{children:[(0,q.jsx)(y,{size:`sm`,variant:`outline`,className:`text-xs cursor-pointer`,onClick:()=>t(!1),children:`Cancel`}),!M&&(0,q.jsxs)(y,{size:`sm`,className:`text-xs cursor-pointer gap-1.5`,onClick:l,disabled:!i.trim()||N,children:[s?(0,q.jsx)(m,{className:`size-3.5 animate-spin`}):(0,q.jsx)(f,{className:`size-3.5`}),`Add key`]})]})]})})}function be({account:e,onClose:t,onDone:n}){let r=ve(()=>{n(),t()});return(0,q.jsx)(ye,{open:!0,onOpenChange:e=>{e||(r.cancelLogin(),t())},reloginLabel:e.label,label:r.label,onLabelChange:r.setLabel,apiKey:``,onApiKeyChange:()=>{},adding:!1,onAddApiKey:()=>{},deviceWaiting:r.deviceWaiting,onStartDevice:()=>void r.startDevice(e.id),device:r.device,browser:r.browser,onStartBrowser:()=>void r.startBrowser(e.id),loginStarting:r.loginStarting,callbackUrl:r.callbackUrl,onCallbackUrlChange:r.setCallbackUrl,submittingCallback:r.submittingCallback,onSubmitCallback:()=>void r.submitCallback(),error:r.err})}function xe(e){let t=e=>Math.round((e??0)*100)>=100;return t(e.session?.utilization)||t(e.weekly?.utilization)}function Se(e){return xe(e)&&(e.resetCredits?.available??0)>0}var Ce={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 we(e){return e?new Date(e).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`}):null}function Te({account:e,usage:t,onDone:n}){let r=v(),[i,a]=(0,$.useState)(!1),[o,c]=(0,$.useState)(!1);if(!Se(t))return null;let l=t.resetCredits;async function u(){c(!0);try{let t=await _.post(`/api/codex-accounts/${e.id}/reset-credit`);n(Ce[t.outcome]?.(e.label)??`${e.label}: ${t.outcome}`)}catch(e){n(e.message||`Could not use the reset`)}finally{c(!1),a(!1)}}let d=we(t.weekly?.resetsAt),f=we(l.nextExpiresAt),p=(0,q.jsxs)(`div`,{className:`space-y-3`,"data-testid":`codex-reset-credit-confirm`,children:[(0,q.jsxs)(`p`,{className:`text-sm`,children:[`Use 1 of `,(0,q.jsx)(`span`,{className:`font-medium`,children:e.label}),`'s `,l.available,` free reset`,l.available===1?``:`s`,`?`]}),(0,q.jsxs)(`ul`,{className:`text-xs text-text-secondary space-y-1.5 list-disc pl-4`,children:[(0,q.jsxs)(`li`,{children:[l.title??`Full reset`,`: the 5-hour and weekly usage go back to 0% now.`]}),(0,q.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,q.jsxs)(`li`,{children:[`This spends the reset that expires first (`,f,`).`]})]}),(0,q.jsxs)(`div`,{className:`flex flex-col-reverse md:flex-row gap-2 md:justify-end pt-1`,children:[(0,q.jsx)(y,{variant:`outline`,onClick:()=>a(!1),disabled:o,className:`min-h-11`,children:`Keep it`}),(0,q.jsxs)(y,{onClick:()=>void u(),disabled:o,className:`min-h-11 gap-1.5`,children:[o?(0,q.jsx)(m,{className:`size-4 animate-spin`}):(0,q.jsx)(s,{className:`size-4`}),`Use reset`]})]})]});return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(y,{size:`sm`,variant:`outline`,className:`min-h-11 md:min-h-0 md:h-7 gap-1 px-2 text-[11px] cursor-pointer border-primary/40 text-primary`,onClick:()=>a(!0),disabled:o,children:[(0,q.jsx)(s,{className:`size-3.5`}),` Use reset`]}),i&&(r?(0,q.jsx)(E,{open:!0,onClose:()=>{o||a(!1)},children:(0,q.jsxs)(`div`,{className:`px-4 pb-4`,children:[(0,q.jsx)(`h2`,{className:`text-base font-semibold mb-3`,children:`Use a free reset`}),p]})}):(0,q.jsx)(T,{open:!0,onOpenChange:e=>{!e&&!o&&a(!1)},children:(0,q.jsxs)(S,{className:`sm:max-w-sm`,children:[(0,q.jsx)(b,{children:(0,q.jsx)(C,{className:`text-sm`,children:`Use a free reset`})}),p]})}))]})}export{X as _,ve as a,K as b,le as c,ie as d,ne as f,ee as g,Z as h,he as i,ce as l,te as m,be as n,me as o,Q as p,ye as r,ue as s,Te as t,oe as u,Y as v,H as x,J as y};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|