claude-use 11.1.0 → 11.2.0

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
@@ -3467,14 +3467,14 @@ var init_schemas = __esm({
3467
3467
  const desc = Object.getOwnPropertyDescriptor(def, "shape");
3468
3468
  const sh2 = desc?.get ? desc.get.raw : def.shape ?? {};
3469
3469
  if (sh2) {
3470
- const get2 = () => {
3470
+ const get3 = () => {
3471
3471
  const newSh = { ...sh2 };
3472
3472
  Object.defineProperty(def, "shape", { value: newSh });
3473
- get2.raw = newSh;
3473
+ get3.raw = newSh;
3474
3474
  return newSh;
3475
3475
  };
3476
- get2.raw = sh2;
3477
- Object.defineProperty(def, "shape", { get: get2 });
3476
+ get3.raw = sh2;
3477
+ Object.defineProperty(def, "shape", { get: get3 });
3478
3478
  }
3479
3479
  const _normalized = cached(() => normalizeDef(def));
3480
3480
  defineLazyInternal(inst, "propValues", (zod) => {
@@ -33969,7 +33969,7 @@ var init_package = __esm({
33969
33969
  "package.json"() {
33970
33970
  package_default = {
33971
33971
  name: "claude-use",
33972
- version: "11.1.0",
33972
+ version: "11.2.0",
33973
33973
  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.",
33974
33974
  license: "MIT",
33975
33975
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -109879,12 +109879,12 @@ function resolveWriteTarget(context) {
109879
109879
  activeConfigProfile: context.activeConfigProfile
109880
109880
  });
109881
109881
  }
109882
- function resolveCategoryState(get2) {
109882
+ function resolveCategoryState(get3) {
109883
109883
  return {
109884
- runtime: get2("runtime") ?? SHIPPED_CATEGORY_DEFAULTS.runtime,
109885
- history: get2("history") ?? SHIPPED_CATEGORY_DEFAULTS.history,
109886
- knowledge: get2("knowledge") ?? SHIPPED_CATEGORY_DEFAULTS.knowledge,
109887
- settings: get2("settings") ?? SHIPPED_CATEGORY_DEFAULTS.settings
109884
+ runtime: get3("runtime") ?? SHIPPED_CATEGORY_DEFAULTS.runtime,
109885
+ history: get3("history") ?? SHIPPED_CATEGORY_DEFAULTS.history,
109886
+ knowledge: get3("knowledge") ?? SHIPPED_CATEGORY_DEFAULTS.knowledge,
109887
+ settings: get3("settings") ?? SHIPPED_CATEGORY_DEFAULTS.settings
109888
109888
  };
109889
109889
  }
109890
109890
  function currentCategoryState(context) {
@@ -113473,13 +113473,13 @@ init_pick();
113473
113473
  function createHeadroomDecision() {
113474
113474
  const sessions = /* @__PURE__ */ new Map();
113475
113475
  return {
113476
- decide: (sessionId, wanted, nowMs) => {
113476
+ decide: async (sessionId, wanted, nowMs, available) => {
113477
113477
  if (sessionId === void 0) {
113478
- return wanted;
113478
+ return wanted && await available();
113479
113479
  }
113480
113480
  const state = sessions.get(sessionId);
113481
113481
  const atBoundary = state === void 0 || nowMs - state.lastEndedAtMs > PROMPT_CACHE_TTL_MS || state.cacheReadInputTokens === 0;
113482
- const viaHeadroom = atBoundary ? wanted : state.viaHeadroom;
113482
+ const viaHeadroom = atBoundary ? wanted && await available() : state.viaHeadroom;
113483
113483
  sessions.set(sessionId, { viaHeadroom, lastEndedAtMs: state?.lastEndedAtMs ?? nowMs, cacheReadInputTokens: state?.cacheReadInputTokens ?? 0 });
113484
113484
  return viaHeadroom;
113485
113485
  },
@@ -126264,6 +126264,33 @@ async function answerBadGateway(response, message) {
126264
126264
  response.end();
126265
126265
  }
126266
126266
  var HOP_AGENT = new http4.Agent({ keepAlive: false });
126267
+ async function headroomReady(deps, signal) {
126268
+ const target = deps.headroomSocket();
126269
+ if (target === void 0 || target.refused !== void 0) {
126270
+ return false;
126271
+ }
126272
+ const { socketPath } = target;
126273
+ return await new Promise((resolve2) => {
126274
+ const probe = http4.get({ socketPath, path: "/health", agent: HOP_AGENT, signal }, (response) => {
126275
+ void (0, import_consumers.buffer)(response).then(
126276
+ (body) => {
126277
+ try {
126278
+ const parsed = JSON.parse(body.toString("utf8"));
126279
+ resolve2(response.statusCode === HTTP_STATUS.ok && typeof parsed === "object" && parsed !== null && "ready" in parsed && parsed.ready === true);
126280
+ } catch {
126281
+ resolve2(false);
126282
+ }
126283
+ },
126284
+ () => {
126285
+ resolve2(false);
126286
+ }
126287
+ );
126288
+ });
126289
+ probe.on("error", () => {
126290
+ resolve2(false);
126291
+ });
126292
+ });
126293
+ }
126267
126294
  var HOP_RESET_RETRIES = 1;
126268
126295
  var HOP_RESET_CODES = /* @__PURE__ */ new Set(["ECONNRESET", "EPIPE"]);
126269
126296
  async function collectBody(request7) {
@@ -126485,7 +126512,8 @@ async function serveRouted(request7, deps) {
126485
126512
  response2.end();
126486
126513
  return;
126487
126514
  }
126488
- const wantsHeadroom = deps.headroomDecision.decide(identified.session.sessionId, identified.session.headroom, deps.now());
126515
+ const { headroom } = deps;
126516
+ const wantsHeadroom = await deps.headroomDecision.decide(identified.session.sessionId, identified.session.headroom, deps.now(), async () => headroom !== void 0 && await headroomReady(headroom, request7.signal));
126489
126517
  const viaHeadroom = wantsHeadroom && resolution.route.headroomEligible && deps.headroom !== void 0;
126490
126518
  const response = createRoutedResponse(request7.response, { deps, session: identified.session, route: resolution.route.name, request: { ...observed, viaHeadroom } });
126491
126519
  try {
package/dist/index.cjs CHANGED
@@ -2758,7 +2758,7 @@ var init_package = __esm({
2758
2758
  "package.json"() {
2759
2759
  package_default = {
2760
2760
  name: "claude-use",
2761
- version: "11.1.0",
2761
+ version: "11.2.0",
2762
2762
  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.",
2763
2763
  license: "MIT",
2764
2764
  author: "Joseph Mearman <joseph@mearman.co.uk>",
package/dist/index.mjs CHANGED
@@ -2734,7 +2734,7 @@ var init_package = __esm({
2734
2734
  "package.json"() {
2735
2735
  package_default = {
2736
2736
  name: "claude-use",
2737
- version: "11.1.0",
2737
+ version: "11.2.0",
2738
2738
  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.",
2739
2739
  license: "MIT",
2740
2740
  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.1.0",
3
+ "version": "11.2.0",
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>",