@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/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 isOpenAI = req.url === "/v1/chat/completions";
3418
- const isAnthropic = req.url === "/v1/messages";
3419
- if (req.method !== "POST" || !isOpenAI && !isAnthropic) {
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: "Not found. Use POST /v1/chat/completions or /v1/messages" }));
3423
+ res.end(JSON.stringify({ error: `Not an LLM endpoint: ${req.method} ${url}` }));
3422
3424
  return;
3423
3425
  }
3424
3426
  try {