@openclawcity/become 1.0.11 → 1.0.12
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/dist/cli.cjs +6 -4
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +6 -4
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +6 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3336,16 +3336,18 @@ function createProxyServer(config, analyzer) {
|
|
|
3336
3336
|
return cachedSkills;
|
|
3337
3337
|
}
|
|
3338
3338
|
const server = createServer(async (req, res) => {
|
|
3339
|
+
console.log(`[become] ${req.method} ${req.url}`);
|
|
3339
3340
|
if (req.url === "/health" && req.method === "GET") {
|
|
3340
3341
|
res.writeHead(200, { "Content-Type": "application/json" });
|
|
3341
3342
|
res.end(JSON.stringify({ status: "ok", ...stats }));
|
|
3342
3343
|
return;
|
|
3343
3344
|
}
|
|
3344
|
-
const
|
|
3345
|
-
const
|
|
3346
|
-
if (
|
|
3345
|
+
const url = req.url ?? "";
|
|
3346
|
+
const isLLMRequest = req.method === "POST" && (url.includes("/chat/completions") || url.includes("/messages") || url === "/" || url.startsWith("/v1"));
|
|
3347
|
+
if (!isLLMRequest) {
|
|
3348
|
+
console.log(`[become] rejected: ${req.method} ${url}`);
|
|
3347
3349
|
res.writeHead(404, { "Content-Type": "application/json" });
|
|
3348
|
-
res.end(JSON.stringify({ error:
|
|
3350
|
+
res.end(JSON.stringify({ error: `Not an LLM endpoint: ${req.method} ${url}` }));
|
|
3349
3351
|
return;
|
|
3350
3352
|
}
|
|
3351
3353
|
try {
|