claude-use 11.67.0 → 11.67.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.cjs CHANGED
@@ -29675,6 +29675,9 @@ async function runSupervisor(initialConfig, ports, options = {}) {
29675
29675
  return HEADROOM_SUPERVISOR_STILL_RUNNING;
29676
29676
  }
29677
29677
  ticks += 1;
29678
+ if (ports.rotateDaemonLog({ maxBytes: HEADROOM_LOG_MAX_BYTES, keptGenerations: HEADROOM_LOG_KEPT_GENERATIONS })) {
29679
+ ports.log(`agent-shim headroom supervisor: rotated the daemon log past ${String(HEADROOM_LOG_MAX_BYTES)} bytes, keeping ${String(HEADROOM_LOG_KEPT_GENERATIONS)} earlier file(s)`);
29680
+ }
29678
29681
  config2 = ports.readConfig();
29679
29682
  const settingsHash = hashSettings(config2.settings);
29680
29683
  const inputs = currentHeadroomAllowlistInputs(fs31, paths, ports.frontDoorLiveness);
@@ -29825,7 +29828,7 @@ function lastLines(output2) {
29825
29828
  const lines = redactText(output2).split("\n").map((line) => line.trim()).filter((line) => line !== "").map((line) => line.length > DAEMON_EXIT_LOG_LINE_CHARS ? `${line.slice(0, DAEMON_EXIT_LOG_LINE_CHARS)}...` : line);
29826
29829
  return lines.length === 0 ? "(the daemon wrote nothing)" : lines.slice(-DAEMON_EXIT_LOG_LINES).join(" | ");
29827
29830
  }
29828
- var import_node_path9, HEADROOM_BACKOFF_BASE_MS, HEADROOM_BACKOFF_CAP_MS, HEADROOM_START_RETRY_BUDGET, HEADROOM_READY_TIMEOUT_MS, DAEMON_EXIT_LOG_LINES, DAEMON_EXIT_LOG_LINE_CHARS, DAEMON_LOG_TAIL_BYTES, HEADROOM_POLL_MS, MS_PER_MINUTE, STOP_POLL_MS, TERM_GRACE_MS, KILL_GRACE_MS, HEADROOM_SUPERVISOR_STILL_RUNNING;
29831
+ var import_node_path9, HEADROOM_BACKOFF_BASE_MS, HEADROOM_BACKOFF_CAP_MS, HEADROOM_START_RETRY_BUDGET, HEADROOM_READY_TIMEOUT_MS, DAEMON_EXIT_LOG_LINES, DAEMON_EXIT_LOG_LINE_CHARS, DAEMON_LOG_TAIL_BYTES, BYTES_PER_KIB, BYTES_PER_MIB, HEADROOM_LOG_MAX_MIB, HEADROOM_LOG_MAX_BYTES, HEADROOM_LOG_KEPT_GENERATIONS, HEADROOM_POLL_MS, MS_PER_MINUTE, STOP_POLL_MS, TERM_GRACE_MS, KILL_GRACE_MS, HEADROOM_SUPERVISOR_STILL_RUNNING;
29829
29832
  var init_supervisor = __esm({
29830
29833
  "src/headroom/supervisor.ts"() {
29831
29834
  "use strict";
@@ -29845,6 +29848,11 @@ var init_supervisor = __esm({
29845
29848
  DAEMON_EXIT_LOG_LINES = 6;
29846
29849
  DAEMON_EXIT_LOG_LINE_CHARS = 400;
29847
29850
  DAEMON_LOG_TAIL_BYTES = 8192;
29851
+ BYTES_PER_KIB = 1024;
29852
+ BYTES_PER_MIB = BYTES_PER_KIB * BYTES_PER_KIB;
29853
+ HEADROOM_LOG_MAX_MIB = 64;
29854
+ HEADROOM_LOG_MAX_BYTES = HEADROOM_LOG_MAX_MIB * BYTES_PER_MIB;
29855
+ HEADROOM_LOG_KEPT_GENERATIONS = 2;
29848
29856
  HEADROOM_POLL_MS = 1e3;
29849
29857
  MS_PER_MINUTE = 6e4;
29850
29858
  STOP_POLL_MS = 100;
@@ -37379,7 +37387,7 @@ var init_package = __esm({
37379
37387
  "package.json"() {
37380
37388
  package_default = {
37381
37389
  name: "claude-use",
37382
- version: "11.67.0",
37390
+ version: "11.67.1",
37383
37391
  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.",
37384
37392
  license: "MIT",
37385
37393
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -134063,9 +134071,9 @@ async function headroomReady(deps, signal) {
134063
134071
  }
134064
134072
  var HOP_RESET_RETRIES = 1;
134065
134073
  var HOP_RESET_CODES = /* @__PURE__ */ new Set(["ECONNRESET", "EPIPE"]);
134066
- var BYTES_PER_MIB = 1048576;
134074
+ var BYTES_PER_MIB2 = 1048576;
134067
134075
  var MESSAGES_API_LIMIT_MIB = 32;
134068
- var MAX_BODY_BYTES = MESSAGES_API_LIMIT_MIB * BYTES_PER_MIB;
134076
+ var MAX_BODY_BYTES = MESSAGES_API_LIMIT_MIB * BYTES_PER_MIB2;
134069
134077
  async function collectBody(body) {
134070
134078
  return await new Promise((resolve3) => {
134071
134079
  const chunks = [];
@@ -135754,9 +135762,9 @@ var import_node_stream3 = require("node:stream");
135754
135762
 
135755
135763
  // src/frontdoor/requestScan.ts
135756
135764
  var import_node_stream2 = require("node:stream");
135757
- var BYTES_PER_KIB = 1024;
135765
+ var BYTES_PER_KIB2 = 1024;
135758
135766
  var SCAN_KIB = 64;
135759
- var REQUEST_SCAN_CAP_BYTES = SCAN_KIB * BYTES_PER_KIB;
135767
+ var REQUEST_SCAN_CAP_BYTES = SCAN_KIB * BYTES_PER_KIB2;
135760
135768
  async function scanRequestHead(request7, wholeBody = false) {
135761
135769
  const body = request7.body;
135762
135770
  const head = [];
@@ -154848,6 +154856,25 @@ var import_node_path65 = __toESM(require("node:path"), 1);
154848
154856
  var import_node_child_process10 = require("node:child_process");
154849
154857
  init_commandDeps();
154850
154858
  init_configProfilesStore();
154859
+
154860
+ // src/logRotation.ts
154861
+ function rotateLogIfOver(fs31, logPath, limits) {
154862
+ if ((fs31.lstat(logPath)?.sizeBytes ?? 0) <= limits.maxBytes) {
154863
+ return false;
154864
+ }
154865
+ const generation = (index) => `${logPath}.${String(index)}`;
154866
+ fs31.removeRecursive(generation(limits.keptGenerations));
154867
+ for (let index = limits.keptGenerations - 1; index >= 1; index -= 1) {
154868
+ if (fs31.lstat(generation(index)) !== void 0) {
154869
+ fs31.rename(generation(index), generation(index + 1));
154870
+ }
154871
+ }
154872
+ fs31.copyRecursive(logPath, generation(1));
154873
+ fs31.writeFileUtf8(logPath, "");
154874
+ return true;
154875
+ }
154876
+
154877
+ // src/headroom/commands.ts
154851
154878
  init_realFrontDoorPort();
154852
154879
  init_trust();
154853
154880
 
@@ -155064,6 +155091,7 @@ function realSupervisorPorts(paths) {
155064
155091
  daemonCommandLine: realProcessCommandLine,
155065
155092
  daemonLogSize: () => realFileSize(paths.headroomLogPath),
155066
155093
  readDaemonLogTail: (fromByte, maxBytes) => realReadFileTail(paths.headroomLogPath, fromByte, maxBytes),
155094
+ rotateDaemonLog: (limits) => rotateLogIfOver(realFarmFs, paths.headroomLogPath, limits),
155067
155095
  socketTrust: realHeadroomSocketTrust,
155068
155096
  readConfig: () => resolveSupervisorConfig(readGlobalConfig(paths)?.headroom ?? {}),
155069
155097
  spawnHeadroom: (socketPath, allowlistFile, settings2) => {
package/dist/index.cjs CHANGED
@@ -4762,7 +4762,7 @@ var init_package = __esm({
4762
4762
  "package.json"() {
4763
4763
  package_default = {
4764
4764
  name: "claude-use",
4765
- version: "11.67.0",
4765
+ version: "11.67.1",
4766
4766
  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.",
4767
4767
  license: "MIT",
4768
4768
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -5773,6 +5773,9 @@ async function runSupervisor(initialConfig, ports, options = {}) {
5773
5773
  return HEADROOM_SUPERVISOR_STILL_RUNNING;
5774
5774
  }
5775
5775
  ticks += 1;
5776
+ if (ports.rotateDaemonLog({ maxBytes: HEADROOM_LOG_MAX_BYTES, keptGenerations: HEADROOM_LOG_KEPT_GENERATIONS })) {
5777
+ ports.log(`agent-shim headroom supervisor: rotated the daemon log past ${String(HEADROOM_LOG_MAX_BYTES)} bytes, keeping ${String(HEADROOM_LOG_KEPT_GENERATIONS)} earlier file(s)`);
5778
+ }
5776
5779
  config = ports.readConfig();
5777
5780
  const settingsHash = hashSettings(config.settings);
5778
5781
  const inputs = currentHeadroomAllowlistInputs(fs14, paths, ports.frontDoorLiveness);
@@ -5923,7 +5926,7 @@ function lastLines(output) {
5923
5926
  const lines = redactText(output).split("\n").map((line) => line.trim()).filter((line) => line !== "").map((line) => line.length > DAEMON_EXIT_LOG_LINE_CHARS ? `${line.slice(0, DAEMON_EXIT_LOG_LINE_CHARS)}...` : line);
5924
5927
  return lines.length === 0 ? "(the daemon wrote nothing)" : lines.slice(-DAEMON_EXIT_LOG_LINES).join(" | ");
5925
5928
  }
5926
- var import_node_path14, HEADROOM_BACKOFF_BASE_MS, HEADROOM_BACKOFF_CAP_MS, HEADROOM_START_RETRY_BUDGET, HEADROOM_READY_TIMEOUT_MS, DAEMON_EXIT_LOG_LINES, DAEMON_EXIT_LOG_LINE_CHARS, DAEMON_LOG_TAIL_BYTES, HEADROOM_POLL_MS, MS_PER_MINUTE2, HEADROOM_SUPERVISOR_STILL_RUNNING;
5929
+ var import_node_path14, HEADROOM_BACKOFF_BASE_MS, HEADROOM_BACKOFF_CAP_MS, HEADROOM_START_RETRY_BUDGET, HEADROOM_READY_TIMEOUT_MS, DAEMON_EXIT_LOG_LINES, DAEMON_EXIT_LOG_LINE_CHARS, DAEMON_LOG_TAIL_BYTES, BYTES_PER_KIB, BYTES_PER_MIB, HEADROOM_LOG_MAX_MIB, HEADROOM_LOG_MAX_BYTES, HEADROOM_LOG_KEPT_GENERATIONS, HEADROOM_POLL_MS, MS_PER_MINUTE2, HEADROOM_SUPERVISOR_STILL_RUNNING;
5927
5930
  var init_supervisor2 = __esm({
5928
5931
  "src/headroom/supervisor.ts"() {
5929
5932
  "use strict";
@@ -5943,6 +5946,11 @@ var init_supervisor2 = __esm({
5943
5946
  DAEMON_EXIT_LOG_LINES = 6;
5944
5947
  DAEMON_EXIT_LOG_LINE_CHARS = 400;
5945
5948
  DAEMON_LOG_TAIL_BYTES = 8192;
5949
+ BYTES_PER_KIB = 1024;
5950
+ BYTES_PER_MIB = BYTES_PER_KIB * BYTES_PER_KIB;
5951
+ HEADROOM_LOG_MAX_MIB = 64;
5952
+ HEADROOM_LOG_MAX_BYTES = HEADROOM_LOG_MAX_MIB * BYTES_PER_MIB;
5953
+ HEADROOM_LOG_KEPT_GENERATIONS = 2;
5946
5954
  HEADROOM_POLL_MS = 1e3;
5947
5955
  MS_PER_MINUTE2 = 6e4;
5948
5956
  HEADROOM_SUPERVISOR_STILL_RUNNING = -1;
package/dist/index.mjs CHANGED
@@ -4738,7 +4738,7 @@ var init_package = __esm({
4738
4738
  "package.json"() {
4739
4739
  package_default = {
4740
4740
  name: "claude-use",
4741
- version: "11.67.0",
4741
+ version: "11.67.1",
4742
4742
  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.",
4743
4743
  license: "MIT",
4744
4744
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -5750,6 +5750,9 @@ async function runSupervisor(initialConfig, ports, options = {}) {
5750
5750
  return HEADROOM_SUPERVISOR_STILL_RUNNING;
5751
5751
  }
5752
5752
  ticks += 1;
5753
+ if (ports.rotateDaemonLog({ maxBytes: HEADROOM_LOG_MAX_BYTES, keptGenerations: HEADROOM_LOG_KEPT_GENERATIONS })) {
5754
+ ports.log(`agent-shim headroom supervisor: rotated the daemon log past ${String(HEADROOM_LOG_MAX_BYTES)} bytes, keeping ${String(HEADROOM_LOG_KEPT_GENERATIONS)} earlier file(s)`);
5755
+ }
5753
5756
  config = ports.readConfig();
5754
5757
  const settingsHash = hashSettings(config.settings);
5755
5758
  const inputs = currentHeadroomAllowlistInputs(fs14, paths, ports.frontDoorLiveness);
@@ -5900,7 +5903,7 @@ function lastLines(output) {
5900
5903
  const lines = redactText(output).split("\n").map((line) => line.trim()).filter((line) => line !== "").map((line) => line.length > DAEMON_EXIT_LOG_LINE_CHARS ? `${line.slice(0, DAEMON_EXIT_LOG_LINE_CHARS)}...` : line);
5901
5904
  return lines.length === 0 ? "(the daemon wrote nothing)" : lines.slice(-DAEMON_EXIT_LOG_LINES).join(" | ");
5902
5905
  }
5903
- var HEADROOM_BACKOFF_BASE_MS, HEADROOM_BACKOFF_CAP_MS, HEADROOM_START_RETRY_BUDGET, HEADROOM_READY_TIMEOUT_MS, DAEMON_EXIT_LOG_LINES, DAEMON_EXIT_LOG_LINE_CHARS, DAEMON_LOG_TAIL_BYTES, HEADROOM_POLL_MS, MS_PER_MINUTE2, HEADROOM_SUPERVISOR_STILL_RUNNING;
5906
+ var HEADROOM_BACKOFF_BASE_MS, HEADROOM_BACKOFF_CAP_MS, HEADROOM_START_RETRY_BUDGET, HEADROOM_READY_TIMEOUT_MS, DAEMON_EXIT_LOG_LINES, DAEMON_EXIT_LOG_LINE_CHARS, DAEMON_LOG_TAIL_BYTES, BYTES_PER_KIB, BYTES_PER_MIB, HEADROOM_LOG_MAX_MIB, HEADROOM_LOG_MAX_BYTES, HEADROOM_LOG_KEPT_GENERATIONS, HEADROOM_POLL_MS, MS_PER_MINUTE2, HEADROOM_SUPERVISOR_STILL_RUNNING;
5904
5907
  var init_supervisor2 = __esm({
5905
5908
  "src/headroom/supervisor.ts"() {
5906
5909
  "use strict";
@@ -5919,6 +5922,11 @@ var init_supervisor2 = __esm({
5919
5922
  DAEMON_EXIT_LOG_LINES = 6;
5920
5923
  DAEMON_EXIT_LOG_LINE_CHARS = 400;
5921
5924
  DAEMON_LOG_TAIL_BYTES = 8192;
5925
+ BYTES_PER_KIB = 1024;
5926
+ BYTES_PER_MIB = BYTES_PER_KIB * BYTES_PER_KIB;
5927
+ HEADROOM_LOG_MAX_MIB = 64;
5928
+ HEADROOM_LOG_MAX_BYTES = HEADROOM_LOG_MAX_MIB * BYTES_PER_MIB;
5929
+ HEADROOM_LOG_KEPT_GENERATIONS = 2;
5922
5930
  HEADROOM_POLL_MS = 1e3;
5923
5931
  MS_PER_MINUTE2 = 6e4;
5924
5932
  HEADROOM_SUPERVISOR_STILL_RUNNING = -1;
@@ -8895,6 +8895,14 @@ interface FileAllowlistDrift {
8895
8895
  readonly hashLags: boolean;
8896
8896
  }
8897
8897
 
8898
+ /** When a log is rotated and how much of its history is kept. */
8899
+ interface LogRotationLimits {
8900
+ /** The size in bytes above which the live file is rotated. */
8901
+ readonly maxBytes: number;
8902
+ /** How many rotated files are kept beside the live one, at least one: `<log>.1` is the newest and `<log>.<keptGenerations>` the oldest, and the file shifted past it is deleted. */
8903
+ readonly keptGenerations: number;
8904
+ }
8905
+
8898
8906
  /** The token-saving settings of the `headroom` config block, without its install and lifecycle fields (`source`, `idleShutdownMinutes`). */
8899
8907
  type HeadroomSettings = Pick<HeadroomGlobalConfig, "mode" | "targetRatio" | "ccr" | "rolloutChannel" | "interceptToolResults" | "readMaturation">;
8900
8908
 
@@ -8929,8 +8937,10 @@ interface SupervisorPorts {
8929
8937
  readonly frontDoorLiveness: (pids: readonly number[]) => FrontDoorLiveness;
8930
8938
  /** The daemon log's size in bytes (0 before it exists): where the next start attempt's own output will begin. */
8931
8939
  readonly daemonLogSize: () => number;
8932
- /** The daemon log from byte `fromByte` to its end, at most its last `maxBytes`, read without loading the whole file (nothing rotates the log). */
8940
+ /** The daemon log from byte `fromByte` to its end, at most its last `maxBytes`, read without loading the whole file. */
8933
8941
  readonly readDaemonLogTail: (fromByte: number, maxBytes: number) => string;
8942
+ /** Rotates the daemon log when it is over `limits.maxBytes` (see `rotateLogIfOver`), returning whether it did. Every offset `daemonLogSize` returned earlier is invalid afterwards, so the supervisor calls it only at the top of a tick, before it takes the offset of any start attempt. */
8943
+ readonly rotateDaemonLog: (limits: LogRotationLimits) => boolean;
8934
8944
  /** The command line of a running process as `ps` reports it, or undefined when it cannot be read: how a recorded orphan daemon is confirmed to be one before it is signalled (see `daemonIdentity`). */
8935
8945
  readonly daemonCommandLine: (pid: number) => string | undefined;
8936
8946
  /** The platform facts and owner-only checks the daemon's socket directory is prepared and verified with (see `prepareHeadroomSocket`). */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-use",
3
- "version": "11.67.0",
3
+ "version": "11.67.1",
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>",