clay-server 2.27.0-beta.4 → 2.27.0-beta.6
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/sdk-bridge.js +4 -4
- package/lib/server.js +23 -19
- package/package.json +1 -1
package/lib/sdk-bridge.js
CHANGED
|
@@ -2375,9 +2375,9 @@ function createSDKBridge(opts) {
|
|
|
2375
2375
|
includePartialMessages: true,
|
|
2376
2376
|
abortController: abortController,
|
|
2377
2377
|
canUseTool: opts.canUseTool || function (toolName, input) {
|
|
2378
|
-
var
|
|
2379
|
-
if (
|
|
2380
|
-
return Promise.resolve(
|
|
2378
|
+
var whitelisted = checkToolWhitelist(toolName, input);
|
|
2379
|
+
if (whitelisted) {
|
|
2380
|
+
return Promise.resolve(whitelisted);
|
|
2381
2381
|
}
|
|
2382
2382
|
return Promise.resolve({
|
|
2383
2383
|
behavior: "deny",
|
|
@@ -2386,7 +2386,7 @@ function createSDKBridge(opts) {
|
|
|
2386
2386
|
},
|
|
2387
2387
|
};
|
|
2388
2388
|
if (opts.model) mentionQueryOptions.model = opts.model;
|
|
2389
|
-
if (mcpServers) mentionQueryOptions.mcpServers = mcpServers;
|
|
2389
|
+
if (opts.includeMcpServers && mcpServers) mentionQueryOptions.mcpServers = mcpServers;
|
|
2390
2390
|
query = sdk.query({
|
|
2391
2391
|
prompt: mq,
|
|
2392
2392
|
options: mentionQueryOptions,
|
package/lib/server.js
CHANGED
|
@@ -15,6 +15,7 @@ var { CONFIG_DIR } = require("./config");
|
|
|
15
15
|
var { provisionLinuxUser } = require("./os-users");
|
|
16
16
|
|
|
17
17
|
var https = require("https");
|
|
18
|
+
var pkg = require("../package.json");
|
|
18
19
|
|
|
19
20
|
var publicDir = path.join(__dirname, "public");
|
|
20
21
|
var bundledThemesDir = path.join(__dirname, "themes");
|
|
@@ -1124,31 +1125,34 @@ function createServer(opts) {
|
|
|
1124
1125
|
return;
|
|
1125
1126
|
}
|
|
1126
1127
|
|
|
1127
|
-
// Health check endpoint
|
|
1128
|
+
// Health check endpoint
|
|
1129
|
+
// Unauthenticated: minimal liveness info only
|
|
1130
|
+
// Authenticated: full system details (memory, pid, version, sessions)
|
|
1128
1131
|
if (req.method === "GET" && fullUrl === "/api/health") {
|
|
1129
|
-
var mem = process.memoryUsage();
|
|
1130
|
-
var activeSessions = 0;
|
|
1131
|
-
projects.forEach(function (ctx) {
|
|
1132
|
-
if (ctx && ctx.clients) {
|
|
1133
|
-
activeSessions += ctx.clients.size || 0;
|
|
1134
|
-
}
|
|
1135
|
-
});
|
|
1136
|
-
var pkg = require("../package.json");
|
|
1137
1132
|
var health = {
|
|
1138
1133
|
status: "ok",
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1134
|
+
timestamp: new Date().toISOString(),
|
|
1135
|
+
};
|
|
1136
|
+
if (isRequestAuthed(req)) {
|
|
1137
|
+
var mem = process.memoryUsage();
|
|
1138
|
+
var activeSessions = 0;
|
|
1139
|
+
projects.forEach(function (ctx) {
|
|
1140
|
+
if (ctx && ctx.clients) {
|
|
1141
|
+
activeSessions += ctx.clients.size || 0;
|
|
1142
|
+
}
|
|
1143
|
+
});
|
|
1144
|
+
health.uptime = process.uptime();
|
|
1145
|
+
health.version = pkg.version;
|
|
1146
|
+
health.node = process.version;
|
|
1147
|
+
health.sessions = activeSessions;
|
|
1148
|
+
health.projects = projects.size;
|
|
1149
|
+
health.memory = {
|
|
1145
1150
|
rss: mem.rss,
|
|
1146
1151
|
heapUsed: mem.heapUsed,
|
|
1147
1152
|
heapTotal: mem.heapTotal,
|
|
1148
|
-
}
|
|
1149
|
-
pid
|
|
1150
|
-
|
|
1151
|
-
};
|
|
1153
|
+
};
|
|
1154
|
+
health.pid = process.pid;
|
|
1155
|
+
}
|
|
1152
1156
|
res.writeHead(200, { "Content-Type": "application/json" });
|
|
1153
1157
|
res.end(JSON.stringify(health));
|
|
1154
1158
|
return;
|