@clagentic/console 1.12.0-beta.3 → 1.13.0-beta.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.
- package/README.md +7 -1
- package/bin/cli.js +18 -15
- package/lib/agent-roster-ws.js +38 -13
- package/lib/agent-roster.js +111 -12
- package/lib/agents.js +68 -33
- package/lib/atomic-install.js +334 -0
- package/lib/build-changes.js +33 -4
- package/lib/build-sha.json +2 -2
- package/lib/build-update-offer.js +12 -0
- package/lib/chat-width.js +31 -0
- package/lib/cli/agent-usage.js +126 -0
- package/lib/cli/arg-validation.js +1 -1
- package/lib/cli/compact-output.js +69 -0
- package/lib/cli/ipc-subcommands.js +92 -67
- package/lib/cli/output.js +28 -0
- package/lib/cli/restart-verb.js +132 -0
- package/lib/cli/schedule-input-subcommands.js +45 -8
- package/lib/cli/session-subcommands.js +37 -11
- package/lib/cli/settings-subcommands.js +74 -0
- package/lib/cli-transcript-title.js +56 -3
- package/lib/client-files.js +79 -0
- package/lib/daemon.js +100 -28
- package/lib/default-avatar-color.js +4 -0
- package/lib/drain.js +58 -10
- package/lib/mcp-tool-input.js +2 -2
- package/lib/model-families.js +49 -1
- package/lib/notify/type-registry.js +4 -0
- package/lib/notify/types.js +7 -4
- package/lib/pages.js +13 -63
- package/lib/permission-summary.js +12 -16
- package/lib/plan-usage-reader.js +70 -0
- package/lib/project-connection.js +4 -2
- package/lib/project-filesystem.js +6 -7
- package/lib/project-notifications.js +55 -8
- package/lib/project-prompt-expiry-settings.js +42 -0
- package/lib/project-sessions.js +52 -0
- package/lib/project-settings-gate.js +98 -0
- package/lib/project-user-mention.js +3 -2
- package/lib/project.js +1 -1
- package/lib/prompt-expiry-settings.js +49 -0
- package/lib/prompt-expiry.js +24 -3
- package/lib/prompt-kinds/codecs.js +6 -2
- package/lib/public/app.js +36 -36
- package/lib/public/css/admin.css +156 -170
- package/lib/public/css/agent-messages.css +24 -24
- package/lib/public/css/agent-picker.css +90 -38
- package/lib/public/css/agent-roster.css +61 -27
- package/lib/public/css/at-agents.css +10 -10
- package/lib/public/css/base.css +207 -184
- package/lib/public/css/chat-layout.css +228 -0
- package/lib/public/css/command-palette.css +86 -88
- package/lib/public/css/diagnostics.css +78 -204
- package/lib/public/css/diff.css +10 -10
- package/lib/public/css/filebrowser.css +32 -60
- package/lib/public/css/home-hub.css +100 -100
- package/lib/public/css/icon-strip.css +195 -238
- package/lib/public/css/input.css +191 -212
- package/lib/public/css/login-panel.css +16 -16
- package/lib/public/css/loop.css +96 -187
- package/lib/public/css/mention.css +49 -110
- package/lib/public/css/menus.css +162 -169
- package/lib/public/css/messages.css +49 -123
- package/lib/public/css/mobile-nav.css +207 -264
- package/lib/public/css/notifications-center.css +45 -124
- package/lib/public/css/overlay.css +269 -0
- package/lib/public/css/overlays.css +134 -156
- package/lib/public/css/playbook.css +41 -41
- package/lib/public/css/profile.css +43 -112
- package/lib/public/css/rewind.css +112 -112
- package/lib/public/css/scheduler-modal.css +27 -135
- package/lib/public/css/scheduler.css +204 -210
- package/lib/public/css/server-settings.css +173 -239
- package/lib/public/css/session-search.css +20 -20
- package/lib/public/css/settings-nav.css +197 -0
- package/lib/public/css/sidebar.css +213 -304
- package/lib/public/css/skills.css +121 -135
- package/lib/public/css/sticky-notes.css +114 -200
- package/lib/public/css/stt.css +17 -26
- package/lib/public/css/team-panel.css +36 -36
- package/lib/public/css/team-view.css +9 -9
- package/lib/public/css/title-bar.css +83 -100
- package/lib/public/css/tooltip.css +10 -10
- package/lib/public/css/user-settings.css +78 -131
- package/lib/public/css/user-shell.css +125 -29
- package/lib/public/index.html +178 -177
- package/lib/public/manifest.json +0 -2
- package/lib/public/modules/admin.js +54 -92
- package/lib/public/modules/agent-avatar.js +134 -3
- package/lib/public/modules/agent-messages.js +2 -1
- package/lib/public/modules/agent-picker.js +23 -21
- package/lib/public/modules/agent-roster-groups.js +128 -0
- package/lib/public/modules/agent-roster.js +40 -11
- package/lib/public/modules/app-connection.js +13 -1
- package/lib/public/modules/app-cursors.js +9 -9
- package/lib/public/modules/app-favicon.js +8 -16
- package/lib/public/modules/app-header.js +28 -19
- package/lib/public/modules/app-history-replay.js +67 -4
- package/lib/public/modules/app-home-hub.js +15 -0
- package/lib/public/modules/app-loop-ui.js +41 -47
- package/lib/public/modules/app-loop-wizard.js +9 -10
- package/lib/public/modules/app-messages.js +32 -36
- package/lib/public/modules/app-misc.js +22 -92
- package/lib/public/modules/app-modals.js +98 -0
- package/lib/public/modules/app-notifications.js +124 -135
- package/lib/public/modules/app-panels.js +28 -32
- package/lib/public/modules/app-projects.js +30 -40
- package/lib/public/modules/app-rate-limit.js +26 -9
- package/lib/public/modules/app-rendering.js +128 -110
- package/lib/public/modules/app-skills-install.js +6 -4
- package/lib/public/modules/assistant-identity.js +55 -0
- package/lib/public/modules/at-agents.js +3 -0
- package/lib/public/modules/build-guard.js +25 -11
- package/lib/public/modules/chat-width-choice.js +75 -0
- package/lib/public/modules/chat-width-prefs.js +52 -0
- package/lib/public/modules/chat-width.js +102 -0
- package/lib/public/modules/collapsible-text.js +36 -4
- package/lib/public/modules/command-palette.js +28 -34
- package/lib/public/modules/context-sources.js +3 -5
- package/lib/public/modules/diagnostics.js +130 -129
- package/lib/public/modules/info-panel.js +31 -0
- package/lib/public/modules/injected-identity.js +8 -8
- package/lib/public/modules/input-list-menu.js +39 -0
- package/lib/public/modules/input.js +22 -21
- package/lib/public/modules/markdown.js +10 -11
- package/lib/public/modules/mcp-ui.js +4 -14
- package/lib/public/modules/mention.js +100 -229
- package/lib/public/modules/message-header.js +80 -0
- package/lib/public/modules/message-participants.js +39 -0
- package/lib/public/modules/mobile-action-sheet.js +46 -0
- package/lib/public/modules/mobile-nav-sheet.js +104 -0
- package/lib/public/modules/model-families.js +41 -4
- package/lib/public/modules/note-order.js +39 -0
- package/lib/public/modules/notifications.js +35 -52
- package/lib/public/modules/overlay-history.js +73 -19
- package/lib/public/modules/overlay-menu.js +123 -0
- package/lib/public/modules/overlay-modal.js +186 -0
- package/lib/public/modules/overlay-registry.js +392 -0
- package/lib/public/modules/overlay-stack.js +110 -0
- package/lib/public/modules/overlay.js +117 -0
- package/lib/public/modules/popover-position.js +18 -2
- package/lib/public/modules/preference-sync.js +28 -0
- package/lib/public/modules/profile.js +24 -49
- package/lib/public/modules/project-settings.js +27 -172
- package/lib/public/modules/prompt-expiry-controls.js +46 -0
- package/lib/public/modules/prompt-kinds/command-summary.js +149 -0
- package/lib/public/modules/prompt-kinds/permission.js +70 -92
- package/lib/public/modules/prompts.js +1 -2
- package/lib/public/modules/qrcode.js +6 -21
- package/lib/public/modules/queued-button.js +15 -2
- package/lib/public/modules/rewind.js +9 -3
- package/lib/public/modules/schedule-time.js +32 -7
- package/lib/public/modules/scheduled-outbox.js +51 -18
- package/lib/public/modules/scheduler-config.js +87 -127
- package/lib/public/modules/scheduler.js +29 -26
- package/lib/public/modules/serialized-save.js +79 -0
- package/lib/public/modules/server-settings.js +75 -65
- package/lib/public/modules/session-grants.js +16 -19
- package/lib/public/modules/session-list-avatars.js +98 -0
- package/lib/public/modules/session-vendor-state.js +86 -0
- package/lib/public/modules/settings-access.js +35 -0
- package/lib/public/modules/settings-hub.js +125 -0
- package/lib/public/modules/settings-nav.js +182 -0
- package/lib/public/modules/shell-line.js +24 -0
- package/lib/public/modules/sidebar-mobile.js +151 -195
- package/lib/public/modules/sidebar-projects.js +88 -129
- package/lib/public/modules/sidebar-sessions.js +66 -34
- package/lib/public/modules/sidebar.js +2 -2
- package/lib/public/modules/skills.js +11 -26
- package/lib/public/modules/sticky-notes.js +19 -16
- package/lib/public/modules/stt.js +9 -23
- package/lib/public/modules/terminal.js +86 -90
- package/lib/public/modules/theme-choice.js +126 -0
- package/lib/public/modules/theme-colors.js +19 -0
- package/lib/public/modules/theme-prefs.js +121 -0
- package/lib/public/modules/theme.js +227 -605
- package/lib/public/modules/tool-palette.js +7 -17
- package/lib/public/modules/tools.js +8 -10
- package/lib/public/modules/user-settings.js +59 -115
- package/lib/public/modules/user-shell.js +9 -2
- package/lib/public/modules/utils.js +10 -12
- package/lib/public/modules/vendor-picker.js +4 -2
- package/lib/public/modules/vendor-registry.js +1 -2
- package/lib/public/style.css +3 -1
- package/lib/public/sw.js +9 -2
- package/lib/public/theme-core.js +411 -0
- package/lib/request-body.js +70 -0
- package/lib/sdk-bridge.js +227 -88
- package/lib/sdk-message-processor.js +44 -16
- package/lib/server-admin.js +198 -200
- package/lib/server-auth.js +16 -13
- package/lib/server-dm.js +4 -3
- package/lib/server-settings.js +177 -130
- package/lib/server.js +87 -36
- package/lib/session-background-tasks.js +79 -0
- package/lib/session-directory.js +138 -13
- package/lib/session-input-ipc.js +2 -0
- package/lib/session-input.js +39 -5
- package/lib/session-list-avatars.js +16 -0
- package/lib/session-reclaim.js +37 -25
- package/lib/session-vendor.js +37 -0
- package/lib/sessions.js +99 -34
- package/lib/settings-ipc.js +60 -0
- package/lib/settings-registry.js +86 -0
- package/lib/terminal-manager.js +17 -5
- package/lib/theme-files.js +132 -0
- package/lib/theme-seed.js +136 -0
- package/lib/themes/clagentic-dark.json +13 -6
- package/lib/themes/clagentic-light.json +12 -5
- package/lib/updater.js +6 -4
- package/lib/usage-store.js +97 -10
- package/lib/users-preferences.js +118 -19
- package/lib/users.js +19 -10
- package/lib/vendor-catalog.js +130 -0
- package/lib/ws-schema.js +4 -2
- package/lib/yoke/adapters/claude.js +81 -1
- package/lib/yoke/adapters/codex-user-shell.js +87 -23
- package/lib/yoke/adapters/codex.js +89 -5
- package/lib/yoke/codex-binary.js +59 -0
- package/package.json +1 -1
- package/scripts/check-test-count.js +5 -0
- package/scripts/install-local-test.js +50 -9
- package/scripts/write-build-sha.js +18 -2
- package/lib/public/css/channel-layout.css +0 -329
- package/lib/themes/ayu-light.json +0 -9
- package/lib/themes/catppuccin-latte.json +0 -9
- package/lib/themes/catppuccin-mocha.json +0 -9
- package/lib/themes/dracula.json +0 -9
- package/lib/themes/everforest-light.json +0 -9
- package/lib/themes/everforest.json +0 -9
- package/lib/themes/github-light.json +0 -9
- package/lib/themes/gruvbox-dark.json +0 -9
- package/lib/themes/gruvbox-light.json +0 -9
- package/lib/themes/monokai.json +0 -9
- package/lib/themes/nord-light.json +0 -9
- package/lib/themes/nord.json +0 -9
- package/lib/themes/one-dark.json +0 -9
- package/lib/themes/one-light.json +0 -9
- package/lib/themes/rose-pine-dawn.json +0 -9
- package/lib/themes/rose-pine.json +0 -9
- package/lib/themes/solarized-dark.json +0 -9
- package/lib/themes/solarized-light.json +0 -9
- package/lib/themes/tokyo-night-light.json +0 -9
- package/lib/themes/tokyo-night.json +0 -9
package/lib/server-admin.js
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
// Extracted from server.js
|
|
3
3
|
|
|
4
4
|
var audit = require("./audit");
|
|
5
|
+
var requestBody = require("./request-body");
|
|
6
|
+
var readJsonObjectBody = requestBody.readJsonObjectBody;
|
|
7
|
+
var respondPersistFailure = requestBody.respondPersistFailure;
|
|
5
8
|
|
|
6
9
|
function attachAdmin(ctx) {
|
|
7
10
|
var users = ctx.users;
|
|
@@ -95,56 +98,63 @@ function attachAdmin(ctx) {
|
|
|
95
98
|
res.end('{"error":"Admin access required"}');
|
|
96
99
|
return true;
|
|
97
100
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
+
readJsonObjectBody(req, res, function (data) {
|
|
102
|
+
if (!data.username || typeof data.username !== "string" || data.username.trim().length < 1) {
|
|
103
|
+
res.writeHead(400, { "Content-Type": "application/json" });
|
|
104
|
+
res.end('{"error":"Username is required"}');
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
// A non-string name or email used to throw inside the combined try and
|
|
108
|
+
// answer 400; it is still a client error, so it is checked up front.
|
|
109
|
+
if ((data.displayName && typeof data.displayName !== "string") || (data.email && typeof data.email !== "string")) {
|
|
110
|
+
res.writeHead(400, { "Content-Type": "application/json" });
|
|
111
|
+
res.end('{"error":"Invalid request"}');
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
var result;
|
|
101
115
|
try {
|
|
102
|
-
|
|
103
|
-
if (!data.username || typeof data.username !== "string" || data.username.trim().length < 1) {
|
|
104
|
-
res.writeHead(400, { "Content-Type": "application/json" });
|
|
105
|
-
res.end('{"error":"Username is required"}');
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
var result = users.createUserByAdmin({
|
|
116
|
+
result = users.createUserByAdmin({
|
|
109
117
|
username: data.username.trim(),
|
|
110
118
|
displayName: data.displayName ? data.displayName.trim() : data.username.trim(),
|
|
111
119
|
email: data.email ? data.email.trim() : null,
|
|
112
120
|
role: data.role === "admin" ? "admin" : "user",
|
|
113
121
|
});
|
|
114
|
-
if (result.error) {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
if (provision.ok) {
|
|
123
|
-
users.updateLinuxUser(result.user.id, provision.linuxUser);
|
|
124
|
-
if (onUserProvisioned) onUserProvisioned(result.user.id, provision.linuxUser);
|
|
122
|
+
if (!result.error) {
|
|
123
|
+
// Auto-provision Linux account if OS users mode is enabled
|
|
124
|
+
if (osUsers && !result.user.linuxUser) {
|
|
125
|
+
var provision = provisionLinuxUser(result.user.username);
|
|
126
|
+
if (provision.ok) {
|
|
127
|
+
users.updateLinuxUser(result.user.id, provision.linuxUser);
|
|
128
|
+
if (onUserProvisioned) onUserProvisioned(result.user.id, provision.linuxUser);
|
|
129
|
+
}
|
|
125
130
|
}
|
|
131
|
+
audit.log("user.create", {
|
|
132
|
+
actorId: mu.id,
|
|
133
|
+
actorName: mu.username,
|
|
134
|
+
target: result.user.id,
|
|
135
|
+
metadata: { username: result.user.username, role: result.user.role },
|
|
136
|
+
});
|
|
126
137
|
}
|
|
127
|
-
audit.log("user.create", {
|
|
128
|
-
actorId: mu.id,
|
|
129
|
-
actorName: mu.username,
|
|
130
|
-
target: result.user.id,
|
|
131
|
-
metadata: { username: result.user.username, role: result.user.role },
|
|
132
|
-
});
|
|
133
|
-
res.writeHead(200, { "Content-Type": "application/json" });
|
|
134
|
-
res.end(JSON.stringify({
|
|
135
|
-
ok: true,
|
|
136
|
-
user: {
|
|
137
|
-
id: result.user.id,
|
|
138
|
-
username: result.user.username,
|
|
139
|
-
displayName: result.user.displayName,
|
|
140
|
-
role: result.user.role,
|
|
141
|
-
},
|
|
142
|
-
tempPin: result.tempPin,
|
|
143
|
-
}));
|
|
144
138
|
} catch (e) {
|
|
139
|
+
respondPersistFailure(res, "user", e);
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
if (result.error) {
|
|
145
143
|
res.writeHead(400, { "Content-Type": "application/json" });
|
|
146
|
-
res.end(
|
|
144
|
+
res.end(JSON.stringify({ error: result.error }));
|
|
145
|
+
return;
|
|
147
146
|
}
|
|
147
|
+
res.writeHead(200, { "Content-Type": "application/json" });
|
|
148
|
+
res.end(JSON.stringify({
|
|
149
|
+
ok: true,
|
|
150
|
+
user: {
|
|
151
|
+
id: result.user.id,
|
|
152
|
+
username: result.user.username,
|
|
153
|
+
displayName: result.user.displayName,
|
|
154
|
+
role: result.user.role,
|
|
155
|
+
},
|
|
156
|
+
tempPin: result.tempPin,
|
|
157
|
+
}));
|
|
148
158
|
});
|
|
149
159
|
return true;
|
|
150
160
|
}
|
|
@@ -202,22 +212,20 @@ function attachAdmin(ctx) {
|
|
|
202
212
|
}
|
|
203
213
|
var urlParts = fullUrl.split("/");
|
|
204
214
|
var targetUserId = urlParts[4]; // /api/admin/users/{userId}/linux-user
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
req.on("end", function() {
|
|
215
|
+
readJsonObjectBody(req, res, function (parsed) {
|
|
216
|
+
var result;
|
|
208
217
|
try {
|
|
209
|
-
|
|
210
|
-
var result = users.updateLinuxUser(targetUserId, parsed.linuxUser || null);
|
|
211
|
-
if (result.error) {
|
|
212
|
-
res.writeHead(400, { "Content-Type": "application/json" });
|
|
213
|
-
res.end(JSON.stringify({ error: result.error }));
|
|
214
|
-
} else {
|
|
215
|
-
res.writeHead(200, { "Content-Type": "application/json" });
|
|
216
|
-
res.end('{"ok":true}');
|
|
217
|
-
}
|
|
218
|
+
result = users.updateLinuxUser(targetUserId, parsed.linuxUser || null);
|
|
218
219
|
} catch (e) {
|
|
220
|
+
respondPersistFailure(res, "linux user", e);
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
if (result.error) {
|
|
219
224
|
res.writeHead(400, { "Content-Type": "application/json" });
|
|
220
|
-
res.end(
|
|
225
|
+
res.end(JSON.stringify({ error: result.error }));
|
|
226
|
+
} else {
|
|
227
|
+
res.writeHead(200, { "Content-Type": "application/json" });
|
|
228
|
+
res.end('{"ok":true}');
|
|
221
229
|
}
|
|
222
230
|
});
|
|
223
231
|
return true;
|
|
@@ -233,22 +241,20 @@ function attachAdmin(ctx) {
|
|
|
233
241
|
}
|
|
234
242
|
var urlParts = fullUrl.split("/");
|
|
235
243
|
var targetUserId = urlParts[4]; // /api/admin/users/{userId}/permissions
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
req.on("end", function() {
|
|
244
|
+
readJsonObjectBody(req, res, function (parsed) {
|
|
245
|
+
var result;
|
|
239
246
|
try {
|
|
240
|
-
|
|
241
|
-
var result = users.updateUserPermissions(targetUserId, parsed.permissions || {});
|
|
242
|
-
if (result.error) {
|
|
243
|
-
res.writeHead(400, { "Content-Type": "application/json" });
|
|
244
|
-
res.end(JSON.stringify({ error: result.error }));
|
|
245
|
-
} else {
|
|
246
|
-
res.writeHead(200, { "Content-Type": "application/json" });
|
|
247
|
-
res.end(JSON.stringify({ ok: true, permissions: result.permissions }));
|
|
248
|
-
}
|
|
247
|
+
result = users.updateUserPermissions(targetUserId, parsed.permissions || {});
|
|
249
248
|
} catch (e) {
|
|
249
|
+
respondPersistFailure(res, "permissions", e);
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
if (result.error) {
|
|
250
253
|
res.writeHead(400, { "Content-Type": "application/json" });
|
|
251
|
-
res.end(
|
|
254
|
+
res.end(JSON.stringify({ error: result.error }));
|
|
255
|
+
} else {
|
|
256
|
+
res.writeHead(200, { "Content-Type": "application/json" });
|
|
257
|
+
res.end(JSON.stringify({ ok: true, permissions: result.permissions }));
|
|
252
258
|
}
|
|
253
259
|
});
|
|
254
260
|
return true;
|
|
@@ -322,31 +328,29 @@ function attachAdmin(ctx) {
|
|
|
322
328
|
res.end('{"error":"Admin access required"}');
|
|
323
329
|
return true;
|
|
324
330
|
}
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
331
|
+
readJsonObjectBody(req, res, function (data) {
|
|
332
|
+
if (!data.email || !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(data.email)) {
|
|
333
|
+
res.writeHead(400, { "Content-Type": "application/json" });
|
|
334
|
+
res.end('{"error":"Valid email is required"}');
|
|
335
|
+
return;
|
|
336
|
+
}
|
|
337
|
+
var invite;
|
|
328
338
|
try {
|
|
329
|
-
|
|
330
|
-
if (!data.email || !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(data.email)) {
|
|
331
|
-
res.writeHead(400, { "Content-Type": "application/json" });
|
|
332
|
-
res.end('{"error":"Valid email is required"}');
|
|
333
|
-
return;
|
|
334
|
-
}
|
|
335
|
-
var invite = users.createInvite(mu.id, data.email);
|
|
336
|
-
var proto = tlsOptions ? "https" : "http";
|
|
337
|
-
var host = req.headers.host || ("localhost:" + portNum);
|
|
338
|
-
var inviteUrl = proto + "://" + host + "/invite/" + invite.code;
|
|
339
|
-
smtp.sendInviteEmail(data.email, inviteUrl, mu.displayName || mu.username).then(function () {
|
|
340
|
-
res.writeHead(200, { "Content-Type": "application/json" });
|
|
341
|
-
res.end(JSON.stringify({ ok: true, invite: invite, url: inviteUrl }));
|
|
342
|
-
}).catch(function (err) {
|
|
343
|
-
res.writeHead(500, { "Content-Type": "application/json" });
|
|
344
|
-
res.end(JSON.stringify({ error: "Failed to send email: " + (err.message || "unknown error") }));
|
|
345
|
-
});
|
|
339
|
+
invite = users.createInvite(mu.id, data.email);
|
|
346
340
|
} catch (e) {
|
|
347
|
-
res
|
|
348
|
-
|
|
341
|
+
respondPersistFailure(res, "invite", e);
|
|
342
|
+
return;
|
|
349
343
|
}
|
|
344
|
+
var proto = tlsOptions ? "https" : "http";
|
|
345
|
+
var host = req.headers.host || ("localhost:" + portNum);
|
|
346
|
+
var inviteUrl = proto + "://" + host + "/invite/" + invite.code;
|
|
347
|
+
smtp.sendInviteEmail(data.email, inviteUrl, mu.displayName || mu.username).then(function () {
|
|
348
|
+
res.writeHead(200, { "Content-Type": "application/json" });
|
|
349
|
+
res.end(JSON.stringify({ ok: true, invite: invite, url: inviteUrl }));
|
|
350
|
+
}).catch(function (err) {
|
|
351
|
+
res.writeHead(500, { "Content-Type": "application/json" });
|
|
352
|
+
res.end(JSON.stringify({ error: "Failed to send email: " + (err.message || "unknown error") }));
|
|
353
|
+
});
|
|
350
354
|
});
|
|
351
355
|
return true;
|
|
352
356
|
}
|
|
@@ -378,28 +382,30 @@ function attachAdmin(ctx) {
|
|
|
378
382
|
res.end('{"error":"Admin access required"}');
|
|
379
383
|
return true;
|
|
380
384
|
}
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
var data = JSON.parse(body);
|
|
386
|
-
// Allow clearing SMTP config by sending empty fields
|
|
387
|
-
if (!data.host && !data.user && !data.pass && !data.from) {
|
|
385
|
+
readJsonObjectBody(req, res, function (data) {
|
|
386
|
+
// Allow clearing SMTP config by sending empty fields
|
|
387
|
+
if (!data.host && !data.user && !data.pass && !data.from) {
|
|
388
|
+
try {
|
|
388
389
|
smtp.saveSmtpConfig(null);
|
|
389
390
|
audit.log("settings.smtp.update", {
|
|
390
391
|
actorId: mu.id,
|
|
391
392
|
actorName: mu.username,
|
|
392
393
|
metadata: { cleared: true },
|
|
393
394
|
});
|
|
394
|
-
|
|
395
|
-
res
|
|
396
|
-
return;
|
|
397
|
-
}
|
|
398
|
-
if (!data.host || !data.user || !data.pass || !data.from) {
|
|
399
|
-
res.writeHead(400, { "Content-Type": "application/json" });
|
|
400
|
-
res.end('{"error":"Host, user, password, and from address are required"}');
|
|
395
|
+
} catch (e) {
|
|
396
|
+
respondPersistFailure(res, "smtp config", e);
|
|
401
397
|
return;
|
|
402
398
|
}
|
|
399
|
+
res.writeHead(200, { "Content-Type": "application/json" });
|
|
400
|
+
res.end('{"ok":true}');
|
|
401
|
+
return;
|
|
402
|
+
}
|
|
403
|
+
if (!data.host || !data.user || !data.pass || !data.from) {
|
|
404
|
+
res.writeHead(400, { "Content-Type": "application/json" });
|
|
405
|
+
res.end('{"error":"Host, user, password, and from address are required"}');
|
|
406
|
+
return;
|
|
407
|
+
}
|
|
408
|
+
try {
|
|
403
409
|
// If password is masked, keep existing
|
|
404
410
|
var existingCfg = smtp.getSmtpConfig();
|
|
405
411
|
var pass = data.pass;
|
|
@@ -421,12 +427,12 @@ function attachAdmin(ctx) {
|
|
|
421
427
|
// Log field names only — never log host credentials, passwords, or secrets.
|
|
422
428
|
metadata: { fieldsUpdated: ["host", "port", "secure", "user", "from", "emailLoginEnabled"] },
|
|
423
429
|
});
|
|
424
|
-
res.writeHead(200, { "Content-Type": "application/json" });
|
|
425
|
-
res.end('{"ok":true}');
|
|
426
430
|
} catch (e) {
|
|
427
|
-
res
|
|
428
|
-
|
|
431
|
+
respondPersistFailure(res, "smtp config", e);
|
|
432
|
+
return;
|
|
429
433
|
}
|
|
434
|
+
res.writeHead(200, { "Content-Type": "application/json" });
|
|
435
|
+
res.end('{"ok":true}');
|
|
430
436
|
});
|
|
431
437
|
return true;
|
|
432
438
|
}
|
|
@@ -439,42 +445,41 @@ function attachAdmin(ctx) {
|
|
|
439
445
|
res.end('{"error":"Admin access required"}');
|
|
440
446
|
return true;
|
|
441
447
|
}
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
448
|
+
readJsonObjectBody(req, res, function (data) {
|
|
449
|
+
// Use provided config or fall back to saved
|
|
450
|
+
var existingCfg;
|
|
445
451
|
try {
|
|
446
|
-
|
|
447
|
-
// Use provided config or fall back to saved
|
|
448
|
-
var existingCfg = smtp.getSmtpConfig();
|
|
449
|
-
var pass = data.pass;
|
|
450
|
-
if (pass === "••••••••" && existingCfg) {
|
|
451
|
-
pass = existingCfg.pass;
|
|
452
|
-
}
|
|
453
|
-
var cfg = {
|
|
454
|
-
host: data.host || (existingCfg && existingCfg.host),
|
|
455
|
-
port: parseInt(data.port, 10) || (existingCfg && existingCfg.port) || 587,
|
|
456
|
-
secure: data.secure !== undefined ? !!data.secure : (existingCfg && !!existingCfg.secure),
|
|
457
|
-
user: data.user || (existingCfg && existingCfg.user),
|
|
458
|
-
pass: pass || (existingCfg && existingCfg.pass),
|
|
459
|
-
from: data.from || (existingCfg && existingCfg.from),
|
|
460
|
-
};
|
|
461
|
-
if (!cfg.host || !cfg.user || !cfg.pass || !cfg.from) {
|
|
462
|
-
res.writeHead(400, { "Content-Type": "application/json" });
|
|
463
|
-
res.end('{"error":"SMTP configuration is incomplete"}');
|
|
464
|
-
return;
|
|
465
|
-
}
|
|
466
|
-
var testTo = mu.email || cfg.from;
|
|
467
|
-
smtp.sendTestEmail(cfg, testTo).then(function (result) {
|
|
468
|
-
res.writeHead(200, { "Content-Type": "application/json" });
|
|
469
|
-
res.end(JSON.stringify({ ok: true, message: "Test email sent to " + testTo }));
|
|
470
|
-
}).catch(function (err) {
|
|
471
|
-
res.writeHead(500, { "Content-Type": "application/json" });
|
|
472
|
-
res.end(JSON.stringify({ ok: false, error: err.message || "Connection failed" }));
|
|
473
|
-
});
|
|
452
|
+
existingCfg = smtp.getSmtpConfig();
|
|
474
453
|
} catch (e) {
|
|
454
|
+
respondPersistFailure(res, "smtp config read", e);
|
|
455
|
+
return;
|
|
456
|
+
}
|
|
457
|
+
var pass = data.pass;
|
|
458
|
+
if (pass === "••••••••" && existingCfg) {
|
|
459
|
+
pass = existingCfg.pass;
|
|
460
|
+
}
|
|
461
|
+
var cfg = {
|
|
462
|
+
host: data.host || (existingCfg && existingCfg.host),
|
|
463
|
+
port: parseInt(data.port, 10) || (existingCfg && existingCfg.port) || 587,
|
|
464
|
+
secure: data.secure !== undefined ? !!data.secure : (existingCfg && !!existingCfg.secure),
|
|
465
|
+
user: data.user || (existingCfg && existingCfg.user),
|
|
466
|
+
pass: pass || (existingCfg && existingCfg.pass),
|
|
467
|
+
from: data.from || (existingCfg && existingCfg.from),
|
|
468
|
+
};
|
|
469
|
+
if (!cfg.host || !cfg.user || !cfg.pass || !cfg.from) {
|
|
475
470
|
res.writeHead(400, { "Content-Type": "application/json" });
|
|
476
|
-
res.end('{"error":"
|
|
471
|
+
res.end('{"error":"SMTP configuration is incomplete"}');
|
|
472
|
+
return;
|
|
477
473
|
}
|
|
474
|
+
var testTo = mu.email || cfg.from;
|
|
475
|
+
// A failed test send is an external call, not persistence: it keeps its own answer.
|
|
476
|
+
smtp.sendTestEmail(cfg, testTo).then(function (result) {
|
|
477
|
+
res.writeHead(200, { "Content-Type": "application/json" });
|
|
478
|
+
res.end(JSON.stringify({ ok: true, message: "Test email sent to " + testTo }));
|
|
479
|
+
}).catch(function (err) {
|
|
480
|
+
res.writeHead(500, { "Content-Type": "application/json" });
|
|
481
|
+
res.end(JSON.stringify({ ok: false, error: err.message || "Connection failed" }));
|
|
482
|
+
});
|
|
478
483
|
});
|
|
479
484
|
return true;
|
|
480
485
|
}
|
|
@@ -498,33 +503,31 @@ function attachAdmin(ctx) {
|
|
|
498
503
|
res.end('{"error":"Worktree projects inherit parent visibility"}');
|
|
499
504
|
return true;
|
|
500
505
|
}
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
506
|
+
readJsonObjectBody(req, res, function (data) {
|
|
507
|
+
if (data.visibility !== "public" && data.visibility !== "private") {
|
|
508
|
+
res.writeHead(400, { "Content-Type": "application/json" });
|
|
509
|
+
res.end('{"error":"Visibility must be public or private"}');
|
|
510
|
+
return;
|
|
511
|
+
}
|
|
512
|
+
if (!onSetProjectVisibility) {
|
|
513
|
+
res.writeHead(500, { "Content-Type": "application/json" });
|
|
514
|
+
res.end('{"error":"Visibility handler not configured"}');
|
|
515
|
+
return;
|
|
516
|
+
}
|
|
517
|
+
var result;
|
|
504
518
|
try {
|
|
505
|
-
|
|
506
|
-
if (data.visibility !== "public" && data.visibility !== "private") {
|
|
507
|
-
res.writeHead(400, { "Content-Type": "application/json" });
|
|
508
|
-
res.end('{"error":"Visibility must be public or private"}');
|
|
509
|
-
return;
|
|
510
|
-
}
|
|
511
|
-
if (!onSetProjectVisibility) {
|
|
512
|
-
res.writeHead(500, { "Content-Type": "application/json" });
|
|
513
|
-
res.end('{"error":"Visibility handler not configured"}');
|
|
514
|
-
return;
|
|
515
|
-
}
|
|
516
|
-
var result = onSetProjectVisibility(projSlug, data.visibility);
|
|
517
|
-
if (result && result.error) {
|
|
518
|
-
res.writeHead(404, { "Content-Type": "application/json" });
|
|
519
|
-
res.end(JSON.stringify({ error: result.error }));
|
|
520
|
-
return;
|
|
521
|
-
}
|
|
522
|
-
res.writeHead(200, { "Content-Type": "application/json" });
|
|
523
|
-
res.end('{"ok":true}');
|
|
519
|
+
result = onSetProjectVisibility(projSlug, data.visibility);
|
|
524
520
|
} catch (e) {
|
|
525
|
-
res
|
|
526
|
-
|
|
521
|
+
respondPersistFailure(res, "project visibility", e);
|
|
522
|
+
return;
|
|
527
523
|
}
|
|
524
|
+
if (result && result.error) {
|
|
525
|
+
res.writeHead(404, { "Content-Type": "application/json" });
|
|
526
|
+
res.end(JSON.stringify({ error: result.error }));
|
|
527
|
+
return;
|
|
528
|
+
}
|
|
529
|
+
res.writeHead(200, { "Content-Type": "application/json" });
|
|
530
|
+
res.end('{"ok":true}');
|
|
528
531
|
});
|
|
529
532
|
return true;
|
|
530
533
|
}
|
|
@@ -543,18 +546,15 @@ function attachAdmin(ctx) {
|
|
|
543
546
|
res.end('{"error":"Worktree projects inherit parent settings"}');
|
|
544
547
|
return true;
|
|
545
548
|
}
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
+
readJsonObjectBody(req, res, function (data) {
|
|
550
|
+
var targetCtx = projects.get(projSlug);
|
|
551
|
+
if (!targetCtx) {
|
|
552
|
+
res.writeHead(404, { "Content-Type": "application/json" });
|
|
553
|
+
res.end('{"error":"Project not found"}');
|
|
554
|
+
return;
|
|
555
|
+
}
|
|
556
|
+
var ownerId = data.userId || null;
|
|
549
557
|
try {
|
|
550
|
-
var data = JSON.parse(body);
|
|
551
|
-
var targetCtx = projects.get(projSlug);
|
|
552
|
-
if (!targetCtx) {
|
|
553
|
-
res.writeHead(404, { "Content-Type": "application/json" });
|
|
554
|
-
res.end('{"error":"Project not found"}');
|
|
555
|
-
return;
|
|
556
|
-
}
|
|
557
|
-
var ownerId = data.userId || null;
|
|
558
558
|
targetCtx.setProjectOwner(ownerId);
|
|
559
559
|
if (onProjectOwnerChanged) {
|
|
560
560
|
onProjectOwnerChanged(projSlug, ownerId);
|
|
@@ -566,12 +566,12 @@ function attachAdmin(ctx) {
|
|
|
566
566
|
ownerName = ownerUser ? (ownerUser.displayName || ownerUser.username) : ownerId;
|
|
567
567
|
}
|
|
568
568
|
targetCtx.send({ type: "project_owner_changed", ownerId: ownerId, ownerName: ownerName });
|
|
569
|
-
res.writeHead(200, { "Content-Type": "application/json" });
|
|
570
|
-
res.end('{"ok":true}');
|
|
571
569
|
} catch (e) {
|
|
572
|
-
res
|
|
573
|
-
|
|
570
|
+
respondPersistFailure(res, "project owner", e);
|
|
571
|
+
return;
|
|
574
572
|
}
|
|
573
|
+
res.writeHead(200, { "Content-Type": "application/json" });
|
|
574
|
+
res.end('{"ok":true}');
|
|
575
575
|
});
|
|
576
576
|
return true;
|
|
577
577
|
}
|
|
@@ -593,33 +593,31 @@ function attachAdmin(ctx) {
|
|
|
593
593
|
res.end('{"error":"Worktree projects inherit parent settings"}');
|
|
594
594
|
return true;
|
|
595
595
|
}
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
596
|
+
readJsonObjectBody(req, res, function (data) {
|
|
597
|
+
if (!Array.isArray(data.allowedUsers)) {
|
|
598
|
+
res.writeHead(400, { "Content-Type": "application/json" });
|
|
599
|
+
res.end('{"error":"allowedUsers must be an array"}');
|
|
600
|
+
return;
|
|
601
|
+
}
|
|
602
|
+
if (!onSetProjectAllowedUsers) {
|
|
603
|
+
res.writeHead(500, { "Content-Type": "application/json" });
|
|
604
|
+
res.end('{"error":"AllowedUsers handler not configured"}');
|
|
605
|
+
return;
|
|
606
|
+
}
|
|
607
|
+
var result;
|
|
599
608
|
try {
|
|
600
|
-
|
|
601
|
-
if (!Array.isArray(data.allowedUsers)) {
|
|
602
|
-
res.writeHead(400, { "Content-Type": "application/json" });
|
|
603
|
-
res.end('{"error":"allowedUsers must be an array"}');
|
|
604
|
-
return;
|
|
605
|
-
}
|
|
606
|
-
if (!onSetProjectAllowedUsers) {
|
|
607
|
-
res.writeHead(500, { "Content-Type": "application/json" });
|
|
608
|
-
res.end('{"error":"AllowedUsers handler not configured"}');
|
|
609
|
-
return;
|
|
610
|
-
}
|
|
611
|
-
var result = onSetProjectAllowedUsers(projSlug, data.allowedUsers);
|
|
612
|
-
if (result && result.error) {
|
|
613
|
-
res.writeHead(404, { "Content-Type": "application/json" });
|
|
614
|
-
res.end(JSON.stringify({ error: result.error }));
|
|
615
|
-
return;
|
|
616
|
-
}
|
|
617
|
-
res.writeHead(200, { "Content-Type": "application/json" });
|
|
618
|
-
res.end('{"ok":true}');
|
|
609
|
+
result = onSetProjectAllowedUsers(projSlug, data.allowedUsers);
|
|
619
610
|
} catch (e) {
|
|
620
|
-
res
|
|
621
|
-
|
|
611
|
+
respondPersistFailure(res, "project allowed users", e);
|
|
612
|
+
return;
|
|
613
|
+
}
|
|
614
|
+
if (result && result.error) {
|
|
615
|
+
res.writeHead(404, { "Content-Type": "application/json" });
|
|
616
|
+
res.end(JSON.stringify({ error: result.error }));
|
|
617
|
+
return;
|
|
622
618
|
}
|
|
619
|
+
res.writeHead(200, { "Content-Type": "application/json" });
|
|
620
|
+
res.end('{"ok":true}');
|
|
623
621
|
});
|
|
624
622
|
return true;
|
|
625
623
|
}
|
package/lib/server-auth.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
var crypto = require("crypto");
|
|
2
2
|
var fs = require("fs");
|
|
3
3
|
var path = require("path");
|
|
4
|
+
var { DEFAULT_AVATAR_COLOR } = require("./default-avatar-color");
|
|
5
|
+
var themeSeed = require("./theme-seed");
|
|
4
6
|
var { CONFIG_DIR } = require("./config");
|
|
5
7
|
var _isDevMode = require("./config").isDevMode;
|
|
6
8
|
var store = require("./store");
|
|
@@ -279,19 +281,20 @@ function attachAuth(ctx) {
|
|
|
279
281
|
return '<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">'
|
|
280
282
|
+ '<title>Admin Password Recovery</title>'
|
|
281
283
|
+ '<style>'
|
|
284
|
+
+ themeSeed.systemVarsCss()
|
|
282
285
|
+ '*{margin:0;padding:0;box-sizing:border-box}'
|
|
283
|
-
+ 'body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;background
|
|
284
|
-
+ '.card{background
|
|
286
|
+
+ 'body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;background:var(--bg);color:var(--text-secondary);display:flex;align-items:center;justify-content:center;min-height:100vh}'
|
|
287
|
+
+ '.card{background:var(--bg-alt);border:1px solid var(--border);border-radius:12px;padding:32px;width:100%;max-width:380px}'
|
|
285
288
|
+ 'h1{font-size:18px;font-weight:600;margin-bottom:4px}'
|
|
286
|
-
+ '.sub{font-size:13px;color
|
|
287
|
-
+ 'label{display:block;font-size:13px;color
|
|
288
|
-
+ 'input{width:100%;padding:10px 12px;background
|
|
289
|
-
+ 'input:focus{border-color
|
|
290
|
-
+ 'button{width:100%;padding:10px;background
|
|
291
|
-
+ 'button:hover{background
|
|
289
|
+
+ '.sub{font-size:13px;color:var(--text-muted);margin-bottom:24px}'
|
|
290
|
+
+ 'label{display:block;font-size:13px;color:var(--text-muted);margin-bottom:6px}'
|
|
291
|
+
+ 'input{width:100%;padding:10px 12px;background:var(--input-bg);border:1px solid var(--border-strong);border-radius:8px;color:var(--text);font-size:14px;outline:none;margin-bottom:16px}'
|
|
292
|
+
+ 'input:focus{border-color:var(--accent)}'
|
|
293
|
+
+ 'button{width:100%;padding:10px;background:var(--accent);color:var(--on-accent);border:none;border-radius:8px;font-size:14px;font-weight:500;cursor:pointer}'
|
|
294
|
+
+ 'button:hover{background:var(--accent-hover)}'
|
|
292
295
|
+ 'button:disabled{opacity:.5;cursor:not-allowed}'
|
|
293
|
-
+ '.error{color
|
|
294
|
-
+ '.success{text-align:center;color
|
|
296
|
+
+ '.error{color:var(--error);font-size:13px;margin-bottom:12px;display:none}'
|
|
297
|
+
+ '.success{text-align:center;color:var(--success);font-size:15px}'
|
|
295
298
|
+ '.hidden{display:none}'
|
|
296
299
|
+ '</style></head><body>'
|
|
297
300
|
+ '<div class="card">'
|
|
@@ -463,7 +466,7 @@ function attachAuth(ctx) {
|
|
|
463
466
|
adminProfile = {
|
|
464
467
|
name: data.displayName || data.username,
|
|
465
468
|
lang: existingProfile.lang || "en-US",
|
|
466
|
-
avatarColor: existingProfile.avatarColor ||
|
|
469
|
+
avatarColor: existingProfile.avatarColor || DEFAULT_AVATAR_COLOR,
|
|
467
470
|
avatarStyle: existingProfile.avatarStyle || "thumbs",
|
|
468
471
|
avatarSeed: existingProfile.avatarSeed || crypto.randomBytes(4).toString("hex"),
|
|
469
472
|
};
|
|
@@ -762,8 +765,8 @@ function attachAuth(ctx) {
|
|
|
762
765
|
if (!validation.valid) {
|
|
763
766
|
res.writeHead(200, { "Content-Type": "text/html; charset=utf-8" });
|
|
764
767
|
res.end('<!DOCTYPE html><html><head><title>Clagentic: Console</title>' +
|
|
765
|
-
'<style>body{background
|
|
766
|
-
'.c{text-align:center;max-width:360px;padding:20px}h1{color
|
|
768
|
+
'<style>' + themeSeed.systemVarsCss() + 'body{background:var(--bg);color:var(--text);font-family:system-ui;display:flex;align-items:center;justify-content:center;min-height:100vh;margin:0}' +
|
|
769
|
+
'.c{text-align:center;max-width:360px;padding:20px}h1{color:var(--accent);margin-bottom:16px}p{color:var(--text-muted)}</style></head>' +
|
|
767
770
|
'<body><div class="c"><h1>Clagentic: Console</h1><p>' + (validation.error === "Invite expired" ? "This invite link has expired." : validation.error === "Invite already used" ? "This invite link has already been used." : "Invalid invite link.") + '</p></div></body></html>');
|
|
768
771
|
return true;
|
|
769
772
|
}
|
package/lib/server-dm.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
var { notifyFor } = require("./notify");
|
|
2
|
+
var { DEFAULT_AVATAR_COLOR } = require("./default-avatar-color");
|
|
2
3
|
|
|
3
4
|
// Strict allow-list for client-supplied dmKey values.
|
|
4
5
|
// Accepts exactly two segments separated by a single colon, each containing
|
|
@@ -33,7 +34,7 @@ function attachDm(ctx) {
|
|
|
33
34
|
username: otherUser.username,
|
|
34
35
|
avatarStyle: p.avatarStyle || "thumbs",
|
|
35
36
|
avatarSeed: p.avatarSeed || otherUser.username,
|
|
36
|
-
avatarColor: p.avatarColor ||
|
|
37
|
+
avatarColor: p.avatarColor || DEFAULT_AVATAR_COLOR,
|
|
37
38
|
avatarCustom: p.avatarCustom || "",
|
|
38
39
|
};
|
|
39
40
|
}
|
|
@@ -58,7 +59,7 @@ function attachDm(ctx) {
|
|
|
58
59
|
username: targetUser.username,
|
|
59
60
|
avatarStyle: tp.avatarStyle || "thumbs",
|
|
60
61
|
avatarSeed: tp.avatarSeed || targetUser.username,
|
|
61
|
-
avatarColor: tp.avatarColor ||
|
|
62
|
+
avatarColor: tp.avatarColor || DEFAULT_AVATAR_COLOR,
|
|
62
63
|
avatarCustom: tp.avatarCustom || "",
|
|
63
64
|
} : null,
|
|
64
65
|
}));
|
|
@@ -138,7 +139,7 @@ function attachDm(ctx) {
|
|
|
138
139
|
role: u.role,
|
|
139
140
|
avatarStyle: p.avatarStyle || "thumbs",
|
|
140
141
|
avatarSeed: p.avatarSeed || u.username,
|
|
141
|
-
avatarColor: p.avatarColor ||
|
|
142
|
+
avatarColor: p.avatarColor || DEFAULT_AVATAR_COLOR,
|
|
142
143
|
avatarCustom: p.avatarCustom || "",
|
|
143
144
|
};
|
|
144
145
|
});
|