clay-server 2.13.0-beta.7 → 2.13.0-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/public/app.js +74 -2
- package/lib/public/css/mates.css +107 -0
- package/package.json +1 -1
package/lib/public/app.js
CHANGED
|
@@ -634,6 +634,13 @@ import { initCommandPalette, handlePaletteSessionSwitch, setPaletteVersion } fro
|
|
|
634
634
|
var mateColor = (targetUser.profile && targetUser.profile.avatarColor) || targetUser.avatarColor || "#7c3aed";
|
|
635
635
|
document.body.style.setProperty("--mate-color", mateColor);
|
|
636
636
|
document.body.classList.add("mate-dm-active");
|
|
637
|
+
// Build mate avatar URL for DM bubble injection
|
|
638
|
+
var mp = targetUser.profile || {};
|
|
639
|
+
var mateAvatarUrl = "https://api.dicebear.com/9.x/" + (mp.avatarStyle || targetUser.avatarStyle || "bottts") + "/svg?seed=" + encodeURIComponent(mp.avatarSeed || targetUser.avatarSeed || targetUser.id) + "&size=36";
|
|
640
|
+
var myUser = cachedAllUsers.find(function (u) { return u.id === myUserId; });
|
|
641
|
+
var myAvatarUrl = "https://api.dicebear.com/9.x/" + ((myUser && myUser.avatarStyle) || "thumbs") + "/svg?seed=" + encodeURIComponent((myUser && (myUser.avatarSeed || myUser.username)) || myUserId) + "&size=36";
|
|
642
|
+
document.body.dataset.mateAvatarUrl = mateAvatarUrl;
|
|
643
|
+
document.body.dataset.myAvatarUrl = myAvatarUrl;
|
|
637
644
|
var titleBarContent = document.querySelector(".title-bar-content");
|
|
638
645
|
if (titleBarContent) {
|
|
639
646
|
titleBarContent.style.background = mateColor;
|
|
@@ -720,6 +727,11 @@ import { initCommandPalette, handlePaletteSessionSwitch, setPaletteVersion } fro
|
|
|
720
727
|
// Reset chat title bar and mate color
|
|
721
728
|
document.body.style.removeProperty("--mate-color");
|
|
722
729
|
document.body.classList.remove("mate-dm-active");
|
|
730
|
+
delete document.body.dataset.mateAvatarUrl;
|
|
731
|
+
delete document.body.dataset.myAvatarUrl;
|
|
732
|
+
// Remove injected DM bubble avatars
|
|
733
|
+
var bubbleAvatars = messagesEl.querySelectorAll(".dm-bubble-avatar");
|
|
734
|
+
for (var ba = 0; ba < bubbleAvatars.length; ba++) bubbleAvatars[ba].remove();
|
|
723
735
|
var titleBarContent = document.querySelector(".title-bar-content");
|
|
724
736
|
if (titleBarContent) {
|
|
725
737
|
titleBarContent.style.background = "";
|
|
@@ -2547,7 +2559,34 @@ import { initCommandPalette, handlePaletteSessionSwitch, setPaletteVersion } fro
|
|
|
2547
2559
|
}
|
|
2548
2560
|
|
|
2549
2561
|
|
|
2550
|
-
|
|
2562
|
+
// Mate DM: wrap avatar + header + bubble in DM-like layout
|
|
2563
|
+
if (document.body.classList.contains("mate-dm-active") && document.body.dataset.myAvatarUrl) {
|
|
2564
|
+
var avi = document.createElement("img");
|
|
2565
|
+
avi.className = "dm-bubble-avatar dm-bubble-avatar-me";
|
|
2566
|
+
avi.src = document.body.dataset.myAvatarUrl;
|
|
2567
|
+
div.appendChild(avi);
|
|
2568
|
+
|
|
2569
|
+
var contentWrap = document.createElement("div");
|
|
2570
|
+
contentWrap.className = "dm-bubble-content";
|
|
2571
|
+
|
|
2572
|
+
var header = document.createElement("div");
|
|
2573
|
+
header.className = "dm-bubble-header";
|
|
2574
|
+
var myU = cachedAllUsers.find(function (u) { return u.id === myUserId; });
|
|
2575
|
+
var nameSpan = document.createElement("span");
|
|
2576
|
+
nameSpan.className = "dm-bubble-name";
|
|
2577
|
+
nameSpan.textContent = myU ? myU.displayName : "Me";
|
|
2578
|
+
header.appendChild(nameSpan);
|
|
2579
|
+
var timeSpan = document.createElement("span");
|
|
2580
|
+
timeSpan.className = "dm-bubble-time";
|
|
2581
|
+
var nowH = new Date();
|
|
2582
|
+
timeSpan.textContent = String(nowH.getHours()).padStart(2, "0") + ":" + String(nowH.getMinutes()).padStart(2, "0");
|
|
2583
|
+
header.appendChild(timeSpan);
|
|
2584
|
+
contentWrap.appendChild(header);
|
|
2585
|
+
contentWrap.appendChild(bubble);
|
|
2586
|
+
div.appendChild(contentWrap);
|
|
2587
|
+
} else {
|
|
2588
|
+
div.appendChild(bubble);
|
|
2589
|
+
}
|
|
2551
2590
|
|
|
2552
2591
|
// Action bar below bubble (icons visible on hover)
|
|
2553
2592
|
var actions = document.createElement("div");
|
|
@@ -2581,7 +2620,40 @@ import { initCommandPalette, handlePaletteSessionSwitch, setPaletteVersion } fro
|
|
|
2581
2620
|
currentMsgEl = document.createElement("div");
|
|
2582
2621
|
currentMsgEl.className = "msg-assistant";
|
|
2583
2622
|
currentMsgEl.dataset.turn = turnCounter;
|
|
2584
|
-
|
|
2623
|
+
// Inject mate avatar + header for DM bubble style
|
|
2624
|
+
if (document.body.classList.contains("mate-dm-active") && document.body.dataset.mateAvatarUrl) {
|
|
2625
|
+
var avi = document.createElement("img");
|
|
2626
|
+
avi.className = "dm-bubble-avatar dm-bubble-avatar-mate";
|
|
2627
|
+
avi.src = document.body.dataset.mateAvatarUrl;
|
|
2628
|
+
currentMsgEl.appendChild(avi);
|
|
2629
|
+
|
|
2630
|
+
var contentWrap = document.createElement("div");
|
|
2631
|
+
contentWrap.className = "dm-bubble-content";
|
|
2632
|
+
|
|
2633
|
+
var header = document.createElement("div");
|
|
2634
|
+
header.className = "dm-bubble-header";
|
|
2635
|
+
var nameSpan = document.createElement("span");
|
|
2636
|
+
nameSpan.className = "dm-bubble-name";
|
|
2637
|
+
nameSpan.textContent = (dmTargetUser && dmTargetUser.displayName) || "Mate";
|
|
2638
|
+
header.appendChild(nameSpan);
|
|
2639
|
+
var timeSpan = document.createElement("span");
|
|
2640
|
+
timeSpan.className = "dm-bubble-time";
|
|
2641
|
+
var nowA = new Date();
|
|
2642
|
+
timeSpan.textContent = String(nowA.getHours()).padStart(2, "0") + ":" + String(nowA.getMinutes()).padStart(2, "0");
|
|
2643
|
+
header.appendChild(timeSpan);
|
|
2644
|
+
contentWrap.appendChild(header);
|
|
2645
|
+
|
|
2646
|
+
var mdDiv = document.createElement("div");
|
|
2647
|
+
mdDiv.className = "md-content";
|
|
2648
|
+
mdDiv.dir = "auto";
|
|
2649
|
+
contentWrap.appendChild(mdDiv);
|
|
2650
|
+
currentMsgEl.appendChild(contentWrap);
|
|
2651
|
+
} else {
|
|
2652
|
+
var mdDiv = document.createElement("div");
|
|
2653
|
+
mdDiv.className = "md-content";
|
|
2654
|
+
mdDiv.dir = "auto";
|
|
2655
|
+
currentMsgEl.appendChild(mdDiv);
|
|
2656
|
+
}
|
|
2585
2657
|
addToMessages(currentMsgEl);
|
|
2586
2658
|
currentFullText = "";
|
|
2587
2659
|
}
|
package/lib/public/css/mates.css
CHANGED
|
@@ -1216,3 +1216,110 @@ body.mate-dm-active .notes-archive-header button:hover {
|
|
|
1216
1216
|
color: #fff;
|
|
1217
1217
|
background: rgba(255, 255, 255, 0.15);
|
|
1218
1218
|
}
|
|
1219
|
+
|
|
1220
|
+
/* ==========================================================================
|
|
1221
|
+
Mate DM: Chat bubble style (messenger feel)
|
|
1222
|
+
========================================================================== */
|
|
1223
|
+
|
|
1224
|
+
/* --- Avatar (injected by JS into .msg-user / .msg-assistant) --- */
|
|
1225
|
+
.dm-bubble-avatar {
|
|
1226
|
+
width: 36px;
|
|
1227
|
+
height: 36px;
|
|
1228
|
+
border-radius: 6px;
|
|
1229
|
+
flex-shrink: 0;
|
|
1230
|
+
display: none;
|
|
1231
|
+
object-fit: cover;
|
|
1232
|
+
margin-top: 2px;
|
|
1233
|
+
}
|
|
1234
|
+
body.mate-dm-active .dm-bubble-avatar {
|
|
1235
|
+
display: block;
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
/* --- DM bubble header (name + time) --- */
|
|
1239
|
+
.dm-bubble-content {
|
|
1240
|
+
flex: 1;
|
|
1241
|
+
min-width: 0;
|
|
1242
|
+
}
|
|
1243
|
+
.dm-bubble-header {
|
|
1244
|
+
display: flex;
|
|
1245
|
+
align-items: baseline;
|
|
1246
|
+
gap: 8px;
|
|
1247
|
+
}
|
|
1248
|
+
.dm-bubble-name {
|
|
1249
|
+
font-weight: 700;
|
|
1250
|
+
font-size: 15px;
|
|
1251
|
+
color: var(--text);
|
|
1252
|
+
}
|
|
1253
|
+
.dm-bubble-time {
|
|
1254
|
+
font-size: 12px;
|
|
1255
|
+
color: var(--text-dimmer);
|
|
1256
|
+
}
|
|
1257
|
+
|
|
1258
|
+
/* --- Shared: Slack-style flat layout for both user & assistant --- */
|
|
1259
|
+
body.mate-dm-active .msg-user,
|
|
1260
|
+
body.mate-dm-active .msg-assistant {
|
|
1261
|
+
display: flex;
|
|
1262
|
+
flex-direction: row;
|
|
1263
|
+
align-items: flex-start;
|
|
1264
|
+
gap: 8px;
|
|
1265
|
+
max-width: 100%;
|
|
1266
|
+
padding: 4px 16px;
|
|
1267
|
+
margin: 0;
|
|
1268
|
+
border-radius: 0;
|
|
1269
|
+
}
|
|
1270
|
+
body.mate-dm-active .msg-user:hover,
|
|
1271
|
+
body.mate-dm-active .msg-assistant:hover {
|
|
1272
|
+
background: var(--bg-alt);
|
|
1273
|
+
}
|
|
1274
|
+
|
|
1275
|
+
/* --- User messages --- */
|
|
1276
|
+
body.mate-dm-active .msg-user {
|
|
1277
|
+
justify-content: flex-start; /* left-aligned like DM */
|
|
1278
|
+
}
|
|
1279
|
+
body.mate-dm-active .msg-user .dm-bubble-avatar-me {
|
|
1280
|
+
order: -1; /* avatar first (left) */
|
|
1281
|
+
}
|
|
1282
|
+
body.mate-dm-active .msg-user .bubble {
|
|
1283
|
+
background: none;
|
|
1284
|
+
border-radius: 0;
|
|
1285
|
+
padding: 0;
|
|
1286
|
+
max-width: 100%;
|
|
1287
|
+
font-size: 15px;
|
|
1288
|
+
line-height: 1.46;
|
|
1289
|
+
white-space: pre-wrap;
|
|
1290
|
+
word-wrap: break-word;
|
|
1291
|
+
}
|
|
1292
|
+
body.mate-dm-active .msg-user .msg-actions {
|
|
1293
|
+
display: none;
|
|
1294
|
+
}
|
|
1295
|
+
|
|
1296
|
+
/* --- Assistant messages --- */
|
|
1297
|
+
body.mate-dm-active .msg-assistant .dm-bubble-content {
|
|
1298
|
+
flex: 1;
|
|
1299
|
+
min-width: 0;
|
|
1300
|
+
}
|
|
1301
|
+
body.mate-dm-active .msg-assistant .md-content {
|
|
1302
|
+
background: none;
|
|
1303
|
+
border-radius: 0;
|
|
1304
|
+
padding: 0;
|
|
1305
|
+
}
|
|
1306
|
+
|
|
1307
|
+
/* Hide turn meta in mate DM */
|
|
1308
|
+
body.mate-dm-active .turn-meta {
|
|
1309
|
+
display: none;
|
|
1310
|
+
}
|
|
1311
|
+
|
|
1312
|
+
/* --- Interstitial elements: indent to align with message content (16px pad + 36px avatar + 8px gap = 60px) --- */
|
|
1313
|
+
body.mate-dm-active .thinking-item,
|
|
1314
|
+
body.mate-dm-active .tool-item,
|
|
1315
|
+
body.mate-dm-active .tool-group,
|
|
1316
|
+
body.mate-dm-active .plan-card,
|
|
1317
|
+
body.mate-dm-active .permission-container,
|
|
1318
|
+
body.mate-dm-active .ask-user-container,
|
|
1319
|
+
body.mate-dm-active .subagent-log,
|
|
1320
|
+
body.mate-dm-active .conflict-msg,
|
|
1321
|
+
body.mate-dm-active .context-overflow-msg,
|
|
1322
|
+
body.mate-dm-active .sys-msg,
|
|
1323
|
+
body.mate-dm-active .activity-inline {
|
|
1324
|
+
padding-left: 60px;
|
|
1325
|
+
}
|