claude-use 11.44.2 → 11.44.3

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.cjs CHANGED
@@ -34701,7 +34701,7 @@ var init_package = __esm({
34701
34701
  "package.json"() {
34702
34702
  package_default = {
34703
34703
  name: "claude-use",
34704
- version: "11.44.2",
34704
+ version: "11.44.3",
34705
34705
  description: "A profile manager and launcher for Claude Code that lets one person run multiple logins from one machine while controlling what gets shared between them.",
34706
34706
  license: "MIT",
34707
34707
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -34986,7 +34986,7 @@ function parseProviderPath(path65) {
34986
34986
  }
34987
34987
  return { provider: decodeURIComponent(tail.slice(0, slash)), rest: tail.slice(slash) };
34988
34988
  }
34989
- var HEADROOM_SESSION_HEADER, INTERNAL_HEADER_NAMES, IDENTITY_HEADER, SESSION_HEADER, PROVIDER_HEADER, HEADROOM_FLAG_HEADER, ROUTE_BY_NAME_HEADER, PROJECT_ID_HEADER, CLIENT_SESSION_HEADER, HEADROOM_BASE_URL_HEADER, AUTH_HEADER, HOP_SECRET_HEADER, HOP_ID_HEADER, MODEL_CHOICE_HEADER, PROVIDER_PATH_PREFIX;
34989
+ var HEADROOM_SESSION_HEADER, INTERNAL_HEADER_NAMES, IDENTITY_HEADER, SESSION_HEADER, PROVIDER_HEADER, HEADROOM_FLAG_HEADER, ROUTE_BY_NAME_HEADER, PROJECT_ID_HEADER, CLIENT_SESSION_HEADER, HEADROOM_BASE_URL_HEADER, AUTH_HEADER, HOP_SECRET_HEADER, HOP_ID_HEADER, PROVIDER_PATH_PREFIX;
34990
34990
  var init_route = __esm({
34991
34991
  "src/frontdoor/route.ts"() {
34992
34992
  "use strict";
@@ -35015,7 +35015,6 @@ var init_route = __esm({
35015
35015
  AUTH_HEADER = "x-agent-shim-auth";
35016
35016
  HOP_SECRET_HEADER = "x-agent-shim-hop";
35017
35017
  HOP_ID_HEADER = "x-agent-shim-hop-id";
35018
- MODEL_CHOICE_HEADER = "x-agent-shim-model-choice";
35019
35018
  PROVIDER_PATH_PREFIX = "/providers/";
35020
35019
  }
35021
35020
  });
@@ -35316,9 +35315,15 @@ function destinationOf(path65, sessionProvider) {
35316
35315
  }
35317
35316
  return { provider: sessionProvider ?? ANTHROPIC_PROVIDER, endpoint: path65 };
35318
35317
  }
35318
+ function modelChoiceOf(event, servedModel, provider) {
35319
+ if (event.modelChoice !== void 0) return event.modelChoice;
35320
+ if (event.requestedModel === void 0 || servedModel === void 0 || event.requestedModel === servedModel) return void 0;
35321
+ return { requested: event.requestedModel, providers: [provider] };
35322
+ }
35319
35323
  function buildRecord(event, context) {
35320
35324
  const { scan } = context;
35321
35325
  const { provider, endpoint } = destinationOf(event.servedPath, event.session.provider);
35326
+ const choice = modelChoiceOf(event, scan?.model, provider);
35322
35327
  const rateLimitHeaders = rateLimitHeadersOf(event.headers);
35323
35328
  const limit = classifyLimit({ status: event.status, headers: rateLimitHeaders ?? {}, error: scan?.error, nowMs: context.endedAt });
35324
35329
  const requestId = headerValue(event.headers, "request-id");
@@ -35335,8 +35340,8 @@ function buildRecord(event, context) {
35335
35340
  method: event.method,
35336
35341
  endpoint,
35337
35342
  ...scan?.model === void 0 ? {} : { model: scan.model },
35338
- ...event.modelChoice === void 0 ? {} : { requestedModel: event.modelChoice.requested },
35339
- ...event.modelChoice !== void 0 && event.modelChoice.providers.length > 1 ? { candidateProviders: [...event.modelChoice.providers] } : {},
35343
+ ...choice === void 0 ? {} : { requestedModel: choice.requested },
35344
+ ...choice !== void 0 && choice.providers.length > 1 ? { candidateProviders: [...choice.providers] } : {},
35340
35345
  status: event.status,
35341
35346
  latencyMs: Math.max(0, Math.round(context.headAt - event.receivedAt)),
35342
35347
  durationMs: Math.max(0, Math.round(context.endedAt - event.receivedAt)),
@@ -116917,8 +116922,6 @@ function createDoorPipelines(deps) {
116917
116922
  direct: {
116918
116923
  resolveRoute: deps.resolveRoute,
116919
116924
  responseObservers: [],
116920
- // The direct pipeline's responses are consumed by this door's own headroom hop, never by a client, so the noted model choice rides the head home as MODEL_CHOICE_HEADER (see `exposeModelChoiceOnHead`) instead of dying with the observers this pipeline deliberately runs none of.
116921
- exposeModelChoiceOnHead: true,
116922
116925
  admit: admitHop(deps.hopSecret, deps.custody),
116923
116926
  headroomDecision: deps.headroomDecision,
116924
116927
  now: deps.now,
@@ -130150,7 +130153,7 @@ function responseHeaders(headers) {
130150
130153
  }
130151
130154
  return result;
130152
130155
  }
130153
- async function applyHeadroomHop(request7, response, upstream, deps, onThread) {
130156
+ async function applyHeadroomHop(request7, response, upstream, deps, onFacts) {
130154
130157
  const target = deps.headroomSocket();
130155
130158
  if (target === void 0) {
130156
130159
  await answerBadGateway(response, "agent-shim front door: the headroom daemon is restarting");
@@ -130186,7 +130189,7 @@ async function applyHeadroomHop(request7, response, upstream, deps, onThread) {
130186
130189
  }
130187
130190
  headers[HOP_SECRET_HEADER] = deps.hopSecret;
130188
130191
  try {
130189
- await forwardThroughHeadroom(request7, response, { socketPath, headers, log: deps.log, onThread });
130192
+ await forwardThroughHeadroom(request7, response, { socketPath, headers, log: deps.log, onFacts });
130190
130193
  } finally {
130191
130194
  if (hopId !== void 0) {
130192
130195
  deps.custody.release(hopId);
@@ -130267,21 +130270,17 @@ async function collectBody(body) {
130267
130270
  });
130268
130271
  });
130269
130272
  }
130270
- function parseModelChoiceHeader(value2) {
130271
- if (value2 === void 0) return void 0;
130272
- let parsed;
130273
+ function requestedModelOf(body) {
130273
130274
  try {
130274
- parsed = JSON.parse(value2);
130275
+ const parsed = JSON.parse(body.toString("utf8"));
130276
+ if (typeof parsed !== "object" || parsed === null || !("model" in parsed) || typeof parsed.model !== "string") return void 0;
130277
+ return parsed.model;
130275
130278
  } catch {
130276
130279
  return void 0;
130277
130280
  }
130278
- if (typeof parsed !== "object" || parsed === null || !("requested" in parsed) || !("providers" in parsed) || typeof parsed.requested !== "string" || !Array.isArray(parsed.providers)) return void 0;
130279
- const providers = [];
130280
- for (const name of parsed.providers) {
130281
- if (typeof name !== "string") return void 0;
130282
- providers.push(name);
130283
- }
130284
- return { requested: parsed.requested, providers };
130281
+ }
130282
+ function hopFactsOf(body) {
130283
+ return { lineage: lineageOf(body), requestedModel: requestedModelOf(body) };
130285
130284
  }
130286
130285
  async function forwardThroughHeadroom(request7, response, target) {
130287
130286
  const collected = await collectBody(request7.body);
@@ -130296,7 +130295,7 @@ async function forwardThroughHeadroom(request7, response, target) {
130296
130295
  return;
130297
130296
  }
130298
130297
  const { body } = collected;
130299
- target.onThread(lineageOf(body));
130298
+ target.onFacts(hopFactsOf(body));
130300
130299
  for (let retriesLeft = HOP_RESET_RETRIES; ; retriesLeft -= 1) {
130301
130300
  const outcome = await hopOnce(request7, response, target, body, retriesLeft > 0);
130302
130301
  if (outcome === "settled") {
@@ -130308,12 +130307,7 @@ async function hopOnce(request7, response, target, body, mayRetry) {
130308
130307
  const { socketPath, headers } = target;
130309
130308
  return await new Promise((resolve2) => {
130310
130309
  const onUpstreamResponse = (upstreamResponse) => {
130311
- const { [MODEL_CHOICE_HEADER]: choiceHeader, ...head } = responseHeaders(upstreamResponse.headers);
130312
- const choice = parseModelChoiceHeader(choiceHeader);
130313
- if (choice !== void 0) {
130314
- response.noteModelChoice?.(choice);
130315
- }
130316
- response.start(upstreamResponse.statusCode ?? HTTP_BAD_GATEWAY2, head);
130310
+ response.start(upstreamResponse.statusCode ?? HTTP_BAD_GATEWAY2, responseHeaders(upstreamResponse.headers));
130317
130311
  response.flush();
130318
130312
  const stream = async () => {
130319
130313
  try {
@@ -130439,10 +130433,9 @@ function createRoutedResponse(response, context) {
130439
130433
  return headersSent;
130440
130434
  },
130441
130435
  start: (status, headers) => {
130442
- const head = deps.exposeModelChoiceOnHead === true && request7.modelChoice.value !== void 0 ? { ...headers, [MODEL_CHOICE_HEADER]: JSON.stringify(request7.modelChoice.value) } : headers;
130443
130436
  for (const observe of deps.responseObservers) {
130444
130437
  try {
130445
- const body = observe({ session, route, method: request7.method, path: request7.path, servedPath: context.servedPath, receivedAt: request7.receivedAt, viaHeadroom: request7.viaHeadroom, lineage: request7.thread.lineage, modelChoice: request7.modelChoice.value, status, headers });
130438
+ const body = observe({ session, route, method: request7.method, path: request7.path, servedPath: context.servedPath, receivedAt: request7.receivedAt, viaHeadroom: request7.viaHeadroom, lineage: request7.thread.lineage, modelChoice: request7.modelChoice.value, requestedModel: request7.requestedModel.value, status, headers });
130446
130439
  if (body !== void 0) {
130447
130440
  bodyObservers.push(body);
130448
130441
  }
@@ -130450,7 +130443,7 @@ function createRoutedResponse(response, context) {
130450
130443
  deps.log(`front door: response observer threw for ${route}: ${describeThrown(error63)}`);
130451
130444
  }
130452
130445
  }
130453
- response.writeHead(status, head);
130446
+ response.writeHead(status, headers);
130454
130447
  headersSent = true;
130455
130448
  },
130456
130449
  noteModelChoice: (choice) => {
@@ -130486,7 +130479,7 @@ function createRoutedResponse(response, context) {
130486
130479
  };
130487
130480
  }
130488
130481
  async function serveRouted(request7, deps) {
130489
- const observed = { method: request7.method, path: pathOf(request7.url), receivedAt: deps.now(), viaHeadroom: false, thread: { lineage: void 0 }, modelChoice: { value: void 0 } };
130482
+ const observed = { method: request7.method, path: pathOf(request7.url), receivedAt: deps.now(), viaHeadroom: false, thread: { lineage: void 0 }, modelChoice: { value: void 0 }, requestedModel: { value: void 0 } };
130490
130483
  const identified = identifyRequest(request7.headers);
130491
130484
  const admission = deps.admit({ url: request7.url, headers: request7.headers, forwardable: identified.forwardableHeaders });
130492
130485
  if (!admission.ok) {
@@ -130521,8 +130514,9 @@ async function serveRouted(request7, deps) {
130521
130514
  const response = createRoutedResponse(request7.response, { deps, session: identified.session, route: resolution.route.name, request: { ...observed, viaHeadroom }, servedPath: pathOf(resolution.request?.url ?? request7.url) });
130522
130515
  try {
130523
130516
  if (viaHeadroom) {
130524
- await applyHeadroomHop(resolution.request ?? routed, response, resolution.route.headroomUpstream, deps.headroom, (lineage) => {
130525
- observed.thread.lineage = lineage;
130517
+ await applyHeadroomHop(resolution.request ?? routed, response, resolution.route.headroomUpstream, deps.headroom, (facts) => {
130518
+ observed.thread.lineage = facts.lineage;
130519
+ observed.requestedModel.value = facts.requestedModel;
130526
130520
  });
130527
130521
  } else {
130528
130522
  await resolution.route.serve(routed, response);
package/dist/index.cjs CHANGED
@@ -3151,7 +3151,7 @@ var init_package = __esm({
3151
3151
  "package.json"() {
3152
3152
  package_default = {
3153
3153
  name: "claude-use",
3154
- version: "11.44.2",
3154
+ version: "11.44.3",
3155
3155
  description: "A profile manager and launcher for Claude Code that lets one person run multiple logins from one machine while controlling what gets shared between them.",
3156
3156
  license: "MIT",
3157
3157
  author: "Joseph Mearman <joseph@mearman.co.uk>",
package/dist/index.mjs CHANGED
@@ -3127,7 +3127,7 @@ var init_package = __esm({
3127
3127
  "package.json"() {
3128
3128
  package_default = {
3129
3129
  name: "claude-use",
3130
- version: "11.44.2",
3130
+ version: "11.44.3",
3131
3131
  description: "A profile manager and launcher for Claude Code that lets one person run multiple logins from one machine while controlling what gets shared between them.",
3132
3132
  license: "MIT",
3133
3133
  author: "Joseph Mearman <joseph@mearman.co.uk>",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-use",
3
- "version": "11.44.2",
3
+ "version": "11.44.3",
4
4
  "description": "A profile manager and launcher for Claude Code that lets one person run multiple logins from one machine while controlling what gets shared between them.",
5
5
  "license": "MIT",
6
6
  "author": "Joseph Mearman <joseph@mearman.co.uk>",