agent-shim 7.9.0 → 7.10.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
@@ -15625,7 +15625,7 @@ var require_agent = __commonJS({
15625
15625
  function defaultFactory(origin, opts) {
15626
15626
  return opts && opts.connections === 1 ? new Client(origin, opts) : new Pool(origin, opts);
15627
15627
  }
15628
- var Agent6 = class extends DispatcherBase {
15628
+ var Agent7 = class extends DispatcherBase {
15629
15629
  constructor({ factory = defaultFactory, maxOrigins = Infinity, connect: connect3, ...options } = {}) {
15630
15630
  if (typeof factory !== "function") {
15631
15631
  throw new InvalidArgumentError2("factory must be a function.");
@@ -15734,7 +15734,7 @@ var require_agent = __commonJS({
15734
15734
  return allClientStats;
15735
15735
  }
15736
15736
  };
15737
- module2.exports = Agent6;
15737
+ module2.exports = Agent7;
15738
15738
  }
15739
15739
  });
15740
15740
 
@@ -16440,7 +16440,7 @@ var require_proxy_agent = __commonJS({
16440
16440
  "node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/dispatcher/proxy-agent.js"(exports2, module2) {
16441
16441
  "use strict";
16442
16442
  var { kProxy, kClose, kDestroy, kDispatch } = require_symbols();
16443
- var Agent6 = require_agent();
16443
+ var Agent7 = require_agent();
16444
16444
  var Pool = require_pool();
16445
16445
  var DispatcherBase = require_dispatcher_base();
16446
16446
  var { InvalidArgumentError: InvalidArgumentError2, RequestAbortedError, SecureProxyConnectionError } = require_errors();
@@ -16571,7 +16571,7 @@ var require_proxy_agent = __commonJS({
16571
16571
  } else {
16572
16572
  this[kClient] = clientFactory(url2, { connect: connect3 });
16573
16573
  }
16574
- this[kAgent] = new Agent6({
16574
+ this[kAgent] = new Agent7({
16575
16575
  ...opts,
16576
16576
  factory,
16577
16577
  connect: async (opts2, callback) => {
@@ -16699,7 +16699,7 @@ var require_env_http_proxy_agent = __commonJS({
16699
16699
  var DispatcherBase = require_dispatcher_base();
16700
16700
  var { kClose, kDestroy, kClosed, kDestroyed, kDispatch, kNoProxyAgent, kHttpProxyAgent, kHttpsProxyAgent } = require_symbols();
16701
16701
  var ProxyAgent = require_proxy_agent();
16702
- var Agent6 = require_agent();
16702
+ var Agent7 = require_agent();
16703
16703
  var DEFAULT_PORTS = {
16704
16704
  "http:": 80,
16705
16705
  "https:": 443
@@ -16712,7 +16712,7 @@ var require_env_http_proxy_agent = __commonJS({
16712
16712
  super();
16713
16713
  this.#opts = opts;
16714
16714
  const { httpProxy, httpsProxy, noProxy, ...agentOpts } = opts;
16715
- this[kNoProxyAgent] = new Agent6(agentOpts);
16715
+ this[kNoProxyAgent] = new Agent7(agentOpts);
16716
16716
  const HTTP_PROXY = httpProxy ?? process.env.http_proxy ?? process.env.HTTP_PROXY;
16717
16717
  if (HTTP_PROXY) {
16718
16718
  this[kHttpProxyAgent] = new ProxyAgent({ ...agentOpts, uri: HTTP_PROXY });
@@ -19410,7 +19410,7 @@ var require_mock_agent = __commonJS({
19410
19410
  "node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/mock/mock-agent.js"(exports2, module2) {
19411
19411
  "use strict";
19412
19412
  var { kClients } = require_symbols();
19413
- var Agent6 = require_agent();
19413
+ var Agent7 = require_agent();
19414
19414
  var {
19415
19415
  kAgent,
19416
19416
  kMockAgentSet,
@@ -19448,7 +19448,7 @@ var require_mock_agent = __commonJS({
19448
19448
  if (opts?.agent && typeof opts.agent.dispatch !== "function") {
19449
19449
  throw new InvalidArgumentError2("Argument opts.agent must implement Agent");
19450
19450
  }
19451
- const agent = opts?.agent ? opts.agent : new Agent6(opts);
19451
+ const agent = opts?.agent ? opts.agent : new Agent7(opts);
19452
19452
  this[kAgent] = agent;
19453
19453
  this[kClients] = agent[kClients];
19454
19454
  this[kOptions] = mockOptions;
@@ -20055,7 +20055,7 @@ var require_snapshot_recorder = __commonJS({
20055
20055
  var require_snapshot_agent = __commonJS({
20056
20056
  "node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/mock/snapshot-agent.js"(exports2, module2) {
20057
20057
  "use strict";
20058
- var Agent6 = require_agent();
20058
+ var Agent7 = require_agent();
20059
20059
  var MockAgent = require_mock_agent();
20060
20060
  var { SnapshotRecorder } = require_snapshot_recorder();
20061
20061
  var WrapHandler = require_wrap_handler();
@@ -20106,7 +20106,7 @@ var require_snapshot_agent = __commonJS({
20106
20106
  });
20107
20107
  this[kSnapshotLoaded] = false;
20108
20108
  if (this[kSnapshotMode] === "record" || this[kSnapshotMode] === "update" || this[kSnapshotMode] === "playback" && opts.excludeUrls && opts.excludeUrls.length > 0) {
20109
- this[kRealAgent] = new Agent6(opts);
20109
+ this[kRealAgent] = new Agent7(opts);
20110
20110
  }
20111
20111
  if ((this[kSnapshotMode] === "playback" || this[kSnapshotMode] === "update") && this[kSnapshotPath]) {
20112
20112
  this.loadSnapshots().catch(() => {
@@ -20345,9 +20345,9 @@ var require_global2 = __commonJS({
20345
20345
  var globalDispatcher = /* @__PURE__ */ Symbol.for("undici.globalDispatcher.2");
20346
20346
  var legacyGlobalDispatcher = /* @__PURE__ */ Symbol.for("undici.globalDispatcher.1");
20347
20347
  var { InvalidArgumentError: InvalidArgumentError2 } = require_errors();
20348
- var Agent6 = require_agent();
20348
+ var Agent7 = require_agent();
20349
20349
  if (getGlobalDispatcher() === void 0) {
20350
- setGlobalDispatcher(new Agent6());
20350
+ setGlobalDispatcher(new Agent7());
20351
20351
  }
20352
20352
  function setGlobalDispatcher(agent) {
20353
20353
  if (!agent || typeof agent.dispatch !== "function") {
@@ -31562,7 +31562,7 @@ var require_undici = __commonJS({
31562
31562
  var Pool = require_pool();
31563
31563
  var BalancedPool = require_balanced_pool();
31564
31564
  var RoundRobinPool = require_round_robin_pool();
31565
- var Agent6 = require_agent();
31565
+ var Agent7 = require_agent();
31566
31566
  var ProxyAgent = require_proxy_agent();
31567
31567
  var Socks5ProxyAgent = require_socks5_proxy_agent();
31568
31568
  var EnvHttpProxyAgent = require_env_http_proxy_agent();
@@ -31589,7 +31589,7 @@ var require_undici = __commonJS({
31589
31589
  module2.exports.Pool = Pool;
31590
31590
  module2.exports.BalancedPool = BalancedPool;
31591
31591
  module2.exports.RoundRobinPool = RoundRobinPool;
31592
- module2.exports.Agent = Agent6;
31592
+ module2.exports.Agent = Agent7;
31593
31593
  module2.exports.ProxyAgent = ProxyAgent;
31594
31594
  module2.exports.Socks5ProxyAgent = Socks5ProxyAgent;
31595
31595
  module2.exports.EnvHttpProxyAgent = EnvHttpProxyAgent;
@@ -60955,7 +60955,7 @@ function registerIdentityCommand(program2, deps) {
60955
60955
  // package.json
60956
60956
  var package_default = {
60957
60957
  name: "agent-shim",
60958
- version: "7.9.0",
60958
+ version: "7.10.1",
60959
60959
  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.",
60960
60960
  license: "MIT",
60961
60961
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -64499,7 +64499,7 @@ async function startConnectServer(config2, effects, preferredPort) {
64499
64499
  ${request6.rawHeaders.reduce((accumulated, value, index) => index % 2 === 0 ? `${accumulated}${value}: ` : `${accumulated}${value}\r
64500
64500
  `, "")}\r
64501
64501
  `;
64502
- pumpTapSession(socket, async (clientAlpn) => await effects.connectTlsUpstream(host, HTTPS_PORT, clientAlpn), void 0, Buffer.from(headText, "utf8"));
64502
+ pumpTapSession(socket, async (clientAlpn) => await effects.connectTlsUpstream(host, HTTPS_PORT, clientAlpn), config2.capture?.tapStream?.(host), Buffer.from(headText, "utf8"));
64503
64503
  };
64504
64504
  const sessions = config2.interceptHosts.map((host) => {
64505
64505
  if (config2.tapHosts.includes(host)) {
@@ -65160,6 +65160,7 @@ async function applyHeadroomHop(request6, response, upstream, deps) {
65160
65160
  }
65161
65161
  }
65162
65162
  }
65163
+ var HOP_AGENT = new http3.Agent({ keepAlive: false });
65163
65164
  async function forwardThroughHeadroom(request6, response, target) {
65164
65165
  const { port, headers } = target;
65165
65166
  await new Promise((resolve) => {
@@ -65184,7 +65185,7 @@ async function forwardThroughHeadroom(request6, response, target) {
65184
65185
  };
65185
65186
  void stream();
65186
65187
  };
65187
- const hop = http3.request({ host: "127.0.0.1", port, method: request6.method, path: request6.url, headers }, onUpstreamResponse);
65188
+ const hop = http3.request({ host: "127.0.0.1", port, method: request6.method, path: request6.url, headers, agent: HOP_AGENT }, onUpstreamResponse);
65188
65189
  hop.on("error", (error62) => {
65189
65190
  target.log(`front door: headroom hop to 127.0.0.1:${String(port)} failed: ${error62.message}`);
65190
65191
  if (!response.headersSent) {
package/dist/index.cjs CHANGED
@@ -2905,7 +2905,7 @@ async function startConnectServer(config, effects, preferredPort) {
2905
2905
  ${request3.rawHeaders.reduce((accumulated, value, index) => index % 2 === 0 ? `${accumulated}${value}: ` : `${accumulated}${value}\r
2906
2906
  `, "")}\r
2907
2907
  `;
2908
- pumpTapSession(socket, async (clientAlpn) => await effects.connectTlsUpstream(host, HTTPS_PORT, clientAlpn), void 0, Buffer.from(headText, "utf8"));
2908
+ pumpTapSession(socket, async (clientAlpn) => await effects.connectTlsUpstream(host, HTTPS_PORT, clientAlpn), config.capture?.tapStream?.(host), Buffer.from(headText, "utf8"));
2909
2909
  };
2910
2910
  const sessions = config.interceptHosts.map((host) => {
2911
2911
  if (config.tapHosts.includes(host)) {
package/dist/index.mjs CHANGED
@@ -2742,7 +2742,7 @@ async function startConnectServer(config, effects, preferredPort) {
2742
2742
  ${request3.rawHeaders.reduce((accumulated, value, index) => index % 2 === 0 ? `${accumulated}${value}: ` : `${accumulated}${value}\r
2743
2743
  `, "")}\r
2744
2744
  `;
2745
- pumpTapSession(socket, async (clientAlpn) => await effects.connectTlsUpstream(host, HTTPS_PORT, clientAlpn), void 0, Buffer.from(headText, "utf8"));
2745
+ pumpTapSession(socket, async (clientAlpn) => await effects.connectTlsUpstream(host, HTTPS_PORT, clientAlpn), config.capture?.tapStream?.(host), Buffer.from(headText, "utf8"));
2746
2746
  };
2747
2747
  const sessions = config.interceptHosts.map((host) => {
2748
2748
  if (config.tapHosts.includes(host)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-shim",
3
- "version": "7.9.0",
3
+ "version": "7.10.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>",