agent-shim 8.7.0 → 8.8.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/cli.cjs CHANGED
@@ -61673,7 +61673,7 @@ function registerIdentityCommand(program2, deps) {
61673
61673
  // package.json
61674
61674
  var package_default = {
61675
61675
  name: "agent-shim",
61676
- version: "8.7.0",
61676
+ version: "8.8.0",
61677
61677
  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.",
61678
61678
  license: "MIT",
61679
61679
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -62003,6 +62003,21 @@ function createAccountReader(fs19, identitiesDir) {
62003
62003
  }
62004
62004
 
62005
62005
  // src/usage/plan.ts
62006
+ var PlanClassSchema = external_exports.union([
62007
+ external_exports.strictObject({
62008
+ kind: external_exports.literal("subscription"),
62009
+ /** The plan's size as a multiple of the smallest subscription tier (Max 5x is 5, Max 20x is 20). */
62010
+ capacity: external_exports.number().positive(),
62011
+ /** False when the tier string named no multiplier and no tier this project knows, so `capacity` is the neutral 1 rather than a reading. */
62012
+ recognised: external_exports.boolean(),
62013
+ /** The tier string the classification rests on, when the account had one. */
62014
+ tier: external_exports.string().optional()
62015
+ }),
62016
+ external_exports.strictObject({
62017
+ kind: external_exports.literal("pay-per-use"),
62018
+ tier: external_exports.string().optional()
62019
+ })
62020
+ ]);
62006
62021
  var TIER_MULTIPLIER = /(?:^|_)(\d+)x$/;
62007
62022
  var ZERO_TIER = /(?:^|_)zero$/;
62008
62023
  var BASE_TIER = /(?:^|_)(?:pro|free)$/;
@@ -63140,7 +63155,7 @@ function candidateView(candidate) {
63140
63155
  feasible: candidate.feasible,
63141
63156
  ...candidate.blockedUntilMs === void 0 ? {} : { blockedUntil: new Date(candidate.blockedUntilMs).toISOString() },
63142
63157
  plan: candidate.plan,
63143
- reasons: candidate.reasons
63158
+ reasons: [...candidate.reasons]
63144
63159
  };
63145
63160
  }
63146
63161
  function collectPoolPick(params) {
@@ -63159,7 +63174,7 @@ function collectPoolPick(params) {
63159
63174
  directory: params.directory,
63160
63175
  ...ranking.pick === void 0 ? {} : { pick: ranking.pick.identity },
63161
63176
  candidates: ranking.candidates.map(candidateView),
63162
- missing,
63177
+ missing: [...missing],
63163
63178
  ...ranking.earliestReturn === void 0 ? {} : { earliestReturn: { identity: ranking.earliestReturn.identity, at: new Date(ranking.earliestReturn.atMs).toISOString() } },
63164
63179
  ...sticky.problem === void 0 ? {} : { stickyProblem: sticky.problem }
63165
63180
  };
@@ -65668,25 +65683,19 @@ function realConnectEffects() {
65668
65683
  }
65669
65684
  };
65670
65685
  },
65671
- connectTlsUpstream: async (host, port, clientAlpn) => await new Promise((resolve, reject) => {
65672
- const dial = (localPort) => {
65673
- const raw = net2.connect({ host, port, localPort, lookup: realAddressLookup });
65674
- return tls.connect({ socket: raw, servername: host, ...clientAlpn === void 0 ? {} : { ALPNProtocols: [clientAlpn] } });
65675
- };
65676
- const settle2 = (candidate) => {
65677
- candidate.once("secureConnect", () => {
65678
- resolve(candidate);
65686
+ connectTlsUpstream: async (host, port, clientAlpn) => {
65687
+ const dialled = await reservedDial({ host, port });
65688
+ if (dialled.error !== null) {
65689
+ throw dialled.error;
65690
+ }
65691
+ return await new Promise((resolve, reject) => {
65692
+ const secure = tls.connect({ socket: dialled.socket, servername: host, ...clientAlpn === void 0 ? {} : { ALPNProtocols: [clientAlpn] } });
65693
+ secure.once("secureConnect", () => {
65694
+ resolve(secure);
65679
65695
  });
65680
- candidate.once("error", (error62) => {
65681
- if ("code" in error62 && error62.code === "EADDRINUSE") {
65682
- settle2(dial(upstreamLocalPort()));
65683
- return;
65684
- }
65685
- reject(error62);
65686
- });
65687
- };
65688
- settle2(dial(upstreamLocalPort()));
65689
- }),
65696
+ secure.once("error", reject);
65697
+ });
65698
+ },
65690
65699
  connectTcp: async (host, port) => await new Promise((resolve, reject) => {
65691
65700
  const socket = net2.connect({ host, port });
65692
65701
  socket.once("connect", () => {