clay-server 2.19.0 → 2.20.0-beta.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 (41) hide show
  1. package/README.md +51 -91
  2. package/bin/cli.js +49 -14
  3. package/lib/builtin-mates.js +360 -0
  4. package/lib/cli-sessions.js +3 -3
  5. package/lib/config.js +30 -4
  6. package/lib/daemon.js +28 -5
  7. package/lib/mates.js +169 -7
  8. package/lib/notes.js +20 -0
  9. package/lib/os-users.js +71 -2
  10. package/lib/project.js +903 -228
  11. package/lib/public/app.js +249 -69
  12. package/lib/public/css/icon-strip.css +55 -2
  13. package/lib/public/css/input.css +50 -30
  14. package/lib/public/css/mates.css +316 -2
  15. package/lib/public/css/mention.css +23 -0
  16. package/lib/public/css/mobile-nav.css +198 -0
  17. package/lib/public/css/overlays.css +23 -0
  18. package/lib/public/css/rewind.css +32 -0
  19. package/lib/public/css/title-bar.css +3 -0
  20. package/lib/public/css/user-settings.css +2 -2
  21. package/lib/public/index.html +65 -14
  22. package/lib/public/mates/ally.png +0 -0
  23. package/lib/public/mates/sage.jpg +0 -0
  24. package/lib/public/mates/scout.png +0 -0
  25. package/lib/public/modules/command-palette.js +44 -4
  26. package/lib/public/modules/filebrowser.js +2 -0
  27. package/lib/public/modules/input.js +158 -16
  28. package/lib/public/modules/mate-knowledge.js +2 -0
  29. package/lib/public/modules/mate-memory.js +353 -0
  30. package/lib/public/modules/mention.js +77 -2
  31. package/lib/public/modules/notifications.js +0 -8
  32. package/lib/public/modules/server-settings.js +11 -4
  33. package/lib/public/modules/sidebar.js +507 -21
  34. package/lib/public/modules/theme.js +10 -12
  35. package/lib/public/modules/tools.js +84 -12
  36. package/lib/public/modules/user-settings.js +45 -12
  37. package/lib/sdk-bridge.js +122 -61
  38. package/lib/server.js +209 -13
  39. package/lib/sessions.js +4 -4
  40. package/lib/users.js +89 -0
  41. package/package.json +1 -1
@@ -830,13 +830,17 @@
830
830
  border: 1px solid var(--border);
831
831
  border-radius: 12px;
832
832
  padding: 8px;
833
- width: 220px;
833
+ width: 300px;
834
+ max-height: 70vh;
835
+ overflow-y: auto;
834
836
  box-shadow: 0 8px 24px rgba(var(--shadow-rgb), 0.5);
835
837
  z-index: 10001;
836
838
  animation: ctxMenuAppear 0.15s ease-out;
837
839
  display: flex;
838
840
  flex-direction: column;
839
841
  gap: 4px;
842
+ scrollbar-width: thin;
843
+ scrollbar-color: var(--border) transparent;
840
844
  }
841
845
 
842
846
  .dm-user-picker-search {
@@ -861,11 +865,27 @@
861
865
  }
862
866
 
863
867
  .dm-user-picker-list {
864
- max-height: 200px;
868
+ overflow: visible;
869
+ }
870
+
871
+ .dm-user-picker-list.dm-mates-list {
872
+ max-height: 336px; /* ~7 items at ~48px each */
865
873
  overflow-y: auto;
866
874
  overflow-x: hidden;
867
875
  scrollbar-width: thin;
868
876
  scrollbar-color: var(--border) transparent;
877
+ mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
878
+ -webkit-mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
879
+ }
880
+
881
+ .dm-user-picker-list.dm-mates-list.scrolled-bottom {
882
+ mask-image: linear-gradient(to bottom, transparent 0%, black 35%);
883
+ -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 35%);
884
+ }
885
+
886
+ .dm-user-picker-list.dm-mates-list.no-overflow {
887
+ mask-image: none;
888
+ -webkit-mask-image: none;
869
889
  }
870
890
 
871
891
  .dm-user-picker-list::-webkit-scrollbar {
@@ -919,6 +939,39 @@
919
939
  text-align: center;
920
940
  }
921
941
 
942
+ .dm-picker-fav-btn,
943
+ .dm-picker-del-btn {
944
+ flex-shrink: 0;
945
+ border: none;
946
+ background: none;
947
+ cursor: pointer;
948
+ padding: 4px;
949
+ border-radius: 4px;
950
+ display: flex;
951
+ align-items: center;
952
+ opacity: 0.5;
953
+ transition: opacity 0.15s, color 0.15s;
954
+ }
955
+
956
+ .dm-picker-fav-btn:hover,
957
+ .dm-picker-del-btn:hover {
958
+ opacity: 1;
959
+ }
960
+
961
+ .dm-picker-del-btn:hover {
962
+ color: var(--danger, #e74c3c) !important;
963
+ }
964
+
965
+ .dm-picker-fav-btn svg,
966
+ .dm-picker-del-btn svg {
967
+ width: 16px;
968
+ height: 16px;
969
+ }
970
+
971
+ .dm-picker-fav .dm-picker-fav-btn {
972
+ opacity: 1;
973
+ }
974
+
922
975
  /* --- Worktree folder groups --- */
923
976
  .icon-strip-group {
924
977
  display: flex;
@@ -340,7 +340,8 @@
340
340
  }
341
341
 
342
342
  #attach-file-btn,
343
- #attach-image-btn {
343
+ #attach-image-btn,
344
+ #schedule-btn {
344
345
  width: 36px;
345
346
  height: 36px;
346
347
  border-radius: 50%;
@@ -356,10 +357,12 @@
356
357
  }
357
358
 
358
359
  #attach-file-btn .lucide,
359
- #attach-image-btn .lucide { width: 20px; height: 20px; }
360
+ #attach-image-btn .lucide,
361
+ #schedule-btn .lucide { width: 20px; height: 20px; flex-shrink: 0; }
360
362
 
361
363
  #attach-file-btn:hover,
362
- #attach-image-btn:hover { background: rgba(var(--overlay-rgb), 0.06); color: var(--text); }
364
+ #attach-image-btn:hover,
365
+ #schedule-btn:hover { background: rgba(var(--overlay-rgb), 0.06); color: var(--text); }
363
366
 
364
367
  #send-btn {
365
368
  flex-shrink: 0;
@@ -668,52 +671,69 @@
668
671
  }
669
672
 
670
673
  /* ==========================================================================
671
- Rate Limit Schedule Mode
674
+ Message Scheduling
672
675
  ========================================================================== */
673
676
 
674
- /* Input area styling when rate limited */
675
- #input-row.input-rate-limited {
676
- border-color: var(--warning, #d97706);
677
- box-shadow: 0 0 0 1px color-mix(in srgb, var(--warning, #d97706) 20%, transparent);
677
+ /* Schedule button inline expand (like STT pill) */
678
+ #schedule-btn {
679
+ transition: width 0.2s ease, border-radius 0.2s ease, background 0.15s, color 0.15s, padding 0.2s ease;
680
+ overflow: hidden;
681
+ white-space: nowrap;
682
+ gap: 6px;
683
+ position: relative;
678
684
  }
679
685
 
680
- #input-row.input-rate-limited:focus-within {
681
- border-color: var(--warning, #d97706);
682
- box-shadow: 0 0 0 1px color-mix(in srgb, var(--warning, #d97706) 30%, transparent);
686
+ #schedule-btn.schedule-expanded {
687
+ width: auto;
688
+ padding: 0 10px 0 8px;
689
+ border-radius: 18px;
683
690
  }
684
691
 
685
- /* Scheduled message bubble in chat */
686
- .scheduled-msg-wrap {
687
- display: flex;
688
- justify-content: flex-end;
689
- padding: 4px 16px;
692
+ #schedule-btn.schedule-active {
693
+ color: var(--accent);
694
+ background: var(--accent-bg, rgba(99,102,241,0.15));
695
+ }
696
+
697
+ .schedule-inline-input {
698
+ width: 48px;
699
+ padding: 2px 4px;
700
+ border: 1px solid var(--border);
701
+ border-radius: 6px;
702
+ background: var(--bg);
703
+ color: var(--text);
704
+ font-size: 12px;
705
+ text-align: center;
706
+ outline: none;
707
+ }
708
+ .schedule-inline-input:focus {
709
+ border-color: var(--accent);
690
710
  }
691
711
 
692
- .scheduled-msg-bubble {
693
- max-width: 75%;
694
- padding: 10px 14px;
695
- border-radius: 12px;
696
- background: color-mix(in srgb, var(--warning, #d97706) 8%, var(--bg-alt));
697
- border: 1px dashed color-mix(in srgb, var(--warning, #d97706) 40%, transparent);
712
+ .schedule-delay-label {
713
+ font-size: 12px;
714
+ font-weight: 600;
715
+ color: inherit;
698
716
  }
699
717
 
700
- .scheduled-msg-text {
701
- font-size: 14px;
702
- color: var(--text);
703
- line-height: 1.5;
704
- white-space: pre-wrap;
705
- word-break: break-word;
718
+ /* Scheduled message bubble: accent-tinted user bubble */
719
+ .scheduled-msg-wrap .bubble {
720
+ background: color-mix(in srgb, var(--accent) 18%, var(--user-bubble, var(--bg-alt)));
721
+ border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
706
722
  }
707
723
 
724
+ .scheduled-msg-wrap .msg-user-rewind-btn,
725
+ .scheduled-msg-wrap .msg-actions { display: none !important; }
726
+
708
727
  .scheduled-msg-meta {
709
728
  display: flex;
710
729
  align-items: center;
711
730
  gap: 6px;
712
- margin-top: 8px;
731
+ padding-right: 4px;
713
732
  font-size: 12px;
714
- color: var(--warning, #d97706);
733
+ color: var(--accent);
715
734
  }
716
735
 
736
+ .scheduled-msg-icon svg,
717
737
  .scheduled-msg-icon .lucide {
718
738
  width: 14px;
719
739
  height: 14px;
@@ -22,7 +22,7 @@
22
22
  }
23
23
 
24
24
  .title-bar-content.mate-dm-active .status,
25
- .title-bar-content.mate-dm-active .status * {
25
+ .title-bar-content.mate-dm-active .status *:not(.rate-limit-popover) {
26
26
  color: rgba(255, 255, 255, 0.85) !important;
27
27
  }
28
28
 
@@ -966,6 +966,7 @@ body.mate-dm-active #layout.sidebar-collapsed .mate-collapsed-info {
966
966
 
967
967
  /* Sidebar file list */
968
968
  #mate-sidebar-knowledge.hidden,
969
+ #mate-sidebar-memory.hidden,
969
970
  #mate-sidebar-conversations.hidden {
970
971
  display: none;
971
972
  }
@@ -1139,6 +1140,312 @@ body.mate-dm-active #layout.sidebar-collapsed .mate-collapsed-info {
1139
1140
  color: var(--text-dimmer);
1140
1141
  }
1141
1142
 
1143
+ /* --- Memory panel --- */
1144
+ /* Memory viewer */
1145
+ @media (min-width: 1024px) {
1146
+ #mate-memory-viewer {
1147
+ width: 50%;
1148
+ max-width: 720px;
1149
+ min-width: 360px;
1150
+ border-left: 1px solid var(--border-subtle);
1151
+ display: flex;
1152
+ flex-direction: column;
1153
+ overflow: hidden;
1154
+ flex-shrink: 0;
1155
+ }
1156
+ #mate-memory-viewer.hidden { display: none; }
1157
+ }
1158
+ @media (max-width: 1023px) {
1159
+ #mate-memory-viewer {
1160
+ position: fixed;
1161
+ inset: 0;
1162
+ background: var(--bg);
1163
+ z-index: 1100;
1164
+ display: flex;
1165
+ flex-direction: column;
1166
+ overflow: hidden;
1167
+ }
1168
+ #mate-memory-viewer.hidden { display: none; }
1169
+ }
1170
+ .mate-memory-viewer-header {
1171
+ display: flex;
1172
+ align-items: center;
1173
+ gap: 8px;
1174
+ padding: 0 12px;
1175
+ border-bottom: none;
1176
+ flex-shrink: 0;
1177
+ min-height: 44px;
1178
+ }
1179
+ .mate-memory-danger-btn:hover {
1180
+ color: var(--error, #ff5555) !important;
1181
+ }
1182
+
1183
+ /* Tabs */
1184
+ .mate-memory-viewer-tabs {
1185
+ display: flex;
1186
+ gap: 0;
1187
+ padding: 0 12px;
1188
+ border-bottom: 1px solid var(--border-subtle);
1189
+ flex-shrink: 0;
1190
+ }
1191
+ .mate-memory-tab {
1192
+ padding: 8px 16px;
1193
+ font-size: 13px;
1194
+ font-weight: 500;
1195
+ color: var(--text-dimmer);
1196
+ background: none;
1197
+ border: none;
1198
+ border-bottom: 2px solid transparent;
1199
+ cursor: pointer;
1200
+ transition: color 0.15s, border-color 0.15s;
1201
+ }
1202
+ .mate-memory-tab:hover {
1203
+ color: var(--text-secondary);
1204
+ }
1205
+ .mate-memory-tab.active {
1206
+ color: var(--text);
1207
+ border-bottom-color: var(--accent, #6c5ce7);
1208
+ font-weight: 600;
1209
+ }
1210
+
1211
+ /* Tab bodies */
1212
+ .mate-memory-tab-body {
1213
+ flex: 1;
1214
+ overflow-y: auto;
1215
+ padding: 16px;
1216
+ }
1217
+ .mate-memory-tab-body.hidden {
1218
+ display: none;
1219
+ }
1220
+
1221
+ /* Summary tab */
1222
+ #mate-memory-summary-content h1 {
1223
+ font-size: 18px;
1224
+ font-weight: 700;
1225
+ margin: 0 0 12px;
1226
+ color: var(--text);
1227
+ }
1228
+ #mate-memory-summary-content h2 {
1229
+ font-size: 14px;
1230
+ font-weight: 600;
1231
+ margin: 16px 0 8px;
1232
+ color: var(--text);
1233
+ }
1234
+ #mate-memory-summary-content ul {
1235
+ margin: 0 0 8px;
1236
+ padding-left: 20px;
1237
+ }
1238
+ #mate-memory-summary-content li {
1239
+ font-size: 13px;
1240
+ color: var(--text-secondary);
1241
+ line-height: 1.6;
1242
+ margin-bottom: 2px;
1243
+ }
1244
+
1245
+ /* Digest list */
1246
+ .mate-memory-digest-list {
1247
+ display: flex;
1248
+ flex-direction: column;
1249
+ gap: 2px;
1250
+ }
1251
+ .mate-memory-digest-list.hidden {
1252
+ display: none;
1253
+ }
1254
+ .mate-memory-item {
1255
+ display: flex;
1256
+ flex-direction: column;
1257
+ gap: 2px;
1258
+ padding: 10px 12px;
1259
+ border-radius: 8px;
1260
+ cursor: pointer;
1261
+ transition: background 0.12s;
1262
+ }
1263
+ .mate-memory-item:hover {
1264
+ background: rgba(var(--overlay-rgb), 0.05);
1265
+ }
1266
+ .mate-memory-item-top {
1267
+ display: flex;
1268
+ align-items: center;
1269
+ gap: 6px;
1270
+ }
1271
+ .mate-memory-date {
1272
+ font-size: 11px;
1273
+ color: var(--text-dimmer);
1274
+ }
1275
+ .mate-memory-type-badge {
1276
+ font-size: 9px;
1277
+ text-transform: uppercase;
1278
+ letter-spacing: 0.5px;
1279
+ padding: 1px 5px;
1280
+ border-radius: 3px;
1281
+ background: rgba(var(--overlay-rgb), 0.08);
1282
+ color: var(--text-dimmer);
1283
+ }
1284
+ .mate-memory-tag {
1285
+ font-size: 9px;
1286
+ padding: 1px 5px;
1287
+ border-radius: 3px;
1288
+ background: rgba(var(--accent-rgb, 108, 92, 231), 0.1);
1289
+ color: var(--accent, #6c5ce7);
1290
+ }
1291
+ .mate-memory-delete-btn {
1292
+ margin-left: auto;
1293
+ background: none;
1294
+ border: none;
1295
+ color: var(--text-dimmer);
1296
+ cursor: pointer;
1297
+ padding: 2px;
1298
+ display: none;
1299
+ align-items: center;
1300
+ }
1301
+ .mate-memory-delete-btn svg { width: 13px; height: 13px; }
1302
+ .mate-memory-item:hover .mate-memory-delete-btn { display: flex; }
1303
+ .mate-memory-delete-btn:hover { color: var(--error, #ff5555); }
1304
+ .mate-memory-topic {
1305
+ font-size: 13px;
1306
+ font-weight: 600;
1307
+ color: var(--text);
1308
+ white-space: nowrap;
1309
+ overflow: hidden;
1310
+ text-overflow: ellipsis;
1311
+ }
1312
+ .mate-memory-position {
1313
+ font-size: 12px;
1314
+ color: var(--text-secondary);
1315
+ white-space: nowrap;
1316
+ overflow: hidden;
1317
+ text-overflow: ellipsis;
1318
+ }
1319
+ .mate-memory-empty {
1320
+ padding: 24px 12px;
1321
+ text-align: center;
1322
+ font-size: 13px;
1323
+ color: var(--text-dimmer);
1324
+ line-height: 1.6;
1325
+ }
1326
+
1327
+ /* Digest detail view */
1328
+ .mate-memory-digest-detail {
1329
+ display: flex;
1330
+ flex-direction: column;
1331
+ }
1332
+ .mate-memory-digest-detail.hidden {
1333
+ display: none;
1334
+ }
1335
+ .mate-memory-detail-header {
1336
+ display: flex;
1337
+ align-items: center;
1338
+ gap: 8px;
1339
+ padding-bottom: 12px;
1340
+ margin-bottom: 12px;
1341
+ border-bottom: 1px solid var(--border-subtle);
1342
+ }
1343
+ .mate-memory-detail-back {
1344
+ display: flex;
1345
+ align-items: center;
1346
+ gap: 4px;
1347
+ background: none;
1348
+ border: none;
1349
+ color: var(--text-secondary);
1350
+ cursor: pointer;
1351
+ font-size: 13px;
1352
+ padding: 4px 8px;
1353
+ border-radius: 6px;
1354
+ transition: background 0.12s;
1355
+ }
1356
+ .mate-memory-detail-back:hover {
1357
+ background: rgba(var(--overlay-rgb), 0.06);
1358
+ color: var(--text);
1359
+ }
1360
+ .mate-memory-detail-back svg { width: 14px; height: 14px; }
1361
+ .mate-memory-detail-delete {
1362
+ background: none;
1363
+ border: none;
1364
+ color: var(--text-dimmer);
1365
+ cursor: pointer;
1366
+ padding: 4px;
1367
+ display: flex;
1368
+ align-items: center;
1369
+ }
1370
+ .mate-memory-detail-delete svg { width: 15px; height: 15px; }
1371
+ .mate-memory-detail-body {
1372
+ padding: 0 4px;
1373
+ }
1374
+
1375
+ /* Memory detail fields */
1376
+ .mate-memory-detail {
1377
+ margin-bottom: 16px;
1378
+ }
1379
+ .mate-memory-detail-label {
1380
+ font-size: 10px;
1381
+ text-transform: uppercase;
1382
+ letter-spacing: 0.8px;
1383
+ color: var(--text-dimmer);
1384
+ margin-bottom: 4px;
1385
+ font-weight: 600;
1386
+ }
1387
+ .mate-memory-detail-value {
1388
+ font-size: 14px;
1389
+ color: var(--text);
1390
+ line-height: 1.5;
1391
+ white-space: pre-wrap;
1392
+ }
1393
+
1394
+ /* Memory delete confirmation */
1395
+ .mate-memory-confirm-overlay {
1396
+ position: fixed;
1397
+ inset: 0;
1398
+ background: rgba(0,0,0,0.5);
1399
+ z-index: 9999;
1400
+ display: flex;
1401
+ align-items: center;
1402
+ justify-content: center;
1403
+ }
1404
+ .mate-memory-confirm-dialog {
1405
+ background: var(--bg);
1406
+ border: 1px solid var(--border-subtle);
1407
+ border-radius: 10px;
1408
+ padding: 20px 24px;
1409
+ min-width: 260px;
1410
+ box-shadow: 0 8px 32px rgba(0,0,0,0.3);
1411
+ }
1412
+ .mate-memory-confirm-msg {
1413
+ font-size: 14px;
1414
+ color: var(--text);
1415
+ margin-bottom: 16px;
1416
+ text-align: center;
1417
+ }
1418
+ .mate-memory-confirm-actions {
1419
+ display: flex;
1420
+ gap: 8px;
1421
+ justify-content: flex-end;
1422
+ }
1423
+ .mate-memory-confirm-cancel {
1424
+ padding: 6px 16px;
1425
+ border-radius: 6px;
1426
+ border: 1px solid var(--border-subtle);
1427
+ background: none;
1428
+ color: var(--text);
1429
+ cursor: pointer;
1430
+ font-size: 13px;
1431
+ }
1432
+ .mate-memory-confirm-cancel:hover {
1433
+ background: rgba(var(--overlay-rgb), 0.06);
1434
+ }
1435
+ .mate-memory-confirm-delete {
1436
+ padding: 6px 16px;
1437
+ border-radius: 6px;
1438
+ border: none;
1439
+ background: var(--error, #ff5555);
1440
+ color: #fff;
1441
+ cursor: pointer;
1442
+ font-size: 13px;
1443
+ font-weight: 600;
1444
+ }
1445
+ .mate-memory-confirm-delete:hover {
1446
+ opacity: 0.85;
1447
+ }
1448
+
1142
1449
  /* Active file name in editor toolbar */
1143
1450
  .mate-knowledge-active-name {
1144
1451
  font-size: 14px;
@@ -1633,6 +1940,7 @@ body.mate-dm-active #layout.sidebar-collapsed .mate-collapsed-info {
1633
1940
  /* Match panel header heights to sidebar header (48px) */
1634
1941
  body.mate-dm-active .mate-knowledge-header-bar,
1635
1942
  body.mate-dm-active .mate-knowledge-viewer-header,
1943
+ body.mate-dm-active .mate-memory-viewer-header,
1636
1944
  body.mate-dm-active .scheduler-top-bar,
1637
1945
  body.mate-dm-active .notes-archive-header {
1638
1946
  height: 48px;
@@ -2130,11 +2438,17 @@ body.mate-dm-active .context-overflow-msg,
2130
2438
  body.mate-dm-active .sys-msg {
2131
2439
  display: none;
2132
2440
  }
2133
- body.mate-dm-active .activity-inline:not(.mention-activity-bar) {
2441
+ body.mate-dm-active .activity-inline:not(.mention-activity-bar):not(.mate-pre-activity):not(.mate-thinking-activity) {
2134
2442
  padding-left: 60px;
2135
2443
  margin-left: 0;
2136
2444
  margin-right: 0;
2137
2445
  }
2446
+ .mate-thinking > .dm-bubble-content > .mate-thinking-activity,
2447
+ .mate-thinking > .dm-bubble-content > .mate-pre-activity {
2448
+ margin: 4px 0 0;
2449
+ padding: 0;
2450
+ max-width: none;
2451
+ }
2138
2452
 
2139
2453
  /* ==========================================================================
2140
2454
  Mobile Mate DM Title Bar
@@ -163,6 +163,29 @@
163
163
  color: var(--mention-color, #6c5ce7);
164
164
  }
165
165
 
166
+ .mention-stop-btn {
167
+ margin-left: auto;
168
+ background: none;
169
+ border: 1px solid var(--border, #333);
170
+ border-radius: 4px;
171
+ color: var(--text-secondary, #aaa);
172
+ cursor: pointer;
173
+ padding: 2px 6px;
174
+ display: flex;
175
+ align-items: center;
176
+ gap: 4px;
177
+ font-size: 12px;
178
+ transition: color 0.15s, border-color 0.15s;
179
+ }
180
+ .mention-stop-btn:hover {
181
+ color: var(--danger, #e74c3c);
182
+ border-color: var(--danger, #e74c3c);
183
+ }
184
+ .mention-stop-btn svg {
185
+ width: 12px;
186
+ height: 12px;
187
+ }
188
+
166
189
  .mention-content {
167
190
  font-size: 15px;
168
191
  line-height: 1.7;