agent-shim 11.84.1 → 11.86.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.
@@ -297,8 +297,8 @@ declare const LaunchSchema: z.ZodObject<{
297
297
  }>>;
298
298
  layout: z.ZodOptional<z.ZodObject<{
299
299
  header: z.ZodOptional<z.ZodArray<z.ZodEnum<{
300
- account: "account";
301
300
  model: "model";
301
+ account: "account";
302
302
  identity: "identity";
303
303
  provider: "provider";
304
304
  version: "version";
@@ -1310,6 +1310,7 @@ declare const ProviderSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1310
1310
  type Provider = z.infer<typeof ProviderSchema>;
1311
1311
  /** The global `models` block: the virtual models, the tier pointers, the prices and the visibility filter. */
1312
1312
  declare const ModelsConfigSchema: z.ZodObject<{
1313
+ pickerLabelSpaces: z.ZodOptional<z.ZodBoolean>;
1313
1314
  virtual: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1314
1315
  mode: z.ZodEnum<{
1315
1316
  ordered: "ordered";
@@ -1360,6 +1361,7 @@ type ModelsConfig = z.infer<typeof ModelsConfigSchema>;
1360
1361
  * The `models` block as a cascade layer writes it: identical to the global block except that any definition may be `null`, which removes what the shallower layers set rather than replacing it. A profile, directory rule or committed `.agent-shim.json` carries this form.
1361
1362
  */
1362
1363
  declare const ModelsLayerSchema: z.ZodObject<{
1364
+ pickerLabelSpaces: z.ZodOptional<z.ZodBoolean>;
1363
1365
  virtual: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
1364
1366
  mode: z.ZodEnum<{
1365
1367
  ordered: "ordered";
@@ -1525,8 +1527,8 @@ declare const ConfigProfileSchema: z.ZodObject<{
1525
1527
  }>>;
1526
1528
  layout: z.ZodOptional<z.ZodObject<{
1527
1529
  header: z.ZodOptional<z.ZodArray<z.ZodEnum<{
1528
- account: "account";
1529
1530
  model: "model";
1531
+ account: "account";
1530
1532
  identity: "identity";
1531
1533
  provider: "provider";
1532
1534
  version: "version";
@@ -2057,6 +2059,7 @@ declare const ConfigProfileSchema: z.ZodObject<{
2057
2059
  }, z.core.$strict>>;
2058
2060
  }, z.core.$strict>>;
2059
2061
  models: z.ZodOptional<z.ZodObject<{
2062
+ pickerLabelSpaces: z.ZodOptional<z.ZodBoolean>;
2060
2063
  virtual: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
2061
2064
  mode: z.ZodEnum<{
2062
2065
  ordered: "ordered";
@@ -2286,6 +2289,7 @@ declare const DirectoryRuleSchema: z.ZodObject<{
2286
2289
  }, z.core.$strip>], "kind">]>;
2287
2290
  }, z.core.$strict>]>>>;
2288
2291
  models: z.ZodOptional<z.ZodObject<{
2292
+ pickerLabelSpaces: z.ZodOptional<z.ZodBoolean>;
2289
2293
  virtual: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
2290
2294
  mode: z.ZodEnum<{
2291
2295
  ordered: "ordered";
@@ -2373,8 +2377,8 @@ declare const DirectoryRuleSchema: z.ZodObject<{
2373
2377
  }>>;
2374
2378
  layout: z.ZodOptional<z.ZodObject<{
2375
2379
  header: z.ZodOptional<z.ZodArray<z.ZodEnum<{
2376
- account: "account";
2377
2380
  model: "model";
2381
+ account: "account";
2378
2382
  identity: "identity";
2379
2383
  provider: "provider";
2380
2384
  version: "version";
@@ -3061,6 +3065,7 @@ declare const DirectoryRulesSchema: z.ZodObject<{
3061
3065
  }, z.core.$strip>], "kind">]>;
3062
3066
  }, z.core.$strict>]>>>;
3063
3067
  models: z.ZodOptional<z.ZodObject<{
3068
+ pickerLabelSpaces: z.ZodOptional<z.ZodBoolean>;
3064
3069
  virtual: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
3065
3070
  mode: z.ZodEnum<{
3066
3071
  ordered: "ordered";
@@ -3148,8 +3153,8 @@ declare const DirectoryRulesSchema: z.ZodObject<{
3148
3153
  }>>;
3149
3154
  layout: z.ZodOptional<z.ZodObject<{
3150
3155
  header: z.ZodOptional<z.ZodArray<z.ZodEnum<{
3151
- account: "account";
3152
3156
  model: "model";
3157
+ account: "account";
3153
3158
  identity: "identity";
3154
3159
  provider: "provider";
3155
3160
  version: "version";
@@ -3837,6 +3842,7 @@ declare const PortableConfigSchema: z.ZodObject<{
3837
3842
  }, z.core.$strip>], "kind">]>;
3838
3843
  }, z.core.$strict>]>>>;
3839
3844
  models: z.ZodOptional<z.ZodObject<{
3845
+ pickerLabelSpaces: z.ZodOptional<z.ZodBoolean>;
3840
3846
  virtual: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
3841
3847
  mode: z.ZodEnum<{
3842
3848
  ordered: "ordered";
@@ -3923,8 +3929,8 @@ declare const PortableConfigSchema: z.ZodObject<{
3923
3929
  }>>;
3924
3930
  layout: z.ZodOptional<z.ZodObject<{
3925
3931
  header: z.ZodOptional<z.ZodArray<z.ZodEnum<{
3926
- account: "account";
3927
3932
  model: "model";
3933
+ account: "account";
3928
3934
  identity: "identity";
3929
3935
  provider: "provider";
3930
3936
  version: "version";
@@ -4679,8 +4685,8 @@ declare const GlobalConfigSchema: z.ZodObject<{
4679
4685
  }>>;
4680
4686
  layout: z.ZodOptional<z.ZodObject<{
4681
4687
  header: z.ZodOptional<z.ZodArray<z.ZodEnum<{
4682
- account: "account";
4683
4688
  model: "model";
4689
+ account: "account";
4684
4690
  identity: "identity";
4685
4691
  provider: "provider";
4686
4692
  version: "version";
@@ -5326,6 +5332,7 @@ declare const GlobalConfigSchema: z.ZodObject<{
5326
5332
  compactAtUtilisation: z.ZodOptional<z.ZodNumber>;
5327
5333
  }, z.core.$strict>>>;
5328
5334
  models: z.ZodOptional<z.ZodObject<{
5335
+ pickerLabelSpaces: z.ZodOptional<z.ZodBoolean>;
5329
5336
  virtual: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
5330
5337
  mode: z.ZodEnum<{
5331
5338
  ordered: "ordered";
@@ -5498,7 +5505,7 @@ type CategoryClassificationOverlay = z.infer<typeof CategoryClassificationOverla
5498
5505
  interface LayoutPaths {
5499
5506
  /** The resolved root directory, see `resolveAgentShimHome`. */
5500
5507
  readonly root: string;
5501
- /** Directory holding one subdirectory per identity (symlink farm + local credentials/daemon state). */
5508
+ /** Directory holding one subdirectory per identity (symlink farm + local credentials/daemon state), named by the identity's id: the name it was created with, or a free variant of it, kept for good by a rename, which changes only the `name` in its `identity.json`. */
5502
5509
  readonly identitiesDir: string;
5503
5510
  /** Directory holding named, reusable configuration profile JSON files. */
5504
5511
  readonly configProfilesDir: string;
@@ -5572,7 +5579,7 @@ interface LayoutPaths {
5572
5579
  readonly usageDir: string;
5573
5580
  /** Directory of the append-only usage log: one `<YYYY-MM-DD>.<writer-pid>.jsonl` segment per writing process per UTC day. */
5574
5581
  readonly usageLogDir: string;
5575
- /** Directory of the latest-state snapshots, one `<identity>.json` per identity: the stable file other tools read. */
5582
+ /** Directory of the latest-state snapshots, one `<id>.json` per identity, named by the id the identity is stored under (its directory's name, which a rename keeps), never by its name: the stable file other tools read. */
5576
5583
  readonly usageSnapshotsDir: string;
5577
5584
  /** Directory of the built-in statusline's own state (the day's cost ledger, under `session/` what it keeps between refreshes about each transcript it reads, and under `run/` the short-lived output files of the programs it runs), each file of the ledger and under `session/` read as absent when it is missing, is not a regular file or is not of its shape, and none restored: a session's entry for today in the cost ledger starts again from the cost reported by the session's next render that lists the `dailyCost` segment and has a cost to record (or from the previous day's total, by the rule a session's first render of the day carries it by), so the day's total no longer counts what the session spent before that figure, and its entry for the day before, which is only read, carries nothing; the transcript reader's cache is folded again from the start of the transcript; the speed sample is replaced by that of the next render that lists the `speed` segment and has a figure to measure, which draws no speed; and the transcript's last good context frame is none until the next good frame is written. */
5578
5585
  readonly statuslineDir: string;
@@ -5590,7 +5597,9 @@ interface LayoutPaths {
5590
5597
  readonly jobLogsDir: string;
5591
5598
  /** Directory holding one journal per unfinished `identity rename`, written before its first step and removed when it ends: the trace a rename that was killed leaves, which a re-run resumes from and `doctor` reports. Runtime state, never configuration. */
5592
5599
  readonly identityRenamesDir: string;
5593
- /** Directory holding one `<launcher-pid>.<identity>.json` record per launch in progress, written before the identity's farm is resynced and removed once the child has exited. Runtime state, never configuration: it is what lets an identity rename see a launch that has resynced but not yet started its child. */
5600
+ /** Directory holding one record per rename of the name alone that is applying, written before its first rewrite and removed when it ends or is rolled back: what tells a rename killed part way, whose references already name the new name, from references a person wrote. Runtime state, never configuration. */
5601
+ readonly identityNameRenamesDir: string;
5602
+ /** Directory holding one `<launcher-pid>.<id>.json` record per launch in progress, named by the id of the identity it launches, written before the identity's farm is resynced and removed once the child has exited. Runtime state, never configuration: it is what lets `identity rename --move` see a launch that has resynced but not yet started its child. */
5594
5603
  readonly launchesDir: string;
5595
5604
  /** Directory of the supervised sessions' shared state, one subdirectory per pool: the live sessions each launcher registers, so sessions on one account see each other, and the lock that serialises their moves. Runtime state, never configuration. */
5596
5605
  readonly superviseDir: string;
@@ -5949,6 +5958,7 @@ declare const FrontDoorSessionSchema: z.ZodObject<{
5949
5958
  supervisorPid: z.ZodOptional<z.ZodNumber>;
5950
5959
  sessionId: z.ZodOptional<z.ZodString>;
5951
5960
  models: z.ZodOptional<z.ZodObject<{
5961
+ pickerLabelSpaces: z.ZodOptional<z.ZodBoolean>;
5952
5962
  virtual: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
5953
5963
  mode: z.ZodEnum<{
5954
5964
  ordered: "ordered";
@@ -6311,7 +6321,7 @@ interface ResyncFarmParams {
6311
6321
  /** Distinguishes this resync's scratch and superseded directory names from any other process's. `${pid}.${uuid}` in real use; a fixed string in tests. */
6312
6322
  readonly uniqueSuffix: string;
6313
6323
  /**
6314
- * Whether the identity still exists, asked once the lock is held and any interrupted swap recovered. A launch that waited for the lock while the identity was renamed or removed must not rebuild its directory, so a caller that can answer passes it and `resyncFarm` throws `IdentityGoneError` on `false`. Absent means the caller has no way to tell.
6324
+ * Whether the identity still exists, asked once the lock is held and any interrupted swap recovered. A launch that waited for the lock while the identity's directory was moved with `identity rename --move` or removed must not rebuild it (a rename of the name alone leaves the directory where it was), so a caller that can answer passes it and `resyncFarm` throws `IdentityGoneError` on `false`. Absent means the caller has no way to tell.
6315
6325
  */
6316
6326
  readonly identityExists?: () => boolean;
6317
6327
  readonly lock: {
@@ -8470,7 +8480,7 @@ declare const CheckReportJsonSchema: z.ZodObject<{
8470
8480
  }, z.core.$strict>;
8471
8481
  type CheckReportJson = z.output<typeof CheckReportJsonSchema>;
8472
8482
 
8473
- /** What a cache stores for one credential: the token, when it was fetched, and the source that produced it (a non-secret descriptor, kept so `check` and the launch log can still say where the token came from). */
8483
+ /** What a cache stores for one credential: the token, when it was fetched, the source that produced it (a non-secret descriptor, kept so `check` and the launch log can still say where the token came from), and, in the file store, the owner it was cached for (`identity <id>`, `provider <name>`), which the file store records on every write; the Keychain store files each entry under its owner's account and records none. A file-store entry with no `owner` was written before owners were recorded. */
8474
8484
  declare const CachedCredentialSchema: z.ZodObject<{
8475
8485
  token: z.ZodString;
8476
8486
  fetchedAt: z.ZodNumber;
@@ -8496,6 +8506,7 @@ declare const CachedCredentialSchema: z.ZodObject<{
8496
8506
  }, z.core.$strict>, z.ZodObject<{
8497
8507
  literal: z.ZodString;
8498
8508
  }, z.core.$strict>]>;
8509
+ owner: z.ZodOptional<z.ZodString>;
8499
8510
  }, z.core.$strict>;
8500
8511
  type CachedCredential = z.infer<typeof CachedCredentialSchema>;
8501
8512
  /**
@@ -8803,6 +8814,8 @@ interface RunCheckParams {
8803
8814
  readonly overlay?: CategoryClassificationOverlay;
8804
8815
  };
8805
8816
  readonly identityName?: string;
8817
+ /** The id the resolved identity is stored under, which keys its cached credential (see `identityCacheKey`). */
8818
+ readonly identityId?: string;
8806
8819
  readonly identitySource: IdentityDecisionSource;
8807
8820
  /** The pool the launch selected and how it ranks right now, when it named a pool instead of an identity; `identityName` is then the member it would pick. */
8808
8821
  readonly poolPick?: PoolPickReport;
@@ -8898,94 +8911,6 @@ type PathShadowStatus = {
8898
8911
  readonly by: string;
8899
8912
  };
8900
8913
 
8901
- /** Raised by any operation that requires an identity to already exist, when it does not. */
8902
- declare class IdentityNotFoundError extends CliError {
8903
- readonly name: string;
8904
- constructor(name: string);
8905
- }
8906
- /** Raised by `addIdentity` when an identity with the given name already has an `identity.json`. */
8907
- declare class IdentityAlreadyExistsError extends CliError {
8908
- readonly identityName: string;
8909
- constructor(identityName: string);
8910
- }
8911
- /** Raised by `addIdentity` when `name` fails `IdentitySchema`'s own naming rule — it must start with a letter or number and may then contain letters, numbers, dots, hyphens, underscores, and at signs, so an email address names an identity directly while a *leading* `@` stays invalid (it would collide with the `@name` selector syntax's first-`@` split). */
8912
- declare class InvalidIdentityNameError extends CliError {
8913
- readonly attemptedName: string;
8914
- constructor(attemptedName: string);
8915
- }
8916
- declare function identityExists(paths: LayoutPaths, name: string): boolean;
8917
- /** Reads and validates one identity's `identity.json`, or undefined when it does not exist. */
8918
- declare function readIdentity(paths: LayoutPaths, name: string): Identity | undefined;
8919
- /**
8920
- * Creates a new identity: validates `name` against `IdentitySchema`'s own naming rule and writes a fresh `identity.json` with `allowAmbientCredential: false` and no `defaultConfigProfile`.
8921
- *
8922
- * Throws a `CliError` naming the command that finishes the rename when an unfinished rename names `name` (see `requireNoUnfinishedRenameNaming`), `IdentityAlreadyExistsError` if an identity with this name already has an `identity.json`, since `add` never silently overwrites an existing identity. Throws `InvalidIdentityNameError` when `name` fails `IdentitySchema`'s naming rule, rather than letting the underlying `ZodError` escape as an unhandled crash.
8923
- */
8924
- declare function addIdentity(paths: LayoutPaths, name: string): Identity;
8925
- /**
8926
- * Persists `name` as the active identity, written atomically as plain text (not JSON — this file is read by `decideIdentity` in `src/launcher/identity.ts` via a simple UTF-8 read-and-trim, matching the README's documented `~/.agent-shim/active-identity` file).
8927
- *
8928
- * `name` may be a `pool:<name>` selector, which makes launches pick a member of that pool. Throws `IdentityNotFoundError` when no identity with this name exists yet, and `PoolNotFoundError` for a pool that is not defined: selecting either would silently persist a name nothing else can ever load.
8929
- */
8930
- declare function useIdentity(paths: LayoutPaths, name: string): void;
8931
- /** Reads the persisted active-identity file, or undefined when none is set. */
8932
- declare function readActiveIdentity(paths: LayoutPaths): string | undefined;
8933
- /**
8934
- * Whether a directory name directly under `identitiesDir` names an actual identity, rather than one of agent-shim's own farm directories.
8935
- *
8936
- * `IdentitySchema` requires an identity name to start with a letter or digit, so a leading `.` can only be a resync's own bookkeeping: a `.<identity>.scratch.<suffix>` tree still being built, or a `.<identity>.previous.<suffix>` superseded farm retained for `agent-shim identity resolve-conflicts`. Neither is an identity, and neither should be reported as a broken one for lacking an `identity.json` a resync never put there.
8937
- */
8938
- declare function isIdentityDirectoryName(name: string): boolean;
8939
- /** An entry directly under `identitiesDir` that cannot be reached, and why: `code` is the error the filesystem gave. */
8940
- interface UnreachableIdentityEntry {
8941
- readonly name: string;
8942
- readonly code: string;
8943
- }
8944
- /** One identity as reported by `listIdentities`, whose `identity.json` parsed and validated cleanly. */
8945
- interface IdentityListEntry {
8946
- readonly name: string;
8947
- readonly identity: Identity;
8948
- readonly isActive: boolean;
8949
- readonly problem?: never;
8950
- }
8951
- /** One identity whose `identity.json` is present but unreadable — malformed JSON, or valid JSON this version's `IdentitySchema` rejects. `problem` carries the reason, already flattened onto a single line. */
8952
- interface UnreadableIdentityListEntry {
8953
- readonly name: string;
8954
- readonly identity?: never;
8955
- readonly isActive: boolean;
8956
- readonly problem: string;
8957
- }
8958
- /** Either shape `listIdentities` can report, discriminated by which of `identity`/`problem` is present rather than by a tag field — the two are never simultaneously satisfiable. */
8959
- type IdentityListing = IdentityListEntry | UnreadableIdentityListEntry;
8960
- /**
8961
- * Lists every identity under `identitiesDir`, marking which one (if any) is currently active.
8962
- *
8963
- * One identity whose `identity.json` cannot be read is reported as its own `UnreadableIdentityListEntry` rather than aborting the whole listing. A single bad file blocking `identity list` outright is exactly the failure mode that hides every *other* identity from view at the moment the user most needs to see them — and the file need not even be corrupt to land here, since a name written by a newer agent-shim whose naming rule has since widened is rejected outright by an older binary's own copy of `IdentitySchema`.
8964
- */
8965
- declare function listIdentities(paths: LayoutPaths): readonly IdentityListing[];
8966
- /**
8967
- * Sets `identity`'s `defaultConfigProfile` field, or clears it when `profileName` is undefined. Throws `IdentityNotFoundError` when the identity does not exist. Whether the profile exists is the caller's concern: `identity set --default-profile` checks it first.
8968
- */
8969
- declare function setDefaultConfigProfile(paths: LayoutPaths, identityName: string, profileName: string | undefined): Identity;
8970
- /**
8971
- * Patches `identity`'s `allowAmbientCredential` field. Throws `IdentityNotFoundError` when the identity does not exist.
8972
- */
8973
- declare function setAllowAmbientCredential(paths: LayoutPaths, identityName: string, allow: boolean): Identity;
8974
- /** The change `setIdentityCredential` makes: new sources and/or a new target for the credential block, or `false` to remove the block and return the identity to its stored login. */
8975
- type IdentityCredentialChange = {
8976
- readonly sources?: readonly CredentialSource[];
8977
- readonly target?: CredentialTarget;
8978
- readonly cache?: CredentialCache | false;
8979
- } | false;
8980
- /**
8981
- * Sets, changes or removes `identityName`'s credential block. New `sources` replace the whole ordered list (the order is the meaning); a `target` alone keeps the existing sources, and so needs a credential block to exist already. Throws `IdentityNotFoundError` when the identity does not exist, and `UsageError` when only a target is given for an identity with no credential yet.
8982
- */
8983
- declare function setIdentityCredential(paths: LayoutPaths, identityName: string, change: IdentityCredentialChange): Identity;
8984
- /**
8985
- * Deletes identity `name` entirely: its directory under `identitiesDir` (the farm, its `identity.json`, and whatever that farm holds unshared, credentials included), its resync lock, any scratch or superseded farm a resync left behind, and the active-identity selection when it names this identity. Data shared into `~/.claude` stays there, since the farm only ever symlinks to it. Throws a `CliError` naming the command that finishes the rename when an unfinished rename names `name`, and `IdentityNotFoundError` when the identity does not exist.
8986
- */
8987
- declare function removeIdentity(paths: LayoutPaths, name: string): void;
8988
-
8989
8914
  /** One routed request, appended to the usage log when its response has finished. */
8990
8915
  declare const UsageRecordSchema: z.ZodObject<{
8991
8916
  schemaVersion: z.ZodLiteral<1>;
@@ -9059,7 +8984,7 @@ declare const AccountMetadataSchema: z.ZodObject<{
9059
8984
  }, z.core.$strict>;
9060
8985
  type AccountMetadata = z.infer<typeof AccountMetadataSchema>;
9061
8986
  /**
9062
- * The latest state for one identity, rewritten atomically after each recorded response: the snapshot file other tools read (`~/.agent-shim/usage/snapshots/<identity>.json`) without shelling out to `agent-shim`.
8987
+ * The latest state for one identity, rewritten atomically after each recorded response: the snapshot file other tools read (`~/.agent-shim/usage/snapshots/<id>.json`, named and keyed in `identity` by the identity's id) without shelling out to `agent-shim`.
9063
8988
  */
9064
8989
  declare const UsageSnapshotSchema: z.ZodObject<{
9065
8990
  schemaVersion: z.ZodLiteral<1>;
@@ -9160,6 +9085,193 @@ declare const UsageSnapshotSchema: z.ZodObject<{
9160
9085
  }, z.core.$strict>;
9161
9086
  type UsageSnapshot = z.infer<typeof UsageSnapshotSchema>;
9162
9087
 
9088
+ /**
9089
+ * The read side of the usage store: pure over an injected filesystem, so the CLI, the library surface and tests all read the same way, and nothing here writes.
9090
+ */
9091
+ /** The filesystem reads the usage store's readers need. */
9092
+ type UsageReadFs = Pick<FarmFs, "readFileUtf8" | "readdir">;
9093
+ /** Raised for a snapshot file that exists but does not hold a snapshot of this schema version. */
9094
+ declare class UsageSnapshotError extends Error {
9095
+ readonly file: string;
9096
+ constructor(file: string, detail: string);
9097
+ }
9098
+ /** The path of the snapshot filed under identity id `identity` (`<snapshotsDir>/<id>.json`). Throws for an id that is not a valid identity directory id, since such an id could name a path outside the snapshots directory. */
9099
+ declare function snapshotPath(snapshotsDir: string, identity: string): string;
9100
+ /** Reads the snapshot filed under identity id `identity`: undefined when there is none yet, `UsageSnapshotError` when the file is there but unreadable. */
9101
+ declare function readUsageSnapshot(fs: Pick<FarmFs, "readFileUtf8">, snapshotsDir: string, identity: string): UsageSnapshot | undefined;
9102
+ /** Reads every snapshot in the directory, each filed under the id of the identity it belongs to (its `identity` field is that id). */
9103
+ declare function listUsageSnapshots(fs: UsageReadFs, snapshotsDir: string): readonly UsageSnapshot[];
9104
+
9105
+ /** Everything `acquireIdentityLock` needs, all of it injected so a test never sleeps for real, never reads a real pid table, and never writes outside its own fake filesystem. */
9106
+ interface AcquireIdentityLockParams {
9107
+ readonly identity: string;
9108
+ /** The directory the lock file lives in — `~/.agent-shim/identities`, alongside (never inside) the farm the lock protects, so a farm swap can rename the farm root out from under itself without disturbing the lock. */
9109
+ readonly dir: string;
9110
+ readonly fs: FarmFs;
9111
+ readonly nowMs: () => number;
9112
+ readonly pid: number;
9113
+ /** Answers whether a process is still running, so a lock left behind by a crash is recognised rather than waited out for the full staleness window. Zombie-aware: a holder that exited without being reaped still answers signal 0 as alive, but will never release the lock itself. */
9114
+ readonly isRunning: (pid: number) => boolean;
9115
+ /** Blocks for the given number of milliseconds. Synchronous by necessity: the whole launcher is synchronous, right through to `spawnSync`. */
9116
+ readonly sleep: (ms: number) => void;
9117
+ readonly staleAfterMs?: number;
9118
+ readonly retryDelayMs?: number;
9119
+ readonly maxAttempts?: number;
9120
+ }
9121
+
9122
+ /** What taking the identity names lock needs from the machine: the lock's own ports, and how many attempts to make before giving up (one for a caller that must not wait, such as the front door, whose event loop a sleep would hold). */
9123
+ type IdentityNamesLockPorts = Pick<AcquireIdentityLockParams, "fs" | "nowMs" | "pid" | "isRunning" | "sleep" | "maxAttempts">;
9124
+
9125
+ /**
9126
+ * One identity as its storage knows it. `id` is the name of its directory under the identities directory: it is chosen when the identity is created and never changes, so everything filed under it (the directory, the `CLAUDE_CONFIG_DIR` every session holds, the macOS Keychain login filed under a hash of that path, the resync lock, the usage snapshot) stays valid across a rename. `name` is what `identity.json` calls the identity: every command, selector and configuration reference uses it, and `identity rename` changes it alone.
9127
+ */
9128
+ interface IdentityRecord {
9129
+ readonly id: string;
9130
+ /** Undefined when the record's `identity.json` gives no name that can be read: such a record claims no name, so it can never collide with one another identity holds. */
9131
+ readonly name: string | undefined;
9132
+ }
9133
+ /** What reading one `identity.json` for its name found: the name, no file there, or a file whose name cannot be read (not JSON, or no string `name`). */
9134
+ type IdentityNameRead = {
9135
+ readonly name: string;
9136
+ } | "absent" | "unreadable";
9137
+ /** What reading the records needs: the entries directly under the identities directory, and the name in one `identity.json`. Injected so the launcher's configuration port, the farm's filesystem port and the real filesystem all resolve through the same rule. */
9138
+ interface IdentityRecordsPort {
9139
+ readonly readdir: (directory: string) => readonly string[];
9140
+ readonly readName: (identityJson: string) => IdentityNameRead;
9141
+ /** Whether two entries are one directory on disk, which a symlink beside an identity's directory makes them. */
9142
+ readonly sameDirectory: (first: string, second: string) => boolean;
9143
+ /** Whether an entry is itself a symlink, read without following it: of two entries that are one directory, the one that is not is the identity's own. */
9144
+ readonly isSymlink: (entry: string) => boolean;
9145
+ }
9146
+ /**
9147
+ * Every identity record under `identitiesDir`, sorted by id. An entry whose name does not start with a dot is an identity when it holds an `identity.json`: the record takes the name that file gives, or no name when the file's name cannot be read (see `identityIdIn` for how such a record is still reached). An entry with no `identity.json` is not an identity unless a superseded farm of it holds one (below).
9148
+ *
9149
+ * Two entries that are one directory on disk, as a symlink beside an identity's directory makes them, are one record: the entry that is the directory itself rather than a symlink to it, or else the first by id. The choice reads the filesystem, never the name, so a rename of the name never changes which entry is the identity's id.
9150
+ *
9151
+ * A superseded farm (`.<id>.previous.<suffix>`) whose identity's entry holds no `identity.json` (no directory at all, a resync killed between the two renames of its swap; or the new farm swapped in before the file was carried over into it) is the trace the launcher's recovery repairs: until then the identity's `identity.json` is inside it, so the record is read from there (from the first such farm in name order that holds an `identity.json`, which is the farm the launcher's recovery restores; a farm retained from an earlier swap for its conflicts holds none, since a completed swap carries the file over), and the identity can still be found by name to be recovered.
9152
+ */
9153
+ declare function readIdentityRecords(port: IdentityRecordsPort, identitiesDir: string): readonly IdentityRecord[];
9154
+ /** Raised when two identity records claim one name: nothing can tell which of them a reference to the name means, so nothing resolves it until one is renamed. `doctor` reports the same. */
9155
+ declare class DuplicateIdentityNameError extends CliError {
9156
+ readonly identityName: string;
9157
+ readonly ids: readonly string[];
9158
+ constructor(identityName: string, ids: readonly string[]);
9159
+ }
9160
+
9161
+ /** Raised by any operation that requires an identity to already exist, when it does not. `remedy` says what to do, adding the identity unless given (`identityNotFound` gives it from the state on disk). */
9162
+ declare class IdentityNotFoundError extends CliError {
9163
+ readonly name: string;
9164
+ constructor(name: string, remedy?: string);
9165
+ }
9166
+ /** Raised when an identity already claims the given name: by `addIdentity`, and by a rename to that name. */
9167
+ declare class IdentityAlreadyExistsError extends CliError {
9168
+ readonly identityName: string;
9169
+ constructor(identityName: string);
9170
+ }
9171
+ /** Raised by `addIdentity` when `name` fails `IdentitySchema`'s own naming rule — it must start with a letter or number and may then contain letters, numbers, dots, hyphens, underscores, and at signs, so an email address names an identity directly while a *leading* `@` stays invalid (it would collide with the `@name` selector syntax's first-`@` split). */
9172
+ declare class InvalidIdentityNameError extends CliError {
9173
+ readonly attemptedName: string;
9174
+ constructor(attemptedName: string);
9175
+ }
9176
+ /** Every identity's record (its id, the directory it is stored in, and its name), read fresh from the identities directory. See `readIdentityRecords`. */
9177
+ declare function identityRecords(paths: LayoutPaths): readonly IdentityRecord[];
9178
+ /** The id (the directory under `identitiesDir`) of the identity named `name`, or undefined when there is none. Every lookup of an identity by name goes through this, since a renamed identity keeps the directory it was created with. Throws `DuplicateIdentityNameError` when two identities claim the name. */
9179
+ declare function identityIdOf(paths: LayoutPaths, name: string): string | undefined;
9180
+ /** The name of the identity stored under id `id`, or undefined when no identity is. */
9181
+ declare function identityNameOf(paths: LayoutPaths, id: string): string | undefined;
9182
+ /** Whether an identity is named `name`. Throws `DuplicateIdentityNameError` when two are. */
9183
+ declare function identityExists(paths: LayoutPaths, name: string): boolean;
9184
+ /** Reads and validates the `identity.json` of the identity named `name`, or undefined when there is none. */
9185
+ declare function readIdentity(paths: LayoutPaths, name: string): Identity | undefined;
9186
+ /** Reads and validates the `identity.json` stored under id `id`, or undefined when there is none. */
9187
+ declare function readIdentityById(paths: LayoutPaths, id: string): Identity | undefined;
9188
+ /** How `addIdentity` reaches what it needs beyond the files: the identity names lock, and, for an add whose id was checked before the lock was taken (`requireIdentityAddable`), that id. */
9189
+ interface AddIdentityOptions {
9190
+ readonly namesLock?: IdentityNamesLockPorts;
9191
+ readonly checkedId?: string;
9192
+ }
9193
+ /**
9194
+ * Creates a new identity: validates `name` against `IdentitySchema`'s own naming rule and writes a fresh `identity.json` with `allowAmbientCredential: false` and no `defaultConfigProfile`, in the directory `newIdentityId` gives (the name itself unless something is already filed under it), or in `options.checkedId` when the add was checked against that id, which is used only while it is still free.
9195
+ *
9196
+ * Every check is made, and the file written, holding the identity names lock (`options.namesLock` reaches it; see `acquireIdentityNamesLock`), so a rename or another add cannot give the name to a second identity in between. Throws `IdentityLockBusyError` when the lock stays held, a `CliError` naming the command that finishes the rename when an unfinished rename names `name` or its id (see `requireNoUnfinishedRenameNaming`), `IdentityAlreadyExistsError` if an identity is already named `name`, since `add` never silently overwrites an existing identity, and a `CliError` when the checked id was taken in between. Throws `InvalidIdentityNameError` when `name` fails `IdentitySchema`'s naming rule, rather than letting the underlying `ZodError` escape as an unhandled crash.
9197
+ *
9198
+ * It does not ask the Keychain: called alone, it neither passes over an id whose cached credential the Keychain store still holds nor refuses over a Claude Code login left for the directory. `identity add` and the door make those checks first (`requireIdentityAddable`, then this with `checkedId`, as `addNewIdentity` does).
9199
+ */
9200
+ declare function addIdentity(paths: LayoutPaths, name: string, options?: AddIdentityOptions): Identity;
9201
+ /**
9202
+ * Persists `name` as the active identity, written atomically as plain text (not JSON — this file is read by `decideIdentity` in `src/launcher/identity.ts` via a simple UTF-8 read-and-trim, matching the README's documented `~/.agent-shim/active-identity` file).
9203
+ *
9204
+ * `name` may be a `pool:<name>` selector, which makes launches pick a member of that pool. Throws `IdentityNotFoundError` when no identity with this name exists yet, and `PoolNotFoundError` for a pool that is not defined: selecting either would silently persist a name nothing else can ever load.
9205
+ */
9206
+ declare function useIdentity(paths: LayoutPaths, name: string, namesLock?: IdentityNamesLockPorts): void;
9207
+ /** Reads the persisted active-identity file, or undefined when none is set. */
9208
+ declare function readActiveIdentity(paths: LayoutPaths): string | undefined;
9209
+ /**
9210
+ * Whether a directory name directly under `identitiesDir` names an actual identity, rather than one of agent-shim's own farm directories.
9211
+ *
9212
+ * `IdentitySchema` requires an identity name to start with a letter or digit, so a leading `.` can only be a resync's own bookkeeping: a `.<identity>.scratch.<suffix>` tree still being built, or a `.<identity>.previous.<suffix>` superseded farm retained for `agent-shim identity resolve-conflicts`. Neither is an identity, and neither should be reported as a broken one for lacking an `identity.json` a resync never put there.
9213
+ */
9214
+ declare function isIdentityDirectoryName(name: string): boolean;
9215
+ /** An entry directly under `identitiesDir` that cannot be reached, and why: `code` is the error the filesystem gave. */
9216
+ interface UnreachableIdentityEntry {
9217
+ readonly name: string;
9218
+ readonly code: string;
9219
+ }
9220
+ /** One identity as reported by `listIdentities`, whose `identity.json` parsed and validated cleanly. `name` is the name it gives; `id` is the directory it is stored under. */
9221
+ interface IdentityListEntry {
9222
+ readonly name: string;
9223
+ readonly id: string;
9224
+ readonly identity: Identity;
9225
+ readonly isActive: boolean;
9226
+ readonly problem?: never;
9227
+ readonly displaced?: never;
9228
+ }
9229
+ /** One identity whose `identity.json` cannot be read where it belongs: malformed, rejected by `IdentitySchema`, or (with `displaced`) left only in a superseded farm. `problem` carries the reason, already flattened onto a single line. `name` is the name the file gives when that much of it can be read, and otherwise its id (the record of such a file claims no name). */
9230
+ interface UnreadableIdentityListEntry {
9231
+ readonly name: string;
9232
+ readonly id: string;
9233
+ readonly identity?: never;
9234
+ readonly isActive: boolean;
9235
+ readonly problem: string;
9236
+ /** Set when the file is not unreadable but displaced: an interrupted resync left it only in a superseded farm, and the next launch of the identity puts it back. */
9237
+ readonly displaced?: true;
9238
+ }
9239
+ /** Either shape `listIdentities` can report, discriminated by which of `identity`/`problem` is present rather than by a tag field — the two are never simultaneously satisfiable. */
9240
+ type IdentityListing = IdentityListEntry | UnreadableIdentityListEntry;
9241
+ /**
9242
+ * Lists every identity under `identitiesDir`, sorted by name, marking which one (if any) is currently active. Two identities that claim one name are both listed; `doctor` reports them.
9243
+ *
9244
+ * One identity whose `identity.json` cannot be read is reported as its own `UnreadableIdentityListEntry` rather than aborting the whole listing. A single bad file blocking `identity list` outright is exactly the failure mode that hides every *other* identity from view at the moment the user most needs to see them — and the file need not even be corrupt to land here, since a name written by a newer agent-shim whose naming rule has since widened is rejected outright by an older binary's own copy of `IdentitySchema`.
9245
+ */
9246
+ declare function listIdentities(paths: LayoutPaths): readonly IdentityListing[];
9247
+ /**
9248
+ * Sets `identity`'s `defaultConfigProfile` field, or clears it when `profileName` is undefined. Throws `IdentityNotFoundError` when the identity does not exist. Whether the profile exists is the caller's concern: `identity set --default-profile` checks it first.
9249
+ */
9250
+ declare function setDefaultConfigProfile(paths: LayoutPaths, identityName: string, profileName: string | undefined): Identity;
9251
+ /**
9252
+ * Patches `identity`'s `allowAmbientCredential` field. Throws `IdentityNotFoundError` when the identity does not exist.
9253
+ */
9254
+ declare function setAllowAmbientCredential(paths: LayoutPaths, identityName: string, allow: boolean): Identity;
9255
+ /** The change `setIdentityCredential` makes: new sources and/or a new target for the credential block, or `false` to remove the block and return the identity to its stored login. */
9256
+ type IdentityCredentialChange = {
9257
+ readonly sources?: readonly CredentialSource[];
9258
+ readonly target?: CredentialTarget;
9259
+ readonly cache?: CredentialCache | false;
9260
+ } | false;
9261
+ /**
9262
+ * Sets, changes or removes `identityName`'s credential block. New `sources` replace the whole ordered list (the order is the meaning); a `target` alone keeps the existing sources, and so needs a credential block to exist already. Throws `IdentityNotFoundError` when the identity does not exist, and `UsageError` when only a target is given for an identity with no credential yet.
9263
+ */
9264
+ declare function setIdentityCredential(paths: LayoutPaths, identityName: string, change: IdentityCredentialChange): Identity;
9265
+ /**
9266
+ * Deletes the identity named `name` entirely: its directory under `identitiesDir` (the farm, its `identity.json`, and whatever that farm holds unshared, credentials included; for an entry that is a symlink, the link and not what it points to), every other entry there that is the same directory (each symlink to it), its resync lock, any scratch or superseded farm a resync left behind, the files outside the directory that hold its state under its id (`REMOVED_STATE`: its stored token, its cached credential in the file store, which the store deletes only when it is this identity's own or was cached before owners were recorded, and its usage snapshot), and the active-identity selection when it names this identity. Returns the id it was stored under, so a caller that can reach the Keychain forgets a credential cached there too. Data shared into `~/.claude` stays there, since the farm only ever symlinks to it. Throws a `CliError` naming the command that finishes the rename when an unfinished rename names `name` or the identity's id, `IdentityNotFoundError` when no identity is named `name`, and `DuplicateIdentityNameError` when two are. It holds the identity names lock throughout, so it never removes an identity a rename is applying to, and throws `IdentityLockBusyError` when that stays held; it then takes the identity's own resync lock, so it never removes an identity a launch is resyncing, and throws `IdentityRemovalBusyError` (naming the launch to let finish or stop) when that is held.
9267
+ */
9268
+ declare function removeIdentity(paths: LayoutPaths, name: string, namesLock?: IdentityNamesLockPorts): string;
9269
+
9270
+ /** A record read from a superseded farm, with whether its identity's directory is present (holding no `identity.json` yet) or missing. */
9271
+ interface DisplacedIdentityRecord extends IdentityRecord {
9272
+ readonly directoryPresent: boolean;
9273
+ }
9274
+
9163
9275
  /**
9164
9276
  * 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.
9165
9277
  */
@@ -9391,10 +9503,13 @@ interface DoctorReport {
9391
9503
  }
9392
9504
  /** One identity's raw `identity.json`, unparsed — `runDoctor` does its own JSON.parse/schema validation so one malformed file never aborts the rest of the report. */
9393
9505
  interface DoctorIdentityInput {
9506
+ /** The name its `identity.json` gives it when that much of the file can be read, and otherwise its id (the record of such a file claims no name). */
9394
9507
  readonly name: string;
9508
+ /** Its storage id: the directory under the identities directory it is stored in. */
9509
+ readonly id: string;
9395
9510
  readonly path: string;
9396
9511
  readonly raw: string | undefined;
9397
- /** The identity's own farm root (`identitiesDir/<name>`) — the account name the Keychain lookup uses. */
9512
+ /** The identity's own farm root (`identitiesDir/<id>`): the account name the Keychain lookup uses. */
9398
9513
  readonly farmRoot: string;
9399
9514
  /** Whether the identity's `.credentials.json` exists, pre-resolved by the wiring layer since it is a file-existence check. */
9400
9515
  readonly credentialsFilePresent: boolean;
@@ -9459,6 +9574,16 @@ interface RunDoctorParams {
9459
9574
  readonly renameJournals?: RenameJournalListing;
9460
9575
  /** The entries of the identities directory that cannot be reached (a symlink the filesystem would not follow, or a directory nobody can enter), which are not counted as identities. Omit to leave them out of the findings. */
9461
9576
  readonly unreachableIdentities?: readonly UnreachableIdentityEntry[];
9577
+ /** Every identity's record as the resolver reads it (`all`, see `readIdentityRecords`), which a name two of them claim is found in, and those whose directory is missing, or present without `identity.json`, while a superseded farm a resync left holds their `identity.json` (`displaced`), which the next launch puts back, and the renames of the name alone left half done, each with the sentence that says what it rewrote and how it is finished (`unfinishedNameRenames`), and the files under `identity-name-renames/` holding a record that no rename filed there (`strayNameRenameFiles`, see `strayNameRenameRecordFiles`). Omit to leave them out of the findings. */
9578
+ readonly identityRecords?: {
9579
+ readonly all: readonly IdentityRecord[];
9580
+ readonly displaced: readonly DisplacedIdentityRecord[];
9581
+ readonly nameRenames?: readonly {
9582
+ readonly from: string;
9583
+ readonly description: string;
9584
+ }[];
9585
+ readonly strayNameRenameFiles?: readonly string[];
9586
+ };
9462
9587
  readonly directoryRules: DoctorFileInput;
9463
9588
  readonly globalConfig: DoctorFileInput;
9464
9589
  /** The parsed `models` block of the global config, when one is defined. Omit to skip the models checks. */
@@ -9500,6 +9625,13 @@ interface RunDoctorParams {
9500
9625
  readonly listeners?: readonly FrontDoorListenerReading[];
9501
9626
  };
9502
9627
  }
9628
+ /**
9629
+ * Audits the whole `~/.agent-shim` config graph for internal consistency: every identity, every configuration profile's own `extends` chain, every provider, `directory-rules.json`, `config.json`, `categories.local.json`, `active-identity`, plus real Claude Code binary discoverability and ambient-credential exposure.
9630
+ *
9631
+ * Deliberately identity/directory-agnostic, unlike `runCheck` — there is no single cascade to resolve `doctor` against, so it never touches settings-exposure (which only means anything relative to one resolved cascade).
9632
+ *
9633
+ * Every check aggregates rather than throws: a malformed file becomes one `fail` finding for that file, not an aborted report. This is the one place in the codebase that deliberately breaks the "throw a validation error and let it propagate" convention every other command relies on — `doctor`'s whole purpose is to survive a broken file and keep auditing everything else.
9634
+ */
9503
9635
  declare function runDoctor(params: RunDoctorParams): DoctorReport;
9504
9636
  /** Renders a full `DoctorReport` as plain text lines, one section header at a time, in the order `agent-shim doctor` prints them. */
9505
9637
  declare function formatDoctorReport(report: DoctorReport): string[];
@@ -9823,7 +9955,6 @@ declare function createConfigApiRouter(deps: ConfigApiDeps): {
9823
9955
  kind: zod.ZodLiteral<"profile">;
9824
9956
  name: zod.ZodString;
9825
9957
  value: zod.ZodObject<{
9826
- description: zod.ZodOptional<zod.ZodString>;
9827
9958
  entries: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodUnion<readonly [zod.ZodBoolean, zod.ZodObject<{
9828
9959
  value: zod.ZodBoolean;
9829
9960
  when: zod.ZodUnion<readonly [zod.ZodObject<{
@@ -9899,7 +10030,9 @@ declare function createConfigApiRouter(deps: ConfigApiDeps): {
9899
10030
  key: zod.ZodType<trilean.JsonValue, unknown, zod_v4_core.$ZodTypeInternals<trilean.JsonValue, unknown>>;
9900
10031
  }, zod_v4_core.$strip>], "kind">]>;
9901
10032
  }, zod_v4_core.$strict>]>>>;
10033
+ description: zod.ZodOptional<zod.ZodString>;
9902
10034
  models: zod.ZodOptional<zod.ZodObject<{
10035
+ pickerLabelSpaces: zod.ZodOptional<zod.ZodBoolean>;
9903
10036
  virtual: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodUnion<readonly [zod.ZodObject<{
9904
10037
  mode: zod.ZodEnum<{
9905
10038
  ordered: "ordered";
@@ -9986,8 +10119,8 @@ declare function createConfigApiRouter(deps: ConfigApiDeps): {
9986
10119
  }>>;
9987
10120
  layout: zod.ZodOptional<zod.ZodObject<{
9988
10121
  header: zod.ZodOptional<zod.ZodArray<zod.ZodEnum<{
9989
- account: "account";
9990
10122
  model: "model";
10123
+ account: "account";
9991
10124
  identity: "identity";
9992
10125
  provider: "provider";
9993
10126
  version: "version";
@@ -10546,7 +10679,6 @@ declare function createConfigApiRouter(deps: ConfigApiDeps): {
10546
10679
  kind: zod.ZodLiteral<"profile">;
10547
10680
  name: zod.ZodString;
10548
10681
  value: zod.ZodObject<{
10549
- description: zod.ZodOptional<zod.ZodString>;
10550
10682
  entries: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodUnion<readonly [zod.ZodBoolean, zod.ZodObject<{
10551
10683
  value: zod.ZodBoolean;
10552
10684
  when: zod.ZodUnion<readonly [zod.ZodObject<{
@@ -10622,7 +10754,9 @@ declare function createConfigApiRouter(deps: ConfigApiDeps): {
10622
10754
  key: zod.ZodType<trilean.JsonValue, unknown, zod_v4_core.$ZodTypeInternals<trilean.JsonValue, unknown>>;
10623
10755
  }, zod_v4_core.$strip>], "kind">]>;
10624
10756
  }, zod_v4_core.$strict>]>>>;
10757
+ description: zod.ZodOptional<zod.ZodString>;
10625
10758
  models: zod.ZodOptional<zod.ZodObject<{
10759
+ pickerLabelSpaces: zod.ZodOptional<zod.ZodBoolean>;
10626
10760
  virtual: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodUnion<readonly [zod.ZodObject<{
10627
10761
  mode: zod.ZodEnum<{
10628
10762
  ordered: "ordered";
@@ -10709,8 +10843,8 @@ declare function createConfigApiRouter(deps: ConfigApiDeps): {
10709
10843
  }>>;
10710
10844
  layout: zod.ZodOptional<zod.ZodObject<{
10711
10845
  header: zod.ZodOptional<zod.ZodArray<zod.ZodEnum<{
10712
- account: "account";
10713
10846
  model: "model";
10847
+ account: "account";
10714
10848
  identity: "identity";
10715
10849
  provider: "provider";
10716
10850
  version: "version";
@@ -11821,6 +11955,7 @@ declare function createConfigApiRouter(deps: ConfigApiDeps): {
11821
11955
  }, zod_v4_core.$strip>], "kind">]>;
11822
11956
  }, zod_v4_core.$strict>]>>>;
11823
11957
  models: zod.ZodOptional<zod.ZodObject<{
11958
+ pickerLabelSpaces: zod.ZodOptional<zod.ZodBoolean>;
11824
11959
  virtual: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodUnion<readonly [zod.ZodObject<{
11825
11960
  mode: zod.ZodEnum<{
11826
11961
  ordered: "ordered";
@@ -11908,8 +12043,8 @@ declare function createConfigApiRouter(deps: ConfigApiDeps): {
11908
12043
  }>>;
11909
12044
  layout: zod.ZodOptional<zod.ZodObject<{
11910
12045
  header: zod.ZodOptional<zod.ZodArray<zod.ZodEnum<{
11911
- account: "account";
11912
12046
  model: "model";
12047
+ account: "account";
11913
12048
  identity: "identity";
11914
12049
  provider: "provider";
11915
12050
  version: "version";
@@ -12601,6 +12736,7 @@ declare function createConfigApiRouter(deps: ConfigApiDeps): {
12601
12736
  }, zod_v4_core.$strip>], "kind">]>;
12602
12737
  }, zod_v4_core.$strict>]>>>;
12603
12738
  models: zod.ZodOptional<zod.ZodObject<{
12739
+ pickerLabelSpaces: zod.ZodOptional<zod.ZodBoolean>;
12604
12740
  virtual: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodUnion<readonly [zod.ZodObject<{
12605
12741
  mode: zod.ZodEnum<{
12606
12742
  ordered: "ordered";
@@ -12688,8 +12824,8 @@ declare function createConfigApiRouter(deps: ConfigApiDeps): {
12688
12824
  }>>;
12689
12825
  layout: zod.ZodOptional<zod.ZodObject<{
12690
12826
  header: zod.ZodOptional<zod.ZodArray<zod.ZodEnum<{
12691
- account: "account";
12692
12827
  model: "model";
12828
+ account: "account";
12693
12829
  identity: "identity";
12694
12830
  provider: "provider";
12695
12831
  version: "version";
@@ -13396,7 +13532,8 @@ type DoorHealthEvent = z.output<typeof DoorHealthEventSchema>;
13396
13532
  * 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.
13397
13533
  */
13398
13534
  declare const QuotaExpiringEventSchema: z.ZodObject<{
13399
- identity: z.ZodString;
13535
+ id: z.ZodString;
13536
+ name: z.ZodOptional<z.ZodString>;
13400
13537
  provider: z.ZodString;
13401
13538
  window: z.ZodEnum<{
13402
13539
  fiveHour: "fiveHour";
@@ -13409,10 +13546,109 @@ declare const QuotaExpiringEventSchema: z.ZodObject<{
13409
13546
  /** One expiring-quota event, as the TypeScript the publisher emits and its consumers handle. */
13410
13547
  type QuotaExpiringEvent = z.output<typeof QuotaExpiringEventSchema>;
13411
13548
  /**
13412
- * 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.
13549
+ * The usage source's payload: the snapshot the door just wrote, verbatim, so a consumer sees a quota change or a reset in the payload itself rather than the door guessing what the two writes were, with the identity it belongs to named both ways. A snapshot is filed by the identity's id, which its `identity` field also holds; `id` repeats it under the name every event uses, and `name` is the identity's name when the door wrote it, absent for a snapshot of an identity no longer stored under that id.
13413
13550
  */
13414
- /** 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. */
13415
- type UsageChangeEvent = UsageSnapshot;
13551
+ declare const UsageChangeEventSchema: z.ZodObject<{
13552
+ schemaVersion: z.ZodLiteral<1>;
13553
+ identity: z.ZodString;
13554
+ updatedAt: z.ZodISODateTime;
13555
+ account: z.ZodOptional<z.ZodObject<{
13556
+ accountUuid: z.ZodOptional<z.ZodString>;
13557
+ emailAddress: z.ZodOptional<z.ZodString>;
13558
+ displayName: z.ZodOptional<z.ZodString>;
13559
+ organizationUuid: z.ZodOptional<z.ZodString>;
13560
+ organizationName: z.ZodOptional<z.ZodString>;
13561
+ organizationType: z.ZodOptional<z.ZodString>;
13562
+ organizationRole: z.ZodOptional<z.ZodString>;
13563
+ workspaceRole: z.ZodOptional<z.ZodString>;
13564
+ billingType: z.ZodOptional<z.ZodString>;
13565
+ seatTier: z.ZodOptional<z.ZodString>;
13566
+ organizationRateLimitTier: z.ZodOptional<z.ZodString>;
13567
+ userRateLimitTier: z.ZodOptional<z.ZodString>;
13568
+ hasExtraUsageEnabled: z.ZodOptional<z.ZodBoolean>;
13569
+ subscriptionCreatedAt: z.ZodOptional<z.ZodString>;
13570
+ accountCreatedAt: z.ZodOptional<z.ZodString>;
13571
+ }, z.core.$strict>>;
13572
+ providers: z.ZodRecord<z.ZodString, z.ZodObject<{
13573
+ lastRequestAt: z.ZodOptional<z.ZodISODateTime>;
13574
+ lastStatus: z.ZodOptional<z.ZodNumber>;
13575
+ lastModel: z.ZodOptional<z.ZodString>;
13576
+ rateLimit: z.ZodOptional<z.ZodObject<{
13577
+ observedAt: z.ZodISODateTime;
13578
+ headers: z.ZodRecord<z.ZodString, z.ZodString>;
13579
+ unified: z.ZodOptional<z.ZodObject<{
13580
+ status: z.ZodOptional<z.ZodString>;
13581
+ fiveHour: z.ZodOptional<z.ZodObject<{
13582
+ utilization: z.ZodOptional<z.ZodNumber>;
13583
+ resetsAt: z.ZodOptional<z.ZodISODateTime>;
13584
+ status: z.ZodOptional<z.ZodString>;
13585
+ graceUtilization: z.ZodOptional<z.ZodNumber>;
13586
+ }, z.core.$strict>>;
13587
+ sevenDay: z.ZodOptional<z.ZodObject<{
13588
+ utilization: z.ZodOptional<z.ZodNumber>;
13589
+ resetsAt: z.ZodOptional<z.ZodISODateTime>;
13590
+ status: z.ZodOptional<z.ZodString>;
13591
+ graceUtilization: z.ZodOptional<z.ZodNumber>;
13592
+ }, z.core.$strict>>;
13593
+ sevenDayOverageIncluded: z.ZodOptional<z.ZodObject<{
13594
+ utilization: z.ZodOptional<z.ZodNumber>;
13595
+ resetsAt: z.ZodOptional<z.ZodISODateTime>;
13596
+ status: z.ZodOptional<z.ZodString>;
13597
+ graceUtilization: z.ZodOptional<z.ZodNumber>;
13598
+ }, z.core.$strict>>;
13599
+ representativeClaim: z.ZodOptional<z.ZodString>;
13600
+ resetAt: z.ZodOptional<z.ZodISODateTime>;
13601
+ overageStatus: z.ZodOptional<z.ZodString>;
13602
+ overageUtilization: z.ZodOptional<z.ZodNumber>;
13603
+ overageResetsAt: z.ZodOptional<z.ZodISODateTime>;
13604
+ overageDisabledReason: z.ZodOptional<z.ZodString>;
13605
+ overageInUse: z.ZodOptional<z.ZodBoolean>;
13606
+ extraUsageSpend: z.ZodOptional<z.ZodObject<{
13607
+ usedMinor: z.ZodNumber;
13608
+ limitMinor: z.ZodOptional<z.ZodNumber>;
13609
+ currency: z.ZodString;
13610
+ }, z.core.$strict>>;
13611
+ fallbackAvailable: z.ZodOptional<z.ZodBoolean>;
13612
+ }, z.core.$strict>>;
13613
+ planWindowsUnavailableAt: z.ZodOptional<z.ZodISODateTime>;
13614
+ }, z.core.$strict>>;
13615
+ lastLimit: z.ZodOptional<z.ZodObject<{
13616
+ kind: z.ZodEnum<{
13617
+ "rate-limited": "rate-limited";
13618
+ "quota-exhausted": "quota-exhausted";
13619
+ }>;
13620
+ retryAfterSeconds: z.ZodOptional<z.ZodNumber>;
13621
+ resetAt: z.ZodOptional<z.ZodISODateTime>;
13622
+ window: z.ZodOptional<z.ZodString>;
13623
+ evidence: z.ZodArray<z.ZodString>;
13624
+ observedAt: z.ZodISODateTime;
13625
+ status: z.ZodNumber;
13626
+ }, z.core.$strict>>;
13627
+ quota: z.ZodOptional<z.ZodObject<{
13628
+ observedAt: z.ZodISODateTime;
13629
+ source: z.ZodString;
13630
+ level: z.ZodOptional<z.ZodString>;
13631
+ account: z.ZodOptional<z.ZodObject<{
13632
+ email: z.ZodOptional<z.ZodString>;
13633
+ accountId: z.ZodOptional<z.ZodString>;
13634
+ }, z.core.$strict>>;
13635
+ windows: z.ZodArray<z.ZodObject<{
13636
+ measures: z.ZodString;
13637
+ periodMs: z.ZodOptional<z.ZodNumber>;
13638
+ period: z.ZodOptional<z.ZodString>;
13639
+ utilization: z.ZodNumber;
13640
+ resetsAt: z.ZodOptional<z.ZodISODateTime>;
13641
+ limit: z.ZodOptional<z.ZodNumber>;
13642
+ used: z.ZodOptional<z.ZodNumber>;
13643
+ remaining: z.ZodOptional<z.ZodNumber>;
13644
+ }, z.core.$strict>>;
13645
+ }, z.core.$strict>>;
13646
+ }, z.core.$strict>>;
13647
+ id: z.ZodString;
13648
+ name: z.ZodOptional<z.ZodString>;
13649
+ }, z.core.$strict>;
13650
+ /** One usage change event, as the TypeScript the publisher emits and its consumers handle (the schema's own inferred type). */
13651
+ type UsageChangeEvent = z.output<typeof UsageChangeEventSchema>;
13416
13652
 
13417
13653
  /**
13418
13654
  * 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.
@@ -13561,8 +13797,8 @@ declare const StatuslineSchema: z.ZodObject<{
13561
13797
  }>>;
13562
13798
  layout: z.ZodOptional<z.ZodObject<{
13563
13799
  header: z.ZodOptional<z.ZodArray<z.ZodEnum<{
13564
- account: "account";
13565
13800
  model: "model";
13801
+ account: "account";
13566
13802
  identity: "identity";
13567
13803
  provider: "provider";
13568
13804
  version: "version";
@@ -14194,6 +14430,7 @@ interface FarmRuntime {
14194
14430
  /** Inputs to `prepareLaunch`: everything a launch needs except the means of spawning the child. */
14195
14431
  interface PrepareLaunchParams {
14196
14432
  readonly paths: LayoutPaths;
14433
+ readonly namesLock?: IdentityNamesLockPorts;
14197
14434
  readonly fs: FsPort;
14198
14435
  readonly proc: ProcPort;
14199
14436
  readonly log: LogPort;
@@ -14254,6 +14491,8 @@ interface LaunchPoolDecision {
14254
14491
  interface LaunchDecision {
14255
14492
  /** The identity the launch runs as. Absent when the escape hatch applied or nothing resolved one. */
14256
14493
  readonly identity?: string;
14494
+ /** The id `identity` is stored under: the directory under the identities directory, which a rename keeps. Absent exactly when `identity` is. */
14495
+ readonly identityId?: string;
14257
14496
  /** Which precedence rule selected the identity (or the pool the identity was picked from). */
14258
14497
  readonly identitySource: IdentityDecisionSource;
14259
14498
  /** The pool pick behind `identity`, when the launch selected a pool. */
@@ -14367,6 +14606,7 @@ declare function createLaunchApiRouter(deps: LaunchApiDeps): {
14367
14606
  }, zod_v4_core.$strict>, zod.ZodObject<{
14368
14607
  decision: zod.ZodObject<{
14369
14608
  identity: zod.ZodOptional<zod.ZodString>;
14609
+ identityId: zod.ZodOptional<zod.ZodString>;
14370
14610
  identitySource: zod.ZodEnum<{
14371
14611
  "config-dir-escape-hatch": "config-dir-escape-hatch";
14372
14612
  argv: "argv";
@@ -14421,8 +14661,8 @@ declare function createLaunchApiRouter(deps: LaunchApiDeps): {
14421
14661
  }>>;
14422
14662
  layout: zod.ZodOptional<zod.ZodObject<{
14423
14663
  header: zod.ZodOptional<zod.ZodArray<zod.ZodEnum<{
14424
- account: "account";
14425
14664
  model: "model";
14665
+ account: "account";
14426
14666
  identity: "identity";
14427
14667
  provider: "provider";
14428
14668
  version: "version";
@@ -16041,6 +16281,7 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
16041
16281
  }, zod_v4_core.$strict>, zod.ZodObject<{
16042
16282
  decision: zod.ZodObject<{
16043
16283
  identity: zod.ZodOptional<zod.ZodString>;
16284
+ identityId: zod.ZodOptional<zod.ZodString>;
16044
16285
  identitySource: zod.ZodEnum<{
16045
16286
  "config-dir-escape-hatch": "config-dir-escape-hatch";
16046
16287
  argv: "argv";
@@ -16095,8 +16336,8 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
16095
16336
  }>>;
16096
16337
  layout: zod.ZodOptional<zod.ZodObject<{
16097
16338
  header: zod.ZodOptional<zod.ZodArray<zod.ZodEnum<{
16098
- account: "account";
16099
16339
  model: "model";
16340
+ account: "account";
16100
16341
  identity: "identity";
16101
16342
  provider: "provider";
16102
16343
  version: "version";
@@ -16902,7 +17143,6 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
16902
17143
  kind: zod.ZodLiteral<"profile">;
16903
17144
  name: zod.ZodString;
16904
17145
  value: zod.ZodObject<{
16905
- description: zod.ZodOptional<zod.ZodString>;
16906
17146
  entries: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodUnion<readonly [zod.ZodBoolean, zod.ZodObject<{
16907
17147
  value: zod.ZodBoolean;
16908
17148
  when: zod.ZodUnion<readonly [zod.ZodObject<{
@@ -16978,7 +17218,9 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
16978
17218
  key: zod.ZodType<trilean.JsonValue, unknown, zod_v4_core.$ZodTypeInternals<trilean.JsonValue, unknown>>;
16979
17219
  }, zod_v4_core.$strip>], "kind">]>;
16980
17220
  }, zod_v4_core.$strict>]>>>;
17221
+ description: zod.ZodOptional<zod.ZodString>;
16981
17222
  models: zod.ZodOptional<zod.ZodObject<{
17223
+ pickerLabelSpaces: zod.ZodOptional<zod.ZodBoolean>;
16982
17224
  virtual: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodUnion<readonly [zod.ZodObject<{
16983
17225
  mode: zod.ZodEnum<{
16984
17226
  ordered: "ordered";
@@ -17065,8 +17307,8 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
17065
17307
  }>>;
17066
17308
  layout: zod.ZodOptional<zod.ZodObject<{
17067
17309
  header: zod.ZodOptional<zod.ZodArray<zod.ZodEnum<{
17068
- account: "account";
17069
17310
  model: "model";
17311
+ account: "account";
17070
17312
  identity: "identity";
17071
17313
  provider: "provider";
17072
17314
  version: "version";
@@ -17625,7 +17867,6 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
17625
17867
  kind: zod.ZodLiteral<"profile">;
17626
17868
  name: zod.ZodString;
17627
17869
  value: zod.ZodObject<{
17628
- description: zod.ZodOptional<zod.ZodString>;
17629
17870
  entries: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodUnion<readonly [zod.ZodBoolean, zod.ZodObject<{
17630
17871
  value: zod.ZodBoolean;
17631
17872
  when: zod.ZodUnion<readonly [zod.ZodObject<{
@@ -17701,7 +17942,9 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
17701
17942
  key: zod.ZodType<trilean.JsonValue, unknown, zod_v4_core.$ZodTypeInternals<trilean.JsonValue, unknown>>;
17702
17943
  }, zod_v4_core.$strip>], "kind">]>;
17703
17944
  }, zod_v4_core.$strict>]>>>;
17945
+ description: zod.ZodOptional<zod.ZodString>;
17704
17946
  models: zod.ZodOptional<zod.ZodObject<{
17947
+ pickerLabelSpaces: zod.ZodOptional<zod.ZodBoolean>;
17705
17948
  virtual: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodUnion<readonly [zod.ZodObject<{
17706
17949
  mode: zod.ZodEnum<{
17707
17950
  ordered: "ordered";
@@ -17788,8 +18031,8 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
17788
18031
  }>>;
17789
18032
  layout: zod.ZodOptional<zod.ZodObject<{
17790
18033
  header: zod.ZodOptional<zod.ZodArray<zod.ZodEnum<{
17791
- account: "account";
17792
18034
  model: "model";
18035
+ account: "account";
17793
18036
  identity: "identity";
17794
18037
  provider: "provider";
17795
18038
  version: "version";
@@ -18900,6 +19143,7 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
18900
19143
  }, zod_v4_core.$strip>], "kind">]>;
18901
19144
  }, zod_v4_core.$strict>]>>>;
18902
19145
  models: zod.ZodOptional<zod.ZodObject<{
19146
+ pickerLabelSpaces: zod.ZodOptional<zod.ZodBoolean>;
18903
19147
  virtual: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodUnion<readonly [zod.ZodObject<{
18904
19148
  mode: zod.ZodEnum<{
18905
19149
  ordered: "ordered";
@@ -18987,8 +19231,8 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
18987
19231
  }>>;
18988
19232
  layout: zod.ZodOptional<zod.ZodObject<{
18989
19233
  header: zod.ZodOptional<zod.ZodArray<zod.ZodEnum<{
18990
- account: "account";
18991
19234
  model: "model";
19235
+ account: "account";
18992
19236
  identity: "identity";
18993
19237
  provider: "provider";
18994
19238
  version: "version";
@@ -19680,6 +19924,7 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
19680
19924
  }, zod_v4_core.$strip>], "kind">]>;
19681
19925
  }, zod_v4_core.$strict>]>>>;
19682
19926
  models: zod.ZodOptional<zod.ZodObject<{
19927
+ pickerLabelSpaces: zod.ZodOptional<zod.ZodBoolean>;
19683
19928
  virtual: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodUnion<readonly [zod.ZodObject<{
19684
19929
  mode: zod.ZodEnum<{
19685
19930
  ordered: "ordered";
@@ -19767,8 +20012,8 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
19767
20012
  }>>;
19768
20013
  layout: zod.ZodOptional<zod.ZodObject<{
19769
20014
  header: zod.ZodOptional<zod.ZodArray<zod.ZodEnum<{
19770
- account: "account";
19771
20015
  model: "model";
20016
+ account: "account";
19772
20017
  identity: "identity";
19773
20018
  provider: "provider";
19774
20019
  version: "version";
@@ -21436,7 +21681,6 @@ declare const ConfigProfileAddOutputSchema: z.ZodObject<{
21436
21681
  kind: z.ZodLiteral<"profile">;
21437
21682
  name: z.ZodString;
21438
21683
  value: z.ZodObject<{
21439
- description: z.ZodOptional<z.ZodString>;
21440
21684
  entries: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
21441
21685
  value: z.ZodBoolean;
21442
21686
  when: z.ZodUnion<readonly [z.ZodObject<{
@@ -21512,7 +21756,9 @@ declare const ConfigProfileAddOutputSchema: z.ZodObject<{
21512
21756
  key: z.ZodType<trilean.JsonValue, unknown, z.core.$ZodTypeInternals<trilean.JsonValue, unknown>>;
21513
21757
  }, z.core.$strip>], "kind">]>;
21514
21758
  }, z.core.$strict>]>>>;
21759
+ description: z.ZodOptional<z.ZodString>;
21515
21760
  models: z.ZodOptional<z.ZodObject<{
21761
+ pickerLabelSpaces: z.ZodOptional<z.ZodBoolean>;
21516
21762
  virtual: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
21517
21763
  mode: z.ZodEnum<{
21518
21764
  ordered: "ordered";
@@ -21599,8 +21845,8 @@ declare const ConfigProfileAddOutputSchema: z.ZodObject<{
21599
21845
  }>>;
21600
21846
  layout: z.ZodOptional<z.ZodObject<{
21601
21847
  header: z.ZodOptional<z.ZodArray<z.ZodEnum<{
21602
- account: "account";
21603
21848
  model: "model";
21849
+ account: "account";
21604
21850
  identity: "identity";
21605
21851
  provider: "provider";
21606
21852
  version: "version";
@@ -22161,7 +22407,6 @@ declare const ConfigProfileSetOutputSchema: z.ZodObject<{
22161
22407
  kind: z.ZodLiteral<"profile">;
22162
22408
  name: z.ZodString;
22163
22409
  value: z.ZodObject<{
22164
- description: z.ZodOptional<z.ZodString>;
22165
22410
  entries: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
22166
22411
  value: z.ZodBoolean;
22167
22412
  when: z.ZodUnion<readonly [z.ZodObject<{
@@ -22237,7 +22482,9 @@ declare const ConfigProfileSetOutputSchema: z.ZodObject<{
22237
22482
  key: z.ZodType<trilean.JsonValue, unknown, z.core.$ZodTypeInternals<trilean.JsonValue, unknown>>;
22238
22483
  }, z.core.$strip>], "kind">]>;
22239
22484
  }, z.core.$strict>]>>>;
22485
+ description: z.ZodOptional<z.ZodString>;
22240
22486
  models: z.ZodOptional<z.ZodObject<{
22487
+ pickerLabelSpaces: z.ZodOptional<z.ZodBoolean>;
22241
22488
  virtual: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
22242
22489
  mode: z.ZodEnum<{
22243
22490
  ordered: "ordered";
@@ -22324,8 +22571,8 @@ declare const ConfigProfileSetOutputSchema: z.ZodObject<{
22324
22571
  }>>;
22325
22572
  layout: z.ZodOptional<z.ZodObject<{
22326
22573
  header: z.ZodOptional<z.ZodArray<z.ZodEnum<{
22327
- account: "account";
22328
22574
  model: "model";
22575
+ account: "account";
22329
22576
  identity: "identity";
22330
22577
  provider: "provider";
22331
22578
  version: "version";
@@ -23438,6 +23685,7 @@ declare const ConfigRuleAddOutputSchema: z.ZodObject<{
23438
23685
  }, z.core.$strip>], "kind">]>;
23439
23686
  }, z.core.$strict>]>>>;
23440
23687
  models: z.ZodOptional<z.ZodObject<{
23688
+ pickerLabelSpaces: z.ZodOptional<z.ZodBoolean>;
23441
23689
  virtual: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
23442
23690
  mode: z.ZodEnum<{
23443
23691
  ordered: "ordered";
@@ -23525,8 +23773,8 @@ declare const ConfigRuleAddOutputSchema: z.ZodObject<{
23525
23773
  }>>;
23526
23774
  layout: z.ZodOptional<z.ZodObject<{
23527
23775
  header: z.ZodOptional<z.ZodArray<z.ZodEnum<{
23528
- account: "account";
23529
23776
  model: "model";
23777
+ account: "account";
23530
23778
  identity: "identity";
23531
23779
  provider: "provider";
23532
23780
  version: "version";
@@ -24220,6 +24468,7 @@ declare const ConfigRuleSetOutputSchema: z.ZodObject<{
24220
24468
  }, z.core.$strip>], "kind">]>;
24221
24469
  }, z.core.$strict>]>>>;
24222
24470
  models: z.ZodOptional<z.ZodObject<{
24471
+ pickerLabelSpaces: z.ZodOptional<z.ZodBoolean>;
24223
24472
  virtual: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
24224
24473
  mode: z.ZodEnum<{
24225
24474
  ordered: "ordered";
@@ -24307,8 +24556,8 @@ declare const ConfigRuleSetOutputSchema: z.ZodObject<{
24307
24556
  }>>;
24308
24557
  layout: z.ZodOptional<z.ZodObject<{
24309
24558
  header: z.ZodOptional<z.ZodArray<z.ZodEnum<{
24310
- account: "account";
24311
24559
  model: "model";
24560
+ account: "account";
24312
24561
  identity: "identity";
24313
24562
  provider: "provider";
24314
24563
  version: "version";
@@ -25292,6 +25541,7 @@ declare const LaunchResolveInputSchema: z.ZodObject<{
25292
25541
  declare const LaunchResolveOutputSchema: z.ZodObject<{
25293
25542
  decision: z.ZodObject<{
25294
25543
  identity: z.ZodOptional<z.ZodString>;
25544
+ identityId: z.ZodOptional<z.ZodString>;
25295
25545
  identitySource: z.ZodEnum<{
25296
25546
  "config-dir-escape-hatch": "config-dir-escape-hatch";
25297
25547
  argv: "argv";
@@ -25346,8 +25596,8 @@ declare const LaunchResolveOutputSchema: z.ZodObject<{
25346
25596
  }>>;
25347
25597
  layout: z.ZodOptional<z.ZodObject<{
25348
25598
  header: z.ZodOptional<z.ZodArray<z.ZodEnum<{
25349
- account: "account";
25350
25599
  model: "model";
25600
+ account: "account";
25351
25601
  identity: "identity";
25352
25602
  provider: "provider";
25353
25603
  version: "version";
@@ -25980,10 +26230,11 @@ interface QuotaExpiringPublisher {
25980
26230
  /** 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. */
25981
26231
  readonly check: () => void;
25982
26232
  }
25983
- /** Creates the expiring-quota publisher. One per door process, checked on the supervisor's tick. */
26233
+ /** Creates the expiring-quota publisher. One per door process, checked on the supervisor's tick. Snapshots are held by identity id, and `nameOf` names the identity of an id when an event is published, so a rename since the snapshot was written shows. */
25984
26234
  declare function createQuotaExpiringPublisher(hub: DoorEventHub, deps: {
25985
26235
  readonly seed: readonly UsageSnapshot[];
25986
26236
  readonly now: () => number;
26237
+ readonly nameOf: (id: string) => string | undefined;
25987
26238
  }): QuotaExpiringPublisher;
25988
26239
 
25989
26240
  /**
@@ -26166,8 +26417,8 @@ declare const RC_SELF_HOST_RECORD_DIR = "rc-selfhost";
26166
26417
  declare const RC_SELF_HOST_RECORD_FILE = "credential.json";
26167
26418
  /** Everything the minting needs, injected so it runs against an in-memory fake filesystem in unit tests. */
26168
26419
  interface RcSelfHostMintDeps {
26169
- readonly fs: Pick<FarmFs, "readFileUtf8" | "writeFilePrivate" | "mkdirPrivate">;
26170
- /** The agent-shim identities directory (the mint writes inside `<identitiesDir>/<identity>/`). */
26420
+ readonly fs: Pick<FarmFs, "readFileUtf8" | "readdir" | "writeFilePrivate" | "mkdirPrivate">;
26421
+ /** The agent-shim identities directory (the mint writes inside `<identitiesDir>/<id>/`, the directory of the identity's id). */
26171
26422
  readonly identitiesDir: string;
26172
26423
  /** The door's state directory (the record is written under `<frontdoorDir>/rc-selfhost/`). */
26173
26424
  readonly frontdoorDir: string;
@@ -26413,23 +26664,6 @@ interface RunFrontDoorSupervisorOptions {
26413
26664
  */
26414
26665
  declare function runFrontDoorSupervisor(idleShutdownMinutes: number, ports: FrontDoorSupervisorPorts, options?: RunFrontDoorSupervisorOptions): Promise<number>;
26415
26666
 
26416
- /**
26417
- * The read side of the usage store: pure over an injected filesystem, so the CLI, the library surface and tests all read the same way, and nothing here writes.
26418
- */
26419
- /** The filesystem reads the usage store's readers need. */
26420
- type UsageReadFs = Pick<FarmFs, "readFileUtf8" | "readdir">;
26421
- /** Raised for a snapshot file that exists but does not hold a snapshot of this schema version. */
26422
- declare class UsageSnapshotError extends Error {
26423
- readonly file: string;
26424
- constructor(file: string, detail: string);
26425
- }
26426
- /** The path of an identity's snapshot. Throws for an invalid identity name, which could otherwise name a path outside the snapshots directory. */
26427
- declare function snapshotPath(snapshotsDir: string, identity: string): string;
26428
- /** Reads one identity's snapshot: undefined when it has none yet, `UsageSnapshotError` when the file is there but unreadable. */
26429
- declare function readUsageSnapshot(fs: Pick<FarmFs, "readFileUtf8">, snapshotsDir: string, identity: string): UsageSnapshot | undefined;
26430
- /** Reads every identity's snapshot, by identity name. */
26431
- declare function listUsageSnapshots(fs: UsageReadFs, snapshotsDir: string): readonly UsageSnapshot[];
26432
-
26433
26667
  /** A quota window as it stands at a given instant. */
26434
26668
  interface EffectiveWindow {
26435
26669
  /** True when the window's reset time has passed, so the recorded observation describes a window that no longer exists. */
@@ -26655,6 +26889,8 @@ interface IdentitySession extends SessionSummary {
26655
26889
  declare class SessionLookupError extends CliError {
26656
26890
  constructor(message: string);
26657
26891
  }
26892
+ /** The configuration directory an identity's sessions live under, by the identity's name: its directory under the identities directory, which is named by the identity's id and so not necessarily by its name. */
26893
+ type IdentityConfigDirOf = (identity: string) => string;
26658
26894
  /** Filters for `session list`. */
26659
26895
  interface SessionListFilters {
26660
26896
  /** Only this identity's sessions. */
@@ -26665,7 +26901,7 @@ interface SessionListFilters {
26665
26901
  /**
26666
26902
  * Collects `session list`, read-only: every session of the given identities with its agent and workflow-run counts, newest transcript first. Sessions with nothing to inspect are left out unless `all` is set, because most sessions never spawn an agent and listing them would bury the ones that did.
26667
26903
  */
26668
- declare function collectSessionList(fs: SessionCommandFs, identitiesDir: string, identities: readonly string[], filters: Readonly<SessionListFilters>): readonly IdentitySession[];
26904
+ declare function collectSessionList(fs: SessionCommandFs, configDirOf: IdentityConfigDirOf, identities: readonly string[], filters: Readonly<SessionListFilters>): readonly IdentitySession[];
26669
26905
  /** A resolved session: where it is read from and which identities expose it. */
26670
26906
  interface LocatedSession {
26671
26907
  readonly identities: readonly string[];
@@ -26675,14 +26911,14 @@ interface LocatedSession {
26675
26911
  /**
26676
26912
  * Resolves a session id, or an unambiguous prefix of one, across the given identities. Fails with every candidate named when the prefix matches several, so the caller can say which it meant.
26677
26913
  */
26678
- declare function locateSession(fs: SessionCommandFs, identitiesDir: string, identities: readonly string[], query: string, onlyIdentity?: string): LocatedSession;
26914
+ declare function locateSession(fs: SessionCommandFs, configDirOf: IdentityConfigDirOf, identities: readonly string[], query: string, onlyIdentity?: string): LocatedSession;
26679
26915
  /** One session resolved and read: the tree and every identity that exposes it. */
26680
26916
  interface SessionView {
26681
26917
  readonly identities: readonly string[];
26682
26918
  readonly tree: SessionAgentTree;
26683
26919
  }
26684
26920
  /** Resolves a session id or prefix and reads its tree: what `session show` and the door's `sessions.show` both answer. */
26685
- declare function showSession(fs: SessionCommandFs, identitiesDir: string, identities: readonly string[], query: string, onlyIdentity?: string): SessionView;
26921
+ declare function showSession(fs: SessionCommandFs, configDirOf: IdentityConfigDirOf, identities: readonly string[], query: string, onlyIdentity?: string): SessionView;
26686
26922
 
26687
26923
  /** One quota window's pool-selection facts, in the units a policy reads: fractions of the window, and hours until it resets. */
26688
26924
  interface PoolWindowFacts {
@@ -26952,7 +27188,7 @@ interface UpdateProviderInput {
26952
27188
  * Updates an existing provider definition in place. Throws `ProviderNotFoundError` when it does not exist, and `ConfigValidationError` when the updated definition fails `ProviderSchema`, leaving the file untouched.
26953
27189
  */
26954
27190
  declare function updateProvider(paths: LayoutPaths, name: string, input: UpdateProviderInput): Provider;
26955
- /** Deletes a provider definition. Throws `ProviderNotFoundError` when it does not exist. */
27191
+ /** Deletes a provider definition and its file-cached credential, leaving another provider's entry in the same file alone. Throws `ProviderNotFoundError` when it does not exist. */
26956
27192
  declare function removeProvider(paths: LayoutPaths, name: string): void;
26957
27193
 
26958
27194
  /** One pool member entry, whichever form it takes: the plain selector string, or the object form carrying its policy condition. */
@@ -27208,5 +27444,5 @@ declare const OWN_CLI_FILE_NAME = "cli.cjs";
27208
27444
  */
27209
27445
  declare function agentShimCliPath(distDir?: string | undefined): string;
27210
27446
 
27211
- 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, ConfigIdentityAddInputSchema, 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, changePool, checkReportHasWarnings, checkReportToJson, collectCheckReport, collectDoctorReport, collectFrontDoorStatus, collectPoolPick, collectResets, collectSessionList, createAgentTreesApiRouter, createCodexApiRouter, createConfigApiRouter, createControlApiRouter, createDoorApiNodeHandler, createDoorApiRouter, createDoorEventHub, createDoorHealthPublisher, createEventsApiRouter, createLaunchApiRouter, createLaunchEventPublisher, createLeafCache, createLifecycleApiRouter, createLiveSessionRegistry, 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, setProfileCategories, setProfileEntries, setProfileLaunchFlags, setProfileMetadata, setRcSessionModel, setRcSessionPermissionMode, showSession, snapshotPath, spawnClaude, startConnectServer, submitRcSessionMcpOAuthCallbackUrl, suggestRcSessionFiles, summariseSession, teleportRcSession, topLevelNames, updateDirectoryRule, updateProvider, useIdentity, watchedInstallEntry, writeDirectoryRules };
27212
- 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, LiveSessionRegistry, LiveSessionRegistryPorts, LiveTask, LiveTaskBook, LocatedSession, MergedAgentNode, MergedAgentTree, NestedContribution, OwnExecutableStat, PlanClass, Pool, PoolChange, PoolMember, PoolPickReport, PoolPolicy, 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 };
27447
+ 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, ConfigIdentityAddInputSchema, 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, DuplicateIdentityNameError, 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, UsageChangeEventSchema, 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, changePool, checkReportHasWarnings, checkReportToJson, collectCheckReport, collectDoctorReport, collectFrontDoorStatus, collectPoolPick, collectResets, collectSessionList, createAgentTreesApiRouter, createCodexApiRouter, createConfigApiRouter, createControlApiRouter, createDoorApiNodeHandler, createDoorApiRouter, createDoorEventHub, createDoorHealthPublisher, createEventsApiRouter, createLaunchApiRouter, createLaunchEventPublisher, createLeafCache, createLifecycleApiRouter, createLiveSessionRegistry, 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, identityIdOf, identityNameOf, identityRecords, 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, readIdentityById, readIdentityRecords, 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, setProfileCategories, setProfileEntries, setProfileLaunchFlags, setProfileMetadata, setRcSessionModel, setRcSessionPermissionMode, showSession, snapshotPath, spawnClaude, startConnectServer, submitRcSessionMcpOAuthCallbackUrl, suggestRcSessionFiles, summariseSession, teleportRcSession, topLevelNames, updateDirectoryRule, updateProvider, useIdentity, watchedInstallEntry, writeDirectoryRules };
27448
+ 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, IdentityNameRead, IdentityRecord, IdentityRecordsPort, IdentitySession, InjectedCredential, LaunchApiDeps, LaunchApiRouter, LaunchDecision, LaunchEventPublisher, LaunchLifecycleEvent, LaunchPlan, LaunchPoolDecision, LaunchResolution, LaunchSelection, Layer, LayerId, LayoutPaths, LeafCert, LifecycleApiClient, LifecycleApiDeps, LifecycleApiRouter, LiveSessionRegistry, LiveSessionRegistryPorts, LiveTask, LiveTaskBook, LocatedSession, MergedAgentNode, MergedAgentTree, NestedContribution, OwnExecutableStat, PlanClass, Pool, PoolChange, PoolMember, PoolPickReport, PoolPolicy, 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 };