clay-server 3.7.0 → 3.8.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.
- package/lib/builtin-mates.js +14 -14
- package/lib/mates.js +2 -6
- package/lib/os-users.js +17 -1
- package/lib/project-http.js +34 -1
- package/lib/project-image.js +87 -1
- package/lib/project-mate-interaction.js +7 -7
- package/lib/project-sessions.js +1 -1
- package/lib/project-user-mention.js +4 -4
- package/lib/project.js +6 -4
- package/lib/public/css/avatar-imprints.css +46 -0
- package/lib/public/css/generated-images.css +242 -0
- package/lib/public/css/icon-strip.css +3 -3
- package/lib/public/css/profile.css +123 -95
- package/lib/public/css/session-actions.css +40 -9
- package/lib/public/css/user-settings.css +1 -1
- package/lib/public/index.html +3 -3
- package/lib/public/modules/app-cursors.js +2 -2
- package/lib/public/modules/app-dm.js +1 -8
- package/lib/public/modules/app-messages.js +2 -2
- package/lib/public/modules/app-projects.js +7 -6
- package/lib/public/modules/app-rate-limit.js +0 -1
- package/lib/public/modules/app-rendering.js +0 -3
- package/lib/public/modules/avatar-imprint.js +134 -0
- package/lib/public/modules/avatar.js +25 -19
- package/lib/public/modules/debate.js +10 -5
- package/lib/public/modules/generated-images.js +211 -2
- package/lib/public/modules/mate-sidebar.js +2 -2
- package/lib/public/modules/mention.js +26 -16
- package/lib/public/modules/profile.js +73 -190
- package/lib/public/modules/session-actions.js +5 -3
- package/lib/public/modules/sidebar-mates.js +5 -4
- package/lib/public/modules/sidebar-sessions.js +1 -1
- package/lib/public/style.css +2 -1
- package/lib/server-auth.js +2 -2
- package/lib/server-dm.js +8 -8
- package/lib/server-mates.js +3 -3
- package/lib/server-settings.js +2 -2
- package/lib/server.js +5 -4
- package/lib/users.js +4 -4
- package/package.json +1 -1
package/lib/server-dm.js
CHANGED
|
@@ -28,9 +28,9 @@ function attachDm(ctx) {
|
|
|
28
28
|
id: otherUser.id,
|
|
29
29
|
displayName: p.name || otherUser.displayName || otherUser.username,
|
|
30
30
|
username: otherUser.username,
|
|
31
|
-
avatarStyle: p.avatarStyle || "
|
|
31
|
+
avatarStyle: p.avatarStyle || "imprint",
|
|
32
32
|
avatarSeed: p.avatarSeed || otherUser.username,
|
|
33
|
-
avatarColor: p.avatarColor || "#
|
|
33
|
+
avatarColor: p.avatarColor || "#5857fc",
|
|
34
34
|
avatarCustom: p.avatarCustom || "",
|
|
35
35
|
};
|
|
36
36
|
}
|
|
@@ -69,9 +69,9 @@ function attachDm(ctx) {
|
|
|
69
69
|
id: mate.id,
|
|
70
70
|
displayName: mp.displayName || mate.name || "New Mate",
|
|
71
71
|
username: mate.id,
|
|
72
|
-
avatarStyle: mp.avatarStyle || "
|
|
72
|
+
avatarStyle: mp.avatarStyle || "imprint",
|
|
73
73
|
avatarSeed: mp.avatarSeed || mate.id,
|
|
74
|
-
avatarColor: mp.avatarColor || "#
|
|
74
|
+
avatarColor: mp.avatarColor || "#5857fc",
|
|
75
75
|
avatarCustom: mp.avatarCustom || "",
|
|
76
76
|
isMate: true,
|
|
77
77
|
primary: !!mate.primary,
|
|
@@ -94,9 +94,9 @@ function attachDm(ctx) {
|
|
|
94
94
|
id: targetUser.id,
|
|
95
95
|
displayName: tp.name || targetUser.displayName || targetUser.username,
|
|
96
96
|
username: targetUser.username,
|
|
97
|
-
avatarStyle: tp.avatarStyle || "
|
|
97
|
+
avatarStyle: tp.avatarStyle || "imprint",
|
|
98
98
|
avatarSeed: tp.avatarSeed || targetUser.username,
|
|
99
|
-
avatarColor: tp.avatarColor || "#
|
|
99
|
+
avatarColor: tp.avatarColor || "#5857fc",
|
|
100
100
|
avatarCustom: tp.avatarCustom || "",
|
|
101
101
|
} : null,
|
|
102
102
|
}));
|
|
@@ -191,9 +191,9 @@ function attachDm(ctx) {
|
|
|
191
191
|
displayName: p.name || u.displayName || u.username,
|
|
192
192
|
username: u.username,
|
|
193
193
|
role: u.role,
|
|
194
|
-
avatarStyle: p.avatarStyle || "
|
|
194
|
+
avatarStyle: p.avatarStyle || "imprint",
|
|
195
195
|
avatarSeed: p.avatarSeed || u.username,
|
|
196
|
-
avatarColor: p.avatarColor || "#
|
|
196
|
+
avatarColor: p.avatarColor || "#5857fc",
|
|
197
197
|
avatarCustom: p.avatarCustom || "",
|
|
198
198
|
};
|
|
199
199
|
});
|
package/lib/server-mates.js
CHANGED
|
@@ -152,7 +152,7 @@ function attachMates(ctx) {
|
|
|
152
152
|
displayName: bDef2.displayName,
|
|
153
153
|
bio: bDef2.bio,
|
|
154
154
|
avatarCustom: bDef2.avatarCustom || "",
|
|
155
|
-
avatarStyle: bDef2.avatarStyle || "
|
|
155
|
+
avatarStyle: bDef2.avatarStyle || "imprint",
|
|
156
156
|
avatarColor: bDef2.avatarColor || "",
|
|
157
157
|
});
|
|
158
158
|
}
|
|
@@ -186,7 +186,7 @@ function attachMates(ctx) {
|
|
|
186
186
|
displayName: bDef3.displayName,
|
|
187
187
|
bio: bDef3.bio,
|
|
188
188
|
avatarCustom: bDef3.avatarCustom || "",
|
|
189
|
-
avatarStyle: bDef3.avatarStyle || "
|
|
189
|
+
avatarStyle: bDef3.avatarStyle || "imprint",
|
|
190
190
|
avatarColor: bDef3.avatarColor || "",
|
|
191
191
|
});
|
|
192
192
|
}
|
|
@@ -227,7 +227,7 @@ function attachMates(ctx) {
|
|
|
227
227
|
for (var abkR = 0; abkR < missingKeysR.length; abkR++) {
|
|
228
228
|
var bDefR = builtinDefsR.getBuiltinByKey(missingKeysR[abkR]);
|
|
229
229
|
if (bDefR) {
|
|
230
|
-
availableBuiltinsR.push({ key: bDefR.key, displayName: bDefR.displayName, bio: bDefR.bio, avatarCustom: bDefR.avatarCustom || "", avatarStyle: bDefR.avatarStyle || "
|
|
230
|
+
availableBuiltinsR.push({ key: bDefR.key, displayName: bDefR.displayName, bio: bDefR.bio, avatarCustom: bDefR.avatarCustom || "", avatarStyle: bDefR.avatarStyle || "imprint", avatarColor: bDefR.avatarColor || "" });
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
233
|
ws.send(JSON.stringify({ type: "mate_created", mate: newMate, projectSlug: readdSlug, availableBuiltins: availableBuiltinsR, dmFavorites: updatedFavsR }));
|
package/lib/server-settings.js
CHANGED
|
@@ -21,7 +21,7 @@ function attachSettings(ctx) {
|
|
|
21
21
|
res.end('{"error":"unauthorized"}');
|
|
22
22
|
return true;
|
|
23
23
|
}
|
|
24
|
-
var profile = mu.profile || { name: "", lang: "en-US", avatarColor: "#
|
|
24
|
+
var profile = mu.profile || { name: "", lang: "en-US", avatarColor: "#5857fc", avatarStyle: "imprint", avatarSeed: "", avatarCustom: "" };
|
|
25
25
|
profile.username = mu.username;
|
|
26
26
|
profile.userId = mu.id;
|
|
27
27
|
profile.role = mu.role;
|
|
@@ -35,7 +35,7 @@ function attachSettings(ctx) {
|
|
|
35
35
|
res.end(JSON.stringify(profile));
|
|
36
36
|
return true;
|
|
37
37
|
}
|
|
38
|
-
var profile = { name: "", lang: "en-US", avatarColor: "#
|
|
38
|
+
var profile = { name: "", lang: "en-US", avatarColor: "#5857fc", avatarStyle: "imprint", avatarSeed: "", avatarCustom: "" };
|
|
39
39
|
try {
|
|
40
40
|
var raw = fs.readFileSync(profilePath, "utf8");
|
|
41
41
|
var saved = JSON.parse(raw);
|
package/lib/server.js
CHANGED
|
@@ -355,7 +355,7 @@ function createServer(opts) {
|
|
|
355
355
|
// origin. External sites still cannot frame Clay; frame-ancestors below
|
|
356
356
|
// is the modern equivalent for browsers that honor CSP.
|
|
357
357
|
"X-Frame-Options": "SAMEORIGIN",
|
|
358
|
-
"Content-Security-Policy": "default-src 'self'; frame-ancestors 'self'; script-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net https://esm.sh; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com https://cdn.jsdelivr.net; img-src * data: blob:; connect-src 'self' ws: wss: https://cdn.jsdelivr.net https://esm.sh https://api.
|
|
358
|
+
"Content-Security-Policy": "default-src 'self'; frame-ancestors 'self'; script-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net https://esm.sh; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com https://cdn.jsdelivr.net; img-src * data: blob:; connect-src 'self' ws: wss: https://cdn.jsdelivr.net https://esm.sh https://api.open-meteo.com https://ipapi.co; font-src 'self' data: https://fonts.gstatic.com https://cdn.jsdelivr.net;",
|
|
359
359
|
};
|
|
360
360
|
if (tlsOptions) {
|
|
361
361
|
securityHeaders["Strict-Transport-Security"] = "max-age=31536000; includeSubDomains";
|
|
@@ -1418,8 +1418,9 @@ function createServer(opts) {
|
|
|
1418
1418
|
id: u.id,
|
|
1419
1419
|
displayName: p.name || u.displayName || u.username,
|
|
1420
1420
|
username: u.username,
|
|
1421
|
-
avatarStyle: p.avatarStyle || "
|
|
1421
|
+
avatarStyle: p.avatarStyle || "imprint",
|
|
1422
1422
|
avatarSeed: p.avatarSeed || u.username,
|
|
1423
|
+
avatarColor: p.avatarColor || "#5857fc",
|
|
1423
1424
|
avatarCustom: p.avatarCustom || "",
|
|
1424
1425
|
});
|
|
1425
1426
|
});
|
|
@@ -1451,9 +1452,9 @@ function createServer(opts) {
|
|
|
1451
1452
|
displayName: p.name || u.displayName || u.username,
|
|
1452
1453
|
username: u.username,
|
|
1453
1454
|
role: u.role,
|
|
1454
|
-
avatarStyle: p.avatarStyle || "
|
|
1455
|
+
avatarStyle: p.avatarStyle || "imprint",
|
|
1455
1456
|
avatarSeed: p.avatarSeed || u.username,
|
|
1456
|
-
avatarColor: p.avatarColor || "#
|
|
1457
|
+
avatarColor: p.avatarColor || "#5857fc",
|
|
1457
1458
|
avatarCustom: p.avatarCustom || "",
|
|
1458
1459
|
};
|
|
1459
1460
|
});
|
package/lib/users.js
CHANGED
|
@@ -81,8 +81,8 @@ function createUser(opts) {
|
|
|
81
81
|
profile: opts.profile || {
|
|
82
82
|
name: opts.displayName || opts.username,
|
|
83
83
|
lang: "en-US",
|
|
84
|
-
avatarColor: "#
|
|
85
|
-
avatarStyle: "
|
|
84
|
+
avatarColor: "#5857fc",
|
|
85
|
+
avatarStyle: "imprint",
|
|
86
86
|
avatarSeed: crypto.randomBytes(4).toString("hex"),
|
|
87
87
|
},
|
|
88
88
|
};
|
|
@@ -315,8 +315,8 @@ function createUserWithoutPin(opts) {
|
|
|
315
315
|
profile: opts.profile || {
|
|
316
316
|
name: opts.displayName || opts.username,
|
|
317
317
|
lang: "en-US",
|
|
318
|
-
avatarColor: "#
|
|
319
|
-
avatarStyle: "
|
|
318
|
+
avatarColor: "#5857fc",
|
|
319
|
+
avatarStyle: "imprint",
|
|
320
320
|
avatarSeed: crypto.randomBytes(4).toString("hex"),
|
|
321
321
|
},
|
|
322
322
|
};
|
package/package.json
CHANGED