clay-server 2.26.1-beta.1 → 2.27.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/project-connection.js +259 -0
- package/lib/project-file-watch.js +120 -0
- package/lib/project-filesystem.js +482 -0
- package/lib/project-http.js +685 -0
- package/lib/project-image.js +94 -0
- package/lib/project-knowledge.js +161 -0
- package/lib/project-loop.js +1160 -0
- package/lib/project-sessions.js +1152 -0
- package/lib/project-user-message.js +631 -0
- package/lib/project.js +357 -4438
- package/lib/server.js +30 -0
- package/package.json +1 -1
package/lib/server.js
CHANGED
|
@@ -1124,6 +1124,36 @@ function createServer(opts) {
|
|
|
1124
1124
|
return;
|
|
1125
1125
|
}
|
|
1126
1126
|
|
|
1127
|
+
// Health check endpoint (no auth required, for monitoring tools)
|
|
1128
|
+
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
|
+
var health = {
|
|
1138
|
+
status: "ok",
|
|
1139
|
+
uptime: process.uptime(),
|
|
1140
|
+
version: pkg.version,
|
|
1141
|
+
node: process.version,
|
|
1142
|
+
sessions: activeSessions,
|
|
1143
|
+
projects: projects.size,
|
|
1144
|
+
memory: {
|
|
1145
|
+
rss: mem.rss,
|
|
1146
|
+
heapUsed: mem.heapUsed,
|
|
1147
|
+
heapTotal: mem.heapTotal,
|
|
1148
|
+
},
|
|
1149
|
+
pid: process.pid,
|
|
1150
|
+
timestamp: new Date().toISOString(),
|
|
1151
|
+
};
|
|
1152
|
+
res.writeHead(200, { "Content-Type": "application/json" });
|
|
1153
|
+
res.end(JSON.stringify(health));
|
|
1154
|
+
return;
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1127
1157
|
// Theme list: bundled (lib/themes/) + user (~/.clay/themes/)
|
|
1128
1158
|
if (req.method === "GET" && fullUrl === "/api/themes") {
|
|
1129
1159
|
var bundled = {};
|