texlite 0.19.1 → 0.20.0
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/DESIGN.md +273 -6
- package/OPERATIONS.md +7 -4
- package/README.md +6 -1
- package/README.zh-CN.md +4 -1
- package/dist/client/assets/AdminUsers-BghRo_hC.js +1 -0
- package/dist/client/assets/AdminUsers-BghRo_hC.js.br +0 -0
- package/dist/client/assets/AdminUsers-BghRo_hC.js.gz +0 -0
- package/dist/client/assets/AgentIcon-DsoMeMA8.js +1 -0
- package/dist/client/assets/AgentIcon-DsoMeMA8.js.br +0 -0
- package/dist/client/assets/AgentIcon-DsoMeMA8.js.gz +0 -0
- package/dist/client/assets/AgentIcon-dCMgWJG-.css +1 -0
- package/dist/client/assets/AgentIcon-dCMgWJG-.css.br +0 -0
- package/dist/client/assets/AgentIcon-dCMgWJG-.css.gz +0 -0
- package/dist/client/assets/AgentManagement-rIYtm4Bo.js +1 -0
- package/dist/client/assets/AgentManagement-rIYtm4Bo.js.br +0 -0
- package/dist/client/assets/AgentManagement-rIYtm4Bo.js.gz +0 -0
- package/dist/client/assets/AgentTerminal-BEjiw51y.js +2 -0
- package/dist/client/assets/AgentTerminal-BEjiw51y.js.br +0 -0
- package/dist/client/assets/AgentTerminal-BEjiw51y.js.gz +0 -0
- package/dist/client/assets/{AgentTerminalSurface-CaYNNZ9A.js → AgentTerminalSurface-B2rwONYs.js} +2 -2
- package/dist/client/assets/AgentTerminalSurface-B2rwONYs.js.br +0 -0
- package/dist/client/assets/AgentTerminalSurface-B2rwONYs.js.gz +0 -0
- package/dist/client/assets/AvatarSettingsDialog-DplRpiJJ.js +1 -0
- package/dist/client/assets/AvatarSettingsDialog-DplRpiJJ.js.br +0 -0
- package/dist/client/assets/AvatarSettingsDialog-DplRpiJJ.js.gz +0 -0
- package/dist/client/assets/CitationBibtexEditor-BnK6nZPi.js +1 -0
- package/dist/client/assets/CitationLibraryDialog-CZvJiTmT.js +3 -0
- package/dist/client/assets/CitationLibraryDialog-CZvJiTmT.js.br +0 -0
- package/dist/client/assets/CitationLibraryDialog-CZvJiTmT.js.gz +0 -0
- package/dist/client/assets/CitationNotesPreview-CiIzdjCa.js +36 -0
- package/dist/client/assets/CitationNotesPreview-CiIzdjCa.js.br +0 -0
- package/dist/client/assets/CitationNotesPreview-CiIzdjCa.js.gz +0 -0
- package/dist/client/assets/Dashboard-Dcl0Y_C3.js +5 -0
- package/dist/client/assets/Dashboard-Dcl0Y_C3.js.br +0 -0
- package/dist/client/assets/Dashboard-Dcl0Y_C3.js.gz +0 -0
- package/dist/client/assets/GitDialog-BeYvUCDv.js +3 -0
- package/dist/client/assets/GitDialog-BeYvUCDv.js.br +0 -0
- package/dist/client/assets/GitDialog-BeYvUCDv.js.gz +0 -0
- package/dist/client/assets/GitHubAccountDialog-BGKINOwJ.js +1 -0
- package/dist/client/assets/GitHubAccountDialog-BGKINOwJ.js.br +0 -0
- package/dist/client/assets/GitHubAccountDialog-BGKINOwJ.js.gz +0 -0
- package/dist/client/assets/GitHubIcon-CExJn0AV.js +1 -0
- package/dist/client/assets/HistoryDialog-B-C4Zaef.js +8 -0
- package/dist/client/assets/HistoryDialog-B-C4Zaef.js.br +0 -0
- package/dist/client/assets/HistoryDialog-B-C4Zaef.js.gz +0 -0
- package/dist/client/assets/InfoPopover-Dkz742vJ.js +1 -0
- package/dist/client/assets/LatexEditor-CohUJrGD.js +25 -0
- package/dist/client/assets/LatexEditor-CohUJrGD.js.br +0 -0
- package/dist/client/assets/LatexEditor-CohUJrGD.js.gz +0 -0
- package/dist/client/assets/PdfPreview-BvJxduy3.js +1 -0
- package/dist/client/assets/PdfPreview-BvJxduy3.js.br +0 -0
- package/dist/client/assets/PdfPreview-BvJxduy3.js.gz +0 -0
- package/dist/client/assets/ProjectIconPickerDialog-B9_XvdIC.js +1 -0
- package/dist/client/assets/ProjectIconPickerDialog-B9_XvdIC.js.br +0 -0
- package/dist/client/assets/ProjectIconPickerDialog-B9_XvdIC.js.gz +0 -0
- package/dist/client/assets/ProjectSettings-D8uH3PqQ.js +4 -0
- package/dist/client/assets/ProjectSettings-D8uH3PqQ.js.br +0 -0
- package/dist/client/assets/ProjectSettings-D8uH3PqQ.js.gz +0 -0
- package/dist/client/assets/ProjectWorkspace-BZj-CRZB.js +31 -0
- package/dist/client/assets/ProjectWorkspace-BZj-CRZB.js.br +0 -0
- package/dist/client/assets/ProjectWorkspace-BZj-CRZB.js.gz +0 -0
- package/dist/client/assets/QuickOpenDialog-B9bf5mnw.js +1 -0
- package/dist/client/assets/QuickOpenDialog-B9bf5mnw.js.br +0 -0
- package/dist/client/assets/QuickOpenDialog-B9bf5mnw.js.gz +0 -0
- package/dist/client/assets/ReadOnlySource-BZ7WYQO7.js +2 -0
- package/dist/client/assets/SaveButton-wiTpGLho.js +1 -0
- package/dist/client/assets/{SelectionHistoryDialog-DzlVKtxs.js → SelectionHistoryDialog-DYQb9hXp.js} +2 -2
- package/dist/client/assets/SelectionHistoryDialog-DYQb9hXp.js.br +0 -0
- package/dist/client/assets/SelectionHistoryDialog-DYQb9hXp.js.gz +0 -0
- package/dist/client/assets/SharedProjectPage-BOGGeyBG.css +1 -0
- package/dist/client/assets/SharedProjectPage-DJjR-D8d.js +2 -0
- package/dist/client/assets/SharedProjectPage-DJjR-D8d.js.br +0 -0
- package/dist/client/assets/SharedProjectPage-DJjR-D8d.js.gz +0 -0
- package/dist/client/assets/SystemMetricsDialog-BExTHWxg.js +1 -0
- package/dist/client/assets/SystemMetricsDialog-BExTHWxg.js.br +0 -0
- package/dist/client/assets/SystemMetricsDialog-BExTHWxg.js.gz +0 -0
- package/dist/client/assets/{TagColorSelect-xbc2H5ou.js → TagColorSelect-CzPUDAny.js} +1 -1
- package/dist/client/assets/TagManagementDialog-BBOpD_62.js +1 -0
- package/dist/client/assets/TagManagementDialog-BBOpD_62.js.br +0 -0
- package/dist/client/assets/TagManagementDialog-BBOpD_62.js.gz +0 -0
- package/dist/client/assets/ThemeSwitcher-BTDUp7Wj.js +1 -0
- package/dist/client/assets/ThemeSwitcher-BTDUp7Wj.js.br +0 -0
- package/dist/client/assets/ThemeSwitcher-BTDUp7Wj.js.gz +0 -0
- package/dist/client/assets/WordCountDialog-CgDcnPdJ.js +1 -0
- package/dist/client/assets/WordCountDialog-CgDcnPdJ.js.br +0 -0
- package/dist/client/assets/WordCountDialog-CgDcnPdJ.js.gz +0 -0
- package/dist/client/assets/arrow-down-C_4f1E-E.js +1 -0
- package/dist/client/assets/check-Dw16EqG-.js +1 -0
- package/dist/client/assets/chevron-up-BHaMUEEA.js +1 -0
- package/dist/client/assets/{chktex-Bz-LKycq.js → chktex-BeOSrdut.js} +1 -1
- package/dist/client/assets/circle-check-CunlnBPw.js +1 -0
- package/dist/client/assets/clipboard-CslquMx4.js +1 -0
- package/dist/client/assets/clock-3-DztJubz_.js +1 -0
- package/dist/client/assets/createLucideIcon-CDYIzuiB.js +1 -0
- package/dist/client/assets/createLucideIcon-CDYIzuiB.js.br +0 -0
- package/dist/client/assets/createLucideIcon-CDYIzuiB.js.gz +0 -0
- package/dist/client/assets/dist-B_WjsTVV.js +1 -0
- package/dist/client/assets/dist-B_WjsTVV.js.br +0 -0
- package/dist/client/assets/dist-B_WjsTVV.js.gz +0 -0
- package/dist/client/assets/dist-Bcdl4EAC.js +1 -0
- package/dist/client/assets/dist-Bcdl4EAC.js.br +0 -0
- package/dist/client/assets/dist-Bcdl4EAC.js.gz +0 -0
- package/dist/client/assets/dist-DdUqlCPw.js +1 -0
- package/dist/client/assets/dist-DdUqlCPw.js.br +0 -0
- package/dist/client/assets/dist-DdUqlCPw.js.gz +0 -0
- package/dist/client/assets/editor-JqCouYk8.js +14 -0
- package/dist/client/assets/editor-JqCouYk8.js.br +0 -0
- package/dist/client/assets/editor-JqCouYk8.js.gz +0 -0
- package/dist/client/assets/editor-languages-CRI2h3Fj.js +36 -0
- package/dist/client/assets/editor-languages-CRI2h3Fj.js.br +0 -0
- package/dist/client/assets/editor-languages-CRI2h3Fj.js.gz +0 -0
- package/dist/client/assets/editorThemeExtension-BNWs0sHh.js +1 -0
- package/dist/client/assets/editorThemeExtension-BNWs0sHh.js.br +0 -0
- package/dist/client/assets/editorThemeExtension-BNWs0sHh.js.gz +0 -0
- package/dist/client/assets/es2015-D2UDOM09.js +41 -0
- package/dist/client/assets/es2015-D2UDOM09.js.br +0 -0
- package/dist/client/assets/es2015-D2UDOM09.js.gz +0 -0
- package/dist/client/assets/eye-BnslGpqB.js +1 -0
- package/dist/client/assets/hard-drive-CXlummIE.js +1 -0
- package/dist/client/assets/i18n-Bv4wFb8D.js +13 -0
- package/dist/client/assets/i18n-Bv4wFb8D.js.br +0 -0
- package/dist/client/assets/i18n-Bv4wFb8D.js.gz +0 -0
- package/dist/client/assets/index-Bdb2ITID.js +2 -0
- package/dist/client/assets/index-Bdb2ITID.js.br +0 -0
- package/dist/client/assets/index-Bdb2ITID.js.gz +0 -0
- package/dist/client/assets/index-wqKiaXZr.css +1 -0
- package/dist/client/assets/index-wqKiaXZr.css.br +0 -0
- package/dist/client/assets/index-wqKiaXZr.css.gz +0 -0
- package/dist/client/assets/katex-CBRBI6nR.js +257 -0
- package/dist/client/assets/katex-CBRBI6nR.js.br +0 -0
- package/dist/client/assets/katex-CBRBI6nR.js.gz +0 -0
- package/dist/client/assets/katex-CvRo0776.css +1 -0
- package/dist/client/assets/katex-CvRo0776.css.br +0 -0
- package/dist/client/assets/{katex-DDK6mlKN.css.gz → katex-CvRo0776.css.gz} +0 -0
- package/dist/client/assets/library-big-B8e_Fiql.js +1 -0
- package/dist/client/assets/loader-circle-DKGyi5EK.js +1 -0
- package/dist/client/assets/lock-keyhole-aC_QjKDi.js +1 -0
- package/dist/client/assets/minimize-2-CkBmeGXp.js +1 -0
- package/dist/client/assets/minus-DrpwqY8Y.js +1 -0
- package/dist/client/assets/refresh-cw-IqExWG6S.js +1 -0
- package/dist/client/assets/relativeTime-DlKXhH_h.js +1 -0
- package/dist/client/assets/relativeTime-DlKXhH_h.js.br +0 -0
- package/dist/client/assets/relativeTime-DlKXhH_h.js.gz +0 -0
- package/dist/client/assets/search-DjOWqLig.js +1 -0
- package/dist/client/assets/sourceCursorStore-C7u-3Gbl.js +1 -0
- package/dist/client/assets/sourceCursorStore-C7u-3Gbl.js.br +0 -0
- package/dist/client/assets/sourceCursorStore-C7u-3Gbl.js.gz +0 -0
- package/dist/client/assets/{spellCheck-xzICTGx1.js → spellCheck-P-fMO4iR.js} +1 -1
- package/dist/client/assets/spellCheck-P-fMO4iR.js.br +0 -0
- package/dist/client/assets/spellCheck-P-fMO4iR.js.gz +0 -0
- package/dist/client/assets/tags-GrE3ZIQN.js +1 -0
- package/dist/client/assets/terminal-DD9WJ56e.js +1 -0
- package/dist/client/assets/{textLanguageSupport-DIXngcZX.js → textLanguageSupport-BSIE7WPM.js} +1 -1
- package/dist/client/assets/textLanguages-DAJ1OXJA.js +78 -0
- package/dist/client/assets/textLanguages-DAJ1OXJA.js.br +0 -0
- package/dist/client/assets/textLanguages-DAJ1OXJA.js.gz +0 -0
- package/dist/client/assets/type-CKe1tHHo.js +1 -0
- package/dist/client/assets/useDeletionTransitions-TAZINdHX.js +1 -0
- package/dist/client/assets/useDeletionTransitions-TAZINdHX.js.br +0 -0
- package/dist/client/assets/useDeletionTransitions-TAZINdHX.js.gz +0 -0
- package/dist/client/assets/useTranslation-DwkoADSz.js +1 -0
- package/dist/client/assets/useTranslation-DwkoADSz.js.br +0 -0
- package/dist/client/assets/useTranslation-DwkoADSz.js.gz +0 -0
- package/dist/client/assets/user-plus-NNBQOWDP.js +1 -0
- package/dist/client/assets/{vimSupport-RdD-E-Eh.js → vimSupport-BwIAfLU0.js} +6 -6
- package/dist/client/assets/vimSupport-BwIAfLU0.js.br +0 -0
- package/dist/client/assets/vimSupport-BwIAfLU0.js.gz +0 -0
- package/dist/client/index.html +9 -4
- package/dist/server/app.js +7 -1
- package/dist/server/byteRange.js +19 -0
- package/dist/server/citationCollections.js +163 -0
- package/dist/server/citationFolderTransfer.js +74 -0
- package/dist/server/citationInput.js +34 -0
- package/dist/server/collaboration.js +47 -16
- package/dist/server/commentMentions.js +6 -1
- package/dist/server/commentSuggestions.js +143 -0
- package/dist/server/db.js +81 -0
- package/dist/server/i18n.js +9 -0
- package/dist/server/locales/zh-Hant.js +6 -0
- package/dist/server/projectPreview.js +133 -0
- package/dist/server/projects.js +2 -1
- package/dist/server/routes/citations.js +84 -55
- package/dist/server/routes/commentSuggestions.js +154 -0
- package/dist/server/routes/comments.js +17 -1
- package/dist/server/routes/compile.js +1 -19
- package/dist/server/routes/projectShared.js +4 -0
- package/dist/server/routes/projectViewLinks.js +238 -0
- package/dist/server/routes/projects.js +27 -12
- package/dist/server/routes/users.js +7 -1
- package/dist/server/viewLinkTokens.js +49 -0
- package/dist/server/viewLinks.js +25 -0
- package/dist/shared/citationCollections.js +29 -0
- package/dist/shared/citationContent.js +4 -0
- package/dist/shared/citationTransfer.js +7 -0
- package/dist/shared/comments.js +2 -1
- package/dist/shared/projectCatalog.js +1 -0
- package/dist/shared/projectViewLinks.js +20 -0
- package/dist/shared/suggestionMessages.js +41 -0
- package/dist/shared/updates.js +1 -1
- package/dist/shared/userManagement.js +1 -0
- package/package.json +9 -1
- package/dist/client/assets/AdminUsers-CuYfWnEk.js +0 -1
- package/dist/client/assets/AdminUsers-CuYfWnEk.js.br +0 -0
- package/dist/client/assets/AdminUsers-CuYfWnEk.js.gz +0 -0
- package/dist/client/assets/AgentIcon-ClP5dPRL.js +0 -1
- package/dist/client/assets/AgentIcon-ClP5dPRL.js.br +0 -0
- package/dist/client/assets/AgentIcon-ClP5dPRL.js.gz +0 -0
- package/dist/client/assets/AgentIcon-DxrC-zx_.css +0 -1
- package/dist/client/assets/AgentIcon-DxrC-zx_.css.br +0 -0
- package/dist/client/assets/AgentIcon-DxrC-zx_.css.gz +0 -0
- package/dist/client/assets/AgentManagement-jY_BF6Qy.js +0 -1
- package/dist/client/assets/AgentManagement-jY_BF6Qy.js.br +0 -0
- package/dist/client/assets/AgentManagement-jY_BF6Qy.js.gz +0 -0
- package/dist/client/assets/AgentTerminal-JKP2SVkZ.js +0 -2
- package/dist/client/assets/AgentTerminal-JKP2SVkZ.js.br +0 -0
- package/dist/client/assets/AgentTerminal-JKP2SVkZ.js.gz +0 -0
- package/dist/client/assets/AgentTerminalSurface-CaYNNZ9A.js.br +0 -0
- package/dist/client/assets/AgentTerminalSurface-CaYNNZ9A.js.gz +0 -0
- package/dist/client/assets/AvatarSettingsDialog-C2TACfvP.js +0 -1
- package/dist/client/assets/AvatarSettingsDialog-C2TACfvP.js.br +0 -0
- package/dist/client/assets/AvatarSettingsDialog-C2TACfvP.js.gz +0 -0
- package/dist/client/assets/CitationLibraryDialog-BdU9nbgG.js +0 -1
- package/dist/client/assets/CitationLibraryDialog-BdU9nbgG.js.br +0 -0
- package/dist/client/assets/CitationLibraryDialog-BdU9nbgG.js.gz +0 -0
- package/dist/client/assets/Dashboard-B7mMz5Gj.js +0 -5
- package/dist/client/assets/Dashboard-B7mMz5Gj.js.br +0 -0
- package/dist/client/assets/Dashboard-B7mMz5Gj.js.gz +0 -0
- package/dist/client/assets/GitDialog-C2H-jKVO.js +0 -3
- package/dist/client/assets/GitDialog-C2H-jKVO.js.br +0 -0
- package/dist/client/assets/GitDialog-C2H-jKVO.js.gz +0 -0
- package/dist/client/assets/GitHubAccountDialog-DdKiE3pw.js +0 -1
- package/dist/client/assets/GitHubAccountDialog-DdKiE3pw.js.br +0 -0
- package/dist/client/assets/GitHubAccountDialog-DdKiE3pw.js.gz +0 -0
- package/dist/client/assets/GitHubIcon-Cjli8pd_.js +0 -1
- package/dist/client/assets/HistoryDialog-CoxJ3EsK.js +0 -8
- package/dist/client/assets/HistoryDialog-CoxJ3EsK.js.br +0 -0
- package/dist/client/assets/HistoryDialog-CoxJ3EsK.js.gz +0 -0
- package/dist/client/assets/LatexEditor-BhAKioho.js +0 -101
- package/dist/client/assets/LatexEditor-BhAKioho.js.br +0 -0
- package/dist/client/assets/LatexEditor-BhAKioho.js.gz +0 -0
- package/dist/client/assets/PdfPreview-CC8KEz1Y.js +0 -1
- package/dist/client/assets/PdfPreview-CC8KEz1Y.js.br +0 -0
- package/dist/client/assets/PdfPreview-CC8KEz1Y.js.gz +0 -0
- package/dist/client/assets/ProjectIconPickerDialog-vi_HwlCS.js +0 -1
- package/dist/client/assets/ProjectIconPickerDialog-vi_HwlCS.js.br +0 -0
- package/dist/client/assets/ProjectIconPickerDialog-vi_HwlCS.js.gz +0 -0
- package/dist/client/assets/ProjectSettings-Bl1t-Gnh.js +0 -4
- package/dist/client/assets/ProjectSettings-Bl1t-Gnh.js.br +0 -0
- package/dist/client/assets/ProjectSettings-Bl1t-Gnh.js.gz +0 -0
- package/dist/client/assets/ProjectWorkspace-1UOdyfBq.js +0 -30
- package/dist/client/assets/ProjectWorkspace-1UOdyfBq.js.br +0 -0
- package/dist/client/assets/ProjectWorkspace-1UOdyfBq.js.gz +0 -0
- package/dist/client/assets/QuickOpenDialog-BAzyrB-4.js +0 -1
- package/dist/client/assets/QuickOpenDialog-BAzyrB-4.js.br +0 -0
- package/dist/client/assets/QuickOpenDialog-BAzyrB-4.js.gz +0 -0
- package/dist/client/assets/SaveButton-DkyoEu6j.js +0 -1
- package/dist/client/assets/SelectionHistoryDialog-DzlVKtxs.js.br +0 -0
- package/dist/client/assets/SelectionHistoryDialog-DzlVKtxs.js.gz +0 -0
- package/dist/client/assets/SystemMetricsDialog-C6RVZdJZ.js +0 -1
- package/dist/client/assets/SystemMetricsDialog-C6RVZdJZ.js.br +0 -0
- package/dist/client/assets/SystemMetricsDialog-C6RVZdJZ.js.gz +0 -0
- package/dist/client/assets/TagManagementDialog-8pZUVaEI.js +0 -1
- package/dist/client/assets/TagManagementDialog-8pZUVaEI.js.br +0 -0
- package/dist/client/assets/TagManagementDialog-8pZUVaEI.js.gz +0 -0
- package/dist/client/assets/WordCountDialog-BODhL9iz.js +0 -1
- package/dist/client/assets/WordCountDialog-BODhL9iz.js.br +0 -0
- package/dist/client/assets/WordCountDialog-BODhL9iz.js.gz +0 -0
- package/dist/client/assets/arrow-down-B6T7Z6IO.js +0 -1
- package/dist/client/assets/check-BRlv1lrZ.js +0 -1
- package/dist/client/assets/chevron-up-krb7w67X.js +0 -1
- package/dist/client/assets/clock-3-Fb1_e3ec.js +0 -1
- package/dist/client/assets/dist-CMYWzCHL.js +0 -1
- package/dist/client/assets/dist-CMYWzCHL.js.br +0 -0
- package/dist/client/assets/dist-CMYWzCHL.js.gz +0 -0
- package/dist/client/assets/dist-Dxkdrap6.js +0 -2
- package/dist/client/assets/dist-Dxkdrap6.js.br +0 -0
- package/dist/client/assets/dist-Dxkdrap6.js.gz +0 -0
- package/dist/client/assets/editor-languages-C6EDWlLD.js +0 -36
- package/dist/client/assets/editor-languages-C6EDWlLD.js.br +0 -0
- package/dist/client/assets/editor-languages-C6EDWlLD.js.gz +0 -0
- package/dist/client/assets/editor-oR9RlWUz.js +0 -14
- package/dist/client/assets/editor-oR9RlWUz.js.br +0 -0
- package/dist/client/assets/editor-oR9RlWUz.js.gz +0 -0
- package/dist/client/assets/eye-B6AX_5uX.js +0 -1
- package/dist/client/assets/hard-drive-CBmnJ2xS.js +0 -1
- package/dist/client/assets/i18n-DF6keNBA.js +0 -13
- package/dist/client/assets/i18n-DF6keNBA.js.br +0 -0
- package/dist/client/assets/i18n-DF6keNBA.js.gz +0 -0
- package/dist/client/assets/index-DCwfhKK9.js +0 -42
- package/dist/client/assets/index-DCwfhKK9.js.br +0 -0
- package/dist/client/assets/index-DCwfhKK9.js.gz +0 -0
- package/dist/client/assets/index-SVNFLCYh.css +0 -1
- package/dist/client/assets/index-SVNFLCYh.css.br +0 -0
- package/dist/client/assets/index-SVNFLCYh.css.gz +0 -0
- package/dist/client/assets/info-DNSAs0_-.js +0 -1
- package/dist/client/assets/katex-Bd0sKoun.js +0 -257
- package/dist/client/assets/katex-Bd0sKoun.js.br +0 -0
- package/dist/client/assets/katex-Bd0sKoun.js.gz +0 -0
- package/dist/client/assets/katex-DDK6mlKN.css +0 -1
- package/dist/client/assets/katex-DDK6mlKN.css.br +0 -0
- package/dist/client/assets/minimize-2-C8oL6PTV.js +0 -1
- package/dist/client/assets/minus-TCBOakyi.js +0 -1
- package/dist/client/assets/plus-Dfkyfvvy.js +0 -1
- package/dist/client/assets/refresh-cw-DuLtxWBX.js +0 -1
- package/dist/client/assets/relativeTime-BR0CVAvz.js +0 -1
- package/dist/client/assets/relativeTime-BR0CVAvz.js.br +0 -0
- package/dist/client/assets/relativeTime-BR0CVAvz.js.gz +0 -0
- package/dist/client/assets/search-n-2tBATf.js +0 -1
- package/dist/client/assets/spellCheck-xzICTGx1.js.br +0 -0
- package/dist/client/assets/spellCheck-xzICTGx1.js.gz +0 -0
- package/dist/client/assets/tags-Dy96boLq.js +0 -1
- package/dist/client/assets/terminal-C0xh8jVR.js +0 -1
- package/dist/client/assets/type-BjXWxrjH.js +0 -1
- package/dist/client/assets/user-plus-3oJZJXHW.js +0 -1
- package/dist/client/assets/vimSupport-RdD-E-Eh.js.br +0 -0
- package/dist/client/assets/vimSupport-RdD-E-Eh.js.gz +0 -0
package/DESIGN.md
CHANGED
|
@@ -64,6 +64,37 @@ conversion. Use consistent terminology such as 專案, 檔案, 原始碼, 儲存
|
|
|
64
64
|
and 批註 (collaborative comments). Tests check catalog keys, interpolation
|
|
65
65
|
variables, rich-text tags, language detection, persistence, and API headers.
|
|
66
66
|
|
|
67
|
+
### Project catalog
|
|
68
|
+
|
|
69
|
+
The homepage places All projects, Owned by me and Shared with me tabs below the
|
|
70
|
+
page title. Ownership is filtered on the server before pagination (32 projects
|
|
71
|
+
per page), preserving the existing list/grid views, search, private tags,
|
|
72
|
+
sorting and per-user archive filter. Each response includes counts for all three
|
|
73
|
+
categories under the current search and tag conditions, including both active
|
|
74
|
+
and archived projects, independently of the selected category, archive filter
|
|
75
|
+
and page; zero counts are not displayed. Pagination totals still follow the
|
|
76
|
+
archive filter. Archiving/unarchiving preserves tab counts; deletion reduces
|
|
77
|
+
them. Administrators only see and count projects they own or that were explicitly
|
|
78
|
+
shared with them.
|
|
79
|
+
|
|
80
|
+
Changing category resets pagination. The browser caches rows together with the
|
|
81
|
+
category, filters, counts and page, so returning from a workspace restores the
|
|
82
|
+
same view before revalidation. Obsolete requests are aborted and ignored, and
|
|
83
|
+
rows from a previous category are not shown while its replacement is loading.
|
|
84
|
+
Successful catalog mutations revalidate the currently selected view.
|
|
85
|
+
|
|
86
|
+
Grid cards keep unread mentions and unresolved-comment counts in the owner
|
|
87
|
+
header, using icon-and-number badges with full tooltip labels. Titles clamp to
|
|
88
|
+
two lines without reserving a fixed title height; timestamp groups align at
|
|
89
|
+
the bottom of equal-height cards. Private tags take precedence over a two-line
|
|
90
|
+
source preview. Grid catalog requests opt into previews only for tagless rows:
|
|
91
|
+
the server reads at most the first 64 KiB of the selected main document,
|
|
92
|
+
preferring an abstract sentence, then the document title, then body prose.
|
|
93
|
+
Reads are asynchronous, coalesced and cached by file metadata, with at most 128
|
|
94
|
+
entries; includes are not traversed and no TeX is executed. Empty source and
|
|
95
|
+
unavailable previews have distinct placeholders. List layout and its labels
|
|
96
|
+
remain unchanged.
|
|
97
|
+
|
|
67
98
|
### Citation library
|
|
68
99
|
|
|
69
100
|
The citation library is stored in SQLite and is independent of project source
|
|
@@ -77,6 +108,94 @@ citation library as a separate management page beside the other management
|
|
|
77
108
|
controls; the project workspace keeps a smaller `.bib` import dialog for
|
|
78
109
|
in-context writing. Library results are server-filtered and paginated with 60
|
|
79
110
|
entries per page by default (the API accepts a bounded page-size override).
|
|
111
|
+
Migration 18 adds private, single-level citation folders and a many-to-many
|
|
112
|
+
entry/folder relation. A folder represents a paper or research topic; the same
|
|
113
|
+
entry can belong to several folders without copying its BibTeX. All references
|
|
114
|
+
and Unfiled are built-in views. Folder counts are library-wide, independent of
|
|
115
|
+
search, tag filters and pagination. Existing references remain unfiled on
|
|
116
|
+
upgrade. By default, folder deletion removes only placements, not entries or their tags.
|
|
117
|
+
The delete confirmation offers an unchecked option to also delete references
|
|
118
|
+
exclusive to that folder, including their notes. References linked to other
|
|
119
|
+
folders are kept. `DELETE .../collections/:id?deleteReferences=true` performs
|
|
120
|
+
both deletions in one authenticated, user-scoped SQLite transaction; omitting
|
|
121
|
+
the flag (or using `false`) retains references. Tag definitions and project
|
|
122
|
+
`.bib` files are never removed by this operation.
|
|
123
|
+
Each user-created folder holds at most 500 references, enforced inside the
|
|
124
|
+
server's placement transactions for new saves and folder reassignment. A full
|
|
125
|
+
folder still permits edits and retaining existing memberships. Failed additions
|
|
126
|
+
leave content, notes, tags, revisions and other memberships unchanged. Existing
|
|
127
|
+
oversized folders are preserved and may shrink, but cannot gain new entries.
|
|
128
|
+
All references and Unfiled are views, not folders, and have no 500-entry cap;
|
|
129
|
+
the private library's total size is not limited by folder capacity.
|
|
130
|
+
The dashboard page and project import dialog share folder navigation. Project
|
|
131
|
+
workflows use a separate controller and render only Import on library entries
|
|
132
|
+
and Save/Update on current-file entries. These are compact icon-only actions
|
|
133
|
+
with accessible names, action/state tooltips and the shared saved-check feedback.
|
|
134
|
+
Tag filters combine with folders, search and pagination, but project dialogs do
|
|
135
|
+
not expose tag or entry management controls. The workspace's compact entry is
|
|
136
|
+
labelled Citation; the homepage keeps Citation library. New saves require a destination folder; updates preserve
|
|
137
|
+
existing folder placements. A bounded, debounced comparison request returns
|
|
138
|
+
only key/id/revision and content-equality metadata, never full library text.
|
|
139
|
+
Equality ignores platform line endings and outer whitespace, not differences
|
|
140
|
+
inside an entry. Unchanged entries cannot be updated; changed ones still need
|
|
141
|
+
the last-read revision. Source/file switches abort stale comparisons and
|
|
142
|
+
ignore late save feedback. This is an explicit copy into/out of a `.bib`, not
|
|
143
|
+
automatic bidirectional sync.
|
|
144
|
+
Folder assignment uses the entry revision to reject concurrent stale changes.
|
|
145
|
+
Only the owning user can manage, filter or export a folder, including when
|
|
146
|
+
another account is an administrator. Export streams every member's stored
|
|
147
|
+
BibTeX in citation-key order, without the list's search or pagination limits,
|
|
148
|
+
as a UTF-8 `.bib` download. Export is available only in each folder's overflow
|
|
149
|
+
menu, not as a separate list-toolbar button. No external citation service is involved.
|
|
150
|
+
Migration 19 adds private Markdown notes to each library entry, initially empty.
|
|
151
|
+
Add and edit forms share three accessible tabs: BibTeX, Notes, and Notes preview.
|
|
152
|
+
Switching tabs preserves both drafts; preview renders the current unsaved notes.
|
|
153
|
+
The BibTeX tab loads a compact CodeMirror editor on demand, reusing the project's
|
|
154
|
+
Lezer BibTeX parser and syntax palettes. It keeps local undo history across tab
|
|
155
|
+
and theme changes; external form updates do not echo back as user edits.
|
|
156
|
+
Saving temporarily makes the editor read-only. The form adds no collaboration,
|
|
157
|
+
lint, completion or spelling services, and Tab still leaves the input normally.
|
|
158
|
+
Save is disabled until either field changes. Notes are limited to 64 KB of UTF-8 text and use the same revision
|
|
159
|
+
check as BibTeX edits. Saving updates from a project's `.bib` without a `notes`
|
|
160
|
+
field preserves the existing notes. Notes never enter the project's `.bib` or
|
|
161
|
+
the ordinary `.bib` export. The entry menu's Show/Hide notes action expands or
|
|
162
|
+
collapses notes directly below that entry, not in a modal. Multiple entries may
|
|
163
|
+
stay expanded independently, and ordinary refreshes keep their expansion state
|
|
164
|
+
while displaying the latest saved notes. Each panel has a fixed header/close
|
|
165
|
+
control and an internally scrolling body capped at 320px or 45vh, whichever is
|
|
166
|
+
smaller. The Markdown renderer loads on demand, with GFM tables/lists, HTML disabled and default safe-URL
|
|
167
|
+
handling; notes retain the site's light/dark palette. The same renderer serves
|
|
168
|
+
the form's preview tab. `remark-math` parses `$...$` inline math and `$$...$$`
|
|
169
|
+
display math; React components render its math nodes using the editor's KaTeX
|
|
170
|
+
version, with trusted commands disabled and bounded expansion/size. Code spans
|
|
171
|
+
and ordinary fenced code remain literal, and malformed formulas do not break
|
|
172
|
+
the rest of a note. A scoped npm override keeps micromark's transitive KaTeX
|
|
173
|
+
on the same version as the application's renderer.
|
|
174
|
+
|
|
175
|
+
Export BibTeX with notes, also in the folder menu, downloads one portable
|
|
176
|
+
`*.texlite-citations.json` file (`format: texlite-citation-folder`, `version: 1`).
|
|
177
|
+
It contains entries' BibTeX, display metadata and Markdown notes, but no folder
|
|
178
|
+
name, user IDs, tags or database memberships. The Import row at the top
|
|
179
|
+
of the sidebar's folder list accepts a single `.bib` file or TexLite `.json`
|
|
180
|
+
export, by dropping it or browsing for it, with a preview before submission.
|
|
181
|
+
Its clickable info explains naming, replacement and tag handling. The import
|
|
182
|
+
form requires a destination folder name and defaults to the selected filename
|
|
183
|
+
without its extension or the export-specific `.texlite-citations` JSON suffix,
|
|
184
|
+
up to 80 characters. The user can edit it before import;
|
|
185
|
+
any name embedded in a JSON file is ignored. A `.bib` import uses empty notes;
|
|
186
|
+
JSON preserves the exported notes. The destination name is sent only in the
|
|
187
|
+
import request, separately from the portable file content.
|
|
188
|
+
Both paths validate the chosen file and its BibTeX in the browser;
|
|
189
|
+
the server independently enforces authentication, shapes and byte limits.
|
|
190
|
+
Imports and both export formats support at most 500 entries per transfer.
|
|
191
|
+
Imports and JSON-with-notes exports also have a 16 MB limit; oversized exports fail instead
|
|
192
|
+
of downloading a partial file. Import is one SQLite transaction: it creates a
|
|
193
|
+
new private folder, appending `-1`, `-2`, etc. when the name is already used.
|
|
194
|
+
Matching citation keys replace that user's BibTeX and notes and increment the
|
|
195
|
+
entry revision, retaining existing tags and other folder placements. Incoming
|
|
196
|
+
tag fields are ignored, even for direct API requests. Repeated
|
|
197
|
+
keys within a file use the last entry. Other users' libraries are untouched.
|
|
198
|
+
Malformed input or a database failure leaves no partially imported folder.
|
|
80
199
|
Entry management actions live in an accessible, portalled overflow menu, with
|
|
81
200
|
deletion separated from ordinary actions and still requiring confirmation.
|
|
82
201
|
Copy BibTeX remains a direct button, preserves the full entry text and shows a
|
|
@@ -320,6 +439,84 @@ to source comments. Comments are anchored to source offsets and selected text,
|
|
|
320
439
|
can be resolved, edited, deleted, and replied to. If an author is removed,
|
|
321
440
|
the record remains visible as “Deleted User”.
|
|
322
441
|
|
|
442
|
+
The workspace Share button shows a superscript count of explicitly shared
|
|
443
|
+
read/edit members, excluding the owner and hiding zero. This is unrelated to
|
|
444
|
+
online presence. Initial counts come with project metadata; successful share
|
|
445
|
+
form loads and member changes update the badge without reloading the workspace.
|
|
446
|
+
|
|
447
|
+
Owners can also create **read-only links** from a separate tab in Share. These
|
|
448
|
+
are anonymous reading capabilities, not read-only members: visitors can browse
|
|
449
|
+
source files, images and the current compiled PDF, but cannot comment, edit,
|
|
450
|
+
compile, inspect history/Git or use agents. They do not join Yjs, consume a
|
|
451
|
+
collaborator slot or appear in presence/member counts. The reader has no live
|
|
452
|
+
editing subscription; Refresh fetches the latest saved files and published PDF.
|
|
453
|
+
Its appearance uses the normal workspace's topbar frame, layout menu, outline,
|
|
454
|
+
file-icon/tree styles, editor font defaults and PDF header. Files/source/PDF
|
|
455
|
+
panels can be resized, the file tree can be collapsed, and the outline stays
|
|
456
|
+
bound to the configured main document (including local inputs). Share, Git,
|
|
457
|
+
Terminal, snapshots, comments and compile remain visible but disabled; none
|
|
458
|
+
mount authenticated workflows. Reader settings change only browser language
|
|
459
|
+
and theme. Narrow screens start with the editor-only layout.
|
|
460
|
+
|
|
461
|
+
Migration 15 adds `project_view_links` with a project foreign key (cascade on
|
|
462
|
+
deletion), label, SHA-256 token hash and creation/expiry timestamps. Revoking a
|
|
463
|
+
link deletes its row and removes it from the owner's list. Migration 16 removes
|
|
464
|
+
previously revoked records and the obsolete revocation column; active and
|
|
465
|
+
expired links are preserved. Repeated owner revocation requests are idempotent. A
|
|
466
|
+
link defaults to seven days; the owner can explicitly choose no expiry. Each
|
|
467
|
+
project can have only one unexpired link, including a link with no expiry. An
|
|
468
|
+
immediate database transaction checks for an active link before inserting, so
|
|
469
|
+
concurrent creates cannot bypass this rule. Copying always returns the same
|
|
470
|
+
address without changing the token or expiry. Create is hidden while an active
|
|
471
|
+
link exists and becomes available after expiry or revocation. A
|
|
472
|
+
256-bit independent random token travels in the `/share/:id#token` URL
|
|
473
|
+
fragment, not the HTTP page URL. The browser exchanges it in a POST body
|
|
474
|
+
for an HttpOnly, SameSite=Strict cookie scoped to that link's base-path-aware
|
|
475
|
+
`/api/shared/:id` namespace, then removes the fragment. No login session or user
|
|
476
|
+
record is created, and no token is persisted in browser storage.
|
|
477
|
+
|
|
478
|
+
Migration 17 adds AES-256-GCM encrypted tokens for repeated owner copying, while
|
|
479
|
+
the SHA-256 hash remains the guest authorization check. Ciphertexts are bound
|
|
480
|
+
to the project/link ids using authenticated associated data; the independent
|
|
481
|
+
`view-link-token.key` is generated with mode 0600 in the data directory. Only
|
|
482
|
+
the actual owner's no-store management response returns recoverable link
|
|
483
|
+
addresses. Guest responses never contain a token, hash or ciphertext. Each link
|
|
484
|
+
row displays its address and a reusable Copy button with brief success feedback.
|
|
485
|
+
The sharing dialog no longer displays the administrator-created-users notice.
|
|
486
|
+
|
|
487
|
+
Link management offers Copy and Delete. To replace a link, delete it and create
|
|
488
|
+
a new one. Existing hash-only links stay valid, but cannot be copied because the
|
|
489
|
+
old secret cannot be reconstructed from its hash. Missing keys or corrupt
|
|
490
|
+
ciphertext likewise leave deletion controls accessible; delete and recreate
|
|
491
|
+
to regain copying. Back up the key with the database.
|
|
492
|
+
|
|
493
|
+
Every guest metadata/source/image/PDF request, including HEAD and byte ranges,
|
|
494
|
+
checks link existence, token hash and expiry in the database. Guest responses are
|
|
495
|
+
private/no-store, no-referrer and noindex; uploaded SVGs have a sandbox CSP.
|
|
496
|
+
PDF URLs are pinned to the current published run to avoid mixing Range bytes;
|
|
497
|
+
older compile versions and output/log directories are not exposed. A changed
|
|
498
|
+
published run requires Refresh. Existing authenticated project, compilation,
|
|
499
|
+
Agent and WebSocket routes accept only normal account sessions, never view
|
|
500
|
+
tokens. Anonymous Yjs updates are rejected before joining a room.
|
|
501
|
+
|
|
502
|
+
Revocation takes effect on the next server request. The viewer also
|
|
503
|
+
rechecks access every 30 seconds while visible and on returning to the tab,
|
|
504
|
+
and clears source/PDF at expiry or on rejection. Revocation cannot erase content
|
|
505
|
+
already copied or downloaded. Sharing deliberately exposes the source tree:
|
|
506
|
+
owners should remove project-local secrets before giving a link to anyone.
|
|
507
|
+
Only the current owner can list, create or revoke links; transfer keeps
|
|
508
|
+
existing links under the new owner's control. Links never grant member-management
|
|
509
|
+
or ownership rights.
|
|
510
|
+
|
|
511
|
+
The owner-only share form uses one editable user combobox: opening it lists
|
|
512
|
+
available users, and typing filters by display name or username. Candidates
|
|
513
|
+
exclude the owner and existing members. The popup is at most 240 px tall,
|
|
514
|
+
bounded by the dialog's available space, with internal scrolling and keyboard
|
|
515
|
+
navigation. Filtering uses the loaded active-user directory without per-keypress
|
|
516
|
+
requests. Typing clears an old selection but retains the permission draft;
|
|
517
|
+
only Add member grants access. Loads are aborted when the dialog closes or
|
|
518
|
+
changes project, and member mutations are guarded against duplicate submissions.
|
|
519
|
+
|
|
323
520
|
Live anchor updates replay the actual Yjs text deltas against their saved
|
|
324
521
|
source baseline. Agent disk imports retain an inferred-diff flag even when
|
|
325
522
|
their changes are transported as Yjs operations. HTTP replacements, recovered
|
|
@@ -352,6 +549,71 @@ and time; deleting that user retains the timestamp and displays “Deleted User
|
|
|
352
549
|
Schema migration 4 adds nullable columns without guessing metadata for existing
|
|
353
550
|
resolved comments. This stores the current resolution, not an activity log.
|
|
354
551
|
|
|
552
|
+
### Suggested changes
|
|
553
|
+
|
|
554
|
+
A source comment can optionally carry one replacement suggestion. The note
|
|
555
|
+
remains the discussion's primary content; an empty note becomes “Suggested
|
|
556
|
+
change” in the author's language. Ordinary comments have no reviewer. Only
|
|
557
|
+
replacement suggestions require a reviewer. Read-only members may
|
|
558
|
+
propose changes, but only the assigned reviewer with current write access may
|
|
559
|
+
accept or reject them. The comment author cannot be their own reviewer, even
|
|
560
|
+
if they own the project. Enabling an edit defaults its reviewer to the project
|
|
561
|
+
owner when they are not the author; otherwise the author must choose another
|
|
562
|
+
writable member. The reviewer stays fixed after submission; there is no
|
|
563
|
+
change-reviewer control. The author may edit the replacement while it is still
|
|
564
|
+
pending and no accepted update is being persisted. An empty replacement means
|
|
565
|
+
deleting the selected passage. Saving a changed replacement renews the review
|
|
566
|
+
notification without changing the original source, reviewer or discussion.
|
|
567
|
+
Identical-save retries do not renew it again.
|
|
568
|
+
|
|
569
|
+
Suggestions are collapsed attachments, not a separate discussion list. Opening
|
|
570
|
+
one shows an inline source diff, compacting unchanged context without hiding
|
|
571
|
+
edits. Preview differences are word-oriented and never supply source offsets
|
|
572
|
+
or patches to the acceptance endpoint. Existing comment authors attach
|
|
573
|
+
suggestions through the comment's more-actions menu. The new-comment modal
|
|
574
|
+
places read-only original source first, keeps the optional edit switch off by
|
|
575
|
+
default, and presents the reviewer at the bottom only while the edit switch is
|
|
576
|
+
enabled. Turning it off submits an ordinary comment without reviewer metadata
|
|
577
|
+
or a review request. Its live status
|
|
578
|
+
describes the actual payload: comment, edit, or both. Opening unchanged edit
|
|
579
|
+
controls does not create a suggestion. Review requests reuse
|
|
580
|
+
personal unread notifications with a distinct `review` kind; an explicit mention
|
|
581
|
+
of the same reviewer does not create a duplicate notification. Reading a review
|
|
582
|
+
request does not decide it. Accepting or rejecting clears that review request,
|
|
583
|
+
but leaves the discussion open and preserves other mention notifications.
|
|
584
|
+
A discussion with a pending suggestion cannot be resolved.
|
|
585
|
+
|
|
586
|
+
Edits and review decisions include the replacement text the user actually saw
|
|
587
|
+
as a compare-and-swap precondition. The server compares it under the project
|
|
588
|
+
write lock; acceptance checks again after cold-room preparation. A stale save
|
|
589
|
+
cannot overwrite a newer draft, and a stale decision cannot accept or reject
|
|
590
|
+
an unseen replacement. Conflicts trigger a discussion refresh without retrying
|
|
591
|
+
the write or discarding typed edits. Decided suggestions and journaled pending
|
|
592
|
+
applications cannot be edited. This content-based precondition needs no schema
|
|
593
|
+
version or extra database field.
|
|
594
|
+
|
|
595
|
+
Creation binds the selection to a source hash. Acceptance runs in the project
|
|
596
|
+
write queue, flushes preceding edits, checks current reviewer permissions and
|
|
597
|
+
requires the anchored source to match the saved original exactly. Edits outside
|
|
598
|
+
the passage can move its anchor; changed or lost source cannot be patched
|
|
599
|
+
fuzzily. Acceptance applies a targeted Yjs delete/insert, leaving unrelated
|
|
600
|
+
content and connected collaborators intact. The accepting reviewer is the
|
|
601
|
+
source-edit author. Rejection does not change source. Deleting a discussion
|
|
602
|
+
after acceptance does not undo the applied change.
|
|
603
|
+
|
|
604
|
+
Schema migration 12 adds a suggestion table and the notification kind without
|
|
605
|
+
changing existing comments. Migration 14 reverses the comment-level reviewer
|
|
606
|
+
layout introduced by development migration 13: it preserves suggestion
|
|
607
|
+
assignments, decisions, recovery receipts and notifications while removing
|
|
608
|
+
plain-comment reviewer assignments and their review requests.
|
|
609
|
+
Before applying a change, the service persists its
|
|
610
|
+
Yjs base and journals the exact CRDT update and replacement-range positions in
|
|
611
|
+
SQLite. An interrupted application can replay that same update idempotently;
|
|
612
|
+
it becomes accepted only after source/state/anchor persistence succeeds. A
|
|
613
|
+
missing recovery base fails explicitly rather than guessing and duplicating
|
|
614
|
+
the replacement. This recovery receipt is separate from ordinary anchor-save
|
|
615
|
+
bookkeeping and from the comment's resolution attribution.
|
|
616
|
+
|
|
355
617
|
The source-pin button opens an independent current-comment view: only that Open
|
|
356
618
|
thread in the active source file is shown and highlighted, without status,
|
|
357
619
|
scope, participant, unread or sorting controls. Saved review filters do not
|
|
@@ -743,8 +1005,12 @@ use default sizes; older browser records are left untouched. Blocked browser
|
|
|
743
1005
|
storage also falls back to usable defaults. File-panel collapse state follows `onResize`.
|
|
744
1006
|
Source comments sit at the left edge of the preview region, immediately beside
|
|
745
1007
|
the editor. They do not add an outer resizable panel or change the editor/file
|
|
746
|
-
widths. A 760 px preview-container breakpoint switches between
|
|
747
|
-
|
|
1008
|
+
widths. A 760 px preview-container breakpoint switches between an inline review
|
|
1009
|
+
column and a drawer over the PDF; closing it restores the preview. A right-edge
|
|
1010
|
+
separator resizes either presentation from 280 to 640 px (360 px by default),
|
|
1011
|
+
capped by the container and reserving at least 320 px for an inline PDF. Its
|
|
1012
|
+
browser-local preference is scoped to the deployment, not stored in the project.
|
|
1013
|
+
Arrow/Home/End keys resize it too; double-click restores the default width.
|
|
748
1014
|
The PDF stays mounted, and a stable portal host preserves review filters and
|
|
749
1015
|
reply forms across responsive changes. Editor-only mode falls back to an
|
|
750
1016
|
adjacent resizable context pane; settings keep their existing right-hand pane.
|
|
@@ -1206,6 +1472,7 @@ The default data layout is:
|
|
|
1206
1472
|
├── texlite.db-wal
|
|
1207
1473
|
├── texlite.db-shm
|
|
1208
1474
|
├── git-token.key
|
|
1475
|
+
├── view-link-token.key
|
|
1209
1476
|
├── tmp/ and trash/
|
|
1210
1477
|
└── projects/
|
|
1211
1478
|
└── <project-id>/
|
|
@@ -1217,10 +1484,10 @@ The default data layout is:
|
|
|
1217
1484
|
└── history/
|
|
1218
1485
|
~~~
|
|
1219
1486
|
|
|
1220
|
-
Back up `texlite.db`, `git-token.key`, and `projects/`
|
|
1221
|
-
SQLite WAL files in a live filesystem backup or use a SQLite-aware backup
|
|
1222
|
-
procedure. The
|
|
1223
|
-
|
|
1487
|
+
Back up `texlite.db`, `git-token.key`, `view-link-token.key`, and `projects/`
|
|
1488
|
+
together. Include the SQLite WAL files in a live filesystem backup or use a SQLite-aware backup
|
|
1489
|
+
procedure. The encryption keys are required to recover saved GitHub credentials
|
|
1490
|
+
and copy existing read-only links, respectively.
|
|
1224
1491
|
|
|
1225
1492
|
TexLite opens SQLite with WAL mode and `synchronous=NORMAL`. This avoids a
|
|
1226
1493
|
full WAL fsync on most small metadata writes while preserving SQLite's atomic
|
package/OPERATIONS.md
CHANGED
|
@@ -219,7 +219,7 @@ Relative paths are resolved from the configuration file. The default data
|
|
|
219
219
|
directory is `$XDG_DATA_HOME/texlite`, or `~/.local/share/texlite` when
|
|
220
220
|
`XDG_DATA_HOME` is unset. Set `storage.dataDir` or `TEXLITE_DATA_DIR` to move
|
|
221
221
|
it. The data directory contains the SQLite database, project sources, compiled
|
|
222
|
-
output, history objects, and
|
|
222
|
+
output, history objects, and encryption keys for GitHub tokens and read-only links.
|
|
223
223
|
|
|
224
224
|
Use [texlite.config.example.json](texlite.config.example.json) as a complete
|
|
225
225
|
starting point. It omits `storage.dataDir`, so copied configurations retain the
|
|
@@ -591,9 +591,12 @@ calls; platform/native-agent login behavior should also be checked when deployin
|
|
|
591
591
|
## Backup and security
|
|
592
592
|
|
|
593
593
|
Back up the entire configured data directory, including `texlite.db`, its WAL
|
|
594
|
-
files, `git-token.key`, and `projects/`.
|
|
595
|
-
|
|
596
|
-
|
|
594
|
+
files, `git-token.key`, `view-link-token.key`, and `projects/`. Saved GitHub tokens
|
|
595
|
+
and copying existing read-only links require their corresponding encryption
|
|
596
|
+
keys. Losing `view-link-token.key` does not invalidate distributed reader links,
|
|
597
|
+
but the owner must delete the link and create a new one to regain copying.
|
|
598
|
+
For an online copy of SQLite, include WAL files or use a SQLite-aware backup
|
|
599
|
+
method.
|
|
597
600
|
|
|
598
601
|
TexLite is designed for trusted users on localhost. Shell escape is disabled by
|
|
599
602
|
default and compile jobs have timeouts and concurrency limits, but LaTeX itself
|
package/README.md
CHANGED
|
@@ -110,7 +110,12 @@ shared browser writing, not a replacement for a personal IDE.
|
|
|
110
110
|
## What the writing workflow includes
|
|
111
111
|
|
|
112
112
|
- Projects with folders, ZIP import/export, tags, sharing, ownership transfer,
|
|
113
|
-
archiving, and a private per-user citation library
|
|
113
|
+
archiving, and a private per-user citation library with topic folders, tags,
|
|
114
|
+
Markdown notes, and folder-wide BibTeX export with optional notes for sharing.
|
|
115
|
+
Import `.bib` files or TexLite JSON exports; imports and exports allow up to
|
|
116
|
+
500 entries per transfer and exclude tags. Each folder holds up to 500 references.
|
|
117
|
+
- Owner-managed read-only links for anonymous readers, with expiry, rotation
|
|
118
|
+
and revocation. Readers can view source and existing PDFs without joining collaboration.
|
|
114
119
|
- CodeMirror editing with LaTeX/BibTeX highlighting, folding, completion,
|
|
115
120
|
optional Vim mode, formatting, spelling/grammar/ChkTeX assistance, search/replace,
|
|
116
121
|
and source/PDF SyncTeX navigation.
|
package/README.zh-CN.md
CHANGED
|
@@ -99,7 +99,10 @@ TeX 更新、数据位置与协作工作流的掌控。
|
|
|
99
99
|
|
|
100
100
|
## 核心写作工作流
|
|
101
101
|
|
|
102
|
-
- 项目支持文件夹、ZIP
|
|
102
|
+
- 项目支持文件夹、ZIP 导入/导出、标签、分享、所有权转让、归档和私有的个人引用库;引用库支持主题文件夹、标签、Markdown 笔记及整文件夹 BibTeX 导出,也可携带笔记导出并分享给其他用户。
|
|
103
|
+
支持导入 `.bib` 文件或 TexLite JSON 导出文件,每次导入或导出最多 500 条文献,均忽略标签;单个文件夹最多容纳 500 条文献。
|
|
104
|
+
- 所有者可创建免登录的只读链接,设置有效期、轮换或撤销;访客可查看源码和已有 PDF,
|
|
105
|
+
不加入协作列表。
|
|
103
106
|
- 基于 CodeMirror 的编辑器提供 LaTeX/BibTeX 高亮、折叠、补全、可选 Vim 模式、格式化、
|
|
104
107
|
拼写/语法/ChkTeX 辅助、搜索替换及源码/PDF SyncTeX 跳转。
|
|
105
108
|
- 基于 Yjs 的协同源码编辑支持活动会话、源码锚定批注、回复、解决状态,以及让审阅者
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-DUEFWlB7.js";import{_ as r}from"./relativeTime-DlKXhH_h.js";import{t as i}from"./useTranslation-DwkoADSz.js";import{t as a}from"./createLucideIcon-CDYIzuiB.js";import{H as o,S as ee,T as s,U as te,d as ne,x as c,z as re}from"./useDeletionTransitions-TAZINdHX.js";import{t as ie}from"./circle-check-CunlnBPw.js";import{t as ae}from"./loader-circle-DKGyi5EK.js";import{t as l}from"./lock-keyhole-aC_QjKDi.js";import{t as oe}from"./search-DjOWqLig.js";import{t as u}from"./user-plus-NNBQOWDP.js";import{c as d,d as f,m as p,s as se}from"./index-Bdb2ITID.js";import{t as ce}from"./SuccessNotice-ubBtzzi_.js";var m={name:`dices`,size:24,node:[[`rect`,{width:`12`,height:`12`,x:`2`,y:`10`,rx:`2`,ry:`2`,key:`6agr2n`}],[`path`,{d:`m17.92 14 3.5-3.5a2.24 2.24 0 0 0 0-3l-5-4.92a2.24 2.24 0 0 0-3 0L10 6`,key:`1o487t`}],[`path`,{d:`M6 18h.01`,key:`uhywen`}],[`path`,{d:`M10 14h.01`,key:`ssrbsk`}],[`path`,{d:`M15 6h.01`,key:`cblpky`}],[`path`,{d:`M18 9h.01`,key:`2061c0`}]]};m.node;var le=a(m),h={name:`key-round`,size:24,node:[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]};h.node;var ue=a(h),g=e(t(),1),_=n();function de(e=10){let t=crypto.getRandomValues(new Uint8Array(e));return Array.from(t,e=>`ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz23456789!@#$%`[e%62]).join(``)}function v({currentUser:e,minPasswordLength:t,onBack:n}){let{t:a}=i(),[m,h]=(0,g.useState)([]),[v,fe]=(0,g.useState)(null),[y,b]=(0,g.useState)(``),[x,S]=(0,g.useState)(1),[C,pe]=(0,g.useState)({page:1,pageSize:20,total:0,totalPages:0}),[w,me]=(0,g.useState)(!0),[T,he]=(0,g.useState)(!1),[ge,_e]=(0,g.useState)(0),[E,D]=(0,g.useState)(``),O=ce(),[k,A]=(0,g.useState)(!1),[j,M]=(0,g.useState)(``),[ve,N]=(0,g.useState)(!1),[P,F]=(0,g.useState)({username:``,displayName:``,password:``,role:`user`,canCreateProjects:!1}),[I,L]=(0,g.useState)(null),[R,z]=(0,g.useState)(``),[ye,B]=(0,g.useState)(null),[V,H]=(0,g.useState)(null),[U,W]=(0,g.useState)(!1),[G,K]=(0,g.useState)(!1),[be,q]=(0,g.useState)(``),[J,Y]=(0,g.useState)(null),[X,xe]=(0,g.useState)(!1),[Se,Z]=(0,g.useState)(``),Q=y.trim(),$=()=>_e(e=>e+1);(0,g.useEffect)(()=>{let e=new AbortController;B(null),me(!0),he(!1),D(``);let t=window.setTimeout(()=>{let t=new URLSearchParams({page:String(x)});Q&&t.set(`q`,Q),p(`/api/admin/users?${t}`,{signal:e.signal}).then(t=>{e.signal.aborted||(h(t.users),fe(t.summary),pe(t.pagination),S(t.pagination.page))}).catch(t=>{e.signal.aborted||(D(f(t)),he(!0))}).finally(()=>{e.signal.aborted||me(!1)})},Q?200:0);return()=>{window.clearTimeout(t),e.abort()}},[Q,x,ge]);let Ce=async()=>{if(!k){if(P.password.length<t)return M(a(`auth.passwordMinimum`,{count:t}));A(!0),M(``),O.clear();try{await p(`/api/admin/users`,{method:`POST`,body:JSON.stringify({username:P.username,displayName:P.displayName||P.username,password:P.password,role:P.role,canCreateProjects:P.canCreateProjects})}),N(!1),F({username:``,displayName:``,password:``,role:`user`,canCreateProjects:!1}),$(),O.show(`create`)}catch(e){M(f(e))}finally{A(!1)}}},we=async e=>{Y({target:e,setting:e.role===`admin`?`demote`:`promote`}),Z(``)},Te=async e=>{Y({target:e,setting:e.canCreateProjects?`denyProjectCreation`:`allowProjectCreation`}),Z(``)},Ee=async()=>{if(!J||X)return;let{target:e,setting:t}=J,n=t===`demote`?{role:`user`}:t===`promote`?{role:`admin`}:{canCreateProjects:t===`allowProjectCreation`};xe(!0),Z(``);try{await p(`/api/admin/users/${e.id}`,{method:`PATCH`,body:JSON.stringify(n)}),$(),Y(null)}catch(e){Z(f(e))}finally{xe(!1)}},De=async()=>{if(I&&R&&!k){if(R.length<t)return M(a(`auth.passwordMinimum`,{count:t}));A(!0),M(``),O.clear();try{await p(`/api/admin/users/${I.id}`,{method:`PATCH`,body:JSON.stringify({password:R})}),O.show(`reset:${I.id}`),L(null),z(``)}catch(e){M(f(e))}finally{A(!1)}}},Oe=async()=>{if(V&&!G){K(!0),q(``);try{await p(`/api/admin/users/${V.id}`,{method:`DELETE`,body:JSON.stringify({deleteProjects:U})}),H(null),W(!1),$()}catch(e){q(f(e))}finally{K(!1)}}},ke=[{key:`totalUsers`,detail:v?a(`users.summary.administrators`,{count:v.administrators}):``},{key:`projectCreators`,detail:v?a(`users.summary.ofUsers`,{count:v.totalUsers}):``},{key:`totalProjects`,detail:v?a(`users.summary.projectOwners`,{count:v.projectOwners}):``}];return(0,_.jsxs)(`section`,{className:`admin-users-page management-page`,children:[(0,_.jsxs)(`div`,{className:`section-title`,children:[(0,_.jsxs)(`div`,{children:[(0,_.jsxs)(`h1`,{children:[(0,_.jsx)(ee,{"aria-hidden":!0,size:25}),a(`users.manage`)]}),(0,_.jsx)(`p`,{className:`muted`,children:a(`users.onlyAdmin`)})]}),(0,_.jsxs)(`button`,{type:`button`,className:`dashboard-back-button`,onClick:n,children:[(0,_.jsx)(te,{size:14}),a(`navigation.backToProjects`)]})]}),(0,_.jsxs)(`div`,{className:`admin-user-layout`,children:[(0,_.jsx)(`dl`,{className:`admin-user-summary`,"aria-label":a(`users.overview`),children:ke.map(({key:e,detail:t})=>(0,_.jsxs)(`div`,{children:[(0,_.jsx)(`dt`,{children:a(`users.summary.${e}`)}),(0,_.jsxs)(`dd`,{className:v?.[e]===0?`admin-user-zero`:void 0,children:[(0,_.jsx)(`strong`,{children:v?.[e]??`—`}),t&&(0,_.jsx)(`span`,{children:t})]})]},e))}),(0,_.jsxs)(`div`,{className:`admin-user-content`,children:[(0,_.jsxs)(`div`,{className:`admin-user-toolbar`,children:[(0,_.jsxs)(`div`,{className:`admin-user-filters`,children:[(0,_.jsxs)(`div`,{className:`admin-user-search`,role:`search`,children:[(0,_.jsx)(oe,{"aria-hidden":!0,size:16}),(0,_.jsx)(`input`,{role:`searchbox`,"aria-label":a(`users.searchPlaceholder`),placeholder:a(`users.searchPlaceholder`),value:y,onChange:e=>{b(e.target.value),S(1)}}),y&&(0,_.jsx)(`button`,{type:`button`,"aria-label":a(`users.clearSearch`),title:a(`users.clearSearch`),onClick:()=>{b(``),S(1)},children:(0,_.jsx)(c,{"aria-hidden":!0,size:14})})]}),Q&&!w&&!T&&(0,_.jsx)(`span`,{className:`admin-user-count`,role:`status`,children:a(`users.total`,{count:C.total})})]}),(0,_.jsxs)(`button`,{className:`primary icon-button admin-user-add`,onClick:()=>{O.clear(),M(``),N(!0)},children:[(0,_.jsx)(u,{"aria-hidden":!0,size:15}),(0,_.jsx)(`span`,{role:`status`,children:a(O.message===`create`?`common.done`:`users.add`)})]})]}),E&&(0,_.jsx)(`p`,{className:`error`,role:`alert`,children:E}),(0,_.jsx)(`div`,{className:`table-card admin-user-table`,"aria-busy":w,children:(0,_.jsxs)(`table`,{children:[(0,_.jsx)(`thead`,{children:(0,_.jsxs)(`tr`,{children:[(0,_.jsx)(`th`,{children:a(`common.user`)}),(0,_.jsx)(`th`,{children:a(`users.role`)}),(0,_.jsx)(`th`,{children:a(`users.createProjects`)}),(0,_.jsx)(`th`,{children:a(`users.ownedProjects`)}),(0,_.jsx)(`th`,{children:a(`users.actions`)})]})}),(0,_.jsx)(`tbody`,{children:w?(0,_.jsx)(`tr`,{children:(0,_.jsx)(`td`,{colSpan:5,className:`admin-user-list-state`,children:(0,_.jsxs)(`span`,{role:`status`,children:[(0,_.jsx)(ae,{className:`spin`,size:16}),a(`common.loading`)]})})}):T?(0,_.jsx)(`tr`,{children:(0,_.jsxs)(`td`,{colSpan:5,className:`admin-user-list-state`,children:[(0,_.jsx)(`span`,{children:a(`users.loadFailed`)}),(0,_.jsx)(`button`,{type:`button`,onClick:$,children:a(`common.retry`)})]})}):m.length===0?(0,_.jsx)(`tr`,{children:(0,_.jsx)(`td`,{colSpan:5,className:`admin-user-list-state`,children:a(Q?`users.noMatches`:`users.empty`)})}):m.map(t=>{let n=t.id===e.id,r=k||X,i=ye===t.id,o=O.message===`reset:${t.id}`;return(0,_.jsxs)(`tr`,{children:[(0,_.jsx)(`td`,{children:(0,_.jsxs)(`div`,{className:`admin-user-identity`,children:[(0,_.jsx)(ne,{userId:t.id,name:t.displayName,username:t.username,avatarStyle:t.avatarStyle,className:`admin-user-avatar`}),(0,_.jsxs)(`div`,{children:[(0,_.jsx)(`strong`,{children:t.displayName}),(0,_.jsxs)(`small`,{children:[`@`,t.username]})]})]})}),(0,_.jsx)(`td`,{children:n?(0,_.jsxs)(`span`,{className:`admin-user-badge`,title:a(`users.selfProtected`),children:[(0,_.jsx)(l,{size:12,"aria-hidden":!0}),a(`common.admin`)]}):(0,_.jsxs)(`select`,{className:`admin-user-role`,"aria-label":a(`users.roleFor`,{username:t.username}),value:t.role,disabled:r,onChange:()=>void we(t),children:[(0,_.jsx)(`option`,{value:`user`,children:a(`common.user`)}),(0,_.jsx)(`option`,{value:`admin`,children:a(`common.admin`)})]})}),(0,_.jsx)(`td`,{children:t.role===`admin`?(0,_.jsxs)(`span`,{className:`admin-user-locked`,title:a(`users.adminCreation`),children:[(0,_.jsx)(l,{size:12,"aria-hidden":!0}),a(`users.alwaysAllowed`)]}):(0,_.jsx)(`button`,{type:`button`,className:`admin-user-switch`,role:`switch`,"aria-checked":t.canCreateProjects,"aria-label":a(`users.creationFor`,{username:t.username}),disabled:r,onClick:()=>void Te(t),children:(0,_.jsx)(`span`,{})})}),(0,_.jsx)(`td`,{className:t.ownedProjects?void 0:`admin-user-zero`,children:t.ownedProjects??0}),(0,_.jsx)(`td`,{children:(0,_.jsxs)(`div`,{className:`admin-user-actions`,children:[(0,_.jsxs)(`div`,{className:`admin-user-action-items`,id:`user-actions-${t.id}`,hidden:!i,children:[(0,_.jsxs)(`button`,{type:`button`,className:`icon-button`,disabled:r,title:a(o?`common.done`:`users.resetPassword`),"aria-label":a(`users.resetPassword`),onClick:()=>{O.clear(),L(t),z(``),M(``)},children:[o?(0,_.jsx)(ie,{className:`admin-user-action-confirmation`,"aria-hidden":!0,size:15}):(0,_.jsx)(ue,{"aria-hidden":!0,size:15}),(0,_.jsx)(`span`,{className:`sr-only`,role:`status`,children:o?a(`common.done`):``})]}),!n&&(0,_.jsx)(`button`,{type:`button`,className:`icon-button danger-text`,disabled:r,title:a(`users.deleteTitle`),"aria-label":a(`users.deleteTitle`),onClick:()=>{H(t),W(!1),q(``)},children:(0,_.jsx)(s,{size:15,"aria-hidden":!0})})]}),(0,_.jsx)(`button`,{type:`button`,className:`icon-button admin-user-action-toggle`,disabled:r,"aria-label":a(`users.actionsFor`,{username:t.username}),"aria-expanded":i,"aria-controls":`user-actions-${t.id}`,onClick:()=>B(i?null:t.id),children:(0,_.jsx)(re,{size:17,"aria-hidden":!0})})]})})]},t.id)})})]})}),C.totalPages>1&&(0,_.jsxs)(`nav`,{className:`project-pagination admin-user-pagination`,"aria-label":a(`users.pagination`),children:[(0,_.jsxs)(`button`,{type:`button`,disabled:w||T||C.page<=1,onClick:()=>S(C.page-1),children:[(0,_.jsx)(r,{size:15}),a(`users.previousPage`)]}),(0,_.jsx)(`span`,{children:a(`users.pageOf`,{page:C.page,totalPages:C.totalPages})}),(0,_.jsxs)(`button`,{type:`button`,disabled:w||T||C.page>=C.totalPages,onClick:()=>S(C.page+1),children:[a(`users.nextPage`),(0,_.jsx)(o,{size:15})]})]})]})]}),(0,_.jsxs)(d,{className:`management-dialog`,open:ve,title:a(`users.add`),description:a(`users.addDescription`),onOpenChange:e=>{k||N(e)},footer:(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(`button`,{className:`icon-button`,disabled:k,onClick:()=>N(!1),children:[(0,_.jsx)(c,{"aria-hidden":!0,size:14}),a(`common.cancel`)]}),(0,_.jsxs)(`button`,{className:`primary icon-button`,disabled:k||!P.username.trim()||P.password.length<t,onClick:()=>void Ce(),children:[(0,_.jsx)(u,{"aria-hidden":!0,size:14}),a(`users.createUser`)]})]}),children:[j&&(0,_.jsx)(`p`,{className:`error`,role:`alert`,children:j}),(0,_.jsxs)(`fieldset`,{className:`admin-user-form form-stack`,disabled:k,children:[(0,_.jsxs)(`label`,{className:`form-field`,children:[a(`auth.username`),(0,_.jsx)(`input`,{value:P.username,onChange:e=>F({...P,username:e.target.value})})]}),(0,_.jsxs)(`label`,{className:`form-field`,children:[a(`users.displayName`),(0,_.jsx)(`input`,{value:P.displayName,onChange:e=>F({...P,displayName:e.target.value})})]}),(0,_.jsxs)(`label`,{className:`form-field`,children:[a(`users.initialPassword`),(0,_.jsxs)(`span`,{className:`password-generator`,children:[(0,_.jsx)(`input`,{minLength:t,autoComplete:`new-password`,value:P.password,onChange:e=>F({...P,password:e.target.value})}),(0,_.jsxs)(`button`,{type:`button`,title:a(`users.generatePassword`),onClick:()=>F({...P,password:de()}),children:[(0,_.jsx)(le,{size:15}),a(`users.randomPassword`)]})]}),(0,_.jsx)(`small`,{className:`field-hint`,children:a(`auth.passwordMinimum`,{count:t})})]}),(0,_.jsxs)(`label`,{className:`form-field`,children:[a(`users.role`),(0,_.jsxs)(`select`,{value:P.role,onChange:e=>F({...P,role:e.target.value}),children:[(0,_.jsx)(`option`,{value:`user`,children:a(`common.user`)}),(0,_.jsx)(`option`,{value:`admin`,children:a(`common.admin`)})]})]}),(0,_.jsxs)(`label`,{className:`checkbox-field`,children:[(0,_.jsx)(`input`,{type:`checkbox`,checked:P.canCreateProjects||P.role===`admin`,disabled:P.role===`admin`,onChange:e=>F({...P,canCreateProjects:e.target.checked})}),` `,a(`users.allowCreate`)]})]})]}),(0,_.jsxs)(d,{className:`management-dialog`,open:!!I,title:a(`users.resetPassword`),description:a(`users.resetDescription`,{username:I?.username??``}),onOpenChange:e=>{!e&&!k&&L(null)},footer:(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(`button`,{className:`icon-button`,disabled:k,onClick:()=>L(null),children:[(0,_.jsx)(c,{"aria-hidden":!0,size:14}),a(`common.cancel`)]}),(0,_.jsxs)(`button`,{className:`primary icon-button`,disabled:k||R.length<t,onClick:()=>void De(),children:[(0,_.jsx)(ue,{"aria-hidden":!0,size:14}),a(`users.reset`)]})]}),children:[j&&(0,_.jsx)(`p`,{className:`error`,role:`alert`,children:j}),(0,_.jsxs)(`label`,{className:`form-field`,children:[a(`auth.newPassword`),(0,_.jsxs)(`span`,{className:`password-generator`,children:[(0,_.jsx)(`input`,{disabled:k,autoFocus:!0,minLength:t,autoComplete:`new-password`,value:R,onChange:e=>z(e.target.value)}),(0,_.jsxs)(`button`,{type:`button`,disabled:k,onClick:()=>z(de()),children:[(0,_.jsx)(le,{size:15}),a(`users.randomPassword`)]})]}),(0,_.jsx)(`small`,{className:`field-hint`,children:a(`auth.passwordMinimum`,{count:t})})]})]}),(0,_.jsx)(d,{className:`management-dialog`,open:!!V,title:a(`users.deleteTitle`),description:a(`users.deleteDescription`,{username:V?.username??``}),onOpenChange:e=>{!e&&!G&&(H(null),q(``))},footer:(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(`button`,{className:`icon-button`,disabled:G,onClick:()=>{H(null),q(``)},children:[(0,_.jsx)(c,{"aria-hidden":!0,size:14}),a(`common.cancel`)]}),(0,_.jsxs)(`button`,{className:`danger icon-button`,disabled:G,"aria-busy":G,onClick:()=>void Oe(),children:[G?(0,_.jsx)(ae,{className:`spin`,"aria-hidden":!0,size:14}):(0,_.jsx)(s,{"aria-hidden":!0,size:14}),a(G?`common.loading`:`users.deleteTitle`)]})]}),children:(0,_.jsxs)(_.Fragment,{children:[be&&(0,_.jsx)(`p`,{className:`error dialog-error`,children:be}),(0,_.jsxs)(`fieldset`,{className:`choice-group`,disabled:G,children:[(0,_.jsx)(`legend`,{children:a(`users.ownedChoice`,{count:V?.ownedProjects??0})}),(0,_.jsxs)(`label`,{children:[(0,_.jsx)(`input`,{type:`radio`,checked:!U,onChange:()=>W(!1)}),` `,a(`users.transferProjects`)]}),(0,_.jsxs)(`label`,{children:[(0,_.jsx)(`input`,{type:`radio`,checked:U,onChange:()=>W(!0)}),` `,a(`users.deleteProjects`)]})]})]})}),(0,_.jsx)(se,{open:!!J,title:a(`userConfirmations.${J?.setting??`demote`}Title`),description:a(`userConfirmations.${J?.setting??`demote`}Description`,{username:J?.target.username??``}),confirmLabel:a(`userConfirmations.${J?.setting??`demote`}Confirm`),danger:J?.setting!==`promote`&&J?.setting!==`allowProjectCreation`,busy:X,error:Se,onCancel:()=>{X||(Y(null),Z(``))},onConfirm:()=>void Ee()})]})}export{v as AdminUsers};
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./react-DUEFWlB7.js";import{t}from"./createLucideIcon-CDYIzuiB.js";var n={name:`circle-off`,size:24,node:[[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.35 2.69A10 10 0 0 1 21.3 15.65`,key:`1pfsoa`}],[`path`,{d:`M19.08 19.08A10 10 0 1 1 4.92 4.92`,key:`1ablyi`}]]};n.node;var r=t(n),i={codex:`Codex`,opencode:`OpenCode`,claude:`Claude Code`},a=65536;function o(e){let t=[];for(let n=0;n<e.length;){let r=Math.min(e.length,n+a),i=e.charCodeAt(r-1);r<e.length&&i>=55296&&i<=56319&&r--,t.push(e.slice(n,r)),n=r}return t}var s=e(),c={codex:{path:`M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z`},opencode:{path:`M16 6H8v12h8V6zm4 16H4V2h16v20z`},claude:{color:`#D97757`,path:`M20.998 10.949H24v3.102h-3v3.028h-1.487V20H18v-2.921h-1.487V20H15v-2.921H9V20H7.488v-2.921H6V20H4.487v-2.921H3V14.05H0V10.95h3V5h17.998v5.949zM6 10.949h1.488V8.102H6v2.847zm10.51 0H18V8.102h-1.49v2.847z`}};function l({agent:e,size:t=18}){let n=c[e];return(0,s.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,width:t,height:t,className:`agent-identity-icon`,fill:n.color??`currentColor`,"aria-hidden":`true`,focusable:`false`,children:(0,s.jsx)(`path`,{d:n.path,fillRule:`evenodd`,clipRule:`evenodd`})})}export{r as i,i as n,o as r,l as t};
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.agent-management{gap:20px;min-width:0;padding-bottom:28px;display:grid}.agent-management .section-title{margin-bottom:0}.agent-management h1{align-items:center;gap:10px;display:flex}.agent-management button,.agent-terminal-panel button{border:1px solid var(--ui-border,#d4ddd7);background:var(--ui-surface,#fff);color:var(--ui-text,#273a2f);cursor:pointer;border-radius:6px;justify-content:center;align-items:center;gap:5px;padding:6px 10px;font-size:12px;display:inline-flex}.agent-management button:hover:not(:disabled),.agent-terminal-panel button:hover:not(:disabled){background:var(--ui-hover,#edf4ef)}.agent-management button:disabled,.agent-terminal-panel button:disabled{opacity:.45;cursor:default}.agent-management button.primary,.agent-terminal-panel button.primary{background:var(--ui-accent,#176b44);color:var(--ui-surface,#fff);border-color:#0000}.agent-management button.primary:hover:not(:disabled),.agent-terminal-panel button.primary:hover:not(:disabled){background:color-mix(in srgb, var(--ui-accent,#176b44), #000 12%)}.agent-management input:not([type=checkbox]),.agent-management select,.agent-terminal-panel input:not([type=checkbox]){border:1px solid var(--ui-border,#d4ddd7);background:var(--ui-surface,#fff);min-width:0;color:var(--ui-text,#273a2f);border-radius:6px;padding:7px 9px;font-size:12px}.agent-policy-card{border:1px solid var(--ui-border,#d8e1db);background:var(--ui-surface,#fff);border-radius:12px;padding:20px}.agent-policy-heading,.agent-policy-actions{align-items:center;gap:10px;display:flex}.agent-policy-heading{flex-wrap:wrap;justify-content:space-between}.agent-policy-heading strong{font-size:14px}.agent-policy-title{align-items:center;gap:5px;display:inline-flex}.agent-management .agent-policy-help{width:24px;height:24px;color:var(--ui-muted,#788178);background:0 0;border:0;border-radius:50%;flex:none;padding:0}.agent-policy-help:focus-visible{outline:2px solid var(--ui-accent,#176b44);outline-offset:2px}.agent-catalog{grid-template-columns:repeat(auto-fill,minmax(min(100%,220px),1fr));gap:12px;margin-top:18px;display:grid}.agent-catalog-item{border:1px solid var(--ui-border,#d8e1db);cursor:pointer;border-radius:8px;align-items:flex-start;gap:10px;min-width:0;padding:14px;display:flex}.agent-catalog-item input{accent-color:#23704c;flex:none;margin:3px 0 0}.agent-catalog-details{overflow-wrap:anywhere;min-width:0}.agent-catalog-item strong{align-items:center;gap:8px;font-size:14px;display:flex}.agent-identity{align-items:center;gap:7px;display:inline-flex}.agent-identity-icon{flex:none}.agent-catalog-item small{color:var(--ui-muted,#788178);margin-top:6px;font-size:11px;display:block}.agent-catalog-item.unavailable{opacity:.6}.agent-list-controls{flex-wrap:wrap;align-items:center;gap:9px;display:flex}.agent-list-reminder{border:1px solid var(--ui-border,#d8e1db);background:var(--ui-subtle,#f3f6f3);color:var(--ui-warning,#805a24);border-radius:8px;align-items:flex-start;gap:7px;margin:0;padding:10px 12px;font-size:12px;line-height:1.5;display:flex}.agent-list-reminder>svg,.agent-execution-reminder>svg{flex:none;margin-top:2px}.agent-list-controls>input{flex:130px;max-width:220px}.agent-list-controls small{color:var(--ui-muted,#788178)}.agent-toolbar-spacer{flex:1}.agent-bulk-actions{align-items:center;gap:10px;font-size:12px;display:flex}.agent-table-scroll{min-width:0;overflow-x:auto}.agent-task-table{border-collapse:collapse;width:100%;min-width:760px}.agent-task-table th{white-space:nowrap}.agent-task-table td{vertical-align:middle;font-size:12px}.agent-task-table td small{margin-top:5px;display:block}.agent-task-table tr.selected{background:var(--ui-accent-bg,#eaf3ed)}.agent-task-name{text-overflow:ellipsis;white-space:nowrap;vertical-align:middle;max-width:230px;display:inline-block;overflow:hidden}.agent-task-table .agent-table-time{color:var(--ui-muted,#788178);white-space:nowrap;font-variant-numeric:tabular-nums;font-size:11px}.agent-table-time time,.agent-table-user{cursor:default;border-radius:3px}.agent-table-time time:focus-visible,.agent-table-user:focus-visible{outline:2px solid var(--ui-accent,#176b44);outline-offset:3px}.agent-time-heading{align-items:center;gap:5px;display:inline-flex}.agent-state-badge{background:var(--ui-hover,#eef2ef);color:var(--ui-muted,#788178);white-space:nowrap;border-radius:5px;padding:4px 7px;font-size:11px;display:inline-block}.agent-state-badge.running,.agent-state-badge.starting{background:var(--ui-accent-bg,#eaf3ed);color:var(--ui-accent,#236544)}.agent-state-badge.failed{color:var(--ui-danger,#a33c36)}.agent-row-actions{white-space:nowrap}.agent-action-confirmation{color:var(--ui-info,#2563b4)}.agent-management button.agent-danger,.agent-terminal-panel button.agent-danger{color:var(--ui-danger,#a33c36)}.agent-management .project-pagination{margin-top:0}.agent-delete-item{border-bottom:1px solid var(--ui-border,#d8e1db);gap:6px;padding:12px 0;font-size:13px;display:grid}.agent-delete-item small{color:var(--ui-muted,#788178)}.agent-delete-item:last-child{border-bottom:0}.agent-terminal-panel{background:var(--ui-surface,#fafbf9);min-width:0;height:100%;color:var(--ui-text,#273a2f);flex-direction:column;display:flex;overflow:hidden}.agent-terminal-heading{border-bottom:1px solid var(--ui-border,#d8e1db);flex:none;align-items:center;gap:6px;padding:6px 8px;display:flex}.agent-terminal-heading>strong{align-items:center;gap:5px;font-size:11px;font-weight:600;display:flex}.agent-terminal-panel .agent-session-help{width:22px;height:22px;color:var(--ui-muted,#788178);background:0 0;border:0;border-radius:50%;flex:none;padding:0}.agent-session-help:focus-visible{outline:2px solid var(--ui-accent,#176b44);outline-offset:2px}.agent-task-tabs{flex:1;gap:4px;min-width:0;display:flex;overflow-x:auto}.agent-task-tabs button{background:0 0;border-color:#0000;flex:none;max-width:210px;padding:5px 7px;font-size:11px}.agent-task-tabs button>span:not(.agent-state-dot){text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.agent-task-tabs button.active{border-color:var(--ui-accent-border,#b4d0be);background:var(--ui-accent-bg,#eaf3ed)}.agent-task-tabs small{color:var(--ui-muted,#788178);font-size:10px}.agent-state-dot{background:var(--ui-muted,#8b948d);border-radius:50%;flex:none;width:5px;height:5px}.agent-state-dot.running{background:#389c68;box-shadow:0 0 0 2px #389c6818}.agent-task-toolbar{border-bottom:1px solid var(--ui-border,#d8e1db);flex-wrap:wrap;flex:none;align-items:center;gap:5px;padding:5px 8px;display:flex}.agent-task-toolbar button{padding:4px 6px;font-size:11px}.agent-task-state{color:var(--ui-muted,#788178);padding-left:4px;font-size:10px}.agent-task-create{flex-wrap:wrap;flex:none;gap:7px;padding:8px;display:flex}.agent-task-create input{flex:120px}.agent-terminal-panel .agent-select-trigger{justify-content:flex-start;min-width:150px;max-width:100%;padding:7px 9px}.agent-select-trigger>span{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.agent-select-trigger>svg:last-child{color:var(--ui-muted,#788178);flex:none;margin-left:auto}.agent-select-trigger:focus-visible{outline:2px solid var(--ui-accent,#176b44);outline-offset:2px}.agent-select-options{z-index:120;min-width:max(200px, var(--radix-dropdown-menu-trigger-width));max-width:calc(100vw - 16px);max-height:var(--radix-dropdown-menu-content-available-height);border:1px solid var(--ui-border,#cbd5ce);background:var(--ui-raised,#fff);color:var(--ui-text,#273a2f);border-radius:8px;padding:4px;overflow-y:auto;box-shadow:0 8px 24px #071c2426}.agent-select-option{cursor:pointer;user-select:none;border-radius:5px;outline:none;align-items:center;gap:9px;min-height:34px;padding:7px 9px;font-size:12px;display:flex}.agent-select-option[data-highlighted]{background:var(--ui-hover,#edf4ef)}.agent-select-option[data-disabled]{opacity:.5;cursor:default}.agent-select-label{flex-direction:column;flex:1;gap:3px;min-width:0;display:flex}.agent-select-label small{color:var(--ui-muted,#788178);font-size:10px}.agent-select-check{color:var(--ui-accent,#176b44);flex:none;margin-left:auto;display:flex}.agent-terminal-body{background:var(--terminal-bg);min-height:0;color:var(--terminal-fg);flex:1;overflow:hidden}.agent-terminal-surface{background:var(--terminal-bg);height:100%;color:var(--terminal-fg);flex-direction:column;display:flex;overflow:hidden}.agent-xterm{background:var(--terminal-bg);flex:1;min-width:0;min-height:0;padding:7px 5px;overflow:hidden}.agent-xterm .xterm{height:100%}.agent-terminal-status{background:var(--ui-surface,#fafbf9);color:var(--ui-muted,#788178);flex:none;justify-content:space-between;align-items:center;gap:8px;padding:5px 10px;font-size:11px;display:flex}.agent-execution-reminder{border-top:1px solid var(--ui-border,#d8e1db);color:var(--ui-muted,#788178);flex:none;align-items:flex-start;gap:6px;margin:0;padding:5px 10px;font-size:11px;line-height:1.5;display:flex}.agent-task-empty{text-align:center;min-height:90px;color:var(--ui-muted,#788178);flex-direction:column;justify-content:center;align-items:center;gap:9px;padding:28px 20px 36px;display:flex}.agent-terminal-body .agent-task-empty{height:100%;color:var(--terminal-muted)}.agent-task-empty strong{color:var(--ui-text,#273a2f);font-size:13px}.agent-terminal-body .agent-task-empty strong{color:var(--terminal-fg)}.agent-task-empty p{max-width:470px;margin:0;font-size:12px;line-height:1.6}.agent-inline-error,.agent-inline-warning{flex:none;align-items:center;gap:6px;margin:0;padding:6px 10px;font-size:11px;display:flex}.agent-inline-error{justify-content:space-between}.agent-inline-warning{border-block:1px solid var(--ui-danger-border,#e9b6b0);background:var(--ui-danger-bg,#fff3f1);color:var(--ui-danger,#b3261e);align-items:flex-start;line-height:1.5}.agent-inline-warning>svg{flex:none;margin-top:1px}@media (width<=900px){.agent-terminal-heading>strong{font-size:0}}@media (width<=1250px){.agent-management .agent-table-scroll{background:0 0;border:0;border-radius:0;overflow:visible}.agent-task-table{min-width:0;display:block}.agent-task-table thead{margin-bottom:8px;display:block}.agent-task-table thead tr{display:block}.agent-task-table thead th{clip-path:inset(50%);width:1px;height:1px;padding:0;position:absolute;overflow:hidden}.agent-task-table thead th:first-child{clip-path:none;background:0 0;border:0;align-items:center;gap:8px;width:auto;height:auto;padding:0;display:inline-flex;position:static;overflow:visible}.agent-task-table thead th:first-child:after{content:attr(data-label);color:var(--ui-muted,#788178);font-size:11px;font-weight:400}.agent-task-table tbody{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;display:grid}.agent-task-table tbody tr{border:1px solid var(--ui-border,#d8e1db);background:var(--ui-surface,#fff);border-radius:10px;grid-template-rows:auto auto 1fr auto auto;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 12px;min-width:0;padding:14px;display:grid;position:relative}.agent-task-table tbody td{overflow-wrap:anywhere;border:0;min-width:0;padding:0}.agent-task-table tbody td[data-label]:before{content:attr(data-label);color:var(--ui-muted,#788178);margin-bottom:5px;font-size:10px;line-height:1.4;display:block}.agent-task-table .agent-task-selection{position:absolute;top:12px;right:12px}.agent-task-table .agent-task-selection input{width:18px;height:18px;margin:0}.agent-task-table .agent-table-task{grid-column:1/-1;padding-right:28px}.agent-task-table .agent-task-name{white-space:normal;overflow-wrap:anywhere;max-width:100%;display:block}.agent-task-table .agent-project-name{-webkit-line-clamp:2;-webkit-box-orient:vertical;max-height:3em;line-height:1.5;display:-webkit-box;overflow:hidden}.agent-task-table .agent-table-task strong{font-size:13px;line-height:1.5}.agent-task-table .agent-table-time{white-space:normal;grid-column:1/-1}.agent-task-table .agent-row-actions{border-top:1px solid var(--ui-border,#d8e1db);grid-column:1/-1;justify-content:flex-end;gap:8px;padding-top:10px;display:flex}.agent-task-table .agent-row-actions button{min-height:44px;margin:0}.agent-task-table .agent-row-actions .agent-icon-button{min-width:44px}.agent-bulk-actions{flex-wrap:wrap}}@media (width<=600px){.agent-task-table tbody{grid-template-columns:minmax(0,1fr)}.agent-list-controls>input{max-width:none}}@media (width<=550px){.agent-policy-card{padding:13px}}
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-DUEFWlB7.js";import{_ as r,r as i,u as a}from"./relativeTime-DlKXhH_h.js";import{t as ee}from"./useTranslation-DwkoADSz.js";import{t as te}from"./arrow-down-C_4f1E-E.js";import{E as o,H as ne,T as s,U as re,c,w as ie}from"./useDeletionTransitions-TAZINdHX.js";import{t as l}from"./circle-check-CunlnBPw.js";import{i as u,n as d,t as f}from"./AgentIcon-DsoMeMA8.js";import{t as ae}from"./InfoPopover-Dkz742vJ.js";import{t as p}from"./loader-circle-DKGyi5EK.js";import{t as m}from"./refresh-cw-IqExWG6S.js";import{t as oe}from"./SaveButton-wiTpGLho.js";import{c as se,d as h,m as g}from"./index-Bdb2ITID.js";import{t as ce}from"./SuccessNotice-ubBtzzi_.js";var _=e(t(),1),v=n();function y({user:e,onBack:t}){let{t:n,i18n:y}=ee(),{showExecutionReminder:le}=a(),b=e.role===`admin`,x=b?`/api/admin/agent-tasks`:`/api/agent-tasks`,[S,C]=(0,_.useState)(null),[w,T]=(0,_.useState)({allowed:[]}),[E,ue]=(0,_.useState)({tasks:[],page:1,pageSize:50,total:0}),[D,O]=(0,_.useState)(1),[k,de]=(0,_.useState)(``),[A,fe]=(0,_.useState)(``),[j,pe]=(0,_.useState)(``),[M,me]=(0,_.useState)(``),[he,N]=(0,_.useState)(0),[P,F]=(0,_.useState)(!0),[I,L]=(0,_.useState)(!1),R=(0,_.useRef)(!1),z=(0,_.useRef)(!0),[B,V]=(0,_.useState)(``),H=ce(),[U,W]=(0,_.useState)(new Set),[G,K]=(0,_.useState)([]),[q,J]=(0,_.useState)({});(0,_.useEffect)(()=>(z.current=!0,()=>{z.current=!1}),[]),(0,_.useEffect)(()=>{let e=new AbortController;return g(b?`/api/admin/agents`:`/api/agents`,{signal:e.signal}).then(e=>{C(e),T(e.policy)}).catch(t=>{e.signal.aborted||V(h(t))}),()=>e.abort()},[b]),(0,_.useEffect)(()=>{let e,t=!1,n=()=>{if(document.visibilityState===`hidden`)return;e?.abort(),e=new AbortController;let n=e,r=new URLSearchParams({page:String(D)});k&&r.set(`state`,k),A&&r.set(`agent`,A),j.trim()&&r.set(`project`,j.trim()),M.trim()&&r.set(`user`,M.trim()),g(`${x}?${r}`,{signal:n.signal}).then(e=>{!t&&!n.signal.aborted&&(ue(e),F(!1))}).catch(e=>{!t&&!n.signal.aborted&&(V(h(e)),F(!1))})},r=window.setTimeout(n,150),i=window.setInterval(n,5e3);return window.addEventListener(`focus`,n),()=>{t=!0,e?.abort(),window.clearTimeout(r),window.clearInterval(i),window.removeEventListener(`focus`,n)}},[x,D,k,A,j,M,he]);let Y=async e=>{if(!R.current){R.current=!0,L(!0),V(``),H.clear();try{await e()}catch(e){z.current&&V(h(e))}finally{R.current=!1,i(),z.current&&(L(!1),N(e=>e+1))}}},X=async(e,t)=>{let r=await Promise.allSettled(e.map(e=>g(`${x}/${e.id}${t===`stop`?`/stop`:``}`,{method:t===`stop`?`POST`:`DELETE`}))),i={},a=[];r.forEach((t,n)=>{t.status===`rejected`&&(i[e[n].id]=h(t.reason),a.push(e[n]))}),J(i),W(new Set(a.map(e=>e.id))),t===`delete`&&K(a),a.length?V(n(`agents.operationFailed`)):t===`stop`&&e.length===1&&H.show(`stop:${e[0].id}`)},Z=e=>{V(``),J({}),K(e)},Q=(e,t)=>{e(t),O(1),W(new Set)},$=E.tasks.filter(e=>U.has(e.id));return(0,v.jsxs)(`section`,{className:`agent-management management-page`,children:[(0,v.jsxs)(`div`,{className:`section-title`,children:[(0,v.jsxs)(`div`,{children:[(0,v.jsxs)(`h1`,{children:[(0,v.jsx)(o,{size:25}),n(b?`agents.title`:`agents.tasks`)]}),(0,v.jsx)(`p`,{children:n(b?`agents.description`:`agents.personalDescription`)})]}),(0,v.jsxs)(`button`,{type:`button`,className:`dashboard-back-button`,onClick:t,children:[(0,v.jsx)(re,{size:14}),n(`navigation.backToProjects`)]})]}),B&&!G.length&&(0,v.jsx)(`p`,{className:`error`,role:`alert`,children:B}),b&&(0,v.jsxs)(`section`,{className:`agent-policy-card`,children:[(0,v.jsxs)(`div`,{className:`agent-policy-heading`,children:[(0,v.jsxs)(`div`,{className:`agent-policy-title`,children:[(0,v.jsx)(`strong`,{children:n(`agents.allowedAgents`)}),(0,v.jsx)(ae,{className:`agent-policy-help`,content:n(`agents.usageHint`),size:15})]}),(0,v.jsxs)(`div`,{className:`agent-policy-actions`,children:[(0,v.jsxs)(`button`,{disabled:I,onClick:()=>void Y(async()=>{let e=await g(`/api/admin/agents/refresh`,{method:`POST`});C(e),H.show(`detect`)}),children:[(0,v.jsx)(m,{size:14}),(0,v.jsx)(`span`,{role:`status`,children:n(H.message===`detect`?`common.done`:`agents.detection`)})]}),(0,v.jsx)(oe,{saving:I,feedback:H.message===`policy`?n(`editor.saved`):``,disabled:!S,onClick:()=>void Y(async()=>{let e=await g(`/api/admin/agents`,{method:`PATCH`,body:JSON.stringify(w)});C(e),T(e.policy),H.show(`policy`),window.dispatchEvent(new Event(`texlite:agents-policy`))}),children:n(`common.save`)})]})]}),(0,v.jsx)(`div`,{className:`agent-catalog`,children:S?.agents.map(e=>(0,v.jsxs)(`label`,{className:`agent-catalog-item${e.installed?``:` unavailable`}`,children:[(0,v.jsx)(`input`,{type:`checkbox`,"aria-label":`${n(`agents.allowed`)} ${e.label}`,disabled:I,checked:w.allowed.includes(e.id),onChange:t=>T(n=>({...n,allowed:t.target.checked?[...n.allowed,e.id]:n.allowed.filter(t=>t!==e.id)}))}),(0,v.jsxs)(`div`,{className:`agent-catalog-details`,children:[(0,v.jsxs)(`strong`,{children:[(0,v.jsx)(f,{agent:e.id}),e.label]}),(0,v.jsx)(`small`,{children:e.installed?`${n(`agents.installed`)} · ${e.version??n(`agents.unknown`)}`:n(`agents.notInstalled`)})]})]},e.id))}),S&&!S.ptyAvailable&&(0,v.jsx)(`p`,{className:`error`,children:n(`agents.ptyUnavailable`)})]}),le&&(0,v.jsxs)(`p`,{className:`agent-list-reminder`,children:[(0,v.jsx)(ie,{size:14,"aria-hidden":`true`}),(0,v.jsx)(`span`,{children:n(`agents.endReminder`)})]}),(0,v.jsxs)(`div`,{className:`agent-list-controls`,children:[(0,v.jsxs)(`select`,{"aria-label":n(`agents.state`),value:k,onChange:e=>Q(de,e.target.value),children:[(0,v.jsx)(`option`,{value:``,children:n(`agents.all`)}),(0,v.jsx)(`option`,{value:`running`,children:n(`agents.running`)}),(0,v.jsx)(`option`,{value:`cleanup`,children:n(`agents.cleanup`)})]}),(0,v.jsxs)(`select`,{"aria-label":n(`agents.agent`),value:A,onChange:e=>Q(fe,e.target.value),children:[(0,v.jsx)(`option`,{value:``,children:n(`agents.agent`)}),Object.entries(d).map(([e,t])=>(0,v.jsx)(`option`,{value:e,children:t},e))]}),(0,v.jsx)(`input`,{"aria-label":n(`agents.projectFilter`),placeholder:n(`agents.projectFilter`),value:j,onChange:e=>Q(pe,e.target.value)}),b&&(0,v.jsx)(`input`,{"aria-label":n(`agents.userFilter`),placeholder:n(`agents.userFilter`),value:M,onChange:e=>Q(me,e.target.value)}),(0,v.jsx)(`span`,{className:`agent-toolbar-spacer`}),(0,v.jsx)(`small`,{children:n(`agents.taskCount`,{count:E.total})}),(0,v.jsx)(`button`,{"aria-label":n(`agents.refresh`),disabled:I,onClick:()=>N(e=>e+1),children:(0,v.jsx)(m,{size:14})})]}),$.length>0&&(0,v.jsxs)(`div`,{className:`agent-bulk-actions`,children:[(0,v.jsx)(`span`,{children:n(`agents.selected`,{count:$.length})}),(0,v.jsxs)(`button`,{disabled:I,onClick:()=>void Y(()=>X($,`stop`)),children:[(0,v.jsx)(u,{size:13}),n(`agents.batchEnd`)]}),(0,v.jsxs)(`button`,{className:`agent-danger`,disabled:I,onClick:()=>Z($),children:[(0,v.jsx)(s,{size:13}),n(`agents.batchDelete`)]})]}),(0,v.jsxs)(`div`,{className:`agent-table-scroll table-card`,children:[(0,v.jsxs)(`table`,{className:`agent-task-table`,role:`table`,children:[(0,v.jsx)(`thead`,{children:(0,v.jsxs)(`tr`,{children:[(0,v.jsx)(`th`,{"data-label":n(`agents.all`),children:(0,v.jsx)(`input`,{type:`checkbox`,"aria-label":n(`agents.all`),checked:E.tasks.length>0&&E.tasks.every(e=>U.has(e.id)),onChange:e=>W(new Set(e.target.checked?E.tasks.map(e=>e.id):[]))})}),(0,v.jsx)(`th`,{children:n(`agents.task`)}),(0,v.jsx)(`th`,{children:n(`agents.project`)}),b&&(0,v.jsx)(`th`,{children:n(`agents.user`)}),(0,v.jsx)(`th`,{children:n(`agents.agent`)}),(0,v.jsx)(`th`,{children:n(`agents.state`)}),(0,v.jsx)(`th`,{scope:`col`,"aria-sort":`descending`,children:(0,v.jsxs)(`span`,{className:`agent-time-heading`,children:[n(`agents.updated`),(0,v.jsx)(te,{size:12,"aria-hidden":`true`})]})}),(0,v.jsx)(`th`,{children:n(`agents.actions`)})]})}),(0,v.jsx)(`tbody`,{children:E.tasks.map(e=>(0,v.jsxs)(`tr`,{className:U.has(e.id)?`selected`:``,children:[(0,v.jsx)(`td`,{className:`agent-task-selection`,children:(0,v.jsx)(`input`,{type:`checkbox`,"aria-label":e.title,checked:U.has(e.id),onChange:t=>W(n=>{let r=new Set(n);return t.target.checked?r.add(e.id):r.delete(e.id),r})})}),(0,v.jsx)(`td`,{className:`agent-table-task`,children:(0,v.jsx)(`strong`,{className:`agent-task-name`,title:e.title,children:e.title})}),(0,v.jsx)(`td`,{"data-label":n(`agents.project`),children:(0,v.jsx)(`span`,{className:`agent-task-name agent-project-name`,title:e.projectId,children:e.projectName})}),b&&(0,v.jsx)(`td`,{"data-label":n(`agents.user`),children:(0,v.jsx)(`span`,{className:`agent-table-user`,tabIndex:e.userUsername?0:void 0,"data-tooltip":e.userUsername?`@${e.userUsername}`:void 0,children:e.userName})}),(0,v.jsx)(`td`,{"data-label":n(`agents.agent`),children:(0,v.jsxs)(`span`,{className:`agent-identity`,children:[(0,v.jsx)(f,{agent:e.agentId,size:15}),d[e.agentId]]})}),(0,v.jsxs)(`td`,{"data-label":n(`agents.state`),children:[(0,v.jsx)(`span`,{className:`agent-state-badge ${e.state}`,children:n(`agents.state_${e.state}`)}),e.cleanupState!==`none`&&(0,v.jsx)(`small`,{className:`error`,children:n(`agents.cleanup`)}),e.errorCode&&!q[e.id]&&(0,v.jsx)(`small`,{className:`error`,children:n(`errors.codes.${e.errorCode}`,{defaultValue:n(`agents.taskUnavailable`)})}),q[e.id]&&!G.length&&(0,v.jsx)(`small`,{className:`error`,children:q[e.id]})]}),(0,v.jsx)(`td`,{className:`agent-table-time`,"data-label":n(`agents.updated`),children:(0,v.jsx)(`time`,{dateTime:e.updatedAt,tabIndex:0,"data-tooltip":n(`agents.createdTooltip`,{created:c(e.createdAt,y.resolvedLanguage)}),children:c(e.updatedAt,y.resolvedLanguage,{year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`})})}),(0,v.jsxs)(`td`,{className:`agent-row-actions`,children:[(0,v.jsxs)(`button`,{type:`button`,className:`agent-icon-button`,title:n(`agents.end`),"aria-label":n(`agents.end`),disabled:I||![`running`,`starting`,`stopping`].includes(e.state),onClick:()=>void Y(()=>X([e],`stop`)),children:[H.message===`stop:${e.id}`?(0,v.jsx)(l,{className:`agent-action-confirmation`,size:14,"aria-hidden":`true`}):(0,v.jsx)(u,{size:14,"aria-hidden":`true`}),(0,v.jsx)(`span`,{className:`sr-only`,role:`status`,children:n(H.message===`stop:${e.id}`?`common.done`:`agents.end`)})]}),(0,v.jsx)(`button`,{className:`agent-icon-button agent-danger`,title:n(`agents.delete`),"aria-label":n(`agents.delete`),disabled:I,onClick:()=>Z([e]),children:(0,v.jsx)(s,{size:14})})]})]},e.id))})]}),!E.tasks.length&&(0,v.jsxs)(`div`,{className:`agent-task-empty`,children:[P?(0,v.jsx)(p,{size:24,className:`spin`}):(0,v.jsx)(o,{size:28}),(0,v.jsx)(`strong`,{children:n(P?`common.loading`:`agents.noTasks`)}),!P&&(0,v.jsx)(`p`,{children:n(`agents.noTasksHint`)})]})]}),(0,v.jsxs)(`nav`,{className:`project-pagination agent-pagination`,"aria-label":n(`agents.tasks`),children:[(0,v.jsxs)(`button`,{type:`button`,disabled:I||E.page<=1,onClick:()=>{O(E.page-1),W(new Set)},children:[(0,v.jsx)(r,{size:14,"aria-hidden":`true`}),n(`agents.previous`)]}),(0,v.jsx)(`span`,{children:n(`common.pageOf`,{page:E.page,totalPages:Math.max(1,Math.ceil(E.total/E.pageSize))})}),(0,v.jsxs)(`button`,{type:`button`,disabled:I||E.page*E.pageSize>=E.total,onClick:()=>{O(E.page+1),W(new Set)},children:[n(`agents.next`),(0,v.jsx)(ne,{size:14,"aria-hidden":`true`})]})]}),(0,v.jsxs)(se,{className:`management-dialog`,open:G.length>0,title:n(`agents.delete`),description:n(`agents.bulkDeleteDescription`),onOpenChange:e=>{!e&&!I&&K([])},footer:(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(`button`,{disabled:I,onClick:()=>K([]),children:n(`common.cancel`)}),(0,v.jsxs)(`button`,{className:`danger`,disabled:I,onClick:()=>void Y(()=>X(G,`delete`)),children:[I&&(0,v.jsx)(p,{size:14,className:`spin`}),n(`agents.delete`)]})]}),children:[G.length>1&&(0,v.jsx)(`p`,{children:n(`agents.selected`,{count:G.length})}),G.filter(e=>G.length===1||q[e.id]).map(e=>(0,v.jsxs)(`div`,{className:`agent-delete-item`,children:[(0,v.jsx)(`strong`,{children:e.title}),(0,v.jsxs)(`small`,{children:[e.projectName,` · `,e.userName,` · `,d[e.agentId]]}),q[e.id]&&(0,v.jsx)(`p`,{className:`error`,role:`alert`,children:q[e.id]})]},e.id))]})]})}export{y as AgentManagement};
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./AgentTerminalSurface-B2rwONYs.js","./rolldown-runtime-XKyaHtl9.js","./react-DUEFWlB7.js","./relativeTime-DlKXhH_h.js","./i18nInstance-CIMFwH0l.js","./useTranslation-DwkoADSz.js","./basePath-B5-c90eh.js","./createLucideIcon-CDYIzuiB.js","./useDeletionTransitions-TAZINdHX.js","./dist-B_WjsTVV.js","./es2015-D2UDOM09.js","./index-Bdb2ITID.js","./i18n-Bv4wFb8D.js","./vite-runtime-CRzLMJPS.js","./loader-circle-DKGyi5EK.js","./dist-DdUqlCPw.js","./index-wqKiaXZr.css","./AgentIcon-DsoMeMA8.js","./AgentIcon-dCMgWJG-.css","./AgentTerminalSurface-B5LH8GIb.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-DUEFWlB7.js";import{_ as r,d as i,m as a,r as o,u as s}from"./relativeTime-DlKXhH_h.js";import{t as c}from"./useTranslation-DwkoADSz.js";import{t as l}from"./vite-runtime-CRzLMJPS.js";import{E as u,H as d,T as f,w as p,x as m}from"./useDeletionTransitions-TAZINdHX.js";import{t as h}from"./check-Dw16EqG-.js";import{o as g}from"./dist-B_WjsTVV.js";import{t as _}from"./chevron-up-BHaMUEEA.js";import{i as v,n as y,t as b}from"./AgentIcon-DsoMeMA8.js";import{S as x}from"./sourceCursorStore-C7u-3Gbl.js";import{t as S}from"./InfoPopover-Dkz742vJ.js";import{t as C}from"./loader-circle-DKGyi5EK.js";import{a as w,i as T,l as E,n as D,o as O,s as k,t as A,u as j}from"./dist-Bcdl4EAC.js";import{t as M}from"./SaveButton-wiTpGLho.js";import{c as N,d as P,m as F}from"./index-Bdb2ITID.js";var I=e(t(),1);function L(e){let[t,n]=(0,I.useState)(null),[r,i]=(0,I.useState)({tasks:[],page:1,pageSize:50,total:0}),[a,s]=(0,I.useState)(1),[c,l]=(0,I.useState)(``),[u,d]=(0,I.useState)(``),[f,p]=(0,I.useState)(!1),m=(0,I.useRef)(!1),h=(0,I.useRef)(0),g=(0,I.useRef)(!1),[_,v]=(0,I.useState)(0);(0,I.useEffect)(()=>(g.current=!0,()=>{g.current=!1}),[]),(0,I.useEffect)(()=>{let e=new AbortController;return F(`/api/agents`,{signal:e.signal}).then(n).catch(t=>{e.signal.aborted||d(P(t))}),()=>e.abort()},[e,_]),(0,I.useEffect)(()=>{let t,n=!1,r=()=>{if(document.visibilityState===`hidden`||m.current)return;t?.abort(),t=new AbortController;let r=t,o=h.current,s=new URLSearchParams({project:e,page:String(a)});F(`/api/agent-tasks?${s}`,{signal:r.signal}).then(e=>{n||r.signal.aborted||o!==h.current||(i(e),l(t=>e.tasks.some(e=>e.id===t)?t:e.tasks[0]?.id??``))}).catch(e=>{!n&&!r.signal.aborted&&o===h.current&&d(P(e))})};r();let o=window.setInterval(r,5e3);return window.addEventListener(`focus`,r),()=>{n=!0,t?.abort(),window.clearInterval(o),window.removeEventListener(`focus`,r)}},[e,a,_]);let y=(0,I.useCallback)(()=>v(e=>e+1),[]),b=(0,I.useCallback)(e=>{h.current++,i(t=>({...t,activeTaskId:[`starting`,`running`,`stopping`].includes(e.state)?e.id:t.activeTaskId===e.id?null:t.activeTaskId,tasks:t.tasks.some(t=>t.id===e.id)?t.tasks.map(t=>t.id===e.id?e:t):[e,...t.tasks],total:t.tasks.some(t=>t.id===e.id)?t.total:t.total+1})),m.current||o()},[]);return{catalog:t,result:r,page:a,setPage:s,selectedId:c,setSelectedId:l,selected:r.tasks.find(e=>e.id===c)??null,error:u,setError:d,busy:f,mutate:async e=>{if(!m.current){m.current=!0,h.current++,p(!0),d(``);try{return await e()}catch(e){g.current&&d(P(e))}finally{m.current=!1,o(),g.current&&(p(!1),y())}}},acceptTask:b}}var R=n();function z({agents:e,value:t,onChange:n,disabled:r=!1}){let{t:i}=c(),[a,o]=(0,I.useState)(!1),s=(0,I.useRef)(null),l=e.find(e=>e.id===t),u=r||e.length===0;return(0,I.useEffect)(()=>{u&&o(!1)},[u]),(0,R.jsxs)(A,{modal:!1,open:a,onOpenChange:o,children:[(0,R.jsx)(E,{asChild:!0,children:(0,R.jsxs)(`button`,{ref:s,type:`button`,className:`agent-select-trigger`,disabled:u,"aria-label":l?`${i(`agents.agent`)}: ${l.label}`:i(`agents.agent`),children:[l&&(0,R.jsx)(b,{agent:l.id,size:16}),(0,R.jsx)(`span`,{children:l?.label??i(`agents.agent`)}),(0,R.jsx)(g,{size:13,"aria-hidden":`true`})]})}),(0,R.jsx)(w,{container:s.current?.closest(`[role="dialog"]`),children:(0,R.jsx)(D,{className:`agent-select-options`,side:`top`,align:`start`,sideOffset:5,collisionPadding:8,children:(0,R.jsx)(O,{value:t,"aria-label":i(`agents.agent`),onValueChange:t=>{let r=e.find(e=>e.id===t);!u&&r?.installed&&r.enabled&&n(r.id)},children:e.map(e=>(0,R.jsxs)(k,{value:e.id,textValue:e.label,className:`agent-select-option`,disabled:u||!e.installed||!e.enabled,children:[(0,R.jsx)(b,{agent:e.id,size:16}),(0,R.jsxs)(`span`,{className:`agent-select-label`,children:[e.label,(!e.installed||!e.enabled)&&(0,R.jsx)(`small`,{children:i(e.installed?`agents.disabled`:`agents.notInstalled`)})]}),(0,R.jsx)(T,{className:`agent-select-check`,children:(0,R.jsx)(h,{size:14,"aria-hidden":`true`})})]},e.id))})})})]})}var B=(0,I.lazy)(()=>l(()=>import(`./AgentTerminalSurface-B2rwONYs.js`).then(e=>({default:e.AgentTerminalSurface})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]),import.meta.url));function V({projectId:e,readOnly:t,onHide:n,maximized:o=!1,onToggleMaximized:l}){let{t:h}=c(),w=L(e),T=s(),E=w.selected,[D,O]=(0,I.useState)(!1),[k,A]=(0,I.useState)(``),[P,V]=(0,I.useState)(``),[ee,H]=(0,I.useState)(!1),[U,W]=(0,I.useState)(``),[G,K]=(0,I.useState)(!1),q=E&&[`starting`,`running`,`stopping`].includes(E.state),te=E&&(E.canResume||E.startedAt!==null||[`stopped`,`exited`,`interrupted`].includes(E.state)),J=w.catalog?.agents.find(e=>e.id===E?.agentId),Y=w.catalog?.agents.filter(e=>e.installed&&e.enabled)??[],X=P?w.catalog?.agents.find(e=>e.id===P):Y[0],Z=!!(w.result.activeTaskId&&w.result.activeTaskId!==E?.id),Q=t||w.busy||!!w.result.activeTaskId||!w.catalog?.ptyAvailable||!X?.installed||!X.enabled,ne=!Z&&!t&&J?.installed&&J.enabled&&w.catalog?.ptyAvailable&&E?.cleanupState===`none`,re=e=>{w.setSelectedId(e),H(!1)},$=e=>w.mutate(async()=>{if(!E)return;let t=await F(`/api/agent-tasks/${E.id}${e}`,{method:`POST`});w.acceptTask(t.task)});return(0,R.jsxs)(`section`,{className:`agent-terminal-panel`,"data-agent-terminal":`true`,"aria-label":h(`agents.terminal`),children:[(0,R.jsxs)(`div`,{className:`agent-terminal-heading`,children:[(0,R.jsxs)(`strong`,{children:[(0,R.jsx)(u,{size:14}),h(`agents.terminal`)]}),(0,R.jsx)(S,{className:`agent-session-help`,content:h(`agents.sessionManagementHint`),size:13}),(0,R.jsx)(`div`,{className:`agent-task-tabs`,role:`tablist`,"aria-label":h(`agents.tasks`),children:w.result.tasks.map(e=>(0,R.jsxs)(`button`,{role:`tab`,type:`button`,"aria-selected":e.id===E?.id,title:e.title,className:e.id===E?.id?`active`:``,onClick:()=>re(e.id),children:[(0,R.jsx)(`span`,{className:`agent-state-dot ${e.state}`}),(0,R.jsx)(b,{agent:e.agentId,size:13}),(0,R.jsx)(`span`,{children:e.title}),(0,R.jsx)(`small`,{children:y[e.agentId]})]},e.id))}),(0,R.jsx)(`button`,{className:`agent-icon-button`,disabled:t||w.busy||!Y.length,title:h(`agents.newTask`),"aria-label":h(`agents.newTask`),onClick:()=>O(e=>!e),children:(0,R.jsx)(j,{size:15})}),l&&(0,R.jsx)(`button`,{type:`button`,className:`agent-icon-button`,title:h(o?`agents.restoreTerminal`:`agents.maximizeTerminal`),"aria-label":h(o?`agents.restoreTerminal`:`agents.maximizeTerminal`),"aria-pressed":o,onClick:l,children:o?(0,R.jsx)(g,{size:15}):(0,R.jsx)(_,{size:15})}),(0,R.jsx)(`button`,{className:`agent-icon-button`,title:h(`agents.hide`),"aria-label":h(`agents.hide`),onClick:n,children:(0,R.jsx)(m,{size:15})})]}),(E||w.result.total>w.result.pageSize)&&(0,R.jsxs)(`div`,{className:`agent-task-toolbar`,children:[w.result.total>w.result.pageSize&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`button`,{disabled:w.result.page<=1,"aria-label":h(`agents.previous`),onClick:()=>w.setPage(w.result.page-1),children:(0,R.jsx)(r,{size:13})}),(0,R.jsxs)(`small`,{children:[w.result.page,` / `,Math.ceil(w.result.total/w.result.pageSize)]}),(0,R.jsx)(`button`,{disabled:w.result.page*w.result.pageSize>=w.result.total,"aria-label":h(`agents.next`),onClick:()=>w.setPage(w.result.page+1),children:(0,R.jsx)(d,{size:13})})]}),E&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`span`,{className:`agent-task-state`,children:h(`agents.state_${E.state}`)}),(0,R.jsx)(`span`,{className:`agent-toolbar-spacer`}),q?(0,R.jsxs)(`button`,{disabled:w.busy,onClick:()=>void $(`/stop`),children:[(0,R.jsx)(v,{size:12}),h(`agents.end`)]}):(0,R.jsxs)(`button`,{disabled:!ne||w.busy,onClick:()=>void $(`/start`),children:[(0,R.jsx)(x,{size:13}),h(te?`agents.resume`:`agents.start`)]}),(0,R.jsx)(`button`,{className:`agent-icon-button`,title:h(`agents.rename`),"aria-label":h(`agents.rename`),disabled:w.busy,onClick:()=>{W(E.title),H(e=>!e)},children:(0,R.jsx)(a,{size:13})}),(0,R.jsx)(`button`,{className:`agent-icon-button agent-danger`,title:h(`agents.delete`),"aria-label":h(`agents.delete`),disabled:w.busy,onClick:()=>{w.setError(``),K(!0)},children:(0,R.jsx)(f,{size:13})})]})]}),(D||!E)&&(0,R.jsxs)(`form`,{className:`agent-task-create`,onSubmit:t=>{t.preventDefault(),!Q&&w.mutate(async()=>{let t=X?.id,n=await F(`/api/projects/${e}/agent-tasks`,{method:`POST`,body:JSON.stringify({agentId:t,title:k})});w.acceptTask(n.task),w.setPage(1),w.setSelectedId(n.task.id),O(!1),A(``);let r=await F(`/api/agent-tasks/${n.task.id}/start`,{method:`POST`});w.acceptTask(r.task)})},children:[(0,R.jsx)(`input`,{"aria-label":h(`agents.task`),placeholder:h(`agents.titlePlaceholder`),maxLength:160,value:k,onChange:e=>A(e.target.value),disabled:w.busy||t}),(0,R.jsx)(z,{agents:w.catalog?.agents??[],value:X?.id??``,onChange:V,disabled:t||w.busy}),(0,R.jsxs)(`button`,{type:`submit`,disabled:Q,children:[w.busy&&(0,R.jsx)(C,{className:`spin`,size:13}),h(`agents.create`)]})]}),ee&&E&&(0,R.jsxs)(`form`,{className:`agent-task-create`,onSubmit:e=>{e.preventDefault(),w.mutate(async()=>{let e=await F(`/api/agent-tasks/${E.id}`,{method:`PATCH`,body:JSON.stringify({title:U})});w.acceptTask(e.task),H(!1)})},children:[(0,R.jsx)(`input`,{value:U,onChange:e=>W(e.target.value),required:!0,maxLength:160,"aria-label":h(`agents.task`)}),(0,R.jsx)(M,{type:`submit`,saving:w.busy,children:h(`common.save`)})]}),w.error&&!G&&(0,R.jsxs)(`p`,{className:`error agent-inline-error`,role:`alert`,children:[w.error,(0,R.jsx)(`button`,{onClick:()=>w.setError(``),"aria-label":h(`common.close`),children:(0,R.jsx)(m,{size:13})})]}),E?.errorCode&&!w.error&&!G&&(0,R.jsx)(`p`,{className:`error agent-inline-error`,role:`alert`,children:h(`errors.codes.${E.errorCode}`,{defaultValue:h(`agents.taskUnavailable`)})}),(Z||D&&w.result.activeTaskId)&&(0,R.jsxs)(`p`,{className:`agent-inline-warning`,role:`status`,children:[(0,R.jsx)(p,{size:14,"aria-hidden":`true`}),(0,R.jsx)(`span`,{children:h(`errors.codes.AGENT_PROJECT_BUSY`)})]}),w.catalog&&!w.catalog.ptyAvailable&&(0,R.jsx)(`p`,{className:`error agent-inline-error`,children:h(`agents.ptyUnavailable`)}),(0,R.jsx)(`div`,{className:`agent-terminal-body`,style:i(T.theme),children:(0,R.jsx)(I.Suspense,{fallback:(0,R.jsx)(`div`,{className:`agent-task-empty`,children:(0,R.jsx)(C,{className:`spin`,size:18})}),children:E&&q&&!t?(0,R.jsx)(B,{task:E,onTask:w.acceptTask},E.id):(0,R.jsxs)(`div`,{className:`agent-task-empty`,children:[(0,R.jsx)(u,{size:24}),(0,R.jsx)(`strong`,{children:E?.title||h(`agents.noTasks`)}),(0,R.jsx)(`p`,{children:h(t?`agents.permissionLost`:`agents.readyHint`)}),E?.exitCode!==null&&E?.exitCode!==void 0&&E.exitCode!==0&&(0,R.jsx)(`small`,{children:h(`agents.exitCode`,{code:E.exitCode})})]})})}),T.showExecutionReminder&&q&&E.state!==`stopping`&&(0,R.jsxs)(`p`,{className:`agent-execution-reminder`,children:[(0,R.jsx)(p,{size:12,"aria-hidden":`true`}),(0,R.jsx)(`span`,{children:h(`agents.endReminder`)})]}),E&&(0,R.jsx)(N,{open:G,title:h(`agents.delete`),description:h(`agents.deleteDescription`),onOpenChange:e=>{w.busy||K(e)},footer:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`button`,{disabled:w.busy,onClick:()=>K(!1),children:h(`common.cancel`)}),(0,R.jsxs)(`button`,{className:`danger`,disabled:w.busy,onClick:()=>void w.mutate(async()=>{await F(`/api/agent-tasks/${E.id}`,{method:`DELETE`}),K(!1)}),children:[w.busy&&(0,R.jsx)(C,{className:`spin`,size:13}),h(`agents.delete`)]})]}),children:w.error&&(0,R.jsx)(`p`,{className:`error`,role:`alert`,children:w.error})})]})}export{V as AgentTerminal};
|
|
Binary file
|
|
Binary file
|