@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/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 isOpenAI = req.url === "/v1/chat/completions";
3345
- const isAnthropic = req.url === "/v1/messages";
3346
- if (req.method !== "POST" || !isOpenAI && !isAnthropic) {
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: "Not found. Use POST /v1/chat/completions or /v1/messages" }));
3350
+ res.end(JSON.stringify({ error: `Not an LLM endpoint: ${req.method} ${url}` }));
3349
3351
  return;
3350
3352
  }
3351
3353
  try {