@clagentic/console 1.5.0-beta.2 → 1.5.0-beta.4

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 (54) hide show
  1. package/README.md +18 -14
  2. package/bin/cli.js +1 -0
  3. package/lib/cli-sessions.js +71 -18
  4. package/lib/config.js +80 -6
  5. package/lib/daemon-projects.js +1 -1
  6. package/lib/daemon.js +142 -26
  7. package/lib/pages.js +1 -42
  8. package/lib/project-connection.js +4 -8
  9. package/lib/project-external-trigger.js +62 -7
  10. package/lib/project-http.js +17 -1
  11. package/lib/project-loop.js +3 -2
  12. package/lib/project-notifications.js +3 -18
  13. package/lib/project-sessions.js +68 -27
  14. package/lib/project-team.js +417 -0
  15. package/lib/project-user-message.js +5 -10
  16. package/lib/project.js +53 -53
  17. package/lib/public/app.js +7 -15
  18. package/lib/public/css/home-hub.css +36 -0
  19. package/lib/public/css/icon-strip.css +28 -126
  20. package/lib/public/css/menus.css +2 -2
  21. package/lib/public/css/team-panel.css +149 -0
  22. package/lib/public/index.html +72 -15
  23. package/lib/public/modules/admin.js +1 -52
  24. package/lib/public/modules/agent-picker.js +11 -3
  25. package/lib/public/modules/app-cursors.js +43 -47
  26. package/lib/public/modules/app-home-hub.js +12 -0
  27. package/lib/public/modules/app-messages.js +18 -12
  28. package/lib/public/modules/app-rendering.js +1 -2
  29. package/lib/public/modules/server-settings.js +74 -5
  30. package/lib/public/modules/sidebar-mobile.js +9 -88
  31. package/lib/public/modules/sidebar-projects.js +1 -1
  32. package/lib/public/modules/sidebar-sessions.js +6 -2
  33. package/lib/public/modules/sidebar-users.js +37 -307
  34. package/lib/public/modules/team-panel.js +331 -0
  35. package/lib/public/modules/tools.js +3 -0
  36. package/lib/public/modules/user-settings.js +0 -3
  37. package/lib/public/style.css +1 -0
  38. package/lib/sdk-bridge.js +121 -8
  39. package/lib/sdk-message-processor.js +39 -4
  40. package/lib/sdk-worker.js +2 -2
  41. package/lib/server-admin.js +1 -86
  42. package/lib/server-auth.js +13 -124
  43. package/lib/server-dm.js +2 -7
  44. package/lib/server-palette.js +9 -20
  45. package/lib/server-settings.js +41 -243
  46. package/lib/server-skills.js +11 -13
  47. package/lib/server.js +37 -60
  48. package/lib/sessions.js +16 -50
  49. package/lib/terminal-manager.js +13 -15
  50. package/lib/users-auth.js +0 -38
  51. package/lib/users.js +14 -11
  52. package/lib/ws-schema.js +12 -0
  53. package/lib/yoke/adapters/claude.js +5 -0
  54. package/package.json +1 -1
package/lib/public/app.js CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  renderIconStrip, updateProjectBadge
12
12
  } from './modules/sidebar-projects.js';
13
13
  import {
14
- renderUserStrip, closeDmUserPicker, setCurrentDmUser,
14
+ closeDmUserPicker, setCurrentDmUser,
15
15
  updateDmBadge, renderSidebarPresence, setMentionActive, clearAllMentionActive,
16
16
  initSidebarUsers
17
17
  } from './modules/sidebar-users.js';
@@ -65,6 +65,7 @@ import { initProjects, onProjectListUpdated, onResetClientState, updateProjectLi
65
65
  import { initRendering, addToMessages as _renAddToMessages, scrollToBottom as _renScrollToBottom, forceScrollToBottom as _renForceScrollToBottom, addUserMessage as _renAddUserMessage, getMsgTime as _renGetMsgTime, shouldGroupMessage as _renShouldGroupMessage, ensureAssistantBlock as _renEnsureAssistantBlock, addCopyHandler as _renAddCopyHandler, appendDelta as _renAppendDelta, flushStreamBuffer as _renFlushStreamBuffer, finalizeAssistantBlock as _renFinalizeAssistantBlock, addSystemMessage as _renAddSystemMessage, addConflictMessage as _renAddConflictMessage, addContextOverflowMessage as _renAddContextOverflowMessage, showClaudePreThinking as _renShowClaudePreThinking, showSuggestionChips as _renShowSuggestionChips, hideSuggestionChips as _renHideSuggestionChips, getGhostSuggestion as _renGetGhostSuggestion, getTurnCounter, setTurnCounter, getPrependAnchor, setPrependAnchor, getActivityEl, setActivityEl, getIsUserScrolledUp, setIsUserScrolledUp, getStickyBottom, armStickyBottom, disarmStickyBottom } from './modules/app-rendering.js';
66
66
  import { initDm, openDm as _dmOpenDm, enterDmMode as _dmEnterDmMode, exitDmMode as _dmExitDmMode, appendDmMessage as _dmAppendDmMessage, showDmTypingIndicator as _dmShowDmTypingIndicator, handleDmSend as _dmHandleDmSend } from './modules/app-dm.js';
67
67
  import { initMention, handleMentionStart, handleMentionStream, handleMentionDone, handleMentionError, handleMentionActivity, renderMentionUser, renderMentionResponse } from './modules/mention.js';
68
+ import { initTeamPanel } from './modules/team-panel.js';
68
69
 
69
70
  // --- Base path for multi-project routing ---
70
71
  var slugMatch = location.pathname.match(/^\/p\/([a-z0-9_-]+)/);
@@ -268,7 +269,7 @@ import { initMention, handleMentionStart, handleMentionStream, handleMentionDone
268
269
  cachedDmFavorites: [],
269
270
  pendingTermCommand: null,
270
271
  myUserId: null,
271
- isMultiUserMode: false,
272
+ isMultiUserMode: true,
272
273
  dmUnread: {},
273
274
  dmRemovedUsers: {},
274
275
  cachedAllUsers: [],
@@ -375,6 +376,7 @@ import { initMention, handleMentionStart, handleMentionStream, handleMentionDone
375
376
  initToolPalettes();
376
377
  initSidebar(sidebarCtx);
377
378
  initSidebarUsers();
379
+ initTeamPanel();
378
380
 
379
381
  initCommandPalette({
380
382
  switchProject: function (slug) { switchProject(slug); },
@@ -743,21 +745,11 @@ import { initMention, handleMentionStart, handleMentionStream, handleMentionDone
743
745
  get projectList() { return getCachedProjects(); },
744
746
  });
745
747
  fetch("/api/me").then(function (r) { return r.json(); }).then(function (d) {
746
- if (d.multiUser) {
747
- store.set({ isMultiUserMode: true });
748
- if (document.body) document.body.classList.add('is-multi-user');
749
- }
748
+ store.set({ isMultiUserMode: true });
749
+ if (document.body) document.body.classList.add('is-multi-user');
750
750
  if (d.user && d.user.id) { store.set({ myUserId: d.user.id }); }
751
751
  if (d.permissions) store.set({ permissions: d.permissions });
752
752
  if (d.mustChangePin) showForceChangePinOverlay();
753
- // Single-user mode: clear user strip skeletons immediately (no presence message will arrive)
754
- if (!store.get('isMultiUserMode')) {
755
- var usersContainer = document.getElementById("icon-strip-users");
756
- if (usersContainer) {
757
- usersContainer.innerHTML = "";
758
- usersContainer.classList.add("hidden");
759
- }
760
- }
761
753
  initCursorToggle();
762
754
  // Apply RBAC UI gating
763
755
  var _perms = store.get('permissions');
@@ -788,7 +780,7 @@ import { initMention, handleMentionStart, handleMentionStream, handleMentionDone
788
780
  }).catch(function () {});
789
781
  // Hide server settings and update controls for non-admin users in multi-user mode
790
782
  checkAdminAccess().then(function (isAdmin) {
791
- if (store.get('isMultiUserMode') && !isAdmin) {
783
+ if (!isAdmin) {
792
784
  var settingsBtn = document.getElementById("server-settings-btn");
793
785
  if (settingsBtn) settingsBtn.style.display = "none";
794
786
  var updatePill = document.getElementById("update-pill-wrap");
@@ -79,6 +79,42 @@
79
79
  }
80
80
 
81
81
 
82
+ /* --- Hub search bar (delegates to command palette on interaction) --- */
83
+ .hub-search-bar {
84
+ display: flex;
85
+ align-items: center;
86
+ gap: 10px;
87
+ background: var(--bg-alt);
88
+ border: 1px solid var(--border-subtle);
89
+ border-radius: 10px;
90
+ padding: 10px 14px;
91
+ cursor: text;
92
+ animation: hubCardIn 0.35s ease;
93
+ }
94
+
95
+ .hub-search-bar .lucide {
96
+ width: 16px;
97
+ height: 16px;
98
+ color: var(--text-dimmer);
99
+ flex-shrink: 0;
100
+ }
101
+
102
+ .hub-search-bar input {
103
+ flex: 1;
104
+ min-width: 0;
105
+ background: none;
106
+ border: none;
107
+ outline: none;
108
+ font-family: inherit;
109
+ font-size: 14px;
110
+ color: var(--text);
111
+ cursor: text;
112
+ }
113
+
114
+ .hub-search-bar input::placeholder {
115
+ color: var(--text-dimmer);
116
+ }
117
+
82
118
  /* --- Greeting --- */
83
119
  .hub-greeting {
84
120
  text-align: center;
@@ -828,134 +828,57 @@
828
828
  height: 22px;
829
829
  }
830
830
 
831
- /* Mate section wrapper — pinned just above the user-island at the
832
- bottom of the strip. Groups the \u2318M hint pill with the users
833
- list so the hint sits directly above the mate avatars rather than
834
- floating up in the project section's flex flow. */
835
- /* --- User avatars (circle, inside the mate section) --- */
836
- .icon-strip-users {
837
- width: 56px;
838
- display: flex;
839
- flex-direction: column;
840
- align-items: center;
841
- gap: 0;
842
- padding: 4px 0;
843
- }
844
-
845
- .icon-strip-users.hidden {
846
- display: none;
847
- }
848
-
849
- /* "Invite" mini button at bottom of user strip */
850
- .icon-strip-invite {
851
- position: relative;
852
- width: 40px;
853
- height: 32px;
854
- border-radius: 10px;
855
- background: transparent;
856
- border: none;
857
- display: flex;
858
- align-items: center;
859
- justify-content: center;
860
- cursor: pointer;
861
- flex-shrink: 0;
862
- color: var(--text-dimmer);
863
- transition: color 0.2s, background 0.2s;
864
- }
865
-
866
- .icon-strip-invite:hover {
867
- color: var(--accent);
868
- background: rgba(var(--overlay-rgb), 0.08);
869
- }
870
-
871
- .icon-strip-invite .lucide {
872
- width: 16px;
873
- height: 16px;
874
- }
875
-
876
- .icon-strip-user {
831
+ /* --- Permanent Teams button (always visible, opens team panel) --- */
832
+ .icon-strip-team-btn {
877
833
  position: relative;
878
- width: 42px;
879
- height: 42px;
834
+ width: 48px;
835
+ height: 48px;
880
836
  border-radius: 0;
881
837
  background: transparent;
838
+ border: none;
882
839
  display: flex;
883
840
  align-items: center;
884
841
  justify-content: center;
885
842
  cursor: pointer;
886
843
  flex-shrink: 0;
844
+ color: var(--text-secondary);
887
845
  }
888
846
 
889
- .icon-strip-user-avatar {
890
- width: 34px;
891
- height: 34px;
892
- border-radius: 50%;
893
- object-fit: cover;
894
- transition: opacity 0.2s ease, transform 0.2s ease;
895
- opacity: 0.7;
896
- }
897
-
898
- .icon-strip-user:hover .icon-strip-user-avatar {
899
- opacity: 1;
900
- transform: scale(1.08);
901
- }
902
-
903
- .icon-strip-user.active .icon-strip-user-avatar {
904
- opacity: 1;
905
- box-shadow: 0 0 0 2px var(--accent);
847
+ .icon-strip-team-btn::before {
848
+ content: "";
849
+ position: absolute;
850
+ width: 38px;
851
+ height: 38px;
852
+ border-radius: 12px;
853
+ background: var(--bg-alt);
854
+ transition: background 0.2s ease;
855
+ z-index: -1;
906
856
  }
907
857
 
908
- /* Primary mate: full color (no desaturate), no ring */
909
- .icon-strip-primary-mate {
910
- opacity: 1;
911
- border-radius: 8px;
912
- filter: saturate(1) !important;
858
+ .icon-strip-team-btn:hover::before {
859
+ background: var(--accent);
913
860
  }
914
861
 
915
- /* Online status dot (bottom-right on avatar, like project blink dot) */
916
- .icon-strip-user-online {
917
- position: absolute;
918
- bottom: 5px;
919
- right: 5px;
920
- width: 10px;
921
- height: 10px;
922
- border-radius: 50%;
923
- background: var(--text-dimmer);
924
- border: 2px solid var(--sidebar-bg);
925
- opacity: 1;
926
- transition: opacity 0.2s, background 0.3s;
862
+ .icon-strip-team-btn:hover {
863
+ color: #fff;
927
864
  }
928
865
 
929
- .icon-strip-user.online .icon-strip-user-online {
930
- background: var(--success);
866
+ .icon-strip-team-btn.active::before {
867
+ background: var(--accent);
931
868
  }
932
869
 
933
- /* DM unread badge */
934
- .icon-strip-user-badge {
935
- position: absolute;
936
- top: -2px;
937
- right: -2px;
938
- min-width: 18px;
939
- height: 18px;
940
- border-radius: 9px;
941
- background: #e74c3c;
870
+ .icon-strip-team-btn.active {
942
871
  color: #fff;
943
- font-size: 11px;
944
- font-weight: 700;
945
- display: none;
946
- align-items: center;
947
- justify-content: center;
948
- padding: 0 5px;
949
- line-height: 18px;
950
- text-align: center;
951
- box-shadow: 0 0 0 2px var(--bg);
952
- z-index: 2;
953
872
  }
954
873
 
955
- .icon-strip-user-badge.has-unread {
956
- display: flex;
874
+ .icon-strip-team-btn .lucide {
875
+ width: 20px;
876
+ height: 20px;
877
+ position: relative;
878
+ z-index: 1;
957
879
  }
958
880
 
881
+
959
882
  /* Project unread badge */
960
883
  .icon-strip-project-badge {
961
884
  position: absolute;
@@ -982,19 +905,6 @@
982
905
  display: flex;
983
906
  }
984
907
 
985
- /* Pill for user icons */
986
- .icon-strip-user:hover .icon-strip-pill {
987
- opacity: 1;
988
- height: 20px;
989
- }
990
-
991
- .icon-strip-user.active .icon-strip-pill {
992
- opacity: 1;
993
- height: 32px;
994
- }
995
-
996
- /* DM mode: keep same position (user-island gone but layout stays) */
997
-
998
908
  /* --- My avatar at bottom of icon strip (always present, behind user-island) --- */
999
909
  /* Positioned to align with icon-strip center (72px / 2 = 36px) */
1000
910
  /* Matches user-island avatar center: left:8px + padding:10px + 18px = 36px */
@@ -1494,14 +1404,6 @@ select.wt-modal-input {
1494
1404
  margin: 5px auto;
1495
1405
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
1496
1406
  }
1497
- .skeleton-icon-strip-user {
1498
- width: 34px;
1499
- height: 34px;
1500
- border-radius: 50%;
1501
- background: var(--text-muted, #888);
1502
- margin: 4px auto;
1503
- animation: skeleton-shimmer 1.5s ease-in-out infinite;
1504
- }
1505
1407
 
1506
1408
  @media (max-width: 768px) {
1507
1409
  #icon-strip {
@@ -669,7 +669,7 @@
669
669
  #info-panels:empty { display: none; }
670
670
 
671
671
  /* --- Usage panel --- */
672
- #usage-panel, #status-panel, #context-panel {
672
+ #usage-panel, #status-panel, #context-panel, #team-panel {
673
673
  background: var(--bg-alt);
674
674
  border: 1px solid var(--border);
675
675
  border-radius: 12px;
@@ -678,7 +678,7 @@
678
678
  pointer-events: auto;
679
679
  }
680
680
 
681
- #usage-panel.hidden, #status-panel.hidden, #context-panel.hidden { display: none; }
681
+ #usage-panel.hidden, #status-panel.hidden, #context-panel.hidden, #team-panel.hidden { display: none; }
682
682
 
683
683
  .usage-panel-header {
684
684
  display: flex;
@@ -0,0 +1,149 @@
1
+ /* team-panel.css - Live team activity panel styles */
2
+
3
+ .team-panel-body {
4
+ padding: 12px 14px;
5
+ overflow-y: auto;
6
+ }
7
+
8
+ .team-section-header {
9
+ font-size: 10px;
10
+ font-weight: 600;
11
+ letter-spacing: 0.07em;
12
+ text-transform: uppercase;
13
+ color: var(--text-dimmer);
14
+ margin: 14px 0 6px;
15
+ }
16
+
17
+ .team-section-header:first-child {
18
+ margin-top: 0;
19
+ }
20
+
21
+ .team-member-row {
22
+ display: flex;
23
+ align-items: center;
24
+ gap: 8px;
25
+ padding: 4px 0;
26
+ }
27
+
28
+ .team-member-status-dot {
29
+ width: 8px;
30
+ height: 8px;
31
+ border-radius: 50%;
32
+ flex-shrink: 0;
33
+ background: var(--text-dimmer);
34
+ }
35
+
36
+ .team-member-status-dot.alive {
37
+ background: #4caf50;
38
+ }
39
+
40
+ .team-member-status-dot.idle {
41
+ background: #ff9800;
42
+ }
43
+
44
+ .team-member-status-dot.gone,
45
+ .team-member-status-dot.unknown {
46
+ background: var(--text-dimmer);
47
+ }
48
+
49
+ .team-member-name {
50
+ font-weight: 500;
51
+ font-size: 13px;
52
+ white-space: nowrap;
53
+ }
54
+
55
+ .team-member-activity {
56
+ color: var(--text-dim);
57
+ font-size: 12px;
58
+ flex: 1;
59
+ overflow: hidden;
60
+ text-overflow: ellipsis;
61
+ white-space: nowrap;
62
+ }
63
+
64
+ .team-task-item {
65
+ display: flex;
66
+ align-items: center;
67
+ gap: 6px;
68
+ padding: 4px 0;
69
+ font-size: 13px;
70
+ }
71
+
72
+ .team-task-status {
73
+ display: inline-block;
74
+ font-size: 10px;
75
+ padding: 1px 6px;
76
+ border-radius: 4px;
77
+ white-space: nowrap;
78
+ flex-shrink: 0;
79
+ }
80
+
81
+ .team-task-status.completed {
82
+ background: rgba(76, 175, 80, 0.15);
83
+ color: #4caf50;
84
+ }
85
+
86
+ .team-task-status.in_progress {
87
+ background: rgba(33, 150, 243, 0.15);
88
+ color: #2196f3;
89
+ }
90
+
91
+ .team-task-status.pending {
92
+ background: rgba(158, 158, 158, 0.15);
93
+ color: var(--text-dim);
94
+ }
95
+
96
+ .team-task-status.blocked {
97
+ background: rgba(244, 67, 54, 0.15);
98
+ color: #f44336;
99
+ }
100
+
101
+ .team-message-item {
102
+ border-left: 2px solid var(--border-subtle);
103
+ padding-left: 8px;
104
+ margin-bottom: 8px;
105
+ }
106
+
107
+ .team-message-from {
108
+ font-size: 11px;
109
+ font-weight: 600;
110
+ color: var(--text-dim);
111
+ margin-bottom: 2px;
112
+ }
113
+
114
+ .team-message-body {
115
+ font-size: 13px;
116
+ display: -webkit-box;
117
+ -webkit-line-clamp: 3;
118
+ -webkit-box-orient: vertical;
119
+ overflow: hidden;
120
+ }
121
+
122
+ .beta-badge {
123
+ display: inline-block;
124
+ font-size: 10px;
125
+ padding: 1px 5px;
126
+ border-radius: 4px;
127
+ background: #ff9800;
128
+ color: #fff;
129
+ vertical-align: middle;
130
+ margin-left: 4px;
131
+ font-weight: 600;
132
+ letter-spacing: 0.02em;
133
+ }
134
+
135
+ .team-empty-state {
136
+ text-align: center;
137
+ color: var(--text-dim);
138
+ padding: 24px 16px;
139
+ }
140
+
141
+ .team-empty-state p {
142
+ margin: 0 0 6px;
143
+ font-size: 14px;
144
+ }
145
+
146
+ .team-empty-hint {
147
+ font-size: 12px;
148
+ color: var(--text-dimmer);
149
+ }
@@ -125,6 +125,7 @@
125
125
  <line x1="29" y1="55" x2="46" y2="55" stroke="url(#cg-strip)" stroke-width="1.8" stroke-linecap="round"/>
126
126
  </svg>
127
127
  </div>
128
+ <button type="button" class="icon-strip-team-btn" id="icon-strip-team-btn" title="Team" aria-label="Team"><i data-lucide="users"></i></button>
128
129
  <div class="icon-strip-separator"></div>
129
130
  <button type="button" class="icon-strip-hint" id="icon-strip-hint-project" data-switcher-mode="project" aria-label="Switch project"></button>
130
131
  <div class="icon-strip-projects" id="icon-strip-projects">
@@ -132,7 +133,6 @@
132
133
  <div class="skeleton-icon-strip-item"></div>
133
134
  </div>
134
135
  <button class="icon-strip-add" id="icon-strip-add" title="Add project"><i data-lucide="plus"></i></button>
135
- <div class="icon-strip-users hidden" id="icon-strip-users"></div>
136
136
  <div class="icon-strip-me" id="icon-strip-me"></div>
137
137
  </div>
138
138
 
@@ -144,13 +144,15 @@
144
144
  <span>ESC</span>
145
145
  </button>
146
146
  <div class="home-hub-inner">
147
+ <div class="hub-search-bar">
148
+ <i data-lucide="search"></i>
149
+ <input type="text" id="hub-search-input" placeholder="Search sessions, projects, commands…" autocomplete="off" spellcheck="false" />
150
+ </div>
147
151
  <div class="hub-greeting">
148
152
  <h1 id="hub-greeting-text"></h1>
149
153
  <p id="hub-greeting-date"></p>
150
154
  </div>
151
155
 
152
- <div id="home-hub-mates" class="home-hub-mates hidden"></div>
153
-
154
156
  <div class="hub-card hub-recent-sessions">
155
157
  <div class="hub-card-header">
156
158
  <span class="hub-card-title">Recent Sessions</span>
@@ -328,6 +330,13 @@
328
330
  <div class="usage-row"><span class="usage-label">Terminals</span><span id="status-terminals" class="usage-value">-</span></div>
329
331
  </div>
330
332
  </div>
333
+ <div id="team-panel" class="hidden">
334
+ <div class="usage-panel-header">
335
+ <span>Team <span class="beta-badge">Beta</span></span>
336
+ <button id="team-panel-close" aria-label="Close"><i data-lucide="x"></i></button>
337
+ </div>
338
+ <div id="team-panel-body" class="usage-panel-body team-panel-body"></div>
339
+ </div>
331
340
  <div id="context-panel" class="hidden">
332
341
  <div class="usage-panel-header">
333
342
  <span>Context</span>
@@ -532,7 +541,7 @@
532
541
  <line x1="29" y1="55" x2="46" y2="55" stroke="url(#cg-mobile)" stroke-width="1.8" stroke-linecap="round"/>
533
542
  </svg>
534
543
  </button>
535
- <button class="mobile-tab" data-tab="search" id="mob-tab-search"><i data-lucide="search"></i><span class="mobile-tab-label">Search</span></button>
544
+ <button class="mobile-tab" data-tab="team" id="mob-tab-team"><i data-lucide="users"></i><span class="mobile-tab-label">Team</span></button>
536
545
  <button class="mobile-tab" data-tab="more" id="mob-tab-more"><i data-lucide="ellipsis"></i><span class="mobile-tab-label">More</span></button>
537
546
  </div>
538
547
 
@@ -1042,7 +1051,7 @@
1042
1051
  <button class="settings-nav-item" data-section="lite" id="settings-clagentic-nav"><span>Lite</span></button>
1043
1052
  <div class="settings-nav-separator"></div>
1044
1053
  <div class="settings-nav-category">Server</div>
1045
- <button class="settings-nav-item hidden" data-section="keep-awake" id="settings-keep-awake-nav"><span>Keep Awake</span></button>
1054
+ <button class="settings-nav-item" data-section="advanced" id="settings-advanced-nav"><span>Advanced</span></button>
1046
1055
  <button class="settings-nav-item" data-section="restart"><span>Restart</span></button>
1047
1056
  <button class="settings-nav-item settings-nav-danger" data-section="shutdown"><span>Shutdown</span></button>
1048
1057
  </div>
@@ -1124,6 +1133,17 @@
1124
1133
  <span class="settings-value settings-mono" id="settings-project-slug">-</span>
1125
1134
  </div>
1126
1135
  </div>
1136
+ <h3>Agent Catalog</h3>
1137
+ <div class="settings-card">
1138
+ <div class="settings-field">
1139
+ <label class="settings-label">Refresh Agent Catalog</label>
1140
+ <div class="settings-hint">Re-scans for installed agents and updates the picker for all connected users. Happens automatically when you open the agent picker — use this to push an update immediately.</div>
1141
+ <div style="margin-top: 12px;">
1142
+ <button class="settings-btn-sm" id="settings-refresh-agents-btn"><i data-lucide="refresh-cw" style="width:14px;height:14px;vertical-align:-2px;margin-right:4px;"></i>Refresh agents</button>
1143
+ </div>
1144
+ <div class="settings-hint hidden" id="settings-refresh-agents-status" style="margin-top: 8px;"></div>
1145
+ </div>
1146
+ </div>
1127
1147
  <div class="settings-card">
1128
1148
  <div class="settings-field-row">
1129
1149
  <label class="settings-label">Support</label>
@@ -1325,18 +1345,55 @@
1325
1345
  </div>
1326
1346
  </div>
1327
1347
  </div>
1328
- <!-- Auto-continue moved to User Settings > Behavior -->
1329
- <div class="server-settings-section hidden" data-section="keep-awake" id="settings-keep-awake-section">
1330
- <h2>Keep Awake</h2>
1331
- <div class="settings-card">
1332
- <label class="settings-toggle-row">
1348
+ <!-- Advanced: groups power-user settings (Keep Awake + Memory) -->
1349
+ <div class="server-settings-section" data-section="advanced">
1350
+ <h2>Advanced</h2>
1351
+ <p class="settings-hint" style="margin-bottom: 16px;">Power-user settings. Changes here affect daemon behavior and stability.</p>
1352
+
1353
+ <!-- Keep Awake subsection (macOS only — JS shows/hides this block) -->
1354
+ <div id="settings-keep-awake-section" class="hidden">
1355
+ <h3 class="settings-subsection-title">Keep Awake</h3>
1356
+ <div class="settings-card" style="margin-bottom: 24px;">
1357
+ <label class="settings-toggle-row">
1358
+ <div>
1359
+ <span class="settings-label">Keep Awake</span>
1360
+ <div class="settings-hint">Prevent the system from sleeping while the server is running (macOS only).</div>
1361
+ </div>
1362
+ <input type="checkbox" id="settings-keep-awake">
1363
+ <span class="toggle-track"><span class="toggle-thumb"></span></span>
1364
+ </label>
1365
+ </div>
1366
+ </div>
1367
+
1368
+ <!-- Memory subsection -->
1369
+ <h3 class="settings-subsection-title">Memory</h3>
1370
+ <p class="settings-hint" style="margin-bottom: 12px;">Fine-tune memory pressure gates that protect daemon stability under load.</p>
1371
+ <div class="settings-card" style="border-left: 3px solid var(--warn, #f9e2af); padding-left: 12px;">
1372
+ <div class="settings-hint" style="color: var(--warn, #f9e2af);">
1373
+ <i data-lucide="alert-triangle" style="width:14px;height:14px;vertical-align:-2px;margin-right:4px;"></i>
1374
+ These settings affect daemon stability. Misconfiguration can cause sessions to be blocked or the daemon to restart.
1375
+ </div>
1376
+ </div>
1377
+ <div class="settings-card" style="margin-top: 16px;">
1378
+ <button id="settings-advanced-memory-toggle" class="settings-field-row" style="background:none;border:none;cursor:pointer;width:100%;text-align:left;padding:0;" aria-expanded="false">
1333
1379
  <div>
1334
- <span class="settings-label">Keep Awake</span>
1335
- <div class="settings-hint">Prevent the system from sleeping while the server is running (macOS only).</div>
1380
+ <span class="settings-label">Advanced</span>
1381
+ <span class="settings-hint">Expand to configure memory thresholds</span>
1336
1382
  </div>
1337
- <input type="checkbox" id="settings-keep-awake">
1338
- <span class="toggle-track"><span class="toggle-thumb"></span></span>
1339
- </label>
1383
+ <i data-lucide="chevron-right" class="settings-adv-chevron" style="flex-shrink:0;transition:transform 0.15s;"></i>
1384
+ </button>
1385
+ <div id="settings-advanced-memory-body" class="hidden" style="padding-top: 16px;">
1386
+ <div class="settings-field">
1387
+ <label class="settings-label" for="settings-mem-available-min">Min available memory (MB)</label>
1388
+ <div class="settings-hint">Minimum system memory required to start a new session. Increase if you experience OOM restarts.</div>
1389
+ <input type="number" id="settings-mem-available-min" class="settings-budget-input" min="0" max="65536" step="128" value="1024" style="margin-top: 8px; width: 120px;">
1390
+ </div>
1391
+ <div class="settings-field" style="margin-top: 16px;">
1392
+ <label class="settings-label" for="settings-tokens-per-mb-headroom">Context tokens per MB headroom</label>
1393
+ <div class="settings-hint">Controls how large a session's context can grow relative to available cgroup memory. Lower = more conservative. Default (67) is calibrated for claude-opus-4 at 1M context.</div>
1394
+ <input type="number" id="settings-tokens-per-mb-headroom" class="settings-budget-input" min="10" max="500" step="1" value="67" style="margin-top: 8px; width: 120px;">
1395
+ </div>
1396
+ </div>
1340
1397
  </div>
1341
1398
  </div>
1342
1399
  <div class="server-settings-section" data-section="restart">