claude-use 9.12.1 → 9.13.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
@@ -2573,7 +2573,7 @@ function listFrontDoorSessions(fs12, sessionsDir) {
2573
2573
  try {
2574
2574
  const parsed = FrontDoorSessionSchema.safeParse(JSON.parse(fs12.readFileUtf8(path8.join(sessionsDir, name)) ?? ""));
2575
2575
  if (parsed.success) {
2576
- sessions.push({ pid: parsed.data.pid, startedAt: parsed.data.startedAt });
2576
+ sessions.push({ pid: parsed.data.pid, startedAt: parsed.data.startedAt, ...parsed.data.supervisorPid === void 0 ? {} : { supervisorPid: parsed.data.supervisorPid } });
2577
2577
  }
2578
2578
  } catch {
2579
2579
  continue;
@@ -2599,7 +2599,7 @@ var init_state = __esm({
2599
2599
  "src/frontdoor/state.ts"() {
2600
2600
  "use strict";
2601
2601
  FRONT_DOOR_PROTOCOL = 3;
2602
- FrontDoorSessionSchema = z3.strictObject({ pid: z3.number().int().positive(), startedAt: z3.number(), token: z3.string().min(1) });
2602
+ FrontDoorSessionSchema = z3.strictObject({ pid: z3.number().int().positive(), startedAt: z3.number(), token: z3.string().min(1), supervisorPid: z3.number().int().positive().optional() });
2603
2603
  FrontDoorStateSchema = z3.strictObject({
2604
2604
  /**
2605
2605
  * The launcher-to-door wire protocol this supervisor speaks, written once it is serving; absent in state written by a release that predates the field, which `ensureFrontDoor` reads as protocol 0. A launcher replaces a door whose protocol is lower than its own (see `FRONT_DOOR_PROTOCOL`).
@@ -2639,7 +2639,7 @@ var init_package = __esm({
2639
2639
  "package.json"() {
2640
2640
  package_default = {
2641
2641
  name: "claude-use",
2642
- version: "9.12.1",
2642
+ version: "9.13.0",
2643
2643
  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.",
2644
2644
  license: "MIT",
2645
2645
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -2742,6 +2742,36 @@ var init_package = __esm({
2742
2742
  }
2743
2743
  });
2744
2744
 
2745
+ // src/frontdoor/supervisorProcesses.ts
2746
+ function parseFrontDoorSupervisorPids(psOutput) {
2747
+ const pids = [];
2748
+ for (const line of psOutput.split("\n")) {
2749
+ const [pidText, ...argumentsList] = line.trim().split(/\s+/);
2750
+ const pid = Number(pidText);
2751
+ if (Number.isInteger(pid) && pid > 0 && argumentsList.includes(FRONT_DOOR_SUPERVISOR_ARGUMENT)) {
2752
+ pids.push(pid);
2753
+ }
2754
+ }
2755
+ return pids.sort((a, b) => a - b);
2756
+ }
2757
+ function listFrontDoorSupervisors(run, uid) {
2758
+ const result = run.run("ps", ["-U", String(uid), "-o", "pid=,command="]);
2759
+ if (result.status === null) {
2760
+ return { ok: false, message: "ps could not be run" };
2761
+ }
2762
+ if (result.status !== 0) {
2763
+ return { ok: false, message: `ps exited ${String(result.status)}${result.stderr.trim() === "" ? "" : `: ${result.stderr.trim()}`}` };
2764
+ }
2765
+ return { ok: true, pids: parseFrontDoorSupervisorPids(result.stdout) };
2766
+ }
2767
+ var FRONT_DOOR_SUPERVISOR_ARGUMENT;
2768
+ var init_supervisorProcesses = __esm({
2769
+ "src/frontdoor/supervisorProcesses.ts"() {
2770
+ "use strict";
2771
+ FRONT_DOOR_SUPERVISOR_ARGUMENT = "__frontdoor-supervisor";
2772
+ }
2773
+ });
2774
+
2745
2775
  // src/headroom/state.ts
2746
2776
  import { createHash as createHash3 } from "node:crypto";
2747
2777
  import path11 from "node:path";
@@ -3338,9 +3368,15 @@ async function runSupervisor(initialConfig, ports, options = {}) {
3338
3368
  await ports.sleep(HEADROOM_POLL_MS);
3339
3369
  }
3340
3370
  }
3371
+ function currentHeadroomAllowlistInputs(fs12, paths) {
3372
+ return {
3373
+ providers: readAllProviders(fs12, paths.providersDir).map((entry) => entry.provider),
3374
+ frontDoorOrigin: frontDoorOrigin(readFrontDoorState(fs12, paths.frontdoorStateFile))
3375
+ };
3376
+ }
3341
3377
  function currentHeadroomAllowlist(fs12, paths) {
3342
- const providers = readAllProviders(fs12, paths.providersDir).map((entry) => entry.provider);
3343
- return headroomAllowlist(headroomUpstreams(providers, frontDoorOrigin(readFrontDoorState(fs12, paths.frontdoorStateFile))));
3378
+ const inputs = currentHeadroomAllowlistInputs(fs12, paths);
3379
+ return headroomAllowlist(headroomUpstreams(inputs.providers, inputs.frontDoorOrigin));
3344
3380
  }
3345
3381
  function allowlistOf(ports) {
3346
3382
  return currentHeadroomAllowlist(ports.fs, ports.paths);
@@ -3409,8 +3445,8 @@ function realIsProcessRunning(pid) {
3409
3445
  return realIsProcessAlive(pid) && !realIsProcessZombie(pid);
3410
3446
  }
3411
3447
  function realIsFrontDoorSupervisor(pid) {
3412
- const result = spawnSync("ps", ["-o", "command=", "-p", String(pid)], { encoding: "utf8" });
3413
- return result.status === 0 && result.stdout.split(/\s+/).includes(FRONT_DOOR_SUPERVISOR_SUBCOMMAND);
3448
+ const result = spawnSync("ps", ["-o", "pid=,command=", "-p", String(pid)], { encoding: "utf8" });
3449
+ return result.status === 0 && parseFrontDoorSupervisorPids(result.stdout).includes(pid);
3414
3450
  }
3415
3451
  function expandHome2(filePath) {
3416
3452
  return filePath.startsWith("~/") ? path13.join(os3.homedir(), filePath.slice(1)) : filePath;
@@ -3609,12 +3645,13 @@ function realResolveClaudeBinary(isOwnBinary) {
3609
3645
  function realInstalledClaudeVersions() {
3610
3646
  return installedVersions(listVersionsDir(defaultVersionsDir()));
3611
3647
  }
3612
- var realFsPort, OWNER_ONLY_DIR_MODE, OWNER_ONLY_FILE_MODE, PERMISSION_BITS, realFarmFs, INT32_BYTE_LENGTH, FRONT_DOOR_SUPERVISOR_SUBCOMMAND, realRunPort, MACOS_GUI_SESSION_MANAGER, realCredentialPort, SOCKET_PERMISSION_BITS, realHeadroomSocketTrust, realSpawnPort, realProcPort, EXECUTE_BITS_MASK, WINDOWS_DEFAULT_PATHEXT;
3648
+ var realFsPort, OWNER_ONLY_DIR_MODE, OWNER_ONLY_FILE_MODE, PERMISSION_BITS, realFarmFs, INT32_BYTE_LENGTH, realRunPort, MACOS_GUI_SESSION_MANAGER, realCredentialPort, SOCKET_PERMISSION_BITS, realHeadroomSocketTrust, realSpawnPort, realProcPort, EXECUTE_BITS_MASK, WINDOWS_DEFAULT_PATHEXT;
3613
3649
  var init_realPorts = __esm({
3614
3650
  "src/realPorts.ts"() {
3615
3651
  "use strict";
3616
3652
  init_load();
3617
3653
  init_versionDiscovery();
3654
+ init_supervisorProcesses();
3618
3655
  init_ensure();
3619
3656
  init_supervisor();
3620
3657
  init_state2();
@@ -3744,7 +3781,6 @@ var init_realPorts = __esm({
3744
3781
  }
3745
3782
  };
3746
3783
  INT32_BYTE_LENGTH = 4;
3747
- FRONT_DOOR_SUPERVISOR_SUBCOMMAND = "__frontdoor-supervisor";
3748
3784
  realRunPort = {
3749
3785
  run(command, args) {
3750
3786
  const result = spawnSync(command, [...args], { encoding: "utf8" });
@@ -4650,7 +4686,7 @@ function assessIdentity(member, nowMs) {
4650
4686
  );
4651
4687
  if (blockedUntil > nowMs) {
4652
4688
  if (unified.overageStatus === "allowed") {
4653
- return { candidate: { ...base, class: "pay-per-use", reasons: [`plan exhausted until ${new Date(blockedUntil).toISOString()}, continues as extra usage`, ...windowReasons, ...planReasons] } };
4689
+ return { candidate: { ...base, class: "pay-per-use", planReturnsAtMs: blockedUntil, reasons: [`plan exhausted until ${new Date(blockedUntil).toISOString()} (in ${formatAge(blockedUntil - nowMs)}), continues as extra usage`, ...windowReasons, ...planReasons] } };
4654
4690
  }
4655
4691
  return { candidate: { ...base, class: "ineligible", blockedUntilMs: blockedUntil, reasons: [`refused until ${new Date(blockedUntil).toISOString()} (in ${formatAge(blockedUntil - nowMs)})`, ...unified.fallbackAvailable === true ? ["a fallback is on offer, so requests for some models may still be served"] : [], ...windowReasons, ...overageReasons, ...planReasons] } };
4656
4692
  }
@@ -4765,7 +4801,8 @@ function rankPool(input) {
4765
4801
  return {
4766
4802
  candidates: ordered,
4767
4803
  ...pick === void 0 ? { ...earliestReturn === void 0 ? {} : { earliestReturn } } : { pick },
4768
- ...movedOff === void 0 || pick === void 0 ? {} : { movedOff }
4804
+ ...movedOff === void 0 || pick === void 0 ? {} : { movedOff },
4805
+ ...pick?.planReturnsAtMs === void 0 ? {} : { planReturn: { identity: pick.identity, atMs: pick.planReturnsAtMs } }
4769
4806
  };
4770
4807
  }
4771
4808
  var MS_PER_SECOND4, MS_PER_HOUR2, HOURS_PER_DAY2, FIVE_HOURS, PROMPT_CACHE_TTL_HOURS, PERCENT, SEVEN_DAYS, FIVE_HOUR_WINDOW_MS, SEVEN_DAY_WINDOW_MS, PROMPT_CACHE_TTL_MS, CLASS_ORDER;
@@ -6178,7 +6215,7 @@ function ensureFrontDoor(params) {
6178
6215
  }
6179
6216
  if (verdict.ok) {
6180
6217
  const token = randomUUID3();
6181
- writeFrontDoorSession(ports.fs, paths.frontdoorSessionsDir, { pid: params.launcherPid, startedAt: ports.now(), token });
6218
+ writeFrontDoorSession(ports.fs, paths.frontdoorSessionsDir, { pid: params.launcherPid, startedAt: ports.now(), token, supervisorPid });
6182
6219
  return { port: state.port, connectPort: state.connectPort, token };
6183
6220
  }
6184
6221
  lastRejection = `the listener on 127.0.0.1:${String(state.port)} (recorded for pid ${String(supervisorPid)}) failed authentication: ${verdict.reason}`;
@@ -6712,7 +6749,12 @@ function resolvePoolLaunch(params) {
6712
6749
  if (graph.ranking.candidates.length === 0) {
6713
6750
  return { ok: false, message: `agent-shim: no member of pool "${poolName}" is an existing identity.` };
6714
6751
  }
6715
- const { pick, earliestReturn, movedOff } = graph.ranking;
6752
+ const { pick, earliestReturn, movedOff, planReturn } = graph.ranking;
6753
+ if (pick !== void 0 && params.wait && planReturn !== void 0) {
6754
+ log.info(`agent-shim: pool "${poolName}" would continue ${planReturn.identity} on extra usage; waiting until ${new Date(planReturn.atMs).toISOString()} for its plan window`);
6755
+ params.sleep(Math.max(planReturn.atMs - nowMs, 0));
6756
+ continue;
6757
+ }
6716
6758
  if (pick !== void 0) {
6717
6759
  if (params.recordPick) {
6718
6760
  recordStickyPick(params.usageFs, params.paths.usagePicksFile, params.cwd, pick.identity, nowMs);
@@ -8316,16 +8358,27 @@ async function runFrontDoorSupervisor(idleShutdownMinutes, ports, options = {})
8316
8358
  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)}`);
8317
8359
  let idleSince;
8318
8360
  let ticks = 0;
8361
+ const supersedingOwner = () => {
8362
+ const owner = readFrontDoorState(fs12, paths.frontdoorStateFile)?.supervisorPid;
8363
+ return owner !== void 0 && owner !== ports.ownPid && ports.isRunning(owner) ? owner : void 0;
8364
+ };
8365
+ let supersededBy;
8366
+ let served;
8319
8367
  const binaryReplaced = () => {
8320
8368
  const current = ports.statOwnExecutable();
8321
8369
  return current !== void 0 && servingBinary !== void 0 && (current.dev !== servingBinary.dev || current.ino !== servingBinary.ino || current.size !== servingBinary.size || current.mtimeMs !== servingBinary.mtimeMs);
8322
8370
  };
8323
- const shutdown = async () => {
8371
+ const closeServing = async () => {
8324
8372
  await direct.close();
8325
8373
  await connect3.close();
8326
8374
  await http3.close();
8327
8375
  ports.closeRcStreamHub();
8328
- writeFrontDoorState(fs12, paths.frontdoorStateFile, sticky());
8376
+ };
8377
+ const shutdown = async () => {
8378
+ await closeServing();
8379
+ if (supersedingOwner() === void 0) {
8380
+ writeFrontDoorState(fs12, paths.frontdoorStateFile, sticky());
8381
+ }
8329
8382
  return 0;
8330
8383
  };
8331
8384
  for (; ; ) {
@@ -8338,7 +8391,28 @@ async function runFrontDoorSupervisor(idleShutdownMinutes, ports, options = {})
8338
8391
  ports.observeLaunchRegistry(listed, pruned);
8339
8392
  ports.checkQuotaExpiry();
8340
8393
  const prunedPids = new Set(pruned);
8341
- if (listed.filter((session) => !prunedPids.has(session.pid)).length === 0) {
8394
+ const live = listed.filter((session) => !prunedPids.has(session.pid));
8395
+ if (supersededBy === void 0) {
8396
+ supersededBy = supersedingOwner();
8397
+ if (supersededBy !== void 0) {
8398
+ ports.log(`agent-shim frontdoor supervisor ${String(ports.ownPid)}: supervisor ${String(supersededBy)} now owns the front door; taking no new sessions and exiting once the sessions this door serves have ended`);
8399
+ ports.doorHealth.superseded(supersededBy);
8400
+ await ports.sleep(FRONTDOOR_POLL_MS);
8401
+ continue;
8402
+ }
8403
+ } else {
8404
+ const owner = supersededBy;
8405
+ served = (served ?? live.filter((session) => session.pid !== ports.ownPid && session.pid !== owner && (session.supervisorPid === void 0 || session.supervisorPid === ports.ownPid))).filter((own) => live.some((session) => session.pid === own.pid && session.startedAt === own.startedAt));
8406
+ if (served.length === 0) {
8407
+ ports.log("agent-shim frontdoor supervisor: the sessions this superseded door served have ended; closing the front door and exiting");
8408
+ ports.doorHealth.drained();
8409
+ await closeServing();
8410
+ return 0;
8411
+ }
8412
+ await ports.sleep(FRONTDOOR_POLL_MS);
8413
+ continue;
8414
+ }
8415
+ if (live.length === 0) {
8342
8416
  if (ticks > 1 && binaryReplaced()) {
8343
8417
  ports.log("agent-shim frontdoor supervisor: the installed binary changed and no sessions are live; turning the door over for the next launch");
8344
8418
  ports.doorHealth.binaryTurnover();
@@ -12492,7 +12566,55 @@ init_credential();
12492
12566
  init_credentialCache();
12493
12567
  init_realCredentialCache();
12494
12568
  init_source();
12569
+
12570
+ // src/headroom/allowlistDrift.ts
12495
12571
  init_state2();
12572
+ function diagnoseAllowlistDrift(params) {
12573
+ const { recordedHash, providers, frontDoorOrigin: frontDoorOrigin2 } = params;
12574
+ if (recordedHash === void 0 || recordedHash === hashAllowlist(headroomAllowlist(headroomUpstreams(providers, frontDoorOrigin2)))) {
12575
+ return void 0;
12576
+ }
12577
+ const originIsInput = providers.length > 0 && frontDoorOrigin2 !== void 0;
12578
+ if (!originIsInput) {
12579
+ return ["provider-files"];
12580
+ }
12581
+ return recordedHash === hashAllowlist(headroomAllowlist(headroomUpstreams(providers, void 0))) ? ["front-door-origin"] : ["provider-files", "front-door-origin"];
12582
+ }
12583
+
12584
+ // src/doctorReport.ts
12585
+ init_state2();
12586
+ init_supervisor();
12587
+ init_state();
12588
+
12589
+ // src/doctorFrontDoor.ts
12590
+ function pushFrontDoor(push, supervisors, registeredPid) {
12591
+ if (!supervisors.ok) {
12592
+ push("frontdoor", "warn", `Could not list processes to look for duplicate front door supervisors: ${supervisors.message}.`);
12593
+ return;
12594
+ }
12595
+ const { pids } = supervisors;
12596
+ if (pids.length === 0) {
12597
+ push("frontdoor", "pass", "No front door supervisor is running.");
12598
+ return;
12599
+ }
12600
+ const [only, ...rest] = pids;
12601
+ if (only !== void 0 && rest.length === 0) {
12602
+ push("frontdoor", "pass", `One front door supervisor is running (pid ${String(only)}).`);
12603
+ return;
12604
+ }
12605
+ const serving = registeredPid !== void 0 && pids.includes(registeredPid) ? `The front door state file names pid ${String(registeredPid)} as the serving supervisor.` : "The front door state file names no running supervisor.";
12606
+ for (const pid of pids.filter((candidate) => candidate !== registeredPid)) {
12607
+ push(
12608
+ "frontdoor",
12609
+ "fail",
12610
+ `Front door supervisor pid ${String(pid)} is running beside ${String(pids.length - 1)} other(s). ${serving} Stop it with \`kill ${String(pid)}\`; launches still connected to it lose their door.`,
12611
+ String(pid)
12612
+ );
12613
+ }
12614
+ }
12615
+
12616
+ // src/doctorReport.ts
12617
+ init_supervisorProcesses();
12496
12618
  init_legacy();
12497
12619
  init_providersStore();
12498
12620
  init_guard();
@@ -12515,7 +12637,8 @@ var DOCTOR_SECTIONS = [
12515
12637
  "global-config",
12516
12638
  "categories-local",
12517
12639
  "active-identity",
12518
- "headroom"
12640
+ "headroom",
12641
+ "frontdoor"
12519
12642
  ];
12520
12643
  function refinePathShadow(status, ownExecutablePath, realpath) {
12521
12644
  if (status.status !== "shadowed") {
@@ -12911,6 +13034,17 @@ function runDoctor(params) {
12911
13034
  `Headroom daemon is up on unix socket ${state.socketPath} (supervisor ${String(state.supervisorPid)}, daemon ${String(state.headroomPid)}).`
12912
13035
  );
12913
13036
  }
13037
+ const allowlist = params.headroom.allowlist;
13038
+ if (supervisorAlive && headroomAlive && state.socketPath !== void 0 && allowlist?.driftInputs?.includes("front-door-origin") === true) {
13039
+ const origin = allowlist.frontDoorOrigin ?? "";
13040
+ const certainty = allowlist.driftInputs.includes("provider-files") ? "may exclude" : "excludes";
13041
+ push(
13042
+ "headroom",
13043
+ "fail",
13044
+ `Headroom daemon ${String(state.headroomPid)} was started with an allowlist that ${certainty} the serving front door's direct origin ${origin}, so it refuses every request a provider launch sends back through the door. Its supervisor restarts it once no launch is registered against it; \`agent-shim headroom status\` lists the registered launches, and \`--no-headroom\` launches are unaffected.`,
13045
+ String(state.headroomPid)
13046
+ );
13047
+ }
12914
13048
  if (state.lastError !== void 0 && supervisorAlive) {
12915
13049
  push("headroom", "warn", `Headroom recorded a previous error: ${state.lastError}`);
12916
13050
  }
@@ -12923,6 +13057,10 @@ function runDoctor(params) {
12923
13057
  }
12924
13058
  }
12925
13059
  }
13060
+ if (params.frontDoor !== void 0) {
13061
+ const validated3 = params.frontDoor.state.raw === void 0 ? void 0 : validateJson(FrontDoorStateSchema, params.frontDoor.state);
13062
+ pushFrontDoor(push, params.frontDoor.supervisors, validated3?.ok === true ? validated3.data.supervisorPid : void 0);
13063
+ }
12926
13064
  if (params.activeIdentity.raw === void 0) {
12927
13065
  push("active-identity", "pass", "No active identity set.");
12928
13066
  } else {
@@ -12952,6 +13090,7 @@ var SECTION_TITLES = {
12952
13090
  "directory-rules": "Directory rules",
12953
13091
  "global-config": "Global config",
12954
13092
  headroom: "Headroom daemon",
13093
+ frontdoor: "Front door",
12955
13094
  "categories-local": "categories.local.json",
12956
13095
  "active-identity": "Active identity"
12957
13096
  };
@@ -12969,6 +13108,7 @@ var SECTION_ORDER = [
12969
13108
  "directory-rules",
12970
13109
  "global-config",
12971
13110
  "headroom",
13111
+ "frontdoor",
12972
13112
  "categories-local",
12973
13113
  "active-identity"
12974
13114
  ];
@@ -13046,6 +13186,9 @@ function collectDoctorReport(params) {
13046
13186
  shimState.targetPath,
13047
13187
  realpathOrSelf
13048
13188
  );
13189
+ const uid = process.getuid?.();
13190
+ const allowlistInputs = currentHeadroomAllowlistInputs(realFarmFs, paths);
13191
+ const servingHeadroom = resolveServingHeadroomState(realFarmFs, { stateFile: paths.headroomStateFile, legacyStateFile: paths.headroomLegacyStateFile }, realIsProcessRunning);
13049
13192
  const report = runDoctor({
13050
13193
  env: params.env,
13051
13194
  credentialCache: realCredentialCacheEnv(paths),
@@ -13084,8 +13227,13 @@ function collectDoctorReport(params) {
13084
13227
  const statePath = resolved?.path ?? paths.headroomStateFile;
13085
13228
  return { path: statePath, raw: realFarmFs.readFileUtf8(statePath) };
13086
13229
  })(),
13087
- isRunning: realIsProcessRunning
13088
- }
13230
+ isRunning: realIsProcessRunning,
13231
+ allowlist: {
13232
+ driftInputs: diagnoseAllowlistDrift({ recordedHash: servingHeadroom?.state.allowlistHash, ...allowlistInputs }),
13233
+ frontDoorOrigin: allowlistInputs.frontDoorOrigin
13234
+ }
13235
+ },
13236
+ ...uid === void 0 ? {} : { frontDoor: { state: { path: paths.frontdoorStateFile, raw: realFsPort.readFileUtf8(paths.frontdoorStateFile) }, supervisors: listFrontDoorSupervisors(realRunPort, uid) } }
13089
13237
  });
13090
13238
  return report;
13091
13239
  }
@@ -13787,7 +13935,9 @@ var DoorHealthEventSchema = z23.discriminatedUnion("kind", [
13787
13935
  z23.strictObject({ kind: z23.literal("generation"), pid: z23.number().int().positive(), providerPort: z23.number().int().positive(), connectPort: z23.number().int().positive(), directPort: z23.number().int().positive(), observedAt: z23.number() }),
13788
13936
  z23.strictObject({ kind: z23.literal("listenerFailed"), pid: z23.number().int().positive(), listener: z23.enum(["provider", "connect", "direct"]), message: z23.string(), observedAt: z23.number() }),
13789
13937
  z23.strictObject({ kind: z23.literal("binaryTurnover"), pid: z23.number().int().positive(), observedAt: z23.number() }),
13790
- z23.strictObject({ kind: z23.literal("idleShutdown"), pid: z23.number().int().positive(), observedAt: z23.number() })
13938
+ z23.strictObject({ kind: z23.literal("idleShutdown"), pid: z23.number().int().positive(), observedAt: z23.number() }),
13939
+ z23.strictObject({ kind: z23.literal("superseded"), pid: z23.number().int().positive(), ownerPid: z23.number().int().positive(), observedAt: z23.number() }),
13940
+ z23.strictObject({ kind: z23.literal("drained"), pid: z23.number().int().positive(), observedAt: z23.number() })
13791
13941
  ]);
13792
13942
  var QuotaExpiringEventSchema = z23.strictObject({
13793
13943
  identity: z23.string().min(1),
@@ -14284,6 +14434,12 @@ function createDoorHealthPublisher(hub, now, pid) {
14284
14434
  },
14285
14435
  binaryTurnover: () => {
14286
14436
  publisher.publish({ kind: "binaryTurnover", pid, observedAt: now() });
14437
+ },
14438
+ superseded: (ownerPid) => {
14439
+ publisher.publish({ kind: "superseded", pid, ownerPid, observedAt: now() });
14440
+ },
14441
+ drained: () => {
14442
+ publisher.publish({ kind: "drained", pid, observedAt: now() });
14287
14443
  }
14288
14444
  };
14289
14445
  }