@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.js CHANGED
@@ -731,16 +731,18 @@ function createProxyServer(config, analyzer) {
731
731
  return cachedSkills;
732
732
  }
733
733
  const server = createServer(async (req, res) => {
734
+ console.log(`[become] ${req.method} ${req.url}`);
734
735
  if (req.url === "/health" && req.method === "GET") {
735
736
  res.writeHead(200, { "Content-Type": "application/json" });
736
737
  res.end(JSON.stringify({ status: "ok", ...stats }));
737
738
  return;
738
739
  }
739
- const isOpenAI = req.url === "/v1/chat/completions";
740
- const isAnthropic = req.url === "/v1/messages";
741
- if (req.method !== "POST" || !isOpenAI && !isAnthropic) {
740
+ const url = req.url ?? "";
741
+ const isLLMRequest = req.method === "POST" && (url.includes("/chat/completions") || url.includes("/messages") || url === "/" || url.startsWith("/v1"));
742
+ if (!isLLMRequest) {
743
+ console.log(`[become] rejected: ${req.method} ${url}`);
742
744
  res.writeHead(404, { "Content-Type": "application/json" });
743
- res.end(JSON.stringify({ error: "Not found. Use POST /v1/chat/completions or /v1/messages" }));
745
+ res.end(JSON.stringify({ error: `Not an LLM endpoint: ${req.method} ${url}` }));
744
746
  return;
745
747
  }
746
748
  try {