texlite 0.19.0 → 0.19.1

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.
Files changed (201) hide show
  1. package/DESIGN.md +94 -14
  2. package/OPERATIONS.md +47 -5
  3. package/README.md +4 -0
  4. package/README.zh-CN.md +3 -0
  5. package/dist/client/assets/AdminUsers-CuYfWnEk.js +1 -0
  6. package/dist/client/assets/AdminUsers-CuYfWnEk.js.br +0 -0
  7. package/dist/client/assets/AdminUsers-CuYfWnEk.js.gz +0 -0
  8. package/dist/client/assets/{AgentIcon-BlHvdrRo.js → AgentIcon-ClP5dPRL.js} +1 -1
  9. package/dist/client/assets/AgentIcon-ClP5dPRL.js.br +0 -0
  10. package/dist/client/assets/AgentIcon-ClP5dPRL.js.gz +0 -0
  11. package/dist/client/assets/{AgentIcon-DE7FEpRY.css → AgentIcon-DxrC-zx_.css} +1 -1
  12. package/dist/client/assets/AgentIcon-DxrC-zx_.css.br +0 -0
  13. package/dist/client/assets/AgentIcon-DxrC-zx_.css.gz +0 -0
  14. package/dist/client/assets/AgentManagement-jY_BF6Qy.js +1 -0
  15. package/dist/client/assets/AgentManagement-jY_BF6Qy.js.br +0 -0
  16. package/dist/client/assets/AgentManagement-jY_BF6Qy.js.gz +0 -0
  17. package/dist/client/assets/AgentTerminal-JKP2SVkZ.js +2 -0
  18. package/dist/client/assets/AgentTerminal-JKP2SVkZ.js.br +0 -0
  19. package/dist/client/assets/AgentTerminal-JKP2SVkZ.js.gz +0 -0
  20. package/dist/client/assets/{AgentTerminalSurface-D0MLcJmw.js → AgentTerminalSurface-CaYNNZ9A.js} +2 -2
  21. package/dist/client/assets/AgentTerminalSurface-CaYNNZ9A.js.br +0 -0
  22. package/dist/client/assets/AgentTerminalSurface-CaYNNZ9A.js.gz +0 -0
  23. package/dist/client/assets/AvatarSettingsDialog-C2TACfvP.js +1 -0
  24. package/dist/client/assets/AvatarSettingsDialog-C2TACfvP.js.br +0 -0
  25. package/dist/client/assets/AvatarSettingsDialog-C2TACfvP.js.gz +0 -0
  26. package/dist/client/assets/CitationLibraryDialog-BdU9nbgG.js +1 -0
  27. package/dist/client/assets/CitationLibraryDialog-BdU9nbgG.js.br +0 -0
  28. package/dist/client/assets/CitationLibraryDialog-BdU9nbgG.js.gz +0 -0
  29. package/dist/client/assets/Dashboard-B7mMz5Gj.js +5 -0
  30. package/dist/client/assets/Dashboard-B7mMz5Gj.js.br +0 -0
  31. package/dist/client/assets/Dashboard-B7mMz5Gj.js.gz +0 -0
  32. package/dist/client/assets/GitDialog-C2H-jKVO.js +3 -0
  33. package/dist/client/assets/GitDialog-C2H-jKVO.js.br +0 -0
  34. package/dist/client/assets/GitDialog-C2H-jKVO.js.gz +0 -0
  35. package/dist/client/assets/GitHubAccountDialog-DdKiE3pw.js +1 -0
  36. package/dist/client/assets/GitHubAccountDialog-DdKiE3pw.js.br +0 -0
  37. package/dist/client/assets/GitHubAccountDialog-DdKiE3pw.js.gz +0 -0
  38. package/dist/client/assets/{GitHubIcon-BPTVKTrM.js → GitHubIcon-Cjli8pd_.js} +1 -1
  39. package/dist/client/assets/HistoryDialog-CoxJ3EsK.js +8 -0
  40. package/dist/client/assets/HistoryDialog-CoxJ3EsK.js.br +0 -0
  41. package/dist/client/assets/HistoryDialog-CoxJ3EsK.js.gz +0 -0
  42. package/dist/client/assets/{LatexEditor-BDpqgoOa.js → LatexEditor-BhAKioho.js} +26 -26
  43. package/dist/client/assets/LatexEditor-BhAKioho.js.br +0 -0
  44. package/dist/client/assets/LatexEditor-BhAKioho.js.gz +0 -0
  45. package/dist/client/assets/{PdfPreview-C2puKgCh.js → PdfPreview-CC8KEz1Y.js} +1 -1
  46. package/dist/client/assets/PdfPreview-CC8KEz1Y.js.br +0 -0
  47. package/dist/client/assets/PdfPreview-CC8KEz1Y.js.gz +0 -0
  48. package/dist/client/assets/ProjectIconPickerDialog-vi_HwlCS.js +1 -0
  49. package/dist/client/assets/ProjectIconPickerDialog-vi_HwlCS.js.br +0 -0
  50. package/dist/client/assets/ProjectIconPickerDialog-vi_HwlCS.js.gz +0 -0
  51. package/dist/client/assets/ProjectSettings-Bl1t-Gnh.js +4 -0
  52. package/dist/client/assets/ProjectSettings-Bl1t-Gnh.js.br +0 -0
  53. package/dist/client/assets/ProjectSettings-Bl1t-Gnh.js.gz +0 -0
  54. package/dist/client/assets/ProjectWorkspace-1UOdyfBq.js +30 -0
  55. package/dist/client/assets/ProjectWorkspace-1UOdyfBq.js.br +0 -0
  56. package/dist/client/assets/ProjectWorkspace-1UOdyfBq.js.gz +0 -0
  57. package/dist/client/assets/{QuickOpenDialog-CEYxIk4l.js → QuickOpenDialog-BAzyrB-4.js} +1 -1
  58. package/dist/client/assets/QuickOpenDialog-BAzyrB-4.js.br +0 -0
  59. package/dist/client/assets/QuickOpenDialog-BAzyrB-4.js.gz +0 -0
  60. package/dist/client/assets/SaveButton-DkyoEu6j.js +1 -0
  61. package/dist/client/assets/{SelectionHistoryDialog-DBL6vVD4.js → SelectionHistoryDialog-DzlVKtxs.js} +2 -2
  62. package/dist/client/assets/SelectionHistoryDialog-DzlVKtxs.js.br +0 -0
  63. package/dist/client/assets/SelectionHistoryDialog-DzlVKtxs.js.gz +0 -0
  64. package/dist/client/assets/SuccessNotice-ubBtzzi_.js +1 -0
  65. package/dist/client/assets/{SystemMetricsDialog-D2EQX5hh.js → SystemMetricsDialog-C6RVZdJZ.js} +1 -1
  66. package/dist/client/assets/SystemMetricsDialog-C6RVZdJZ.js.br +0 -0
  67. package/dist/client/assets/SystemMetricsDialog-C6RVZdJZ.js.gz +0 -0
  68. package/dist/client/assets/TagColorSelect-xbc2H5ou.js +1 -0
  69. package/dist/client/assets/TagManagementDialog-8pZUVaEI.js +1 -0
  70. package/dist/client/assets/TagManagementDialog-8pZUVaEI.js.br +0 -0
  71. package/dist/client/assets/TagManagementDialog-8pZUVaEI.js.gz +0 -0
  72. package/dist/client/assets/{WordCountDialog-DaHxqArj.js → WordCountDialog-BODhL9iz.js} +1 -1
  73. package/dist/client/assets/WordCountDialog-BODhL9iz.js.br +0 -0
  74. package/dist/client/assets/WordCountDialog-BODhL9iz.js.gz +0 -0
  75. package/dist/client/assets/{arrow-down-BySB1dS6.js → arrow-down-B6T7Z6IO.js} +1 -1
  76. package/dist/client/assets/check-BRlv1lrZ.js +1 -0
  77. package/dist/client/assets/chevron-up-krb7w67X.js +1 -0
  78. package/dist/client/assets/{chktex-B2-niLAo.js → chktex-Bz-LKycq.js} +1 -1
  79. package/dist/client/assets/{clock-3-C_8q2yLj.js → clock-3-Fb1_e3ec.js} +1 -1
  80. package/dist/client/assets/{dist-CIxSPQK5.js → dist-CMYWzCHL.js} +1 -1
  81. package/dist/client/assets/dist-CMYWzCHL.js.br +0 -0
  82. package/dist/client/assets/dist-CMYWzCHL.js.gz +0 -0
  83. package/dist/client/assets/{eye-DpIOhQ2p.js → eye-B6AX_5uX.js} +1 -1
  84. package/dist/client/assets/{hard-drive-DRbINIYf.js → hard-drive-CBmnJ2xS.js} +1 -1
  85. package/dist/client/assets/i18n-DF6keNBA.js +13 -0
  86. package/dist/client/assets/i18n-DF6keNBA.js.br +0 -0
  87. package/dist/client/assets/i18n-DF6keNBA.js.gz +0 -0
  88. package/dist/client/assets/{index-h0BVkT8k.js → index-DCwfhKK9.js} +3 -3
  89. package/dist/client/assets/index-DCwfhKK9.js.br +0 -0
  90. package/dist/client/assets/index-DCwfhKK9.js.gz +0 -0
  91. package/dist/client/assets/index-SVNFLCYh.css +1 -0
  92. package/dist/client/assets/index-SVNFLCYh.css.br +0 -0
  93. package/dist/client/assets/index-SVNFLCYh.css.gz +0 -0
  94. package/dist/client/assets/{info-DB-RajXx.js → info-DNSAs0_-.js} +1 -1
  95. package/dist/client/assets/{minimize-2-DtsKyo4M.js → minimize-2-C8oL6PTV.js} +1 -1
  96. package/dist/client/assets/{minus-CdwrG9Yo.js → minus-TCBOakyi.js} +1 -1
  97. package/dist/client/assets/plus-Dfkyfvvy.js +1 -0
  98. package/dist/client/assets/{refresh-cw-c6Tzy-hb.js → refresh-cw-DuLtxWBX.js} +1 -1
  99. package/dist/client/assets/relativeTime-BR0CVAvz.js +1 -0
  100. package/dist/client/assets/relativeTime-BR0CVAvz.js.br +0 -0
  101. package/dist/client/assets/relativeTime-BR0CVAvz.js.gz +0 -0
  102. package/dist/client/assets/{search-Cy8DgYGb.js → search-n-2tBATf.js} +1 -1
  103. package/dist/client/assets/{spellCheck-DEQIFH7w.js → spellCheck-xzICTGx1.js} +1 -1
  104. package/dist/client/assets/spellCheck-xzICTGx1.js.br +0 -0
  105. package/dist/client/assets/spellCheck-xzICTGx1.js.gz +0 -0
  106. package/dist/client/assets/tags-Dy96boLq.js +1 -0
  107. package/dist/client/assets/{terminal-DaAc1558.js → terminal-C0xh8jVR.js} +1 -1
  108. package/dist/client/assets/{type-Cm3TiSO6.js → type-BjXWxrjH.js} +1 -1
  109. package/dist/client/assets/{user-plus-BLC3_SFQ.js → user-plus-3oJZJXHW.js} +1 -1
  110. package/dist/client/index.html +3 -3
  111. package/dist/server/agents/adapters/claude.js +170 -9
  112. package/dist/server/agents/adapters/opencode.js +15 -3
  113. package/dist/server/agents/sessions.js +18 -8
  114. package/dist/server/collaboration.js +2 -1
  115. package/dist/server/db.js +5 -0
  116. package/dist/server/routes/projectShared.js +6 -1
  117. package/dist/shared/sourceCommentAnchors.js +52 -4
  118. package/package.json +1 -1
  119. package/dist/client/assets/AdminUsers-DXWi8wl0.js +0 -1
  120. package/dist/client/assets/AdminUsers-DXWi8wl0.js.br +0 -0
  121. package/dist/client/assets/AdminUsers-DXWi8wl0.js.gz +0 -0
  122. package/dist/client/assets/AgentIcon-BlHvdrRo.js.br +0 -0
  123. package/dist/client/assets/AgentIcon-BlHvdrRo.js.gz +0 -0
  124. package/dist/client/assets/AgentIcon-DE7FEpRY.css.br +0 -0
  125. package/dist/client/assets/AgentIcon-DE7FEpRY.css.gz +0 -0
  126. package/dist/client/assets/AgentManagement-CDWaxEmP.js +0 -1
  127. package/dist/client/assets/AgentManagement-CDWaxEmP.js.br +0 -0
  128. package/dist/client/assets/AgentManagement-CDWaxEmP.js.gz +0 -0
  129. package/dist/client/assets/AgentTerminal-BXH3gHWm.js +0 -2
  130. package/dist/client/assets/AgentTerminal-BXH3gHWm.js.br +0 -0
  131. package/dist/client/assets/AgentTerminal-BXH3gHWm.js.gz +0 -0
  132. package/dist/client/assets/AgentTerminalSurface-D0MLcJmw.js.br +0 -0
  133. package/dist/client/assets/AgentTerminalSurface-D0MLcJmw.js.gz +0 -0
  134. package/dist/client/assets/AvatarSettingsDialog-CtbzavqH.js +0 -1
  135. package/dist/client/assets/AvatarSettingsDialog-CtbzavqH.js.br +0 -0
  136. package/dist/client/assets/AvatarSettingsDialog-CtbzavqH.js.gz +0 -0
  137. package/dist/client/assets/CitationLibraryDialog-CnQVjovw.js +0 -1
  138. package/dist/client/assets/CitationLibraryDialog-CnQVjovw.js.br +0 -0
  139. package/dist/client/assets/CitationLibraryDialog-CnQVjovw.js.gz +0 -0
  140. package/dist/client/assets/Dashboard-Dzq1oMZU.js +0 -5
  141. package/dist/client/assets/Dashboard-Dzq1oMZU.js.br +0 -0
  142. package/dist/client/assets/Dashboard-Dzq1oMZU.js.gz +0 -0
  143. package/dist/client/assets/GitDialog-CzgguGGW.js +0 -3
  144. package/dist/client/assets/GitDialog-CzgguGGW.js.br +0 -0
  145. package/dist/client/assets/GitDialog-CzgguGGW.js.gz +0 -0
  146. package/dist/client/assets/GitHubAccountDialog-lRAWfkKP.js +0 -1
  147. package/dist/client/assets/GitHubAccountDialog-lRAWfkKP.js.br +0 -0
  148. package/dist/client/assets/GitHubAccountDialog-lRAWfkKP.js.gz +0 -0
  149. package/dist/client/assets/HistoryDialog-Bw3GHfbM.js +0 -8
  150. package/dist/client/assets/HistoryDialog-Bw3GHfbM.js.br +0 -0
  151. package/dist/client/assets/HistoryDialog-Bw3GHfbM.js.gz +0 -0
  152. package/dist/client/assets/LatexEditor-BDpqgoOa.js.br +0 -0
  153. package/dist/client/assets/LatexEditor-BDpqgoOa.js.gz +0 -0
  154. package/dist/client/assets/PdfPreview-C2puKgCh.js.br +0 -0
  155. package/dist/client/assets/PdfPreview-C2puKgCh.js.gz +0 -0
  156. package/dist/client/assets/ProjectIconPickerDialog-BzNdyAz6.js +0 -1
  157. package/dist/client/assets/ProjectIconPickerDialog-BzNdyAz6.js.br +0 -0
  158. package/dist/client/assets/ProjectIconPickerDialog-BzNdyAz6.js.gz +0 -0
  159. package/dist/client/assets/ProjectSettings-B_y5nRgp.js +0 -4
  160. package/dist/client/assets/ProjectSettings-B_y5nRgp.js.br +0 -0
  161. package/dist/client/assets/ProjectSettings-B_y5nRgp.js.gz +0 -0
  162. package/dist/client/assets/ProjectWorkspace-BnT5JPTA.js +0 -30
  163. package/dist/client/assets/ProjectWorkspace-BnT5JPTA.js.br +0 -0
  164. package/dist/client/assets/ProjectWorkspace-BnT5JPTA.js.gz +0 -0
  165. package/dist/client/assets/QuickOpenDialog-CEYxIk4l.js.br +0 -0
  166. package/dist/client/assets/QuickOpenDialog-CEYxIk4l.js.gz +0 -0
  167. package/dist/client/assets/SelectionHistoryDialog-DBL6vVD4.js.br +0 -0
  168. package/dist/client/assets/SelectionHistoryDialog-DBL6vVD4.js.gz +0 -0
  169. package/dist/client/assets/SuccessNotice-C8XV7MAJ.js +0 -1
  170. package/dist/client/assets/SystemMetricsDialog-D2EQX5hh.js.br +0 -0
  171. package/dist/client/assets/SystemMetricsDialog-D2EQX5hh.js.gz +0 -0
  172. package/dist/client/assets/TagColorSelect-CfJaFovr.js +0 -1
  173. package/dist/client/assets/TagManagementDialog-CiJ6AhVk.js +0 -1
  174. package/dist/client/assets/TagManagementDialog-CiJ6AhVk.js.br +0 -0
  175. package/dist/client/assets/TagManagementDialog-CiJ6AhVk.js.gz +0 -0
  176. package/dist/client/assets/WordCountDialog-DaHxqArj.js.br +0 -0
  177. package/dist/client/assets/WordCountDialog-DaHxqArj.js.gz +0 -0
  178. package/dist/client/assets/binary-B57nBiwS.js +0 -1
  179. package/dist/client/assets/check-B-GEn6vk.js +0 -1
  180. package/dist/client/assets/chevron-up-B0yLKMZJ.js +0 -1
  181. package/dist/client/assets/circle-check-CfK-oqlC.js +0 -1
  182. package/dist/client/assets/dist-CIxSPQK5.js.br +0 -0
  183. package/dist/client/assets/dist-CIxSPQK5.js.gz +0 -0
  184. package/dist/client/assets/i18n-BzlyqR_B.js +0 -13
  185. package/dist/client/assets/i18n-BzlyqR_B.js.br +0 -0
  186. package/dist/client/assets/i18n-BzlyqR_B.js.gz +0 -0
  187. package/dist/client/assets/index-BHHBwQuG.css +0 -1
  188. package/dist/client/assets/index-BHHBwQuG.css.br +0 -0
  189. package/dist/client/assets/index-BHHBwQuG.css.gz +0 -0
  190. package/dist/client/assets/index-h0BVkT8k.js.br +0 -0
  191. package/dist/client/assets/index-h0BVkT8k.js.gz +0 -0
  192. package/dist/client/assets/plus-PHvPlka_.js +0 -1
  193. package/dist/client/assets/relativeTime-Cf5dzFc9.js +0 -1
  194. package/dist/client/assets/relativeTime-Cf5dzFc9.js.br +0 -0
  195. package/dist/client/assets/relativeTime-Cf5dzFc9.js.gz +0 -0
  196. package/dist/client/assets/spellCheck-DEQIFH7w.js.br +0 -0
  197. package/dist/client/assets/spellCheck-DEQIFH7w.js.gz +0 -0
  198. package/dist/client/assets/tags-BQ0exG-g.js +0 -1
  199. package/dist/client/assets/terminalPreferences-CgacIg2F.js +0 -1
  200. package/dist/client/assets/terminalPreferences-CgacIg2F.js.br +0 -0
  201. package/dist/client/assets/terminalPreferences-CgacIg2F.js.gz +0 -0
package/DESIGN.md CHANGED
@@ -77,6 +77,14 @@ citation library as a separate management page beside the other management
77
77
  controls; the project workspace keeps a smaller `.bib` import dialog for
78
78
  in-context writing. Library results are server-filtered and paginated with 60
79
79
  entries per page by default (the API accepts a bounded page-size override).
80
+ Entry management actions live in an accessible, portalled overflow menu, with
81
+ deletion separated from ordinary actions and still requiring confirmation.
82
+ Copy BibTeX remains a direct button, preserves the full entry text and shows a
83
+ two-second result on the button. It falls back to selection-based copying for
84
+ HTTP/LAN browsers without usable
85
+ Clipboard API access. Save/import remain direct actions in project dialogs.
86
+ Library rows use compact spacing and a single-line title with the full title
87
+ available on hover.
80
88
  Library entries are checked in the browser with the `bibtex-tidy` JavaScript
81
89
  parser and formatter before a mutation request is sent. Citation keys are unique
82
90
  per user without regard to letter case. Creating an existing key is rejected;
@@ -313,8 +321,14 @@ can be resolved, edited, deleted, and replied to. If an author is removed,
313
321
  the record remains visible as “Deleted User”.
314
322
 
315
323
  Live anchor updates replay the actual Yjs text deltas against their saved
316
- source baseline. HTTP replacements, recovered state without a delta chain,
317
- and chains that do not reconstruct the final source use a before/after diff.
324
+ source baseline. Agent disk imports retain an inferred-diff flag even when
325
+ their changes are transported as Yjs operations. HTTP replacements, recovered
326
+ state without a delta chain, and chains that do not reconstruct the final
327
+ source also use a before/after diff. Unlike actual edits, inferred partial
328
+ matches require contiguous meaningful text, sufficient retention relative to
329
+ both ranges, and matching context (or a substantially intact quote). Exact
330
+ quotes and whitespace-only formatting remain recognizable; scattered shared
331
+ letters must not stretch a discussion across unrelated replacement prose.
318
332
  Partial edits retain the discussion; fully erased selections preserve their
319
333
  last attached quote and surrounding context for recovery. Recovery requires
320
334
  the original quote to be formed by the current insertion, replacement or an
@@ -511,9 +525,19 @@ because they do not carry editor operations. These existing
511
525
  database fields remain durable across restarts, without a schema change.
512
526
  The server and editor share the range/context rules. Live editor anchors retain
513
527
  detached state through undo and supply current offsets for thread-to-source
514
- navigation, even before a save. Unchanged or stale saved anchors cannot replace
515
- a valid live mapping. Browser recovery searches are bounded around the hint
516
- and newly inserted fragments; ordinary edits never flatten the entire document.
528
+ navigation, even before a save. Comment responses include a response-only
529
+ SHA-256 source revision, computed once per file. An authoritative server anchor
530
+ can correct a misleading live mapping only at that exact revision, including
531
+ when its HTTP response arrives before the Yjs source update. Stale saved
532
+ anchors cannot replace a live mapping, reactivate a deleted selection at a
533
+ duplicate occurrence, or overwrite undo recovery. Results for a different
534
+ revision remain pending; a view-owned 200 ms trailing check retries after
535
+ document updates, coalesces typing, and is cancelled on editor destruction.
536
+ Failed checks do not poll or reschedule themselves. Browser recovery searches
537
+ are bounded around the hint and newly inserted fragments; document-change
538
+ mapping never flattens/hashes the file for revision reconciliation. Incoming
539
+ comment responses may hash the current source once to apply matching results
540
+ immediately.
517
541
 
518
542
  The collaboration service uses a versioned handshake and a versioned epoch
519
543
  marker. When a browser from an incompatible release connects, it is forced to
@@ -717,6 +741,15 @@ deployment base path. The adapter validates current v4 per-combination records
717
741
  and does not convert v2 layout arrays. Missing, unsupported or corrupt records
718
742
  use default sizes; older browser records are left untouched. Blocked browser
719
743
  storage also falls back to usable defaults. File-panel collapse state follows `onResize`.
744
+ Source comments sit at the left edge of the preview region, immediately beside
745
+ the editor. They do not add an outer resizable panel or change the editor/file
746
+ widths. A 760 px preview-container breakpoint switches between a 300–360 px
747
+ inline review column and a drawer over the PDF; closing it restores the preview.
748
+ The PDF stays mounted, and a stable portal host preserves review filters and
749
+ reply forms across responsive changes. Editor-only mode falls back to an
750
+ adjacent resizable context pane; settings keep their existing right-hand pane.
751
+ Source annotations use small outlined comment icons with the same toggle,
752
+ keyboard activation and tooltip behavior as the former pins.
720
753
  SyncTeX arrows are portalled outside the group and anchored to the separator,
721
754
  so v4's document-level drag capture does not consume their pointer/keyboard
722
755
  actions. Observers and window listeners are removed when the separator unmounts.
@@ -1289,10 +1322,31 @@ trusted writers, not additional tasks imported into TexLite.
1289
1322
  All adapters inherit the service account's `XDG_CACHE_HOME`; when it is unset,
1290
1323
  the CLI chooses its own default. Shared caches can reuse model catalogs and
1291
1324
  installed dependencies across projects, tasks and native terminals.
1292
- Codex and Claude keep task-specific `CODEX_HOME` and `CLAUDE_CONFIG_DIR` because
1293
- these directories also contain conversations and other persistent state.
1294
- TexLite does not selectively share undocumented files inside those native homes.
1295
- Filesystem cleanup removes only the task's UUID directory, not the inherited host cache.
1325
+ Codex keeps a task-specific `CODEX_HOME`. Claude directly shares the service
1326
+ account's native configuration and login instead of copying selected files.
1327
+ For the default home, `CLAUDE_CONFIG_DIR` stays unset to preserve native
1328
+ `~/.claude.json` onboarding discovery. An explicit configuration directory is
1329
+ passed through. Each task durably binds that location and its UUID in
1330
+ `state/claude-session.json` before its CLI can launch. Native discovery and
1331
+ continuation target only that UUID; existing host conversations are not adopted.
1332
+ Claude-specific model/context, provider-authentication, timeout and client-certificate
1333
+ variables supplement the shared gateway/proxy environment on each start/resume.
1334
+ The source is only the current service process, not a port-specific lookup or a
1335
+ shell-profile loader. Runtime session markers and transcript controls stay excluded;
1336
+ the durable ownership binding stores no inherited credentials.
1337
+ Deletion removes only that session's transcript, subagent directory, transcript
1338
+ sidecars and UUID-scoped checkpoint/task/debug data. Shared prompt history,
1339
+ settings, credentials, plugins, project memory and caches are left untouched.
1340
+ A missing or invalid ownership binding blocks native cleanup rather than
1341
+ dropping the task and leaving an unmanaged conversation. After successful native
1342
+ cleanup, `agent_tasks.native_cleanup_done` is committed before local file removal;
1343
+ retries (including after restart) then need neither the binding nor CLI discovery.
1344
+ The successful deletion audit and final task-row deletion commit together.
1345
+ OpenCode management falls back to the task-state directory when a project's
1346
+ source directory is gone, retaining the registered database and exact session ID.
1347
+ Old private Claude conversations are not migrated and should be removed before
1348
+ upgrading. Task deletion also removes its private TexLite UUID directory,
1349
+ never the inherited host cache or the host configuration directory.
1296
1350
  These locations organize tasks; they do not sandbox agents running as the same
1297
1351
  service account.
1298
1352
 
@@ -1394,12 +1448,18 @@ terminal data over authenticated, origin-checked WebSockets with base-path and
1394
1448
  HTTPS support. One attachment owns input/resize; takeover is explicit. Server
1395
1449
  display replay is bounded, slow sockets disconnect without stopping the task,
1396
1450
  and full transcripts are not persisted by TexLite. Native CLI history can still
1397
- exist in its task state. Raw terminal replay is a bounded recent stream, not a
1451
+ exist in task-local or shared host state. Raw terminal replay is a bounded recent stream, not a
1398
1452
  complete saved terminal screen; very long full-screen sessions may need a redraw.
1399
1453
 
1400
1454
  Terminal appearance is separate from editor appearance. Its font, size and theme
1401
1455
  are browser-local preferences shared across projects and scoped to the
1402
1456
  deployment base path, without user/database or CLI configuration changes. The
1457
+ Terminal tab also saves a default-on execution-reminder toggle in this browser
1458
+ store. It controls the terminal/task-list reminder text and active-task count
1459
+ badges on Terminal and Agent tasks entries, including their accessible labels.
1460
+ It does not stop or reconnect tasks, alter actual counts/access, or hide
1461
+ project-busy warnings and other operational guidance.
1462
+ Older preferences without the toggle keep the reminder enabled. The
1403
1463
  default is JetBrains Mono at 13 px with fixed 1.2 line spacing; existing web fonts and
1404
1464
  a system-monospace fallback are available. The original Catppuccin-inspired
1405
1465
  TexLite dark palette remains the default; Catppuccin Latte (light) and Gruvbox
@@ -1423,10 +1483,30 @@ before measuring the selected font, with stale
1423
1483
  loads and unmounted terminals ignored; failed web fonts use the fallback stack.
1424
1484
  Previously stored terminal line-spacing choices are ignored and omitted on the
1425
1485
  next save; the editor's independent line-spacing setting is unchanged.
1426
- Manual saves for editor/terminal/compiler settings, snapshot names and project
1427
- tag edits show dismissible inline confirmation for two seconds. Unchanged
1428
- compiler settings are reported separately; browser-storage failures show an
1429
- error instead of claiming that local preferences were saved.
1486
+ Manual saves for editor/terminal/compiler settings show a blue check and “Saved” on
1487
+ the header and footer save buttons for two seconds, without a success banner.
1488
+ Feedback is scoped to the saved tab, including delayed compiler responses;
1489
+ idle buttons retain their existing labels. Unchanged compiler settings are
1490
+ reported on the buttons instead. Failures remain visible as errors rather than
1491
+ claiming success. User, citation, tag and Coding Agent management actions follow
1492
+ the same button-only success-feedback convention. Deletions and permission
1493
+ changes are reflected by their resulting list/control state without success
1494
+ banners; failures keep their contextual errors. Citation/tag edit forms remain
1495
+ open after saving, retaining the updated revision for subsequent writes.
1496
+ Snapshot naming and GitHub token saves use the same button-only confirmation.
1497
+ All explicit save buttons share `SaveButton`: a neutral surface and text,
1498
+ a save icon at rest, a disabled spinner while saving, and a blue check for
1499
+ confirmed feedback. The owning workflow still controls persistence, errors and
1500
+ the two-second feedback timer. Dialogs that close after saving retain that
1501
+ behavior; create, send and destructive actions keep their distinct semantics.
1502
+
1503
+ Management pages use the Coding Agent page's compact control scale: 12 px
1504
+ controls and table text, 32 px main actions, and matching themed primary buttons.
1505
+ User, citation and Coding Agent management share the localized “Back to projects”
1506
+ navigation label and fixed 32 px button height, including when the Agent page's
1507
+ stylesheet loads later. Citation list actions use the same compact height,
1508
+ line height and icon scale, including Copy BibTeX and the overflow trigger.
1509
+ Project-list controls and editor content are not rescaled.
1430
1510
 
1431
1511
  `node-pty` loads dynamically and is an optional production dependency. xterm.js
1432
1512
  and its fit addon are build dependencies behind a lazy terminal boundary. Missing
package/OPERATIONS.md CHANGED
@@ -396,7 +396,7 @@ authentication or provider quota. A PM2/systemd service may have a different
396
396
 
397
397
  The management screen is a normal page. Administrators can filter all projects'
398
398
  tasks by project, user, agent, execution state, or failed cleanup,
399
- with 20 entries per page. They can end/delete individual or selected tasks;
399
+ with 50 entries per page. They can end/delete individual or selected tasks;
400
400
  administrative access does not grant access to other users' terminal streams or
401
401
  private project files. Other users get a personal task list from **Agent tasks**.
402
402
 
@@ -405,8 +405,13 @@ Select an allowed installed agent and click **Start task** to create and launch
405
405
  it in one action. The task name is optional; an omitted name receives six random
406
406
  characters from uppercase/lowercase ASCII letters, digits and `-`. If launch
407
407
  fails, the same task stays selected for retry.
408
- Multiple tasks may use the same agent in the same project. The resizable terminal
409
- sits below the editor. Browser tabs attach to the same running task; one tab
408
+ Multiple tasks may use the same agent in the same project. A shared information
409
+ hint in the terminal heading asks users not to create new sessions inside agents,
410
+ for example with `/new` or `/clear`: commands that start a new conversation with
411
+ an empty context can bypass the task's registered session binding.
412
+ Native renaming does not change a session ID, but its title is independent of
413
+ the TexLite task name.
414
+ The resizable terminal sits below the editor. Browser tabs attach to the same running task; one tab
410
415
  controls input, and another can take control. Hiding the panel, leaving a project,
411
416
  disconnecting a browser, or archiving a project does not stop executions.
412
417
  Agent tasks have no archive state: end an execution to free its process, or
@@ -504,7 +509,15 @@ identified retrospectively.
504
509
  | --- | --- | --- |
505
510
  | Codex | Task-specific `CODEX_HOME`; resume an identified transcript UUID. Use `--no-daemon` when advertised by the installed CLI. | Prefer detected native `delete --force`; remove the task-owned state directory afterward. |
506
511
  | OpenCode | New V2 tasks share the host database, sign-ins and native history. Bind a separate session ID per task and use `--standalone` to own the execution process tree. Existing private conversations keep their original state. | Delete only the task's registered native session, verify deletion, then remove its task directory. Never remove the shared database or host credentials. |
507
- | Claude Code | Task-specific `CLAUDE_CONFIG_DIR`; start with a task UUID and resume its matching saved transcript. | Remove task-owned state without touching the host's other conversations. |
512
+ | Claude Code | Share the service account's native configuration, credentials and initialization state; start with a task UUID and resume that exact ID. | Remove only the registered session's transcripts and session-scoped files; keep host settings and unrelated conversations. |
513
+
514
+ Task deletion records native-cleanup completion in the database before removing
515
+ the task's local files. If local removal fails or the service restarts, retrying
516
+ deletion finishes that step without needing a removed session binding or an
517
+ installed CLI. Failed native cleanup keeps its ownership information for retry.
518
+ If an OpenCode task's project directory has been deleted, management commands
519
+ use its task-state directory while still targeting only its registered database
520
+ and session ID; the deleted project is not recreated.
508
521
 
509
522
  All agents inherit the TexLite service account's `XDG_CACHE_HOME`. If unset,
510
523
  the CLI uses its own default cache location. This lets model catalogs and
@@ -525,7 +538,36 @@ task to use shared host authentication. TexLite's task pages/API show and manage
525
538
  only its own registered tasks. OpenCode's native history picker inside the
526
539
  terminal can also show host conversations; those are not imported into TexLite.
527
540
 
528
- On the first start, Codex, Claude and legacy isolated OpenCode tasks copy selected host credential/configuration
541
+ Claude tasks directly reuse the service account's configuration and sign-in,
542
+ including model settings, plugins and completed onboarding. Without a custom
543
+ `CLAUDE_CONFIG_DIR`, TexLite leaves that variable unset so Claude still finds its
544
+ native `~/.claude.json`; an explicitly configured directory is reused as-is.
545
+ The configuration location and task UUID are registered in
546
+ `agent-tasks/<task-id>/state/claude-session.json` before launching, so later
547
+ environment changes cannot redirect a saved conversation or its cleanup.
548
+ TexLite never imports the host's other conversations into its task list.
549
+ Deletion does not rewrite shared prompt history, settings, plugins or global
550
+ caches, and never uses project-wide `claude purge`.
551
+ Old isolated Claude tasks are not migrated; remove them before upgrading and
552
+ create new tasks to use the shared configuration.
553
+
554
+ Claude starts and resumes also inherit the current TexLite process's exported
555
+ gateway credentials and models (`ANTHROPIC_*`), supported Claude model/context
556
+ settings, cloud-provider authentication (AWS, Azure and Google), request timeout,
557
+ proxy and certificate settings. Only configuration variables are forwarded;
558
+ another Claude session's identity, nested-session markers and transcript controls
559
+ are not. Credentials are not saved in TexLite's session binding.
560
+ Each TexLite instance uses its own process environment, regardless of its port;
561
+ it never reads another instance's environment or sources shell startup files.
562
+ Export variables **before** starting TexLite. After changing a shell profile,
563
+ restart the relevant instance from a shell with those variables loaded
564
+ (`texlite restart --config /path/to/texlite.config.json`, or restart `npm run dev`
565
+ for development); refreshing the browser or restarting only the agent cannot
566
+ update its parent service's environment. Alternatively, put persistent Claude
567
+ variables in the host's `~/.claude/settings.json` under `env`, as described in
568
+ the [Claude environment-variable reference](https://code.claude.com/docs/en/env-vars).
569
+
570
+ On the first start, Codex and legacy isolated OpenCode tasks copy selected host credential/configuration
529
571
  files if available; they do not copy host conversation history. Credentials
530
572
  subsequently refreshed within a task are preserved. Keychain/credential formats
531
573
  vary by CLI version, so an individual task may require login. Provider environment
package/README.md CHANGED
@@ -135,6 +135,10 @@ Git, and Harper locally, use the heavier
135
135
  [TexLite-Docker](https://github.com/SWUFE-DB-Group/TexLite-Docker) deployment.
136
136
  Its published image bundles those runtime dependencies for you.
137
137
 
138
+ The Docker image currently does not include Coding Agent CLIs. For agent
139
+ integration, we recommend deploying TexLite directly via npm and installing and
140
+ configuring the CLIs on the host.
141
+
138
142
  ```bash
139
143
  git clone https://github.com/SWUFE-DB-Group/TexLite-Docker.git
140
144
  cd texlite-docker
package/README.zh-CN.md CHANGED
@@ -119,6 +119,9 @@ TeX 更新、数据位置与协作工作流的掌控。
119
119
  [TexLite-Docker](https://github.com/SWUFE-DB-Group/TexLite-Docker) 部署。其已发布镜像会
120
120
  一并提供这些运行时依赖。
121
121
 
122
+ 当前 Docker 镜像未预装 Coding Agent CLI。如需使用此功能,推荐通过 npm 直接部署
123
+ TexLite,并在宿主机安装、配置所需 CLI。
124
+
122
125
  ```bash
123
126
  git clone https://github.com/SWUFE-DB-Group/TexLite-Docker.git
124
127
  cd texlite-docker
@@ -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,I as i,M as a,N as ee,Z as te,at as ne,et as re}from"./relativeTime-BR0CVAvz.js";import{t as ie}from"./search-n-2tBATf.js";import{t as o}from"./user-plus-3oJZJXHW.js";import{C as s,E as c,b as l,c as u,j as ae,s as oe,y as se}from"./index-DCwfhKK9.js";import{a as ce,l as le,n as ue,r as de,t as fe}from"./dist-CMYWzCHL.js";import{t as pe}from"./SuccessNotice-ubBtzzi_.js";var d={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`}]]};d.node;var f=l(d),p={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`}]]};p.node;var m=l(p),h={name:`lock-keyhole`,size:24,node:[[`circle`,{cx:`12`,cy:`16`,r:`1`,key:`1au0dj`}],[`rect`,{x:`3`,y:`10`,width:`18`,height:`12`,rx:`2`,key:`6s8ecr`}],[`path`,{d:`M7 10V7a5 5 0 0 1 10 0v3`,key:`1pqi11`}]]};h.node;var g=l(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:l}=ae(),[d,p]=(0,_.useState)([]),[h,b]=(0,_.useState)(``),[x,S]=(0,_.useState)(1),[C,me]=(0,_.useState)({page:1,pageSize:20,total:0,totalPages:0}),[w,T]=(0,_.useState)(!0),[E,he]=(0,_.useState)(!1),[ge,_e]=(0,_.useState)(0),[D,O]=(0,_.useState)(``),k=pe(),[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)(``),[V,H]=(0,_.useState)(null),[U,W]=(0,_.useState)(!1),[G,K]=(0,_.useState)(!1),[ye,q]=(0,_.useState)(``),[J,Y]=(0,_.useState)(null),[X,be]=(0,_.useState)(!1),[xe,Z]=(0,_.useState)(``),Q=h.trim(),$=()=>_e(e=>e+1);(0,_.useEffect)(()=>{let e=new AbortController;T(!0),he(!1),O(``);let t=window.setTimeout(()=>{let t=new URLSearchParams({page:String(x)});Q&&t.set(`q`,Q),c(`/api/admin/users?${t}`,{signal:e.signal}).then(t=>{e.signal.aborted||(p(t.users),me(t.pagination),S(t.pagination.page))}).catch(t=>{e.signal.aborted||(O(s(t)),he(!0))}).finally(()=>{e.signal.aborted||T(!1)})},Q?200:0);return()=>{window.clearTimeout(t),e.abort()}},[Q,x,ge]);let Se=async()=>{if(!A){if(F.password.length<t)return N(l(`auth.passwordMinimum`,{count:t}));j(!0),N(``),k.clear();try{await c(`/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(s(e))}finally{j(!1)}}},Ce=async e=>{Y({target:e,setting:e.role===`admin`?`demote`:`promote`}),Z(``)},we=async e=>{Y({target:e,setting:e.canCreateProjects?`denyProjectCreation`:`allowProjectCreation`}),Z(``)},Te=async()=>{if(!J||X)return;let{target:e,setting:t}=J,n=t===`demote`?{role:`user`}:t===`promote`?{role:`admin`}:{canCreateProjects:t===`allowProjectCreation`};be(!0),Z(``);try{await c(`/api/admin/users/${e.id}`,{method:`PATCH`,body:JSON.stringify(n)}),$(),Y(null)}catch(e){Z(s(e))}finally{be(!1)}},Ee=async()=>{if(L&&z&&!A){if(z.length<t)return N(l(`auth.passwordMinimum`,{count:t}));j(!0),N(``),k.clear();try{await c(`/api/admin/users/${L.id}`,{method:`PATCH`,body:JSON.stringify({password:z})}),k.show(`reset:${L.id}`),R(null),B(``)}catch(e){N(s(e))}finally{j(!1)}}},De=async()=>{if(V&&!G){K(!0),q(``);try{await c(`/api/admin/users/${V.id}`,{method:`DELETE`,body:JSON.stringify({deleteProjects:U})}),H(null),W(!1),$()}catch(e){q(s(e))}finally{K(!1)}}};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}),l(`users.manage`)]}),(0,v.jsx)(`p`,{className:`muted`,children:l(`users.onlyAdmin`)})]}),(0,v.jsxs)(`button`,{type:`button`,className:`dashboard-back-button`,onClick:n,children:[(0,v.jsx)(ne,{size:14}),l(`navigation.backToProjects`)]})]}),(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)(ie,{"aria-hidden":!0,size:16}),(0,v.jsx)(`input`,{role:`searchbox`,"aria-label":l(`users.searchPlaceholder`),placeholder:l(`users.searchPlaceholder`),value:h,onChange:e=>{b(e.target.value),S(1)}}),h&&(0,v.jsx)(`button`,{type:`button`,"aria-label":l(`users.clearSearch`),title:l(`users.clearSearch`),onClick:()=>{b(``),S(1)},children:(0,v.jsx)(a,{"aria-hidden":!0,size:14})})]}),!w&&!E&&(0,v.jsx)(`span`,{className:`admin-user-count`,role:`status`,children:l(`users.total`,{count:C.total})})]}),(0,v.jsxs)(`button`,{className:`primary icon-button admin-user-add`,onClick:()=>{k.clear(),N(``),P(!0)},children:[(0,v.jsx)(o,{"aria-hidden":!0,size:15}),(0,v.jsx)(`span`,{role:`status`,children:l(k.message===`create`?`common.done`:`users.add`)})]})]}),D&&(0,v.jsx)(`p`,{className:`error`,role:`alert`,children:D}),(0,v.jsx)(`div`,{className:`table-card admin-user-table`,"aria-busy":w,children:(0,v.jsxs)(`table`,{children:[(0,v.jsx)(`thead`,{children:(0,v.jsxs)(`tr`,{children:[(0,v.jsx)(`th`,{children:l(`common.user`)}),(0,v.jsx)(`th`,{children:l(`users.role`)}),(0,v.jsx)(`th`,{children:l(`users.createProjects`)}),(0,v.jsx)(`th`,{children:l(`users.ownedProjects`)}),(0,v.jsx)(`th`,{children:l(`users.actions`)})]})}),(0,v.jsx)(`tbody`,{children:w?(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)(se,{className:`spin`,size:16}),l(`common.loading`)]})})}):E?(0,v.jsx)(`tr`,{children:(0,v.jsxs)(`td`,{colSpan:5,className:`admin-user-list-state`,children:[(0,v.jsx)(`span`,{children:l(`users.loadFailed`)}),(0,v.jsx)(`button`,{type:`button`,onClick:$,children:l(`common.retry`)})]})}):d.length===0?(0,v.jsx)(`tr`,{children:(0,v.jsx)(`td`,{colSpan:5,className:`admin-user-list-state`,children:l(Q?`users.noMatches`:`users.empty`)})}):d.map(t=>{let n=t.id===e.id,r=A||X;return(0,v.jsxs)(`tr`,{children:[(0,v.jsxs)(`td`,{className:`admin-user-identity`,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:l(`users.selfProtected`),children:[(0,v.jsx)(g,{size:12,"aria-hidden":!0}),l(`common.admin`)]}):(0,v.jsxs)(`select`,{className:`admin-user-role`,"aria-label":l(`users.roleFor`,{username:t.username}),value:t.role,disabled:r,onChange:()=>void Ce(t),children:[(0,v.jsx)(`option`,{value:`user`,children:l(`common.user`)}),(0,v.jsx)(`option`,{value:`admin`,children:l(`common.admin`)})]})}),(0,v.jsx)(`td`,{children:t.role===`admin`?(0,v.jsxs)(`span`,{className:`admin-user-locked`,title:l(`users.adminCreation`),children:[(0,v.jsx)(g,{size:12,"aria-hidden":!0}),l(`users.allow`)]}):(0,v.jsx)(`button`,{type:`button`,className:`admin-user-switch`,role:`switch`,"aria-checked":t.canCreateProjects,"aria-label":l(`users.creationFor`,{username:t.username}),disabled:r,onClick:()=>void we(t),children:(0,v.jsx)(`span`,{})})}),(0,v.jsx)(`td`,{children:t.ownedProjects??0}),(0,v.jsx)(`td`,{children:(0,v.jsxs)(`div`,{className:`admin-user-actions`,children:[(0,v.jsxs)(`button`,{className:`icon-button`,disabled:r,onClick:()=>{k.clear(),R(t),B(``),N(``)},children:[(0,v.jsx)(m,{"aria-hidden":!0,size:13}),(0,v.jsx)(`span`,{role:`status`,children:l(k.message===`reset:${t.id}`?`common.done`:`users.resetPassword`)})]}),!n&&(0,v.jsxs)(fe,{modal:!1,children:[(0,v.jsx)(le,{asChild:!0,children:(0,v.jsx)(`button`,{className:`icon-button`,disabled:r,"aria-label":l(`users.actionsFor`,{username:t.username}),children:(0,v.jsx)(te,{size:17,"aria-hidden":!0})})}),(0,v.jsx)(ce,{children:(0,v.jsx)(ue,{className:`comment-actions-menu-content`,align:`end`,sideOffset:5,children:(0,v.jsxs)(de,{className:`danger-text`,onSelect:()=>{H(t),W(!1),q(``)},children:[(0,v.jsx)(i,{size:14,"aria-hidden":!0}),l(`users.deleteTitle`)]})})})]})]})})]},t.id)})})]})}),C.totalPages>1&&(0,v.jsxs)(`nav`,{className:`project-pagination admin-user-pagination`,"aria-label":l(`users.pagination`),children:[(0,v.jsxs)(`button`,{type:`button`,disabled:w||E||C.page<=1,onClick:()=>S(C.page-1),children:[(0,v.jsx)(re,{size:15}),l(`users.previousPage`)]}),(0,v.jsx)(`span`,{children:l(`users.pageOf`,{page:C.page,totalPages:C.totalPages})}),(0,v.jsxs)(`button`,{type:`button`,disabled:w||E||C.page>=C.totalPages,onClick:()=>S(C.page+1),children:[l(`users.nextPage`),(0,v.jsx)(r,{size:15})]})]}),(0,v.jsxs)(u,{className:`management-dialog`,open:ve,title:l(`users.add`),description:l(`users.addDescription`),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)(a,{"aria-hidden":!0,size:14}),l(`common.cancel`)]}),(0,v.jsxs)(`button`,{className:`primary icon-button`,disabled:A||!F.username.trim()||F.password.length<t,onClick:()=>void Se(),children:[(0,v.jsx)(o,{"aria-hidden":!0,size:14}),l(`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:[l(`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:[l(`users.displayName`),(0,v.jsx)(`input`,{value:F.displayName,onChange:e=>I({...F,displayName:e.target.value})})]}),(0,v.jsxs)(`label`,{className:`form-field`,children:[l(`users.initialPassword`),(0,v.jsxs)(`span`,{className:`password-generator`,children:[(0,v.jsx)(`input`,{minLength:t,autoComplete:`new-password`,value:F.password,onChange:e=>I({...F,password:e.target.value})}),(0,v.jsxs)(`button`,{type:`button`,title:l(`users.generatePassword`),onClick:()=>I({...F,password:y()}),children:[(0,v.jsx)(f,{size:15}),l(`users.randomPassword`)]})]}),(0,v.jsx)(`small`,{className:`field-hint`,children:l(`auth.passwordMinimum`,{count:t})})]}),(0,v.jsxs)(`label`,{className:`form-field`,children:[l(`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:l(`common.user`)}),(0,v.jsx)(`option`,{value:`admin`,children:l(`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})}),` `,l(`users.allowCreate`)]})]})]}),(0,v.jsxs)(u,{className:`management-dialog`,open:!!L,title:l(`users.resetPassword`),description:l(`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)(a,{"aria-hidden":!0,size:14}),l(`common.cancel`)]}),(0,v.jsxs)(`button`,{className:`primary icon-button`,disabled:A||z.length<t,onClick:()=>void Ee(),children:[(0,v.jsx)(m,{"aria-hidden":!0,size:14}),l(`users.reset`)]})]}),children:[M&&(0,v.jsx)(`p`,{className:`error`,role:`alert`,children:M}),(0,v.jsxs)(`label`,{className:`form-field`,children:[l(`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)(f,{size:15}),l(`users.randomPassword`)]})]}),(0,v.jsx)(`small`,{className:`field-hint`,children:l(`auth.passwordMinimum`,{count:t})})]})]}),(0,v.jsx)(u,{className:`management-dialog`,open:!!V,title:l(`users.deleteTitle`),description:l(`users.deleteDescription`,{username:V?.username??``}),onOpenChange:e=>{!e&&!G&&(H(null),q(``))},footer:(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(`button`,{className:`icon-button`,disabled:G,onClick:()=>{H(null),q(``)},children:[(0,v.jsx)(a,{"aria-hidden":!0,size:14}),l(`common.cancel`)]}),(0,v.jsxs)(`button`,{className:`danger icon-button`,disabled:G,"aria-busy":G,onClick:()=>void De(),children:[G?(0,v.jsx)(se,{className:`spin`,"aria-hidden":!0,size:14}):(0,v.jsx)(i,{"aria-hidden":!0,size:14}),l(G?`common.loading`:`users.deleteTitle`)]})]}),children:(0,v.jsxs)(v.Fragment,{children:[ye&&(0,v.jsx)(`p`,{className:`error dialog-error`,children:ye}),(0,v.jsxs)(`fieldset`,{className:`choice-group`,disabled:G,children:[(0,v.jsx)(`legend`,{children:l(`users.ownedChoice`,{count:V?.ownedProjects??0})}),(0,v.jsxs)(`label`,{children:[(0,v.jsx)(`input`,{type:`radio`,checked:!U,onChange:()=>W(!1)}),` `,l(`users.transferProjects`)]}),(0,v.jsxs)(`label`,{children:[(0,v.jsx)(`input`,{type:`radio`,checked:U,onChange:()=>W(!0)}),` `,l(`users.deleteProjects`)]})]})]})}),(0,v.jsx)(oe,{open:!!J,title:l(`userConfirmations.${J?.setting??`demote`}Title`),description:l(`userConfirmations.${J?.setting??`demote`}Description`,{username:J?.target.username??``}),confirmLabel:l(`userConfirmations.${J?.setting??`demote`}Confirm`),danger:J?.setting!==`promote`&&J?.setting!==`allowProjectCreation`,busy:X,error:xe,onCancel:()=>{X||(Y(null),Z(``))},onConfirm:()=>void Te()})]})}export{b as AdminUsers};
@@ -1 +1 @@
1
- import{t as e}from"./react-DUEFWlB7.js";import{b as t}from"./index-h0BVkT8k.js";var n={name:`square`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]};n.node;var r=t(n),i={codex:`Codex`,opencode:`OpenCode`,claude:`Claude Code`},a=65536;function o(e){let t=[];for(let n=0;n<e.length;){let r=Math.min(e.length,n+a),i=e.charCodeAt(r-1);r<e.length&&i>=55296&&i<=56319&&r--,t.push(e.slice(n,r)),n=r}return t}var s=e(),c={codex:{path:`M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z`},opencode:{path:`M16 6H8v12h8V6zm4 16H4V2h16v20z`},claude:{color:`#D97757`,path:`M20.998 10.949H24v3.102h-3v3.028h-1.487V20H18v-2.921h-1.487V20H15v-2.921H9V20H7.488v-2.921H6V20H4.487v-2.921H3V14.05H0V10.95h3V5h17.998v5.949zM6 10.949h1.488V8.102H6v2.847zm10.51 0H18V8.102h-1.49v2.847z`}};function l({agent:e,size:t=18}){let n=c[e];return(0,s.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,width:t,height:t,className:`agent-identity-icon`,fill:n.color??`currentColor`,"aria-hidden":`true`,focusable:`false`,children:(0,s.jsx)(`path`,{d:n.path,fillRule:`evenodd`,clipRule:`evenodd`})})}export{r as i,i as n,o as r,l as t};
1
+ import{t as e}from"./react-DUEFWlB7.js";import{b as t}from"./index-DCwfhKK9.js";var n={name:`square`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]};n.node;var r=t(n),i={codex:`Codex`,opencode:`OpenCode`,claude:`Claude Code`},a=65536;function o(e){let t=[];for(let n=0;n<e.length;){let r=Math.min(e.length,n+a),i=e.charCodeAt(r-1);r<e.length&&i>=55296&&i<=56319&&r--,t.push(e.slice(n,r)),n=r}return t}var s=e(),c={codex:{path:`M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z`},opencode:{path:`M16 6H8v12h8V6zm4 16H4V2h16v20z`},claude:{color:`#D97757`,path:`M20.998 10.949H24v3.102h-3v3.028h-1.487V20H18v-2.921h-1.487V20H15v-2.921H9V20H7.488v-2.921H6V20H4.487v-2.921H3V14.05H0V10.95h3V5h17.998v5.949zM6 10.949h1.488V8.102H6v2.847zm10.51 0H18V8.102h-1.49v2.847z`}};function l({agent:e,size:t=18}){let n=c[e];return(0,s.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,width:t,height:t,className:`agent-identity-icon`,fill:n.color??`currentColor`,"aria-hidden":`true`,focusable:`false`,children:(0,s.jsx)(`path`,{d:n.path,fillRule:`evenodd`,clipRule:`evenodd`})})}export{r as i,i as n,o as r,l as t};
@@ -1 +1 @@
1
- .agent-management{gap:20px;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-muted,#65756b);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{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-management button.agent-danger,.agent-terminal-panel button.agent-danger{color:var(--ui-danger,#a33c36)}.agent-management .project-pagination{margin-top:0}.agent-pagination button{box-sizing:border-box;white-space:nowrap;min-width:92px;height:32px;padding:0 10px;line-height:1}.agent-pagination>span{text-align:center;font-variant-numeric:tabular-nums;min-width:44px}.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-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-warning{color:var(--ui-warning,#91640f);flex:none}.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-notice,.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-notice{color:var(--ui-accent,#236544)}.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<=550px){.agent-policy-card{padding:13px}}
1
+ .agent-management{gap:20px;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-muted,#65756b);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{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-management button.agent-danger,.agent-terminal-panel button.agent-danger{color:var(--ui-danger,#a33c36)}.agent-management .project-pagination{margin-top:0}.agent-pagination button{box-sizing:border-box;white-space:nowrap;min-width:92px;height:32px;padding:0 10px;line-height:1}.agent-pagination>span{text-align:center;font-variant-numeric:tabular-nums;min-width:44px}.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<=550px){.agent-policy-card{padding:13px}}
@@ -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{t as r}from"./arrow-down-B6T7Z6IO.js";import{$ as i,F as a,I as o,L as s,a as c,at as ee,et as te,f as ne,y as l}from"./relativeTime-BR0CVAvz.js";import{t as re}from"./SaveButton-DkyoEu6j.js";import{t as ie}from"./info-DNSAs0_-.js";import{t as u}from"./refresh-cw-DuLtxWBX.js";import{i as d,n as f,t as p}from"./AgentIcon-ClP5dPRL.js";import{C as m,E as h,c as ae,j as oe,y as g}from"./index-DCwfhKK9.js";import{t as se}from"./SuccessNotice-ubBtzzi_.js";var _=e(t(),1),v=n();function y({user:e,onBack:t}){let{t:n,i18n:y}=oe(),{showExecutionReminder:ce}=ne(),b=e.role===`admin`,x=b?`/api/admin/agent-tasks`:`/api/agent-tasks`,[S,C]=(0,_.useState)(null),[w,T]=(0,_.useState)({allowed:[]}),[E,le]=(0,_.useState)({tasks:[],page:1,pageSize:50,total:0}),[D,O]=(0,_.useState)(1),[k,ue]=(0,_.useState)(``),[A,de]=(0,_.useState)(``),[j,fe]=(0,_.useState)(``),[M,pe]=(0,_.useState)(``),[me,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=se(),[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(m(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&&(le(e),F(!1))}).catch(e=>{!t&&!n.signal.aborted&&(V(m(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,me]);let Y=async e=>{if(!R.current){R.current=!0,L(!0),V(``),H.clear();try{await e()}catch(e){z.current&&V(m(e))}finally{R.current=!1,c(),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]=m(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)(s,{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)(`button`,{type:`button`,className:`agent-policy-help`,"aria-label":n(`agents.usageHint`),"data-tooltip":n(`agents.usageHint`),children:(0,v.jsx)(ie,{size:15,"aria-hidden":`true`})})]}),(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)(u,{size:14}),(0,v.jsx)(`span`,{role:`status`,children:n(H.message===`detect`?`common.done`:`agents.detection`)})]}),(0,v.jsx)(re,{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)(p,{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`)})]}),ce&&(0,v.jsxs)(`p`,{className:`agent-list-reminder`,children:[(0,v.jsx)(a,{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(ue,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(de,e.target.value),children:[(0,v.jsx)(`option`,{value:``,children:n(`agents.agent`)}),Object.entries(f).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(fe,e.target.value)}),b&&(0,v.jsx)(`input`,{"aria-label":n(`agents.userFilter`),placeholder:n(`agents.userFilter`),value:M,onChange:e=>Q(pe,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)(u,{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)(d,{size:13}),n(`agents.batchEnd`)]}),(0,v.jsxs)(`button`,{className:`agent-danger`,disabled:I,onClick:()=>Z($),children:[(0,v.jsx)(o,{size:13}),n(`agents.batchDelete`)]})]}),(0,v.jsxs)(`div`,{className:`agent-table-scroll table-card`,children:[(0,v.jsxs)(`table`,{className:`agent-task-table`,children:[(0,v.jsx)(`thead`,{children:(0,v.jsxs)(`tr`,{children:[(0,v.jsx)(`th`,{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)(r,{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`,{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`,{children:(0,v.jsx)(`strong`,{className:`agent-task-name`,title:e.title,children:e.title})}),(0,v.jsx)(`td`,{children:(0,v.jsx)(`span`,{className:`agent-task-name`,title:e.projectId,children:e.projectName})}),b&&(0,v.jsx)(`td`,{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`,{children:(0,v.jsxs)(`span`,{className:`agent-identity`,children:[(0,v.jsx)(p,{agent:e.agentId,size:15}),f[e.agentId]]})}),(0,v.jsxs)(`td`,{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`,children:(0,v.jsx)(`time`,{dateTime:e.updatedAt,tabIndex:0,"data-tooltip":n(`agents.createdTooltip`,{created:l(e.createdAt,y.resolvedLanguage)}),children:l(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`,{disabled:I||![`running`,`starting`,`stopping`].includes(e.state),onClick:()=>void Y(()=>X([e],`stop`)),children:[(0,v.jsx)(d,{size:12}),(0,v.jsx)(`span`,{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)(o,{size:14})})]})]},e.id))})]}),!E.tasks.length&&(0,v.jsxs)(`div`,{className:`agent-task-empty`,children:[P?(0,v.jsx)(g,{size:24,className:`spin`}):(0,v.jsx)(s,{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)(te,{size:14,"aria-hidden":`true`}),n(`agents.previous`)]}),(0,v.jsxs)(`span`,{children:[E.page,` / `,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)(i,{size:14,"aria-hidden":`true`})]})]}),(0,v.jsx)(ae,{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)(g,{size:14,className:`spin`}),n(`agents.delete`)]})]}),children:G.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,` · `,f[e.agentId]]}),q[e.id]&&(0,v.jsx)(`p`,{className:`error`,role:`alert`,children:q[e.id]})]},e.id))})]})}export{y as AgentManagement};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./AgentTerminalSurface-CaYNNZ9A.js","./rolldown-runtime-XKyaHtl9.js","./react-DUEFWlB7.js","./basePath-B5-c90eh.js","./relativeTime-BR0CVAvz.js","./index-DCwfhKK9.js","./i18nInstance-CIMFwH0l.js","./i18n-DF6keNBA.js","./vite-runtime-CRzLMJPS.js","./index-SVNFLCYh.css","./AgentIcon-ClP5dPRL.js","./AgentIcon-DxrC-zx_.css","./AgentTerminalSurface-B5LH8GIb.css"])))=>i.map(i=>d[i]);
2
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-DUEFWlB7.js";import{t as r}from"./vite-runtime-CRzLMJPS.js";import{$ as i,F as a,I as o,L as s,M as c,a as l,et as u,f as d,p as f,tt as p,z as m}from"./relativeTime-BR0CVAvz.js";import{t as h}from"./check-BRlv1lrZ.js";import{t as g}from"./chevron-up-krb7w67X.js";import{t as _}from"./SaveButton-DkyoEu6j.js";import{t as v}from"./info-DNSAs0_-.js";import{t as y}from"./plus-Dfkyfvvy.js";import{i as b,n as x,t as S}from"./AgentIcon-ClP5dPRL.js";import{C,E as w,c as T,j as E,y as D}from"./index-DCwfhKK9.js";import{a as O,i as k,l as A,n as j,o as M,s as N,t as P}from"./dist-CMYWzCHL.js";import{R as ee}from"./ProjectWorkspace-1UOdyfBq.js";var F=e(t(),1);function I(e){let[t,n]=(0,F.useState)(null),[r,i]=(0,F.useState)({tasks:[],page:1,pageSize:50,total:0}),[a,o]=(0,F.useState)(1),[s,c]=(0,F.useState)(``),[u,d]=(0,F.useState)(``),[f,p]=(0,F.useState)(!1),m=(0,F.useRef)(!1),h=(0,F.useRef)(0),g=(0,F.useRef)(!1),[_,v]=(0,F.useState)(0);(0,F.useEffect)(()=>(g.current=!0,()=>{g.current=!1}),[]),(0,F.useEffect)(()=>{let e=new AbortController;return w(`/api/agents`,{signal:e.signal}).then(n).catch(t=>{e.signal.aborted||d(C(t))}),()=>e.abort()},[e,_]),(0,F.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)});w(`/api/agent-tasks?${s}`,{signal:r.signal}).then(e=>{n||r.signal.aborted||o!==h.current||(i(e),c(t=>e.tasks.some(e=>e.id===t)?t:e.tasks[0]?.id??``))}).catch(e=>{!n&&!r.signal.aborted&&o===h.current&&d(C(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,F.useCallback)(()=>v(e=>e+1),[]),b=(0,F.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||l()},[]);return{catalog:t,result:r,page:a,setPage:o,selectedId:s,setSelectedId:c,selected:r.tasks.find(e=>e.id===s)??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(C(e))}finally{m.current=!1,l(),g.current&&(p(!1),y())}}},acceptTask:b}}var L=n();function R({agents:e,value:t,onChange:n,disabled:r=!1}){let{t:i}=E(),[a,o]=(0,F.useState)(!1),s=(0,F.useRef)(null),c=e.find(e=>e.id===t),l=r||e.length===0;return(0,F.useEffect)(()=>{l&&o(!1)},[l]),(0,L.jsxs)(P,{modal:!1,open:a,onOpenChange:o,children:[(0,L.jsx)(A,{asChild:!0,children:(0,L.jsxs)(`button`,{ref:s,type:`button`,className:`agent-select-trigger`,disabled:l,"aria-label":c?`${i(`agents.agent`)}: ${c.label}`:i(`agents.agent`),children:[c&&(0,L.jsx)(S,{agent:c.id,size:16}),(0,L.jsx)(`span`,{children:c?.label??i(`agents.agent`)}),(0,L.jsx)(p,{size:13,"aria-hidden":`true`})]})}),(0,L.jsx)(O,{container:s.current?.closest(`[role="dialog"]`),children:(0,L.jsx)(j,{className:`agent-select-options`,side:`top`,align:`start`,sideOffset:5,collisionPadding:8,children:(0,L.jsx)(M,{value:t,"aria-label":i(`agents.agent`),onValueChange:t=>{let r=e.find(e=>e.id===t);!l&&r?.installed&&r.enabled&&n(r.id)},children:e.map(e=>(0,L.jsxs)(N,{value:e.id,textValue:e.label,className:`agent-select-option`,disabled:l||!e.installed||!e.enabled,children:[(0,L.jsx)(S,{agent:e.id,size:16}),(0,L.jsxs)(`span`,{className:`agent-select-label`,children:[e.label,(!e.installed||!e.enabled)&&(0,L.jsx)(`small`,{children:i(e.installed?`agents.disabled`:`agents.notInstalled`)})]}),(0,L.jsx)(k,{className:`agent-select-check`,children:(0,L.jsx)(h,{size:14,"aria-hidden":`true`})})]},e.id))})})})]})}var z=(0,F.lazy)(()=>r(()=>import(`./AgentTerminalSurface-CaYNNZ9A.js`).then(e=>({default:e.AgentTerminalSurface})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]),import.meta.url));function B({projectId:e,readOnly:t,onHide:n,maximized:r=!1,onToggleMaximized:l}){let{t:h}=E(),C=I(e),O=d(),k=C.selected,[A,j]=(0,F.useState)(!1),[M,N]=(0,F.useState)(``),[P,B]=(0,F.useState)(``),[V,H]=(0,F.useState)(!1),[U,W]=(0,F.useState)(``),[G,K]=(0,F.useState)(!1),q=k&&[`starting`,`running`,`stopping`].includes(k.state),te=k&&(k.canResume||k.startedAt!==null||[`stopped`,`exited`,`interrupted`].includes(k.state)),J=C.catalog?.agents.find(e=>e.id===k?.agentId),Y=C.catalog?.agents.filter(e=>e.installed&&e.enabled)??[],X=P?C.catalog?.agents.find(e=>e.id===P):Y[0],Z=!!(C.result.activeTaskId&&C.result.activeTaskId!==k?.id),Q=t||C.busy||!!C.result.activeTaskId||!C.catalog?.ptyAvailable||!X?.installed||!X.enabled,ne=!Z&&!t&&J?.installed&&J.enabled&&C.catalog?.ptyAvailable&&k?.cleanupState===`none`,re=e=>{C.setSelectedId(e),H(!1)},$=e=>C.mutate(async()=>{if(!k)return;let t=await w(`/api/agent-tasks/${k.id}${e}`,{method:`POST`});C.acceptTask(t.task)});return(0,L.jsxs)(`section`,{className:`agent-terminal-panel`,"data-agent-terminal":`true`,"aria-label":h(`agents.terminal`),children:[(0,L.jsxs)(`div`,{className:`agent-terminal-heading`,children:[(0,L.jsxs)(`strong`,{children:[(0,L.jsx)(s,{size:14}),h(`agents.terminal`)]}),(0,L.jsx)(`button`,{type:`button`,className:`agent-session-help`,"aria-label":h(`agents.sessionManagementHint`),"data-tooltip":h(`agents.sessionManagementHint`),"data-texlite-tooltip-always":!0,children:(0,L.jsx)(v,{size:13,"aria-hidden":`true`})}),(0,L.jsx)(`div`,{className:`agent-task-tabs`,role:`tablist`,"aria-label":h(`agents.tasks`),children:C.result.tasks.map(e=>(0,L.jsxs)(`button`,{role:`tab`,type:`button`,"aria-selected":e.id===k?.id,title:e.title,className:e.id===k?.id?`active`:``,onClick:()=>re(e.id),children:[(0,L.jsx)(`span`,{className:`agent-state-dot ${e.state}`}),(0,L.jsx)(S,{agent:e.agentId,size:13}),(0,L.jsx)(`span`,{children:e.title}),(0,L.jsx)(`small`,{children:x[e.agentId]})]},e.id))}),(0,L.jsx)(`button`,{className:`agent-icon-button`,disabled:t||C.busy||!Y.length,title:h(`agents.newTask`),"aria-label":h(`agents.newTask`),onClick:()=>j(e=>!e),children:(0,L.jsx)(y,{size:15})}),l&&(0,L.jsx)(`button`,{type:`button`,className:`agent-icon-button`,title:h(r?`agents.restoreTerminal`:`agents.maximizeTerminal`),"aria-label":h(r?`agents.restoreTerminal`:`agents.maximizeTerminal`),"aria-pressed":r,onClick:l,children:r?(0,L.jsx)(p,{size:15}):(0,L.jsx)(g,{size:15})}),(0,L.jsx)(`button`,{className:`agent-icon-button`,title:h(`agents.hide`),"aria-label":h(`agents.hide`),onClick:n,children:(0,L.jsx)(c,{size:15})})]}),(k||C.result.total>C.result.pageSize)&&(0,L.jsxs)(`div`,{className:`agent-task-toolbar`,children:[C.result.total>C.result.pageSize&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`button`,{disabled:C.result.page<=1,"aria-label":h(`agents.previous`),onClick:()=>C.setPage(C.result.page-1),children:(0,L.jsx)(u,{size:13})}),(0,L.jsxs)(`small`,{children:[C.result.page,` / `,Math.ceil(C.result.total/C.result.pageSize)]}),(0,L.jsx)(`button`,{disabled:C.result.page*C.result.pageSize>=C.result.total,"aria-label":h(`agents.next`),onClick:()=>C.setPage(C.result.page+1),children:(0,L.jsx)(i,{size:13})})]}),k&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`span`,{className:`agent-task-state`,children:h(`agents.state_${k.state}`)}),(0,L.jsx)(`span`,{className:`agent-toolbar-spacer`}),q?(0,L.jsxs)(`button`,{disabled:C.busy,onClick:()=>void $(`/stop`),children:[(0,L.jsx)(b,{size:12}),h(`agents.end`)]}):(0,L.jsxs)(`button`,{disabled:!ne||C.busy,onClick:()=>void $(`/start`),children:[(0,L.jsx)(ee,{size:13}),h(te?`agents.resume`:`agents.start`)]}),(0,L.jsx)(`button`,{className:`agent-icon-button`,title:h(`agents.rename`),"aria-label":h(`agents.rename`),disabled:C.busy,onClick:()=>{W(k.title),H(e=>!e)},children:(0,L.jsx)(m,{size:13})}),(0,L.jsx)(`button`,{className:`agent-icon-button agent-danger`,title:h(`agents.delete`),"aria-label":h(`agents.delete`),disabled:C.busy,onClick:()=>{C.setError(``),K(!0)},children:(0,L.jsx)(o,{size:13})})]})]}),(A||!k)&&(0,L.jsxs)(`form`,{className:`agent-task-create`,onSubmit:t=>{t.preventDefault(),!Q&&C.mutate(async()=>{let t=X?.id,n=await w(`/api/projects/${e}/agent-tasks`,{method:`POST`,body:JSON.stringify({agentId:t,title:M})});C.acceptTask(n.task),C.setPage(1),C.setSelectedId(n.task.id),j(!1),N(``);let r=await w(`/api/agent-tasks/${n.task.id}/start`,{method:`POST`});C.acceptTask(r.task)})},children:[(0,L.jsx)(`input`,{"aria-label":h(`agents.task`),placeholder:h(`agents.titlePlaceholder`),maxLength:160,value:M,onChange:e=>N(e.target.value),disabled:C.busy||t}),(0,L.jsx)(R,{agents:C.catalog?.agents??[],value:X?.id??``,onChange:B,disabled:t||C.busy}),(0,L.jsxs)(`button`,{type:`submit`,disabled:Q,children:[C.busy&&(0,L.jsx)(D,{className:`spin`,size:13}),h(`agents.create`)]})]}),V&&k&&(0,L.jsxs)(`form`,{className:`agent-task-create`,onSubmit:e=>{e.preventDefault(),C.mutate(async()=>{let e=await w(`/api/agent-tasks/${k.id}`,{method:`PATCH`,body:JSON.stringify({title:U})});C.acceptTask(e.task),H(!1)})},children:[(0,L.jsx)(`input`,{value:U,onChange:e=>W(e.target.value),required:!0,maxLength:160,"aria-label":h(`agents.task`)}),(0,L.jsx)(_,{type:`submit`,saving:C.busy,children:h(`common.save`)})]}),C.error&&!G&&(0,L.jsxs)(`p`,{className:`error agent-inline-error`,role:`alert`,children:[C.error,(0,L.jsx)(`button`,{onClick:()=>C.setError(``),"aria-label":h(`common.close`),children:(0,L.jsx)(c,{size:13})})]}),k?.errorCode&&!C.error&&!G&&(0,L.jsx)(`p`,{className:`error agent-inline-error`,role:`alert`,children:h(`errors.codes.${k.errorCode}`,{defaultValue:h(`agents.taskUnavailable`)})}),(Z||A&&C.result.activeTaskId)&&(0,L.jsxs)(`p`,{className:`agent-inline-warning`,role:`status`,children:[(0,L.jsx)(a,{size:14,"aria-hidden":`true`}),(0,L.jsx)(`span`,{children:h(`errors.codes.AGENT_PROJECT_BUSY`)})]}),C.catalog&&!C.catalog.ptyAvailable&&(0,L.jsx)(`p`,{className:`error agent-inline-error`,children:h(`agents.ptyUnavailable`)}),(0,L.jsx)(`div`,{className:`agent-terminal-body`,style:f(O.theme),children:(0,L.jsx)(F.Suspense,{fallback:(0,L.jsx)(`div`,{className:`agent-task-empty`,children:(0,L.jsx)(D,{className:`spin`,size:18})}),children:k&&q&&!t?(0,L.jsx)(z,{task:k,onTask:C.acceptTask},k.id):(0,L.jsxs)(`div`,{className:`agent-task-empty`,children:[(0,L.jsx)(s,{size:24}),(0,L.jsx)(`strong`,{children:k?.title||h(`agents.noTasks`)}),(0,L.jsx)(`p`,{children:h(t?`agents.permissionLost`:`agents.readyHint`)}),k?.exitCode!==null&&k?.exitCode!==void 0&&k.exitCode!==0&&(0,L.jsx)(`small`,{children:h(`agents.exitCode`,{code:k.exitCode})})]})})}),O.showExecutionReminder&&q&&k.state!==`stopping`&&(0,L.jsxs)(`p`,{className:`agent-execution-reminder`,children:[(0,L.jsx)(a,{size:12,"aria-hidden":`true`}),(0,L.jsx)(`span`,{children:h(`agents.endReminder`)})]}),k&&(0,L.jsx)(T,{open:G,title:h(`agents.delete`),description:h(`agents.deleteDescription`),onOpenChange:e=>{C.busy||K(e)},footer:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`button`,{disabled:C.busy,onClick:()=>K(!1),children:h(`common.cancel`)}),(0,L.jsxs)(`button`,{className:`danger`,disabled:C.busy,onClick:()=>void C.mutate(async()=>{await w(`/api/agent-tasks/${k.id}`,{method:`DELETE`}),K(!1)}),children:[C.busy&&(0,L.jsx)(D,{className:`spin`,size:13}),h(`agents.delete`)]})]}),children:C.error&&(0,L.jsx)(`p`,{className:`error`,role:`alert`,children:C.error})})]})}export{B as AgentTerminal};