@chrysb/alphaclaw 0.9.15 → 0.9.17
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/css/tailwind.generated.css +1 -1
- package/lib/public/dist/app.bundle.js +2168 -2103
- package/lib/public/js/components/agents-tab/agent-overview/model-card.js +59 -7
- package/lib/public/js/components/agents-tab/agent-overview/use-model-card.js +124 -0
- package/lib/public/js/components/envars.js +1 -1
- package/lib/public/js/components/file-tree.js +82 -6
- package/lib/public/js/components/row-accessory-select.js +52 -0
- package/lib/public/js/lib/api.js +11 -1
- package/lib/public/js/lib/model-catalog.js +6 -0
- package/lib/public/js/lib/model-config.js +12 -7
- package/lib/public/js/lib/thinking-levels.js +37 -0
- package/lib/server/agents/agents.js +33 -7
- package/lib/server/agents/channels.js +4 -2
- package/lib/server/chat-ws.js +4 -1
- package/lib/server/constants.js +25 -0
- package/lib/server/cost-utils.js +2 -0
- package/lib/server/db/auth/index.js +147 -0
- package/lib/server/db/auth/schema.js +17 -0
- package/lib/server/gateway.js +158 -19
- package/lib/server/helpers.js +1 -3
- package/lib/server/init/register-server-routes.js +37 -18
- package/lib/server/init/runtime-init.js +4 -0
- package/lib/server/init/server-lifecycle.js +1 -24
- package/lib/server/login-throttle.js +242 -60
- package/lib/server/model-catalog-bootstrap.json +5 -0
- package/lib/server/onboarding/index.js +2 -2
- package/lib/server/openclaw-thinking.js +103 -0
- package/lib/server/openclaw-version.js +1 -1
- package/lib/server/routes/agents.js +10 -3
- package/lib/server/routes/browse/constants.js +3 -1
- package/lib/server/routes/browse/index.js +39 -11
- package/lib/server/routes/models.js +35 -1
- package/lib/server/routes/onboarding.js +2 -2
- package/lib/server/routes/system.js +2 -2
- package/lib/server/usage-tracker-config.js +52 -1
- package/lib/server.js +26 -22
- package/package.json +2 -2
|
@@ -93,7 +93,7 @@ const registerOnboardingRoutes = ({
|
|
|
93
93
|
authProfiles,
|
|
94
94
|
ensureGatewayProxyConfig,
|
|
95
95
|
getBaseUrl,
|
|
96
|
-
|
|
96
|
+
runOnboardedBootSequence,
|
|
97
97
|
}) => {
|
|
98
98
|
// Keep mutating onboarding routes marker-gated so in-progress imports
|
|
99
99
|
// can promote files before the final completion marker is written.
|
|
@@ -114,7 +114,7 @@ const registerOnboardingRoutes = ({
|
|
|
114
114
|
authProfiles,
|
|
115
115
|
ensureGatewayProxyConfig,
|
|
116
116
|
getBaseUrl,
|
|
117
|
-
|
|
117
|
+
runOnboardedBootSequence,
|
|
118
118
|
});
|
|
119
119
|
|
|
120
120
|
const kEnvVarNamePattern = /^[A-Z_][A-Z0-9_]*$/;
|
|
@@ -30,7 +30,7 @@ const registerSystemRoutes = ({
|
|
|
30
30
|
let envRestartPending = false;
|
|
31
31
|
let openclawSecretRuntimePromise = null;
|
|
32
32
|
const kManagedChannelTokenPattern =
|
|
33
|
-
/^(?:TELEGRAM_BOT_TOKEN|DISCORD_BOT_TOKEN|SLACK_BOT_TOKEN|SLACK_APP_TOKEN)(?:_[A-Z0-9_]+)?$/;
|
|
33
|
+
/^(?:TELEGRAM_BOT_TOKEN|DISCORD_BOT_TOKEN|SLACK_BOT_TOKEN|SLACK_APP_TOKEN|WHATSAPP_OWNER_NUMBER)(?:_[A-Z0-9_]+)?$/;
|
|
34
34
|
const kEnvVarsReservedForUserInput = new Set([
|
|
35
35
|
"GITHUB_WORKSPACE_REPO",
|
|
36
36
|
"GOG_KEYRING_PASSWORD",
|
|
@@ -838,7 +838,7 @@ const registerSystemRoutes = ({
|
|
|
838
838
|
}
|
|
839
839
|
restartRequiredState.markRestartInProgress();
|
|
840
840
|
try {
|
|
841
|
-
restartGateway();
|
|
841
|
+
await restartGateway();
|
|
842
842
|
envRestartPending = false;
|
|
843
843
|
restartRequiredState.clearRequired();
|
|
844
844
|
restartRequiredState.markRestartComplete();
|
|
@@ -8,6 +8,8 @@ const kUsageTrackerPluginPath = path.resolve(
|
|
|
8
8
|
"usage-tracker",
|
|
9
9
|
);
|
|
10
10
|
const kConversationAccessHookPolicyKey = "allowConversationAccess";
|
|
11
|
+
const kChannelPluginIds = ["telegram", "discord", "slack", "whatsapp"];
|
|
12
|
+
const kDefaultDiscordGroupPolicy = "disabled";
|
|
11
13
|
|
|
12
14
|
const ensurePluginsShell = (cfg = {}) => {
|
|
13
15
|
if (!cfg.plugins || typeof cfg.plugins !== "object") cfg.plugins = {};
|
|
@@ -70,13 +72,58 @@ const ensureUsageTrackerPluginEntry = (cfg = {}) => {
|
|
|
70
72
|
return JSON.stringify(cfg) !== before;
|
|
71
73
|
};
|
|
72
74
|
|
|
75
|
+
const hasDiscordGuildAllowlist = (discordConfig = {}) => {
|
|
76
|
+
const guilds = discordConfig.guilds;
|
|
77
|
+
return !!guilds && typeof guilds === "object" && Object.keys(guilds).length > 0;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
const reconcileDiscordGroupPolicy = (cfg = {}) => {
|
|
81
|
+
const discord = cfg.channels?.discord;
|
|
82
|
+
if (!discord || typeof discord !== "object" || discord.enabled === false) {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
if (hasDiscordGuildAllowlist(discord)) return false;
|
|
86
|
+
if (discord.groupPolicy !== "allowlist") return false;
|
|
87
|
+
discord.groupPolicy = kDefaultDiscordGroupPolicy;
|
|
88
|
+
return true;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
const reconcileEnabledChannelPlugins = (cfg = {}) => {
|
|
92
|
+
ensurePluginsShell(cfg);
|
|
93
|
+
let changed = false;
|
|
94
|
+
for (const pluginKey of kChannelPluginIds) {
|
|
95
|
+
const channelConfig = cfg.channels?.[pluginKey];
|
|
96
|
+
if (!channelConfig || typeof channelConfig !== "object") continue;
|
|
97
|
+
if (channelConfig.enabled !== true) continue;
|
|
98
|
+
const allowBefore = cfg.plugins.allow.length;
|
|
99
|
+
ensurePluginAllowed({ cfg, pluginKey });
|
|
100
|
+
if (cfg.plugins.allow.length > allowBefore) changed = true;
|
|
101
|
+
const existingEntry = cfg.plugins.entries[pluginKey];
|
|
102
|
+
if (!existingEntry || existingEntry.enabled !== true) {
|
|
103
|
+
cfg.plugins.entries[pluginKey] = {
|
|
104
|
+
...(existingEntry && typeof existingEntry === "object" ? existingEntry : {}),
|
|
105
|
+
enabled: true,
|
|
106
|
+
};
|
|
107
|
+
changed = true;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return changed;
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
const reconcileManagedPluginConfig = (cfg = {}) => {
|
|
114
|
+
let changed = ensureUsageTrackerPluginEntry(cfg);
|
|
115
|
+
if (reconcileEnabledChannelPlugins(cfg)) changed = true;
|
|
116
|
+
if (reconcileDiscordGroupPolicy(cfg)) changed = true;
|
|
117
|
+
return changed;
|
|
118
|
+
};
|
|
119
|
+
|
|
73
120
|
const ensureUsageTrackerPluginConfig = ({ fsModule, openclawDir }) => {
|
|
74
121
|
const cfg = readOpenclawConfig({
|
|
75
122
|
fsModule,
|
|
76
123
|
openclawDir,
|
|
77
124
|
fallback: {},
|
|
78
125
|
});
|
|
79
|
-
const changed =
|
|
126
|
+
const changed = reconcileManagedPluginConfig(cfg);
|
|
80
127
|
if (!changed) return false;
|
|
81
128
|
writeOpenclawConfig({
|
|
82
129
|
fsModule,
|
|
@@ -89,8 +136,12 @@ const ensureUsageTrackerPluginConfig = ({ fsModule, openclawDir }) => {
|
|
|
89
136
|
|
|
90
137
|
module.exports = {
|
|
91
138
|
kUsageTrackerPluginPath,
|
|
139
|
+
kDefaultDiscordGroupPolicy,
|
|
92
140
|
ensurePluginsShell,
|
|
93
141
|
ensurePluginAllowed,
|
|
94
142
|
ensureUsageTrackerPluginEntry,
|
|
143
|
+
reconcileDiscordGroupPolicy,
|
|
144
|
+
reconcileEnabledChannelPlugins,
|
|
145
|
+
reconcileManagedPluginConfig,
|
|
95
146
|
ensureUsageTrackerPluginConfig,
|
|
96
147
|
};
|
package/lib/server.js
CHANGED
|
@@ -65,6 +65,10 @@ const {
|
|
|
65
65
|
getDoctorCard,
|
|
66
66
|
updateDoctorCardStatus,
|
|
67
67
|
} = require("./server/db/doctor");
|
|
68
|
+
const {
|
|
69
|
+
initAuthDb,
|
|
70
|
+
createLoginThrottleStore,
|
|
71
|
+
} = require("./server/db/auth");
|
|
68
72
|
const { createWebhookMiddleware } = require("./server/webhook-middleware");
|
|
69
73
|
const {
|
|
70
74
|
readEnvFile,
|
|
@@ -186,7 +190,10 @@ const agentsService = createAgentsService({
|
|
|
186
190
|
restartGateway: () => restartGatewayWithReload(reloadEnv),
|
|
187
191
|
clawCmd,
|
|
188
192
|
});
|
|
189
|
-
const loginThrottle = {
|
|
193
|
+
const loginThrottle = {
|
|
194
|
+
...createLoginThrottle({ store: createLoginThrottleStore() }),
|
|
195
|
+
getClientKey,
|
|
196
|
+
};
|
|
190
197
|
const resolveSetupUrl = () =>
|
|
191
198
|
resolveSetupUiUrl(
|
|
192
199
|
process.env.ALPHACLAW_SETUP_URL ||
|
|
@@ -219,6 +226,7 @@ const cronService = createCronService({
|
|
|
219
226
|
app.use(express.static(path.join(__dirname, "public")));
|
|
220
227
|
initializeServerDatabases({
|
|
221
228
|
constants,
|
|
229
|
+
initAuthDb,
|
|
222
230
|
initWebhooksDb,
|
|
223
231
|
initWatchdogDb,
|
|
224
232
|
initUsageDb,
|
|
@@ -286,7 +294,11 @@ const doSyncPromptFiles = () => {
|
|
|
286
294
|
});
|
|
287
295
|
installGogCliSkill({ fs, openclawDir: constants.OPENCLAW_DIR });
|
|
288
296
|
};
|
|
289
|
-
const {
|
|
297
|
+
const {
|
|
298
|
+
isAuthorizedRequest,
|
|
299
|
+
gmailWatchService,
|
|
300
|
+
runOnboardedBootSequence: runOnboardedBoot,
|
|
301
|
+
} = registerServerRoutes({
|
|
290
302
|
app,
|
|
291
303
|
fs,
|
|
292
304
|
constants,
|
|
@@ -308,6 +320,17 @@ const { isAuthorizedRequest, gmailWatchService } = registerServerRoutes({
|
|
|
308
320
|
ensureGatewayProxyConfig,
|
|
309
321
|
getBaseUrl,
|
|
310
322
|
startGateway,
|
|
323
|
+
ensureManagedExecDefaults: () =>
|
|
324
|
+
ensureManagedExecDefaults({
|
|
325
|
+
fsModule: fs,
|
|
326
|
+
openclawDir: constants.OPENCLAW_DIR,
|
|
327
|
+
}),
|
|
328
|
+
ensureUsageTrackerPluginConfig: () =>
|
|
329
|
+
ensureUsageTrackerPluginConfig({
|
|
330
|
+
fsModule: fs,
|
|
331
|
+
openclawDir: constants.OPENCLAW_DIR,
|
|
332
|
+
}),
|
|
333
|
+
resolveSetupUrl,
|
|
311
334
|
syncChannelConfig,
|
|
312
335
|
getChannelStatus,
|
|
313
336
|
openclawVersionService,
|
|
@@ -393,26 +416,7 @@ startServerLifecycle({
|
|
|
393
416
|
server,
|
|
394
417
|
PORT,
|
|
395
418
|
isOnboarded,
|
|
396
|
-
runOnboardedBootSequence,
|
|
397
|
-
ensureManagedExecDefaults: () =>
|
|
398
|
-
ensureManagedExecDefaults({
|
|
399
|
-
fsModule: fs,
|
|
400
|
-
openclawDir: constants.OPENCLAW_DIR,
|
|
401
|
-
}),
|
|
402
|
-
ensureUsageTrackerPluginConfig: () =>
|
|
403
|
-
ensureUsageTrackerPluginConfig({
|
|
404
|
-
fsModule: fs,
|
|
405
|
-
openclawDir: constants.OPENCLAW_DIR,
|
|
406
|
-
}),
|
|
407
|
-
doSyncPromptFiles,
|
|
408
|
-
reloadEnv,
|
|
409
|
-
syncChannelConfig,
|
|
410
|
-
readEnvFile,
|
|
411
|
-
ensureGatewayProxyConfig,
|
|
412
|
-
resolveSetupUrl,
|
|
413
|
-
startGateway,
|
|
414
|
-
watchdog,
|
|
415
|
-
gmailWatchService,
|
|
419
|
+
runOnboardedBootSequence: runOnboardedBoot,
|
|
416
420
|
});
|
|
417
421
|
registerServerShutdown({
|
|
418
422
|
gmailWatchService,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chrysb/alphaclaw",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.17",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"express": "^4.21.0",
|
|
35
35
|
"http-proxy": "^1.18.1",
|
|
36
|
-
"openclaw": "2026.5.
|
|
36
|
+
"openclaw": "2026.5.28",
|
|
37
37
|
"ws": "^8.19.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|