@openclawcity/become 1.0.13 → 1.0.18

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.d.cts CHANGED
@@ -831,7 +831,7 @@ interface ProxyStats {
831
831
  lessons_extracted: number;
832
832
  started_at: string;
833
833
  }
834
- declare function createProxyServer(config: ProxyConfig, analyzer?: ConversationAnalyzer): {
834
+ declare function createProxyServer(config: ProxyConfig, analyzer?: ConversationAnalyzer, overrideUpstreamUrl?: string): {
835
835
  server: node_http.Server<typeof IncomingMessage, typeof ServerResponse>;
836
836
  stats: ProxyStats;
837
837
  store: FileSkillStore;
package/dist/index.d.ts CHANGED
@@ -831,7 +831,7 @@ interface ProxyStats {
831
831
  lessons_extracted: number;
832
832
  started_at: string;
833
833
  }
834
- declare function createProxyServer(config: ProxyConfig, analyzer?: ConversationAnalyzer): {
834
+ declare function createProxyServer(config: ProxyConfig, analyzer?: ConversationAnalyzer, overrideUpstreamUrl?: string): {
835
835
  server: node_http.Server<typeof IncomingMessage, typeof ServerResponse>;
836
836
  stats: ProxyStats;
837
837
  store: FileSkillStore;
package/dist/index.js CHANGED
@@ -3315,7 +3315,7 @@ Rules:
3315
3315
 
3316
3316
  // src/proxy/server.ts
3317
3317
  var SKILL_CACHE_TTL_MS = 5e3;
3318
- function createProxyServer(config, analyzer) {
3318
+ function createProxyServer(config, analyzer, overrideUpstreamUrl) {
3319
3319
  const store = new FileSkillStore({ baseDir: config.baseDir });
3320
3320
  const trust = new TrustManager(config.baseDir);
3321
3321
  const extractor = analyzer ? new LessonExtractor(store, trust, analyzer) : null;
@@ -3362,7 +3362,7 @@ function createProxyServer(config, analyzer) {
3362
3362
  stats.skills_injected++;
3363
3363
  }
3364
3364
  }
3365
- const upstreamUrl = buildUpstreamUrl(config, req.url);
3365
+ const upstreamUrl = buildUpstreamUrl(overrideUpstreamUrl ?? config.llm_base_url, req.url);
3366
3366
  const upstreamHeaders = buildUpstreamHeaders(config, req.headers);
3367
3367
  const isStreaming = body.stream === true;
3368
3368
  const modifiedBody = JSON.stringify(body);
@@ -3446,8 +3446,8 @@ function readBody(req) {
3446
3446
  req.on("error", reject);
3447
3447
  });
3448
3448
  }
3449
- function buildUpstreamUrl(config, path) {
3450
- const base = config.llm_base_url.replace(/\/+$/, "");
3449
+ function buildUpstreamUrl(baseUrl, path) {
3450
+ const base = baseUrl.replace(/\/+$/, "");
3451
3451
  return `${base}${path}`;
3452
3452
  }
3453
3453
  function buildUpstreamHeaders(config, incomingHeaders) {