agent-shim 8.5.4 → 8.5.6

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
@@ -55519,14 +55519,14 @@ function ensureHeadroom(params) {
55519
55519
  const holders = sessionsForSupervisor(ports.fs, paths.headroomSessionsDir, state.supervisorPid).filter((session) => ports.isRunning(session.pid));
55520
55520
  if (holders.length > 0) {
55521
55521
  throw new HeadroomStartError(
55522
- `agent-shim: the running headroom daemon was started before this launch's front door address and would refuse every request this launch sends through it. It restarts once the launches using it end (pid ${holders.map((session) => String(session.pid)).join(", ")}); end them and launch again, or launch with --no-headroom.`
55522
+ `the running headroom daemon was started before this launch's front door address and would refuse every request this launch sends through it. It restarts once the launches using it end (pid ${holders.map((session) => String(session.pid)).join(", ")}); end them and launch again, or launch with --no-headroom.`
55523
55523
  );
55524
55524
  }
55525
55525
  awaitingAllowlist = true;
55526
55526
  }
55527
55527
  if (state.lastError !== void 0) {
55528
55528
  throw new HeadroomStartError(
55529
- `agent-shim: the headroom daemon reported a fatal error and is not serving: ${state.lastError} (daemon log: ${paths.headroomLogPath})`
55529
+ `the headroom daemon reported a fatal error and is not serving: ${state.lastError} (daemon log: ${paths.headroomLogPath})`
55530
55530
  );
55531
55531
  }
55532
55532
  } else if (!spawnedSupervisor) {
@@ -55550,7 +55550,7 @@ function ensureHeadroom(params) {
55550
55550
  if (ports.now() >= deadline) {
55551
55551
  const lastError = state?.lastError;
55552
55552
  throw new HeadroomStartError(
55553
- `agent-shim: the headroom daemon did not become ready within ${String(HEADROOM_START_TIMEOUT_MS)}ms` + (lastError === void 0 ? "" : ` (last error: ${lastError})`) + (awaitingAllowlist ? " (the running daemon's allowlist does not admit this launch's front door, and it did not restart)" : "") + `. Daemon log: ${paths.headroomLogPath}`
55553
+ `the headroom daemon did not become ready within ${String(HEADROOM_START_TIMEOUT_MS)}ms` + (lastError === void 0 ? "" : ` (last error: ${lastError})`) + (awaitingAllowlist ? " (the running daemon's allowlist does not admit this launch's front door, and it did not restart)" : "") + `. Daemon log: ${paths.headroomLogPath}`
55554
55554
  );
55555
55555
  }
55556
55556
  ports.sleep(HEADROOM_LAUNCHER_POLL_MS);
@@ -61586,7 +61586,7 @@ function registerIdentityCommand(program2, deps) {
61586
61586
  // package.json
61587
61587
  var package_default = {
61588
61588
  name: "agent-shim",
61589
- version: "8.5.4",
61589
+ version: "8.5.6",
61590
61590
  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.",
61591
61591
  license: "MIT",
61592
61592
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -67706,10 +67706,13 @@ function sequenceNumsOf(body) {
67706
67706
  return void 0;
67707
67707
  }
67708
67708
  const sequenceNum = result.sequence_num;
67709
- if (typeof sequenceNum !== "number") {
67709
+ if (typeof sequenceNum === "number") {
67710
+ sequenceNums.push(sequenceNum);
67711
+ } else if (typeof sequenceNum === "string" && /^[0-9]+$/.test(sequenceNum)) {
67712
+ sequenceNums.push(Number(sequenceNum));
67713
+ } else {
67710
67714
  return void 0;
67711
67715
  }
67712
- sequenceNums.push(sequenceNum);
67713
67716
  }
67714
67717
  return sequenceNums.length === 0 ? void 0 : sequenceNums;
67715
67718
  }
@@ -69489,7 +69492,7 @@ function ensureFrontDoor(params) {
69489
69492
  ports.stopSupervisor(supervisorPid);
69490
69493
  while (ports.isRunning(supervisorPid)) {
69491
69494
  if (ports.now() >= deadline) {
69492
- throw new FrontDoorStartError(`agent-shim: the front door (pid ${String(supervisorPid)}, protocol ${String(state.protocol ?? 0)}) is older than this launcher (protocol ${String(FRONT_DOOR_PROTOCOL)}) and did not exit when asked. Daemon log: ${paths.frontdoorLogPath}`);
69495
+ throw new FrontDoorStartError(`the front door (pid ${String(supervisorPid)}, protocol ${String(state.protocol ?? 0)}) is older than this launcher (protocol ${String(FRONT_DOOR_PROTOCOL)}) and did not exit when asked. Daemon log: ${paths.frontdoorLogPath}`);
69493
69496
  }
69494
69497
  ports.sleep(FRONTDOOR_LAUNCHER_POLL_MS);
69495
69498
  }
@@ -69503,13 +69506,13 @@ function ensureFrontDoor(params) {
69503
69506
  }
69504
69507
  lastRejection = `the listener on 127.0.0.1:${String(state.port)} (recorded for pid ${String(supervisorPid)}) failed authentication: ${verdict.reason}`;
69505
69508
  if (spawned) {
69506
- throw new FrontDoorStartError(`agent-shim: ${lastRejection}; refusing to send this session's credentials to it. Daemon log: ${paths.frontdoorLogPath}`);
69509
+ throw new FrontDoorStartError(`${lastRejection}; refusing to send this session's credentials to it. Daemon log: ${paths.frontdoorLogPath}`);
69507
69510
  }
69508
69511
  distrusted.add(supervisorPid);
69509
69512
  continue;
69510
69513
  }
69511
69514
  if (state?.lastError !== void 0) {
69512
- throw new FrontDoorStartError(`agent-shim: the front door reported a fatal error and is not serving: ${state.lastError} (daemon log: ${paths.frontdoorLogPath})`);
69515
+ throw new FrontDoorStartError(`the front door reported a fatal error and is not serving: ${state.lastError} (daemon log: ${paths.frontdoorLogPath})`);
69513
69516
  }
69514
69517
  } else if (!spawned) {
69515
69518
  ports.fs.mkdirp(paths.frontdoorDir);
@@ -69529,7 +69532,7 @@ function ensureFrontDoor(params) {
69529
69532
  if (ports.now() >= deadline) {
69530
69533
  const lastError = state?.lastError;
69531
69534
  throw new FrontDoorStartError(
69532
- `agent-shim: the front door did not become ready within ${String(FRONTDOOR_START_TIMEOUT_MS)}ms` + (lastError === void 0 ? "" : ` (last error: ${lastError})`) + (lastRejection === void 0 ? "" : ` (${lastRejection})`) + `. Daemon log: ${paths.frontdoorLogPath}`
69535
+ `the front door did not become ready within ${String(FRONTDOOR_START_TIMEOUT_MS)}ms` + (lastError === void 0 ? "" : ` (last error: ${lastError})`) + (lastRejection === void 0 ? "" : ` (${lastRejection})`) + `. Daemon log: ${paths.frontdoorLogPath}`
69533
69536
  );
69534
69537
  }
69535
69538
  ports.sleep(FRONTDOOR_LAUNCHER_POLL_MS);
package/dist/index.cjs CHANGED
@@ -4010,10 +4010,13 @@ function sequenceNumsOf(body) {
4010
4010
  return void 0;
4011
4011
  }
4012
4012
  const sequenceNum = result.sequence_num;
4013
- if (typeof sequenceNum !== "number") {
4013
+ if (typeof sequenceNum === "number") {
4014
+ sequenceNums.push(sequenceNum);
4015
+ } else if (typeof sequenceNum === "string" && /^[0-9]+$/.test(sequenceNum)) {
4016
+ sequenceNums.push(Number(sequenceNum));
4017
+ } else {
4014
4018
  return void 0;
4015
4019
  }
4016
- sequenceNums.push(sequenceNum);
4017
4020
  }
4018
4021
  return sequenceNums.length === 0 ? void 0 : sequenceNums;
4019
4022
  }
@@ -4586,7 +4589,7 @@ function ensureFrontDoor(params) {
4586
4589
  ports.stopSupervisor(supervisorPid);
4587
4590
  while (ports.isRunning(supervisorPid)) {
4588
4591
  if (ports.now() >= deadline) {
4589
- throw new FrontDoorStartError(`agent-shim: the front door (pid ${String(supervisorPid)}, protocol ${String(state.protocol ?? 0)}) is older than this launcher (protocol ${String(FRONT_DOOR_PROTOCOL)}) and did not exit when asked. Daemon log: ${paths.frontdoorLogPath}`);
4592
+ throw new FrontDoorStartError(`the front door (pid ${String(supervisorPid)}, protocol ${String(state.protocol ?? 0)}) is older than this launcher (protocol ${String(FRONT_DOOR_PROTOCOL)}) and did not exit when asked. Daemon log: ${paths.frontdoorLogPath}`);
4590
4593
  }
4591
4594
  ports.sleep(FRONTDOOR_LAUNCHER_POLL_MS);
4592
4595
  }
@@ -4600,13 +4603,13 @@ function ensureFrontDoor(params) {
4600
4603
  }
4601
4604
  lastRejection = `the listener on 127.0.0.1:${String(state.port)} (recorded for pid ${String(supervisorPid)}) failed authentication: ${verdict.reason}`;
4602
4605
  if (spawned) {
4603
- throw new FrontDoorStartError(`agent-shim: ${lastRejection}; refusing to send this session's credentials to it. Daemon log: ${paths.frontdoorLogPath}`);
4606
+ throw new FrontDoorStartError(`${lastRejection}; refusing to send this session's credentials to it. Daemon log: ${paths.frontdoorLogPath}`);
4604
4607
  }
4605
4608
  distrusted.add(supervisorPid);
4606
4609
  continue;
4607
4610
  }
4608
4611
  if (state?.lastError !== void 0) {
4609
- throw new FrontDoorStartError(`agent-shim: the front door reported a fatal error and is not serving: ${state.lastError} (daemon log: ${paths.frontdoorLogPath})`);
4612
+ throw new FrontDoorStartError(`the front door reported a fatal error and is not serving: ${state.lastError} (daemon log: ${paths.frontdoorLogPath})`);
4610
4613
  }
4611
4614
  } else if (!spawned) {
4612
4615
  ports.fs.mkdirp(paths.frontdoorDir);
@@ -4626,7 +4629,7 @@ function ensureFrontDoor(params) {
4626
4629
  if (ports.now() >= deadline) {
4627
4630
  const lastError = state?.lastError;
4628
4631
  throw new FrontDoorStartError(
4629
- `agent-shim: the front door did not become ready within ${String(FRONTDOOR_START_TIMEOUT_MS)}ms` + (lastError === void 0 ? "" : ` (last error: ${lastError})`) + (lastRejection === void 0 ? "" : ` (${lastRejection})`) + `. Daemon log: ${paths.frontdoorLogPath}`
4632
+ `the front door did not become ready within ${String(FRONTDOOR_START_TIMEOUT_MS)}ms` + (lastError === void 0 ? "" : ` (last error: ${lastError})`) + (lastRejection === void 0 ? "" : ` (${lastRejection})`) + `. Daemon log: ${paths.frontdoorLogPath}`
4630
4633
  );
4631
4634
  }
4632
4635
  ports.sleep(FRONTDOOR_LAUNCHER_POLL_MS);
@@ -4965,14 +4968,14 @@ function ensureHeadroom(params) {
4965
4968
  const holders = sessionsForSupervisor(ports.fs, paths.headroomSessionsDir, state.supervisorPid).filter((session) => ports.isRunning(session.pid));
4966
4969
  if (holders.length > 0) {
4967
4970
  throw new HeadroomStartError(
4968
- `agent-shim: the running headroom daemon was started before this launch's front door address and would refuse every request this launch sends through it. It restarts once the launches using it end (pid ${holders.map((session) => String(session.pid)).join(", ")}); end them and launch again, or launch with --no-headroom.`
4971
+ `the running headroom daemon was started before this launch's front door address and would refuse every request this launch sends through it. It restarts once the launches using it end (pid ${holders.map((session) => String(session.pid)).join(", ")}); end them and launch again, or launch with --no-headroom.`
4969
4972
  );
4970
4973
  }
4971
4974
  awaitingAllowlist = true;
4972
4975
  }
4973
4976
  if (state.lastError !== void 0) {
4974
4977
  throw new HeadroomStartError(
4975
- `agent-shim: the headroom daemon reported a fatal error and is not serving: ${state.lastError} (daemon log: ${paths.headroomLogPath})`
4978
+ `the headroom daemon reported a fatal error and is not serving: ${state.lastError} (daemon log: ${paths.headroomLogPath})`
4976
4979
  );
4977
4980
  }
4978
4981
  } else if (!spawnedSupervisor) {
@@ -4996,7 +4999,7 @@ function ensureHeadroom(params) {
4996
4999
  if (ports.now() >= deadline) {
4997
5000
  const lastError = state?.lastError;
4998
5001
  throw new HeadroomStartError(
4999
- `agent-shim: the headroom daemon did not become ready within ${String(HEADROOM_START_TIMEOUT_MS)}ms` + (lastError === void 0 ? "" : ` (last error: ${lastError})`) + (awaitingAllowlist ? " (the running daemon's allowlist does not admit this launch's front door, and it did not restart)" : "") + `. Daemon log: ${paths.headroomLogPath}`
5002
+ `the headroom daemon did not become ready within ${String(HEADROOM_START_TIMEOUT_MS)}ms` + (lastError === void 0 ? "" : ` (last error: ${lastError})`) + (awaitingAllowlist ? " (the running daemon's allowlist does not admit this launch's front door, and it did not restart)" : "") + `. Daemon log: ${paths.headroomLogPath}`
5000
5003
  );
5001
5004
  }
5002
5005
  ports.sleep(HEADROOM_LAUNCHER_POLL_MS);
package/dist/index.mjs CHANGED
@@ -3826,10 +3826,13 @@ function sequenceNumsOf(body) {
3826
3826
  return void 0;
3827
3827
  }
3828
3828
  const sequenceNum = result.sequence_num;
3829
- if (typeof sequenceNum !== "number") {
3829
+ if (typeof sequenceNum === "number") {
3830
+ sequenceNums.push(sequenceNum);
3831
+ } else if (typeof sequenceNum === "string" && /^[0-9]+$/.test(sequenceNum)) {
3832
+ sequenceNums.push(Number(sequenceNum));
3833
+ } else {
3830
3834
  return void 0;
3831
3835
  }
3832
- sequenceNums.push(sequenceNum);
3833
3836
  }
3834
3837
  return sequenceNums.length === 0 ? void 0 : sequenceNums;
3835
3838
  }
@@ -4402,7 +4405,7 @@ function ensureFrontDoor(params) {
4402
4405
  ports.stopSupervisor(supervisorPid);
4403
4406
  while (ports.isRunning(supervisorPid)) {
4404
4407
  if (ports.now() >= deadline) {
4405
- throw new FrontDoorStartError(`agent-shim: the front door (pid ${String(supervisorPid)}, protocol ${String(state.protocol ?? 0)}) is older than this launcher (protocol ${String(FRONT_DOOR_PROTOCOL)}) and did not exit when asked. Daemon log: ${paths.frontdoorLogPath}`);
4408
+ throw new FrontDoorStartError(`the front door (pid ${String(supervisorPid)}, protocol ${String(state.protocol ?? 0)}) is older than this launcher (protocol ${String(FRONT_DOOR_PROTOCOL)}) and did not exit when asked. Daemon log: ${paths.frontdoorLogPath}`);
4406
4409
  }
4407
4410
  ports.sleep(FRONTDOOR_LAUNCHER_POLL_MS);
4408
4411
  }
@@ -4416,13 +4419,13 @@ function ensureFrontDoor(params) {
4416
4419
  }
4417
4420
  lastRejection = `the listener on 127.0.0.1:${String(state.port)} (recorded for pid ${String(supervisorPid)}) failed authentication: ${verdict.reason}`;
4418
4421
  if (spawned) {
4419
- throw new FrontDoorStartError(`agent-shim: ${lastRejection}; refusing to send this session's credentials to it. Daemon log: ${paths.frontdoorLogPath}`);
4422
+ throw new FrontDoorStartError(`${lastRejection}; refusing to send this session's credentials to it. Daemon log: ${paths.frontdoorLogPath}`);
4420
4423
  }
4421
4424
  distrusted.add(supervisorPid);
4422
4425
  continue;
4423
4426
  }
4424
4427
  if (state?.lastError !== void 0) {
4425
- throw new FrontDoorStartError(`agent-shim: the front door reported a fatal error and is not serving: ${state.lastError} (daemon log: ${paths.frontdoorLogPath})`);
4428
+ throw new FrontDoorStartError(`the front door reported a fatal error and is not serving: ${state.lastError} (daemon log: ${paths.frontdoorLogPath})`);
4426
4429
  }
4427
4430
  } else if (!spawned) {
4428
4431
  ports.fs.mkdirp(paths.frontdoorDir);
@@ -4442,7 +4445,7 @@ function ensureFrontDoor(params) {
4442
4445
  if (ports.now() >= deadline) {
4443
4446
  const lastError = state?.lastError;
4444
4447
  throw new FrontDoorStartError(
4445
- `agent-shim: the front door did not become ready within ${String(FRONTDOOR_START_TIMEOUT_MS)}ms` + (lastError === void 0 ? "" : ` (last error: ${lastError})`) + (lastRejection === void 0 ? "" : ` (${lastRejection})`) + `. Daemon log: ${paths.frontdoorLogPath}`
4448
+ `the front door did not become ready within ${String(FRONTDOOR_START_TIMEOUT_MS)}ms` + (lastError === void 0 ? "" : ` (last error: ${lastError})`) + (lastRejection === void 0 ? "" : ` (${lastRejection})`) + `. Daemon log: ${paths.frontdoorLogPath}`
4446
4449
  );
4447
4450
  }
4448
4451
  ports.sleep(FRONTDOOR_LAUNCHER_POLL_MS);
@@ -4781,14 +4784,14 @@ function ensureHeadroom(params) {
4781
4784
  const holders = sessionsForSupervisor(ports.fs, paths.headroomSessionsDir, state.supervisorPid).filter((session) => ports.isRunning(session.pid));
4782
4785
  if (holders.length > 0) {
4783
4786
  throw new HeadroomStartError(
4784
- `agent-shim: the running headroom daemon was started before this launch's front door address and would refuse every request this launch sends through it. It restarts once the launches using it end (pid ${holders.map((session) => String(session.pid)).join(", ")}); end them and launch again, or launch with --no-headroom.`
4787
+ `the running headroom daemon was started before this launch's front door address and would refuse every request this launch sends through it. It restarts once the launches using it end (pid ${holders.map((session) => String(session.pid)).join(", ")}); end them and launch again, or launch with --no-headroom.`
4785
4788
  );
4786
4789
  }
4787
4790
  awaitingAllowlist = true;
4788
4791
  }
4789
4792
  if (state.lastError !== void 0) {
4790
4793
  throw new HeadroomStartError(
4791
- `agent-shim: the headroom daemon reported a fatal error and is not serving: ${state.lastError} (daemon log: ${paths.headroomLogPath})`
4794
+ `the headroom daemon reported a fatal error and is not serving: ${state.lastError} (daemon log: ${paths.headroomLogPath})`
4792
4795
  );
4793
4796
  }
4794
4797
  } else if (!spawnedSupervisor) {
@@ -4812,7 +4815,7 @@ function ensureHeadroom(params) {
4812
4815
  if (ports.now() >= deadline) {
4813
4816
  const lastError = state?.lastError;
4814
4817
  throw new HeadroomStartError(
4815
- `agent-shim: the headroom daemon did not become ready within ${String(HEADROOM_START_TIMEOUT_MS)}ms` + (lastError === void 0 ? "" : ` (last error: ${lastError})`) + (awaitingAllowlist ? " (the running daemon's allowlist does not admit this launch's front door, and it did not restart)" : "") + `. Daemon log: ${paths.headroomLogPath}`
4818
+ `the headroom daemon did not become ready within ${String(HEADROOM_START_TIMEOUT_MS)}ms` + (lastError === void 0 ? "" : ` (last error: ${lastError})`) + (awaitingAllowlist ? " (the running daemon's allowlist does not admit this launch's front door, and it did not restart)" : "") + `. Daemon log: ${paths.headroomLogPath}`
4816
4819
  );
4817
4820
  }
4818
4821
  ports.sleep(HEADROOM_LAUNCHER_POLL_MS);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-shim",
3
- "version": "8.5.4",
3
+ "version": "8.5.6",
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>",