agent-shim 8.30.0 → 8.32.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
@@ -2729,6 +2729,7 @@ async function runFrontDoorSupervisor(idleShutdownMinutes, ports, options = {})
2729
2729
  try {
2730
2730
  http3 = await ports.startProviderListener(lastPort);
2731
2731
  } catch (error) {
2732
+ ports.doorHealth.listenerFailed("provider", error instanceof Error ? error.message : String(error));
2732
2733
  return fail(`could not start the provider listener: ${error instanceof Error ? error.message : String(error)}`);
2733
2734
  }
2734
2735
  if (previousSticky !== void 0 && http3.port !== previousSticky) {
@@ -2741,6 +2742,7 @@ async function runFrontDoorSupervisor(idleShutdownMinutes, ports, options = {})
2741
2742
  connect3 = await ports.startConnectListener(lastConnectPort);
2742
2743
  } catch (error) {
2743
2744
  await http3.close();
2745
+ ports.doorHealth.listenerFailed("connect", error instanceof Error ? error.message : String(error));
2744
2746
  return fail(`could not start the CONNECT surface: ${error instanceof Error ? error.message : String(error)}`);
2745
2747
  }
2746
2748
  if (previousStickyConnect !== void 0 && connect3.port !== previousStickyConnect) {
@@ -2754,6 +2756,7 @@ async function runFrontDoorSupervisor(idleShutdownMinutes, ports, options = {})
2754
2756
  } catch (error) {
2755
2757
  await connect3.close();
2756
2758
  await http3.close();
2759
+ ports.doorHealth.listenerFailed("direct", error instanceof Error ? error.message : String(error));
2757
2760
  return fail(`could not start the direct listener: ${error instanceof Error ? error.message : String(error)}`);
2758
2761
  }
2759
2762
  if (previousStickyDirect !== void 0 && direct.port !== previousStickyDirect) {
@@ -2761,6 +2764,7 @@ async function runFrontDoorSupervisor(idleShutdownMinutes, ports, options = {})
2761
2764
  }
2762
2765
  lastDirectPort = direct.port;
2763
2766
  writeFrontDoorState(fs12, paths.frontdoorStateFile, { protocol: FRONT_DOOR_PROTOCOL, supervisorPid: ports.ownPid, port: http3.port, connectPort: connect3.port, directPort: direct.port, ...sticky() });
2767
+ ports.doorHealth.generation({ providerPort: http3.port, connectPort: connect3.port, directPort: direct.port });
2764
2768
  fs12.removeRecursive(paths.frontdoorLockFile);
2765
2769
  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)}`);
2766
2770
  let idleSince;
@@ -2773,11 +2777,13 @@ async function runFrontDoorSupervisor(idleShutdownMinutes, ports, options = {})
2773
2777
  const listed = listFrontDoorSessions(fs12, paths.frontdoorSessionsDir);
2774
2778
  const pruned = pruneDeadFrontDoorSessions(fs12, paths.frontdoorSessionsDir, ports.isRunning);
2775
2779
  ports.observeLaunchRegistry(listed, pruned);
2780
+ ports.checkQuotaExpiry();
2776
2781
  const prunedPids = new Set(pruned);
2777
2782
  if (listed.filter((session) => !prunedPids.has(session.pid)).length === 0) {
2778
2783
  idleSince ??= ports.now();
2779
2784
  if (ports.now() - idleSince >= idleShutdownMinutes * MS_PER_MINUTE) {
2780
2785
  ports.log(`agent-shim frontdoor supervisor: no sessions for ${String(idleShutdownMinutes)} minute(s); closing the front door and exiting`);
2786
+ ports.doorHealth.idleShutdown();
2781
2787
  await direct.close();
2782
2788
  await connect3.close();
2783
2789
  await http3.close();
@@ -5037,7 +5043,7 @@ import { Agent as Agent3, fetch as undiciFetch } from "undici";
5037
5043
  // package.json
5038
5044
  var package_default = {
5039
5045
  name: "agent-shim",
5040
- version: "8.30.0",
5046
+ version: "8.32.0",
5041
5047
  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.",
5042
5048
  license: "MIT",
5043
5049
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -6219,10 +6225,10 @@ function windowBlockedUntil(windows) {
6219
6225
  const resets = windows.flatMap((window) => window.status === "rejected" && window.resetsAtMs !== void 0 ? [window.resetsAtMs] : []);
6220
6226
  return resets.length === 0 ? void 0 : Math.max(...resets);
6221
6227
  }
6222
- function fiveHourBurn(records) {
6228
+ function windowBurn(records, which) {
6223
6229
  const points = [];
6224
6230
  for (const record of records) {
6225
- const window = record.rateLimitHeaders === void 0 ? void 0 : parseUnifiedRateLimit(record.rateLimitHeaders)?.fiveHour;
6231
+ const window = record.rateLimitHeaders === void 0 ? void 0 : parseUnifiedRateLimit(record.rateLimitHeaders)?.[which];
6226
6232
  if (window?.utilization !== void 0 && window.resetsAt !== void 0) {
6227
6233
  points.push({ resetsAt: window.resetsAt, point: { atMs: Date.parse(record.at), utilization: window.utilization } });
6228
6234
  }
@@ -6316,11 +6322,16 @@ function assessIdentity(member, nowMs) {
6316
6322
  const score = remaining * plan.capacity / (untilResetMs / MS_PER_HOUR);
6317
6323
  const fiveRemaining = five?.utilization === void 0 ? void 0 : Math.max(0, 1 - five.utilization);
6318
6324
  const fiveUntil = five?.resetsAtMs === void 0 ? FIVE_HOUR_WINDOW_MS : Math.max(five.resetsAtMs - nowMs, MS_PER_SECOND4);
6319
- const burn = fiveHourBurn(member.records);
6325
+ const burn = windowBurn(member.records, "fiveHour");
6326
+ const sevenRemaining = seven?.utilization === void 0 ? void 0 : Math.max(0, 1 - seven.utilization);
6327
+ const sevenUntil = seven?.resetsAtMs === void 0 ? SEVEN_DAY_WINDOW_MS : Math.max(seven.resetsAtMs - nowMs, MS_PER_SECOND4);
6328
+ const sevenDayBurn = windowBurn(member.records, "sevenDay");
6320
6329
  return {
6321
6330
  candidate: { ...base, class: "scored", score, reasons: [...windowReasons.map((reason, index) => index === windowReasons.length - 1 ? `${reason}${observedAgo}` : reason), ...planReasons] },
6322
6331
  ...fiveRemaining === void 0 ? {} : { fiveHour: { remaining: fiveRemaining, untilResetMs: fiveUntil } },
6323
- ...burn === void 0 ? {} : { burn }
6332
+ ...burn === void 0 ? {} : { burn },
6333
+ ...sevenRemaining === void 0 ? {} : { sevenDay: { remaining: sevenRemaining, untilResetMs: sevenUntil } },
6334
+ ...sevenDayBurn === void 0 ? {} : { sevenDayBurn }
6324
6335
  };
6325
6336
  }
6326
6337
  function rankPool(input) {
@@ -6331,14 +6342,27 @@ function rankPool(input) {
6331
6342
  const candidates = assessments.map((assessment) => {
6332
6343
  const { candidate, fiveHour, burn } = assessment;
6333
6344
  const pace = burn ?? (sharedDemand === void 0 ? void 0 : sharedDemand / capacityOf(candidate.plan));
6334
- if (candidate.class !== "scored" || fiveHour === void 0 || pace === void 0) {
6345
+ const { sevenDay, sevenDayBurn } = assessment;
6346
+ if (candidate.class !== "scored") {
6335
6347
  return { ...candidate, feasible: true };
6336
6348
  }
6337
- const runsDryInMs = fiveHour.remaining / pace;
6338
- if (runsDryInMs >= fiveHour.untilResetMs) {
6349
+ const drySpots = [];
6350
+ if (fiveHour !== void 0 && pace !== void 0) {
6351
+ const runsDryInMs = fiveHour.remaining / pace;
6352
+ if (runsDryInMs < fiveHour.untilResetMs) {
6353
+ drySpots.push(`5h window would run dry in ${formatAge(runsDryInMs)}, before it resets in ${formatAge(fiveHour.untilResetMs)}`);
6354
+ }
6355
+ }
6356
+ if (sevenDay !== void 0 && sevenDayBurn !== void 0) {
6357
+ const runsDryInMs = sevenDay.remaining / sevenDayBurn;
6358
+ if (runsDryInMs < sevenDay.untilResetMs) {
6359
+ drySpots.push(`7d window would run dry in ${formatAge(runsDryInMs)}, before it resets in ${formatAge(sevenDay.untilResetMs)}`);
6360
+ }
6361
+ }
6362
+ if (drySpots.length === 0) {
6339
6363
  return { ...candidate, feasible: true };
6340
6364
  }
6341
- return { ...candidate, feasible: false, reasons: [`5h window would run dry in ${formatAge(runsDryInMs)}, before it resets in ${formatAge(fiveHour.untilResetMs)}`, ...candidate.reasons] };
6365
+ return { ...candidate, feasible: false, reasons: [...drySpots, ...candidate.reasons] };
6342
6366
  });
6343
6367
  const ordered = input.preference === "listed" ? [...candidates] : [...candidates].sort(
6344
6368
  (left, right) => CLASS_ORDER[left.class] - CLASS_ORDER[right.class] || Number(right.feasible) - Number(left.feasible) || (right.score ?? 0) - (left.score ?? 0) || left.identity.localeCompare(right.identity)
@@ -6346,7 +6370,8 @@ function rankPool(input) {
6346
6370
  const sticky = input.sticky;
6347
6371
  const stickyIndex = sticky === void 0 ? -1 : ordered.findIndex((candidate) => candidate.identity === sticky.identity);
6348
6372
  const stickyCandidate = ordered[stickyIndex];
6349
- if (sticky !== void 0 && stickyCandidate?.class === "scored" && stickyCandidate.feasible) {
6373
+ const keepSticky = stickyCandidate?.class === "scored" && stickyCandidate.feasible;
6374
+ if (sticky !== void 0 && keepSticky) {
6350
6375
  const ageMs = nowMs - Date.parse(sticky.at);
6351
6376
  const warm = ageMs <= PROMPT_CACHE_TTL_MS;
6352
6377
  if (input.resuming || warm) {
@@ -6355,12 +6380,14 @@ function rankPool(input) {
6355
6380
  ordered.unshift({ ...stickyCandidate, reasons: [why, ...stickyCandidate.reasons] });
6356
6381
  }
6357
6382
  }
6383
+ const movedOff = sticky !== void 0 && input.resuming && !keepSticky ? { identity: sticky.identity, reason: stickyCandidate?.reasons[0] ?? "no longer among the pool's members" } : void 0;
6358
6384
  const pick = ordered.find((candidate) => candidate.class !== "ineligible");
6359
6385
  const returns = ordered.flatMap((candidate) => candidate.blockedUntilMs === void 0 ? [] : [{ identity: candidate.identity, atMs: candidate.blockedUntilMs }]);
6360
6386
  const earliestReturn = returns.length === 0 ? void 0 : returns.reduce((soonest, entry) => entry.atMs < soonest.atMs ? entry : soonest);
6361
6387
  return {
6362
6388
  candidates: ordered,
6363
- ...pick === void 0 ? { ...earliestReturn === void 0 ? {} : { earliestReturn } } : { pick }
6389
+ ...pick === void 0 ? { ...earliestReturn === void 0 ? {} : { earliestReturn } } : { pick },
6390
+ ...movedOff === void 0 || pick === void 0 ? {} : { movedOff }
6364
6391
  };
6365
6392
  }
6366
6393
 
@@ -6618,6 +6645,7 @@ function collectPoolPick(params) {
6618
6645
  candidates: ranking.candidates.map(candidateView),
6619
6646
  missing: missing.map(({ identity }) => identity),
6620
6647
  ...ranking.earliestReturn === void 0 ? {} : { earliestReturn: { identity: ranking.earliestReturn.identity, at: new Date(ranking.earliestReturn.atMs).toISOString() } },
6648
+ ...ranking.movedOff === void 0 ? {} : { movedOff: ranking.movedOff },
6621
6649
  ...sticky.problem === void 0 ? {} : { stickyProblem: sticky.problem }
6622
6650
  };
6623
6651
  }
@@ -8889,6 +8917,8 @@ var PoolPickReportSchema = z13.strictObject({
8889
8917
  missing: z13.array(z13.string()),
8890
8918
  /** When nothing can be picked, the soonest any member returns. */
8891
8919
  earliestReturn: z13.strictObject({ identity: z13.string(), at: z13.iso.datetime() }).optional(),
8920
+ /** The member a resumed conversation started on but moved off, and why, when the ranking could not keep it. */
8921
+ movedOff: z13.strictObject({ identity: z13.string(), reason: z13.string() }).optional(),
8892
8922
  /** Why the last-pick record could not be read, when that is the case. */
8893
8923
  stickyProblem: z13.string().optional()
8894
8924
  });
@@ -9899,6 +9929,9 @@ import { eventIterator as eventIterator2, withEventMeta as withEventMeta2 } from
9899
9929
  import { z as z20 } from "zod";
9900
9930
  var DOOR_EVENT_SOURCE_RC = "rc";
9901
9931
  var LAUNCH_EVENT_SOURCE = "launch";
9932
+ var USAGE_EVENT_SOURCE = "usage";
9933
+ var DOOR_HEALTH_EVENT_SOURCE = "door";
9934
+ var QUOTA_EXPIRING_EVENT_SOURCE = "quota-expiring";
9902
9935
  var DoorEventSchema = z20.strictObject({
9903
9936
  source: z20.string().min(1),
9904
9937
  /** A positive integer because the backbone's counters start at one and only ever increase. */
@@ -9914,6 +9947,20 @@ var LaunchLifecycleEventSchema = z20.strictObject({
9914
9947
  startedAt: z20.number(),
9915
9948
  observedAt: z20.number()
9916
9949
  });
9950
+ var DoorHealthEventSchema = z20.discriminatedUnion("kind", [
9951
+ z20.strictObject({ kind: z20.literal("generation"), pid: z20.number().int().positive(), providerPort: z20.number().int().positive(), connectPort: z20.number().int().positive(), directPort: z20.number().int().positive(), observedAt: z20.number() }),
9952
+ z20.strictObject({ kind: z20.literal("listenerFailed"), pid: z20.number().int().positive(), listener: z20.enum(["provider", "connect", "direct"]), message: z20.string(), observedAt: z20.number() }),
9953
+ z20.strictObject({ kind: z20.literal("idleShutdown"), pid: z20.number().int().positive(), observedAt: z20.number() })
9954
+ ]);
9955
+ var QuotaExpiringEventSchema = z20.strictObject({
9956
+ identity: z20.string().min(1),
9957
+ provider: z20.string().min(1),
9958
+ window: z20.enum(["fiveHour", "sevenDay"]),
9959
+ /** The fraction of the window already used when it was seen expiring, always below one because a fully used window has nothing left to spend. */
9960
+ utilization: z20.number().min(0).max(1),
9961
+ resetsAt: z20.iso.datetime(),
9962
+ observedAt: z20.number()
9963
+ });
9917
9964
 
9918
9965
  // src/frontdoor/eventsApi.ts
9919
9966
  var EVENTS_API_TAG = "events";
@@ -10222,6 +10269,81 @@ function createLaunchEventPublisher(hub, now) {
10222
10269
  };
10223
10270
  }
10224
10271
 
10272
+ // src/frontdoor/doorHealthEvents.ts
10273
+ function createDoorHealthPublisher(hub, now, pid) {
10274
+ const publisher = hub.publisher(DOOR_HEALTH_EVENT_SOURCE);
10275
+ return {
10276
+ generation: (ports) => {
10277
+ publisher.publish({ kind: "generation", pid, providerPort: ports.providerPort, connectPort: ports.connectPort, directPort: ports.directPort, observedAt: now() });
10278
+ },
10279
+ listenerFailed: (listener, message) => {
10280
+ publisher.publish({ kind: "listenerFailed", pid, listener, message, observedAt: now() });
10281
+ },
10282
+ idleShutdown: () => {
10283
+ publisher.publish({ kind: "idleShutdown", pid, observedAt: now() });
10284
+ }
10285
+ };
10286
+ }
10287
+
10288
+ // src/frontdoor/quotaExpiringEvents.ts
10289
+ var MS_PER_HOUR2 = 36e5;
10290
+ var MS_PER_DAY2 = 864e5;
10291
+ var FIVE_HOUR_WINDOW_HOURS = 5;
10292
+ var SEVEN_DAY_WINDOW_DAYS = 7;
10293
+ var FIVE_HOUR_WINDOW_MS2 = FIVE_HOUR_WINDOW_HOURS * MS_PER_HOUR2;
10294
+ var SEVEN_DAY_WINDOW_MS2 = SEVEN_DAY_WINDOW_DAYS * MS_PER_DAY2;
10295
+ var FINAL_SPAN_DENOMINATOR = 30;
10296
+ var QUOTA_EXPIRING_WINDOW_FRACTION = 1 / FINAL_SPAN_DENOMINATOR;
10297
+ function createQuotaExpiringPublisher(hub, deps) {
10298
+ const publisher = hub.publisher(QUOTA_EXPIRING_EVENT_SOURCE);
10299
+ const latest = /* @__PURE__ */ new Map();
10300
+ for (const snapshot of deps.seed) {
10301
+ latest.set(snapshot.identity, snapshot);
10302
+ }
10303
+ hub.subscribe([USAGE_EVENT_SOURCE], (event) => {
10304
+ const snapshot = UsageSnapshotSchema.parse(event.payload);
10305
+ latest.set(snapshot.identity, snapshot);
10306
+ });
10307
+ const announced = /* @__PURE__ */ new Set();
10308
+ const windowsOf = (snapshot) => {
10309
+ const views = [];
10310
+ for (const provider of Object.keys(snapshot.providers).sort()) {
10311
+ const unified = snapshot.providers[provider]?.rateLimit?.unified;
10312
+ const fiveHour = unified?.fiveHour;
10313
+ if (fiveHour?.utilization !== void 0 && fiveHour.resetsAt !== void 0) {
10314
+ views.push({ provider, view: { window: "fiveHour", spanMs: FIVE_HOUR_WINDOW_MS2, utilization: fiveHour.utilization, resetsAtMs: Date.parse(fiveHour.resetsAt) } });
10315
+ }
10316
+ const sevenDay = unified?.sevenDay;
10317
+ if (sevenDay?.utilization !== void 0 && sevenDay.resetsAt !== void 0) {
10318
+ views.push({ provider, view: { window: "sevenDay", spanMs: SEVEN_DAY_WINDOW_MS2, utilization: sevenDay.utilization, resetsAtMs: Date.parse(sevenDay.resetsAt) } });
10319
+ }
10320
+ }
10321
+ return views;
10322
+ };
10323
+ return {
10324
+ check: () => {
10325
+ const now = deps.now();
10326
+ for (const identity of [...latest.keys()].sort()) {
10327
+ const snapshot = latest.get(identity);
10328
+ if (snapshot === void 0) {
10329
+ continue;
10330
+ }
10331
+ for (const { provider, view } of windowsOf(snapshot)) {
10332
+ if (view.utilization >= 1 || view.resetsAtMs <= now || view.resetsAtMs - now >= view.spanMs * QUOTA_EXPIRING_WINDOW_FRACTION) {
10333
+ continue;
10334
+ }
10335
+ const key = `${identity}:${provider}:${view.window}:${String(view.resetsAtMs)}`;
10336
+ if (announced.has(key)) {
10337
+ continue;
10338
+ }
10339
+ announced.add(key);
10340
+ publisher.publish({ identity, provider, window: view.window, utilization: view.utilization, resetsAt: new Date(view.resetsAtMs).toISOString(), observedAt: now });
10341
+ }
10342
+ }
10343
+ }
10344
+ };
10345
+ }
10346
+
10225
10347
  // src/frontdoor/rcLiveUsage.ts
10226
10348
  var RC_RATE_LIMIT_EVENT_TYPE = "rate_limit_event";
10227
10349
  function isRecord5(value) {
@@ -12543,10 +12665,11 @@ function resolvePoolLaunch(params) {
12543
12665
  if (graph.ranking.candidates.length === 0) {
12544
12666
  return { ok: false, message: `agent-shim: no member of pool "${poolName}" is an existing identity.` };
12545
12667
  }
12546
- const { pick, earliestReturn } = graph.ranking;
12668
+ const { pick, earliestReturn, movedOff } = graph.ranking;
12547
12669
  if (pick !== void 0) {
12548
12670
  recordStickyPick(params.usageFs, params.paths.usagePicksFile, params.cwd, pick.identity, nowMs);
12549
- return { ok: true, identity: pick.identity, explanation: `pool ${poolName}: ${pick.reasons.slice(0, REASONS_LOGGED).join("; ")}` };
12671
+ const move = movedOff === void 0 ? "" : `moved off ${movedOff.identity} (${movedOff.reason}); `;
12672
+ return { ok: true, identity: pick.identity, explanation: `pool ${poolName}: ${move}${pick.reasons.slice(0, REASONS_LOGGED).join("; ")}` };
12550
12673
  }
12551
12674
  if (earliestReturn === void 0) {
12552
12675
  return { ok: false, message: `agent-shim: no member of pool "${poolName}" can be picked.` };
@@ -13214,6 +13337,7 @@ export {
13214
13337
  CredentialSourceSchema,
13215
13338
  DOOR_EVENT_BUFFER_EVENTS,
13216
13339
  DOOR_EVENT_SOURCE_RC,
13340
+ DOOR_HEALTH_EVENT_SOURCE,
13217
13341
  DirectoryRuleAlreadyExistsError,
13218
13342
  DirectoryRuleMissingTargetError,
13219
13343
  DirectoryRuleNotFoundError,
@@ -13223,6 +13347,7 @@ export {
13223
13347
  DoctorRunOutputSchema,
13224
13348
  DoorEventSchema,
13225
13349
  DoorEventSourceQuerySchema,
13350
+ DoorHealthEventSchema,
13226
13351
  EXIT_FAILURE,
13227
13352
  EXIT_USAGE,
13228
13353
  EffectiveWindowSchema,
@@ -13259,6 +13384,8 @@ export {
13259
13384
  ProviderKindMismatchError,
13260
13385
  ProviderNotFoundError,
13261
13386
  ProviderSchema,
13387
+ QUOTA_EXPIRING_EVENT_SOURCE,
13388
+ QuotaExpiringEventSchema,
13262
13389
  RC_CONTEXT_USAGE_DETAILS,
13263
13390
  RC_IDLE_EXPIRY_MS,
13264
13391
  RC_ORPC_PATH_PREFIX,
@@ -13286,6 +13413,7 @@ export {
13286
13413
  RcRateLimitWindowSchema,
13287
13414
  RcStreamEnvelopeSchema,
13288
13415
  RcStreamEventSchema,
13416
+ USAGE_EVENT_SOURCE,
13289
13417
  UsageError,
13290
13418
  UsageListOutputSchema,
13291
13419
  UsageLiveOutputSchema,
@@ -13331,10 +13459,12 @@ export {
13331
13459
  createDoorApiNodeHandler,
13332
13460
  createDoorApiRouter,
13333
13461
  createDoorEventHub,
13462
+ createDoorHealthPublisher,
13334
13463
  createEventsApiRouter,
13335
13464
  createLaunchEventPublisher,
13336
13465
  createLeafCache,
13337
13466
  createProfile,
13467
+ createQuotaExpiringPublisher,
13338
13468
  createRcApiNodeHandler,
13339
13469
  createRcApiRouter,
13340
13470
  createRcControlHandler,
@@ -2816,6 +2816,10 @@ declare const CheckReportJsonSchema: z.ZodObject<{
2816
2816
  identity: z.ZodString;
2817
2817
  at: z.ZodISODateTime;
2818
2818
  }, z.core.$strict>>;
2819
+ movedOff: z.ZodOptional<z.ZodObject<{
2820
+ identity: z.ZodString;
2821
+ reason: z.ZodString;
2822
+ }, z.core.$strict>>;
2819
2823
  stickyProblem: z.ZodOptional<z.ZodString>;
2820
2824
  }, z.core.$strict>>;
2821
2825
  configProfile: z.ZodObject<{
@@ -3293,6 +3297,10 @@ declare const PoolPickReportSchema: z.ZodObject<{
3293
3297
  identity: z.ZodString;
3294
3298
  at: z.ZodISODateTime;
3295
3299
  }, z.core.$strict>>;
3300
+ movedOff: z.ZodOptional<z.ZodObject<{
3301
+ identity: z.ZodString;
3302
+ reason: z.ZodString;
3303
+ }, z.core.$strict>>;
3296
3304
  stickyProblem: z.ZodOptional<z.ZodString>;
3297
3305
  }, z.core.$strict>;
3298
3306
  type PoolPickReport = z.infer<typeof PoolPickReportSchema>;
@@ -3760,6 +3768,12 @@ type UsageSnapshot = z.infer<typeof UsageSnapshotSchema>;
3760
3768
  declare const DOOR_EVENT_SOURCE_RC = "rc";
3761
3769
  /** The source tag every launch lifecycle event carries: the registry's own register, prune and end moments, the first publisher the door itself owns. */
3762
3770
  declare const LAUNCH_EVENT_SOURCE = "launch";
3771
+ /** The source tag every usage change event carries: one event per usage snapshot the door writes, the durable fact a quota consumer diffs or reads windows from. */
3772
+ declare const USAGE_EVENT_SOURCE = "usage";
3773
+ /** The source tag every door health event carries: the supervisor's own state transitions, the moments a consumer of the door needs to know the door itself changed. */
3774
+ declare const DOOR_HEALTH_EVENT_SOURCE = "door";
3775
+ /** The source tag every expiring-quota event carries: an identity whose unused window allowance is about to reset, computed from the same snapshots the usage source keeps fresh. */
3776
+ declare const QUOTA_EXPIRING_EVENT_SOURCE = "quota-expiring";
3763
3777
  /** One event on the door's backbone, exactly as the subscription yields it: the source that published it, the sequence the backbone assigned that source, and the publisher's own payload carried verbatim for the consumer to narrow. */
3764
3778
  declare const DoorEventSchema: z.ZodObject<{
3765
3779
  source: z.ZodString;
@@ -3789,6 +3803,54 @@ declare const LaunchLifecycleEventSchema: z.ZodObject<{
3789
3803
  }, z.core.$strict>;
3790
3804
  /** One launch lifecycle event, as the TypeScript the publisher emits and its consumers handle. */
3791
3805
  type LaunchLifecycleEvent = z.output<typeof LaunchLifecycleEventSchema>;
3806
+ /**
3807
+ * One door health event: the supervisor's own state transitions, observed at the moment they happened in this process. `generation` is the door fully serving (every listener bound and the state file naming it); `listenerFailed` is a start failure that ends the generation, naming which listener and why; `idleShutdown` is the door closing itself with an empty session registry.
3808
+ */
3809
+ declare const DoorHealthEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3810
+ kind: z.ZodLiteral<"generation">;
3811
+ pid: z.ZodNumber;
3812
+ providerPort: z.ZodNumber;
3813
+ connectPort: z.ZodNumber;
3814
+ directPort: z.ZodNumber;
3815
+ observedAt: z.ZodNumber;
3816
+ }, z.core.$strict>, z.ZodObject<{
3817
+ kind: z.ZodLiteral<"listenerFailed">;
3818
+ pid: z.ZodNumber;
3819
+ listener: z.ZodEnum<{
3820
+ provider: "provider";
3821
+ connect: "connect";
3822
+ direct: "direct";
3823
+ }>;
3824
+ message: z.ZodString;
3825
+ observedAt: z.ZodNumber;
3826
+ }, z.core.$strict>, z.ZodObject<{
3827
+ kind: z.ZodLiteral<"idleShutdown">;
3828
+ pid: z.ZodNumber;
3829
+ observedAt: z.ZodNumber;
3830
+ }, z.core.$strict>], "kind">;
3831
+ /** One door health event, as the TypeScript the publisher emits and its consumers handle. */
3832
+ type DoorHealthEvent = z.output<typeof DoorHealthEventSchema>;
3833
+ /**
3834
+ * One expiring-quota event: an identity's window with allowance still unspent that is about to reset, published once when the window enters its final span (so a scheduler can spend what would otherwise be lost, the moment spending it is still possible). `resetsAt` is the window's own reset instant; `observedAt` is when the door's tick saw it cross.
3835
+ */
3836
+ declare const QuotaExpiringEventSchema: z.ZodObject<{
3837
+ identity: z.ZodString;
3838
+ provider: z.ZodString;
3839
+ window: z.ZodEnum<{
3840
+ fiveHour: "fiveHour";
3841
+ sevenDay: "sevenDay";
3842
+ }>;
3843
+ utilization: z.ZodNumber;
3844
+ resetsAt: z.ZodISODateTime;
3845
+ observedAt: z.ZodNumber;
3846
+ }, z.core.$strict>;
3847
+ /** One expiring-quota event, as the TypeScript the publisher emits and its consumers handle. */
3848
+ type QuotaExpiringEvent = z.output<typeof QuotaExpiringEventSchema>;
3849
+ /**
3850
+ * The usage source's payload: the snapshot the door just wrote, verbatim, so a consumer sees the quota change or reset in the payload itself rather than the door guessing which of the two a write was. The snapshot schema is the payload schema (identity, observed instant, every provider's state with its windows), the one definition `usage --json` readers already share.
3851
+ */
3852
+ /** One usage change event, as the TypeScript the publisher emits and its consumers handle: the written snapshot itself, so the snapshot's own schema (`UsageSnapshotSchema`) is this payload's schema rather than a renamed copy. */
3853
+ type UsageChangeEvent = UsageSnapshot;
3792
3854
 
3793
3855
  /**
3794
3856
  * The door's event backbone: the publisher/subscriber machinery the Remote Control client stream's fan-out first proved, generalised so any door-wide source can publish and any consumer can subscribe once instead of each source growing its own channel. A publisher registers under a source tag and publishes payloads; the backbone stamps each event with its source's own monotonic sequence and delivers to every matching subscriber synchronously, in publication order. A source that carries its own ordering on the wire (the Remote Control envelope's per-session `sequence_num`, the number its resume rule resumes after) keeps it inside the payload, verbatim: the backbone's sequence is deliberately not any protocol's number.
@@ -4186,6 +4248,10 @@ declare function createControlApiRouter(deps: ControlApiDeps): {
4186
4248
  identity: zod.ZodString;
4187
4249
  at: zod.ZodISODateTime;
4188
4250
  }, zod_v4_core.$strict>>;
4251
+ movedOff: zod.ZodOptional<zod.ZodObject<{
4252
+ identity: zod.ZodString;
4253
+ reason: zod.ZodString;
4254
+ }, zod_v4_core.$strict>>;
4189
4255
  stickyProblem: zod.ZodOptional<zod.ZodString>;
4190
4256
  }, zod_v4_core.$strict>>;
4191
4257
  configProfile: zod.ZodObject<{
@@ -4503,6 +4569,10 @@ declare function createControlApiRouter(deps: ControlApiDeps): {
4503
4569
  identity: zod.ZodString;
4504
4570
  at: zod.ZodISODateTime;
4505
4571
  }, zod_v4_core.$strict>>;
4572
+ movedOff: zod.ZodOptional<zod.ZodObject<{
4573
+ identity: zod.ZodString;
4574
+ reason: zod.ZodString;
4575
+ }, zod_v4_core.$strict>>;
4506
4576
  stickyProblem: zod.ZodOptional<zod.ZodString>;
4507
4577
  }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
4508
4578
  };
@@ -4759,6 +4829,10 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
4759
4829
  identity: zod.ZodString;
4760
4830
  at: zod.ZodISODateTime;
4761
4831
  }, zod_v4_core.$strict>>;
4832
+ movedOff: zod.ZodOptional<zod.ZodObject<{
4833
+ identity: zod.ZodString;
4834
+ reason: zod.ZodString;
4835
+ }, zod_v4_core.$strict>>;
4762
4836
  stickyProblem: zod.ZodOptional<zod.ZodString>;
4763
4837
  }, zod_v4_core.$strict>>;
4764
4838
  configProfile: zod.ZodObject<{
@@ -5076,6 +5150,10 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
5076
5150
  identity: zod.ZodString;
5077
5151
  at: zod.ZodISODateTime;
5078
5152
  }, zod_v4_core.$strict>>;
5153
+ movedOff: zod.ZodOptional<zod.ZodObject<{
5154
+ identity: zod.ZodString;
5155
+ reason: zod.ZodString;
5156
+ }, zod_v4_core.$strict>>;
5079
5157
  stickyProblem: zod.ZodOptional<zod.ZodString>;
5080
5158
  }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
5081
5159
  };
@@ -5571,6 +5649,36 @@ interface LaunchEventPublisher {
5571
5649
  /** Creates the launch lifecycle publisher. One per door process, fed by the supervisor's tick. */
5572
5650
  declare function createLaunchEventPublisher(hub: DoorEventHub, now: () => number): LaunchEventPublisher;
5573
5651
 
5652
+ /**
5653
+ * The door health publisher: the supervisor's own state transitions as backbone events, so a consumer of the door learns the door itself changed and not only its sessions. The publisher emits nothing of its own: the supervisor tells it the moments it already lives through (every listener bound, a start failure that ends the generation, the idle shutdown), each published the moment it happens rather than at a tick, because these are process facts, not registry facts diffed between observations.
5654
+ */
5655
+ /** Everything the door health publisher needs: the backbone it publishes on and the clock its events are observed at. */
5656
+ interface DoorHealthPublisher {
5657
+ /** Publishes the generation event: every listener bound, the state file naming this supervisor, the door fully serving. */
5658
+ readonly generation: (ports: {
5659
+ readonly providerPort: number;
5660
+ readonly connectPort: number;
5661
+ readonly directPort: number;
5662
+ }) => void;
5663
+ /** Publishes the start failure that ends the generation, naming which listener and why. */
5664
+ readonly listenerFailed: (listener: "provider" | "connect" | "direct", message: string) => void;
5665
+ /** Publishes the idle shutdown: the door closing itself with an empty session registry. */
5666
+ readonly idleShutdown: () => void;
5667
+ }
5668
+ /** Creates the door health publisher. One per door process, fed by the supervisor. */
5669
+ declare function createDoorHealthPublisher(hub: DoorEventHub, now: () => number, pid: number): DoorHealthPublisher;
5670
+
5671
+ /** Everything the expiring-quota publisher needs: the backbone (its usage source keeps the snapshots fresh), the snapshots as they stand at assembly, and the clock the tick reads. */
5672
+ interface QuotaExpiringPublisher {
5673
+ /** Checks every held window against the clock and publishes each one newly inside its final span. Idempotent within one span; cheap enough for the supervisor's every tick. */
5674
+ readonly check: () => void;
5675
+ }
5676
+ /** Creates the expiring-quota publisher. One per door process, checked on the supervisor's tick. */
5677
+ declare function createQuotaExpiringPublisher(hub: DoorEventHub, deps: {
5678
+ readonly seed: readonly UsageSnapshot[];
5679
+ readonly now: () => number;
5680
+ }): QuotaExpiringPublisher;
5681
+
5574
5682
  /**
5575
5683
  * The rate-limit facts one client read stream event carries, or undefined when the event is not a `rate_limit_event` this module can read: a payload of another type, a payload without the family's own one required field, or one whose `rate_limit_info` does not parse. An envelope the door cannot read is one it knows nothing about, never a failure, exactly as the stream's own parser treats an envelope it cannot read. Exported because the renderers (`frontdoor rc watch`, the web client's twin) narrow the same payload through the same one definition.
5576
5684
  */
@@ -5859,6 +5967,14 @@ interface FrontDoorSupervisorPorts {
5859
5967
  * Reports one tick's session-registry facts to the door's event backbone: the sessions the tick's listing saw (taken before the prune, so a pruned launch's record is still there to name its start time) and the pids the tick's prune removed. The launch lifecycle publisher turns the diff between ticks into source-tagged events; the listing is also this loop's own idle input, so the two read one fact instead of two.
5860
5968
  */
5861
5969
  readonly observeLaunchRegistry: (sessions: readonly FrontDoorSessionSummary[], pruned: readonly number[]) => void;
5970
+ /**
5971
+ * Publishes the supervisor's own state transitions to the door's event backbone: the generation serving, a start failure that ends it, the idle shutdown. Fed the moments the supervisor already lives through, published as they happen rather than at a tick, because these are process facts.
5972
+ */
5973
+ readonly doorHealth: DoorHealthPublisher;
5974
+ /**
5975
+ * Checks the expiring-quota windows against the clock, once per tick: the publisher holds the snapshots the usage source keeps fresh, so this costs arithmetic, never a file read.
5976
+ */
5977
+ readonly checkQuotaExpiry: () => void;
5862
5978
  readonly log: (line: string) => void;
5863
5979
  }
5864
5980
  /** Options for `runFrontDoorSupervisor`. */
@@ -5973,7 +6089,7 @@ interface Candidate {
5973
6089
  readonly class: CandidateClass;
5974
6090
  /** Plan-size-weighted remaining quota per hour until its reset: higher is more wasted if left unused. Present for `scored` only. */
5975
6091
  readonly score?: number;
5976
- /** False when the five-hour window would run dry, at the observed pace, before it resets. A `scored` candidate that is not feasible ranks below every feasible one. */
6092
+ /** False when a quota window would run dry, at the observed pace, before it resets (the five-hour at its own or the rescaled shared pace, the seven-day at its own). A `scored` candidate that is not feasible ranks below every feasible one. */
5977
6093
  readonly feasible: boolean;
5978
6094
  /** When an `ineligible` candidate can be used again. */
5979
6095
  readonly blockedUntilMs?: number;
@@ -5991,11 +6107,16 @@ interface PoolRanking {
5991
6107
  readonly identity: string;
5992
6108
  readonly atMs: number;
5993
6109
  };
6110
+ /** The member a resumed or continued conversation started on but moved off, and why, when a launch that resumes could not keep it. One sentence for the launch decision line and `check`. */
6111
+ readonly movedOff?: {
6112
+ readonly identity: string;
6113
+ readonly reason: string;
6114
+ };
5994
6115
  }
5995
6116
  /**
5996
6117
  * Ranks `members` for a launch.
5997
6118
  *
5998
- * A member is `ineligible` while a window of its plan, or a refusal it last hit, still binds; it is `unknown` without recorded quota, `pay-per-use` when its usage bills by use, and otherwise `scored`. Scored members order by how much plan-size-weighted quota would expire unused per hour of runway, with any whose five-hour window would run dry at the observed pace (their own, or the person's pace on another member rescaled by plan size) placed behind those that would not. The member last picked for this directory then moves to the front if it is still usable and either the launch resumes a conversation or its prompt cache is still warm.
6119
+ * A member is `ineligible` while a window of its plan, or a refusal it last hit, still binds; it is `unknown` without recorded quota, `pay-per-use` when its usage bills by use, and otherwise `scored`. Scored members order by how much plan-size-weighted quota would expire unused per hour of runway, with any whose five-hour window would run dry at the observed pace (their own, or the person's pace on another member rescaled by plan size) or whose seven-day window would run dry at its own observed pace placed behind those that would not. The member last picked for this directory then moves to the front if it still serves on plan quota and is not projected to run dry, and either the launch resumes a conversation or its prompt cache is still warm; a resumed conversation that cannot keep its member re-ranks and continues on the pick, with the move named in `movedOff`.
5999
6120
  *
6000
6121
  * How members are ordered depends on `preference`. The default, "score", is the order above: class first, then feasibility, then score, with ties by name. "listed" keeps the order of `members`, which callers build in pool member order, so member order, not class, decides: an `unknown` (no usage recorded) or `pay-per-use` member can be picked before a later `scored` one, which is the list owner's stated preference, and a `scored` member that is not feasible keeps its place and its reason line rather than being demoted. In both modes the pick is the first non-`ineligible` candidate, `earliestReturn` still reports the soonest returning refused member, and the sticky-pick promotion applies unchanged.
6001
6122
  */
@@ -6597,5 +6718,5 @@ interface PrepareClaudeLaunchOptions {
6597
6718
  */
6598
6719
  declare function prepareClaudeLaunch(options: PrepareClaudeLaunchOptions): LaunchPlan;
6599
6720
 
6600
- export { AMBIENT_CREDENTIAL_VARS, CHECK_CREDENTIAL_APPLIES, CONNECT_INTERCEPT_HOST, CONNECT_INTERCEPT_HOSTS, CONNECT_LIMITS, CONTROL_PATH_PREFIX, CategoryClassificationOverlaySchema, CategoryClassificationSchema, CategoryMapSchema, CheckReportJsonSchema, CheckRunInputSchema, CliError, ConfigProfileSchema, CredentialCacheSchema, CredentialSchema, CredentialSourceSchema, DOOR_EVENT_BUFFER_EVENTS, DOOR_EVENT_SOURCE_RC, DirectoryRuleAlreadyExistsError, DirectoryRuleMissingTargetError, DirectoryRuleNotFoundError, DirectoryRuleSchema, DirectoryRulesSchema, DoctorFindingSchema, DoctorRunOutputSchema, DoorEventSchema, DoorEventSourceQuerySchema, EXIT_FAILURE, EXIT_USAGE, EffectiveWindowSchema, EntryValueSchema, FARM_MANIFEST_FILENAME, FrontDoorSessionStatusSchema, FrontDoorSessionsOutputSchema, FrontDoorStartError, FrontDoorStateSchema, FrontDoorStatusOutputSchema, GlobalConfigSchema, HeadroomSocketTargetSchema, HeadroomStartError, IdentityAlreadyExistsError, IdentityNotFoundError, IdentitySchema, InvalidCategoryNameError, InvalidIdentityNameError, InvalidProviderNameError, LAUNCH_EVENT_SOURCE, LaunchLifecycleEventSchema, LaunchRefusedError, LegacyProviderFileError, PROMPT_CACHE_TTL_MS, PlanClassSchema, PoolNameSchema, PoolNotFoundError, PoolPickReportSchema, PoolSchema, PortableConfigSchema, ProfileAlreadyExistsError, ProfileNotFoundError, ProviderAlreadyExistsError, ProviderKindMismatchError, ProviderNotFoundError, ProviderSchema, RC_CONTEXT_USAGE_DETAILS, RC_IDLE_EXPIRY_MS, RC_ORPC_PATH_PREFIX, RC_PENDING_DEADLINE_MS, RC_PERMISSION_MODES, RC_READ_FILE_ENCODINGS, RC_REQUEST_PARSE_CAP_BYTES, RC_SELF_HOST_ENV, RC_SELF_HOST_KEEPALIVE_MS, RC_SELF_HOST_RECORD_DIR, RC_SELF_HOST_RECORD_FILE, RC_SELF_HOST_RETENTION_MS, RC_SELF_HOST_SCOPE_LIST, RC_SELF_HOST_WORKER_JWT_TTL_SECONDS, RC_SESSIONS_PATH_PREFIX, RC_STREAM_BACKOFF_MS, RC_WEB_FETCH_ALLOW_PRIVATE_ENV, RC_WEB_FETCH_DEADLINE_MS, RC_WEB_FETCH_MAX_BYTES, RC_WEB_FETCH_MAX_REDIRECTS, ROUTED_PATH_PREFIX, RcLiveRateLimitSchema, RcPermissionModeSchema, RcRateLimitInfoSchema, RcRateLimitWindowSchema, RcStreamEnvelopeSchema, RcStreamEventSchema, UsageError, UsageListOutputSchema, UsageLiveOutputSchema, UsageSnapshotError, UsageSnapshotSchema, UsageWindowsInputSchema, UsageWindowsOutputSchema, WhenSchema, addDirectoryRule, addIdentity, addPool, addProvider, answerRcControlRequest, authenticateRcSessionMcpServer, buildEntryFacts, buildLayoutPaths, buildRcControlRequestPayload, buildRcControlResponsePayload, buildRcEndSessionPayload, buildRcEventWriteBody, buildRcFileSuggestionsPayload, buildRcGetContextUsagePayload, buildRcGetUsagePayload, buildRcInterruptPayload, buildRcKeepAlivePayload, buildRcMarkReadBody, buildRcMcpAuthenticatePayload, buildRcMcpOAuthCallbackUrlPayload, buildRcMcpReconnectPayload, buildRcMcpStatusPayload, buildRcReadFilePayload, buildRcSetModelPayload, buildRcSetPermissionModePayload, buildRcUserMessagePayload, carryOver, checkReportHasWarnings, checkReportToJson, collectCheckReport, collectDoctorReport, collectFrontDoorStatus, collectPoolPick, createControlApiRouter, createDoorApiNodeHandler, createDoorApiRouter, createDoorEventHub, createEventsApiRouter, createLaunchEventPublisher, createLeafCache, createProfile, createRcApiNodeHandler, createRcApiRouter, createRcControlHandler, createRcCredentialStore, createRcEventFanout, createRcLiveUsage, createRcSelfHostSurface, createRcSessionTracker, createRcStreamHub, createSseParser, describeProviderEndpoint, detectAmbientCredential, doorApiAuth, doorApiNodeHandlerOf, effectiveWindow, endRcSession, ensureCa, ensureFrontDoor, ensureHeadroom, evaluateAmbientCredentialGuard, evaluateWhen, fetchThroughWebProxy, formatAmbientCredentialGuardMessage, formatCheckReport, formatDoctorReport, formatFrontDoorStatus, forwardableHeaders, frontDoorApiClient, frontDoorApiLink, frontDoorRcApiClient, frontDoorRcControl, generateCa, getRcSessionContextUsage, getRcSessionMcpStatus, getRcSessionUsage, headroomSocketTarget, identityExists, injectRcUserMessage, interruptRcSession, isIdentityDirectoryName, isInterceptedHost, isPrivateAddress, isRcContextUsageDetail, isRcPermissionMode, isRcReadFileEncoding, lateRcEventDial, lateRcStreamDial, listDirectoryRules, listIdentities, listProfiles, listProviders, listUsageSnapshots, matchBranch, mintLeaf, mintRcSelfHostCredential, observingRoutedRoute, parseConnectTarget, parseRcStreamEnvelope, planOf, prepareClaudeLaunch, prepareLaunch, profileExists, providerExists, rankPool, rcEventWriteResultFromAnswer, rcFanoutOnDoorHub, rcObserverAsPassthrough, rcRateLimitInfoOf, rcSelfHostFromEnv, rcWebFetchAllowsPrivateFromEnv, readActiveIdentity, readDirectoryRules, readFarmManifest, readGlobalConfig, readIdentity, readPools, readProfile, readProvider, readRcSelfHostRecord, readRcSessionFile, readUsageSnapshot, realConnectCertStore, realConnectEffects, realRcControlTransport, realRcEventDial, realRcStreamDial, realRcWebFetch, reconnectRcSessionMcpServer, recoverFarm, recoveryDiagnostics, removeDirectoryRule, removeIdentity, removePool, removeProfile, removeProvider, requirePool, resolveAgentShimHome, resolveClaudeHome, resolveDecisions, resolveLayoutPaths, resolveSupervisorConfig, resyncFarm, runCheck, runDoctor, runFrontDoorSupervisor, runLauncher, runSupervisor, sendRcKeepAlive, servedByPipeline, setAllowAmbientCredential, setDefaultConfigProfile, setGlobalDefaultProfile, setIdentityCredential, setPool, setProfileCategories, setProfileEntries, setProfileLaunchFlags, setProfileMetadata, setRcSessionModel, setRcSessionPermissionMode, snapshotPath, spawnClaude, startConnectServer, submitRcSessionMcpOAuthCallbackUrl, suggestRcSessionFiles, teleportRcSession, topLevelNames, updateDirectoryRule, updateProvider, useIdentity, writeDirectoryRules };
6601
- export type { AddDirectoryRuleOptions, AddProviderInput, AmbientCredentialDetection, AmbientCredentialGuardResult, AmbientCredentialVar, BuildEntryFactsParams, CaMaterial, Candidate, CarryOverParams, CarryOverResult, CategoryMap, CheckReport, CheckReportJson, CollectCheckReportParams, CollectDoctorReportParams, CompiledRule, ConditionContext, ConfigProfile, ConnectCertStore, ConnectEffects, ConnectLimits, ConnectLocalSurface, ConnectServerConfig, ConnectServerHandle, ConnectTarget, ControlApiClient, ControlApiDeps, ControlApiRouter, Credential, CredentialSource, Decision, Diagnostic, DirectoryRule, DirectoryRules, DoctorReport, DoorApiClient, DoorApiContext, DoorApiDeps, DoorApiRouter, DoorEvent, DoorEventHub, DoorEventPublisher, DoorEventStream, DoorEventsApiDeps, EffectiveWindow, EliminatedRule, EnsureFrontDoorPorts, EnsureHeadroomPorts, EntryFact, EntryFacts, EntryValue, EvaluateAmbientCredentialGuardParams, FlattenedCascade, FrontDoorRcControl, FrontDoorSessionStatus, FrontDoorStatus, FrontDoorSupervisorPorts, GlobalConfig, HeadroomSupervisorConfig, Identity, IdentityCredentialChange, IdentityListEntry, IdentityListing, InjectedCredential, LaunchEventPublisher, LaunchLifecycleEvent, LaunchPlan, Layer, LayerId, LayoutPaths, LeafCert, NestedContribution, PlanClass, Pool, PoolMember, PoolPickReport, PoolRanking, PortableConfig, PrepareClaudeLaunchOptions, PrepareLaunchParams, ProfileListEntry, Provider, ProviderListEntry, RankPoolInput, RcAnswerDecision, RcAnswerDeps, RcApiClient, RcApiDeps, RcApiRouter, RcContextUsageDetail, RcControlAnswer, RcControlHandlerDeps, RcControlRequestDeps, RcControlTransport, RcCredentialStore, RcDialAnswer, RcDialTarget, RcEventDial, RcEventFanout, RcEventWriteResult, RcExchangeObserver, RcInjectDeps, RcLiveRateLimit, RcLiveUsage, RcLiveUsageDeps, RcObservedCredential, RcObservedRequest, RcPendingRequestSummary, RcPermissionMode, RcPresenceAnswer, RcRateLimitInfo, RcRateLimitWindow, RcReadFileEncoding, RcReadFileOptions, RcSelfHostCredentialRecord, RcSelfHostDeps, RcSelfHostMintResult, RcSelfHostSurface, RcSessionStatus, RcSessionSummary, RcSessionTracker, RcSessionTrackerDeps, RcStreamAnswer, RcStreamDial, RcStreamEnvelope, RcStreamEvent, RcStreamHub, RcStreamHubDeps, RcWebFetchDeps, RcWebFetchHop, RcWebFetchOutcome, RcWebFetcher, RcWorkerFact, RcWriteHeaders, RecoverFarmParams, RecoveryResult, ResolveDecisionsInput, ResolvedState, ResyncFarmParams, ResyncFarmResult, RunCheckParams, RunDoctorParams, RunFrontDoorSupervisorOptions, RunLauncherParams, RunSupervisorOptions, SpawnClaudeParams, SseParsedEvent, StickyPick, SupervisorPorts, UnreadableIdentityListEntry, UpdateDirectoryRuleOptions, UpdateProviderInput, UsageReadFs, UsageSnapshot, WhenCondition, WhenEvaluation };
6721
+ export { AMBIENT_CREDENTIAL_VARS, CHECK_CREDENTIAL_APPLIES, CONNECT_INTERCEPT_HOST, CONNECT_INTERCEPT_HOSTS, CONNECT_LIMITS, CONTROL_PATH_PREFIX, CategoryClassificationOverlaySchema, CategoryClassificationSchema, CategoryMapSchema, CheckReportJsonSchema, CheckRunInputSchema, CliError, ConfigProfileSchema, CredentialCacheSchema, CredentialSchema, CredentialSourceSchema, DOOR_EVENT_BUFFER_EVENTS, DOOR_EVENT_SOURCE_RC, DOOR_HEALTH_EVENT_SOURCE, DirectoryRuleAlreadyExistsError, DirectoryRuleMissingTargetError, DirectoryRuleNotFoundError, DirectoryRuleSchema, DirectoryRulesSchema, DoctorFindingSchema, DoctorRunOutputSchema, DoorEventSchema, DoorEventSourceQuerySchema, DoorHealthEventSchema, EXIT_FAILURE, EXIT_USAGE, EffectiveWindowSchema, EntryValueSchema, FARM_MANIFEST_FILENAME, FrontDoorSessionStatusSchema, FrontDoorSessionsOutputSchema, FrontDoorStartError, FrontDoorStateSchema, FrontDoorStatusOutputSchema, GlobalConfigSchema, HeadroomSocketTargetSchema, HeadroomStartError, IdentityAlreadyExistsError, IdentityNotFoundError, IdentitySchema, InvalidCategoryNameError, InvalidIdentityNameError, InvalidProviderNameError, LAUNCH_EVENT_SOURCE, LaunchLifecycleEventSchema, LaunchRefusedError, LegacyProviderFileError, PROMPT_CACHE_TTL_MS, PlanClassSchema, PoolNameSchema, PoolNotFoundError, PoolPickReportSchema, PoolSchema, PortableConfigSchema, ProfileAlreadyExistsError, ProfileNotFoundError, ProviderAlreadyExistsError, ProviderKindMismatchError, ProviderNotFoundError, ProviderSchema, QUOTA_EXPIRING_EVENT_SOURCE, QuotaExpiringEventSchema, RC_CONTEXT_USAGE_DETAILS, RC_IDLE_EXPIRY_MS, RC_ORPC_PATH_PREFIX, RC_PENDING_DEADLINE_MS, RC_PERMISSION_MODES, RC_READ_FILE_ENCODINGS, RC_REQUEST_PARSE_CAP_BYTES, RC_SELF_HOST_ENV, RC_SELF_HOST_KEEPALIVE_MS, RC_SELF_HOST_RECORD_DIR, RC_SELF_HOST_RECORD_FILE, RC_SELF_HOST_RETENTION_MS, RC_SELF_HOST_SCOPE_LIST, RC_SELF_HOST_WORKER_JWT_TTL_SECONDS, RC_SESSIONS_PATH_PREFIX, RC_STREAM_BACKOFF_MS, RC_WEB_FETCH_ALLOW_PRIVATE_ENV, RC_WEB_FETCH_DEADLINE_MS, RC_WEB_FETCH_MAX_BYTES, RC_WEB_FETCH_MAX_REDIRECTS, ROUTED_PATH_PREFIX, RcLiveRateLimitSchema, RcPermissionModeSchema, RcRateLimitInfoSchema, RcRateLimitWindowSchema, RcStreamEnvelopeSchema, RcStreamEventSchema, USAGE_EVENT_SOURCE, UsageError, UsageListOutputSchema, UsageLiveOutputSchema, UsageSnapshotError, UsageSnapshotSchema, UsageWindowsInputSchema, UsageWindowsOutputSchema, WhenSchema, addDirectoryRule, addIdentity, addPool, addProvider, answerRcControlRequest, authenticateRcSessionMcpServer, buildEntryFacts, buildLayoutPaths, buildRcControlRequestPayload, buildRcControlResponsePayload, buildRcEndSessionPayload, buildRcEventWriteBody, buildRcFileSuggestionsPayload, buildRcGetContextUsagePayload, buildRcGetUsagePayload, buildRcInterruptPayload, buildRcKeepAlivePayload, buildRcMarkReadBody, buildRcMcpAuthenticatePayload, buildRcMcpOAuthCallbackUrlPayload, buildRcMcpReconnectPayload, buildRcMcpStatusPayload, buildRcReadFilePayload, buildRcSetModelPayload, buildRcSetPermissionModePayload, buildRcUserMessagePayload, carryOver, checkReportHasWarnings, checkReportToJson, collectCheckReport, collectDoctorReport, collectFrontDoorStatus, collectPoolPick, createControlApiRouter, createDoorApiNodeHandler, createDoorApiRouter, createDoorEventHub, createDoorHealthPublisher, createEventsApiRouter, createLaunchEventPublisher, createLeafCache, createProfile, createQuotaExpiringPublisher, createRcApiNodeHandler, createRcApiRouter, createRcControlHandler, createRcCredentialStore, createRcEventFanout, createRcLiveUsage, createRcSelfHostSurface, createRcSessionTracker, createRcStreamHub, createSseParser, describeProviderEndpoint, detectAmbientCredential, doorApiAuth, doorApiNodeHandlerOf, effectiveWindow, endRcSession, ensureCa, ensureFrontDoor, ensureHeadroom, evaluateAmbientCredentialGuard, evaluateWhen, fetchThroughWebProxy, formatAmbientCredentialGuardMessage, formatCheckReport, formatDoctorReport, formatFrontDoorStatus, forwardableHeaders, frontDoorApiClient, frontDoorApiLink, frontDoorRcApiClient, frontDoorRcControl, generateCa, getRcSessionContextUsage, getRcSessionMcpStatus, getRcSessionUsage, headroomSocketTarget, identityExists, injectRcUserMessage, interruptRcSession, isIdentityDirectoryName, isInterceptedHost, isPrivateAddress, isRcContextUsageDetail, isRcPermissionMode, isRcReadFileEncoding, lateRcEventDial, lateRcStreamDial, listDirectoryRules, listIdentities, listProfiles, listProviders, listUsageSnapshots, matchBranch, mintLeaf, mintRcSelfHostCredential, observingRoutedRoute, parseConnectTarget, parseRcStreamEnvelope, planOf, prepareClaudeLaunch, prepareLaunch, profileExists, providerExists, rankPool, rcEventWriteResultFromAnswer, rcFanoutOnDoorHub, rcObserverAsPassthrough, rcRateLimitInfoOf, rcSelfHostFromEnv, rcWebFetchAllowsPrivateFromEnv, readActiveIdentity, readDirectoryRules, readFarmManifest, readGlobalConfig, readIdentity, readPools, readProfile, readProvider, readRcSelfHostRecord, readRcSessionFile, readUsageSnapshot, realConnectCertStore, realConnectEffects, realRcControlTransport, realRcEventDial, realRcStreamDial, realRcWebFetch, reconnectRcSessionMcpServer, recoverFarm, recoveryDiagnostics, removeDirectoryRule, removeIdentity, removePool, removeProfile, removeProvider, requirePool, resolveAgentShimHome, resolveClaudeHome, resolveDecisions, resolveLayoutPaths, resolveSupervisorConfig, resyncFarm, runCheck, runDoctor, runFrontDoorSupervisor, runLauncher, runSupervisor, sendRcKeepAlive, servedByPipeline, setAllowAmbientCredential, setDefaultConfigProfile, setGlobalDefaultProfile, setIdentityCredential, setPool, setProfileCategories, setProfileEntries, setProfileLaunchFlags, setProfileMetadata, setRcSessionModel, setRcSessionPermissionMode, snapshotPath, spawnClaude, startConnectServer, submitRcSessionMcpOAuthCallbackUrl, suggestRcSessionFiles, teleportRcSession, topLevelNames, updateDirectoryRule, updateProvider, useIdentity, writeDirectoryRules };
6722
+ export type { AddDirectoryRuleOptions, AddProviderInput, AmbientCredentialDetection, AmbientCredentialGuardResult, AmbientCredentialVar, BuildEntryFactsParams, CaMaterial, Candidate, CarryOverParams, CarryOverResult, CategoryMap, CheckReport, CheckReportJson, CollectCheckReportParams, CollectDoctorReportParams, CompiledRule, ConditionContext, ConfigProfile, ConnectCertStore, ConnectEffects, ConnectLimits, ConnectLocalSurface, ConnectServerConfig, ConnectServerHandle, ConnectTarget, ControlApiClient, ControlApiDeps, ControlApiRouter, Credential, CredentialSource, Decision, Diagnostic, DirectoryRule, DirectoryRules, DoctorReport, DoorApiClient, DoorApiContext, DoorApiDeps, DoorApiRouter, DoorEvent, DoorEventHub, DoorEventPublisher, DoorEventStream, DoorEventsApiDeps, DoorHealthEvent, DoorHealthPublisher, EffectiveWindow, EliminatedRule, EnsureFrontDoorPorts, EnsureHeadroomPorts, EntryFact, EntryFacts, EntryValue, EvaluateAmbientCredentialGuardParams, FlattenedCascade, FrontDoorRcControl, FrontDoorSessionStatus, FrontDoorStatus, FrontDoorSupervisorPorts, GlobalConfig, HeadroomSupervisorConfig, Identity, IdentityCredentialChange, IdentityListEntry, IdentityListing, InjectedCredential, LaunchEventPublisher, LaunchLifecycleEvent, LaunchPlan, Layer, LayerId, LayoutPaths, LeafCert, NestedContribution, PlanClass, Pool, PoolMember, PoolPickReport, PoolRanking, PortableConfig, PrepareClaudeLaunchOptions, PrepareLaunchParams, ProfileListEntry, Provider, ProviderListEntry, QuotaExpiringEvent, QuotaExpiringPublisher, RankPoolInput, RcAnswerDecision, RcAnswerDeps, RcApiClient, RcApiDeps, RcApiRouter, RcContextUsageDetail, RcControlAnswer, RcControlHandlerDeps, RcControlRequestDeps, RcControlTransport, RcCredentialStore, RcDialAnswer, RcDialTarget, RcEventDial, RcEventFanout, RcEventWriteResult, RcExchangeObserver, RcInjectDeps, RcLiveRateLimit, RcLiveUsage, RcLiveUsageDeps, RcObservedCredential, RcObservedRequest, RcPendingRequestSummary, RcPermissionMode, RcPresenceAnswer, RcRateLimitInfo, RcRateLimitWindow, RcReadFileEncoding, RcReadFileOptions, RcSelfHostCredentialRecord, RcSelfHostDeps, RcSelfHostMintResult, RcSelfHostSurface, RcSessionStatus, RcSessionSummary, RcSessionTracker, RcSessionTrackerDeps, RcStreamAnswer, RcStreamDial, RcStreamEnvelope, RcStreamEvent, RcStreamHub, RcStreamHubDeps, RcWebFetchDeps, RcWebFetchHop, RcWebFetchOutcome, RcWebFetcher, RcWorkerFact, RcWriteHeaders, RecoverFarmParams, RecoveryResult, ResolveDecisionsInput, ResolvedState, ResyncFarmParams, ResyncFarmResult, RunCheckParams, RunDoctorParams, RunFrontDoorSupervisorOptions, RunLauncherParams, RunSupervisorOptions, SpawnClaudeParams, SseParsedEvent, StickyPick, SupervisorPorts, UnreadableIdentityListEntry, UpdateDirectoryRuleOptions, UpdateProviderInput, UsageChangeEvent, UsageReadFs, UsageSnapshot, WhenCondition, WhenEvaluation };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-shim",
3
- "version": "8.30.0",
3
+ "version": "8.32.0",
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>",