agent-shim 14.14.0 → 14.15.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.cjs CHANGED
@@ -6178,7 +6178,7 @@ ${request4.rawHeaders.reduce((accumulated, value, index) => index % 2 === 0 ? `$
6178
6178
  `;
6179
6179
  pumpTapSession(socket, async (clientAlpn) => await effects.connectTlsUpstream(host, HTTPS_PORT, clientAlpn), config.capture?.tapStream?.(host), Buffer.from(headText, "utf8"));
6180
6180
  };
6181
- const sessionsFor = (ownedSet) => config.interceptHosts.map((host) => {
6181
+ const sessionsFor = (ownedSet) => (ownedSet ? config.interceptHosts.filter((host) => host !== CONNECT_CONNECTOR_PROXY_HOST) : config.interceptHosts).map((host) => {
6182
6182
  if (config.tapHosts.includes(host) && !ownedSet) {
6183
6183
  const serveSecure2 = (secure) => {
6184
6184
  pumpTapSession(secure, async (clientAlpn) => await effects.connectTlsUpstream(host, HTTPS_PORT, clientAlpn), config.capture?.tapStream?.(host));
@@ -6221,6 +6221,11 @@ ${request4.rawHeaders.reduce((accumulated, value, index) => index % 2 === 0 ? `$
6221
6221
  answerAndClose(response, REQUEST_STATUS.notFound);
6222
6222
  return;
6223
6223
  }
6224
+ const rewritten = config.rewriteForwardedAuthorization?.(host, request4, tunnelTokens.get(request4.socket));
6225
+ if (rewritten !== void 0) {
6226
+ request4.headers.authorization = rewritten.authorization;
6227
+ request4.url = rewritten.url;
6228
+ }
6224
6229
  effects.forwardHttp(config.upstreamFor(host), request4, response, config.capture?.observePassthrough(request4));
6225
6230
  };
6226
6231
  const handler = (request4, response) => {
@@ -6570,7 +6575,7 @@ function realConnectCertStore(paths) {
6570
6575
  }
6571
6576
  };
6572
6577
  }
6573
- var import_node_crypto6, fs3, CONNECT_INTERCEPT_HOST, CONNECT_INTERCEPT_HOSTS, ROUTED_PATH_PREFIX, HTTPS_PORT, HTTP_BAD_GATEWAY, CA_KEY_FILE_MODE, CONNECT_LINE_TOKENS, HEAD_TERMINATOR, MAX_CONNECT_HEAD_BYTES, CONNECT_ESTABLISHED, REFUSAL_HEADER, REFUSAL, CONNECT_LIMITS, CA_VALIDITY_DAYS, LEAF_VALIDITY_DAYS, CA_SUBJECT_COMMON_NAME, MS_PER_DAY, TARGET_BASE, HOP_BY_HOP_HEADERS, REQUEST_STATUS, REFUSED_UPGRADE_RESPONSE, TAP_ALPN_PROTOCOLS, SELF_HOSTED_TUNNEL_REFUSAL;
6578
+ var import_node_crypto6, fs3, CONNECT_INTERCEPT_HOST, CONNECT_CONNECTOR_PROXY_HOST, CONNECT_INTERCEPT_HOSTS, ROUTED_PATH_PREFIX, HTTPS_PORT, HTTP_BAD_GATEWAY, CA_KEY_FILE_MODE, CONNECT_LINE_TOKENS, HEAD_TERMINATOR, MAX_CONNECT_HEAD_BYTES, CONNECT_ESTABLISHED, REFUSAL_HEADER, REFUSAL, CONNECT_LIMITS, CA_VALIDITY_DAYS, LEAF_VALIDITY_DAYS, CA_SUBJECT_COMMON_NAME, MS_PER_DAY, TARGET_BASE, HOP_BY_HOP_HEADERS, REQUEST_STATUS, REFUSED_UPGRADE_RESPONSE, TAP_ALPN_PROTOCOLS, SELF_HOSTED_TUNNEL_REFUSAL;
6574
6579
  var init_connect = __esm({
6575
6580
  "src/frontdoor/connect.ts"() {
6576
6581
  "use strict";
@@ -6584,7 +6589,8 @@ var init_connect = __esm({
6584
6589
  init_supervisor();
6585
6590
  init_keepTicking();
6586
6591
  CONNECT_INTERCEPT_HOST = "api.anthropic.com";
6587
- CONNECT_INTERCEPT_HOSTS = [CONNECT_INTERCEPT_HOST, "platform.claude.com"];
6592
+ CONNECT_CONNECTOR_PROXY_HOST = "mcp-proxy.anthropic.com";
6593
+ CONNECT_INTERCEPT_HOSTS = [CONNECT_INTERCEPT_HOST, "platform.claude.com", CONNECT_CONNECTOR_PROXY_HOST];
6588
6594
  ROUTED_PATH_PREFIX = "/v1/";
6589
6595
  HTTPS_PORT = 443;
6590
6596
  HTTP_BAD_GATEWAY = 502;
@@ -14782,6 +14788,48 @@ var init_launchRecords = __esm({
14782
14788
  }
14783
14789
  });
14784
14790
 
14791
+ // src/connectorGrants.ts
14792
+ var init_connectorGrants = __esm({
14793
+ "src/connectorGrants.ts"() {
14794
+ "use strict";
14795
+ }
14796
+ });
14797
+
14798
+ // src/lenderLogin.ts
14799
+ var init_lenderLogin = __esm({
14800
+ "src/lenderLogin.ts"() {
14801
+ "use strict";
14802
+ init_keychainLogin();
14803
+ init_signIn();
14804
+ }
14805
+ });
14806
+
14807
+ // src/connectorProxyAuth.ts
14808
+ var init_connectorProxyAuth = __esm({
14809
+ "src/connectorProxyAuth.ts"() {
14810
+ "use strict";
14811
+ init_connect();
14812
+ init_connectorGrants();
14813
+ init_lenderLogin();
14814
+ }
14815
+ });
14816
+
14817
+ // src/connectorListMerge.ts
14818
+ var init_connectorListMerge = __esm({
14819
+ "src/connectorListMerge.ts"() {
14820
+ "use strict";
14821
+ init_http();
14822
+ init_connectorGrants();
14823
+ }
14824
+ });
14825
+
14826
+ // src/usage/quotaHttp.ts
14827
+ var init_quotaHttp = __esm({
14828
+ "src/usage/quotaHttp.ts"() {
14829
+ "use strict";
14830
+ }
14831
+ });
14832
+
14785
14833
  // src/identityStore.ts
14786
14834
  function displacedIdentity(paths, verb, name, id) {
14787
14835
  return new DisplacedIdentityError(verb, name, id, import_node_fs9.default.existsSync(identityDirectory(paths, id)));
@@ -15223,6 +15271,10 @@ var init_identityStore = __esm({
15223
15271
  init_identityRecords();
15224
15272
  init_launchRecords();
15225
15273
  init_identityGrants();
15274
+ init_connectorProxyAuth();
15275
+ init_connectorListMerge();
15276
+ init_lenderLogin();
15277
+ init_quotaHttp();
15226
15278
  IdentityNotFoundError = class extends CliError {
15227
15279
  constructor(name, remedy2 = `Run \`agent-shim identity add ${name}\` first.`) {
15228
15280
  super(`No identity named "${name}". ${remedy2}`);
@@ -15283,7 +15335,7 @@ var init_package = __esm({
15283
15335
  "package.json"() {
15284
15336
  package_default = {
15285
15337
  name: "agent-shim",
15286
- version: "14.14.0",
15338
+ version: "14.15.0",
15287
15339
  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.",
15288
15340
  license: "MIT",
15289
15341
  author: "Joseph Mearman <joseph@mearman.co.uk>",
package/dist/index.mjs CHANGED
@@ -6154,7 +6154,7 @@ ${request4.rawHeaders.reduce((accumulated, value, index) => index % 2 === 0 ? `$
6154
6154
  `;
6155
6155
  pumpTapSession(socket, async (clientAlpn) => await effects.connectTlsUpstream(host, HTTPS_PORT, clientAlpn), config.capture?.tapStream?.(host), Buffer.from(headText, "utf8"));
6156
6156
  };
6157
- const sessionsFor = (ownedSet) => config.interceptHosts.map((host) => {
6157
+ const sessionsFor = (ownedSet) => (ownedSet ? config.interceptHosts.filter((host) => host !== CONNECT_CONNECTOR_PROXY_HOST) : config.interceptHosts).map((host) => {
6158
6158
  if (config.tapHosts.includes(host) && !ownedSet) {
6159
6159
  const serveSecure2 = (secure) => {
6160
6160
  pumpTapSession(secure, async (clientAlpn) => await effects.connectTlsUpstream(host, HTTPS_PORT, clientAlpn), config.capture?.tapStream?.(host));
@@ -6197,6 +6197,11 @@ ${request4.rawHeaders.reduce((accumulated, value, index) => index % 2 === 0 ? `$
6197
6197
  answerAndClose(response, REQUEST_STATUS.notFound);
6198
6198
  return;
6199
6199
  }
6200
+ const rewritten = config.rewriteForwardedAuthorization?.(host, request4, tunnelTokens.get(request4.socket));
6201
+ if (rewritten !== void 0) {
6202
+ request4.headers.authorization = rewritten.authorization;
6203
+ request4.url = rewritten.url;
6204
+ }
6200
6205
  effects.forwardHttp(config.upstreamFor(host), request4, response, config.capture?.observePassthrough(request4));
6201
6206
  };
6202
6207
  const handler = (request4, response) => {
@@ -6546,7 +6551,7 @@ function realConnectCertStore(paths) {
6546
6551
  }
6547
6552
  };
6548
6553
  }
6549
- var CONNECT_INTERCEPT_HOST, CONNECT_INTERCEPT_HOSTS, ROUTED_PATH_PREFIX, HTTPS_PORT, HTTP_BAD_GATEWAY, CA_KEY_FILE_MODE, CONNECT_LINE_TOKENS, HEAD_TERMINATOR, MAX_CONNECT_HEAD_BYTES, CONNECT_ESTABLISHED, REFUSAL_HEADER, REFUSAL, CONNECT_LIMITS, CA_VALIDITY_DAYS, LEAF_VALIDITY_DAYS, CA_SUBJECT_COMMON_NAME, MS_PER_DAY, TARGET_BASE, HOP_BY_HOP_HEADERS, REQUEST_STATUS, REFUSED_UPGRADE_RESPONSE, TAP_ALPN_PROTOCOLS, SELF_HOSTED_TUNNEL_REFUSAL;
6554
+ var CONNECT_INTERCEPT_HOST, CONNECT_CONNECTOR_PROXY_HOST, CONNECT_INTERCEPT_HOSTS, ROUTED_PATH_PREFIX, HTTPS_PORT, HTTP_BAD_GATEWAY, CA_KEY_FILE_MODE, CONNECT_LINE_TOKENS, HEAD_TERMINATOR, MAX_CONNECT_HEAD_BYTES, CONNECT_ESTABLISHED, REFUSAL_HEADER, REFUSAL, CONNECT_LIMITS, CA_VALIDITY_DAYS, LEAF_VALIDITY_DAYS, CA_SUBJECT_COMMON_NAME, MS_PER_DAY, TARGET_BASE, HOP_BY_HOP_HEADERS, REQUEST_STATUS, REFUSED_UPGRADE_RESPONSE, TAP_ALPN_PROTOCOLS, SELF_HOSTED_TUNNEL_REFUSAL;
6550
6555
  var init_connect = __esm({
6551
6556
  "src/frontdoor/connect.ts"() {
6552
6557
  "use strict";
@@ -6558,7 +6563,8 @@ var init_connect = __esm({
6558
6563
  init_supervisor();
6559
6564
  init_keepTicking();
6560
6565
  CONNECT_INTERCEPT_HOST = "api.anthropic.com";
6561
- CONNECT_INTERCEPT_HOSTS = [CONNECT_INTERCEPT_HOST, "platform.claude.com"];
6566
+ CONNECT_CONNECTOR_PROXY_HOST = "mcp-proxy.anthropic.com";
6567
+ CONNECT_INTERCEPT_HOSTS = [CONNECT_INTERCEPT_HOST, "platform.claude.com", CONNECT_CONNECTOR_PROXY_HOST];
6562
6568
  ROUTED_PATH_PREFIX = "/v1/";
6563
6569
  HTTPS_PORT = 443;
6564
6570
  HTTP_BAD_GATEWAY = 502;
@@ -14753,6 +14759,48 @@ var init_launchRecords = __esm({
14753
14759
  }
14754
14760
  });
14755
14761
 
14762
+ // src/connectorGrants.ts
14763
+ var init_connectorGrants = __esm({
14764
+ "src/connectorGrants.ts"() {
14765
+ "use strict";
14766
+ }
14767
+ });
14768
+
14769
+ // src/lenderLogin.ts
14770
+ var init_lenderLogin = __esm({
14771
+ "src/lenderLogin.ts"() {
14772
+ "use strict";
14773
+ init_keychainLogin();
14774
+ init_signIn();
14775
+ }
14776
+ });
14777
+
14778
+ // src/connectorProxyAuth.ts
14779
+ var init_connectorProxyAuth = __esm({
14780
+ "src/connectorProxyAuth.ts"() {
14781
+ "use strict";
14782
+ init_connect();
14783
+ init_connectorGrants();
14784
+ init_lenderLogin();
14785
+ }
14786
+ });
14787
+
14788
+ // src/connectorListMerge.ts
14789
+ var init_connectorListMerge = __esm({
14790
+ "src/connectorListMerge.ts"() {
14791
+ "use strict";
14792
+ init_http();
14793
+ init_connectorGrants();
14794
+ }
14795
+ });
14796
+
14797
+ // src/usage/quotaHttp.ts
14798
+ var init_quotaHttp = __esm({
14799
+ "src/usage/quotaHttp.ts"() {
14800
+ "use strict";
14801
+ }
14802
+ });
14803
+
14756
14804
  // src/identityStore.ts
14757
14805
  import fs9 from "node:fs";
14758
14806
  import path31 from "node:path";
@@ -15194,6 +15242,10 @@ var init_identityStore = __esm({
15194
15242
  init_identityRecords();
15195
15243
  init_launchRecords();
15196
15244
  init_identityGrants();
15245
+ init_connectorProxyAuth();
15246
+ init_connectorListMerge();
15247
+ init_lenderLogin();
15248
+ init_quotaHttp();
15197
15249
  IdentityNotFoundError = class extends CliError {
15198
15250
  constructor(name, remedy2 = `Run \`agent-shim identity add ${name}\` first.`) {
15199
15251
  super(`No identity named "${name}". ${remedy2}`);
@@ -15254,7 +15306,7 @@ var init_package = __esm({
15254
15306
  "package.json"() {
15255
15307
  package_default = {
15256
15308
  name: "agent-shim",
15257
- version: "14.14.0",
15309
+ version: "14.15.0",
15258
15310
  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.",
15259
15311
  license: "MIT",
15260
15312
  author: "Joseph Mearman <joseph@mearman.co.uk>",