clay-server 2.27.0-beta.3 → 2.27.0-beta.5
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 +1 -0
- package/lib/server.js +23 -19
- package/package.json +1 -1
package/lib/sdk-bridge.js
CHANGED
|
@@ -2386,6 +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
2390
|
query = sdk.query({
|
|
2390
2391
|
prompt: mq,
|
|
2391
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;
|