proxitor 0.9.0 → 0.9.1

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.mjs CHANGED
@@ -21481,7 +21481,7 @@ async function runConfigMenu(client) {
21481
21481
  }
21482
21482
  //#endregion
21483
21483
  //#region src/version.ts
21484
- const version = "0.9.0";
21484
+ const version = "0.9.1";
21485
21485
  //#endregion
21486
21486
  //#region src/commands/doctor.ts
21487
21487
  const DEFAULT_TIMEOUT_MS = 3e3;
@@ -24747,7 +24747,8 @@ const INJECT_PATHS = new Set(Object.keys(ENDPOINT_MAP));
24747
24747
  /** Endpoints that are natively Anthropic (cache_control is always safe regardless of model). */
24748
24748
  const ANTHROPIC_NATIVE_ENDPOINTS = new Set(["messages", "responses"]);
24749
24749
  function classifyEndpoint(pathname) {
24750
- return ENDPOINT_MAP[pathname] ?? "other";
24750
+ const queryIndex = pathname.indexOf("?");
24751
+ return ENDPOINT_MAP[queryIndex === -1 ? pathname : pathname.slice(0, queryIndex)] ?? "other";
24751
24752
  }
24752
24753
  function buildUpstreamUrl(pathname, config) {
24753
24754
  return `${config.openrouterBaseUrl}${pathname}`;
@@ -24787,8 +24788,8 @@ const injectCacheControl = createMiddleware(async (c, next) => {
24787
24788
  await next();
24788
24789
  return;
24789
24790
  }
24790
- if (shouldInjectCacheControl(resolved.cacheControl, c.var.modelName, c.var.path)) {
24791
- const isAnthropic = isAnthropicEndpoint(c.var.modelName, c.var.path);
24791
+ if (shouldInjectCacheControl(resolved.cacheControl, c.var.modelName, c.req.path)) {
24792
+ const isAnthropic = isAnthropicEndpoint(c.var.modelName, c.req.path);
24792
24793
  parsedBody.cache_control = buildCacheControl(parsedBody.cache_control, resolved.cacheControlTtl, isAnthropic);
24793
24794
  c.set("bodyMutated", true);
24794
24795
  }
@@ -24866,7 +24867,7 @@ function deriveSessionId(incomingHeaders, parsedBody, path, mode) {
24866
24867
  //#region src/proxy/middleware/inject-session-id.ts
24867
24868
  const injectSessionId = createMiddleware(async (c, next) => {
24868
24869
  const mode = c.var.resolvedConfig.sessionId;
24869
- const sessionId = deriveSessionId(c.req.raw.headers, c.var.parsedBody, c.var.path, mode);
24870
+ const sessionId = deriveSessionId(c.req.raw.headers, c.var.parsedBody, c.req.path, mode);
24870
24871
  if (sessionId) c.set("effectiveSessionId", sessionId);
24871
24872
  await next();
24872
24873
  });