claude-use 9.19.0 → 10.0.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.
@@ -1703,12 +1703,14 @@ interface LayoutPaths {
1703
1703
  readonly categoriesLocalFile: string;
1704
1704
  /** Path to the claude-shim.json marker recording where `agent-shim shim enable` last placed a `claude`-named copy of this executable, and how. */
1705
1705
  readonly claudeShimFile: string;
1706
- /** Directory holding the headroom daemon's coordination state: the state file, the start lock, the session registry, and the socket directory. */
1706
+ /** Directory holding the headroom daemon's coordination state: the state file, the start lock, the session registry, and the owner-only socket directory, which also holds the allowlist file. */
1707
1707
  readonly headroomDir: string;
1708
- /** Path to the headroom supervisor's state file: pids, socket path, version, allowlist hash, last error. One unversioned name every release shares, arbitrated by the ownership rules in `headroom/state.ts` rather than by a version in the file name. */
1708
+ /** Path to the headroom supervisor's state file: pids, socket path, version, the hash of the allowlist the daemon serves, last error. One unversioned name every release shares, arbitrated by the ownership rules in `headroom/state.ts` rather than by a version in the file name. */
1709
1709
  readonly headroomStateFile: string;
1710
1710
  /** The previous release's versioned name for the state file, read only while a supervisor from that release is still alive and removed once its generation has drained (see `migrateHeadroomState`). */
1711
1711
  readonly headroomLegacyStateFile: string;
1712
+ /** Path to the file the headroom daemon reads its upstream allowlist from (`--allowed-base-urls-file`): the direct origin of every live front door, one per line. It lives in the owner-only socket directory because headroom refuses an allowlist file whose directory another user could write to, and that directory is the one this tool already creates mode 0700 (narrowing it if it existed wider) and checks before every daemon start. The supervisor replaces the file owner-only and atomically whenever a door's origin changes, and the daemon re-reads it on its next request, so a moved or retired front door never needs a restart. */
1713
+ readonly headroomAllowlistFile: string;
1712
1714
  /** Directory, mode 0700, holding the headroom daemon's unix socket: one `<supervisor-pid>.sock` per supervisor generation. Only its owner can enter it, which is what authenticates the door's hop to the daemon. */
1713
1715
  readonly headroomSocketDir: string;
1714
1716
  /** Path to the exclusive-create marker guarding "who spawns the supervisor" so concurrent launches start at most one. */
@@ -1741,6 +1743,8 @@ interface LayoutPaths {
1741
1743
  readonly frontdoorControlTokenFile: string;
1742
1744
  /** Directory holding one `<launcher-pid>.json` session-registry entry per live launch routed through the front door. */
1743
1745
  readonly frontdoorSessionsDir: string;
1746
+ /** Directory holding one `<supervisor-pid>.json` per live front door, recording that door's own direct port: every door still serving sessions forwards its headroom traffic back to its own direct origin, so headroom must admit each of them, not only the one `state.json` names. */
1747
+ readonly frontdoorDirectRecordsDir: string;
1744
1748
  /**
1745
1749
  * Directory holding one `<cse-session-id>.json` Remote Control client credential per observed session, mode 0700 with 0600 files: the OAuth-kind bearer and protocol headers the door replays as the session's attached client, persisted so a door generation that starts after a session's create can still attach. The same secret the identity's own store holds, at the same owner-only protection.
1746
1750
  */
@@ -2204,7 +2208,7 @@ interface HeadroomUp {
2204
2208
  /**
2205
2209
  * Everything the launcher needs from the headroom daemon, injected so its daemon-supervision side effects stay behind a port and the launcher's own logic stays pure over it (`src/realPorts.ts` wires the real one; tests wire fakes).
2206
2210
  *
2207
- * `ensure` brings the daemon up (spawning the detached supervisor when nothing healthy is running) and registers this launch in its session registry; `release` removes that registration when the spawned `claude` exits. `routesProvider` says the launch sends a provider's traffic through the daemon, which needs the daemon to have been started with the front door's current address on its allowlist: `ensure` then waits for a restart that brings it, or refuses when live sessions hold the stale daemon up, instead of registering against a daemon that would reject every request.
2211
+ * `ensure` brings the daemon up (spawning the detached supervisor when nothing healthy is running) and registers this launch in its session registry; `release` removes that registration when the spawned `claude` exits. `routesProvider` says the launch sends a provider's traffic through the daemon, which needs the daemon to be serving an allowlist holding the front door's current direct origin: `ensure` then waits until the supervisor has written it to the daemon's allowlist file and recorded it, instead of registering against a daemon that would reject every request.
2208
2212
  */
2209
2213
  interface HeadroomPort {
2210
2214
  readonly ensure: (options: Readonly<{
@@ -3697,7 +3701,7 @@ type HeadroomFs = Pick<FarmFs, "mkdirp" | "mkdirPrivate" | "readFileUtf8" | "wri
3697
3701
 
3698
3702
  /** What an `lstat` (which never follows symlinks) reports about one path, narrowed to what authenticating the socket needs. */
3699
3703
  interface SocketPathStat {
3700
- readonly kind: "dir" | "socket" | "symlink" | "other";
3704
+ readonly kind: "dir" | "file" | "socket" | "symlink" | "other";
3701
3705
  /** The owning user id. */
3702
3706
  readonly uid: number;
3703
3707
  /** The permission bits, without the file type bits. */
@@ -3711,6 +3715,8 @@ interface HeadroomSocketTrustPorts {
3711
3715
  readonly currentUid: () => number;
3712
3716
  /** Stats one path without following symlinks, or returns undefined when nothing is there. */
3713
3717
  readonly lstat: (target: string) => SocketPathStat | undefined;
3718
+ /** The target a symlink holds, as written: how the allowlist file's path is resolved through a symlinked ancestor. */
3719
+ readonly readlink: (target: string) => string;
3714
3720
  }
3715
3721
  /** Either a socket path the hop may dial, or the reason it must not: the two never appear together. */
3716
3722
  type HeadroomSocketTarget = {
@@ -3720,6 +3726,11 @@ type HeadroomSocketTarget = {
3720
3726
  readonly refused: string;
3721
3727
  readonly socketPath?: never;
3722
3728
  };
3729
+ /** How the allowlist file fails the rules it is held to: what is wrong, and whether the supervisor can repair it (only what lies in agent-shim's own directories can be). */
3730
+ interface AllowlistFileProblem {
3731
+ readonly message: string;
3732
+ readonly repairable: boolean;
3733
+ }
3723
3734
 
3724
3735
  /**
3725
3736
  * A secondary pre-pipeline surface the listener answers under one path prefix: the typed Remote Control API. The listener owns only the dispatch (the prefix and the not-matched 404); the handle itself is whatever the door built, so this file stays independent of the API framework behind it.
@@ -4150,12 +4161,12 @@ declare const CheckReportJsonSchema: z.ZodObject<{
4150
4161
  identity: z.ZodObject<{
4151
4162
  name: z.ZodNullable<z.ZodString>;
4152
4163
  source: z.ZodEnum<{
4164
+ none: "none";
4153
4165
  "config-dir-escape-hatch": "config-dir-escape-hatch";
4154
4166
  argv: "argv";
4155
4167
  env: "env";
4156
4168
  "directory-pin": "directory-pin";
4157
4169
  "active-identity-file": "active-identity-file";
4158
- none: "none";
4159
4170
  }>;
4160
4171
  }, z.core.$strict>;
4161
4172
  pool: z.ZodOptional<z.ZodObject<{
@@ -4203,8 +4214,8 @@ declare const CheckReportJsonSchema: z.ZodObject<{
4203
4214
  name: z.ZodNullable<z.ZodString>;
4204
4215
  source: z.ZodEnum<{
4205
4216
  "directory-rule": "directory-rule";
4206
- env: "env";
4207
4217
  none: "none";
4218
+ env: "env";
4208
4219
  "cli-flag": "cli-flag";
4209
4220
  "identity-default": "identity-default";
4210
4221
  "global-default": "global-default";
@@ -4877,8 +4888,161 @@ type PathShadowStatus = {
4877
4888
  readonly by: string;
4878
4889
  };
4879
4890
 
4880
- /** One input the headroom allowlist is computed from: the provider definitions on disk, or the front door's direct origin. */
4881
- type AllowlistDriftInput = "provider-files" | "front-door-origin";
4891
+ /**
4892
+ * How the allowlist the headroom daemon serves lags the allowlist computed now. The daemon re-reads its allowlist file on every request that follows a change to it, and its supervisor rewrites the file and records the hash in the same tick, so a lag that lasts beyond one tick means the supervisor is not running or cannot write the file. A daemon started by an earlier release reads no file, and is reported as such instead.
4893
+ */
4894
+ type AllowlistDrift = FileAllowlistDrift | EarlierReleaseAllowlistDrift;
4895
+ /** A daemon started by an earlier release whose fixed allowlist, by its recorded hash, does not admit the serving door. */
4896
+ interface EarlierReleaseAllowlistDrift {
4897
+ readonly startedByEarlierRelease: true;
4898
+ readonly missingFromFile?: never;
4899
+ readonly staleInFile?: never;
4900
+ readonly hashLags?: never;
4901
+ }
4902
+ /** A daemon reading the allowlist file, whose file or recorded hash lags the computed allowlist. */
4903
+ interface FileAllowlistDrift {
4904
+ readonly startedByEarlierRelease?: never;
4905
+ /** Computed entries the file does not list: the daemon refuses every request to these upstreams. A missing file lists nothing, so every entry is here. */
4906
+ readonly missingFromFile: readonly string[];
4907
+ /** Entries the file lists that the computed allowlist no longer holds: origins of doors that are gone, which the daemon still admits although nothing routes to them. */
4908
+ readonly staleInFile: readonly string[];
4909
+ /** Whether the recorded hash is not the hash of the entries the file lists: the supervisor has not recorded the file as served, and a provider launch's gate waits until it has. */
4910
+ readonly hashLags: boolean;
4911
+ }
4912
+
4913
+ /**
4914
+ * The record held in one front-door session-registry file: the launcher's pid plus the per-launch capability token its child presents on every request, and the supervisor of the door the launch was sent to. `supervisorPid` is absent on a record written before it existed and on a door's own transparent-surface record; such a launch cannot be attributed to a door, so a superseded door treats it as its own.
4915
+ */
4916
+ declare const FrontDoorSessionSchema: z.ZodObject<{
4917
+ pid: z.ZodNumber;
4918
+ startedAt: z.ZodNumber;
4919
+ token: z.ZodString;
4920
+ supervisorPid: z.ZodOptional<z.ZodNumber>;
4921
+ }, z.core.$strict>;
4922
+ type FrontDoorSession = z.infer<typeof FrontDoorSessionSchema>;
4923
+ /**
4924
+ * The front-door supervisor's state.json under `<home>/frontdoor/`. Every field is optional because the file exists in stages, exactly like headroom's and the old codex daemon's: a fresh supervisor writes its own pid before the listener is up, and a shut-down front door leaves only the sticky `lastPort` and any `lastError` worth surfacing.
4925
+ */
4926
+ declare const FrontDoorStateSchema: z.ZodObject<{
4927
+ protocol: z.ZodOptional<z.ZodNumber>;
4928
+ supervisorPid: z.ZodOptional<z.ZodNumber>;
4929
+ port: z.ZodOptional<z.ZodNumber>;
4930
+ lastPort: z.ZodOptional<z.ZodNumber>;
4931
+ connectPort: z.ZodOptional<z.ZodNumber>;
4932
+ lastConnectPort: z.ZodOptional<z.ZodNumber>;
4933
+ directPort: z.ZodOptional<z.ZodNumber>;
4934
+ lastDirectPort: z.ZodOptional<z.ZodNumber>;
4935
+ lastError: z.ZodOptional<z.ZodString>;
4936
+ }, z.core.$strict>;
4937
+ type FrontDoorState = z.infer<typeof FrontDoorStateSchema>;
4938
+ /**
4939
+ * Which recorded doors are still running as front-door supervisors, as reads of the process table answer it: `doors` holds the pids the table shows running (not zombies) with the front-door supervisor's command line; `unknown` holds the pids no read could answer for, each with why (ps failed to run, was killed, timed out or reported an error). Every other pid asked about is known not to be a door: gone, a zombie, or a process that reused a crashed door's pid.
4940
+ */
4941
+ interface FrontDoorLiveness {
4942
+ readonly doors: ReadonlySet<number>;
4943
+ readonly unknown: ReadonlyMap<number, string>;
4944
+ }
4945
+ /** A registered launch as status and the idle decision see it: the pid and start time, never the token, so nothing that prints or serialises a session can leak the capability. */
4946
+ type FrontDoorSessionSummary = Pick<FrontDoorSession, "pid" | "startedAt" | "supervisorPid">;
4947
+
4948
+ /** The token-saving settings of the `headroom` config block, without its install and lifecycle fields (`source`, `idleShutdownMinutes`). */
4949
+ type HeadroomSettings = Pick<HeadroomGlobalConfig, "mode" | "targetRatio" | "ccr" | "rolloutChannel" | "interceptToolResults" | "readMaturation">;
4950
+
4951
+ /** Everything the supervisor needs to run the daemon, resolved from the global config and the filesystem before it starts. */
4952
+ interface HeadroomSupervisorConfig {
4953
+ /** The install spec as configured (`headroom.source`), already defaulted. */
4954
+ readonly source: string;
4955
+ /** `headroom.idleShutdownMinutes`, already defaulted. */
4956
+ readonly idleShutdownMinutes: number;
4957
+ /** The token-saving settings (`mode`, `targetRatio`, `ccr`, the rollout channel and its opt-ins), as configured; unset fields leave headroom on its own defaults. */
4958
+ readonly settings: HeadroomSettings;
4959
+ }
4960
+ /** How the supervisor resolves the configured source against its defaults. */
4961
+ declare function resolveSupervisorConfig(configured: Readonly<HeadroomGlobalConfig>): HeadroomSupervisorConfig;
4962
+ /**
4963
+ * Every effect the supervisor performs, injected so the whole lifecycle is testable against fakes: no real process, port, clock, or HTTP call ever happens in a unit test.
4964
+ */
4965
+ interface SupervisorPorts {
4966
+ readonly fs: HeadroomFs;
4967
+ readonly paths: LayoutPaths;
4968
+ readonly ownPid: number;
4969
+ readonly now: () => number;
4970
+ /**
4971
+ * Waits `ms`, yielding to the event loop while it does. Deliberately NOT a synchronous Atomics.wait-style sleep: the real supervisor learns of its child's death through the ChildProcess exit event, and a blocking sleep would stop the event loop from ever delivering it (the exact failure that left an unreaped zombie answering liveness checks as alive).
4972
+ */
4973
+ readonly sleep: (ms: number) => Promise<void>;
4974
+ /**
4975
+ * Zombie-aware liveness, and for a daemon this supervisor spawned, exit-event-backed: the implementation keeps the spawned ChildProcess handle, consumes its exit event (which is also what reaps it), and reports the pid as not running from that moment. A bare signal-0 check is not enough, because a defunct process still answers it.
4976
+ */
4977
+ readonly isRunning: (pid: number) => boolean;
4978
+ /** Which of the recorded doors' pids are running front-door supervisors, from one read of the process table per call (see `FrontDoorLiveness`): a door's direct record outlives a crash, and the pid it names can be reused by an unrelated process, whose record must not keep the dead door's origin admitted. The supervisor calls it once per tick. */
4979
+ readonly frontDoorLiveness: (pids: readonly number[]) => FrontDoorLiveness;
4980
+ /** The daemon log's size in bytes (0 before it exists): where the next start attempt's own output will begin. */
4981
+ readonly daemonLogSize: () => number;
4982
+ /** The daemon log from byte `fromByte` to its end, at most its last `maxBytes`, read without loading the whole file (nothing rotates the log). */
4983
+ readonly readDaemonLogTail: (fromByte: number, maxBytes: number) => string;
4984
+ /** The command line of a running process as `ps` reports it, or undefined when it cannot be read: how a recorded orphan daemon is confirmed to be one before it is signalled (see `daemonIdentity`). */
4985
+ readonly daemonCommandLine: (pid: number) => string | undefined;
4986
+ /** The platform facts and owner-only checks the daemon's socket directory is prepared and verified with (see `prepareHeadroomSocket`). */
4987
+ readonly socketTrust: HeadroomSocketTrustPorts;
4988
+ /**
4989
+ * Starts `headroom proxy` serving on the unix socket `socketPath` (and on no TCP port), reading its upstream allowlist from `allowlistFile`, which it re-reads on the next request after the file is replaced, returning its pid. Output goes to the daemon log. The implementation must keep the ChildProcess handle and attach an exit listener (detaching the process is fine; unref'ing a child you still need events from is not, since without the listener nothing reaps it and it lingers as a zombie).
4990
+ */
4991
+ readonly spawnHeadroom: (socketPath: string, allowlistFile: string, settings: Readonly<HeadroomSettings>) => number;
4992
+ /** Reads the headroom config block as it stands on disk now. The supervisor calls it every tick, so a changed `source` or setting is noticed while the daemon runs and applied by a restart once no session is registered against this supervisor. */
4993
+ readonly readConfig: () => HeadroomSupervisorConfig;
4994
+ /** Stops a process the supervisor owns, escalating SIGTERM to SIGKILL on a bounded timeout (see `stopSupervisedProcess`). */
4995
+ readonly stopProcess: (pid: number) => void;
4996
+ /** True once `GET /readyz` over the unix socket succeeds. */
4997
+ readonly ready: (socketPath: string) => Promise<boolean>;
4998
+ /** Runs `uv tool install <spec>`, logging output to the daemon log. Returns ok=false with the error when `uv` is absent or the install fails. */
4999
+ readonly install: (spec: string) => {
5000
+ readonly ok: boolean;
5001
+ readonly error?: string;
5002
+ };
5003
+ /** The installed `headroom --version` output, or undefined when the binary is not on PATH. */
5004
+ readonly headroomVersion: () => string | undefined;
5005
+ /** The commit the installed headroom was built from, as the install itself records it (`direct_url.json`), or undefined when it was not installed from a git source. */
5006
+ readonly installedCommit: () => string | undefined;
5007
+ readonly log: (line: string) => void;
5008
+ }
5009
+ /** Options for `runSupervisor`. */
5010
+ interface RunSupervisorOptions {
5011
+ /**
5012
+ * Bounds the supervisor loop's iterations. The real supervisor runs until it exits on its own (idle shutdown or fatal error); a bounded run is how tests observe steady-state behaviour (drift deferral, restart-on-crash, pruning) without an infinite loop, and such a run returns `HEADROOM_SUPERVISOR_STILL_RUNNING` instead of an exit code.
5013
+ */
5014
+ readonly tickLimit?: number;
5015
+ }
5016
+ /**
5017
+ * Runs the headroom supervisor loop: install the daemon, start it, keep it alive (for crash or drift), and stop it after the configured idle period with an empty session registry. Returns the process exit code (0 for an idle shutdown, 1 for a fatal setup failure).
5018
+ *
5019
+ * Every effect flows through `ports`, so the whole loop is unit-testable with a fake clock, filesystem, and processes. The loop awaits its sleeps, which in the real implementation run on a timer: between ticks the event loop turns, the spawned child's exit event is delivered (and the child thereby reaped), and the next tick's liveness check reads the truth.
5020
+ */
5021
+ declare function runSupervisor(initialConfig: HeadroomSupervisorConfig, ports: SupervisorPorts, options?: RunSupervisorOptions): Promise<number>;
5022
+ /** A recorded front door no read of the process table could answer for, kept on the allowlist until one can: its pid, its direct origin, and why the read failed. */
5023
+ interface UndeterminedFrontDoor {
5024
+ readonly pid: number;
5025
+ readonly origin: string;
5026
+ readonly reason: string;
5027
+ }
5028
+ /**
5029
+ * The upstreams the headroom daemon must admit for one launch that routes a provider through it: the direct origin of the front door `state.json` names, the door the launch is sent to, whose hop names that origin as headroom's upstream for every provider request. Empty before any door has served, when there is nothing to wait for. What `ensureHeadroom`'s `requiredUpstreams` takes.
5030
+ */
5031
+ declare function launchRequiredUpstreams(fs: HeadroomFs, paths: LayoutPaths): readonly string[];
5032
+
5033
+ /** How the running headroom daemon's allowlist file and recorded hash compare with the allowlist computed now, as `doctor` audits it. A file lacking a live door's origin, a recorded hash that lags the file, or an earlier release's fixed allowlist that lags fails (requests through that door are refused or provider launches wait at their gate); a file still listing a gone door's origin warns. */
5034
+ interface DoctorHeadroomAllowlist {
5035
+ /** The drift `diagnoseAllowlistDrift` found, or undefined when the file and the recorded hash are current. */
5036
+ readonly drift: AllowlistDrift | undefined;
5037
+ /** The allowlist file the daemon reads. */
5038
+ readonly file: string;
5039
+ /** The log the supervisor reports a failed write of that file to. */
5040
+ readonly logPath: string;
5041
+ /** The recorded front doors the process table could not answer for (see `undeterminedFrontDoors`): each is a warning, since its origin stays admitted until a read can tell. */
5042
+ readonly undeterminedFrontDoors: readonly UndeterminedFrontDoor[];
5043
+ /** How the allowlist file fails the rules it is held to (see `reportableAllowlistFileProblem`), or undefined when it keeps them or an earlier release's daemon, which reads no file, serves: a failure, whether or not a daemon is up, when headroom refuses it over a directory agent-shim cannot repair, and a warning while a daemon is up otherwise. */
5044
+ readonly fileProblem: AllowlistFileProblem | undefined;
5045
+ }
4882
5046
 
4883
5047
  /** What listing the front-door supervisors found: their pids, or why the process table could not be read. */
4884
5048
  type FrontDoorSupervisorListing = {
@@ -5003,18 +5167,15 @@ interface RunDoctorParams {
5003
5167
  readonly headroom: {
5004
5168
  readonly state: DoctorFileInput;
5005
5169
  readonly isRunning: (pid: number) => boolean;
5006
- /** What the daemon's allowlist is measured against. Omit to skip the allowlist check; with it, a daemon whose allowlist may exclude the serving door's direct origin is a failure. */
5007
- readonly allowlist?: {
5008
- /** The inputs that could explain the recorded allowlist hash not matching the current allowlist, or undefined when it matches. */
5009
- readonly driftInputs: readonly AllowlistDriftInput[] | undefined;
5010
- /** The serving front door's direct origin, or undefined before it has ever served. */
5011
- readonly frontDoorOrigin: string | undefined;
5012
- };
5170
+ /** How the running daemon's allowlist file and recorded hash compare with the allowlist computed now. Omit to skip the allowlist check; with it, a file lacking an upstream the computed allowlist holds, or a recorded hash that lags it, fails (requests to that upstream are refused and provider launches wait at their gate), and a file still listing an upstream nothing routes to warns. */
5171
+ readonly allowlist?: DoctorHeadroomAllowlist;
5013
5172
  };
5014
5173
  /** The front door's state.json and the supervisor processes alive for this user. Omit to skip the front-door checks (the platform cannot list processes); with it, more than one supervisor alive at once is a failure naming each superseded one. */
5015
5174
  readonly frontDoor?: {
5016
5175
  readonly state: DoctorFileInput;
5017
5176
  readonly supervisors: FrontDoorSupervisorListing;
5177
+ /** The launches registered with the front door whose launcher is still running, each naming the door it was sent to: what tells a superseded door still serving its launches from one serving nothing. */
5178
+ readonly liveSessions: readonly FrontDoorSessionSummary[];
5018
5179
  };
5019
5180
  }
5020
5181
  /**
@@ -5203,34 +5364,6 @@ declare const UsageSnapshotSchema: z.ZodObject<{
5203
5364
  }, z.core.$strict>;
5204
5365
  type UsageSnapshot = z.infer<typeof UsageSnapshotSchema>;
5205
5366
 
5206
- /**
5207
- * The record held in one front-door session-registry file: the launcher's pid plus the per-launch capability token its child presents on every request, and the supervisor of the door the launch was sent to. `supervisorPid` is absent on a record written before it existed and on a door's own transparent-surface record; such a launch cannot be attributed to a door, so a superseded door treats it as its own.
5208
- */
5209
- declare const FrontDoorSessionSchema: z.ZodObject<{
5210
- pid: z.ZodNumber;
5211
- startedAt: z.ZodNumber;
5212
- token: z.ZodString;
5213
- supervisorPid: z.ZodOptional<z.ZodNumber>;
5214
- }, z.core.$strict>;
5215
- type FrontDoorSession = z.infer<typeof FrontDoorSessionSchema>;
5216
- /**
5217
- * The front-door supervisor's state.json under `<home>/frontdoor/`. Every field is optional because the file exists in stages, exactly like headroom's and the old codex daemon's: a fresh supervisor writes its own pid before the listener is up, and a shut-down front door leaves only the sticky `lastPort` and any `lastError` worth surfacing.
5218
- */
5219
- declare const FrontDoorStateSchema: z.ZodObject<{
5220
- protocol: z.ZodOptional<z.ZodNumber>;
5221
- supervisorPid: z.ZodOptional<z.ZodNumber>;
5222
- port: z.ZodOptional<z.ZodNumber>;
5223
- lastPort: z.ZodOptional<z.ZodNumber>;
5224
- connectPort: z.ZodOptional<z.ZodNumber>;
5225
- lastConnectPort: z.ZodOptional<z.ZodNumber>;
5226
- directPort: z.ZodOptional<z.ZodNumber>;
5227
- lastDirectPort: z.ZodOptional<z.ZodNumber>;
5228
- lastError: z.ZodOptional<z.ZodString>;
5229
- }, z.core.$strict>;
5230
- type FrontDoorState = z.infer<typeof FrontDoorStateSchema>;
5231
- /** A registered launch as status and the idle decision see it: the pid and start time, never the token, so nothing that prints or serialises a session can leak the capability. */
5232
- type FrontDoorSessionSummary = Pick<FrontDoorSession, "pid" | "startedAt" | "supervisorPid">;
5233
-
5234
5367
  /** How a sign-out went: whether OpenAI was told, so the person knows the grant is dead on its side too. */
5235
5368
  interface SiwcLogoutResult {
5236
5369
  readonly hadGrant: boolean;
@@ -7055,12 +7188,12 @@ declare function createLaunchApiRouter(deps: LaunchApiDeps): {
7055
7188
  decision: zod.ZodObject<{
7056
7189
  identity: zod.ZodOptional<zod.ZodString>;
7057
7190
  identitySource: zod.ZodEnum<{
7191
+ none: "none";
7058
7192
  "config-dir-escape-hatch": "config-dir-escape-hatch";
7059
7193
  argv: "argv";
7060
7194
  env: "env";
7061
7195
  "directory-pin": "directory-pin";
7062
7196
  "active-identity-file": "active-identity-file";
7063
- none: "none";
7064
7197
  }>;
7065
7198
  pool: zod.ZodOptional<zod.ZodObject<{
7066
7199
  name: zod.ZodString;
@@ -7075,8 +7208,8 @@ declare function createLaunchApiRouter(deps: LaunchApiDeps): {
7075
7208
  configProfile: zod.ZodOptional<zod.ZodString>;
7076
7209
  configProfileSource: zod.ZodEnum<{
7077
7210
  "directory-rule": "directory-rule";
7078
- env: "env";
7079
7211
  none: "none";
7212
+ env: "env";
7080
7213
  "cli-flag": "cli-flag";
7081
7214
  "identity-default": "identity-default";
7082
7215
  "global-default": "global-default";
@@ -7655,12 +7788,12 @@ declare function createControlApiRouter(deps: ControlApiDeps): {
7655
7788
  identity: zod.ZodObject<{
7656
7789
  name: zod.ZodNullable<zod.ZodString>;
7657
7790
  source: zod.ZodEnum<{
7791
+ none: "none";
7658
7792
  "config-dir-escape-hatch": "config-dir-escape-hatch";
7659
7793
  argv: "argv";
7660
7794
  env: "env";
7661
7795
  "directory-pin": "directory-pin";
7662
7796
  "active-identity-file": "active-identity-file";
7663
- none: "none";
7664
7797
  }>;
7665
7798
  }, zod_v4_core.$strict>;
7666
7799
  pool: zod.ZodOptional<zod.ZodObject<{
@@ -7708,8 +7841,8 @@ declare function createControlApiRouter(deps: ControlApiDeps): {
7708
7841
  name: zod.ZodNullable<zod.ZodString>;
7709
7842
  source: zod.ZodEnum<{
7710
7843
  "directory-rule": "directory-rule";
7711
- env: "env";
7712
7844
  none: "none";
7845
+ env: "env";
7713
7846
  "cli-flag": "cli-flag";
7714
7847
  "identity-default": "identity-default";
7715
7848
  "global-default": "global-default";
@@ -7962,19 +8095,19 @@ declare function createControlApiRouter(deps: ControlApiDeps): {
7962
8095
  "config-profile": "config-profile";
7963
8096
  identity: "identity";
7964
8097
  provider: "provider";
7965
- frontdoor: "frontdoor";
7966
8098
  pool: "pool";
7967
- keychain: "keychain";
7968
8099
  "ambient-credential": "ambient-credential";
7969
8100
  "binary-discovery": "binary-discovery";
7970
8101
  "claude-shim": "claude-shim";
7971
8102
  "path-resolution": "path-resolution";
7972
8103
  "legacy-name": "legacy-name";
7973
8104
  "sign-in": "sign-in";
8105
+ keychain: "keychain";
7974
8106
  "directory-rules": "directory-rules";
7975
8107
  "categories-local": "categories-local";
7976
8108
  "active-identity": "active-identity";
7977
8109
  headroom: "headroom";
8110
+ frontdoor: "frontdoor";
7978
8111
  }>;
7979
8112
  subject: zod.ZodOptional<zod.ZodString>;
7980
8113
  severity: zod.ZodEnum<{
@@ -8167,12 +8300,12 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
8167
8300
  decision: zod.ZodObject<{
8168
8301
  identity: zod.ZodOptional<zod.ZodString>;
8169
8302
  identitySource: zod.ZodEnum<{
8303
+ none: "none";
8170
8304
  "config-dir-escape-hatch": "config-dir-escape-hatch";
8171
8305
  argv: "argv";
8172
8306
  env: "env";
8173
8307
  "directory-pin": "directory-pin";
8174
8308
  "active-identity-file": "active-identity-file";
8175
- none: "none";
8176
8309
  }>;
8177
8310
  pool: zod.ZodOptional<zod.ZodObject<{
8178
8311
  name: zod.ZodString;
@@ -8187,8 +8320,8 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
8187
8320
  configProfile: zod.ZodOptional<zod.ZodString>;
8188
8321
  configProfileSource: zod.ZodEnum<{
8189
8322
  "directory-rule": "directory-rule";
8190
- env: "env";
8191
8323
  none: "none";
8324
+ env: "env";
8192
8325
  "cli-flag": "cli-flag";
8193
8326
  "identity-default": "identity-default";
8194
8327
  "global-default": "global-default";
@@ -9749,12 +9882,12 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
9749
9882
  identity: zod.ZodObject<{
9750
9883
  name: zod.ZodNullable<zod.ZodString>;
9751
9884
  source: zod.ZodEnum<{
9885
+ none: "none";
9752
9886
  "config-dir-escape-hatch": "config-dir-escape-hatch";
9753
9887
  argv: "argv";
9754
9888
  env: "env";
9755
9889
  "directory-pin": "directory-pin";
9756
9890
  "active-identity-file": "active-identity-file";
9757
- none: "none";
9758
9891
  }>;
9759
9892
  }, zod_v4_core.$strict>;
9760
9893
  pool: zod.ZodOptional<zod.ZodObject<{
@@ -9802,8 +9935,8 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
9802
9935
  name: zod.ZodNullable<zod.ZodString>;
9803
9936
  source: zod.ZodEnum<{
9804
9937
  "directory-rule": "directory-rule";
9805
- env: "env";
9806
9938
  none: "none";
9939
+ env: "env";
9807
9940
  "cli-flag": "cli-flag";
9808
9941
  "identity-default": "identity-default";
9809
9942
  "global-default": "global-default";
@@ -10056,19 +10189,19 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
10056
10189
  "config-profile": "config-profile";
10057
10190
  identity: "identity";
10058
10191
  provider: "provider";
10059
- frontdoor: "frontdoor";
10060
10192
  pool: "pool";
10061
- keychain: "keychain";
10062
10193
  "ambient-credential": "ambient-credential";
10063
10194
  "binary-discovery": "binary-discovery";
10064
10195
  "claude-shim": "claude-shim";
10065
10196
  "path-resolution": "path-resolution";
10066
10197
  "legacy-name": "legacy-name";
10067
10198
  "sign-in": "sign-in";
10199
+ keychain: "keychain";
10068
10200
  "directory-rules": "directory-rules";
10069
10201
  "categories-local": "categories-local";
10070
10202
  "active-identity": "active-identity";
10071
10203
  headroom: "headroom";
10204
+ frontdoor: "frontdoor";
10072
10205
  }>;
10073
10206
  subject: zod.ZodOptional<zod.ZodString>;
10074
10207
  severity: zod.ZodEnum<{
@@ -11902,19 +12035,19 @@ declare const DoctorFindingSchema: z.ZodObject<{
11902
12035
  "config-profile": "config-profile";
11903
12036
  identity: "identity";
11904
12037
  provider: "provider";
11905
- frontdoor: "frontdoor";
11906
12038
  pool: "pool";
11907
- keychain: "keychain";
11908
12039
  "ambient-credential": "ambient-credential";
11909
12040
  "binary-discovery": "binary-discovery";
11910
12041
  "claude-shim": "claude-shim";
11911
12042
  "path-resolution": "path-resolution";
11912
12043
  "legacy-name": "legacy-name";
11913
12044
  "sign-in": "sign-in";
12045
+ keychain: "keychain";
11914
12046
  "directory-rules": "directory-rules";
11915
12047
  "categories-local": "categories-local";
11916
12048
  "active-identity": "active-identity";
11917
12049
  headroom: "headroom";
12050
+ frontdoor: "frontdoor";
11918
12051
  }>;
11919
12052
  subject: z.ZodOptional<z.ZodString>;
11920
12053
  severity: z.ZodEnum<{
@@ -11933,19 +12066,19 @@ declare const DoctorRunOutputSchema: z.ZodObject<{
11933
12066
  "config-profile": "config-profile";
11934
12067
  identity: "identity";
11935
12068
  provider: "provider";
11936
- frontdoor: "frontdoor";
11937
12069
  pool: "pool";
11938
- keychain: "keychain";
11939
12070
  "ambient-credential": "ambient-credential";
11940
12071
  "binary-discovery": "binary-discovery";
11941
12072
  "claude-shim": "claude-shim";
11942
12073
  "path-resolution": "path-resolution";
11943
12074
  "legacy-name": "legacy-name";
11944
12075
  "sign-in": "sign-in";
12076
+ keychain: "keychain";
11945
12077
  "directory-rules": "directory-rules";
11946
12078
  "categories-local": "categories-local";
11947
12079
  "active-identity": "active-identity";
11948
12080
  headroom: "headroom";
12081
+ frontdoor: "frontdoor";
11949
12082
  }>;
11950
12083
  subject: z.ZodOptional<z.ZodString>;
11951
12084
  severity: z.ZodEnum<{
@@ -12018,12 +12151,12 @@ declare const LaunchResolveOutputSchema: z.ZodObject<{
12018
12151
  decision: z.ZodObject<{
12019
12152
  identity: z.ZodOptional<z.ZodString>;
12020
12153
  identitySource: z.ZodEnum<{
12154
+ none: "none";
12021
12155
  "config-dir-escape-hatch": "config-dir-escape-hatch";
12022
12156
  argv: "argv";
12023
12157
  env: "env";
12024
12158
  "directory-pin": "directory-pin";
12025
12159
  "active-identity-file": "active-identity-file";
12026
- none: "none";
12027
12160
  }>;
12028
12161
  pool: z.ZodOptional<z.ZodObject<{
12029
12162
  name: z.ZodString;
@@ -12038,8 +12171,8 @@ declare const LaunchResolveOutputSchema: z.ZodObject<{
12038
12171
  configProfile: z.ZodOptional<z.ZodString>;
12039
12172
  configProfileSource: z.ZodEnum<{
12040
12173
  "directory-rule": "directory-rule";
12041
- env: "env";
12042
12174
  none: "none";
12175
+ env: "env";
12043
12176
  "cli-flag": "cli-flag";
12044
12177
  "identity-default": "identity-default";
12045
12178
  "global-default": "global-default";
@@ -12842,95 +12975,30 @@ interface EnsureHeadroomPorts {
12842
12975
  readonly isRunning: (pid: number) => boolean;
12843
12976
  readonly now: () => number;
12844
12977
  readonly sleep: (ms: number) => void;
12978
+ /** The command line of a running process as `ps` reports it, or undefined when it cannot be read: how a daemon started by an earlier release, which reads no allowlist file, is told apart. */
12979
+ readonly daemonCommandLine: (pid: number) => string | undefined;
12845
12980
  /** Spawns the detached supervisor process that owns the headroom daemon, returning its pid. */
12846
12981
  readonly spawnSupervisor: (paths: LayoutPaths) => number;
12847
12982
  }
12848
12983
  /**
12849
- * Brings the headroom daemon up for this launch, or finds it already running, and registers this launcher pid in its session registry (the fact that keeps the daemon alive and defers drift restarts until this launch is done).
12984
+ * Brings the headroom daemon up for this launch, or finds it already running, and registers this launcher pid in its session registry (the fact that keeps the daemon alive and defers a restart for a changed install source or setting until this launch is done). A launch that routes a provider waits, within the same bound, until the supervisor records that the daemon serves an allowlist admitting it.
12850
12985
  *
12851
12986
  * The exclusive-create start lock decides which of several concurrent launches spawns the one supervisor: its holder spawns and keeps waiting like everyone else, everyone else waits on the state file, and a lock whose holder has died is removed and retried. Readiness is "state names a live supervisor, a live headroom pid, and a socket path", which the supervisor only writes after its own `/readyz` probe over that socket has passed, so polling state alone never mistakes a bound-but-not-ready socket for a usable daemon.
12852
12987
  *
12853
- * Throws `HeadroomStartError` (naming the daemon log path and any recorded `lastError`) when the daemon is not up within `HEADROOM_START_TIMEOUT_MS`, or when a live supervisor has recorded a fatal error (a platform without unix sockets and a socket directory that fails the owner-only check are recorded this way, so the launch fails with the reason).
12988
+ * Throws `HeadroomStartError` (naming the daemon log path and any recorded `lastError`, or the allowlist file when that is what the launch waited on) when the daemon is not up, or not serving the allowlist the launch needs, within `HEADROOM_START_TIMEOUT_MS`, or when a live supervisor has recorded a fatal error (a platform without unix sockets and a socket directory that fails the owner-only check are recorded this way, so the launch fails with the reason).
12854
12989
  */
12855
12990
  declare function ensureHeadroom(params: {
12856
12991
  readonly paths: LayoutPaths;
12857
12992
  readonly launcherPid: number;
12858
12993
  readonly ports: EnsureHeadroomPorts;
12859
12994
  /**
12860
- * The hash of the allowlist the daemon must have been started with for this launch to work, read fresh on every poll because the front door's address it contains can change while the launch waits. Given for a launch that routes a provider through headroom, whose requests come back to the front door's direct origin and are refused by a daemon that was started without it; absent for a launch that only needs Claude Code's own API, which every daemon admits.
12995
+ * The upstreams the daemon must admit for this launch to work, read fresh on every poll because the front door's address among them can change while the launch waits. Given for a launch that routes a provider through headroom, whose requests come back to the front door's direct origin and are refused by a daemon whose allowlist lacks it; absent for a launch that only needs Claude Code's own API, which every daemon admits. `launchRequiredUpstreams` computes them for a provider launch: the serving door's direct origin. The daemon may admit more (a superseded door still serving its own sessions keeps its origin admitted), so the check is that these are among what it serves, not that the lists are equal.
12861
12996
  */
12862
- readonly requiredAllowlistHash?: () => string;
12997
+ readonly requiredUpstreams?: () => readonly string[];
12863
12998
  }): {
12864
12999
  readonly socketPath: string;
12865
13000
  };
12866
13001
 
12867
- /** The token-saving settings of the `headroom` config block, without its install and lifecycle fields (`source`, `idleShutdownMinutes`). */
12868
- type HeadroomSettings = Pick<HeadroomGlobalConfig, "mode" | "targetRatio" | "ccr" | "rolloutChannel" | "interceptToolResults" | "readMaturation">;
12869
-
12870
- /** Everything the supervisor needs to run the daemon, resolved from the global config and the filesystem before it starts. */
12871
- interface HeadroomSupervisorConfig {
12872
- /** The install spec as configured (`headroom.source`), already defaulted. */
12873
- readonly source: string;
12874
- /** `headroom.idleShutdownMinutes`, already defaulted. */
12875
- readonly idleShutdownMinutes: number;
12876
- /** The token-saving settings (`mode`, `targetRatio`, `ccr`, the rollout channel and its opt-ins), as configured; unset fields leave headroom on its own defaults. */
12877
- readonly settings: HeadroomSettings;
12878
- }
12879
- /** How the supervisor resolves the configured source against its defaults. */
12880
- declare function resolveSupervisorConfig(configured: Readonly<HeadroomGlobalConfig>): HeadroomSupervisorConfig;
12881
- /**
12882
- * Every effect the supervisor performs, injected so the whole lifecycle is testable against fakes: no real process, port, clock, or HTTP call ever happens in a unit test.
12883
- */
12884
- interface SupervisorPorts {
12885
- readonly fs: HeadroomFs;
12886
- readonly paths: LayoutPaths;
12887
- readonly ownPid: number;
12888
- readonly now: () => number;
12889
- /**
12890
- * Waits `ms`, yielding to the event loop while it does. Deliberately NOT a synchronous Atomics.wait-style sleep: the real supervisor learns of its child's death through the ChildProcess exit event, and a blocking sleep would stop the event loop from ever delivering it (the exact failure that left an unreaped zombie answering liveness checks as alive).
12891
- */
12892
- readonly sleep: (ms: number) => Promise<void>;
12893
- /**
12894
- * Zombie-aware liveness, and for a daemon this supervisor spawned, exit-event-backed: the implementation keeps the spawned ChildProcess handle, consumes its exit event (which is also what reaps it), and reports the pid as not running from that moment. A bare signal-0 check is not enough, because a defunct process still answers it.
12895
- */
12896
- readonly isRunning: (pid: number) => boolean;
12897
- /** The platform facts and owner-only checks the daemon's socket directory is prepared and verified with (see `prepareHeadroomSocket`). */
12898
- readonly socketTrust: HeadroomSocketTrustPorts;
12899
- /**
12900
- * Starts `headroom proxy` serving on the unix socket `socketPath` (and on no TCP port) with the given allowlist, returning its pid. Output goes to the daemon log. The implementation must keep the ChildProcess handle and attach an exit listener (detaching the process is fine; unref'ing a child you still need events from is not, since without the listener nothing reaps it and it lingers as a zombie).
12901
- */
12902
- readonly spawnHeadroom: (socketPath: string, allowlist: readonly string[], settings: Readonly<HeadroomSettings>) => number;
12903
- /** Reads the headroom config block as it stands on disk now. The supervisor calls it every tick, so a changed `source` or setting is noticed while the daemon runs and applied by the same quiet-registry restart an allowlist change gets. */
12904
- readonly readConfig: () => HeadroomSupervisorConfig;
12905
- /** Stops a process the supervisor owns, escalating SIGTERM to SIGKILL on a bounded timeout (see `stopSupervisedProcess`). */
12906
- readonly stopProcess: (pid: number) => void;
12907
- /** True once `GET /readyz` over the unix socket succeeds. */
12908
- readonly ready: (socketPath: string) => Promise<boolean>;
12909
- /** Runs `uv tool install <spec>`, logging output to the daemon log. Returns ok=false with the error when `uv` is absent or the install fails. */
12910
- readonly install: (spec: string) => {
12911
- readonly ok: boolean;
12912
- readonly error?: string;
12913
- };
12914
- /** The installed `headroom --version` output, or undefined when the binary is not on PATH. */
12915
- readonly headroomVersion: () => string | undefined;
12916
- /** The commit the installed headroom was built from, as the install itself records it (`direct_url.json`), or undefined when it was not installed from a git source. */
12917
- readonly installedCommit: () => string | undefined;
12918
- readonly log: (line: string) => void;
12919
- }
12920
- /** Options for `runSupervisor`. */
12921
- interface RunSupervisorOptions {
12922
- /**
12923
- * Bounds the supervisor loop's iterations. The real supervisor runs until it exits on its own (idle shutdown or fatal error); a bounded run is how tests observe steady-state behaviour (drift deferral, restart-on-crash, pruning) without an infinite loop, and such a run returns `HEADROOM_SUPERVISOR_STILL_RUNNING` instead of an exit code.
12924
- */
12925
- readonly tickLimit?: number;
12926
- }
12927
- /**
12928
- * Runs the headroom supervisor loop: install the daemon, start it, keep it alive (for crash or drift), and stop it after the configured idle period with an empty session registry. Returns the process exit code (0 for an idle shutdown, 1 for a fatal setup failure).
12929
- *
12930
- * Every effect flows through `ports`, so the whole loop is unit-testable with a fake clock, filesystem, and processes. The loop awaits its sleeps, which in the real implementation run on a timer: between ticks the event loop turns, the spawned child's exit event is delivered (and the child thereby reaped), and the next tick's liveness check reads the truth.
12931
- */
12932
- declare function runSupervisor(initialConfig: HeadroomSupervisorConfig, ports: SupervisorPorts, options?: RunSupervisorOptions): Promise<number>;
12933
-
12934
13002
  /** Raised by any operation that requires an identity to already exist, when it does not. */
12935
13003
  declare class IdentityNotFoundError extends CliError {
12936
13004
  readonly name: string;
@@ -13395,5 +13463,5 @@ declare const OWN_CLI_FILE_NAME = "cli.cjs";
13395
13463
  */
13396
13464
  declare function agentShimCliPath(distDir?: string | undefined): string;
13397
13465
 
13398
- export { AMBIENT_CREDENTIAL_VARS, AgentKindSchema, AgentMetaSchema, AgentNodeSchema, AgentTreesListInputSchema, AgentTreesListOutputSchema, AgentTreesShowInputSchema, AgentTreesShowOutputSchema, CHECK_CREDENTIAL_APPLIES, CODEX_APP_SERVER_GENERATED_AGAINST, CODEX_APP_SERVER_TIMEOUT_MS, CONNECT_INTERCEPT_HOST, CONNECT_INTERCEPT_HOSTS, CONNECT_LIMITS, CONTROL_PATH_PREFIX, CategoryClassificationOverlaySchema, CategoryClassificationSchema, CategoryMapSchema, CheckReportJsonSchema, CheckRunInputSchema, CliError, CodexAccountReadSchema, CodexAppServerProtocolError, CodexAppServerRequestError, CodexAppServerUnavailableError, CodexLogoutOutputSchema, CodexRateLimitsReadSchema, CodexSignInSchema, CodexStatusOutputSchema, ConfigIdentityAddOutputSchema, ConfigIdentityRemoveInputSchema, ConfigIdentityRemoveOutputSchema, ConfigIdentitySetInputSchema, ConfigIdentitySetOutputSchema, ConfigIdentityUseOutputSchema, ConfigNameInputSchema, ConfigPoolAddInputSchema, ConfigPoolAddOutputSchema, ConfigPoolRemoveInputSchema, ConfigPoolRemoveOutputSchema, ConfigPoolSetInputSchema, ConfigPoolSetOutputSchema, ConfigPoolUseOutputSchema, ConfigProfileAddInputSchema, ConfigProfileAddOutputSchema, ConfigProfileRemoveInputSchema, ConfigProfileRemoveOutputSchema, ConfigProfileSchema, ConfigProfileSetInputSchema, ConfigProfileSetOutputSchema, ConfigProfileUseOutputSchema, ConfigProviderAddInputSchema, ConfigProviderAddOutputSchema, ConfigProviderRemoveInputSchema, ConfigProviderRemoveOutputSchema, ConfigProviderSetInputSchema, ConfigProviderSetOutputSchema, ConfigRuleAddInputSchema, ConfigRuleAddOutputSchema, ConfigRuleRemoveInputSchema, ConfigRuleRemoveOutputSchema, ConfigRuleSetInputSchema, ConfigRuleSetOutputSchema, CredentialCacheSchema, CredentialSchema, CredentialSourceSchema, CredentialSummarySchema, 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, FrontDoorControlMaterialError, FrontDoorNotServingError, FrontDoorRestartOutputSchema, FrontDoorSessionStatusSchema, FrontDoorSessionsOutputSchema, FrontDoorStartError, FrontDoorStateSchema, FrontDoorStatusOutputSchema, GlobalConfigSchema, HeadroomSocketTargetSchema, HeadroomStartError, IdentityAlreadyExistsError, IdentityNotFoundError, IdentitySchema, InvalidCategoryNameError, InvalidIdentityNameError, InvalidProviderNameError, LAUNCH_EVENT_SOURCE, LIVE_TASK_CAP, LaunchLifecycleEventSchema, LaunchRefusedError, LaunchResolveInputSchema, LaunchResolveOutputSchema, LegacyProviderFileError, LiveTaskSchema, MergedAgentNodeSchema, MergedAgentTreeSchema, OWN_CLI_FILE_NAME, PROMPT_CACHE_TTL_MS, PlanClassSchema, PoolGraphError, 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, ResetRowSchema, ResetScheduleSchema, SessionAgentTreeSchema, SessionLookupError, SessionSummarySchema, TaskItemSchema, USAGE_EVENT_SOURCE, UpdateCheckOutputSchema, UsageError, UsageListOutputSchema, UsageLiveOutputSchema, UsageSnapshotError, UsageSnapshotSchema, UsageWindowsInputSchema, UsageWindowsOutputSchema, WhenSchema, WorkflowRunSchema, addDirectoryRule, addIdentity, addPool, addProvider, agentShimCliPath, answerRcControlRequest, applyAgentTaskEvent, 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, collectResets, collectSessionList, createAgentTreesApiRouter, createCodexApiRouter, createConfigApiRouter, createControlApiRouter, createDoorApiNodeHandler, createDoorApiRouter, createDoorEventHub, createDoorHealthPublisher, createEventsApiRouter, createLaunchApiRouter, createLaunchEventPublisher, createLeafCache, createLifecycleApiRouter, 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, frontDoorApiFromState, frontDoorApiLink, frontDoorRcApiClient, frontDoorRcControl, generateCa, getRcSessionContextUsage, getRcSessionMcpStatus, getRcSessionUsage, headroomSocketTarget, identityExists, injectRcUserMessage, interruptRcSession, isIdentityDirectoryName, isInterceptedHost, isPrivateAddress, isRcContextUsageDetail, isRcPermissionMode, isRcReadFileEncoding, lateRcEventDial, lateRcStreamDial, listDirectoryRules, listIdentities, listProfiles, listProviders, listSessions, listUsageSnapshots, locateSession, matchBranch, mergeLiveTasks, mintLeaf, mintRcSelfHostCredential, observingRoutedRoute, parseConnectTarget, parseRcStreamEnvelope, planOf, poolIdentities, poolSelectedByLaunch, prepareClaudeLaunch, prepareLaunch, profileExists, providerExists, rankPool, rcEventWriteResultFromAnswer, rcFanoutOnDoorHub, rcObserverAsPassthrough, rcRateLimitInfoOf, rcSelfHostFromEnv, rcWebFetchAllowsPrivateFromEnv, readActiveIdentity, readCodexAccount, readCodexRateLimits, readDirectoryRules, readFarmManifest, readFrontDoorControlMaterial, readGlobalConfig, readIdentity, readPools, readProfile, readProvider, readRcSelfHostRecord, readRcSessionFile, readSessionAgentTree, readUsageSnapshot, realCodexAppServerPort, realConnectCertStore, realConnectEffects, realRcControlTransport, realRcEventDial, realRcStreamDial, realRcWebFetch, realSessionFs, reconnectRcSessionMcpServer, recoverFarm, recoveryDiagnostics, refreshLaunchPoolUsage, refreshPoolUsage, refreshStalePoolMembers, removeDirectoryRule, removeIdentity, removePool, removeProfile, removeProvider, requirePool, resolveAgentShimHome, resolveClaudeHome, resolveClaudeLaunch, resolveDecisions, resolveLaunch, resolveLaunchSelection, resolveLayoutPaths, resolveSupervisorConfig, resyncFarm, runCheck, runClaudeLaunch, runDoctor, runFrontDoorSupervisor, runLaunchPlan, runLauncher, runSupervisor, sendRcKeepAlive, servedByPipeline, setAllowAmbientCredential, setDefaultConfigProfile, setGlobalDefaultProfile, setIdentityCredential, setPool, setProfileCategories, setProfileEntries, setProfileLaunchFlags, setProfileMetadata, setRcSessionModel, setRcSessionPermissionMode, showSession, snapshotPath, spawnClaude, startConnectServer, submitRcSessionMcpOAuthCallbackUrl, suggestRcSessionFiles, summariseSession, teleportRcSession, topLevelNames, updateDirectoryRule, updateProvider, useIdentity, watchedInstallEntry, writeDirectoryRules };
13466
+ export { AMBIENT_CREDENTIAL_VARS, AgentKindSchema, AgentMetaSchema, AgentNodeSchema, AgentTreesListInputSchema, AgentTreesListOutputSchema, AgentTreesShowInputSchema, AgentTreesShowOutputSchema, CHECK_CREDENTIAL_APPLIES, CODEX_APP_SERVER_GENERATED_AGAINST, CODEX_APP_SERVER_TIMEOUT_MS, CONNECT_INTERCEPT_HOST, CONNECT_INTERCEPT_HOSTS, CONNECT_LIMITS, CONTROL_PATH_PREFIX, CategoryClassificationOverlaySchema, CategoryClassificationSchema, CategoryMapSchema, CheckReportJsonSchema, CheckRunInputSchema, CliError, CodexAccountReadSchema, CodexAppServerProtocolError, CodexAppServerRequestError, CodexAppServerUnavailableError, CodexLogoutOutputSchema, CodexRateLimitsReadSchema, CodexSignInSchema, CodexStatusOutputSchema, ConfigIdentityAddOutputSchema, ConfigIdentityRemoveInputSchema, ConfigIdentityRemoveOutputSchema, ConfigIdentitySetInputSchema, ConfigIdentitySetOutputSchema, ConfigIdentityUseOutputSchema, ConfigNameInputSchema, ConfigPoolAddInputSchema, ConfigPoolAddOutputSchema, ConfigPoolRemoveInputSchema, ConfigPoolRemoveOutputSchema, ConfigPoolSetInputSchema, ConfigPoolSetOutputSchema, ConfigPoolUseOutputSchema, ConfigProfileAddInputSchema, ConfigProfileAddOutputSchema, ConfigProfileRemoveInputSchema, ConfigProfileRemoveOutputSchema, ConfigProfileSchema, ConfigProfileSetInputSchema, ConfigProfileSetOutputSchema, ConfigProfileUseOutputSchema, ConfigProviderAddInputSchema, ConfigProviderAddOutputSchema, ConfigProviderRemoveInputSchema, ConfigProviderRemoveOutputSchema, ConfigProviderSetInputSchema, ConfigProviderSetOutputSchema, ConfigRuleAddInputSchema, ConfigRuleAddOutputSchema, ConfigRuleRemoveInputSchema, ConfigRuleRemoveOutputSchema, ConfigRuleSetInputSchema, ConfigRuleSetOutputSchema, CredentialCacheSchema, CredentialSchema, CredentialSourceSchema, CredentialSummarySchema, 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, FrontDoorControlMaterialError, FrontDoorNotServingError, FrontDoorRestartOutputSchema, FrontDoorSessionStatusSchema, FrontDoorSessionsOutputSchema, FrontDoorStartError, FrontDoorStateSchema, FrontDoorStatusOutputSchema, GlobalConfigSchema, HeadroomSocketTargetSchema, HeadroomStartError, IdentityAlreadyExistsError, IdentityNotFoundError, IdentitySchema, InvalidCategoryNameError, InvalidIdentityNameError, InvalidProviderNameError, LAUNCH_EVENT_SOURCE, LIVE_TASK_CAP, LaunchLifecycleEventSchema, LaunchRefusedError, LaunchResolveInputSchema, LaunchResolveOutputSchema, LegacyProviderFileError, LiveTaskSchema, MergedAgentNodeSchema, MergedAgentTreeSchema, OWN_CLI_FILE_NAME, PROMPT_CACHE_TTL_MS, PlanClassSchema, PoolGraphError, 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, ResetRowSchema, ResetScheduleSchema, SessionAgentTreeSchema, SessionLookupError, SessionSummarySchema, TaskItemSchema, USAGE_EVENT_SOURCE, UpdateCheckOutputSchema, UsageError, UsageListOutputSchema, UsageLiveOutputSchema, UsageSnapshotError, UsageSnapshotSchema, UsageWindowsInputSchema, UsageWindowsOutputSchema, WhenSchema, WorkflowRunSchema, addDirectoryRule, addIdentity, addPool, addProvider, agentShimCliPath, answerRcControlRequest, applyAgentTaskEvent, 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, collectResets, collectSessionList, createAgentTreesApiRouter, createCodexApiRouter, createConfigApiRouter, createControlApiRouter, createDoorApiNodeHandler, createDoorApiRouter, createDoorEventHub, createDoorHealthPublisher, createEventsApiRouter, createLaunchApiRouter, createLaunchEventPublisher, createLeafCache, createLifecycleApiRouter, 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, frontDoorApiFromState, frontDoorApiLink, frontDoorRcApiClient, frontDoorRcControl, generateCa, getRcSessionContextUsage, getRcSessionMcpStatus, getRcSessionUsage, headroomSocketTarget, identityExists, injectRcUserMessage, interruptRcSession, isIdentityDirectoryName, isInterceptedHost, isPrivateAddress, isRcContextUsageDetail, isRcPermissionMode, isRcReadFileEncoding, lateRcEventDial, lateRcStreamDial, launchRequiredUpstreams, listDirectoryRules, listIdentities, listProfiles, listProviders, listSessions, listUsageSnapshots, locateSession, matchBranch, mergeLiveTasks, mintLeaf, mintRcSelfHostCredential, observingRoutedRoute, parseConnectTarget, parseRcStreamEnvelope, planOf, poolIdentities, poolSelectedByLaunch, prepareClaudeLaunch, prepareLaunch, profileExists, providerExists, rankPool, rcEventWriteResultFromAnswer, rcFanoutOnDoorHub, rcObserverAsPassthrough, rcRateLimitInfoOf, rcSelfHostFromEnv, rcWebFetchAllowsPrivateFromEnv, readActiveIdentity, readCodexAccount, readCodexRateLimits, readDirectoryRules, readFarmManifest, readFrontDoorControlMaterial, readGlobalConfig, readIdentity, readPools, readProfile, readProvider, readRcSelfHostRecord, readRcSessionFile, readSessionAgentTree, readUsageSnapshot, realCodexAppServerPort, realConnectCertStore, realConnectEffects, realRcControlTransport, realRcEventDial, realRcStreamDial, realRcWebFetch, realSessionFs, reconnectRcSessionMcpServer, recoverFarm, recoveryDiagnostics, refreshLaunchPoolUsage, refreshPoolUsage, refreshStalePoolMembers, removeDirectoryRule, removeIdentity, removePool, removeProfile, removeProvider, requirePool, resolveAgentShimHome, resolveClaudeHome, resolveClaudeLaunch, resolveDecisions, resolveLaunch, resolveLaunchSelection, resolveLayoutPaths, resolveSupervisorConfig, resyncFarm, runCheck, runClaudeLaunch, runDoctor, runFrontDoorSupervisor, runLaunchPlan, runLauncher, runSupervisor, sendRcKeepAlive, servedByPipeline, setAllowAmbientCredential, setDefaultConfigProfile, setGlobalDefaultProfile, setIdentityCredential, setPool, setProfileCategories, setProfileEntries, setProfileLaunchFlags, setProfileMetadata, setRcSessionModel, setRcSessionPermissionMode, showSession, snapshotPath, spawnClaude, startConnectServer, submitRcSessionMcpOAuthCallbackUrl, suggestRcSessionFiles, summariseSession, teleportRcSession, topLevelNames, updateDirectoryRule, updateProvider, useIdentity, watchedInstallEntry, writeDirectoryRules };
13399
13467
  export type { AddDirectoryRuleOptions, AddProviderInput, AgentKind, AgentNode, AgentReadFs, AgentTreesApiDeps, AgentTreesApiRouter, AmbientCredentialDetection, AmbientCredentialGuardResult, AmbientCredentialVar, AnthropicUsageRefresher, BuildEntryFactsParams, CaMaterial, Candidate, CarryOverParams, CarryOverResult, CategoryMap, CheckReport, CheckReportJson, ClaudeLaunchResolution, CodexAccountRead, CodexApiClient, CodexApiDeps, CodexApiRouter, CodexAppServerConnection, CodexAppServerPort, CodexAppServerReadOptions, CodexRateLimitsRead, CollectCheckReportParams, CollectDoctorReportParams, CompiledRule, ConditionContext, ConfigApiDeps, ConfigApiRouter, 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, FrontDoorControlMaterial, FrontDoorRcControl, FrontDoorSessionStatus, FrontDoorStatus, FrontDoorSupervisorPorts, GlobalConfig, HeadroomSupervisorConfig, Identity, IdentityCredentialChange, IdentityListEntry, IdentityListing, IdentitySession, InjectedCredential, LaunchApiDeps, LaunchApiRouter, LaunchDecision, LaunchEventPublisher, LaunchLifecycleEvent, LaunchPlan, LaunchPoolDecision, LaunchResolution, LaunchSelection, Layer, LayerId, LayoutPaths, LeafCert, LifecycleApiClient, LifecycleApiDeps, LifecycleApiRouter, LiveTask, LiveTaskBook, LocatedSession, MergedAgentNode, MergedAgentTree, NestedContribution, OwnExecutableStat, 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, ReadSessionOptions, RecoverFarmParams, RecoveryResult, RefreshLaunchPoolUsageOptions, RefreshPoolUsageParams, RefreshStalePoolMembersParams, ResetRow, ResetSchedule, ResolveClaudeLaunchOptions, ResolveDecisionsInput, ResolveLaunchSelectionParams, ResolvedState, ResyncFarmParams, ResyncFarmResult, RunCheckParams, RunClaudeLaunchOptions, RunDoctorParams, RunFrontDoorSupervisorOptions, RunLauncherParams, RunSupervisorOptions, SessionAgentTree, SessionCommandFs, SessionListFilters, SessionRef, SessionSummary, SessionView, SpawnClaudeParams, SseParsedEvent, StickyPick, SupervisorPorts, TaskItem, UnreadableIdentityListEntry, UpdateDirectoryRuleOptions, UpdateProviderInput, UsageChangeEvent, UsageReadFs, UsageSnapshot, WhenCondition, WhenEvaluation, WorkflowRun };