texlite 0.22.0 → 0.24.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 +75 -15
- package/OPERATIONS.md +21 -1
- package/README.md +1 -0
- package/README.zh-CN.md +1 -0
- package/addon.md +76 -0
- package/dist/client/assets/AdminUsers-C-8tXzvj.js +1 -0
- package/dist/client/assets/AdminUsers-C-8tXzvj.js.br +0 -0
- package/dist/client/assets/AdminUsers-C-8tXzvj.js.gz +0 -0
- package/dist/client/assets/{AgentIcon-DeoZDwgh.css → AgentIcon-_B7xXJpJ.css} +1 -1
- package/dist/client/assets/AgentIcon-_B7xXJpJ.css.br +0 -0
- package/dist/client/assets/AgentIcon-_B7xXJpJ.css.gz +0 -0
- package/dist/client/assets/{AgentManagement-DlV6tHez.js → AgentManagement-DXgfP7l_.js} +1 -1
- package/dist/client/assets/AgentManagement-DXgfP7l_.js.br +0 -0
- package/dist/client/assets/AgentManagement-DXgfP7l_.js.gz +0 -0
- package/dist/client/assets/AgentTerminal-DD4sskCS.js +2 -0
- package/dist/client/assets/AgentTerminal-DD4sskCS.js.br +0 -0
- package/dist/client/assets/AgentTerminal-DD4sskCS.js.gz +0 -0
- package/dist/client/assets/AgentTerminalSurface-DliOcop5.js +16 -0
- package/dist/client/assets/AgentTerminalSurface-DliOcop5.js.br +0 -0
- package/dist/client/assets/AgentTerminalSurface-DliOcop5.js.gz +0 -0
- package/dist/client/assets/{AvatarSettingsDialog-C8WQhZBK.js → AvatarSettingsDialog-iuEbMO4a.js} +1 -1
- package/dist/client/assets/AvatarSettingsDialog-iuEbMO4a.js.br +0 -0
- package/dist/client/assets/AvatarSettingsDialog-iuEbMO4a.js.gz +0 -0
- package/dist/client/assets/CitationBibtexEditor-CDiYDj3M.js +1 -0
- package/dist/client/assets/{CitationLibraryDialog-DgOIkLwK.js → CitationLibraryDialog-CJlL-Ytx.js} +3 -3
- package/dist/client/assets/CitationLibraryDialog-CJlL-Ytx.js.br +0 -0
- package/dist/client/assets/CitationLibraryDialog-CJlL-Ytx.js.gz +0 -0
- package/dist/client/assets/Dashboard-DqwGd9wd.js +5 -0
- package/dist/client/assets/Dashboard-DqwGd9wd.js.br +0 -0
- package/dist/client/assets/Dashboard-DqwGd9wd.js.gz +0 -0
- package/dist/client/assets/{GitDialog-DGzZ3GRj.js → GitDialog-DUGAigLx.js} +1 -1
- package/dist/client/assets/GitDialog-DUGAigLx.js.br +0 -0
- package/dist/client/assets/GitDialog-DUGAigLx.js.gz +0 -0
- package/dist/client/assets/{GitHubAccountDialog-CGZl3mcY.js → GitHubAccountDialog-B4eD622i.js} +1 -1
- package/dist/client/assets/GitHubAccountDialog-B4eD622i.js.br +0 -0
- package/dist/client/assets/GitHubAccountDialog-B4eD622i.js.gz +0 -0
- package/dist/client/assets/HistoryDialog-upkR8E0L.js +8 -0
- package/dist/client/assets/HistoryDialog-upkR8E0L.js.br +0 -0
- package/dist/client/assets/HistoryDialog-upkR8E0L.js.gz +0 -0
- package/dist/client/assets/{InfoPopover-Ba7GvcuW.js → InfoPopover-CQ3Q10tN.js} +1 -1
- package/dist/client/assets/LatexEditor-DvDYTc0r.js +25 -0
- package/dist/client/assets/LatexEditor-DvDYTc0r.js.br +0 -0
- package/dist/client/assets/LatexEditor-DvDYTc0r.js.gz +0 -0
- package/dist/client/assets/{MarkdownPreview-BH2iwvle.js → MarkdownPreview-_AXp5G7f.js} +1 -1
- package/dist/client/assets/MarkdownPreview-_AXp5G7f.js.br +0 -0
- package/dist/client/assets/MarkdownPreview-_AXp5G7f.js.gz +0 -0
- package/dist/client/assets/{ProjectIconPickerDialog-Bfkaxcnh.js → ProjectIconPickerDialog-BxjEYsau.js} +1 -1
- package/dist/client/assets/ProjectIconPickerDialog-BxjEYsau.js.br +0 -0
- package/dist/client/assets/ProjectIconPickerDialog-BxjEYsau.js.gz +0 -0
- package/dist/client/assets/ProjectSearchDialog-BB8thfK9.js +1 -0
- package/dist/client/assets/ProjectSearchDialog-BB8thfK9.js.br +0 -0
- package/dist/client/assets/ProjectSearchDialog-BB8thfK9.js.gz +0 -0
- package/dist/client/assets/ProjectSettings-Dx-b26uN.js +4 -0
- package/dist/client/assets/ProjectSettings-Dx-b26uN.js.br +0 -0
- package/dist/client/assets/ProjectSettings-Dx-b26uN.js.gz +0 -0
- package/dist/client/assets/ProjectWorkspace-DiurYeU1.js +25 -0
- package/dist/client/assets/ProjectWorkspace-DiurYeU1.js.br +0 -0
- package/dist/client/assets/ProjectWorkspace-DiurYeU1.js.gz +0 -0
- package/dist/client/assets/{QuickOpenDialog-CHjPlBu2.js → QuickOpenDialog-HlkWqVR9.js} +1 -1
- package/dist/client/assets/QuickOpenDialog-HlkWqVR9.js.br +0 -0
- package/dist/client/assets/QuickOpenDialog-HlkWqVR9.js.gz +0 -0
- package/dist/client/assets/ReadOnlySource-BIdN1YP_.js +2 -0
- package/dist/client/assets/SelectionHistoryDialog-Cb8I-G6m.js +3 -0
- package/dist/client/assets/SelectionHistoryDialog-Cb8I-G6m.js.br +0 -0
- package/dist/client/assets/SelectionHistoryDialog-Cb8I-G6m.js.gz +0 -0
- package/dist/client/assets/SharedProjectPage-BBLOLjnD.js +2 -0
- package/dist/client/assets/SharedProjectPage-BBLOLjnD.js.br +0 -0
- package/dist/client/assets/SharedProjectPage-BBLOLjnD.js.gz +0 -0
- package/dist/client/assets/{SystemMetricsDialog-DkmBA4o4.js → SystemMetricsDialog-Dr4pYWG6.js} +1 -1
- package/dist/client/assets/SystemMetricsDialog-Dr4pYWG6.js.br +0 -0
- package/dist/client/assets/SystemMetricsDialog-Dr4pYWG6.js.gz +0 -0
- package/dist/client/assets/{TagManagementDialog-BM1MRuwh.js → TagManagementDialog-D4fYVboy.js} +1 -1
- package/dist/client/assets/TagManagementDialog-D4fYVboy.js.br +0 -0
- package/dist/client/assets/TagManagementDialog-D4fYVboy.js.gz +0 -0
- package/dist/client/assets/{ThemeSwitcher-dcvtWVCO.js → ThemeSwitcher-BgzkYTeA.js} +1 -1
- package/dist/client/assets/TikzGalleryDialog-Bqzl2256.css +1 -0
- package/dist/client/assets/TikzGalleryDialog-Bqzl2256.css.br +0 -0
- package/dist/client/assets/TikzGalleryDialog-Bqzl2256.css.gz +0 -0
- package/dist/client/assets/TikzGalleryDialog-cPUDQ5Wj.js +1 -0
- package/dist/client/assets/TikzGalleryDialog-cPUDQ5Wj.js.br +0 -0
- package/dist/client/assets/TikzGalleryDialog-cPUDQ5Wj.js.gz +0 -0
- package/dist/client/assets/WordCountDialog-AiuR3rra.js +1 -0
- package/dist/client/assets/WordCountDialog-AiuR3rra.js.br +0 -0
- package/dist/client/assets/WordCountDialog-AiuR3rra.js.gz +0 -0
- package/dist/client/assets/{chktex-BrzPYHey.js → chktex--32C-Pkl.js} +1 -1
- package/dist/client/assets/{citationLibrary-DxGdbZEQ.js → citationLibrary-BJRzAgaV.js} +1 -1
- package/dist/client/assets/citationLibrary-BJRzAgaV.js.br +0 -0
- package/dist/client/assets/citationLibrary-BJRzAgaV.js.gz +0 -0
- package/dist/client/assets/editor-CSq7NymY.js +14 -0
- package/dist/client/assets/editor-CSq7NymY.js.br +0 -0
- package/dist/client/assets/editor-CSq7NymY.js.gz +0 -0
- package/dist/client/assets/editor-languages-CKP1xVf6.js +36 -0
- package/dist/client/assets/editor-languages-CKP1xVf6.js.br +0 -0
- package/dist/client/assets/editor-languages-CKP1xVf6.js.gz +0 -0
- package/dist/client/assets/editorThemeExtension-CjBD77yn.js +1 -0
- package/dist/client/assets/editorThemeExtension-CjBD77yn.js.br +0 -0
- package/dist/client/assets/editorThemeExtension-CjBD77yn.js.gz +0 -0
- package/dist/client/assets/file-cog-D_mhAnBe.js +1 -0
- package/dist/client/assets/{generatedParser-CZa2vsK6.js → generatedParser-2izSCuvk.js} +1 -1
- package/dist/client/assets/generatedParser-2izSCuvk.js.br +0 -0
- package/dist/client/assets/generatedParser-2izSCuvk.js.gz +0 -0
- package/dist/client/assets/i18n-Dpk6KCs6.js +13 -0
- package/dist/client/assets/i18n-Dpk6KCs6.js.br +0 -0
- package/dist/client/assets/i18n-Dpk6KCs6.js.gz +0 -0
- package/dist/client/assets/index-B1vejuOw.js +2 -0
- package/dist/client/assets/index-B1vejuOw.js.br +0 -0
- package/dist/client/assets/index-B1vejuOw.js.gz +0 -0
- package/dist/client/assets/index-Blr4J_Pq.css +1 -0
- package/dist/client/assets/index-Blr4J_Pq.css.br +0 -0
- package/dist/client/assets/index-Blr4J_Pq.css.gz +0 -0
- package/dist/client/assets/{relativeTime-mmWGtWRR.js → relativeTime-CcP1IEvr.js} +1 -1
- package/dist/client/assets/relativeTime-CcP1IEvr.js.br +0 -0
- package/dist/client/assets/relativeTime-CcP1IEvr.js.gz +0 -0
- package/dist/client/assets/sourceCursorStore-EycYBVxj.js +1 -0
- package/dist/client/assets/sourceCursorStore-EycYBVxj.js.br +0 -0
- package/dist/client/assets/sourceCursorStore-EycYBVxj.js.gz +0 -0
- package/dist/client/assets/{spellCheck-BTyLQAFH.js → spellCheck-DpWPgtM7.js} +1 -1
- package/dist/client/assets/spellCheck-DpWPgtM7.js.br +0 -0
- package/dist/client/assets/spellCheck-DpWPgtM7.js.gz +0 -0
- package/dist/client/assets/textLanguageSupport-tGXUsMU9.js +1 -0
- package/dist/client/assets/textLanguages-BpqiXyQi.js +78 -0
- package/dist/client/assets/textLanguages-BpqiXyQi.js.br +0 -0
- package/dist/client/assets/textLanguages-BpqiXyQi.js.gz +0 -0
- package/dist/client/assets/useDeletionTransitions-DvxVkRuo.js +1 -0
- package/dist/client/assets/useDeletionTransitions-DvxVkRuo.js.br +0 -0
- package/dist/client/assets/useDeletionTransitions-DvxVkRuo.js.gz +0 -0
- package/dist/client/assets/{vimSupport-C-WiMLjc.js → vimSupport-DMVGjr9R.js} +6 -6
- package/dist/client/assets/vimSupport-DMVGjr9R.js.br +0 -0
- package/dist/client/assets/vimSupport-DMVGjr9R.js.gz +0 -0
- package/dist/client/index.html +3 -3
- package/dist/server/agentChanges.js +95 -7
- package/dist/server/agents/outputBuffer.js +105 -0
- package/dist/server/agents/sessions.js +33 -16
- package/dist/server/agents/workspaces.js +14 -1
- package/dist/server/app.js +2 -0
- package/dist/server/cli.js +12 -1
- package/dist/server/collaboration.js +9 -0
- package/dist/server/config.js +10 -0
- package/dist/server/db.js +64 -0
- package/dist/server/editHistory.js +68 -20
- package/dist/server/git.js +9 -7
- package/dist/server/history.js +160 -69
- package/dist/server/i18n.js +8 -0
- package/dist/server/locales/zh-Hant.js +4 -0
- package/dist/server/projectMutations.js +4 -0
- package/dist/server/routes/comments.js +7 -2
- package/dist/server/routes/compile.js +56 -4
- package/dist/server/routes/projectFiles.js +54 -0
- package/dist/server/routes/projectGit.js +1 -1
- package/dist/server/routes/projectHistory.js +19 -5
- package/dist/server/routes/system.js +1 -0
- package/dist/server/routes/tikzGallery.js +38 -0
- package/dist/server/tikzEditorAddon.js +115 -0
- package/dist/server/tikzEditorRelease.js +9 -0
- package/dist/server/tikzGallery.js +63 -0
- package/dist/shared/agentMessages.js +3 -0
- package/dist/shared/tikzStandalone.js +15 -0
- package/package.json +2 -1
- package/templates/agents/AGENTS.md +12 -0
- package/texlite.config.example.json +4 -0
- package/dist/client/assets/AdminUsers-DepqkT6m.js +0 -1
- package/dist/client/assets/AdminUsers-DepqkT6m.js.br +0 -0
- package/dist/client/assets/AdminUsers-DepqkT6m.js.gz +0 -0
- package/dist/client/assets/AgentIcon-DeoZDwgh.css.br +0 -0
- package/dist/client/assets/AgentIcon-DeoZDwgh.css.gz +0 -0
- package/dist/client/assets/AgentManagement-DlV6tHez.js.br +0 -0
- package/dist/client/assets/AgentManagement-DlV6tHez.js.gz +0 -0
- package/dist/client/assets/AgentTerminal-CvOz5X_j.js +0 -2
- package/dist/client/assets/AgentTerminal-CvOz5X_j.js.br +0 -0
- package/dist/client/assets/AgentTerminal-CvOz5X_j.js.gz +0 -0
- package/dist/client/assets/AgentTerminalSurface-COqg_GdK.js +0 -16
- package/dist/client/assets/AgentTerminalSurface-COqg_GdK.js.br +0 -0
- package/dist/client/assets/AgentTerminalSurface-COqg_GdK.js.gz +0 -0
- package/dist/client/assets/AvatarSettingsDialog-C8WQhZBK.js.br +0 -0
- package/dist/client/assets/AvatarSettingsDialog-C8WQhZBK.js.gz +0 -0
- package/dist/client/assets/CitationBibtexEditor-SpudGDwi.js +0 -1
- package/dist/client/assets/CitationLibraryDialog-DgOIkLwK.js.br +0 -0
- package/dist/client/assets/CitationLibraryDialog-DgOIkLwK.js.gz +0 -0
- package/dist/client/assets/Dashboard-CD1w42mA.js +0 -5
- package/dist/client/assets/Dashboard-CD1w42mA.js.br +0 -0
- package/dist/client/assets/Dashboard-CD1w42mA.js.gz +0 -0
- package/dist/client/assets/GitDialog-DGzZ3GRj.js.br +0 -0
- package/dist/client/assets/GitDialog-DGzZ3GRj.js.gz +0 -0
- package/dist/client/assets/GitHubAccountDialog-CGZl3mcY.js.br +0 -0
- package/dist/client/assets/GitHubAccountDialog-CGZl3mcY.js.gz +0 -0
- package/dist/client/assets/HistoryDialog-DTZxCgyT.js +0 -8
- package/dist/client/assets/HistoryDialog-DTZxCgyT.js.br +0 -0
- package/dist/client/assets/HistoryDialog-DTZxCgyT.js.gz +0 -0
- package/dist/client/assets/LatexEditor-Boc-45KL.js +0 -25
- package/dist/client/assets/LatexEditor-Boc-45KL.js.br +0 -0
- package/dist/client/assets/LatexEditor-Boc-45KL.js.gz +0 -0
- package/dist/client/assets/MarkdownPreview-BH2iwvle.js.br +0 -0
- package/dist/client/assets/MarkdownPreview-BH2iwvle.js.gz +0 -0
- package/dist/client/assets/ProjectIconPickerDialog-Bfkaxcnh.js.br +0 -0
- package/dist/client/assets/ProjectIconPickerDialog-Bfkaxcnh.js.gz +0 -0
- package/dist/client/assets/ProjectSearchDialog-DPIzxVYj.js +0 -1
- package/dist/client/assets/ProjectSearchDialog-DPIzxVYj.js.br +0 -0
- package/dist/client/assets/ProjectSearchDialog-DPIzxVYj.js.gz +0 -0
- package/dist/client/assets/ProjectSettings-ChXx_cmP.js +0 -4
- package/dist/client/assets/ProjectSettings-ChXx_cmP.js.br +0 -0
- package/dist/client/assets/ProjectSettings-ChXx_cmP.js.gz +0 -0
- package/dist/client/assets/ProjectWorkspace-B-w2ix8N.js +0 -25
- package/dist/client/assets/ProjectWorkspace-B-w2ix8N.js.br +0 -0
- package/dist/client/assets/ProjectWorkspace-B-w2ix8N.js.gz +0 -0
- package/dist/client/assets/QuickOpenDialog-CHjPlBu2.js.br +0 -0
- package/dist/client/assets/QuickOpenDialog-CHjPlBu2.js.gz +0 -0
- package/dist/client/assets/ReadOnlySource-DKcmDg0e.js +0 -2
- package/dist/client/assets/SelectionHistoryDialog-Dnj22E8N.js +0 -3
- package/dist/client/assets/SelectionHistoryDialog-Dnj22E8N.js.br +0 -0
- package/dist/client/assets/SelectionHistoryDialog-Dnj22E8N.js.gz +0 -0
- package/dist/client/assets/SharedProjectPage-l8GSYTm-.js +0 -2
- package/dist/client/assets/SharedProjectPage-l8GSYTm-.js.br +0 -0
- package/dist/client/assets/SharedProjectPage-l8GSYTm-.js.gz +0 -0
- package/dist/client/assets/SystemMetricsDialog-DkmBA4o4.js.br +0 -0
- package/dist/client/assets/SystemMetricsDialog-DkmBA4o4.js.gz +0 -0
- package/dist/client/assets/TagManagementDialog-BM1MRuwh.js.br +0 -0
- package/dist/client/assets/TagManagementDialog-BM1MRuwh.js.gz +0 -0
- package/dist/client/assets/WordCountDialog-DI0Jv-fg.js +0 -1
- package/dist/client/assets/WordCountDialog-DI0Jv-fg.js.br +0 -0
- package/dist/client/assets/WordCountDialog-DI0Jv-fg.js.gz +0 -0
- package/dist/client/assets/citationLibrary-DxGdbZEQ.js.br +0 -0
- package/dist/client/assets/citationLibrary-DxGdbZEQ.js.gz +0 -0
- package/dist/client/assets/editor-CkUEg2La.js +0 -14
- package/dist/client/assets/editor-CkUEg2La.js.br +0 -0
- package/dist/client/assets/editor-CkUEg2La.js.gz +0 -0
- package/dist/client/assets/editor-languages-kcWr1Z3Q.js +0 -36
- package/dist/client/assets/editor-languages-kcWr1Z3Q.js.br +0 -0
- package/dist/client/assets/editor-languages-kcWr1Z3Q.js.gz +0 -0
- package/dist/client/assets/editorThemeExtension-BWtZV1Af.js +0 -1
- package/dist/client/assets/editorThemeExtension-BWtZV1Af.js.br +0 -0
- package/dist/client/assets/editorThemeExtension-BWtZV1Af.js.gz +0 -0
- package/dist/client/assets/generatedParser-CZa2vsK6.js.br +0 -0
- package/dist/client/assets/generatedParser-CZa2vsK6.js.gz +0 -0
- package/dist/client/assets/i18n-Dtn6w-qA.js +0 -13
- package/dist/client/assets/i18n-Dtn6w-qA.js.br +0 -0
- package/dist/client/assets/i18n-Dtn6w-qA.js.gz +0 -0
- package/dist/client/assets/index-BbU2fbRw.css +0 -1
- package/dist/client/assets/index-BbU2fbRw.css.br +0 -0
- package/dist/client/assets/index-BbU2fbRw.css.gz +0 -0
- package/dist/client/assets/index-CPR6YZEf.js +0 -2
- package/dist/client/assets/index-CPR6YZEf.js.br +0 -0
- package/dist/client/assets/index-CPR6YZEf.js.gz +0 -0
- package/dist/client/assets/relativeTime-mmWGtWRR.js.br +0 -0
- package/dist/client/assets/relativeTime-mmWGtWRR.js.gz +0 -0
- package/dist/client/assets/sourceCursorStore-BVDvDKeP.js +0 -1
- package/dist/client/assets/sourceCursorStore-BVDvDKeP.js.br +0 -0
- package/dist/client/assets/sourceCursorStore-BVDvDKeP.js.gz +0 -0
- package/dist/client/assets/spellCheck-BTyLQAFH.js.br +0 -0
- package/dist/client/assets/spellCheck-BTyLQAFH.js.gz +0 -0
- package/dist/client/assets/textLanguageSupport-Ck8lMOWz.js +0 -1
- package/dist/client/assets/textLanguages-CwWstpJ5.js +0 -78
- package/dist/client/assets/textLanguages-CwWstpJ5.js.br +0 -0
- package/dist/client/assets/textLanguages-CwWstpJ5.js.gz +0 -0
- package/dist/client/assets/useDeletionTransitions-Ba_yhkrl.js +0 -1
- package/dist/client/assets/useDeletionTransitions-Ba_yhkrl.js.br +0 -0
- package/dist/client/assets/useDeletionTransitions-Ba_yhkrl.js.gz +0 -0
- package/dist/client/assets/vimSupport-C-WiMLjc.js.br +0 -0
- package/dist/client/assets/vimSupport-C-WiMLjc.js.gz +0 -0
- /package/dist/client/assets/{AgentIcon-CA-PfOka.js → AgentIcon-CjaO3WzI.js} +0 -0
- /package/dist/client/assets/{AgentIcon-CA-PfOka.js.br → AgentIcon-CjaO3WzI.js.br} +0 -0
- /package/dist/client/assets/{AgentIcon-CA-PfOka.js.gz → AgentIcon-CjaO3WzI.js.gz} +0 -0
package/DESIGN.md
CHANGED
|
@@ -471,8 +471,11 @@ subscription cleanup without changing or deleting the draft.
|
|
|
471
471
|
|
|
472
472
|
Read permission is intentionally different from edit permission: read-only
|
|
473
473
|
members cannot modify source files, but can view the project and add or reply
|
|
474
|
-
to source comments.
|
|
475
|
-
|
|
474
|
+
to source comments. Only owners and edit members can resolve or reopen a
|
|
475
|
+
discussion, including one a read-only member started; the server refuses the
|
|
476
|
+
change with `COMMENT_RESOLVE_FORBIDDEN` and the workspace hides the button.
|
|
477
|
+
Authors edit and delete their own comments. Comments are anchored to source
|
|
478
|
+
offsets and selected text. If an author is removed,
|
|
476
479
|
the record remains visible as “Deleted User”.
|
|
477
480
|
|
|
478
481
|
The workspace Share button shows a superscript count of explicitly shared
|
|
@@ -889,8 +892,21 @@ as one token, allowing coarser but lossless comparisons of unusually large files
|
|
|
889
892
|
Recovery snapshots are created only for actual file additions, changes, or
|
|
890
893
|
deletions. Settings-only changes update the persistence baseline without adding
|
|
891
894
|
a timeline entry; effective compiler settings are captured with the next file
|
|
892
|
-
change.
|
|
893
|
-
|
|
895
|
+
change. The one exception is the safety checkpoint of a whole-project restore:
|
|
896
|
+
the restore replaces the settings, so the checkpoint is recorded, and shown,
|
|
897
|
+
when only the settings differ from the newest snapshot. Older zero-file-change
|
|
898
|
+
entries are excluded from timeline pagination and previous-version comparisons,
|
|
899
|
+
but are not automatically purged.
|
|
900
|
+
|
|
901
|
+
A version lists the files changed since the newest version that still exists,
|
|
902
|
+
not since the internal persistence baseline. The two differ after an owner
|
|
903
|
+
deletes the newest version; reporting against the remaining version keeps the
|
|
904
|
+
timeline and the pre-restore checkpoint from missing work saved since then.
|
|
905
|
+
When versions are deleted or thinned by retention, the next remaining version
|
|
906
|
+
takes over their changed paths, keeping only files that still differ from its
|
|
907
|
+
new predecessor. An autosave run reports its net change against the version
|
|
908
|
+
before the run, and a run that ends where it started is removed rather than
|
|
909
|
+
kept as an identical restore point. New snapshots
|
|
894
910
|
record UTF-8 text by default; PDFs, images, archives, fonts and other binary
|
|
895
911
|
attachments are excluded. Known resource types are skipped without reading their
|
|
896
912
|
contents; other files must pass the existing UTF-8/text-content check. Writers
|
|
@@ -901,8 +917,8 @@ a file does not create a deletion entry or remove existing recovery data.
|
|
|
901
917
|
Missing paths with overrides remain visible so their choices can be reset.
|
|
902
918
|
|
|
903
919
|
Each new manifest captures its tracking policy. Whole-project restoration keeps
|
|
904
|
-
current files outside that snapshot's scope
|
|
905
|
-
removes managed files created later. The replacement tree is fully staged before
|
|
920
|
+
current files outside that snapshot's scope and currently empty folders,
|
|
921
|
+
restores its managed files and removes managed files created later. The replacement tree is fully staged before
|
|
906
922
|
the live source tree is swapped. Legacy manifests without a tracking policy
|
|
907
923
|
retain their full-tree restoration behavior and historical binary contents;
|
|
908
924
|
upgrading does not rewrite or discard old snapshots. Before a restore, its safety
|
|
@@ -938,7 +954,13 @@ the requested display windows are complete, rather than loading all retained
|
|
|
938
954
|
payloads at once. This budget never shares or
|
|
939
955
|
reduces the 128 MB recovery-snapshot budget. A too-large individual edit burst
|
|
940
956
|
is omitted, and retention removes the oldest records; both deliberately create
|
|
941
|
-
a visible history boundary rather than presenting an unsafe attribution.
|
|
957
|
+
a visible history boundary rather than presenting an unsafe attribution.
|
|
958
|
+
Retention runs with every saved edit batch, so it first compares the project's
|
|
959
|
+
record count and payload total with the limits and, only when one is exceeded,
|
|
960
|
+
reads the oldest records in age order (migration 24 indexes
|
|
961
|
+
`project_edit_segments(project_id, updated_at)`) and removes them until both
|
|
962
|
+
limits hold. That leaves the same newest contiguous suffix as a newest-first
|
|
963
|
+
scan without sorting the whole retained history. When selection history is viewed,
|
|
942
964
|
adjacent records affecting the selection are consolidated into one editing
|
|
943
965
|
session while no pause between them exceeds five minutes, up to a 30-minute
|
|
944
966
|
span; a longer continuous session is split so earlier states stay visible.
|
|
@@ -1505,7 +1527,14 @@ with a retryable conflict instead of inspecting a different passage. The
|
|
|
1505
1527
|
dialog keeps its inspected selection fixed while collaborators keep editing.
|
|
1506
1528
|
Responses include the earliest reconstructed baseline for diffing, and an
|
|
1507
1529
|
explicit `hasMore` flag when the 60-window display limit is reached. This
|
|
1508
|
-
display limit is separate from missing or pruned history boundaries.
|
|
1530
|
+
display limit is separate from missing or pruned history boundaries. "Load
|
|
1531
|
+
older edits" asks for the next 60 windows with an `offset` of the windows
|
|
1532
|
+
already shown. A passage can only be reconstructed by walking back from the
|
|
1533
|
+
current source, so the server walks again and returns the windows after that
|
|
1534
|
+
offset; the pages join, and the new response's baseline replaces the old one.
|
|
1535
|
+
The dialog retries once, after a short pause, when its first or a later request
|
|
1536
|
+
meets the source-changed conflict, because edits typed just before opening may
|
|
1537
|
+
still be reaching the server; a second conflict is reported.
|
|
1509
1538
|
|
|
1510
1539
|
Project snapshots record initial state, acknowledged collaborative saves,
|
|
1511
1540
|
file/source operations, compiler settings, Git operations, checkpoints, and
|
|
@@ -1546,7 +1575,18 @@ directly. Because coalescing never crosses the flag, a flagged snapshot holds
|
|
|
1546
1575
|
agent changes; it can still include human text the agent sync merged. Rows
|
|
1547
1576
|
written before the migration cannot be classified and stay unflagged. File
|
|
1548
1577
|
contents are complete SHA-256-addressed objects; unchanged files are reused
|
|
1549
|
-
across manifests.
|
|
1578
|
+
across manifests. Migration 23 indexes which objects each version uses
|
|
1579
|
+
(`project_history_version_objects`) and how many versions use each object
|
|
1580
|
+
(`project_history_objects`). Database triggers on version inserts, manifest
|
|
1581
|
+
updates and cascading deletes keep both in step, so storage statistics,
|
|
1582
|
+
retention and object clean-up aggregate them instead of parsing every
|
|
1583
|
+
manifest; metadata size comes from SQLite's `octet_length` of the stored text.
|
|
1584
|
+
Migration 25 completes that index and recounts references on databases that
|
|
1585
|
+
ran an unreleased development draft of migration 23 without the counts.
|
|
1586
|
+
The snapshot dialog reloads its first page every 15 seconds while it is open
|
|
1587
|
+
and visible, so collaborators' saves and agent writes appear. The refreshed
|
|
1588
|
+
page replaces the versions it covers and keeps older pages already loaded; a
|
|
1589
|
+
selected snapshot whose manifest changed reloads its details. Under the storage budget nothing is removed. Over it,
|
|
1550
1590
|
retention first thins older history so the budget covers a longer period:
|
|
1551
1591
|
every version from the last 24 hours is kept, then the newest version of each
|
|
1552
1592
|
server-local hour for the last week, then the newest of each server-local day;
|
|
@@ -1860,12 +1900,18 @@ reviewed" and "Mark all reviewed"; previous/next scrolls the editor without
|
|
|
1860
1900
|
taking keyboard focus, and "Open in editor" moves focus there. Where the agent
|
|
1861
1901
|
panel is available, a small agent button after each highlighted change opens
|
|
1862
1902
|
the panel (if needed) and selects that change in the review without moving the
|
|
1863
|
-
editor. The editor
|
|
1864
|
-
unreviewed agent
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1903
|
+
editor. The editor places
|
|
1904
|
+
unreviewed agent ranges only on the exact source revision they were computed
|
|
1905
|
+
for. Once the text has moved on, marks already placed follow the edits and can
|
|
1906
|
+
still be hidden or activated, and a fresh result is requested at a limited rate.
|
|
1907
|
+
The request first pulls a running agent's newest disk write into the edit chain,
|
|
1908
|
+
so its file does not briefly look as if it had no changes. Which changes were
|
|
1909
|
+
reviewed is kept per user and project in browser storage, bounded in size and
|
|
1910
|
+
never dropped because a change is missing from one result. Text that still
|
|
1911
|
+
stands as written is highlighted in whole words, and results are expressed in
|
|
1912
|
+
the editor's `\n` line endings whatever the file has on disk. A rename or move
|
|
1913
|
+
carries the file's edit chain with it. The list refreshes on task events and every few seconds while one of the user's tasks runs.
|
|
1914
|
+
Reviewing never changes source.
|
|
1869
1915
|
|
|
1870
1916
|
Task context JSON and a compile log are exposed through `TEXLITE_PROJECT_CONTEXT`
|
|
1871
1917
|
and `TEXLITE_COMPILE_LOG`; compile API completion refreshes this context. A CLI
|
|
@@ -1897,6 +1943,20 @@ display replay is bounded, slow sockets disconnect without stopping the task,
|
|
|
1897
1943
|
and full transcripts are not persisted by TexLite. Native CLI history can still
|
|
1898
1944
|
exist in task-local or shared host state. Raw terminal replay is a bounded recent stream, not a
|
|
1899
1945
|
complete saved terminal screen; very long full-screen sessions may need a redraw.
|
|
1946
|
+
Replay uses bounded chunks and separately retains common input modes (including
|
|
1947
|
+
bracketed paste and mouse reporting) across truncation. Project permissions are
|
|
1948
|
+
rechecked at most once per second of output and immediately by mutation-driven
|
|
1949
|
+
reconciliation; terminal input and attachment session validity remain checked
|
|
1950
|
+
on each message. View-only attachments follow the PTY's authoritative dimensions
|
|
1951
|
+
instead of fitting to their own panel; narrower panels can scroll horizontally.
|
|
1952
|
+
Git backup status, working diffs, UI commits and ordinary discard exclude the
|
|
1953
|
+
local `.texlite-agent-conflicts/` recovery directory, even if a CLI stages its
|
|
1954
|
+
files. Explicit forced checkout still discards untracked files as documented.
|
|
1955
|
+
|
|
1956
|
+
xterm clears its selection on input, and a CLI with mouse reporting receives
|
|
1957
|
+
clicks and pointer movement as input. While text is selected, the surface
|
|
1958
|
+
withholds right clicks and pointer movement from xterm, and a right click opens
|
|
1959
|
+
TexLite's own Copy menu because the browser's menu does not reliably offer Copy.
|
|
1900
1960
|
|
|
1901
1961
|
Terminal appearance is separate from editor appearance. Its font, size and theme
|
|
1902
1962
|
are browser-local preferences shared across projects and scoped to the
|
package/OPERATIONS.md
CHANGED
|
@@ -233,6 +233,7 @@ preferred.
|
|
|
233
233
|
| --- | --- | --- |
|
|
234
234
|
| `siteName` | `TexLite` | Site title. |
|
|
235
235
|
| `adminEmail` | empty | Optional administrator contact address. |
|
|
236
|
+
| `tikzGallery.enabled` / `tikzGallery.path` | `false` / `addon/texlite-tikz` | Optional figure gallery. A relative path is resolved from the configuration file. |
|
|
236
237
|
| `server.host` / `server.port` | `127.0.0.1` / `3000` | Use `0.0.0.0` to serve a trusted local network; keep localhost behind a tunnel or reverse proxy. |
|
|
237
238
|
| `server.basePath` | `/` | Public URL mount point, such as `/texlite` or `/tools/texlite`. |
|
|
238
239
|
| `storage.dataDir` | XDG data directory | Stores all persistent project data. |
|
|
@@ -444,7 +445,8 @@ deletion) ends execution and synchronizes its last writes first.
|
|
|
444
445
|
|
|
445
446
|
Task-specific CLI state stays under `dataDir/agent-tasks/<task-id>/state/`.
|
|
446
447
|
`TEXLITE_PROJECT_CONTEXT` names a JSON file containing the source directory,
|
|
447
|
-
configured main file, output directory
|
|
448
|
+
configured main file, output directory, last compile result and, when the TikZ
|
|
449
|
+
gallery add-on is enabled and ships one, the path of its `TIKZ.md` guide.
|
|
448
450
|
`TEXLITE_COMPILE_LOG` names its log file; it is refreshed after compilation through
|
|
449
451
|
TexLite. Ask the agent to read these paths when diagnosing a compile failure.
|
|
450
452
|
There is no separate source copy or review/apply step.
|
|
@@ -588,6 +590,24 @@ renderer is bundled and loaded only when a terminal is opened. Linux PTY I/O and
|
|
|
588
590
|
termination are covered by a local, deterministic test agent without any model
|
|
589
591
|
calls; platform/native-agent login behavior should also be checked when deploying.
|
|
590
592
|
|
|
593
|
+
### Copying terminal text
|
|
594
|
+
|
|
595
|
+
Drag across the text, right-click the selection and choose **Copy**. If dragging
|
|
596
|
+
selects nothing because the CLI captures the mouse, hold `Shift` while dragging
|
|
597
|
+
and release it before right-clicking. On macOS that override is not available,
|
|
598
|
+
so text in such a CLI cannot be selected this way.
|
|
599
|
+
|
|
600
|
+
`Ctrl+C` is not a copy shortcut here: it goes to the CLI, normally as an
|
|
601
|
+
interrupt. While text is selected, right clicks and pointer movement are not
|
|
602
|
+
reported to the CLI; a left click clears the selection and restores reporting.
|
|
603
|
+
Text that a CLI selects and copies on its own through OSC 52 does not reach the
|
|
604
|
+
system clipboard.
|
|
605
|
+
|
|
606
|
+
## TikZ gallery add-on
|
|
607
|
+
|
|
608
|
+
The optional TikZ gallery is a beta feature. See [addon.md](addon.md) for
|
|
609
|
+
installation, configuration and use.
|
|
610
|
+
|
|
591
611
|
## Backup and security
|
|
592
612
|
|
|
593
613
|
Back up the entire configured data directory, including `texlite.db`, its WAL
|
package/README.md
CHANGED
|
@@ -136,6 +136,7 @@ for its user-facing configuration and operations guide.
|
|
|
136
136
|
| ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
|
|
137
137
|
| Installation, configuration paths, effective defaults, environment overrides, service management, backups, and security boundaries | [Operations guide](OPERATIONS.md) |
|
|
138
138
|
| Collaboration, source persistence, compilation isolation, history, and design trade-offs | [Design](DESIGN.md) |
|
|
139
|
+
| TikZ gallery add-on (beta) | [TikZ gallery add-on](addon.md) |
|
|
139
140
|
| Testing an npm package before publication | [NPM testing guide](NPM_TESTING.md) |
|
|
140
141
|
| Complete configuration starting point | [texlite.config.example.json](texlite.config.example.json) |
|
|
141
142
|
|
package/README.zh-CN.md
CHANGED
|
@@ -122,6 +122,7 @@ Docker 版的用户配置和日常运维请参见
|
|
|
122
122
|
| -------------------------------------------------------------- | ---------------------------------------------------------- |
|
|
123
123
|
| 安装、配置路径、生效默认值、环境变量、服务管理、备份与安全边界 | [运维指南(英文)](OPERATIONS.md) |
|
|
124
124
|
| 协作、源码持久化、编译隔离、历史版本和设计权衡 | [设计文档(英文)](DESIGN.md) |
|
|
125
|
+
| TikZ 图库扩展(Beta) | [TikZ 图库扩展(英文)](addon.md) |
|
|
125
126
|
| 发布前测试 npm 包 | [NPM 测试指南(英文)](NPM_TESTING.md) |
|
|
126
127
|
| 完整配置起点 | [texlite.config.example.json](texlite.config.example.json) |
|
|
127
128
|
|
package/addon.md
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# TikZ gallery add-on
|
|
2
|
+
|
|
3
|
+
> **Beta.** The TikZ gallery is a beta feature. Its behavior, configuration and
|
|
4
|
+
> figure library may change between releases.
|
|
5
|
+
|
|
6
|
+
The gallery lets you browse editable TikZ and pgfplots figures and copy them into
|
|
7
|
+
a project. The figures live in a separate repository,
|
|
8
|
+
[texlite-tikz](https://github.com/ChenZhongPu/texlite-tikz), and are not shipped
|
|
9
|
+
with TexLite. The feature is off by default. See that repository for its figure
|
|
10
|
+
licenses and for how to add figures.
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
Clone the add-on into `addon/` beside `texlite.config.json` (`texlite config`
|
|
15
|
+
prints `configPath`):
|
|
16
|
+
|
|
17
|
+
~~~bash
|
|
18
|
+
cd <directory containing texlite.config.json>
|
|
19
|
+
git clone https://github.com/ChenZhongPu/texlite-tikz.git addon/texlite-tikz
|
|
20
|
+
~~~
|
|
21
|
+
|
|
22
|
+
Enable it in the configuration, then run `texlite restart`:
|
|
23
|
+
|
|
24
|
+
~~~json
|
|
25
|
+
{
|
|
26
|
+
"tikzGallery": { "enabled": true }
|
|
27
|
+
}
|
|
28
|
+
~~~
|
|
29
|
+
|
|
30
|
+
To keep the add-on elsewhere, also set `tikzGallery.path`. A relative path is
|
|
31
|
+
resolved against the configuration file, and the default is `addon/texlite-tikz`.
|
|
32
|
+
|
|
33
|
+
`texlite doctor` reports how many figures it found. If it fails, either the
|
|
34
|
+
directory has no `catalog.json`, or the catalog format does not match this version
|
|
35
|
+
of TexLite, in which case update TexLite or the add-on.
|
|
36
|
+
|
|
37
|
+
## Update or remove
|
|
38
|
+
|
|
39
|
+
Run `git pull` in the add-on directory to update it. No restart is needed.
|
|
40
|
+
|
|
41
|
+
To remove it, set `tikzGallery.enabled` to `false`, run `texlite restart` and delete
|
|
42
|
+
the directory. Importing copies a figure into the project, so figures already
|
|
43
|
+
imported are not affected.
|
|
44
|
+
|
|
45
|
+
## Use the gallery
|
|
46
|
+
|
|
47
|
+
In a project you can edit, open the **⋯** menu of the file panel and choose
|
|
48
|
+
**TikZ gallery**. Figures are grouped as templates, examples, icons and data plots.
|
|
49
|
+
Searching icons covers every icon category. Choose a figure to see the packages it
|
|
50
|
+
requires, set **Save as**, and import it. The figure is a complete `standalone`
|
|
51
|
+
document that you can edit like any other source file.
|
|
52
|
+
|
|
53
|
+
## Compile a figure to PDF
|
|
54
|
+
|
|
55
|
+
When the open `.tex` file is a standalone TikZ figure, **Compile to PDF** appears
|
|
56
|
+
above the editor. It compiles the figure and saves the PDF beside the source, ready
|
|
57
|
+
for `\includegraphics` in the main document. The engine chosen next to the button
|
|
58
|
+
applies only to figures, leaves the project's own engine unchanged, and is
|
|
59
|
+
remembered per project in this browser.
|
|
60
|
+
|
|
61
|
+
This button does not depend on the add-on. It works for any standalone TikZ figure
|
|
62
|
+
in a project you can edit.
|
|
63
|
+
|
|
64
|
+
## Coding Agents
|
|
65
|
+
|
|
66
|
+
If the add-on includes `TIKZ.md`, Coding Agents read it for TikZ and pgfplots work
|
|
67
|
+
and may copy figures from the add-on, which they treat as read-only. The instruction
|
|
68
|
+
is in the `AGENTS.md` template that TexLite copies into a project only when the
|
|
69
|
+
project has none, so a project with an existing `AGENTS.md` needs the
|
|
70
|
+
"TikZ and pgfplots figures" section added by hand.
|
|
71
|
+
|
|
72
|
+
## Security
|
|
73
|
+
|
|
74
|
+
Only the sources and previews listed in the add-on's catalog are served, and only
|
|
75
|
+
to signed-in users. Even so, treat the repository as you would any other software
|
|
76
|
+
you install on the host.
|
|
@@ -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,x as i}from"./relativeTime-CcP1IEvr.js";import{t as a}from"./useTranslation-DwkoADSz.js";import{t as o}from"./createLucideIcon-CDYIzuiB.js";import{S as ee,T as te,U as ne,d as re,x as s,z as ie}from"./useDeletionTransitions-DvxVkRuo.js";import{t as ae}from"./circle-check-CunlnBPw.js";import{t as oe}from"./InfoPopover-CQ3Q10tN.js";import{t as c}from"./loader-circle-DKGyi5EK.js";import{t as l}from"./lock-keyhole-aC_QjKDi.js";import{t as se}from"./search-DjOWqLig.js";import{t as u}from"./user-plus-NNBQOWDP.js";import{g as d,h as ce,w as f,y as p}from"./index-B1vejuOw.js";import{t as le}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 ue=o(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 g=o(h),_=e(t(),1),v=n();function y(e=10){let t=crypto.getRandomValues(new Uint8Array(e));return Array.from(t,e=>`ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz23456789!@#$%`[e%62]).join(``)}function b({currentUser:e,minPasswordLength:t,onBack:n}){let{t:o}=a(),[m,h]=(0,_.useState)([]),[b,de]=(0,_.useState)(null),[x,S]=(0,_.useState)(``),[C,w]=(0,_.useState)(1),[T,fe]=(0,_.useState)({page:1,pageSize:20,total:0,totalPages:0}),[E,pe]=(0,_.useState)(!0),[D,me]=(0,_.useState)(!1),[he,ge]=(0,_.useState)(0),[_e,O]=(0,_.useState)(``),k=le(),[A,j]=(0,_.useState)(!1),[M,N]=(0,_.useState)(``),[ve,P]=(0,_.useState)(!1),[F,I]=(0,_.useState)({username:``,displayName:``,password:``,role:`user`,canCreateProjects:!1}),[L,R]=(0,_.useState)(null),[z,B]=(0,_.useState)(``),[ye,V]=(0,_.useState)(null),[H,U]=(0,_.useState)(null),[W,G]=(0,_.useState)(!1),[K,be]=(0,_.useState)(!1),[xe,q]=(0,_.useState)(``),[J,Y]=(0,_.useState)(null),[X,Se]=(0,_.useState)(!1),[Ce,Z]=(0,_.useState)(``),Q=x.trim(),$=()=>ge(e=>e+1);(0,_.useEffect)(()=>{let e=new AbortController;V(null),pe(!0),me(!1),O(``);let t=window.setTimeout(()=>{let t=new URLSearchParams({page:String(C)});Q&&t.set(`q`,Q),f(`/api/admin/users?${t}`,{signal:e.signal}).then(t=>{e.signal.aborted||(h(t.users),de(t.summary),fe(t.pagination),w(t.pagination.page))}).catch(t=>{e.signal.aborted||(O(p(t)),me(!0))}).finally(()=>{e.signal.aborted||pe(!1)})},Q?200:0);return()=>{window.clearTimeout(t),e.abort()}},[Q,C,he]);let we=async()=>{if(!A){if(F.password.length<t)return N(o(`auth.passwordMinimum`,{count:t}));j(!0),N(``),k.clear();try{await f(`/api/admin/users`,{method:`POST`,body:JSON.stringify({username:F.username,displayName:F.displayName||F.username,password:F.password,role:F.role,canCreateProjects:F.canCreateProjects})}),P(!1),I({username:``,displayName:``,password:``,role:`user`,canCreateProjects:!1}),$(),k.show(`create`)}catch(e){N(p(e))}finally{j(!1)}}},Te=async e=>{Y({target:e,setting:e.role===`admin`?`demote`:`promote`}),Z(``)},Ee=async e=>{Y({target:e,setting:e.canCreateProjects?`denyProjectCreation`:`allowProjectCreation`}),Z(``)},De=async()=>{if(!J||X)return;let{target:e,setting:t}=J,n=t===`demote`?{role:`user`}:t===`promote`?{role:`admin`}:{canCreateProjects:t===`allowProjectCreation`};Se(!0),Z(``);try{await f(`/api/admin/users/${e.id}`,{method:`PATCH`,body:JSON.stringify(n)}),$(),Y(null)}catch(e){Z(p(e))}finally{Se(!1)}},Oe=async()=>{if(L&&z&&!A){if(z.length<t)return N(o(`auth.passwordMinimum`,{count:t}));j(!0),N(``),k.clear();try{await f(`/api/admin/users/${L.id}`,{method:`PATCH`,body:JSON.stringify({password:z})}),k.show(`reset:${L.id}`),R(null),B(``)}catch(e){N(p(e))}finally{j(!1)}}},ke=async()=>{if(H&&!K){be(!0),q(``);try{await f(`/api/admin/users/${H.id}`,{method:`DELETE`,body:JSON.stringify({deleteProjects:W})}),U(null),G(!1),$()}catch(e){q(p(e))}finally{be(!1)}}},Ae=[{key:`totalUsers`,detail:b?o(`users.summary.administrators`,{count:b.administrators}):``},{key:`projectCreators`,detail:b?o(`users.summary.ofUsers`,{count:b.totalUsers}):``},{key:`totalProjects`,detail:b?o(`users.summary.projectOwners`,{count:b.projectOwners}):``}];return(0,v.jsxs)(`section`,{className:`admin-users-page management-page`,children:[(0,v.jsxs)(`div`,{className:`section-title`,children:[(0,v.jsxs)(`div`,{children:[(0,v.jsxs)(`h1`,{children:[(0,v.jsx)(ee,{"aria-hidden":!0,size:25}),o(`users.manage`)]}),(0,v.jsx)(`p`,{className:`muted`,children:o(`users.onlyAdmin`)})]}),(0,v.jsxs)(`button`,{type:`button`,className:`dashboard-back-button`,onClick:n,children:[(0,v.jsx)(i,{size:14}),o(`navigation.backToProjects`)]})]}),(0,v.jsxs)(`div`,{className:`admin-user-layout`,children:[(0,v.jsx)(`dl`,{className:`admin-user-summary`,"aria-label":o(`users.overview`),children:Ae.map(({key:e,detail:t})=>(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`dt`,{children:o(`users.summary.${e}`)}),(0,v.jsxs)(`dd`,{className:b?.[e]===0?`admin-user-zero`:void 0,children:[(0,v.jsx)(`strong`,{children:b?.[e]??`—`}),t&&(0,v.jsx)(`span`,{children:t})]})]},e))}),(0,v.jsxs)(`div`,{className:`admin-user-content`,children:[(0,v.jsxs)(`div`,{className:`admin-user-toolbar`,children:[(0,v.jsxs)(`div`,{className:`admin-user-filters`,children:[(0,v.jsxs)(`div`,{className:`admin-user-search`,role:`search`,children:[(0,v.jsx)(se,{"aria-hidden":!0,size:16}),(0,v.jsx)(`input`,{role:`searchbox`,"aria-label":o(`users.searchPlaceholder`),placeholder:o(`users.searchPlaceholder`),value:x,onChange:e=>{S(e.target.value),w(1)}}),x&&(0,v.jsx)(`button`,{type:`button`,"aria-label":o(`users.clearSearch`),title:o(`users.clearSearch`),onClick:()=>{S(``),w(1)},children:(0,v.jsx)(s,{"aria-hidden":!0,size:14})})]}),Q&&!E&&!D&&(0,v.jsx)(`span`,{className:`admin-user-count`,role:`status`,children:o(`users.total`,{count:T.total})})]}),(0,v.jsxs)(`button`,{className:`primary icon-button admin-user-add`,onClick:()=>{k.clear(),N(``),P(!0)},children:[(0,v.jsx)(u,{"aria-hidden":!0,size:15}),(0,v.jsx)(`span`,{role:`status`,children:o(k.message===`create`?`common.done`:`users.add`)})]})]}),_e&&(0,v.jsx)(`p`,{className:`error`,role:`alert`,children:_e}),(0,v.jsx)(`div`,{className:`table-card admin-user-table`,"aria-busy":E,children:(0,v.jsxs)(`table`,{children:[(0,v.jsx)(`thead`,{children:(0,v.jsxs)(`tr`,{children:[(0,v.jsx)(`th`,{children:o(`common.user`)}),(0,v.jsx)(`th`,{children:o(`users.role`)}),(0,v.jsx)(`th`,{children:o(`users.createProjects`)}),(0,v.jsx)(`th`,{children:o(`users.ownedProjects`)}),(0,v.jsx)(`th`,{children:o(`users.actions`)})]})}),(0,v.jsx)(`tbody`,{children:E?(0,v.jsx)(`tr`,{children:(0,v.jsx)(`td`,{colSpan:5,className:`admin-user-list-state`,children:(0,v.jsxs)(`span`,{role:`status`,children:[(0,v.jsx)(c,{className:`spin`,size:16}),o(`common.loading`)]})})}):D?(0,v.jsx)(`tr`,{children:(0,v.jsxs)(`td`,{colSpan:5,className:`admin-user-list-state`,children:[(0,v.jsx)(`span`,{children:o(`users.loadFailed`)}),(0,v.jsx)(`button`,{type:`button`,onClick:$,children:o(`common.retry`)})]})}):m.length===0?(0,v.jsx)(`tr`,{children:(0,v.jsx)(`td`,{colSpan:5,className:`admin-user-list-state`,children:o(Q?`users.noMatches`:`users.empty`)})}):m.map(t=>{let n=t.id===e.id,r=A||X,i=ye===t.id,a=k.message===`reset:${t.id}`;return(0,v.jsxs)(`tr`,{children:[(0,v.jsx)(`td`,{children:(0,v.jsxs)(`div`,{className:`admin-user-identity`,children:[(0,v.jsx)(re,{userId:t.id,name:t.displayName,username:t.username,avatarStyle:t.avatarStyle,className:`admin-user-avatar`}),(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`strong`,{children:t.displayName}),(0,v.jsxs)(`small`,{children:[`@`,t.username]})]})]})}),(0,v.jsx)(`td`,{children:n?(0,v.jsxs)(`span`,{className:`admin-user-badge`,title:o(`users.selfProtected`),children:[(0,v.jsx)(l,{size:12,"aria-hidden":!0}),o(`common.admin`)]}):(0,v.jsxs)(`select`,{className:`admin-user-role`,"aria-label":o(`users.roleFor`,{username:t.username}),value:t.role,disabled:r,onChange:()=>void Te(t),children:[(0,v.jsx)(`option`,{value:`user`,children:o(`common.user`)}),(0,v.jsx)(`option`,{value:`admin`,children:o(`common.admin`)})]})}),(0,v.jsx)(`td`,{children:t.role===`admin`?(0,v.jsxs)(`span`,{className:`admin-user-locked`,title:o(`users.adminCreation`),children:[(0,v.jsx)(l,{size:12,"aria-hidden":!0}),o(`users.alwaysAllowed`)]}):(0,v.jsx)(`button`,{type:`button`,className:`admin-user-switch`,role:`switch`,"aria-checked":t.canCreateProjects,"aria-label":o(`users.creationFor`,{username:t.username}),disabled:r,onClick:()=>void Ee(t),children:(0,v.jsx)(`span`,{})})}),(0,v.jsx)(`td`,{className:t.ownedProjects?void 0:`admin-user-zero`,children:t.ownedProjects??0}),(0,v.jsx)(`td`,{children:(0,v.jsxs)(`div`,{className:`admin-user-actions`,children:[(0,v.jsxs)(`div`,{className:`admin-user-action-items`,id:`user-actions-${t.id}`,hidden:!i,children:[(0,v.jsxs)(`button`,{type:`button`,className:`icon-button`,disabled:r,title:o(a?`common.done`:`users.resetPassword`),"aria-label":o(`users.resetPassword`),onClick:()=>{k.clear(),R(t),B(``),N(``)},children:[a?(0,v.jsx)(ae,{className:`admin-user-action-confirmation`,"aria-hidden":!0,size:15}):(0,v.jsx)(g,{"aria-hidden":!0,size:15}),(0,v.jsx)(`span`,{className:`sr-only`,role:`status`,children:a?o(`common.done`):``})]}),!n&&(0,v.jsx)(`button`,{type:`button`,className:`icon-button danger-text`,disabled:r,title:o(`users.deleteTitle`),"aria-label":o(`users.deleteTitle`),onClick:()=>{U(t),G(!1),q(``)},children:(0,v.jsx)(te,{size:15,"aria-hidden":!0})})]}),(0,v.jsx)(`button`,{type:`button`,className:`icon-button admin-user-action-toggle`,disabled:r,"aria-label":o(`users.actionsFor`,{username:t.username}),"aria-expanded":i,"aria-controls":`user-actions-${t.id}`,onClick:()=>V(i?null:t.id),children:(0,v.jsx)(ie,{size:17,"aria-hidden":!0})})]})})]},t.id)})})]})}),T.totalPages>1&&(0,v.jsxs)(`nav`,{className:`project-pagination admin-user-pagination`,"aria-label":o(`users.pagination`),children:[(0,v.jsxs)(`button`,{type:`button`,disabled:E||D||T.page<=1,onClick:()=>w(T.page-1),children:[(0,v.jsx)(r,{size:15}),o(`users.previousPage`)]}),(0,v.jsx)(`span`,{children:o(`users.pageOf`,{page:T.page,totalPages:T.totalPages})}),(0,v.jsxs)(`button`,{type:`button`,disabled:E||D||T.page>=T.totalPages,onClick:()=>w(T.page+1),children:[o(`users.nextPage`),(0,v.jsx)(ne,{size:15})]})]})]})]}),(0,v.jsxs)(d,{className:`management-dialog`,open:ve,title:o(`users.add`),onOpenChange:e=>{A||P(e)},footer:(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(`button`,{className:`icon-button`,disabled:A,onClick:()=>P(!1),children:[(0,v.jsx)(s,{"aria-hidden":!0,size:14}),o(`common.cancel`)]}),(0,v.jsxs)(`button`,{className:`primary icon-button`,disabled:A||!F.username.trim()||F.password.length<t,onClick:()=>void we(),children:[(0,v.jsx)(u,{"aria-hidden":!0,size:14}),o(`users.createUser`)]})]}),children:[M&&(0,v.jsx)(`p`,{className:`error`,role:`alert`,children:M}),(0,v.jsxs)(`fieldset`,{className:`admin-user-form form-stack`,disabled:A,children:[(0,v.jsxs)(`label`,{className:`form-field`,children:[o(`auth.username`),(0,v.jsx)(`input`,{value:F.username,onChange:e=>I({...F,username:e.target.value})})]}),(0,v.jsxs)(`label`,{className:`form-field`,children:[o(`users.displayName`),(0,v.jsx)(`input`,{value:F.displayName,onChange:e=>I({...F,displayName:e.target.value})})]}),(0,v.jsxs)(`div`,{className:`form-field`,children:[(0,v.jsxs)(`div`,{className:`user-password-heading`,children:[(0,v.jsx)(`label`,{htmlFor:`new-user-password`,children:o(`users.initialPassword`)}),(0,v.jsx)(oe,{content:o(`users.addDescription`)})]}),(0,v.jsxs)(`span`,{className:`password-generator`,children:[(0,v.jsx)(`input`,{id:`new-user-password`,minLength:t,autoComplete:`new-password`,value:F.password,onChange:e=>I({...F,password:e.target.value})}),(0,v.jsxs)(`button`,{type:`button`,title:o(`users.generatePassword`),onClick:()=>I({...F,password:y()}),children:[(0,v.jsx)(ue,{size:15}),o(`users.randomPassword`)]})]}),(0,v.jsx)(`small`,{className:`field-hint`,children:o(`auth.passwordMinimum`,{count:t})})]}),(0,v.jsxs)(`label`,{className:`form-field`,children:[o(`users.role`),(0,v.jsxs)(`select`,{value:F.role,onChange:e=>I({...F,role:e.target.value}),children:[(0,v.jsx)(`option`,{value:`user`,children:o(`common.user`)}),(0,v.jsx)(`option`,{value:`admin`,children:o(`common.admin`)})]})]}),(0,v.jsxs)(`label`,{className:`checkbox-field`,children:[(0,v.jsx)(`input`,{type:`checkbox`,checked:F.canCreateProjects||F.role===`admin`,disabled:F.role===`admin`,onChange:e=>I({...F,canCreateProjects:e.target.checked})}),` `,o(`users.allowCreate`)]})]})]}),(0,v.jsxs)(d,{className:`management-dialog`,open:!!L,title:o(`users.resetPassword`),description:o(`users.resetDescription`,{username:L?.username??``}),onOpenChange:e=>{!e&&!A&&R(null)},footer:(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(`button`,{className:`icon-button`,disabled:A,onClick:()=>R(null),children:[(0,v.jsx)(s,{"aria-hidden":!0,size:14}),o(`common.cancel`)]}),(0,v.jsxs)(`button`,{className:`primary icon-button`,disabled:A||z.length<t,onClick:()=>void Oe(),children:[(0,v.jsx)(g,{"aria-hidden":!0,size:14}),o(`users.reset`)]})]}),children:[M&&(0,v.jsx)(`p`,{className:`error`,role:`alert`,children:M}),(0,v.jsxs)(`label`,{className:`form-field`,children:[o(`auth.newPassword`),(0,v.jsxs)(`span`,{className:`password-generator`,children:[(0,v.jsx)(`input`,{disabled:A,autoFocus:!0,minLength:t,autoComplete:`new-password`,value:z,onChange:e=>B(e.target.value)}),(0,v.jsxs)(`button`,{type:`button`,disabled:A,onClick:()=>B(y()),children:[(0,v.jsx)(ue,{size:15}),o(`users.randomPassword`)]})]}),(0,v.jsx)(`small`,{className:`field-hint`,children:o(`auth.passwordMinimum`,{count:t})})]})]}),(0,v.jsx)(d,{className:`management-dialog`,open:!!H,title:o(`users.deleteTitle`),description:o(`users.deleteDescription`,{username:H?.username??``}),onOpenChange:e=>{!e&&!K&&(U(null),q(``))},footer:(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(`button`,{className:`icon-button`,disabled:K,onClick:()=>{U(null),q(``)},children:[(0,v.jsx)(s,{"aria-hidden":!0,size:14}),o(`common.cancel`)]}),(0,v.jsxs)(`button`,{className:`danger icon-button`,disabled:K,"aria-busy":K,onClick:()=>void ke(),children:[K?(0,v.jsx)(c,{className:`spin`,"aria-hidden":!0,size:14}):(0,v.jsx)(te,{"aria-hidden":!0,size:14}),o(K?`common.loading`:`users.deleteTitle`)]})]}),children:(0,v.jsxs)(v.Fragment,{children:[xe&&(0,v.jsx)(`p`,{className:`error dialog-error`,children:xe}),(0,v.jsxs)(`fieldset`,{className:`choice-group`,disabled:K,children:[(0,v.jsx)(`legend`,{children:o(`users.ownedChoice`,{count:H?.ownedProjects??0})}),(0,v.jsxs)(`label`,{children:[(0,v.jsx)(`input`,{type:`radio`,checked:!W,onChange:()=>G(!1)}),` `,o(`users.transferProjects`)]}),(0,v.jsxs)(`label`,{children:[(0,v.jsx)(`input`,{type:`radio`,checked:W,onChange:()=>G(!0)}),` `,o(`users.deleteProjects`)]})]})]})}),(0,v.jsx)(ce,{open:!!J,title:o(`userConfirmations.${J?.setting??`demote`}Title`),description:o(`userConfirmations.${J?.setting??`demote`}Description`,{username:J?.target.username??``}),confirmLabel:o(`userConfirmations.${J?.setting??`demote`}Confirm`),danger:J?.setting!==`promote`&&J?.setting!==`allowProjectCreation`,busy:X,error:Ce,onCancel:()=>{X||(Y(null),Z(``))},onConfirm:()=>void De()})]})}export{b as AdminUsers};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +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}}.agent-review{border-bottom:1px solid var(--ui-border,#d8e1db);background:var(--ui-surface,#f7faf8);flex:none}.agent-review-bar{flex-wrap:wrap;align-items:center;gap:5px;padding:4px 8px;display:flex}.agent-review-bar>button:not(.agent-icon-button){align-items:center;gap:4px;padding:4px 6px;font-size:11px;display:inline-flex}.agent-review-toggle{color:var(--ui-text,#2f4036);background:0 0;border:0;font-weight:650}.agent-review-count{background:var(--ui-accent-bg,#e3efe7);min-width:18px;color:var(--ui-accent,#1d6640);text-align:center;font-variant-numeric:tabular-nums;border-radius:999px;padding:0 5px;font-size:10px;font-weight:700}.agent-review-position{color:var(--ui-muted,#66726a);font-variant-numeric:tabular-nums;font-size:11px}.agent-review-detail{gap:6px;padding:0 10px 8px;display:grid}.agent-review-detail .suggestion-diff{max-height:160px}.agent-review-location{min-width:0;color:var(--ui-muted,#66726a);justify-content:space-between;align-items:center;gap:8px;font-size:11px;display:flex}.agent-review-file{min-width:0;color:var(--ui-accent,#1d6640);background:0 0;border:0;align-items:center;gap:4px;padding:0;font-size:11px;display:inline-flex}.agent-review-file span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.agent-review-file:hover span{text-decoration:underline}.agent-review-unavailable{color:var(--ui-muted,#66726a);margin:0;font-size:11px}.agent-review-actions{justify-content:flex-end;gap:6px;display:flex}.agent-review-actions button{align-items:center;gap:4px;padding:4px 8px;font-size:11px;display:inline-flex}.agent-review-actions button.primary{background:var(--ui-accent,#176b44);color:var(--ui-surface,#fff);border-color:#0000}.agent-review-actions button.primary:hover{filter:brightness(1.08)}.agent-review-tabs{border-bottom:1px solid var(--ui-border,#d8e1db);align-items:center;gap:3px;display:flex}.agent-review-tabs button{color:var(--ui-muted,#68766d);background:0 0;border:0;border-bottom:2px solid #0000;border-radius:4px 4px 0 0;padding:3px 8px 4px;font-size:11px}.agent-review-tabs button:hover{background:var(--ui-hover,#f1f6f2);color:var(--ui-accent,#355840)}.agent-review-tabs button.active{border-bottom-color:var(--ui-accent-border,#34845a);color:var(--ui-accent,#235e3b);font-weight:650}.agent-review-content{white-space:pre-wrap;overflow-wrap:anywhere;max-height:160px;color:var(--ui-text,#28352d);margin:0;font-family:monospace;font-size:11px;line-height:1.7;overflow:auto}.agent-review-content mark{color:inherit;background:color-mix(in srgb, var(--tl-agent-change) 18%, transparent);border-radius:2px}
|
|
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:auto}.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}.spell-suggestions-menu.agent-terminal-menu{min-width:0;font-size:var(--ui-menu-font-size);padding:4px}.agent-terminal-panel .agent-terminal-menu button{color:var(--tl-tooltip-action);background:0 0;border-color:#0000;justify-content:flex-start}.agent-terminal-panel .agent-terminal-menu button:hover:not(:disabled),.agent-terminal-panel .agent-terminal-menu button:focus-visible{border-color:var(--tl-tooltip-hover-border);background:var(--tl-tooltip-hover-bg);outline:none}.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}}.agent-review{border-bottom:1px solid var(--ui-border,#d8e1db);background:var(--ui-surface,#f7faf8);flex:none}.agent-review-bar{flex-wrap:wrap;align-items:center;gap:5px;padding:4px 8px;display:flex}.agent-review-bar>button:not(.agent-icon-button){align-items:center;gap:4px;padding:4px 6px;font-size:11px;display:inline-flex}.agent-review-toggle{color:var(--ui-text,#2f4036);background:0 0;border:0;font-weight:650}.agent-review-count{background:var(--ui-accent-bg,#e3efe7);min-width:18px;color:var(--ui-accent,#1d6640);text-align:center;font-variant-numeric:tabular-nums;border-radius:999px;padding:0 5px;font-size:10px;font-weight:700}.agent-review-position{color:var(--ui-muted,#66726a);font-variant-numeric:tabular-nums;font-size:11px}.agent-review-detail{gap:6px;padding:0 10px 8px;display:grid}.agent-review-detail .suggestion-diff{max-height:160px}.agent-review-location{min-width:0;color:var(--ui-muted,#66726a);justify-content:space-between;align-items:center;gap:8px;font-size:11px;display:flex}.agent-review-file{min-width:0;color:var(--ui-accent,#1d6640);background:0 0;border:0;align-items:center;gap:4px;padding:0;font-size:11px;display:inline-flex}.agent-review-file span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.agent-review-file:hover span{text-decoration:underline}.agent-review-unavailable{color:var(--ui-muted,#66726a);margin:0;font-size:11px}.agent-review-actions{justify-content:flex-end;gap:6px;display:flex}.agent-review-actions button{align-items:center;gap:4px;padding:4px 8px;font-size:11px;display:inline-flex}.agent-review-actions button.primary{background:var(--ui-accent,#176b44);color:var(--ui-surface,#fff);border-color:#0000}.agent-review-actions button.primary:hover{filter:brightness(1.08)}.agent-review-tabs{border-bottom:1px solid var(--ui-border,#d8e1db);align-items:center;gap:3px;display:flex}.agent-review-tabs button{color:var(--ui-muted,#68766d);background:0 0;border:0;border-bottom:2px solid #0000;border-radius:4px 4px 0 0;padding:3px 8px 4px;font-size:11px}.agent-review-tabs button:hover{background:var(--ui-hover,#f1f6f2);color:var(--ui-accent,#355840)}.agent-review-tabs button.active{border-bottom-color:var(--ui-accent-border,#34845a);color:var(--ui-accent,#235e3b);font-weight:650}.agent-review-content{white-space:pre-wrap;overflow-wrap:anywhere;max-height:160px;color:var(--ui-text,#28352d);margin:0;font-family:monospace;font-size:11px;line-height:1.7;overflow:auto}.agent-review-content mark{color:inherit;background:color-mix(in srgb, var(--tl-agent-change) 18%, transparent);border-radius:2px}
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +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-mmWGtWRR.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-Ba_yhkrl.js";import{t as l}from"./circle-check-CunlnBPw.js";import{i as u,n as d,t as f}from"./AgentIcon-CA-PfOka.js";import{t as ae}from"./InfoPopover-Ba7GvcuW.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{g as se,w as h,y as g}from"./index-CPR6YZEf.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 h(b?`/api/admin/agents`:`/api/agents`,{signal:e.signal}).then(e=>{C(e),T(e.policy)}).catch(t=>{e.signal.aborted||V(g(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()),h(`${x}?${r}`,{signal:n.signal}).then(e=>{!t&&!n.signal.aborted&&(ue(e),F(!1))}).catch(e=>{!t&&!n.signal.aborted&&(V(g(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(g(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=>h(`${x}/${e.id}${t===`stop`?`/stop`:``}`,{method:t===`stop`?`POST`:`DELETE`}))),i={},a=[];r.forEach((t,n)=>{t.status===`rejected`&&(i[e[n].id]=g(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 h(`/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 h(`/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};
|
|
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,x as ee}from"./relativeTime-CcP1IEvr.js";import{t as te}from"./useTranslation-DwkoADSz.js";import{t as ne}from"./arrow-down-C_4f1E-E.js";import{E as o,T as s,U as re,c,w as ie}from"./useDeletionTransitions-DvxVkRuo.js";import{t as l}from"./circle-check-CunlnBPw.js";import{i as u,n as d,t as f}from"./AgentIcon-CjaO3WzI.js";import{t as ae}from"./InfoPopover-CQ3Q10tN.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{g as se,w as h,y as g}from"./index-B1vejuOw.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}=te(),{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 h(b?`/api/admin/agents`:`/api/agents`,{signal:e.signal}).then(e=>{C(e),T(e.policy)}).catch(t=>{e.signal.aborted||V(g(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()),h(`${x}?${r}`,{signal:n.signal}).then(e=>{!t&&!n.signal.aborted&&(ue(e),F(!1))}).catch(e=>{!t&&!n.signal.aborted&&(V(g(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(g(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=>h(`${x}/${e.id}${t===`stop`?`/stop`:``}`,{method:t===`stop`?`POST`:`DELETE`}))),i={},a=[];r.forEach((t,n)=>{t.status===`rejected`&&(i[e[n].id]=g(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)(ee,{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 h(`/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 h(`/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)(ne,{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)(re,{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-DliOcop5.js","./rolldown-runtime-XKyaHtl9.js","./react-DUEFWlB7.js","./relativeTime-CcP1IEvr.js","./i18nInstance-CIMFwH0l.js","./useTranslation-DwkoADSz.js","./basePath-B5-c90eh.js","./createLucideIcon-CDYIzuiB.js","./useDeletionTransitions-DvxVkRuo.js","./dist-B_WjsTVV.js","./es2015-D2UDOM09.js","./index-B1vejuOw.js","./i18n-Dpk6KCs6.js","./vite-runtime-CRzLMJPS.js","./loader-circle-DKGyi5EK.js","./dist-DdUqlCPw.js","./index-Blr4J_Pq.css","./AgentIcon-CjaO3WzI.js","./AgentIcon-_B7xXJpJ.css","./latexScanner-D9bMX44Y.js","./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,h as a,r as o,u as s}from"./relativeTime-CcP1IEvr.js";import{t as c}from"./useTranslation-DwkoADSz.js";import{t as l}from"./vite-runtime-CRzLMJPS.js";import{t as u}from"./createLucideIcon-CDYIzuiB.js";import{t as d}from"./check-Dw16EqG-.js";import{o as f}from"./dist-B_WjsTVV.js";import{E as p,P as m,T as h,U as g,c as _,w as v,x as y}from"./useDeletionTransitions-DvxVkRuo.js";import{t as b}from"./chevron-up-BHaMUEEA.js";import{i as x,n as S,t as C}from"./AgentIcon-CjaO3WzI.js";import{S as ee}from"./sourceCursorStore-EycYBVxj.js";import{t as w}from"./git-compare-arrows-158rS_vn.js";import{t as te}from"./InfoPopover-CQ3Q10tN.js";import{t as T}from"./loader-circle-DKGyi5EK.js";import{t as ne}from"./plus-Cei21TlT.js";import{t as E}from"./refresh-cw-IqExWG6S.js";import{t as re}from"./SaveButton-wiTpGLho.js";import{g as ie,w as D,y as O}from"./index-B1vejuOw.js";import{a as k,i as A,l as j,n as M,o as N,s as P,t as F}from"./dist-C9O-A_C4.js";import{n as I}from"./ProjectWorkspace-DiurYeU1.js";var L={name:`check-check`,size:24,node:[[`path`,{d:`M18 6 7 17l-5-5`,key:`116fxf`}],[`path`,{d:`m22 10-7.5 7.5L13 16`,key:`ke71qq`}]]};L.node;var R=u(L),z=e(t(),1);function ae(e){let[t,n]=(0,z.useState)(null),[r,i]=(0,z.useState)({tasks:[],page:1,pageSize:50,total:0}),[a,s]=(0,z.useState)(1),[c,l]=(0,z.useState)(``),[u,d]=(0,z.useState)(``),[f,p]=(0,z.useState)(!1),m=(0,z.useRef)(!1),h=(0,z.useRef)(0),g=(0,z.useRef)(!1),[_,v]=(0,z.useState)(0);(0,z.useEffect)(()=>(g.current=!0,()=>{g.current=!1}),[]),(0,z.useEffect)(()=>{let e=new AbortController;return D(`/api/agents`,{signal:e.signal}).then(n).catch(t=>{e.signal.aborted||d(O(t))}),()=>e.abort()},[e,_]),(0,z.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)});D(`/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(O(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,z.useCallback)(()=>v(e=>e+1),[]),b=(0,z.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(O(e))}finally{m.current=!1,o(),g.current&&(p(!1),y())}}},acceptTask:b,refreshTasks:y}}var B=n();function oe({agents:e,value:t,onChange:n,disabled:r=!1}){let{t:i}=c(),[a,o]=(0,z.useState)(!1),s=(0,z.useRef)(null),l=e.find(e=>e.id===t),u=r||e.length===0;return(0,z.useEffect)(()=>{u&&o(!1)},[u]),(0,B.jsxs)(F,{modal:!1,open:a,onOpenChange:o,children:[(0,B.jsx)(j,{asChild:!0,children:(0,B.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,B.jsx)(C,{agent:l.id,size:16}),(0,B.jsx)(`span`,{children:l?.label??i(`agents.agent`)}),(0,B.jsx)(f,{size:13,"aria-hidden":`true`})]})}),(0,B.jsx)(k,{container:s.current?.closest(`[role="dialog"]`),children:(0,B.jsx)(M,{className:`agent-select-options`,side:`top`,align:`start`,sideOffset:5,collisionPadding:8,children:(0,B.jsx)(N,{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,B.jsxs)(P,{value:e.id,textValue:e.label,className:`agent-select-option`,disabled:u||!e.installed||!e.enabled,children:[(0,B.jsx)(C,{agent:e.id,size:16}),(0,B.jsxs)(`span`,{className:`agent-select-label`,children:[e.label,(!e.installed||!e.enabled)&&(0,B.jsx)(`small`,{children:i(e.installed?`agents.disabled`:`agents.notInstalled`)})]}),(0,B.jsx)(A,{className:`agent-select-check`,children:(0,B.jsx)(d,{size:14,"aria-hidden":`true`})})]},e.id))})})})]})}function V({change:e}){let t=e.after??``,n=[],r=0;for(let i of[...e.pieces].sort((e,t)=>e.from-t.from)){let a=Math.max(r,i.from-e.afterFrom),o=Math.min(t.length,i.to-e.afterFrom);o<=a||(a>r&&n.push({text:t.slice(r,a),agent:!1}),n.push({text:t.slice(a,o),agent:!0}),r=o)}return r<t.length&&n.push({text:t.slice(r),agent:!1}),(0,B.jsx)(`pre`,{className:`agent-review-content`,children:n.map((e,t)=>e.agent?(0,B.jsx)(`mark`,{children:e.text},t):(0,B.jsx)(`span`,{children:e.text},t))})}function se({review:e,activeId:t,onShow:n,focus:i=null}){let{t:a,i18n:o}=c(),[s,l]=(0,z.useState)(!1),[u,p]=(0,z.useState)(i?.id??t),[h,v]=(0,z.useState)(`diff`),{pending:y}=e,x=(0,z.useMemo)(()=>{let e=y.findIndex(e=>e.id===u);return e>=0?e:y.length?0:-1},[y,u]),S=x>=0?y[x]:null;(0,z.useEffect)(()=>{i&&(p(i.id),l(!0))},[i?.nonce]),(0,z.useEffect)(()=>{S&&S.id!==u&&p(S.id)},[S,u]);let C=e=>{let t=y[(e+y.length)%y.length];t&&(p(t.id),l(!0),n(t,!1))};return!y.length&&!e.error?null:(0,B.jsxs)(`section`,{className:`agent-review`,"aria-label":a(`agents.reviewTitle`),children:[(0,B.jsxs)(`div`,{className:`agent-review-bar`,children:[(0,B.jsxs)(`button`,{type:`button`,className:`agent-review-toggle`,"aria-expanded":s,onClick:()=>l(e=>!e),children:[(0,B.jsx)(w,{size:13,"aria-hidden":!0}),a(`agents.reviewTitle`),(0,B.jsx)(`span`,{className:`agent-review-count`,children:y.length}),s?(0,B.jsx)(b,{size:13,"aria-hidden":!0}):(0,B.jsx)(f,{size:13,"aria-hidden":!0})]}),y.length>0&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`button`,{type:`button`,className:`agent-icon-button`,"aria-label":a(`agents.previousChange`),title:a(`agents.previousChange`),onClick:()=>C(x-1),children:(0,B.jsx)(r,{size:13})}),(0,B.jsxs)(`small`,{className:`agent-review-position`,children:[x+1,` / `,y.length]}),(0,B.jsx)(`button`,{type:`button`,className:`agent-icon-button`,"aria-label":a(`agents.nextChange`),title:a(`agents.nextChange`),onClick:()=>C(x+1),children:(0,B.jsx)(g,{size:13})})]}),(0,B.jsx)(`span`,{className:`agent-toolbar-spacer`}),y.length>0&&(0,B.jsxs)(`button`,{type:`button`,onClick:e.markAllReviewed,children:[(0,B.jsx)(R,{size:12,"aria-hidden":!0}),a(`agents.markAllReviewed`)]}),(0,B.jsx)(`button`,{type:`button`,className:`agent-icon-button`,"aria-label":a(`agents.refreshChanges`),title:a(`agents.refreshChanges`),disabled:e.loading,onClick:e.refresh,children:e.loading?(0,B.jsx)(T,{className:`spin`,size:13}):(0,B.jsx)(E,{size:13})})]}),e.error&&(0,B.jsx)(`p`,{className:`error agent-inline-error`,role:`alert`,children:e.error}),s&&S&&(0,B.jsxs)(`div`,{className:`agent-review-detail`,children:[(0,B.jsxs)(`div`,{className:`agent-review-location`,children:[(0,B.jsxs)(`button`,{type:`button`,className:`agent-review-file`,onClick:()=>n(S,!0),title:a(`agents.openChange`),children:[(0,B.jsx)(m,{size:12,"aria-hidden":!0}),(0,B.jsxs)(`span`,{children:[S.path,`:`,S.line]})]}),(0,B.jsx)(`time`,{dateTime:S.at,children:_(S.at,o.resolvedLanguage,{month:`numeric`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})})]}),(0,B.jsxs)(`div`,{className:`agent-review-tabs`,role:`tablist`,"aria-label":a(`agents.reviewTitle`),children:[(0,B.jsx)(`button`,{type:`button`,role:`tab`,id:`agent-review-tab-content-${S.id}`,"aria-selected":h===`content`,"aria-controls":`agent-review-panel`,className:h===`content`?`active`:``,onClick:()=>v(`content`),children:a(`agents.contentTab`)}),(0,B.jsx)(`button`,{type:`button`,role:`tab`,id:`agent-review-tab-diff-${S.id}`,"aria-selected":h===`diff`,"aria-controls":`agent-review-panel`,className:h===`diff`?`active`:``,onClick:()=>v(`diff`),children:a(`agents.diffTab`)})]}),(0,B.jsx)(`div`,{id:`agent-review-panel`,role:`tabpanel`,"aria-labelledby":`agent-review-tab-${h}-${S.id}`,children:h===`content`?S.after===null?(0,B.jsx)(`p`,{className:`agent-review-unavailable`,children:a(`agents.contentUnavailable`)}):(0,B.jsx)(V,{change:S}):S.before!==null&&S.after!==null?(0,B.jsx)(I,{original:S.before,replacement:S.after}):(0,B.jsx)(`p`,{className:`agent-review-unavailable`,children:a(`agents.changePreviewUnavailable`)})}),(0,B.jsxs)(`div`,{className:`agent-review-actions`,children:[(0,B.jsxs)(`button`,{type:`button`,onClick:()=>n(S,!0),children:[(0,B.jsx)(m,{size:12,"aria-hidden":!0}),a(`agents.openChange`)]}),(0,B.jsxs)(`button`,{type:`button`,className:`primary`,onClick:()=>{if(!S)return;let t=y[x+1]??y[x-1]??null;e.markReviewed(S),p(t?.id??null),t&&n(t,!1)},children:[(0,B.jsx)(d,{size:12,"aria-hidden":!0}),a(`agents.markReviewed`)]})]})]})]})}var ce=(0,z.lazy)(()=>l(()=>import(`./AgentTerminalSurface-DliOcop5.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,20]),import.meta.url)),le=15e3;function H({projectId:e,readOnly:t,onHide:n,maximized:l=!1,onToggleMaximized:u,review:d,activeChangeId:m=null,onShowChange:_,reviewFocus:w=null,pasteRequest:E=null,onPasteFinished:O}){let{t:k}=c(),A=ae(e),j=s(),M=A.selected,[N,P]=(0,z.useState)(!1),[F,I]=(0,z.useState)(``),[L,R]=(0,z.useState)(``),[V,H]=(0,z.useState)(!1),[U,W]=(0,z.useState)(``),[G,K]=(0,z.useState)(!1),q=M&&[`starting`,`running`,`stopping`].includes(M.state),ue=M&&(M.canResume||M.startedAt!==null||[`stopped`,`exited`,`interrupted`].includes(M.state)),J=A.catalog?.agents.find(e=>e.id===M?.agentId),Y=A.catalog?.agents.filter(e=>e.installed&&e.enabled)??[],X=L?A.catalog?.agents.find(e=>e.id===L):Y[0],de=!!(A.result.activeTaskId&&A.result.activeTaskId!==M?.id),fe=t||A.busy||!!A.result.activeTaskId||!A.catalog?.ptyAvailable||!X?.installed||!X.enabled,pe=!de&&!t&&J?.installed&&J.enabled&&A.catalog?.ptyAvailable&&M?.cleanupState===`none`,Z=A.result.activeTaskId,Q=(0,z.useRef)(``),me=(0,z.useRef)(null);(0,z.useEffect)(()=>{if(E&&Z!==void 0){if(Z&&A.result.tasks.some(e=>e.id===Z)){let e=`${E.id}:${Z}`;Q.current!==e&&(Q.current=e,A.setSelectedId(Z))}else Z&&A.result.page!==1?A.setPage(1):me.current===E.id?(A.setError(k(`agents.commentAgentUnavailable`)),o(),O?.(E.id)):(me.current=E.id,A.refreshTasks())}},[E,Z,A.result]);let $=E?.id;(0,z.useEffect)(()=>{if($===void 0)return;let e=window.setTimeout(()=>{A.setError(k(`agents.commentAgentTimedOut`)),O?.($)},le);return()=>window.clearTimeout(e)},[$]);let he=e=>{A.setSelectedId(e),H(!1)},ge=e=>A.mutate(async()=>{if(!M)return;let t=await D(`/api/agent-tasks/${M.id}${e}`,{method:`POST`});A.acceptTask(t.task)});return(0,B.jsxs)(`section`,{className:`agent-terminal-panel`,"data-agent-terminal":`true`,"aria-label":k(`agents.terminal`),children:[(0,B.jsxs)(`div`,{className:`agent-terminal-heading`,children:[(0,B.jsxs)(`strong`,{children:[(0,B.jsx)(p,{size:14}),k(`agents.terminal`)]}),(0,B.jsx)(te,{className:`agent-session-help`,content:k(`agents.sessionManagementHint`),size:13}),(0,B.jsx)(`div`,{className:`agent-task-tabs`,role:`tablist`,"aria-label":k(`agents.tasks`),children:A.result.tasks.map(e=>(0,B.jsxs)(`button`,{role:`tab`,type:`button`,"aria-selected":e.id===M?.id,title:e.title,className:e.id===M?.id?`active`:``,onClick:()=>he(e.id),children:[(0,B.jsx)(`span`,{className:`agent-state-dot ${e.state}`}),(0,B.jsx)(C,{agent:e.agentId,size:13}),(0,B.jsx)(`span`,{children:e.title}),(0,B.jsx)(`small`,{children:S[e.agentId]})]},e.id))}),(0,B.jsx)(`button`,{className:`agent-icon-button`,disabled:t||A.busy||!Y.length,title:k(`agents.newTask`),"aria-label":k(`agents.newTask`),onClick:()=>P(e=>!e),children:(0,B.jsx)(ne,{size:15})}),u&&(0,B.jsx)(`button`,{type:`button`,className:`agent-icon-button`,title:k(l?`agents.restoreTerminal`:`agents.maximizeTerminal`),"aria-label":k(l?`agents.restoreTerminal`:`agents.maximizeTerminal`),"aria-pressed":l,onClick:u,children:l?(0,B.jsx)(f,{size:15}):(0,B.jsx)(b,{size:15})}),(0,B.jsx)(`button`,{className:`agent-icon-button`,title:k(`agents.hide`),"aria-label":k(`agents.hide`),onClick:n,children:(0,B.jsx)(y,{size:15})})]}),(M||A.result.total>A.result.pageSize)&&(0,B.jsxs)(`div`,{className:`agent-task-toolbar`,children:[A.result.total>A.result.pageSize&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`button`,{disabled:A.result.page<=1,"aria-label":k(`agents.previous`),onClick:()=>A.setPage(A.result.page-1),children:(0,B.jsx)(r,{size:13})}),(0,B.jsxs)(`small`,{children:[A.result.page,` / `,Math.ceil(A.result.total/A.result.pageSize)]}),(0,B.jsx)(`button`,{disabled:A.result.page*A.result.pageSize>=A.result.total,"aria-label":k(`agents.next`),onClick:()=>A.setPage(A.result.page+1),children:(0,B.jsx)(g,{size:13})})]}),M&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{className:`agent-task-state`,children:k(`agents.state_${M.state}`)}),(0,B.jsx)(`span`,{className:`agent-toolbar-spacer`}),q?(0,B.jsxs)(`button`,{disabled:A.busy,onClick:()=>void ge(`/stop`),children:[(0,B.jsx)(x,{size:12}),k(`agents.end`)]}):(0,B.jsxs)(`button`,{disabled:!pe||A.busy,onClick:()=>void ge(`/start`),children:[(0,B.jsx)(ee,{size:13}),k(ue?`agents.resume`:`agents.start`)]}),(0,B.jsx)(`button`,{className:`agent-icon-button`,title:k(`agents.rename`),"aria-label":k(`agents.rename`),disabled:A.busy,onClick:()=>{W(M.title),H(e=>!e)},children:(0,B.jsx)(a,{size:13})}),(0,B.jsx)(`button`,{className:`agent-icon-button agent-danger`,title:k(`agents.delete`),"aria-label":k(`agents.delete`),disabled:A.busy,onClick:()=>{A.setError(``),K(!0)},children:(0,B.jsx)(h,{size:13})})]})]}),(N||!M)&&(0,B.jsxs)(`form`,{className:`agent-task-create`,onSubmit:t=>{t.preventDefault(),!fe&&A.mutate(async()=>{let t=X?.id,n=await D(`/api/projects/${e}/agent-tasks`,{method:`POST`,body:JSON.stringify({agentId:t,title:F})});A.acceptTask(n.task),A.setPage(1),A.setSelectedId(n.task.id),P(!1),I(``);let r=await D(`/api/agent-tasks/${n.task.id}/start`,{method:`POST`});A.acceptTask(r.task)})},children:[(0,B.jsx)(`input`,{"aria-label":k(`agents.task`),placeholder:k(`agents.titlePlaceholder`),maxLength:160,value:F,onChange:e=>I(e.target.value),disabled:A.busy||t}),(0,B.jsx)(oe,{agents:A.catalog?.agents??[],value:X?.id??``,onChange:R,disabled:t||A.busy}),(0,B.jsxs)(`button`,{type:`submit`,disabled:fe,children:[A.busy&&(0,B.jsx)(T,{className:`spin`,size:13}),k(`agents.create`)]})]}),V&&M&&(0,B.jsxs)(`form`,{className:`agent-task-create`,onSubmit:e=>{e.preventDefault(),A.mutate(async()=>{let e=await D(`/api/agent-tasks/${M.id}`,{method:`PATCH`,body:JSON.stringify({title:U})});A.acceptTask(e.task),H(!1)})},children:[(0,B.jsx)(`input`,{value:U,onChange:e=>W(e.target.value),required:!0,maxLength:160,"aria-label":k(`agents.task`)}),(0,B.jsx)(re,{type:`submit`,saving:A.busy,children:k(`common.save`)})]}),A.error&&!G&&(0,B.jsxs)(`p`,{className:`error agent-inline-error`,role:`alert`,children:[A.error,(0,B.jsx)(`button`,{onClick:()=>A.setError(``),"aria-label":k(`common.close`),children:(0,B.jsx)(y,{size:13})})]}),M?.errorCode&&!A.error&&!G&&(0,B.jsx)(`p`,{className:`error agent-inline-error`,role:`alert`,children:k(`errors.codes.${M.errorCode}`,{defaultValue:k(`agents.taskUnavailable`)})}),(de||N&&A.result.activeTaskId)&&(0,B.jsxs)(`p`,{className:`agent-inline-warning`,role:`status`,children:[(0,B.jsx)(v,{size:14,"aria-hidden":`true`}),(0,B.jsx)(`span`,{children:k(`errors.codes.AGENT_PROJECT_BUSY`)})]}),A.catalog&&!A.catalog.ptyAvailable&&(0,B.jsx)(`p`,{className:`error agent-inline-error`,children:k(`agents.ptyUnavailable`)}),d&&_&&(0,B.jsx)(se,{review:d,activeId:m,onShow:_,focus:w}),(0,B.jsx)(`div`,{className:`agent-terminal-body`,style:i(j.theme),children:(0,B.jsx)(z.Suspense,{fallback:(0,B.jsx)(`div`,{className:`agent-task-empty`,children:(0,B.jsx)(T,{className:`spin`,size:18})}),children:M&&q&&!t?(0,B.jsx)(ce,{task:M,onTask:A.acceptTask,pasteRequest:M.id===Z?E:null,onPasteFinished:O},M.id):(0,B.jsxs)(`div`,{className:`agent-task-empty`,children:[(0,B.jsx)(p,{size:24}),(0,B.jsx)(`strong`,{children:M?.title||k(`agents.noTasks`)}),(0,B.jsx)(`p`,{children:k(t?`agents.permissionLost`:`agents.readyHint`)}),M?.exitCode!==null&&M?.exitCode!==void 0&&M.exitCode!==0&&(0,B.jsx)(`small`,{children:k(`agents.exitCode`,{code:M.exitCode})})]})})}),j.showExecutionReminder&&q&&M.state!==`stopping`&&(0,B.jsxs)(`p`,{className:`agent-execution-reminder`,children:[(0,B.jsx)(v,{size:12,"aria-hidden":`true`}),(0,B.jsx)(`span`,{children:k(`agents.endReminder`)})]}),M&&(0,B.jsx)(ie,{open:G,title:k(`agents.delete`),description:k(`agents.deleteDescription`),onOpenChange:e=>{A.busy||K(e)},footer:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`button`,{disabled:A.busy,onClick:()=>K(!1),children:k(`common.cancel`)}),(0,B.jsxs)(`button`,{className:`danger`,disabled:A.busy,onClick:()=>void A.mutate(async()=>{await D(`/api/agent-tasks/${M.id}`,{method:`DELETE`}),K(!1)}),children:[A.busy&&(0,B.jsx)(T,{className:`spin`,size:13}),k(`agents.delete`)]})]}),children:A.error&&(0,B.jsx)(`p`,{className:`error`,role:`alert`,children:A.error})})]})}export{H as AgentTerminal};
|
|
Binary file
|
|
Binary file
|