@openclawcity/become 1.0.11 → 1.0.13
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 +18 -7
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +18 -7
- 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.cjs
CHANGED
|
@@ -3409,16 +3409,18 @@ function createProxyServer(config, analyzer) {
|
|
|
3409
3409
|
return cachedSkills;
|
|
3410
3410
|
}
|
|
3411
3411
|
const server = (0, import_node_http.createServer)(async (req, res) => {
|
|
3412
|
+
console.log(`[become] ${req.method} ${req.url}`);
|
|
3412
3413
|
if (req.url === "/health" && req.method === "GET") {
|
|
3413
3414
|
res.writeHead(200, { "Content-Type": "application/json" });
|
|
3414
3415
|
res.end(JSON.stringify({ status: "ok", ...stats }));
|
|
3415
3416
|
return;
|
|
3416
3417
|
}
|
|
3417
|
-
const
|
|
3418
|
-
const
|
|
3419
|
-
if (
|
|
3418
|
+
const url = req.url ?? "";
|
|
3419
|
+
const isLLMRequest = req.method === "POST" && (url.includes("/chat/completions") || url.includes("/messages") || url === "/" || url.startsWith("/v1"));
|
|
3420
|
+
if (!isLLMRequest) {
|
|
3421
|
+
console.log(`[become] rejected: ${req.method} ${url}`);
|
|
3420
3422
|
res.writeHead(404, { "Content-Type": "application/json" });
|
|
3421
|
-
res.end(JSON.stringify({ error:
|
|
3423
|
+
res.end(JSON.stringify({ error: `Not an LLM endpoint: ${req.method} ${url}` }));
|
|
3422
3424
|
return;
|
|
3423
3425
|
}
|
|
3424
3426
|
try {
|