clay-server 2.33.0 → 2.33.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19,6 +19,22 @@ function generateId() {
19
19
  // ========================================================
20
20
 
21
21
  var formatters = {
22
+ auth_required: function (data) {
23
+ var vendor = data.vendor || "claude";
24
+ var title = data.title || ((vendor === "codex" ? "Codex" : "Claude Code") + " is not logged in");
25
+ return {
26
+ type: "auth_required",
27
+ title: title,
28
+ body: data.body || "Open a terminal, then click the URL and follow the instructions.",
29
+ meta: {
30
+ vendor: vendor,
31
+ loginCommand: data.loginCommand || "",
32
+ linuxUser: data.linuxUser || null,
33
+ canAutoLogin: !!data.canAutoLogin,
34
+ },
35
+ };
36
+ },
37
+
22
38
  loop_complete: function (data) {
23
39
  var reason = data.reason || "complete";
24
40
  var body = (reason === "pass" || reason === "complete")
@@ -108,6 +124,7 @@ function attachNotifications(ctx) {
108
124
  // --- Core API ---
109
125
 
110
126
  function notify(event, data) {
127
+ data = data || {};
111
128
  var formatter = formatters[event];
112
129
  if (!formatter) {
113
130
  console.warn("[notifications] Unknown event: " + event);
@@ -432,6 +432,33 @@ function attachSessions(ctx) {
432
432
  return true;
433
433
  }
434
434
 
435
+ if (msg.type === "set_vendor" && msg.vendor) {
436
+ var vendorSession = getSessionForWs(ws);
437
+ if (vendorSession) {
438
+ vendorSession.vendor = msg.vendor;
439
+ // Clear the shared model so the next query uses the vendor's default
440
+ // instead of leaking the previous vendor's model into a fresh session.
441
+ if (sm.currentModel) {
442
+ sm.currentModel = "";
443
+ }
444
+ sm.saveSessionFile(vendorSession);
445
+ sm.broadcastSessionList();
446
+ }
447
+ if (msg.vendor) {
448
+ var vendorModels = (sm.modelsByVendor && sm.modelsByVendor[msg.vendor]) || [];
449
+ sendTo(ws, {
450
+ type: "model_info",
451
+ model: "",
452
+ models: vendorModels,
453
+ vendor: msg.vendor,
454
+ availableVendors: sm.availableVendors || [],
455
+ installedVendors: sm.installedVendors || [],
456
+ });
457
+ send({ type: "config_state", model: sm.currentModel || "", mode: sm.currentPermissionMode || "default", effort: sm.currentEffort || "medium", betas: sm.currentBetas || [], thinking: sm.currentThinking || "adaptive", thinkingBudget: sm.currentThinkingBudget || 10000 });
458
+ }
459
+ return true;
460
+ }
461
+
435
462
  if (msg.type === "set_server_default_model" && msg.model) {
436
463
  if (typeof opts.onSetServerDefaultModel === "function") {
437
464
  opts.onSetServerDefaultModel(msg.model);
package/lib/public/app.js CHANGED
@@ -65,7 +65,7 @@ import { initAppNotifications, handleNotificationsState as _notifHandleState, ha
65
65
  import { createStore, store } from './modules/store.js';
66
66
  import { initPanels, updateConfigChip as _panUpdateConfigChip, getModelEffortLevels as _panGetModelEffortLevels, accumulateUsage as _panAccumulateUsage, updateUsagePanel as _panUpdateUsagePanel, resetUsage as _panResetUsage, toggleUsagePanel as _panToggleUsagePanel, formatTokens as _panFormatTokens, updateStatusPanel as _panUpdateStatusPanel, requestProcessStats as _panRequestProcessStats, toggleStatusPanel as _panToggleStatusPanel, accumulateContext as _panAccumulateContext, updateContextPanel as _panUpdateContextPanel, resetContext as _panResetContext, resetContextData as _panResetContextData, minimizeContext as _panMinimizeContext, expandContext as _panExpandContext, toggleContextPanel as _panToggleContextPanel, getContextView as _panGetContextView, renderCtxPopover as _panRenderCtxPopover, hideCtxPopover as _panHideCtxPopover, formatBytes as _panFormatBytes, formatUptime as _panFormatUptime, getModelSupportsEffort as _panGetModelSupportsEffort, getSessionUsage, setSessionUsage, getContextData, setContextData, setContextView as _panSetContextView, applyContextView as _panApplyContextView } from './modules/app-panels.js';
67
67
  import { initProjects, updateProjectList as _projUpdateProjectList, renderProjectList as _projRenderProjectList, renderTopbarPresence as _projRenderTopbarPresence, switchProject as _projSwitchProject, resetClientState as _projResetClientState, confirmRemoveProject as _projConfirmRemoveProject, handleRemoveProjectCheckResult as _projHandleRemoveProjectCheckResult, handleRemoveProjectResult as _projHandleRemoveProjectResult, openAddProjectModal as _projOpenAddProjectModal, closeAddProjectModal as _projCloseAddProjectModal, handleBrowseDirResult as _projHandleBrowseDirResult, handleAddProjectResult as _projHandleAddProjectResult, handleCloneProgress as _projHandleCloneProgress, showUpdateAvailable as _projShowUpdateAvailable, getCachedProjects, setCachedProjects, getCachedProjectCount, getCachedRemovedProjects, setCachedRemovedProjects } from './modules/app-projects.js';
68
- 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, addAuthRequiredMessage as _renAddAuthRequiredMessage, showClaudePreThinking as _renShowClaudePreThinking, showMatePreThinking as _renShowMatePreThinking, removeMatePreThinking as _renRemoveMatePreThinking, showSuggestionChips as _renShowSuggestionChips, hideSuggestionChips as _renHideSuggestionChips, getGhostSuggestion as _renGetGhostSuggestion, getTurnCounter, setTurnCounter, getPrependAnchor, setPrependAnchor, getActivityEl, setActivityEl, getIsUserScrolledUp, setIsUserScrolledUp } from './modules/app-rendering.js';
68
+ 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, showMatePreThinking as _renShowMatePreThinking, removeMatePreThinking as _renRemoveMatePreThinking, showSuggestionChips as _renShowSuggestionChips, hideSuggestionChips as _renHideSuggestionChips, getGhostSuggestion as _renGetGhostSuggestion, getTurnCounter, setTurnCounter, getPrependAnchor, setPrependAnchor, getActivityEl, setActivityEl, getIsUserScrolledUp, setIsUserScrolledUp } from './modules/app-rendering.js';
69
69
  import { initDm, openDm as _dmOpenDm, enterDmMode as _dmEnterDmMode, exitDmMode as _dmExitDmMode, handleMateCreatedInApp as _dmHandleMateCreatedInApp, renderAvailableBuiltins as _dmRenderAvailableBuiltins, buildMateInterviewPrompt as _dmBuildMateInterviewPrompt, updateMateIconStatus as _dmUpdateMateIconStatus, connectMateProject as _dmConnectMateProject, disconnectMateProject as _dmDisconnectMateProject, appendDmMessage as _dmAppendDmMessage, showDmTypingIndicator as _dmShowDmTypingIndicator, handleDmSend as _dmHandleDmSend } from './modules/app-dm.js';
70
70
  import { initMention, handleMentionStart, handleMentionStream, handleMentionDone, handleMentionError, handleMentionActivity, renderMentionUser, renderMentionResponse } from './modules/mention.js';
71
71
  import { initDebate, handleDebatePreparing, handleDebateStarted, handleDebateResumed, handleDebateTurn, handleDebateActivity, handleDebateStream, handleDebateTurnDone, handleDebateCommentQueued, handleDebateCommentInjected, handleDebateEnded, handleDebateError, renderDebateStarted, renderDebateTurnDone, renderDebateEnded, renderDebateCommentInjected, renderDebateUserResume, openDebateModal, closeDebateModal, handleDebateBriefReady, renderDebateBriefReady, isDebateActive, resetDebateState, exportDebateAsPdf, renderMcpDebateProposal } from './modules/debate.js';
@@ -638,8 +638,6 @@ import { initDebate, handleDebatePreparing, handleDebateStarted, handleDebateRes
638
638
 
639
639
  // pendingTermCommand -> store
640
640
 
641
- function addAuthRequiredMessage(msg) { _renAddAuthRequiredMessage(msg); }
642
-
643
641
  // --- Rate Limit ---
644
642
 
645
643
 
@@ -1502,69 +1502,6 @@ pre.mermaid-error {
1502
1502
 
1503
1503
  .context-overflow-btn:hover { background: var(--accent-hover); }
1504
1504
 
1505
- /* ==========================================================================
1506
- Auth Required Message
1507
- ========================================================================== */
1508
-
1509
- .auth-required-msg {
1510
- max-width: 420px;
1511
- margin: 12px auto;
1512
- padding: 14px 18px;
1513
- background: color-mix(in srgb, var(--warning) 8%, var(--bg));
1514
- border: 1px solid color-mix(in srgb, var(--warning) 30%, transparent);
1515
- border-radius: 12px;
1516
- font-size: 13px;
1517
- }
1518
-
1519
- .auth-required-header {
1520
- font-weight: 600;
1521
- color: var(--warning);
1522
- margin-bottom: 4px;
1523
- }
1524
-
1525
- .auth-required-hint {
1526
- color: var(--text-muted);
1527
- font-size: 12px;
1528
- line-height: 1.5;
1529
- margin-bottom: 4px;
1530
- }
1531
-
1532
- .auth-required-guide {
1533
- color: var(--text-muted);
1534
- font-size: 11px;
1535
- line-height: 1.4;
1536
- margin-bottom: 8px;
1537
- opacity: 0.8;
1538
- }
1539
-
1540
- .auth-required-cmd {
1541
- display: block;
1542
- padding: 8px 12px;
1543
- margin-bottom: 12px;
1544
- background: var(--input-bg);
1545
- border: 1px solid var(--border);
1546
- border-radius: 6px;
1547
- font-family: var(--font-mono);
1548
- font-size: 13px;
1549
- color: var(--text);
1550
- user-select: all;
1551
- }
1552
-
1553
- .auth-required-btn {
1554
- padding: 8px 20px;
1555
- border: none;
1556
- border-radius: 8px;
1557
- background: var(--accent);
1558
- color: #fff;
1559
- font-size: 13px;
1560
- font-weight: 500;
1561
- font-family: inherit;
1562
- cursor: pointer;
1563
- transition: background 0.15s;
1564
- }
1565
-
1566
- .auth-required-btn:hover { background: var(--accent-hover); }
1567
-
1568
1505
  /* ==========================================================================
1569
1506
  Rate Limit Message
1570
1507
  ========================================================================== */
@@ -80,18 +80,21 @@
80
80
 
81
81
  /* Individual banner (frosted glass) */
82
82
  .notif-banner {
83
+ position: relative;
83
84
  display: flex;
84
85
  align-items: center;
85
86
  gap: 10px;
86
- padding: 10px 14px;
87
+ padding: 12px 14px;
87
88
  background:
88
- linear-gradient(180deg, rgba(255,255,255,0.16), rgba(255,255,255,0.04)),
89
- rgba(var(--overlay-rgb), 0.07);
90
- backdrop-filter: blur(10px) saturate(1.08);
91
- -webkit-backdrop-filter: blur(10px) saturate(1.08);
92
- border: 1px solid rgba(255,255,255,0.2);
89
+ linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.02)),
90
+ rgba(var(--overlay-rgb), 0.04);
91
+ backdrop-filter: blur(12px) saturate(1.04);
92
+ -webkit-backdrop-filter: blur(12px) saturate(1.04);
93
+ border: 1px solid rgba(255,255,255,0.08);
93
94
  border-radius: 16px;
94
- box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
95
+ box-shadow:
96
+ inset 0 1px 0 rgba(255,255,255,0.06),
97
+ 0 8px 24px rgba(var(--shadow-rgb), 0.14);
95
98
  pointer-events: auto;
96
99
  cursor: pointer;
97
100
  opacity: 0;
@@ -107,8 +110,10 @@
107
110
  transform: translateY(-100%);
108
111
  }
109
112
  .notif-banner:hover {
110
- border-color: rgba(255,255,255,0.28);
111
- box-shadow: inset 0 1px 0 rgba(255,255,255,0.24);
113
+ border-color: rgba(255,255,255,0.12);
114
+ box-shadow:
115
+ inset 0 1px 0 rgba(255,255,255,0.08),
116
+ 0 10px 28px rgba(var(--shadow-rgb), 0.16);
112
117
  }
113
118
 
114
119
  .notif-banner-icon {
@@ -118,11 +123,11 @@
118
123
  display: flex;
119
124
  align-items: center;
120
125
  justify-content: center;
121
- background: linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0.04));
122
- border: 1px solid rgba(255,255,255,0.16);
126
+ background: linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.02));
127
+ border: 1px solid rgba(255,255,255,0.12);
123
128
  border-radius: 10px;
124
129
  color: var(--text-muted);
125
- box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
130
+ box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
126
131
  }
127
132
  .notif-banner-icon .lucide { width: 16px; height: 16px; }
128
133
  .notif-banner-emoji { font-size: 18px; line-height: 1; }
@@ -140,20 +145,24 @@
140
145
  }
141
146
  .notif-banner-project {
142
147
  font-size: 11px;
143
- font-weight: 600;
144
- color: var(--text-dimmer);
148
+ font-weight: 700;
149
+ color: rgba(255, 255, 255, 0.98);
145
150
  text-transform: uppercase;
146
- letter-spacing: 0.3px;
147
- margin-bottom: 2px;
151
+ letter-spacing: 0.55px;
152
+ margin-bottom: 3px;
153
+ text-shadow:
154
+ 0 1px 0 rgba(0, 0, 0, 0.75),
155
+ 0 0 6px rgba(0, 0, 0, 0.25);
148
156
  }
149
157
  .notif-banner-title {
150
- font-weight: 600;
158
+ font-weight: 700;
151
159
  font-size: 13px;
152
- color: var(--text);
160
+ color: rgba(255, 255, 255, 0.98);
153
161
  line-height: 1.3;
154
162
  overflow: hidden;
155
163
  text-overflow: ellipsis;
156
164
  white-space: nowrap;
165
+ text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
157
166
  }
158
167
  .notif-banner-text {
159
168
  font-size: 12px;
@@ -211,24 +220,30 @@
211
220
 
212
221
  /* Banner close button */
213
222
  .notif-banner-close {
223
+ position: absolute;
224
+ top: -8px;
225
+ left: -8px;
214
226
  display: flex;
215
227
  align-items: center;
216
228
  justify-content: center;
217
- width: 22px;
218
- height: 22px;
219
- background: none;
229
+ width: 18px;
230
+ height: 18px;
231
+ background: rgba(42, 42, 45, 1);
220
232
  border: none;
221
- color: var(--text-dimmer);
233
+ color: rgba(255, 255, 255, 0.92);
222
234
  cursor: pointer;
223
- border-radius: 4px;
235
+ border-radius: 999px;
224
236
  flex-shrink: 0;
225
237
  opacity: 0;
226
- transition: opacity 0.1s, color 0.15s, background 0.15s;
238
+ transition: opacity 0.15s, color 0.15s, background 0.15s, transform 0.15s;
239
+ box-shadow: 0 2px 6px rgba(var(--shadow-rgb), 0.26);
240
+ z-index: 2;
227
241
  }
228
242
  .notif-banner:hover .notif-banner-close { opacity: 1; }
229
243
  .notif-banner-close:hover {
230
- color: var(--text);
231
- background: rgba(255,255,255,0.12);
244
+ color: #fff;
245
+ background: rgba(42, 42, 45, 1);
246
+ transform: scale(1.08);
232
247
  }
233
248
  .notif-banner-close .lucide { width: 12px; height: 12px; }
234
249
 
@@ -236,6 +251,47 @@
236
251
  .notif-banner-update .notif-banner-icon {
237
252
  background: none;
238
253
  }
254
+ .notif-banner-update .notif-banner-project {
255
+ color: rgba(255, 255, 255, 0.98);
256
+ }
257
+ .notif-banner-auth .notif-banner-title {
258
+ white-space: normal;
259
+ }
260
+ .notif-banner-auth .notif-banner-text {
261
+ white-space: normal;
262
+ }
263
+ .notif-banner-auth .notif-banner-project {
264
+ color: rgba(255, 255, 255, 0.98);
265
+ }
266
+ .notif-banner-auth .notif-banner-title,
267
+ .notif-banner-update .notif-banner-title {
268
+ text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4);
269
+ }
270
+ .notif-banner-auth .notif-banner-actions {
271
+ margin-top: 10px;
272
+ }
273
+ .notif-banner-auth-login,
274
+ .notif-banner-new-session {
275
+ padding: 4px 10px;
276
+ border-radius: 6px;
277
+ font-size: 11px;
278
+ font-weight: 600;
279
+ font-family: inherit;
280
+ cursor: pointer;
281
+ border: none;
282
+ background: var(--accent, #6c5ce7);
283
+ color: #fff;
284
+ transition: opacity 0.15s;
285
+ }
286
+ .notif-banner-auth-login:hover,
287
+ .notif-banner-new-session:hover {
288
+ opacity: 0.85;
289
+ }
290
+ .notif-banner-auth-login:disabled,
291
+ .notif-banner-new-session:disabled {
292
+ opacity: 0.6;
293
+ cursor: default;
294
+ }
239
295
  .notif-banner-update-now {
240
296
  padding: 4px 10px;
241
297
  border-radius: 6px;
@@ -260,5 +316,9 @@
260
316
  left: 8px;
261
317
  width: auto;
262
318
  }
263
- .notif-banner-close { opacity: 1; }
319
+ .notif-banner-close {
320
+ top: -7px;
321
+ left: -7px;
322
+ }
323
+ .notif-banner:hover .notif-banner-close { opacity: 1; }
264
324
  }
@@ -1418,6 +1418,30 @@
1418
1418
  transition: background 0.15s, color 0.15s;
1419
1419
  }
1420
1420
 
1421
+ .user-island-actions button#user-theme-toggle-btn {
1422
+ color: var(--text-secondary);
1423
+ }
1424
+
1425
+ .user-island-actions button#user-theme-toggle-btn:hover {
1426
+ color: var(--text);
1427
+ }
1428
+
1429
+ .user-island-actions button#user-theme-toggle-btn.theme-toggle-light {
1430
+ color: #7b8cff;
1431
+ }
1432
+
1433
+ .user-island-actions button#user-theme-toggle-btn.theme-toggle-light:hover {
1434
+ color: #98a4ff;
1435
+ }
1436
+
1437
+ .user-island-actions button#user-theme-toggle-btn.theme-toggle-dark {
1438
+ color: #f2b84d;
1439
+ }
1440
+
1441
+ .user-island-actions button#user-theme-toggle-btn.theme-toggle-dark:hover {
1442
+ color: #ffca6b;
1443
+ }
1444
+
1421
1445
  .user-island-actions button .lucide {
1422
1446
  width: 16px;
1423
1447
  height: 16px;