claude-use 11.62.3 → 11.63.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/index.mjs CHANGED
@@ -3901,12 +3901,13 @@ function pruneDeadFrontDoorSessions(fs14, sessionsDir, listed, isRunning) {
3901
3901
  }
3902
3902
  return removed;
3903
3903
  }
3904
- var FRONT_DOOR_PROTOCOL, FrontDoorSessionSchema, FrontDoorStateSchema, MAX_TCP_PORT, FrontDoorDirectRecordSchema, RECORD_TEMPORARY_FILE;
3904
+ var FRONT_DOOR_PROTOCOL, FRONT_DOOR_HANDOVER_PROTOCOL, FrontDoorSessionSchema, FrontDoorStateSchema, MAX_TCP_PORT, FrontDoorDirectRecordSchema, RECORD_TEMPORARY_FILE;
3905
3905
  var init_state = __esm({
3906
3906
  "src/frontdoor/state.ts"() {
3907
3907
  "use strict";
3908
3908
  init_schema();
3909
- FRONT_DOOR_PROTOCOL = 5;
3909
+ FRONT_DOOR_PROTOCOL = 6;
3910
+ FRONT_DOOR_HANDOVER_PROTOCOL = 6;
3910
3911
  FrontDoorSessionSchema = z5.strictObject({ pid: z5.number().int().positive(), startedAt: z5.number(), token: z5.string().min(1), supervisorPid: z5.number().int().positive().optional(), sessionId: z5.string().min(1).optional(), models: ModelsConfigSchema.optional() });
3911
3912
  FrontDoorStateSchema = z5.strictObject({
3912
3913
  /**
@@ -4003,18 +4004,24 @@ async function serveFrontDoor(idleShutdownMinutes, ports, options) {
4003
4004
  ...lastConnectPort === void 0 ? {} : { lastConnectPort },
4004
4005
  ...lastDirectPort === void 0 ? {} : { lastDirectPort }
4005
4006
  });
4007
+ const { predecessor } = ports;
4008
+ const sourceOf = (listener, preferredPort) => predecessor === void 0 ? { preferredPort } : { inherit: async () => await predecessor.take(listener) };
4006
4009
  const fail = (message) => {
4007
4010
  ports.closeRcStreamHub();
4008
- writeFrontDoorState(fs14, paths.frontdoorStateFile, { lastError: message, ...sticky() });
4009
- fs14.removeRecursive(paths.frontdoorLockFile);
4011
+ if (predecessor === void 0) {
4012
+ writeFrontDoorState(fs14, paths.frontdoorStateFile, { lastError: message, ...sticky() });
4013
+ fs14.removeRecursive(paths.frontdoorLockFile);
4014
+ }
4010
4015
  ports.log(`agent-shim frontdoor supervisor: ${message}`);
4011
4016
  return 1;
4012
4017
  };
4013
- writeFrontDoorState(fs14, paths.frontdoorStateFile, { supervisorPid: ports.ownPid, ...sticky() });
4018
+ if (predecessor === void 0) {
4019
+ writeFrontDoorState(fs14, paths.frontdoorStateFile, { supervisorPid: ports.ownPid, ...sticky() });
4020
+ }
4014
4021
  const previousSticky = lastPort;
4015
4022
  let http3;
4016
4023
  try {
4017
- http3 = await ports.startProviderListener(lastPort);
4024
+ http3 = await ports.startProviderListener(sourceOf("provider", lastPort));
4018
4025
  } catch (error) {
4019
4026
  ports.doorHealth.listenerFailed("provider", error instanceof Error ? error.message : String(error));
4020
4027
  return fail(`could not start the provider listener: ${error instanceof Error ? error.message : String(error)}`);
@@ -4026,7 +4033,7 @@ async function serveFrontDoor(idleShutdownMinutes, ports, options) {
4026
4033
  const previousStickyConnect = lastConnectPort;
4027
4034
  let connect3;
4028
4035
  try {
4029
- connect3 = await ports.startConnectListener(lastConnectPort);
4036
+ connect3 = await ports.startConnectListener(sourceOf("connect", lastConnectPort));
4030
4037
  } catch (error) {
4031
4038
  await http3.close();
4032
4039
  ports.doorHealth.listenerFailed("connect", error instanceof Error ? error.message : String(error));
@@ -4039,7 +4046,7 @@ async function serveFrontDoor(idleShutdownMinutes, ports, options) {
4039
4046
  const previousStickyDirect = lastDirectPort;
4040
4047
  let direct;
4041
4048
  try {
4042
- direct = await ports.startDirectListener(lastDirectPort);
4049
+ direct = await ports.startDirectListener(sourceOf("direct", lastDirectPort));
4043
4050
  } catch (error) {
4044
4051
  await connect3.close();
4045
4052
  await http3.close();
@@ -4053,8 +4060,12 @@ async function serveFrontDoor(idleShutdownMinutes, ports, options) {
4053
4060
  writeFrontDoorDirectRecord(fs14, paths.frontdoorDirectRecordsDir, { pid: ports.ownPid, directPort: direct.port });
4054
4061
  writeFrontDoorState(fs14, paths.frontdoorStateFile, { protocol: FRONT_DOOR_PROTOCOL, supervisorPid: ports.ownPid, port: http3.port, connectPort: connect3.port, directPort: direct.port, ...sticky() });
4055
4062
  ports.doorHealth.generation({ providerPort: http3.port, connectPort: connect3.port, directPort: direct.port });
4056
- fs14.removeRecursive(paths.frontdoorLockFile);
4057
- ports.log(`agent-shim frontdoor supervisor ${String(ports.ownPid)}: front door on 127.0.0.1:${String(http3.port)}, CONNECT surface on 127.0.0.1:${String(connect3.port)}`);
4063
+ if (predecessor === void 0) {
4064
+ fs14.removeRecursive(paths.frontdoorLockFile);
4065
+ } else {
4066
+ predecessor.serving();
4067
+ }
4068
+ ports.log(`agent-shim frontdoor supervisor ${String(ports.ownPid)}: front door on 127.0.0.1:${String(http3.port)}, CONNECT surface on 127.0.0.1:${String(connect3.port)}${predecessor === void 0 ? "" : ", taken over from the door it replaced"}`);
4058
4069
  const watchdog = ports.startWatchdog?.();
4059
4070
  let idleSince;
4060
4071
  let ticks = 0;
@@ -4074,14 +4085,16 @@ async function serveFrontDoor(idleShutdownMinutes, ports, options) {
4074
4085
  resolve();
4075
4086
  };
4076
4087
  ports.retire?.addEventListener("abort", wake, { once: true });
4088
+ ports.handover?.requested.addEventListener("abort", wake, { once: true });
4077
4089
  void ports.sleep(FRONTDOOR_POLL_MS).then(() => {
4078
4090
  ports.retire?.removeEventListener("abort", wake);
4091
+ ports.handover?.requested.removeEventListener("abort", wake);
4079
4092
  resolve();
4080
4093
  });
4081
4094
  });
4082
4095
  };
4083
4096
  const retireByDrain = async () => {
4084
- ports.log(`agent-shim frontdoor supervisor ${String(ports.ownPid)}: asked to exit; releasing the front door's addresses and finishing the connections it carries`);
4097
+ ports.log(`agent-shim frontdoor supervisor ${String(ports.ownPid)}: releasing the front door's addresses and finishing the connections it carries`);
4085
4098
  watchdog?.stop();
4086
4099
  ports.stopBackgroundWork?.();
4087
4100
  const drained = [direct.drain(), connect3.drain(), http3.drain()];
@@ -4096,6 +4109,17 @@ async function serveFrontDoor(idleShutdownMinutes, ports, options) {
4096
4109
  ports.log(`agent-shim frontdoor supervisor ${String(ports.ownPid)}: the connections this door carried have ended; exiting`);
4097
4110
  return 0;
4098
4111
  };
4112
+ const handOverThenDrain = async (run) => {
4113
+ ports.log(`agent-shim frontdoor supervisor ${String(ports.ownPid)}: asked to hand the front door's listeners to a successor; accepting on them until it serves`);
4114
+ const outcome = await run({ provider: http3.listening, connect: connect3.listening, direct: direct.listening });
4115
+ if (outcome.ok) {
4116
+ ports.log(`agent-shim frontdoor supervisor ${String(ports.ownPid)}: successor ${String(outcome.successorPid)} serves the front door's listeners`);
4117
+ ports.doorHealth.superseded(outcome.successorPid);
4118
+ } else {
4119
+ ports.log(`agent-shim frontdoor supervisor ${String(ports.ownPid)}: the handover failed (${outcome.reason}); retiring by drain so a successor is started on the released addresses`);
4120
+ }
4121
+ return await retireByDrain();
4122
+ };
4099
4123
  const closeServing = async () => {
4100
4124
  watchdog?.stop();
4101
4125
  await direct.close();
@@ -4113,8 +4137,12 @@ async function serveFrontDoor(idleShutdownMinutes, ports, options) {
4113
4137
  };
4114
4138
  for (; ; ) {
4115
4139
  if (ports.retire?.aborted === true) {
4140
+ ports.log(`agent-shim frontdoor supervisor ${String(ports.ownPid)}: asked to exit`);
4116
4141
  return await retireByDrain();
4117
4142
  }
4143
+ if (ports.handover?.requested.aborted === true && supersededBy === void 0) {
4144
+ return await handOverThenDrain(ports.handover.run);
4145
+ }
4118
4146
  if (options.tickLimit !== void 0 && ticks >= options.tickLimit) {
4119
4147
  watchdog?.stop();
4120
4148
  return FRONTDOOR_SUPERVISOR_STILL_RUNNING;
@@ -4252,8 +4280,10 @@ function caParses(ca) {
4252
4280
  return false;
4253
4281
  }
4254
4282
  }
4255
- async function startConnectServer(config, effects, preferredPort) {
4283
+ async function startConnectServer(config, effects, source) {
4256
4284
  const tunnelTokens = /* @__PURE__ */ new WeakMap();
4285
+ const ledger = createConnectionLedger(config.limits, config.isLiveCapability);
4286
+ const lateSessionDeadlines = /* @__PURE__ */ new WeakMap();
4257
4287
  const onUpgrade = (host) => (request4, socket, head) => {
4258
4288
  config.capture?.upgrade(request4);
4259
4289
  if (head.length > 0) {
@@ -4275,6 +4305,12 @@ ${request4.rawHeaders.reduce((accumulated, value, index) => index % 2 === 0 ? `$
4275
4305
  return { host, serveSecure: serveSecure2, tlsAcceptor: tlsAcceptor2 };
4276
4306
  }
4277
4307
  const handleHostRequest = async (request4, response) => {
4308
+ if (ledger.retiring()) {
4309
+ clearTimeout(lateSessionDeadlines.get(request4.socket));
4310
+ response.once("close", () => {
4311
+ request4.socket.end();
4312
+ });
4313
+ }
4278
4314
  if (config.localSurface !== void 0 && await config.localSurface.serve(host, request4, response)) {
4279
4315
  return;
4280
4316
  }
@@ -4294,13 +4330,19 @@ ${request4.rawHeaders.reduce((accumulated, value, index) => index % 2 === 0 ? `$
4294
4330
  const httpSession = effects.createHttpSession(handler, onUpgrade(host));
4295
4331
  const serveSecure = (secure, capability) => {
4296
4332
  tunnelTokens.set(secure, capability);
4333
+ if (ledger.retiring()) {
4334
+ const deadline = setTimeout(() => {
4335
+ secure.destroy();
4336
+ }, config.limits.headDeadlineMs);
4337
+ deadline.unref();
4338
+ lateSessionDeadlines.set(secure, deadline);
4339
+ }
4297
4340
  httpSession.serve(secure);
4298
4341
  };
4299
4342
  const tlsAcceptor = effects.createTlsAcceptor(config.leafFor(host), serveSecure);
4300
4343
  return { host, serveSecure, httpSession, tlsAcceptor };
4301
4344
  });
4302
- const ledger = createConnectionLedger(config.limits, config.isLiveCapability);
4303
- const listener = await effects.listenLoopback(preferredPort, (socket) => {
4345
+ const listener = await effects.listenLoopback(source, (socket) => {
4304
4346
  handleConnect(socket, { config, effects, sessions, ledger });
4305
4347
  });
4306
4348
  const apiSession = sessions.find((session) => session.host === config.routedHost);
@@ -4313,7 +4355,7 @@ ${request4.rawHeaders.reduce((accumulated, value, index) => index % 2 === 0 ? `$
4313
4355
  }
4314
4356
  session.serveSecure(secure, config.transparentCapability ?? "");
4315
4357
  });
4316
- const transparent = config.transparentPort === void 0 || apiSession === void 0 ? void 0 : await effects.listenLoopback(config.transparentPort, (socket) => {
4358
+ const transparent = config.transparentPort === void 0 || apiSession === void 0 ? void 0 : await effects.listenLoopback({ preferredPort: config.transparentPort }, (socket) => {
4317
4359
  sniAcceptor.accept(socket);
4318
4360
  });
4319
4361
  const closeSurface = async () => {
@@ -4328,6 +4370,7 @@ ${request4.rawHeaders.reduce((accumulated, value, index) => index % 2 === 0 ? `$
4328
4370
  };
4329
4371
  return {
4330
4372
  port: listener.port,
4373
+ listening: listener.listening,
4331
4374
  ...transparent === void 0 ? {} : { transparentPort: transparent.port },
4332
4375
  openTunnels: ledger.openTunnels,
4333
4376
  drain: async () => {
@@ -4344,7 +4387,9 @@ function createConnectionLedger(limits, isLiveCapability2) {
4344
4387
  const authenticated = /* @__PURE__ */ new Map();
4345
4388
  let tunnels = 0;
4346
4389
  const blind = /* @__PURE__ */ new Set();
4347
- let onNoBlindTunnels;
4390
+ const live = /* @__PURE__ */ new Set();
4391
+ let retiring = false;
4392
+ let onNoConnections;
4348
4393
  const leavePending = (socket) => {
4349
4394
  const deadline = pending.get(socket);
4350
4395
  if (deadline !== void 0) {
@@ -4376,20 +4421,19 @@ function createConnectionLedger(limits, isLiveCapability2) {
4376
4421
  refuse(socket, REFUSAL.requestTimeout);
4377
4422
  }, limits.headDeadlineMs)
4378
4423
  );
4424
+ live.add(socket);
4379
4425
  socket.once("close", () => {
4380
4426
  leavePending(socket);
4427
+ live.delete(socket);
4428
+ if (live.size === 0) {
4429
+ onNoConnections?.();
4430
+ }
4381
4431
  });
4382
4432
  },
4383
4433
  headReceived: leavePending,
4384
4434
  openTunnels: () => tunnels,
4385
4435
  retire: async () => {
4386
- for (const socket of pending.keys()) {
4387
- socket.destroy();
4388
- }
4389
- for (const deadline of pending.values()) {
4390
- clearTimeout(deadline);
4391
- }
4392
- pending.clear();
4436
+ retiring = true;
4393
4437
  for (const sockets of authenticated.values()) {
4394
4438
  for (const socket of sockets) {
4395
4439
  if (!blind.has(socket)) {
@@ -4397,12 +4441,13 @@ function createConnectionLedger(limits, isLiveCapability2) {
4397
4441
  }
4398
4442
  }
4399
4443
  }
4400
- if (blind.size > 0) {
4444
+ if (live.size > 0) {
4401
4445
  await new Promise((resolve) => {
4402
- onNoBlindTunnels = resolve;
4446
+ onNoConnections = resolve;
4403
4447
  });
4404
4448
  }
4405
4449
  },
4450
+ retiring: () => retiring,
4406
4451
  establish: (socket, capability, kind) => {
4407
4452
  if (tunnels >= limits.maxTunnels) {
4408
4453
  return false;
@@ -4417,9 +4462,6 @@ function createConnectionLedger(limits, isLiveCapability2) {
4417
4462
  socket.once("close", () => {
4418
4463
  tunnels -= 1;
4419
4464
  blind.delete(socket);
4420
- if (blind.size === 0) {
4421
- onNoBlindTunnels?.();
4422
- }
4423
4465
  sockets.delete(socket);
4424
4466
  if (sockets.size === 0 && authenticated.get(capability) === sockets) {
4425
4467
  authenticated.delete(capability);
@@ -4627,7 +4669,7 @@ var init_package = __esm({
4627
4669
  "package.json"() {
4628
4670
  package_default = {
4629
4671
  name: "claude-use",
4630
- version: "11.62.3",
4672
+ version: "11.63.0",
4631
4673
  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.",
4632
4674
  license: "MIT",
4633
4675
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -10154,7 +10196,8 @@ var init_replacement = __esm({
10154
10196
  import { randomUUID as randomUUID3 } from "node:crypto";
10155
10197
  function ensureFrontDoor(params) {
10156
10198
  const { paths, ports } = params;
10157
- const deadline = ports.now() + FRONTDOOR_START_TIMEOUT_MS;
10199
+ const startedAt = ports.now();
10200
+ let deadline = startedAt + FRONTDOOR_START_TIMEOUT_MS;
10158
10201
  let spawned = false;
10159
10202
  let replaced = false;
10160
10203
  const distrusted = /* @__PURE__ */ new Set();
@@ -10194,6 +10237,19 @@ function ensureFrontDoor(params) {
10194
10237
  ports.sleep(FRONTDOOR_LAUNCHER_POLL_MS);
10195
10238
  }
10196
10239
  };
10240
+ const handOverAndAwait = (supervisorPid, doorProtocol, reason, request4) => {
10241
+ recordReplacement(supervisorPid, doorProtocol, reason, "SIGUSR2");
10242
+ request4(supervisorPid);
10243
+ const waitEnds = ports.now() + FRONTDOOR_START_TIMEOUT_MS + FRONTDOOR_EXIT_GRACE_MS;
10244
+ deadline += FRONTDOOR_START_TIMEOUT_MS + FRONTDOOR_EXIT_GRACE_MS;
10245
+ while (ports.isRunning(supervisorPid) && readFrontDoorState(ports.fs, paths.frontdoorStateFile)?.supervisorPid === supervisorPid) {
10246
+ if (ports.now() >= waitEnds) {
10247
+ stopAndAwaitExit(supervisorPid, doorProtocol, reason, `the front door (pid ${String(supervisorPid)}) did not act on a request to hand its listeners over, and did not exit when asked to`);
10248
+ return;
10249
+ }
10250
+ ports.sleep(FRONTDOOR_LAUNCHER_POLL_MS);
10251
+ }
10252
+ };
10197
10253
  for (; ; ) {
10198
10254
  const state = readFrontDoorState(ports.fs, paths.frontdoorStateFile);
10199
10255
  const supervisorPid = state?.supervisorPid;
@@ -10207,12 +10263,16 @@ function ensureFrontDoor(params) {
10207
10263
  const verdict = verifyWithRetry(state.port);
10208
10264
  const doorProtocol = state.protocol ?? 0;
10209
10265
  if (verdict.ok && !replaced && !spawned && (params.replace !== void 0 || doorProtocol < FRONT_DOOR_PROTOCOL)) {
10210
- stopAndAwaitExit(
10211
- supervisorPid,
10212
- doorProtocol,
10213
- params.replace ?? "protocol-older",
10214
- `the front door (pid ${String(supervisorPid)}, protocol ${String(doorProtocol)}; this launcher speaks protocol ${String(FRONT_DOOR_PROTOCOL)}) was asked to be replaced and did not exit`
10215
- );
10266
+ if (params.replace !== void 0 && doorProtocol >= FRONT_DOOR_HANDOVER_PROTOCOL && ports.requestHandover !== void 0 && ports.isFrontDoorSupervisor(supervisorPid)) {
10267
+ handOverAndAwait(supervisorPid, doorProtocol, params.replace, ports.requestHandover);
10268
+ } else {
10269
+ stopAndAwaitExit(
10270
+ supervisorPid,
10271
+ doorProtocol,
10272
+ params.replace ?? "protocol-older",
10273
+ `the front door (pid ${String(supervisorPid)}, protocol ${String(doorProtocol)}; this launcher speaks protocol ${String(FRONT_DOOR_PROTOCOL)}) was asked to be replaced and did not exit`
10274
+ );
10275
+ }
10216
10276
  replaced = true;
10217
10277
  continue;
10218
10278
  }
@@ -10264,7 +10324,7 @@ function ensureFrontDoor(params) {
10264
10324
  if (ports.now() >= deadline) {
10265
10325
  const lastError = state?.lastError;
10266
10326
  throw new FrontDoorStartError(
10267
- `the front door did not become ready within ${String(FRONTDOOR_START_TIMEOUT_MS)}ms` + (lastError === void 0 ? "" : ` (last error: ${lastError})`) + (lastRejection === void 0 ? "" : ` (${lastRejection})`) + (busyDoor === void 0 ? "" : `. It was not replaced because ${String(busyDoor.sessions)} live session(s) are using it and would lose their connections; run \`agent-shim frontdoor restart\` to replace it deliberately`) + `. Daemon log: ${paths.frontdoorLogPath}`
10327
+ `the front door did not become ready within ${String(deadline - startedAt)}ms` + (lastError === void 0 ? "" : ` (last error: ${lastError})`) + (lastRejection === void 0 ? "" : ` (${lastRejection})`) + (busyDoor === void 0 ? "" : `. It was not replaced because ${String(busyDoor.sessions)} live session(s) are using it and would lose their connections; run \`agent-shim frontdoor restart\` to replace it deliberately`) + `. Daemon log: ${paths.frontdoorLogPath}`
10268
10328
  );
10269
10329
  }
10270
10330
  ports.sleep(FRONTDOOR_LAUNCHER_POLL_MS);
@@ -11907,6 +11967,12 @@ function realEnsurePorts(paths, spawnDaemon) {
11907
11967
  killSupervisor: (pid) => {
11908
11968
  process.kill(pid, "SIGKILL");
11909
11969
  },
11970
+ // Windows has no user signals (Node refuses to send one), so a replacement there keeps the stop-and-start path.
11971
+ ...process.platform === "win32" ? {} : {
11972
+ requestHandover: (pid) => {
11973
+ process.kill(pid, "SIGUSR2");
11974
+ }
11975
+ },
11910
11976
  // Read fresh for each probe: a replacement supervisor may have regenerated an unparseable CA, and the probe must trust exactly what the serving door's leaf chains to.
11911
11977
  verifyListener: (port) => probeFrontDoorSync(port, fs13.readFileSync(paths.frontdoorCaCertFile, "utf8"))
11912
11978
  };
@@ -14336,7 +14402,7 @@ function realRcStreamDial(target = { host: CONNECT_INTERCEPT_HOST, port: HTTPS_P
14336
14402
  function realConnectEffects(ports = DOOR_SOURCE_PORTS) {
14337
14403
  const plainAgent = new ExemptHttpAgent(ports);
14338
14404
  const tlsAgent = new ExemptTlsAgent(ports);
14339
- const listenOnce = async (port, onSocket) => await new Promise((resolve, reject) => {
14405
+ const listenOnce = async (target, onSocket) => await new Promise((resolve, reject) => {
14340
14406
  const accepted = /* @__PURE__ */ new Set();
14341
14407
  const server = net2.createServer((socket) => {
14342
14408
  accepted.add(socket);
@@ -14346,7 +14412,7 @@ function realConnectEffects(ports = DOOR_SOURCE_PORTS) {
14346
14412
  onSocket(socket);
14347
14413
  });
14348
14414
  server.once("error", reject);
14349
- server.listen(port, "127.0.0.1", () => {
14415
+ const onListening = () => {
14350
14416
  const address = server.address();
14351
14417
  const bound = typeof address === "object" && address !== null ? address.port : 0;
14352
14418
  if (bound === 0) {
@@ -14355,6 +14421,7 @@ function realConnectEffects(ports = DOOR_SOURCE_PORTS) {
14355
14421
  }
14356
14422
  resolve({
14357
14423
  port: bound,
14424
+ listening: server,
14358
14425
  // The listening socket is released by `close` at once; the connections already accepted are untouched and keep the server's `close` callback pending until they end.
14359
14426
  stopAccepting: () => {
14360
14427
  server.close();
@@ -14370,10 +14437,19 @@ function realConnectEffects(ports = DOOR_SOURCE_PORTS) {
14370
14437
  });
14371
14438
  }
14372
14439
  });
14373
- });
14440
+ };
14441
+ if (typeof target === "number") {
14442
+ server.listen(target, "127.0.0.1", onListening);
14443
+ } else {
14444
+ server.listen(target, onListening);
14445
+ }
14374
14446
  });
14375
14447
  return {
14376
- listenLoopback: async (preferredPort, onSocket) => {
14448
+ listenLoopback: async (source, onSocket) => {
14449
+ if ("inherit" in source) {
14450
+ return await listenOnce(await source.inherit(), onSocket);
14451
+ }
14452
+ const { preferredPort } = source;
14377
14453
  if (preferredPort !== void 0) {
14378
14454
  try {
14379
14455
  return await listenOnce(preferredPort, onSocket);