texlite 0.19.0 → 0.19.2

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 (208) hide show
  1. package/DESIGN.md +127 -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-D5vhK_Ae.js +1 -0
  6. package/dist/client/assets/AdminUsers-D5vhK_Ae.js.br +0 -0
  7. package/dist/client/assets/AdminUsers-D5vhK_Ae.js.gz +0 -0
  8. package/dist/client/assets/{AgentIcon-BlHvdrRo.js → AgentIcon-C97W4Mt-.js} +1 -1
  9. package/dist/client/assets/AgentIcon-C97W4Mt-.js.br +0 -0
  10. package/dist/client/assets/AgentIcon-C97W4Mt-.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-D6I_GDL_.js +1 -0
  15. package/dist/client/assets/AgentManagement-D6I_GDL_.js.br +0 -0
  16. package/dist/client/assets/AgentManagement-D6I_GDL_.js.gz +0 -0
  17. package/dist/client/assets/AgentTerminal-fsHpIB_c.js +2 -0
  18. package/dist/client/assets/AgentTerminal-fsHpIB_c.js.br +0 -0
  19. package/dist/client/assets/AgentTerminal-fsHpIB_c.js.gz +0 -0
  20. package/dist/client/assets/{AgentTerminalSurface-D0MLcJmw.js → AgentTerminalSurface-C11baRxh.js} +2 -2
  21. package/dist/client/assets/AgentTerminalSurface-C11baRxh.js.br +0 -0
  22. package/dist/client/assets/AgentTerminalSurface-C11baRxh.js.gz +0 -0
  23. package/dist/client/assets/AvatarSettingsDialog-B80aSza0.js +1 -0
  24. package/dist/client/assets/AvatarSettingsDialog-B80aSza0.js.br +0 -0
  25. package/dist/client/assets/AvatarSettingsDialog-B80aSza0.js.gz +0 -0
  26. package/dist/client/assets/CitationLibraryDialog-DE7W81FW.js +1 -0
  27. package/dist/client/assets/CitationLibraryDialog-DE7W81FW.js.br +0 -0
  28. package/dist/client/assets/CitationLibraryDialog-DE7W81FW.js.gz +0 -0
  29. package/dist/client/assets/Dashboard-DAPwKNNH.js +5 -0
  30. package/dist/client/assets/Dashboard-DAPwKNNH.js.br +0 -0
  31. package/dist/client/assets/Dashboard-DAPwKNNH.js.gz +0 -0
  32. package/dist/client/assets/GitDialog-BzyA_IgU.js +3 -0
  33. package/dist/client/assets/GitDialog-BzyA_IgU.js.br +0 -0
  34. package/dist/client/assets/GitDialog-BzyA_IgU.js.gz +0 -0
  35. package/dist/client/assets/GitHubAccountDialog-tigrQQNz.js +1 -0
  36. package/dist/client/assets/GitHubAccountDialog-tigrQQNz.js.br +0 -0
  37. package/dist/client/assets/GitHubAccountDialog-tigrQQNz.js.gz +0 -0
  38. package/dist/client/assets/{GitHubIcon-BPTVKTrM.js → GitHubIcon-BqDow-CN.js} +1 -1
  39. package/dist/client/assets/HistoryDialog-407q3Fe6.js +8 -0
  40. package/dist/client/assets/HistoryDialog-407q3Fe6.js.br +0 -0
  41. package/dist/client/assets/HistoryDialog-407q3Fe6.js.gz +0 -0
  42. package/dist/client/assets/{LatexEditor-BDpqgoOa.js → LatexEditor-BYiVPD_b.js} +26 -26
  43. package/dist/client/assets/LatexEditor-BYiVPD_b.js.br +0 -0
  44. package/dist/client/assets/LatexEditor-BYiVPD_b.js.gz +0 -0
  45. package/dist/client/assets/{PdfPreview-C2puKgCh.js → PdfPreview-Bbzop29j.js} +1 -1
  46. package/dist/client/assets/PdfPreview-Bbzop29j.js.br +0 -0
  47. package/dist/client/assets/PdfPreview-Bbzop29j.js.gz +0 -0
  48. package/dist/client/assets/ProjectIconPickerDialog-CsT5Pj4j.js +1 -0
  49. package/dist/client/assets/ProjectIconPickerDialog-CsT5Pj4j.js.br +0 -0
  50. package/dist/client/assets/ProjectIconPickerDialog-CsT5Pj4j.js.gz +0 -0
  51. package/dist/client/assets/ProjectSettings-BfvAiyC6.js +4 -0
  52. package/dist/client/assets/ProjectSettings-BfvAiyC6.js.br +0 -0
  53. package/dist/client/assets/ProjectSettings-BfvAiyC6.js.gz +0 -0
  54. package/dist/client/assets/ProjectWorkspace-DHVcaXR0.js +30 -0
  55. package/dist/client/assets/ProjectWorkspace-DHVcaXR0.js.br +0 -0
  56. package/dist/client/assets/ProjectWorkspace-DHVcaXR0.js.gz +0 -0
  57. package/dist/client/assets/{QuickOpenDialog-CEYxIk4l.js → QuickOpenDialog-DKq9iNJ5.js} +1 -1
  58. package/dist/client/assets/QuickOpenDialog-DKq9iNJ5.js.br +0 -0
  59. package/dist/client/assets/QuickOpenDialog-DKq9iNJ5.js.gz +0 -0
  60. package/dist/client/assets/SaveButton-C8W1DGzx.js +1 -0
  61. package/dist/client/assets/{SelectionHistoryDialog-DBL6vVD4.js → SelectionHistoryDialog-cDxbuXmO.js} +2 -2
  62. package/dist/client/assets/SelectionHistoryDialog-cDxbuXmO.js.br +0 -0
  63. package/dist/client/assets/SelectionHistoryDialog-cDxbuXmO.js.gz +0 -0
  64. package/dist/client/assets/SuccessNotice-ubBtzzi_.js +1 -0
  65. package/dist/client/assets/SystemMetricsDialog-GZbYEHna.js +1 -0
  66. package/dist/client/assets/SystemMetricsDialog-GZbYEHna.js.br +0 -0
  67. package/dist/client/assets/SystemMetricsDialog-GZbYEHna.js.gz +0 -0
  68. package/dist/client/assets/TagColorSelect-D-zwdawC.js +1 -0
  69. package/dist/client/assets/TagManagementDialog-BN3tlXuW.js +1 -0
  70. package/dist/client/assets/TagManagementDialog-BN3tlXuW.js.br +0 -0
  71. package/dist/client/assets/TagManagementDialog-BN3tlXuW.js.gz +0 -0
  72. package/dist/client/assets/{WordCountDialog-DaHxqArj.js → WordCountDialog-C4okQWS3.js} +1 -1
  73. package/dist/client/assets/WordCountDialog-C4okQWS3.js.br +0 -0
  74. package/dist/client/assets/WordCountDialog-C4okQWS3.js.gz +0 -0
  75. package/dist/client/assets/{arrow-down-BySB1dS6.js → arrow-down-BiIGj4-X.js} +1 -1
  76. package/dist/client/assets/check-DfWHdQ1s.js +1 -0
  77. package/dist/client/assets/chevron-up-lyMKml7P.js +1 -0
  78. package/dist/client/assets/{chktex-B2-niLAo.js → chktex-Dm6IIkcR.js} +1 -1
  79. package/dist/client/assets/{circle-check-CfK-oqlC.js → circle-check-DjXwnxuR.js} +1 -1
  80. package/dist/client/assets/{clock-3-C_8q2yLj.js → clock-3-D-XeFtkK.js} +1 -1
  81. package/dist/client/assets/{dist-CIxSPQK5.js → dist-ByqeNQqT.js} +1 -1
  82. package/dist/client/assets/dist-ByqeNQqT.js.br +0 -0
  83. package/dist/client/assets/dist-ByqeNQqT.js.gz +0 -0
  84. package/dist/client/assets/{eye-DpIOhQ2p.js → eye-BvCLgqrq.js} +1 -1
  85. package/dist/client/assets/{hard-drive-DRbINIYf.js → hard-drive-Crh-l_oh.js} +1 -1
  86. package/dist/client/assets/i18n-O9QnEo2t.js +13 -0
  87. package/dist/client/assets/i18n-O9QnEo2t.js.br +0 -0
  88. package/dist/client/assets/i18n-O9QnEo2t.js.gz +0 -0
  89. package/dist/client/assets/index-7d5TfVNx.css +1 -0
  90. package/dist/client/assets/index-7d5TfVNx.css.br +0 -0
  91. package/dist/client/assets/index-7d5TfVNx.css.gz +0 -0
  92. package/dist/client/assets/index-DFEpXxLs.js +42 -0
  93. package/dist/client/assets/index-DFEpXxLs.js.br +0 -0
  94. package/dist/client/assets/index-DFEpXxLs.js.gz +0 -0
  95. package/dist/client/assets/{info-DB-RajXx.js → info-g1IBvVg6.js} +1 -1
  96. package/dist/client/assets/{minimize-2-DtsKyo4M.js → minimize-2-BHKmubQs.js} +1 -1
  97. package/dist/client/assets/{minus-CdwrG9Yo.js → minus-BmWzkFwz.js} +1 -1
  98. package/dist/client/assets/plus-CoYCCEFJ.js +1 -0
  99. package/dist/client/assets/{refresh-cw-c6Tzy-hb.js → refresh-cw-Di6Huxb4.js} +1 -1
  100. package/dist/client/assets/relativeTime-CFNodf1I.js +1 -0
  101. package/dist/client/assets/relativeTime-CFNodf1I.js.br +0 -0
  102. package/dist/client/assets/relativeTime-CFNodf1I.js.gz +0 -0
  103. package/dist/client/assets/{search-Cy8DgYGb.js → search-l36unLLS.js} +1 -1
  104. package/dist/client/assets/{spellCheck-DEQIFH7w.js → spellCheck-DiNvmZKv.js} +1 -1
  105. package/dist/client/assets/spellCheck-DiNvmZKv.js.br +0 -0
  106. package/dist/client/assets/spellCheck-DiNvmZKv.js.gz +0 -0
  107. package/dist/client/assets/tags-yjr9KRc8.js +1 -0
  108. package/dist/client/assets/{terminal-DaAc1558.js → terminal-P09ZGT83.js} +1 -1
  109. package/dist/client/assets/{type-Cm3TiSO6.js → type-C7rzXWVU.js} +1 -1
  110. package/dist/client/assets/{user-plus-BLC3_SFQ.js → user-plus-CqyV7OV4.js} +1 -1
  111. package/dist/client/index.html +3 -3
  112. package/dist/server/agents/adapters/claude.js +170 -9
  113. package/dist/server/agents/adapters/opencode.js +15 -3
  114. package/dist/server/agents/sessions.js +18 -8
  115. package/dist/server/collaboration.js +2 -1
  116. package/dist/server/db.js +5 -0
  117. package/dist/server/projects.js +2 -1
  118. package/dist/server/routes/projectShared.js +7 -1
  119. package/dist/server/routes/projects.js +15 -9
  120. package/dist/server/routes/users.js +7 -1
  121. package/dist/shared/projectCatalog.js +1 -0
  122. package/dist/shared/sourceCommentAnchors.js +52 -4
  123. package/dist/shared/userManagement.js +1 -0
  124. package/package.json +1 -1
  125. package/dist/client/assets/AdminUsers-DXWi8wl0.js +0 -1
  126. package/dist/client/assets/AdminUsers-DXWi8wl0.js.br +0 -0
  127. package/dist/client/assets/AdminUsers-DXWi8wl0.js.gz +0 -0
  128. package/dist/client/assets/AgentIcon-BlHvdrRo.js.br +0 -0
  129. package/dist/client/assets/AgentIcon-BlHvdrRo.js.gz +0 -0
  130. package/dist/client/assets/AgentIcon-DE7FEpRY.css.br +0 -0
  131. package/dist/client/assets/AgentIcon-DE7FEpRY.css.gz +0 -0
  132. package/dist/client/assets/AgentManagement-CDWaxEmP.js +0 -1
  133. package/dist/client/assets/AgentManagement-CDWaxEmP.js.br +0 -0
  134. package/dist/client/assets/AgentManagement-CDWaxEmP.js.gz +0 -0
  135. package/dist/client/assets/AgentTerminal-BXH3gHWm.js +0 -2
  136. package/dist/client/assets/AgentTerminal-BXH3gHWm.js.br +0 -0
  137. package/dist/client/assets/AgentTerminal-BXH3gHWm.js.gz +0 -0
  138. package/dist/client/assets/AgentTerminalSurface-D0MLcJmw.js.br +0 -0
  139. package/dist/client/assets/AgentTerminalSurface-D0MLcJmw.js.gz +0 -0
  140. package/dist/client/assets/AvatarSettingsDialog-CtbzavqH.js +0 -1
  141. package/dist/client/assets/AvatarSettingsDialog-CtbzavqH.js.br +0 -0
  142. package/dist/client/assets/AvatarSettingsDialog-CtbzavqH.js.gz +0 -0
  143. package/dist/client/assets/CitationLibraryDialog-CnQVjovw.js +0 -1
  144. package/dist/client/assets/CitationLibraryDialog-CnQVjovw.js.br +0 -0
  145. package/dist/client/assets/CitationLibraryDialog-CnQVjovw.js.gz +0 -0
  146. package/dist/client/assets/Dashboard-Dzq1oMZU.js +0 -5
  147. package/dist/client/assets/Dashboard-Dzq1oMZU.js.br +0 -0
  148. package/dist/client/assets/Dashboard-Dzq1oMZU.js.gz +0 -0
  149. package/dist/client/assets/GitDialog-CzgguGGW.js +0 -3
  150. package/dist/client/assets/GitDialog-CzgguGGW.js.br +0 -0
  151. package/dist/client/assets/GitDialog-CzgguGGW.js.gz +0 -0
  152. package/dist/client/assets/GitHubAccountDialog-lRAWfkKP.js +0 -1
  153. package/dist/client/assets/GitHubAccountDialog-lRAWfkKP.js.br +0 -0
  154. package/dist/client/assets/GitHubAccountDialog-lRAWfkKP.js.gz +0 -0
  155. package/dist/client/assets/HistoryDialog-Bw3GHfbM.js +0 -8
  156. package/dist/client/assets/HistoryDialog-Bw3GHfbM.js.br +0 -0
  157. package/dist/client/assets/HistoryDialog-Bw3GHfbM.js.gz +0 -0
  158. package/dist/client/assets/LatexEditor-BDpqgoOa.js.br +0 -0
  159. package/dist/client/assets/LatexEditor-BDpqgoOa.js.gz +0 -0
  160. package/dist/client/assets/PdfPreview-C2puKgCh.js.br +0 -0
  161. package/dist/client/assets/PdfPreview-C2puKgCh.js.gz +0 -0
  162. package/dist/client/assets/ProjectIconPickerDialog-BzNdyAz6.js +0 -1
  163. package/dist/client/assets/ProjectIconPickerDialog-BzNdyAz6.js.br +0 -0
  164. package/dist/client/assets/ProjectIconPickerDialog-BzNdyAz6.js.gz +0 -0
  165. package/dist/client/assets/ProjectSettings-B_y5nRgp.js +0 -4
  166. package/dist/client/assets/ProjectSettings-B_y5nRgp.js.br +0 -0
  167. package/dist/client/assets/ProjectSettings-B_y5nRgp.js.gz +0 -0
  168. package/dist/client/assets/ProjectWorkspace-BnT5JPTA.js +0 -30
  169. package/dist/client/assets/ProjectWorkspace-BnT5JPTA.js.br +0 -0
  170. package/dist/client/assets/ProjectWorkspace-BnT5JPTA.js.gz +0 -0
  171. package/dist/client/assets/QuickOpenDialog-CEYxIk4l.js.br +0 -0
  172. package/dist/client/assets/QuickOpenDialog-CEYxIk4l.js.gz +0 -0
  173. package/dist/client/assets/SelectionHistoryDialog-DBL6vVD4.js.br +0 -0
  174. package/dist/client/assets/SelectionHistoryDialog-DBL6vVD4.js.gz +0 -0
  175. package/dist/client/assets/SuccessNotice-C8XV7MAJ.js +0 -1
  176. package/dist/client/assets/SystemMetricsDialog-D2EQX5hh.js +0 -1
  177. package/dist/client/assets/SystemMetricsDialog-D2EQX5hh.js.br +0 -0
  178. package/dist/client/assets/SystemMetricsDialog-D2EQX5hh.js.gz +0 -0
  179. package/dist/client/assets/TagColorSelect-CfJaFovr.js +0 -1
  180. package/dist/client/assets/TagManagementDialog-CiJ6AhVk.js +0 -1
  181. package/dist/client/assets/TagManagementDialog-CiJ6AhVk.js.br +0 -0
  182. package/dist/client/assets/TagManagementDialog-CiJ6AhVk.js.gz +0 -0
  183. package/dist/client/assets/WordCountDialog-DaHxqArj.js.br +0 -0
  184. package/dist/client/assets/WordCountDialog-DaHxqArj.js.gz +0 -0
  185. package/dist/client/assets/binary-B57nBiwS.js +0 -1
  186. package/dist/client/assets/check-B-GEn6vk.js +0 -1
  187. package/dist/client/assets/chevron-up-B0yLKMZJ.js +0 -1
  188. package/dist/client/assets/dist-CIxSPQK5.js.br +0 -0
  189. package/dist/client/assets/dist-CIxSPQK5.js.gz +0 -0
  190. package/dist/client/assets/i18n-BzlyqR_B.js +0 -13
  191. package/dist/client/assets/i18n-BzlyqR_B.js.br +0 -0
  192. package/dist/client/assets/i18n-BzlyqR_B.js.gz +0 -0
  193. package/dist/client/assets/index-BHHBwQuG.css +0 -1
  194. package/dist/client/assets/index-BHHBwQuG.css.br +0 -0
  195. package/dist/client/assets/index-BHHBwQuG.css.gz +0 -0
  196. package/dist/client/assets/index-h0BVkT8k.js +0 -42
  197. package/dist/client/assets/index-h0BVkT8k.js.br +0 -0
  198. package/dist/client/assets/index-h0BVkT8k.js.gz +0 -0
  199. package/dist/client/assets/plus-PHvPlka_.js +0 -1
  200. package/dist/client/assets/relativeTime-Cf5dzFc9.js +0 -1
  201. package/dist/client/assets/relativeTime-Cf5dzFc9.js.br +0 -0
  202. package/dist/client/assets/relativeTime-Cf5dzFc9.js.gz +0 -0
  203. package/dist/client/assets/spellCheck-DEQIFH7w.js.br +0 -0
  204. package/dist/client/assets/spellCheck-DEQIFH7w.js.gz +0 -0
  205. package/dist/client/assets/tags-BQ0exG-g.js +0 -1
  206. package/dist/client/assets/terminalPreferences-CgacIg2F.js +0 -1
  207. package/dist/client/assets/terminalPreferences-CgacIg2F.js.br +0 -0
  208. package/dist/client/assets/terminalPreferences-CgacIg2F.js.gz +0 -0
package/DESIGN.md CHANGED
@@ -64,6 +64,25 @@ conversion. Use consistent terminology such as 專案, 檔案, 原始碼, 儲存
64
64
  and 批註 (collaborative comments). Tests check catalog keys, interpolation
65
65
  variables, rich-text tags, language detection, persistence, and API headers.
66
66
 
67
+ ### Project catalog
68
+
69
+ The homepage places All projects, Owned by me and Shared with me tabs below the
70
+ page title. Ownership is filtered on the server before pagination (20 projects
71
+ per page), preserving the existing list/grid views, search, private tags,
72
+ sorting and per-user archive filter. Each response includes counts for all three
73
+ categories under the current search and tag conditions, including both active
74
+ and archived projects, independently of the selected category, archive filter
75
+ and page; zero counts are not displayed. Pagination totals still follow the
76
+ archive filter. Archiving/unarchiving preserves tab counts; deletion reduces
77
+ them. Administrators only see and count projects they own or that were explicitly
78
+ shared with them.
79
+
80
+ Changing category resets pagination. The browser caches rows together with the
81
+ category, filters, counts and page, so returning from a workspace restores the
82
+ same view before revalidation. Obsolete requests are aborted and ignored, and
83
+ rows from a previous category are not shown while its replacement is loading.
84
+ Successful catalog mutations revalidate the currently selected view.
85
+
67
86
  ### Citation library
68
87
 
69
88
  The citation library is stored in SQLite and is independent of project source
@@ -77,6 +96,14 @@ citation library as a separate management page beside the other management
77
96
  controls; the project workspace keeps a smaller `.bib` import dialog for
78
97
  in-context writing. Library results are server-filtered and paginated with 60
79
98
  entries per page by default (the API accepts a bounded page-size override).
99
+ Entry management actions live in an accessible, portalled overflow menu, with
100
+ deletion separated from ordinary actions and still requiring confirmation.
101
+ Copy BibTeX remains a direct button, preserves the full entry text and shows a
102
+ two-second result on the button. It falls back to selection-based copying for
103
+ HTTP/LAN browsers without usable
104
+ Clipboard API access. Save/import remain direct actions in project dialogs.
105
+ Library rows use compact spacing and a single-line title with the full title
106
+ available on hover.
80
107
  Library entries are checked in the browser with the `bibtex-tidy` JavaScript
81
108
  parser and formatter before a mutation request is sent. Citation keys are unique
82
109
  per user without regard to letter case. Creating an existing key is rejected;
@@ -312,9 +339,29 @@ to source comments. Comments are anchored to source offsets and selected text,
312
339
  can be resolved, edited, deleted, and replied to. If an author is removed,
313
340
  the record remains visible as “Deleted User”.
314
341
 
342
+ The workspace Share button shows a superscript count of explicitly shared
343
+ read/edit members, excluding the owner and hiding zero. This is unrelated to
344
+ online presence. Initial counts come with project metadata; successful share
345
+ form loads and member changes update the badge without reloading the workspace.
346
+
347
+ The owner-only share form uses one editable user combobox: opening it lists
348
+ available users, and typing filters by display name or username. Candidates
349
+ exclude the owner and existing members. The popup is at most 240 px tall,
350
+ bounded by the dialog's available space, with internal scrolling and keyboard
351
+ navigation. Filtering uses the loaded active-user directory without per-keypress
352
+ requests. Typing clears an old selection but retains the permission draft;
353
+ only Add member grants access. Loads are aborted when the dialog closes or
354
+ changes project, and member mutations are guarded against duplicate submissions.
355
+
315
356
  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.
357
+ source baseline. Agent disk imports retain an inferred-diff flag even when
358
+ their changes are transported as Yjs operations. HTTP replacements, recovered
359
+ state without a delta chain, and chains that do not reconstruct the final
360
+ source also use a before/after diff. Unlike actual edits, inferred partial
361
+ matches require contiguous meaningful text, sufficient retention relative to
362
+ both ranges, and matching context (or a substantially intact quote). Exact
363
+ quotes and whitespace-only formatting remain recognizable; scattered shared
364
+ letters must not stretch a discussion across unrelated replacement prose.
318
365
  Partial edits retain the discussion; fully erased selections preserve their
319
366
  last attached quote and surrounding context for recovery. Recovery requires
320
367
  the original quote to be formed by the current insertion, replacement or an
@@ -511,9 +558,19 @@ because they do not carry editor operations. These existing
511
558
  database fields remain durable across restarts, without a schema change.
512
559
  The server and editor share the range/context rules. Live editor anchors retain
513
560
  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.
561
+ navigation, even before a save. Comment responses include a response-only
562
+ SHA-256 source revision, computed once per file. An authoritative server anchor
563
+ can correct a misleading live mapping only at that exact revision, including
564
+ when its HTTP response arrives before the Yjs source update. Stale saved
565
+ anchors cannot replace a live mapping, reactivate a deleted selection at a
566
+ duplicate occurrence, or overwrite undo recovery. Results for a different
567
+ revision remain pending; a view-owned 200 ms trailing check retries after
568
+ document updates, coalesces typing, and is cancelled on editor destruction.
569
+ Failed checks do not poll or reschedule themselves. Browser recovery searches
570
+ are bounded around the hint and newly inserted fragments; document-change
571
+ mapping never flattens/hashes the file for revision reconciliation. Incoming
572
+ comment responses may hash the current source once to apply matching results
573
+ immediately.
517
574
 
518
575
  The collaboration service uses a versioned handshake and a versioned epoch
519
576
  marker. When a browser from an incompatible release connects, it is forced to
@@ -717,6 +774,15 @@ deployment base path. The adapter validates current v4 per-combination records
717
774
  and does not convert v2 layout arrays. Missing, unsupported or corrupt records
718
775
  use default sizes; older browser records are left untouched. Blocked browser
719
776
  storage also falls back to usable defaults. File-panel collapse state follows `onResize`.
777
+ Source comments sit at the left edge of the preview region, immediately beside
778
+ the editor. They do not add an outer resizable panel or change the editor/file
779
+ widths. A 760 px preview-container breakpoint switches between a 300–360 px
780
+ inline review column and a drawer over the PDF; closing it restores the preview.
781
+ The PDF stays mounted, and a stable portal host preserves review filters and
782
+ reply forms across responsive changes. Editor-only mode falls back to an
783
+ adjacent resizable context pane; settings keep their existing right-hand pane.
784
+ Source annotations use small outlined comment icons with the same toggle,
785
+ keyboard activation and tooltip behavior as the former pins.
720
786
  SyncTeX arrows are portalled outside the group and anchored to the separator,
721
787
  so v4's document-level drag capture does not consume their pointer/keyboard
722
788
  actions. Observers and window listeners are removed when the separator unmounts.
@@ -1289,10 +1355,31 @@ trusted writers, not additional tasks imported into TexLite.
1289
1355
  All adapters inherit the service account's `XDG_CACHE_HOME`; when it is unset,
1290
1356
  the CLI chooses its own default. Shared caches can reuse model catalogs and
1291
1357
  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.
1358
+ Codex keeps a task-specific `CODEX_HOME`. Claude directly shares the service
1359
+ account's native configuration and login instead of copying selected files.
1360
+ For the default home, `CLAUDE_CONFIG_DIR` stays unset to preserve native
1361
+ `~/.claude.json` onboarding discovery. An explicit configuration directory is
1362
+ passed through. Each task durably binds that location and its UUID in
1363
+ `state/claude-session.json` before its CLI can launch. Native discovery and
1364
+ continuation target only that UUID; existing host conversations are not adopted.
1365
+ Claude-specific model/context, provider-authentication, timeout and client-certificate
1366
+ variables supplement the shared gateway/proxy environment on each start/resume.
1367
+ The source is only the current service process, not a port-specific lookup or a
1368
+ shell-profile loader. Runtime session markers and transcript controls stay excluded;
1369
+ the durable ownership binding stores no inherited credentials.
1370
+ Deletion removes only that session's transcript, subagent directory, transcript
1371
+ sidecars and UUID-scoped checkpoint/task/debug data. Shared prompt history,
1372
+ settings, credentials, plugins, project memory and caches are left untouched.
1373
+ A missing or invalid ownership binding blocks native cleanup rather than
1374
+ dropping the task and leaving an unmanaged conversation. After successful native
1375
+ cleanup, `agent_tasks.native_cleanup_done` is committed before local file removal;
1376
+ retries (including after restart) then need neither the binding nor CLI discovery.
1377
+ The successful deletion audit and final task-row deletion commit together.
1378
+ OpenCode management falls back to the task-state directory when a project's
1379
+ source directory is gone, retaining the registered database and exact session ID.
1380
+ Old private Claude conversations are not migrated and should be removed before
1381
+ upgrading. Task deletion also removes its private TexLite UUID directory,
1382
+ never the inherited host cache or the host configuration directory.
1296
1383
  These locations organize tasks; they do not sandbox agents running as the same
1297
1384
  service account.
1298
1385
 
@@ -1394,12 +1481,18 @@ terminal data over authenticated, origin-checked WebSockets with base-path and
1394
1481
  HTTPS support. One attachment owns input/resize; takeover is explicit. Server
1395
1482
  display replay is bounded, slow sockets disconnect without stopping the task,
1396
1483
  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
1484
+ exist in task-local or shared host state. Raw terminal replay is a bounded recent stream, not a
1398
1485
  complete saved terminal screen; very long full-screen sessions may need a redraw.
1399
1486
 
1400
1487
  Terminal appearance is separate from editor appearance. Its font, size and theme
1401
1488
  are browser-local preferences shared across projects and scoped to the
1402
1489
  deployment base path, without user/database or CLI configuration changes. The
1490
+ Terminal tab also saves a default-on execution-reminder toggle in this browser
1491
+ store. It controls the terminal/task-list reminder text and active-task count
1492
+ badges on Terminal and Agent tasks entries, including their accessible labels.
1493
+ It does not stop or reconnect tasks, alter actual counts/access, or hide
1494
+ project-busy warnings and other operational guidance.
1495
+ Older preferences without the toggle keep the reminder enabled. The
1403
1496
  default is JetBrains Mono at 13 px with fixed 1.2 line spacing; existing web fonts and
1404
1497
  a system-monospace fallback are available. The original Catppuccin-inspired
1405
1498
  TexLite dark palette remains the default; Catppuccin Latte (light) and Gruvbox
@@ -1423,10 +1516,30 @@ before measuring the selected font, with stale
1423
1516
  loads and unmounted terminals ignored; failed web fonts use the fallback stack.
1424
1517
  Previously stored terminal line-spacing choices are ignored and omitted on the
1425
1518
  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.
1519
+ Manual saves for editor/terminal/compiler settings show a blue check and “Saved” on
1520
+ the header and footer save buttons for two seconds, without a success banner.
1521
+ Feedback is scoped to the saved tab, including delayed compiler responses;
1522
+ idle buttons retain their existing labels. Unchanged compiler settings are
1523
+ reported on the buttons instead. Failures remain visible as errors rather than
1524
+ claiming success. User, citation, tag and Coding Agent management actions follow
1525
+ the same button-only success-feedback convention. Deletions and permission
1526
+ changes are reflected by their resulting list/control state without success
1527
+ banners; failures keep their contextual errors. Citation/tag edit forms remain
1528
+ open after saving, retaining the updated revision for subsequent writes.
1529
+ Snapshot naming and GitHub token saves use the same button-only confirmation.
1530
+ All explicit save buttons share `SaveButton`: a neutral surface and text,
1531
+ a save icon at rest, a disabled spinner while saving, and a blue check for
1532
+ confirmed feedback. The owning workflow still controls persistence, errors and
1533
+ the two-second feedback timer. Dialogs that close after saving retain that
1534
+ behavior; create, send and destructive actions keep their distinct semantics.
1535
+
1536
+ Management pages use the Coding Agent page's compact control scale: 12 px
1537
+ controls and table text, 32 px main actions, and matching themed primary buttons.
1538
+ User, citation and Coding Agent management share the localized “Back to projects”
1539
+ navigation label and fixed 32 px button height, including when the Agent page's
1540
+ stylesheet loads later. Citation list actions use the same compact height,
1541
+ line height and icon scale, including Copy BibTeX and the overflow trigger.
1542
+ Project-list controls and editor content are not rescaled.
1430
1543
 
1431
1544
  `node-pty` loads dynamically and is an optional production dependency. xterm.js
1432
1545
  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 ee,F as r,P as i,R as te,nt as a,st as ne,tt as re,x as ie}from"./relativeTime-CFNodf1I.js";import{t as ae}from"./circle-check-DjXwnxuR.js";import{t as oe}from"./search-l36unLLS.js";import{t as o}from"./user-plus-CqyV7OV4.js";import{C as s,E as c,b as l,c as u,j as se,s as ce,y as d}from"./index-DFEpXxLs.js";import{t as le}from"./SuccessNotice-ubBtzzi_.js";var f={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`}]]};f.node;var ue=l(f),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 de=l(p),m={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`}]]};m.node;var fe=l(m),h=e(t(),1),g=n();function _(e=10){let t=crypto.getRandomValues(new Uint8Array(e));return Array.from(t,e=>`ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz23456789!@#$%`[e%62]).join(``)}function v({currentUser:e,minPasswordLength:t,onBack:n}){let{t:l}=se(),[f,p]=(0,h.useState)([]),[m,v]=(0,h.useState)(null),[y,b]=(0,h.useState)(``),[x,S]=(0,h.useState)(1),[C,pe]=(0,h.useState)({page:1,pageSize:20,total:0,totalPages:0}),[w,T]=(0,h.useState)(!0),[E,D]=(0,h.useState)(!1),[me,he]=(0,h.useState)(0),[O,ge]=(0,h.useState)(``),k=le(),[A,j]=(0,h.useState)(!1),[M,N]=(0,h.useState)(``),[_e,P]=(0,h.useState)(!1),[F,I]=(0,h.useState)({username:``,displayName:``,password:``,role:`user`,canCreateProjects:!1}),[L,R]=(0,h.useState)(null),[z,B]=(0,h.useState)(``),[ve,V]=(0,h.useState)(null),[H,U]=(0,h.useState)(null),[W,G]=(0,h.useState)(!1),[K,ye]=(0,h.useState)(!1),[be,q]=(0,h.useState)(``),[J,Y]=(0,h.useState)(null),[X,xe]=(0,h.useState)(!1),[Se,Z]=(0,h.useState)(``),Q=y.trim(),$=()=>he(e=>e+1);(0,h.useEffect)(()=>{let e=new AbortController;V(null),T(!0),D(!1),ge(``);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),v(t.summary),pe(t.pagination),S(t.pagination.page))}).catch(t=>{e.signal.aborted||(ge(s(t)),D(!0))}).finally(()=>{e.signal.aborted||T(!1)})},Q?200:0);return()=>{window.clearTimeout(t),e.abort()}},[Q,x,me]);let Ce=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)}}},we=async e=>{Y({target:e,setting:e.role===`admin`?`demote`:`promote`}),Z(``)},Te=async e=>{Y({target:e,setting:e.canCreateProjects?`denyProjectCreation`:`allowProjectCreation`}),Z(``)},Ee=async()=>{if(!J||X)return;let{target:e,setting:t}=J,n=t===`demote`?{role:`user`}:t===`promote`?{role:`admin`}:{canCreateProjects:t===`allowProjectCreation`};xe(!0),Z(``);try{await c(`/api/admin/users/${e.id}`,{method:`PATCH`,body:JSON.stringify(n)}),$(),Y(null)}catch(e){Z(s(e))}finally{xe(!1)}},De=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)}}},Oe=async()=>{if(H&&!K){ye(!0),q(``);try{await c(`/api/admin/users/${H.id}`,{method:`DELETE`,body:JSON.stringify({deleteProjects:W})}),U(null),G(!1),$()}catch(e){q(s(e))}finally{ye(!1)}}},ke=[{key:`totalUsers`,detail:m?l(`users.summary.administrators`,{count:m.administrators}):``},{key:`projectCreators`,detail:m?l(`users.summary.ofUsers`,{count:m.totalUsers}):``},{key:`totalProjects`,detail:m?l(`users.summary.projectOwners`,{count:m.projectOwners}):``}];return(0,g.jsxs)(`section`,{className:`admin-users-page management-page`,children:[(0,g.jsxs)(`div`,{className:`section-title`,children:[(0,g.jsxs)(`div`,{children:[(0,g.jsxs)(`h1`,{children:[(0,g.jsx)(r,{"aria-hidden":!0,size:25}),l(`users.manage`)]}),(0,g.jsx)(`p`,{className:`muted`,children:l(`users.onlyAdmin`)})]}),(0,g.jsxs)(`button`,{type:`button`,className:`dashboard-back-button`,onClick:n,children:[(0,g.jsx)(ne,{size:14}),l(`navigation.backToProjects`)]})]}),(0,g.jsx)(`dl`,{className:`admin-user-summary`,"aria-label":l(`users.overview`),children:ke.map(({key:e,detail:t})=>(0,g.jsxs)(`div`,{children:[(0,g.jsx)(`dt`,{children:l(`users.summary.${e}`)}),(0,g.jsxs)(`dd`,{className:m?.[e]===0?`admin-user-zero`:void 0,children:[(0,g.jsx)(`strong`,{children:m?.[e]??`—`}),t&&(0,g.jsx)(`span`,{children:t})]})]},e))}),(0,g.jsxs)(`div`,{className:`admin-user-toolbar`,children:[(0,g.jsxs)(`div`,{className:`admin-user-filters`,children:[(0,g.jsxs)(`div`,{className:`admin-user-search`,role:`search`,children:[(0,g.jsx)(oe,{"aria-hidden":!0,size:16}),(0,g.jsx)(`input`,{role:`searchbox`,"aria-label":l(`users.searchPlaceholder`),placeholder:l(`users.searchPlaceholder`),value:y,onChange:e=>{b(e.target.value),S(1)}}),y&&(0,g.jsx)(`button`,{type:`button`,"aria-label":l(`users.clearSearch`),title:l(`users.clearSearch`),onClick:()=>{b(``),S(1)},children:(0,g.jsx)(i,{"aria-hidden":!0,size:14})})]}),Q&&!w&&!E&&(0,g.jsx)(`span`,{className:`admin-user-count`,role:`status`,children:l(`users.total`,{count:C.total})})]}),(0,g.jsxs)(`button`,{className:`primary icon-button admin-user-add`,onClick:()=>{k.clear(),N(``),P(!0)},children:[(0,g.jsx)(o,{"aria-hidden":!0,size:15}),(0,g.jsx)(`span`,{role:`status`,children:l(k.message===`create`?`common.done`:`users.add`)})]})]}),O&&(0,g.jsx)(`p`,{className:`error`,role:`alert`,children:O}),(0,g.jsx)(`div`,{className:`table-card admin-user-table`,"aria-busy":w,children:(0,g.jsxs)(`table`,{children:[(0,g.jsx)(`thead`,{children:(0,g.jsxs)(`tr`,{children:[(0,g.jsx)(`th`,{children:l(`common.user`)}),(0,g.jsx)(`th`,{children:l(`users.role`)}),(0,g.jsx)(`th`,{children:l(`users.createProjects`)}),(0,g.jsx)(`th`,{children:l(`users.ownedProjects`)}),(0,g.jsx)(`th`,{children:l(`users.actions`)})]})}),(0,g.jsx)(`tbody`,{children:w?(0,g.jsx)(`tr`,{children:(0,g.jsx)(`td`,{colSpan:5,className:`admin-user-list-state`,children:(0,g.jsxs)(`span`,{role:`status`,children:[(0,g.jsx)(d,{className:`spin`,size:16}),l(`common.loading`)]})})}):E?(0,g.jsx)(`tr`,{children:(0,g.jsxs)(`td`,{colSpan:5,className:`admin-user-list-state`,children:[(0,g.jsx)(`span`,{children:l(`users.loadFailed`)}),(0,g.jsx)(`button`,{type:`button`,onClick:$,children:l(`common.retry`)})]})}):f.length===0?(0,g.jsx)(`tr`,{children:(0,g.jsx)(`td`,{colSpan:5,className:`admin-user-list-state`,children:l(Q?`users.noMatches`:`users.empty`)})}):f.map(t=>{let n=t.id===e.id,r=A||X,i=ve===t.id,a=k.message===`reset:${t.id}`;return(0,g.jsxs)(`tr`,{children:[(0,g.jsx)(`td`,{children:(0,g.jsxs)(`div`,{className:`admin-user-identity`,children:[(0,g.jsx)(ie,{userId:t.id,name:t.displayName,username:t.username,avatarStyle:t.avatarStyle,className:`admin-user-avatar`}),(0,g.jsxs)(`div`,{children:[(0,g.jsx)(`strong`,{children:t.displayName}),(0,g.jsxs)(`small`,{children:[`@`,t.username]})]})]})}),(0,g.jsx)(`td`,{children:n?(0,g.jsxs)(`span`,{className:`admin-user-badge`,title:l(`users.selfProtected`),children:[(0,g.jsx)(fe,{size:12,"aria-hidden":!0}),l(`common.admin`)]}):(0,g.jsxs)(`select`,{className:`admin-user-role`,"aria-label":l(`users.roleFor`,{username:t.username}),value:t.role,disabled:r,onChange:()=>void we(t),children:[(0,g.jsx)(`option`,{value:`user`,children:l(`common.user`)}),(0,g.jsx)(`option`,{value:`admin`,children:l(`common.admin`)})]})}),(0,g.jsx)(`td`,{children:t.role===`admin`?(0,g.jsxs)(`span`,{className:`admin-user-locked`,title:l(`users.adminCreation`),children:[(0,g.jsx)(fe,{size:12,"aria-hidden":!0}),l(`users.alwaysAllowed`)]}):(0,g.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 Te(t),children:(0,g.jsx)(`span`,{})})}),(0,g.jsx)(`td`,{className:t.ownedProjects?void 0:`admin-user-zero`,children:t.ownedProjects??0}),(0,g.jsx)(`td`,{children:(0,g.jsxs)(`div`,{className:`admin-user-actions`,children:[(0,g.jsxs)(`div`,{className:`admin-user-action-items`,id:`user-actions-${t.id}`,hidden:!i,children:[(0,g.jsxs)(`button`,{type:`button`,className:`icon-button`,disabled:r,title:l(a?`common.done`:`users.resetPassword`),"aria-label":l(`users.resetPassword`),onClick:()=>{k.clear(),R(t),B(``),N(``)},children:[a?(0,g.jsx)(ae,{className:`admin-user-action-confirmation`,"aria-hidden":!0,size:15}):(0,g.jsx)(de,{"aria-hidden":!0,size:15}),(0,g.jsx)(`span`,{className:`sr-only`,role:`status`,children:a?l(`common.done`):``})]}),!n&&(0,g.jsx)(`button`,{type:`button`,className:`icon-button danger-text`,disabled:r,title:l(`users.deleteTitle`),"aria-label":l(`users.deleteTitle`),onClick:()=>{U(t),G(!1),q(``)},children:(0,g.jsx)(te,{size:15,"aria-hidden":!0})})]}),(0,g.jsx)(`button`,{type:`button`,className:`icon-button admin-user-action-toggle`,disabled:r,"aria-label":l(`users.actionsFor`,{username:t.username}),"aria-expanded":i,"aria-controls":`user-actions-${t.id}`,onClick:()=>V(i?null:t.id),children:(0,g.jsx)(ee,{size:17,"aria-hidden":!0})})]})})]},t.id)})})]})}),C.totalPages>1&&(0,g.jsxs)(`nav`,{className:`project-pagination admin-user-pagination`,"aria-label":l(`users.pagination`),children:[(0,g.jsxs)(`button`,{type:`button`,disabled:w||E||C.page<=1,onClick:()=>S(C.page-1),children:[(0,g.jsx)(a,{size:15}),l(`users.previousPage`)]}),(0,g.jsx)(`span`,{children:l(`users.pageOf`,{page:C.page,totalPages:C.totalPages})}),(0,g.jsxs)(`button`,{type:`button`,disabled:w||E||C.page>=C.totalPages,onClick:()=>S(C.page+1),children:[l(`users.nextPage`),(0,g.jsx)(re,{size:15})]})]}),(0,g.jsxs)(u,{className:`management-dialog`,open:_e,title:l(`users.add`),description:l(`users.addDescription`),onOpenChange:e=>{A||P(e)},footer:(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(`button`,{className:`icon-button`,disabled:A,onClick:()=>P(!1),children:[(0,g.jsx)(i,{"aria-hidden":!0,size:14}),l(`common.cancel`)]}),(0,g.jsxs)(`button`,{className:`primary icon-button`,disabled:A||!F.username.trim()||F.password.length<t,onClick:()=>void Ce(),children:[(0,g.jsx)(o,{"aria-hidden":!0,size:14}),l(`users.createUser`)]})]}),children:[M&&(0,g.jsx)(`p`,{className:`error`,role:`alert`,children:M}),(0,g.jsxs)(`fieldset`,{className:`admin-user-form form-stack`,disabled:A,children:[(0,g.jsxs)(`label`,{className:`form-field`,children:[l(`auth.username`),(0,g.jsx)(`input`,{value:F.username,onChange:e=>I({...F,username:e.target.value})})]}),(0,g.jsxs)(`label`,{className:`form-field`,children:[l(`users.displayName`),(0,g.jsx)(`input`,{value:F.displayName,onChange:e=>I({...F,displayName:e.target.value})})]}),(0,g.jsxs)(`label`,{className:`form-field`,children:[l(`users.initialPassword`),(0,g.jsxs)(`span`,{className:`password-generator`,children:[(0,g.jsx)(`input`,{minLength:t,autoComplete:`new-password`,value:F.password,onChange:e=>I({...F,password:e.target.value})}),(0,g.jsxs)(`button`,{type:`button`,title:l(`users.generatePassword`),onClick:()=>I({...F,password:_()}),children:[(0,g.jsx)(ue,{size:15}),l(`users.randomPassword`)]})]}),(0,g.jsx)(`small`,{className:`field-hint`,children:l(`auth.passwordMinimum`,{count:t})})]}),(0,g.jsxs)(`label`,{className:`form-field`,children:[l(`users.role`),(0,g.jsxs)(`select`,{value:F.role,onChange:e=>I({...F,role:e.target.value}),children:[(0,g.jsx)(`option`,{value:`user`,children:l(`common.user`)}),(0,g.jsx)(`option`,{value:`admin`,children:l(`common.admin`)})]})]}),(0,g.jsxs)(`label`,{className:`checkbox-field`,children:[(0,g.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,g.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,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(`button`,{className:`icon-button`,disabled:A,onClick:()=>R(null),children:[(0,g.jsx)(i,{"aria-hidden":!0,size:14}),l(`common.cancel`)]}),(0,g.jsxs)(`button`,{className:`primary icon-button`,disabled:A||z.length<t,onClick:()=>void De(),children:[(0,g.jsx)(de,{"aria-hidden":!0,size:14}),l(`users.reset`)]})]}),children:[M&&(0,g.jsx)(`p`,{className:`error`,role:`alert`,children:M}),(0,g.jsxs)(`label`,{className:`form-field`,children:[l(`auth.newPassword`),(0,g.jsxs)(`span`,{className:`password-generator`,children:[(0,g.jsx)(`input`,{disabled:A,autoFocus:!0,minLength:t,autoComplete:`new-password`,value:z,onChange:e=>B(e.target.value)}),(0,g.jsxs)(`button`,{type:`button`,disabled:A,onClick:()=>B(_()),children:[(0,g.jsx)(ue,{size:15}),l(`users.randomPassword`)]})]}),(0,g.jsx)(`small`,{className:`field-hint`,children:l(`auth.passwordMinimum`,{count:t})})]})]}),(0,g.jsx)(u,{className:`management-dialog`,open:!!H,title:l(`users.deleteTitle`),description:l(`users.deleteDescription`,{username:H?.username??``}),onOpenChange:e=>{!e&&!K&&(U(null),q(``))},footer:(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(`button`,{className:`icon-button`,disabled:K,onClick:()=>{U(null),q(``)},children:[(0,g.jsx)(i,{"aria-hidden":!0,size:14}),l(`common.cancel`)]}),(0,g.jsxs)(`button`,{className:`danger icon-button`,disabled:K,"aria-busy":K,onClick:()=>void Oe(),children:[K?(0,g.jsx)(d,{className:`spin`,"aria-hidden":!0,size:14}):(0,g.jsx)(te,{"aria-hidden":!0,size:14}),l(K?`common.loading`:`users.deleteTitle`)]})]}),children:(0,g.jsxs)(g.Fragment,{children:[be&&(0,g.jsx)(`p`,{className:`error dialog-error`,children:be}),(0,g.jsxs)(`fieldset`,{className:`choice-group`,disabled:K,children:[(0,g.jsx)(`legend`,{children:l(`users.ownedChoice`,{count:H?.ownedProjects??0})}),(0,g.jsxs)(`label`,{children:[(0,g.jsx)(`input`,{type:`radio`,checked:!W,onChange:()=>G(!1)}),` `,l(`users.transferProjects`)]}),(0,g.jsxs)(`label`,{children:[(0,g.jsx)(`input`,{type:`radio`,checked:W,onChange:()=>G(!0)}),` `,l(`users.deleteProjects`)]})]})]})}),(0,g.jsx)(ce,{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:Se,onCancel:()=>{X||(Y(null),Z(``))},onConfirm:()=>void Ee()})]})}export{v 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-DFEpXxLs.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-BiIGj4-X.js";import{L as i,R as a,a as ee,b as o,f as te,nt as s,st as ne,tt as re,z as c}from"./relativeTime-CFNodf1I.js";import{t as ie}from"./info-g1IBvVg6.js";import{t as l}from"./refresh-cw-Di6Huxb4.js";import{t as u}from"./SaveButton-C8W1DGzx.js";import{i as d,n as f,t as p}from"./AgentIcon-C97W4Mt-.js";import{C as m,E as h,c as ae,j as oe,y as g}from"./index-DFEpXxLs.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}=te(),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,ee(),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)(c,{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)(ne,{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)(l,{size:14}),(0,v.jsx)(`span`,{role:`status`,children:n(H.message===`detect`?`common.done`:`agents.detection`)})]}),(0,v.jsx)(u,{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)(i,{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)(l,{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)(a,{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:o(e.createdAt,y.resolvedLanguage)}),children:o(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)(a,{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)(c,{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)(s,{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)(re,{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-C11baRxh.js","./rolldown-runtime-XKyaHtl9.js","./react-DUEFWlB7.js","./basePath-B5-c90eh.js","./relativeTime-CFNodf1I.js","./index-DFEpXxLs.js","./i18nInstance-CIMFwH0l.js","./i18n-O9QnEo2t.js","./vite-runtime-CRzLMJPS.js","./index-7d5TfVNx.css","./AgentIcon-C97W4Mt-.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{L as i,P as a,R as o,V as s,a as c,f as l,nt as u,p as d,rt as f,tt as p,z as m}from"./relativeTime-CFNodf1I.js";import{t as h}from"./check-DfWHdQ1s.js";import{t as g}from"./chevron-up-lyMKml7P.js";import{t as _}from"./info-g1IBvVg6.js";import{t as v}from"./plus-CoYCCEFJ.js";import{t as y}from"./SaveButton-C8W1DGzx.js";import{i as b,n as ee,t as x}from"./AgentIcon-C97W4Mt-.js";import{C as S,E as C,c as w,j as T,y as E}from"./index-DFEpXxLs.js";import{a as D,i as O,l as k,n as A,o as j,s as M,t as N}from"./dist-ByqeNQqT.js";import{R as P}from"./ProjectWorkspace-DHVcaXR0.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,l]=(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 C(`/api/agents`,{signal:e.signal}).then(n).catch(t=>{e.signal.aborted||d(S(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)});C(`/api/agent-tasks?${s}`,{signal:r.signal}).then(e=>{n||r.signal.aborted||o!==h.current||(i(e),l(t=>e.tasks.some(e=>e.id===t)?t:e.tasks[0]?.id??``))}).catch(e=>{!n&&!r.signal.aborted&&o===h.current&&d(S(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||c()},[]);return{catalog:t,result:r,page:a,setPage:o,selectedId:s,setSelectedId:l,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(S(e))}finally{m.current=!1,c(),g.current&&(p(!1),y())}}},acceptTask:b}}var L=n();function R({agents:e,value:t,onChange:n,disabled:r=!1}){let{t:i}=T(),[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)(N,{modal:!1,open:a,onOpenChange:o,children:[(0,L.jsx)(k,{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)(x,{agent:c.id,size:16}),(0,L.jsx)(`span`,{children:c?.label??i(`agents.agent`)}),(0,L.jsx)(f,{size:13,"aria-hidden":`true`})]})}),(0,L.jsx)(D,{container:s.current?.closest(`[role="dialog"]`),children:(0,L.jsx)(A,{className:`agent-select-options`,side:`top`,align:`start`,sideOffset:5,collisionPadding:8,children:(0,L.jsx)(j,{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)(M,{value:e.id,textValue:e.label,className:`agent-select-option`,disabled:l||!e.installed||!e.enabled,children:[(0,L.jsx)(x,{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)(O,{className:`agent-select-check`,children:(0,L.jsx)(h,{size:14,"aria-hidden":`true`})})]},e.id))})})})]})}var z=(0,F.lazy)(()=>r(()=>import(`./AgentTerminalSurface-C11baRxh.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:c}){let{t:h}=T(),S=I(e),D=l(),O=S.selected,[k,A]=(0,F.useState)(!1),[j,M]=(0,F.useState)(``),[N,B]=(0,F.useState)(``),[V,H]=(0,F.useState)(!1),[U,W]=(0,F.useState)(``),[G,K]=(0,F.useState)(!1),q=O&&[`starting`,`running`,`stopping`].includes(O.state),te=O&&(O.canResume||O.startedAt!==null||[`stopped`,`exited`,`interrupted`].includes(O.state)),J=S.catalog?.agents.find(e=>e.id===O?.agentId),Y=S.catalog?.agents.filter(e=>e.installed&&e.enabled)??[],X=N?S.catalog?.agents.find(e=>e.id===N):Y[0],Z=!!(S.result.activeTaskId&&S.result.activeTaskId!==O?.id),Q=t||S.busy||!!S.result.activeTaskId||!S.catalog?.ptyAvailable||!X?.installed||!X.enabled,ne=!Z&&!t&&J?.installed&&J.enabled&&S.catalog?.ptyAvailable&&O?.cleanupState===`none`,re=e=>{S.setSelectedId(e),H(!1)},$=e=>S.mutate(async()=>{if(!O)return;let t=await C(`/api/agent-tasks/${O.id}${e}`,{method:`POST`});S.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)(m,{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)(_,{size:13,"aria-hidden":`true`})}),(0,L.jsx)(`div`,{className:`agent-task-tabs`,role:`tablist`,"aria-label":h(`agents.tasks`),children:S.result.tasks.map(e=>(0,L.jsxs)(`button`,{role:`tab`,type:`button`,"aria-selected":e.id===O?.id,title:e.title,className:e.id===O?.id?`active`:``,onClick:()=>re(e.id),children:[(0,L.jsx)(`span`,{className:`agent-state-dot ${e.state}`}),(0,L.jsx)(x,{agent:e.agentId,size:13}),(0,L.jsx)(`span`,{children:e.title}),(0,L.jsx)(`small`,{children:ee[e.agentId]})]},e.id))}),(0,L.jsx)(`button`,{className:`agent-icon-button`,disabled:t||S.busy||!Y.length,title:h(`agents.newTask`),"aria-label":h(`agents.newTask`),onClick:()=>A(e=>!e),children:(0,L.jsx)(v,{size:15})}),c&&(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:c,children:r?(0,L.jsx)(f,{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)(a,{size:15})})]}),(O||S.result.total>S.result.pageSize)&&(0,L.jsxs)(`div`,{className:`agent-task-toolbar`,children:[S.result.total>S.result.pageSize&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`button`,{disabled:S.result.page<=1,"aria-label":h(`agents.previous`),onClick:()=>S.setPage(S.result.page-1),children:(0,L.jsx)(u,{size:13})}),(0,L.jsxs)(`small`,{children:[S.result.page,` / `,Math.ceil(S.result.total/S.result.pageSize)]}),(0,L.jsx)(`button`,{disabled:S.result.page*S.result.pageSize>=S.result.total,"aria-label":h(`agents.next`),onClick:()=>S.setPage(S.result.page+1),children:(0,L.jsx)(p,{size:13})})]}),O&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`span`,{className:`agent-task-state`,children:h(`agents.state_${O.state}`)}),(0,L.jsx)(`span`,{className:`agent-toolbar-spacer`}),q?(0,L.jsxs)(`button`,{disabled:S.busy,onClick:()=>void $(`/stop`),children:[(0,L.jsx)(b,{size:12}),h(`agents.end`)]}):(0,L.jsxs)(`button`,{disabled:!ne||S.busy,onClick:()=>void $(`/start`),children:[(0,L.jsx)(P,{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:S.busy,onClick:()=>{W(O.title),H(e=>!e)},children:(0,L.jsx)(s,{size:13})}),(0,L.jsx)(`button`,{className:`agent-icon-button agent-danger`,title:h(`agents.delete`),"aria-label":h(`agents.delete`),disabled:S.busy,onClick:()=>{S.setError(``),K(!0)},children:(0,L.jsx)(o,{size:13})})]})]}),(k||!O)&&(0,L.jsxs)(`form`,{className:`agent-task-create`,onSubmit:t=>{t.preventDefault(),!Q&&S.mutate(async()=>{let t=X?.id,n=await C(`/api/projects/${e}/agent-tasks`,{method:`POST`,body:JSON.stringify({agentId:t,title:j})});S.acceptTask(n.task),S.setPage(1),S.setSelectedId(n.task.id),A(!1),M(``);let r=await C(`/api/agent-tasks/${n.task.id}/start`,{method:`POST`});S.acceptTask(r.task)})},children:[(0,L.jsx)(`input`,{"aria-label":h(`agents.task`),placeholder:h(`agents.titlePlaceholder`),maxLength:160,value:j,onChange:e=>M(e.target.value),disabled:S.busy||t}),(0,L.jsx)(R,{agents:S.catalog?.agents??[],value:X?.id??``,onChange:B,disabled:t||S.busy}),(0,L.jsxs)(`button`,{type:`submit`,disabled:Q,children:[S.busy&&(0,L.jsx)(E,{className:`spin`,size:13}),h(`agents.create`)]})]}),V&&O&&(0,L.jsxs)(`form`,{className:`agent-task-create`,onSubmit:e=>{e.preventDefault(),S.mutate(async()=>{let e=await C(`/api/agent-tasks/${O.id}`,{method:`PATCH`,body:JSON.stringify({title:U})});S.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)(y,{type:`submit`,saving:S.busy,children:h(`common.save`)})]}),S.error&&!G&&(0,L.jsxs)(`p`,{className:`error agent-inline-error`,role:`alert`,children:[S.error,(0,L.jsx)(`button`,{onClick:()=>S.setError(``),"aria-label":h(`common.close`),children:(0,L.jsx)(a,{size:13})})]}),O?.errorCode&&!S.error&&!G&&(0,L.jsx)(`p`,{className:`error agent-inline-error`,role:`alert`,children:h(`errors.codes.${O.errorCode}`,{defaultValue:h(`agents.taskUnavailable`)})}),(Z||k&&S.result.activeTaskId)&&(0,L.jsxs)(`p`,{className:`agent-inline-warning`,role:`status`,children:[(0,L.jsx)(i,{size:14,"aria-hidden":`true`}),(0,L.jsx)(`span`,{children:h(`errors.codes.AGENT_PROJECT_BUSY`)})]}),S.catalog&&!S.catalog.ptyAvailable&&(0,L.jsx)(`p`,{className:`error agent-inline-error`,children:h(`agents.ptyUnavailable`)}),(0,L.jsx)(`div`,{className:`agent-terminal-body`,style:d(D.theme),children:(0,L.jsx)(F.Suspense,{fallback:(0,L.jsx)(`div`,{className:`agent-task-empty`,children:(0,L.jsx)(E,{className:`spin`,size:18})}),children:O&&q&&!t?(0,L.jsx)(z,{task:O,onTask:S.acceptTask},O.id):(0,L.jsxs)(`div`,{className:`agent-task-empty`,children:[(0,L.jsx)(m,{size:24}),(0,L.jsx)(`strong`,{children:O?.title||h(`agents.noTasks`)}),(0,L.jsx)(`p`,{children:h(t?`agents.permissionLost`:`agents.readyHint`)}),O?.exitCode!==null&&O?.exitCode!==void 0&&O.exitCode!==0&&(0,L.jsx)(`small`,{children:h(`agents.exitCode`,{code:O.exitCode})})]})})}),D.showExecutionReminder&&q&&O.state!==`stopping`&&(0,L.jsxs)(`p`,{className:`agent-execution-reminder`,children:[(0,L.jsx)(i,{size:12,"aria-hidden":`true`}),(0,L.jsx)(`span`,{children:h(`agents.endReminder`)})]}),O&&(0,L.jsx)(w,{open:G,title:h(`agents.delete`),description:h(`agents.deleteDescription`),onOpenChange:e=>{S.busy||K(e)},footer:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`button`,{disabled:S.busy,onClick:()=>K(!1),children:h(`common.cancel`)}),(0,L.jsxs)(`button`,{className:`danger`,disabled:S.busy,onClick:()=>void S.mutate(async()=>{await C(`/api/agent-tasks/${O.id}`,{method:`DELETE`}),K(!1)}),children:[S.busy&&(0,L.jsx)(E,{className:`spin`,size:13}),h(`agents.delete`)]})]}),children:S.error&&(0,L.jsx)(`p`,{className:`error`,role:`alert`,children:S.error})})]})}export{B as AgentTerminal};