claude-use 9.5.0 → 9.6.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.
@@ -3499,20 +3499,22 @@ interface RcApiDeps {
3499
3499
  /** The context every procedure on the door's typed API runs in: the request's own headers, which the control-token middleware reads the Bearer credential from. */
3500
3500
  interface DoorApiContext {
3501
3501
  readonly headers: IncomingHttpHeaders;
3502
+ /** Registers an action that runs once the response has been fully written, so a procedure whose effect ends the process serving the call (a door restart) never cuts its own answer off. */
3503
+ readonly afterResponse: (action: () => void) => void;
3502
3504
  }
3503
3505
  /** Builds the middleware every procedure on the door's typed API sits behind, whichever router it belongs to: the per-generation owner-only control token, presented as a Bearer credential and checked in constant time like every other capability the door accepts. */
3504
- declare function doorApiAuth(expectedToken: string): _orpc_server.BuilderWithMiddlewares<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, Schema<unknown, unknown>, Schema<unknown, unknown>, Record<never, never>, Record<never, never>>;
3506
+ declare function doorApiAuth(expectedToken: string): _orpc_server.BuilderWithMiddlewares<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, MergedErrorMap<$ErrorMap, TErrorMap>>;
3505
3507
  /** Builds the typed API's router: one procedure per operation, every one behind the control-token middleware. */
3506
3508
  declare function createRcApiRouter(deps: RcApiDeps): {
3507
3509
  rc: {
3508
- list: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, Schema<unknown, unknown>, zod.ZodObject<{
3510
+ list: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, InitialInputSchema, zod.ZodObject<{
3509
3511
  sessions: zod.ZodReadonly<zod.ZodArray<zod.ZodObject<{
3510
3512
  id: zod.ZodString;
3511
3513
  createdAt: zod.ZodNumber;
3512
3514
  lastSeenAt: zod.ZodNumber;
3513
3515
  }, zod_v4_core.$strict>>>;
3514
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
3515
- status: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
3516
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
3517
+ status: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
3516
3518
  session: zod.ZodOptional<zod.ZodString>;
3517
3519
  }, zod_v4_core.$strict>, zod.ZodObject<{
3518
3520
  statuses: zod.ZodReadonly<zod.ZodArray<zod.ZodObject<{
@@ -3535,8 +3537,8 @@ declare function createRcApiRouter(deps: RcApiDeps): {
3535
3537
  createdAt: zod.ZodNumber;
3536
3538
  lastSeenAt: zod.ZodNumber;
3537
3539
  }, zod_v4_core.$strict>>>;
3538
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
3539
- pending: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
3540
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
3541
+ pending: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
3540
3542
  session: zod.ZodOptional<zod.ZodString>;
3541
3543
  }, zod_v4_core.$strict>, zod.ZodObject<{
3542
3544
  pending: zod.ZodReadonly<zod.ZodArray<zod.ZodObject<{
@@ -3546,15 +3548,15 @@ declare function createRcApiRouter(deps: RcApiDeps): {
3546
3548
  summary: zod.ZodString;
3547
3549
  observedAt: zod.ZodNumber;
3548
3550
  }, zod_v4_core.$strict>>>;
3549
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
3550
- send: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
3551
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
3552
+ send: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
3551
3553
  session: zod.ZodString;
3552
3554
  text: zod.ZodString;
3553
3555
  }, zod_v4_core.$strict>, zod.ZodObject<{
3554
3556
  session: zod.ZodString;
3555
3557
  sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
3556
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
3557
- answer: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
3558
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
3559
+ answer: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
3558
3560
  session: zod.ZodString;
3559
3561
  request: zod.ZodString;
3560
3562
  approve: zod.ZodBoolean;
@@ -3563,23 +3565,23 @@ declare function createRcApiRouter(deps: RcApiDeps): {
3563
3565
  session: zod.ZodString;
3564
3566
  request: zod.ZodString;
3565
3567
  sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
3566
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
3567
- interrupt: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
3568
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
3569
+ interrupt: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
3568
3570
  session: zod.ZodString;
3569
3571
  }, zod_v4_core.$strict>, zod.ZodObject<{
3570
3572
  session: zod.ZodString;
3571
3573
  request: zod.ZodString;
3572
3574
  sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
3573
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
3574
- setModel: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
3575
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
3576
+ setModel: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
3575
3577
  session: zod.ZodString;
3576
3578
  model: zod.ZodString;
3577
3579
  }, zod_v4_core.$strict>, zod.ZodObject<{
3578
3580
  session: zod.ZodString;
3579
3581
  request: zod.ZodString;
3580
3582
  sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
3581
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
3582
- setPermissionMode: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
3583
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
3584
+ setPermissionMode: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
3583
3585
  session: zod.ZodString;
3584
3586
  mode: zod.ZodEnum<{
3585
3587
  default: "default";
@@ -3593,24 +3595,24 @@ declare function createRcApiRouter(deps: RcApiDeps): {
3593
3595
  session: zod.ZodString;
3594
3596
  request: zod.ZodString;
3595
3597
  sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
3596
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
3597
- endSession: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
3598
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
3599
+ endSession: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
3598
3600
  session: zod.ZodString;
3599
3601
  reason: zod.ZodOptional<zod.ZodString>;
3600
3602
  }, zod_v4_core.$strict>, zod.ZodObject<{
3601
3603
  session: zod.ZodString;
3602
3604
  request: zod.ZodString;
3603
3605
  sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
3604
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
3605
- getUsage: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
3606
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
3607
+ getUsage: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
3606
3608
  session: zod.ZodString;
3607
3609
  skipBehaviors: zod.ZodOptional<zod.ZodBoolean>;
3608
3610
  }, zod_v4_core.$strict>, zod.ZodObject<{
3609
3611
  session: zod.ZodString;
3610
3612
  request: zod.ZodString;
3611
3613
  sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
3612
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
3613
- getContextUsage: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
3614
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
3615
+ getContextUsage: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
3614
3616
  session: zod.ZodString;
3615
3617
  detail: zod.ZodOptional<zod.ZodEnum<{
3616
3618
  summary: "summary";
@@ -3620,8 +3622,8 @@ declare function createRcApiRouter(deps: RcApiDeps): {
3620
3622
  session: zod.ZodString;
3621
3623
  request: zod.ZodString;
3622
3624
  sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
3623
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
3624
- readFile: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
3625
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
3626
+ readFile: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
3625
3627
  session: zod.ZodString;
3626
3628
  path: zod.ZodString;
3627
3629
  maxBytes: zod.ZodOptional<zod.ZodNumber>;
@@ -3633,37 +3635,37 @@ declare function createRcApiRouter(deps: RcApiDeps): {
3633
3635
  session: zod.ZodString;
3634
3636
  request: zod.ZodString;
3635
3637
  sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
3636
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
3637
- fileSuggestions: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
3638
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
3639
+ fileSuggestions: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
3638
3640
  session: zod.ZodString;
3639
3641
  query: zod.ZodString;
3640
3642
  }, zod_v4_core.$strict>, zod.ZodObject<{
3641
3643
  session: zod.ZodString;
3642
3644
  request: zod.ZodString;
3643
3645
  sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
3644
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
3645
- keepAlive: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
3646
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
3647
+ keepAlive: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
3646
3648
  session: zod.ZodString;
3647
3649
  }, zod_v4_core.$strict>, zod.ZodObject<{
3648
3650
  session: zod.ZodString;
3649
3651
  sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
3650
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
3651
- mcpStatus: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
3652
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
3653
+ mcpStatus: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
3652
3654
  session: zod.ZodString;
3653
3655
  }, zod_v4_core.$strict>, zod.ZodObject<{
3654
3656
  session: zod.ZodString;
3655
3657
  request: zod.ZodString;
3656
3658
  sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
3657
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
3658
- mcpReconnect: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
3659
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
3660
+ mcpReconnect: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
3659
3661
  session: zod.ZodString;
3660
3662
  serverName: zod.ZodString;
3661
3663
  }, zod_v4_core.$strict>, zod.ZodObject<{
3662
3664
  session: zod.ZodString;
3663
3665
  request: zod.ZodString;
3664
3666
  sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
3665
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
3666
- mcpAuthenticate: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
3667
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
3668
+ mcpAuthenticate: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
3667
3669
  session: zod.ZodString;
3668
3670
  serverName: zod.ZodString;
3669
3671
  redirectUri: zod.ZodString;
@@ -3671,8 +3673,8 @@ declare function createRcApiRouter(deps: RcApiDeps): {
3671
3673
  session: zod.ZodString;
3672
3674
  request: zod.ZodString;
3673
3675
  sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
3674
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
3675
- mcpOAuthCallbackUrl: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
3676
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
3677
+ mcpOAuthCallbackUrl: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
3676
3678
  session: zod.ZodString;
3677
3679
  serverName: zod.ZodString;
3678
3680
  callbackUrl: zod.ZodString;
@@ -3680,17 +3682,17 @@ declare function createRcApiRouter(deps: RcApiDeps): {
3680
3682
  session: zod.ZodString;
3681
3683
  request: zod.ZodString;
3682
3684
  sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
3683
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
3684
- teleport: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
3685
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
3686
+ teleport: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
3685
3687
  session: zod.ZodString;
3686
3688
  marker: zod.ZodString;
3687
3689
  }, zod_v4_core.$strict>, zod.ZodObject<{
3688
3690
  session: zod.ZodString;
3689
3691
  sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
3690
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
3691
- subscribe: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
3692
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
3693
+ subscribe: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
3692
3694
  session: zod.ZodOptional<zod.ZodString>;
3693
- }, zod_v4_core.$strict>, any, Record<never, never>, Record<never, never>>;
3695
+ }, zod_v4_core.$strict>, any, MergedErrorMap<$ErrorMap, TErrorMap>>;
3694
3696
  };
3695
3697
  };
3696
3698
  /** The typed API's router, as the CLI-side client's own type is derived from it. */
@@ -3720,12 +3722,12 @@ declare const CheckReportJsonSchema: z.ZodObject<{
3720
3722
  identity: z.ZodObject<{
3721
3723
  name: z.ZodNullable<z.ZodString>;
3722
3724
  source: z.ZodEnum<{
3725
+ none: "none";
3723
3726
  "config-dir-escape-hatch": "config-dir-escape-hatch";
3724
3727
  argv: "argv";
3725
3728
  env: "env";
3726
3729
  "directory-pin": "directory-pin";
3727
3730
  "active-identity-file": "active-identity-file";
3728
- none: "none";
3729
3731
  }>;
3730
3732
  }, z.core.$strict>;
3731
3733
  pool: z.ZodOptional<z.ZodObject<{
@@ -3773,8 +3775,8 @@ declare const CheckReportJsonSchema: z.ZodObject<{
3773
3775
  name: z.ZodNullable<z.ZodString>;
3774
3776
  source: z.ZodEnum<{
3775
3777
  "directory-rule": "directory-rule";
3776
- env: "env";
3777
3778
  none: "none";
3779
+ env: "env";
3778
3780
  "cli-flag": "cli-flag";
3779
3781
  "identity-default": "identity-default";
3780
3782
  "global-default": "global-default";
@@ -4747,6 +4749,113 @@ declare const UsageSnapshotSchema: z.ZodObject<{
4747
4749
  }, z.core.$strict>;
4748
4750
  type UsageSnapshot = z.infer<typeof UsageSnapshotSchema>;
4749
4751
 
4752
+ /** The record held in one front-door session-registry file: the launcher's pid plus the per-launch capability token its child presents on every request. */
4753
+ declare const FrontDoorSessionSchema: z.ZodObject<{
4754
+ pid: z.ZodNumber;
4755
+ startedAt: z.ZodNumber;
4756
+ token: z.ZodString;
4757
+ }, z.core.$strict>;
4758
+ type FrontDoorSession = z.infer<typeof FrontDoorSessionSchema>;
4759
+ /**
4760
+ * The front-door supervisor's state.json under `<home>/frontdoor/`. Every field is optional because the file exists in stages, exactly like headroom's and the old codex daemon's: a fresh supervisor writes its own pid before the listener is up, and a shut-down front door leaves only the sticky `lastPort` and any `lastError` worth surfacing.
4761
+ */
4762
+ declare const FrontDoorStateSchema: z.ZodObject<{
4763
+ protocol: z.ZodOptional<z.ZodNumber>;
4764
+ supervisorPid: z.ZodOptional<z.ZodNumber>;
4765
+ port: z.ZodOptional<z.ZodNumber>;
4766
+ lastPort: z.ZodOptional<z.ZodNumber>;
4767
+ connectPort: z.ZodOptional<z.ZodNumber>;
4768
+ lastConnectPort: z.ZodOptional<z.ZodNumber>;
4769
+ directPort: z.ZodOptional<z.ZodNumber>;
4770
+ lastDirectPort: z.ZodOptional<z.ZodNumber>;
4771
+ lastError: z.ZodOptional<z.ZodString>;
4772
+ }, z.core.$strict>;
4773
+ type FrontDoorState = z.infer<typeof FrontDoorStateSchema>;
4774
+ /** A registered launch as status and the idle decision see it: the pid and start time, never the token, so nothing that prints or serialises a session can leak the capability. */
4775
+ type FrontDoorSessionSummary = Pick<FrontDoorSession, "pid" | "startedAt">;
4776
+
4777
+ /** How a sign-out went: whether OpenAI was told, so the person knows the grant is dead on its side too. */
4778
+ interface SiwcLogoutResult {
4779
+ readonly hadGrant: boolean;
4780
+ /** True when the refresh token was revoked at the issuer; false when the revocation call failed (the local grant is removed either way). */
4781
+ readonly revoked: boolean;
4782
+ }
4783
+
4784
+ /** One session-registry entry plus whether its launcher is still running. */
4785
+ interface CodexSessionStatus extends FrontDoorSessionSummary {
4786
+ readonly alive: boolean;
4787
+ }
4788
+ /** The Sign in with ChatGPT login's state: no sign-in yet, signed in (with who and when the access token lapses), or a file that cannot be read. */
4789
+ type SignInStatus = {
4790
+ readonly state: "none";
4791
+ } | {
4792
+ readonly state: "signed-in";
4793
+ readonly email: string | undefined;
4794
+ readonly planScope: boolean;
4795
+ readonly accessTokenExpiresAt: number;
4796
+ } | {
4797
+ readonly state: "unreadable";
4798
+ readonly message: string;
4799
+ };
4800
+ /** Everything `agent-shim codex status` reports, collected read-only. */
4801
+ interface CodexStatus {
4802
+ /** The front door's state: the codex translation is one route inside the front-door daemon, so its availability is the front door's. */
4803
+ readonly frontDoor: FrontDoorState;
4804
+ readonly supervisorAlive: boolean;
4805
+ readonly sessions: readonly CodexSessionStatus[];
4806
+ /** The codex provider files this AGENT_SHIM_HOME defines. */
4807
+ readonly codexProviders: readonly string[];
4808
+ /** Where the statusline usage snapshot lives. */
4809
+ /** The Sign in with ChatGPT login a provider with `codex.login: "chatgpt-sign-in"` spends. */
4810
+ readonly signIn: SignInStatus;
4811
+ readonly usageSnapshotPath: string;
4812
+ readonly usageSnapshotExists: boolean;
4813
+ readonly logPath: string;
4814
+ readonly logExists: boolean;
4815
+ }
4816
+
4817
+ /**
4818
+ * The door's Codex sign-in as a typed oRPC API, behind the same per-generation control token as every other procedure on the mount: `codex.status` reports what `agent-shim codex status` reports about the sign-in and the codex providers, and `codex.logout` revokes the Sign in with ChatGPT login and removes it from this machine.
4819
+ *
4820
+ * `codex login` is deliberately not a procedure: the sign-in redirects to a fixed loopback port on the door's host, so a browser on another machine cannot complete it, and a same-host caller has the CLI.
4821
+ */
4822
+ /** Everything the Codex procedures need, injected so they serve against fakes in tests exactly as the door's real wiring serves against this machine. */
4823
+ interface CodexApiDeps {
4824
+ /** This generation's control token: the same value every other router on the mount checks. */
4825
+ readonly expectedToken: string;
4826
+ /** The codex translation's read-only status, as `collectCodexStatus` collects it. */
4827
+ readonly codexStatus: () => CodexStatus;
4828
+ /** Signs out as `agent-shim codex logout` does: revokes the refresh token at the issuer and removes the grant. */
4829
+ readonly codexLogout: () => Promise<SiwcLogoutResult>;
4830
+ }
4831
+ /** Builds the Codex router: `codex.status` and `codex.logout`, every one behind the control-token middleware. */
4832
+ declare function createCodexApiRouter(deps: CodexApiDeps): {
4833
+ codex: {
4834
+ status: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, InitialInputSchema, zod.ZodObject<{
4835
+ signIn: zod.ZodDiscriminatedUnion<[zod.ZodObject<{
4836
+ state: zod.ZodLiteral<"none">;
4837
+ }, zod_v4_core.$strict>, zod.ZodObject<{
4838
+ state: zod.ZodLiteral<"signed-in">;
4839
+ email: zod.ZodOptional<zod.ZodString>;
4840
+ planScope: zod.ZodBoolean;
4841
+ accessTokenExpiresAt: zod.ZodNumber;
4842
+ }, zod_v4_core.$strict>, zod.ZodObject<{
4843
+ state: zod.ZodLiteral<"unreadable">;
4844
+ message: zod.ZodString;
4845
+ }, zod_v4_core.$strict>], "state">;
4846
+ codexProviders: zod.ZodReadonly<zod.ZodArray<zod.ZodString>>;
4847
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
4848
+ logout: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, InitialInputSchema, zod.ZodObject<{
4849
+ hadGrant: zod.ZodBoolean;
4850
+ revoked: zod.ZodBoolean;
4851
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
4852
+ };
4853
+ };
4854
+ /** The Codex router, as the merged mount's and the client's own types are derived from it. */
4855
+ type CodexApiRouter = ReturnType<typeof createCodexApiRouter>;
4856
+ /** The Codex procedures alone as a client sees them. */
4857
+ type CodexApiClient = RouterClient<CodexApiRouter>;
4858
+
4750
4859
  /**
4751
4860
  * The Zod schemas of the door's event backbone: the envelope every source-tagged event carries, the source filter the subscription takes, and the launch lifecycle's own payload family. The backbone's TypeScript shapes in `eventHub.ts` and `launchEvents.ts` stay the implementations' types; these schemas are what the typed API's contract validates through, and because the backbone's publishers produce those interfaces' values, a drift between a schema and its interface fails the API's own output validation (exercised by its tests) rather than shipping silently. This module deliberately imports nothing from oRPC: it is a plain Zod leaf, so the backbone and its publishers can share it without depending on the API layer.
4752
4861
  */
@@ -4904,36 +5013,393 @@ interface DoorEventsApiDeps {
4904
5013
  /** Builds the events router: one streaming procedure behind the control-token middleware. */
4905
5014
  declare function createEventsApiRouter(deps: DoorEventsApiDeps): {
4906
5015
  events: {
4907
- subscribe: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
5016
+ subscribe: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
4908
5017
  sources: zod.ZodOptional<zod.ZodArray<zod.ZodString>>;
4909
- }, zod_v4_core.$strict>, any, Record<never, never>, Record<never, never>>;
5018
+ }, zod_v4_core.$strict>, any, MergedErrorMap<$ErrorMap, TErrorMap>>;
4910
5019
  };
4911
5020
  };
4912
5021
 
4913
- /** The record held in one front-door session-registry file: the launcher's pid plus the per-launch capability token its child presents on every request. */
4914
- declare const FrontDoorSessionSchema: z.ZodObject<{
4915
- pid: z.ZodNumber;
4916
- startedAt: z.ZodNumber;
4917
- token: z.ZodString;
4918
- }, z.core.$strict>;
4919
- type FrontDoorSession = z.infer<typeof FrontDoorSessionSchema>;
5022
+ /** What `agent-shim update` reports: the versions compared and what it did about them. */
5023
+ interface UpdateReport {
5024
+ readonly current: string;
5025
+ readonly latest: string;
5026
+ /** `current` when nothing was needed, `available` when `--check` found a newer release and changed nothing, `updated` when the new binary was installed. */
5027
+ readonly action: "current" | "available" | "updated";
5028
+ }
5029
+
4920
5030
  /**
4921
- * The front-door supervisor's state.json under `<home>/frontdoor/`. Every field is optional because the file exists in stages, exactly like headroom's and the old codex daemon's: a fresh supervisor writes its own pid before the listener is up, and a shut-down front door leaves only the sticky `lastPort` and any `lastError` worth surfacing.
5031
+ * The door's lifecycle operations as a typed oRPC API, behind the same per-generation control token as every other procedure on the mount: `frontdoor.restart` replaces the serving door in place, and `update.check` reports whether a newer release exists, the report `agent-shim update --check` prints.
5032
+ *
5033
+ * Applying an update is deliberately not a procedure: `update --mode auto` already installs releases on launch and restarts the door on every automatic update, so a network trigger would add the most dangerous call in the API (replacing the running program) for a case the mode covers.
4922
5034
  */
4923
- declare const FrontDoorStateSchema: z.ZodObject<{
4924
- protocol: z.ZodOptional<z.ZodNumber>;
4925
- supervisorPid: z.ZodOptional<z.ZodNumber>;
4926
- port: z.ZodOptional<z.ZodNumber>;
4927
- lastPort: z.ZodOptional<z.ZodNumber>;
4928
- connectPort: z.ZodOptional<z.ZodNumber>;
4929
- lastConnectPort: z.ZodOptional<z.ZodNumber>;
4930
- directPort: z.ZodOptional<z.ZodNumber>;
4931
- lastDirectPort: z.ZodOptional<z.ZodNumber>;
4932
- lastError: z.ZodOptional<z.ZodString>;
4933
- }, z.core.$strict>;
4934
- type FrontDoorState = z.infer<typeof FrontDoorStateSchema>;
4935
- /** A registered launch as status and the idle decision see it: the pid and start time, never the token, so nothing that prints or serialises a session can leak the capability. */
4936
- type FrontDoorSessionSummary = Pick<FrontDoorSession, "pid" | "startedAt">;
5035
+ /** Everything the lifecycle procedures need, injected so they serve against fakes in tests exactly as the door's real wiring serves against this machine. */
5036
+ interface LifecycleApiDeps {
5037
+ /** This generation's control token: the same value every other router on the mount checks. */
5038
+ readonly expectedToken: string;
5039
+ /** The pid of the door process serving the call, which is the generation a restart replaces. */
5040
+ readonly doorPid: number;
5041
+ /** Replaces the serving door in place. The replacement ends the process answering the call, so the procedure runs this only once its own answer has been written. */
5042
+ readonly restartDoor: () => void;
5043
+ /** The update check as `agent-shim update --check` makes it: nothing is downloaded or changed. */
5044
+ readonly checkForUpdate: () => Promise<UpdateReport>;
5045
+ }
5046
+ /** Builds the lifecycle routers: `frontdoor.restart` and `update.check`, every one behind the control-token middleware. */
5047
+ declare function createLifecycleApiRouter(deps: LifecycleApiDeps): {
5048
+ frontdoor: {
5049
+ restart: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, InitialInputSchema, zod.ZodObject<{
5050
+ action: zod.ZodLiteral<"restarting">;
5051
+ previousPid: zod.ZodInt;
5052
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
5053
+ };
5054
+ update: {
5055
+ check: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, InitialInputSchema, zod.ZodObject<{
5056
+ current: zod.ZodString;
5057
+ latest: zod.ZodString;
5058
+ action: zod.ZodEnum<{
5059
+ current: "current";
5060
+ available: "available";
5061
+ updated: "updated";
5062
+ }>;
5063
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
5064
+ };
5065
+ };
5066
+ /** The lifecycle routers, as the merged mount's and the client's own types are derived from them. */
5067
+ type LifecycleApiRouter = ReturnType<typeof createLifecycleApiRouter>;
5068
+ /** The lifecycle procedures alone as a client sees them. */
5069
+ type LifecycleApiClient = RouterClient<LifecycleApiRouter>;
5070
+
5071
+ /** What a launch's one-off command-line/environment overrides resolve to: the `cliOverride` layer `src/resolve/walk.ts`'s `assembleCascade` composes last, so it beats every other layer. */
5072
+ interface CliOverride {
5073
+ readonly categories?: CategoryMap;
5074
+ readonly entries?: Entries;
5075
+ readonly launch?: {
5076
+ readonly provider?: string;
5077
+ };
5078
+ }
5079
+
5080
+ /** The fully resolved launch flags for one launch. */
5081
+ interface ResolvedLaunchFlags {
5082
+ readonly skipPermissions: boolean;
5083
+ readonly remoteControl: boolean;
5084
+ readonly headroom: boolean;
5085
+ /** Whether the launch routes through the front door so its requests are recorded, even with no provider and no headroom. */
5086
+ readonly trackUsage: boolean;
5087
+ }
5088
+
5089
+ /**
5090
+ * Everything the launch-time update check needs from its host, injected so tests run it against scripted answers and no launch ever reaches GitHub by accident. Deliberately narrower than `UpdatePorts`: the launch path never downloads anything (the detached `agent-shim update` does), so only the release check, the cooldown stamp, the clock, the background spawn and the terminal are wired.
5091
+ */
5092
+ interface UpdateLaunchPort {
5093
+ /** Resolves the URL the `releases/latest` redirect lands on, exactly as `agent-shim update` resolves the newest version. */
5094
+ readonly effectiveUrl: (url: string) => Promise<string>;
5095
+ /** Reads the cooldown stamp, or undefined when it does not exist. */
5096
+ readonly readStamp: (filePath: string) => string | undefined;
5097
+ /** Writes the cooldown stamp atomically: a reader either sees the previous whole stamp or the new one, never a partial write. */
5098
+ readonly writeStamp: (filePath: string, contents: string) => void;
5099
+ /** The clock the cooldown reads, in epoch milliseconds. */
5100
+ readonly now: () => number;
5101
+ /** Re-invokes this very binary with `args` as a detached child whose stdio is ignored and which is unref'd, so it outlives the launch and never holds the terminal. */
5102
+ readonly spawnDetached: (args: readonly string[]) => void;
5103
+ /** Writes one line to the launching terminal's stderr. */
5104
+ readonly writeErr: (line: string) => void;
5105
+ }
5106
+
5107
+ /**
5108
+ * Everything the farm resync needs that the launcher itself has no way to produce: a real filesystem, a real clock, the working directory, and a way to load the cascade for it.
5109
+ *
5110
+ * Supplied by `src/cli.ts` in normal operation. A caller that omits it launches with no farm at all, which is the right behaviour in exactly the cases where there is no agent-shim-managed farm to resync — and is what the launcher's own pre-farm tests exercise.
5111
+ */
5112
+ interface FarmRuntime {
5113
+ readonly fs: FarmFs;
5114
+ /** The canonical `~/.claude` every farm symlink points back into. */
5115
+ readonly claudeHome: string;
5116
+ readonly home: string;
5117
+ readonly cwd: string;
5118
+ /** The git branch at `cwd`, for `when: { branch }` conditions. Undefined when `cwd` is not in a repository. */
5119
+ readonly branch?: string;
5120
+ readonly branchDetached?: boolean;
5121
+ readonly classification: {
5122
+ readonly defaults: CategoryClassification;
5123
+ readonly overlay?: CategoryClassificationOverlay;
5124
+ };
5125
+ /** Loads and assembles the cascade for `cwd` under the given configuration profile and one-off command-line/environment overrides. Injected so the launcher never reads a config file itself. */
5126
+ readonly loadCascade: (baseConfigProfile: string | undefined, cliOverride: CliOverride | undefined) => CascadeInput;
5127
+ readonly now: () => number;
5128
+ /** Distinguishes this process's scratch and superseded farm directories from any other's. */
5129
+ readonly uniqueSuffix: string;
5130
+ readonly lock: {
5131
+ readonly pid: number;
5132
+ readonly isRunning: (pid: number) => boolean;
5133
+ readonly sleep: (ms: number) => void;
5134
+ readonly staleAfterMs?: number;
5135
+ readonly retryDelayMs?: number;
5136
+ readonly maxAttempts?: number;
5137
+ };
5138
+ }
5139
+ /** Inputs to `prepareLaunch`: everything a launch needs except the means of spawning the child. */
5140
+ interface PrepareLaunchParams {
5141
+ readonly paths: LayoutPaths;
5142
+ readonly fs: FsPort;
5143
+ readonly proc: ProcPort;
5144
+ readonly log: LogPort;
5145
+ /** Discovers the real `claude` binary to spawn. Injected so `runLauncher` never depends on `src/versionDiscovery.ts`'s own filesystem/PATH inputs directly — the caller (`src/cli.ts`) wires the real discovery, tests wire a fake that returns a fixed path. */
5146
+ readonly resolveClaudeBinary: ClaudeBinaryResolver;
5147
+ /** An identity pinned to `$PWD` by a directory rule. Accepted as an already-resolved value — the rules-loading code that produces it lands in Phase 4/5. */
5148
+ readonly directoryPinnedIdentity?: string;
5149
+ /** A directory rule's `configProfile` selection for `$PWD`. Accepted as an already-resolved value for the same reason. */
5150
+ readonly directoryRuleConfigProfile?: string;
5151
+ /** An explicit `--config-profile` value, when the caller wants to force one regardless of argv — normal operation instead relies on `parseLauncherArgv` finding `--config-profile` in `proc.argv` itself, so this is only needed to override that. */
5152
+ readonly cliFlagConfigProfile?: string;
5153
+ /** The user-global `~/.agent-shim/config.json` default configuration profile, when one is configured. */
5154
+ readonly globalDefaultConfigProfile?: string;
5155
+ /** The user-global `pools`, which a `pool:<name>` selector picks a member of. */
5156
+ readonly pools?: Readonly<Record<string, Pool>>;
5157
+ /** Wires the farm resync. Omitted only by a caller that has no farm to manage. */
5158
+ readonly farm?: FarmRuntime;
5159
+ /** Wires headroom routing. Omitted by a caller that cannot route through the daemon; a launch that resolves `headroom` on with no port wired is refused loudly rather than silently bypassing it. */
5160
+ readonly headroom?: HeadroomPort;
5161
+ /** Wires the front-door daemon. Omitted by a caller that cannot run it; a launch that routes anything (a provider, or headroom) with no port wired is refused rather than started against an address nothing serves. */
5162
+ readonly frontdoor?: FrontDoorPort;
5163
+ /** Resolves credential blocks (a provider's, or the launching identity's own). Omitted by a caller that cannot read secret files or run commands; a launch that needs a credential is then refused rather than started without it. */
5164
+ readonly credentials?: CredentialPort;
5165
+ /** True when the user was asked on a terminal whether to create the selected configuration profile and chose to launch without it. Without that explicit choice, a selected profile with no file is refused rather than silently skipped. */
5166
+ readonly allowMissingConfigProfile?: boolean;
5167
+ /** The user-global `update.mode`, resolved from the same global config the launcher already loads. Absent means `off`, and `off` runs no launch-time update check at all. */
5168
+ readonly updateMode?: UpdateMode;
5169
+ /** Wires the launch-time update check behind `update.mode`. Omitted by a caller that cannot resolve releases, re-invoke this binary, or write to the terminal; a mode of `notify` or `auto` with no port wired simply checks nothing. */
5170
+ readonly update?: UpdateLaunchPort;
5171
+ }
5172
+ /** Inputs to `runLauncher`: a launch's inputs plus the port that spawns the child. */
5173
+ interface RunLauncherParams extends PrepareLaunchParams {
5174
+ readonly spawn: SpawnPort;
5175
+ }
5176
+ /** The pick a pool made for a launch: the pool, why the ranking chose the member it did, and, for a resumed conversation, the member it left. */
5177
+ interface LaunchPoolDecision {
5178
+ /** The pool the launch selected with `pool:<name>`. */
5179
+ readonly name: string;
5180
+ /** Every reason the ranking gave for the chosen member, in the ranking's order. */
5181
+ readonly reasons: readonly string[];
5182
+ /** The member a resumed conversation left, and why the ranking could not keep it. */
5183
+ readonly movedOff?: {
5184
+ readonly identity: string;
5185
+ readonly reason: string;
5186
+ };
5187
+ }
5188
+ /**
5189
+ * What a launch resolved to, and where each decision came from. Everything here is a name or a path, never a credential.
5190
+ */
5191
+ interface LaunchDecision {
5192
+ /** The identity the launch runs as. Absent when the escape hatch applied or nothing resolved one. */
5193
+ readonly identity?: string;
5194
+ /** Which precedence rule selected the identity (or the pool the identity was picked from). */
5195
+ readonly identitySource: IdentityDecisionSource;
5196
+ /** The pool pick behind `identity`, when the launch selected a pool. */
5197
+ readonly pool?: LaunchPoolDecision;
5198
+ /** True when `CLAUDE_CONFIG_DIR` was already set, so no identity was resolved and no farm was managed. */
5199
+ readonly configDirEscapeHatch: boolean;
5200
+ /** The configuration directory the child runs with: the identity's own, or the one the caller named. Absent when none is set. */
5201
+ readonly configDir?: string;
5202
+ /** The configuration profile that applied, when one did. */
5203
+ readonly configProfile?: string;
5204
+ /** Which precedence rule selected the configuration profile. */
5205
+ readonly configProfileSource: ConfigProfileDecisionSource;
5206
+ /** The provider the launch routes through, when it selected one. */
5207
+ readonly provider?: string;
5208
+ }
5209
+ /**
5210
+ * What one launch resolved to, once every effect its child depends on is in place (the identity's farm resynced, the front door and headroom up and this launch registered with them): the real binary, its arguments and its environment.
5211
+ */
5212
+ interface LaunchPlan {
5213
+ readonly bin: string;
5214
+ readonly args: readonly string[];
5215
+ readonly env: Readonly<Record<string, string | undefined>>;
5216
+ /** Releases the daemon session registrations this launch holds. Call it when the child has exited; it is safe to call more than once. */
5217
+ readonly release: () => void;
5218
+ /** What the launch resolved to, as data: the facts the launcher's decision line reports. */
5219
+ readonly decision: LaunchDecision;
5220
+ /** Marks the moment this plan's child is spawned: the launch-time update check suppresses its notify line from then on, since a line printed after the child took over the terminal would land mid-session. Call it immediately before spawning; it is safe to call more than once. */
5221
+ readonly markChildStarted: () => void;
5222
+ }
5223
+ /**
5224
+ * Prepares one `claude` launch, in order:
5225
+ *
5226
+ * `CLAUDE_CONFIG_DIR` escape-hatch check, then the identity/config-profile decision, the provider decision, the identity's own credential, the ambient-credential guard, the config-gated launch-time update check (fired after the decision line and never awaited; see `runLaunchUpdateCheck`), farm resync, version discovery, flag resolution (and, when headroom resolved on, daemon bring-up), the extra-flags split, and the final argument list and environment, returned as a `LaunchPlan` for the caller to spawn. It refuses through `params.proc.exit`, so a caller that is not a command line process passes a `proc` whose `exit` throws.
5227
+ *
5228
+ * A launch that resolves an identity with no `identity.json`, or a configuration profile with no file, is refused with exit 1 naming the missing name and how it was selected: silently proceeding would create a brand-new login for a mistyped `@name`, or launch with a whole cascade layer missing. On a terminal, `src/runClaude.ts` offers to create either before this runs.
5229
+ *
5230
+ * The farm resync is skipped when `CLAUDE_CONFIG_DIR` was already set (the escape hatch means the user has named a configuration directory explicitly, and agent-shim manages neither its contents nor its lifetime) and when no identity resolved at all (a bare launch against plain `~/.claude`, matching the legacy tool's own behaviour). In both cases there is no agent-shim-managed farm for a resync to act on.
5231
+ */
5232
+ declare function prepareLaunch(params: PrepareLaunchParams): LaunchPlan;
5233
+ /**
5234
+ * What one launch would resolve to, reported without performing it: the decision, the resolved launch flags, the binary and argument list, the credential that would apply (by its block, never a token) and the names of the environment variables the launch would set.
5235
+ */
5236
+ interface LaunchResolution {
5237
+ /** What the launch resolved to, as data: the same decision a real launch reports. */
5238
+ readonly decision: LaunchDecision;
5239
+ /** The launch flags after the command line, the environment and the cascade have each had their say. */
5240
+ readonly flags: ResolvedLaunchFlags;
5241
+ /** The Claude Code version the launch pins, and what pinned it, when it pins one. */
5242
+ readonly claudeVersion?: PinnedClaudeVersion;
5243
+ /** The real `claude` binary the launch would spawn. */
5244
+ readonly bin: string;
5245
+ /** The arguments the launch would pass it. */
5246
+ readonly args: readonly string[];
5247
+ /** The credential the launch would authenticate with, summarised by target and source kinds. Absent when none applies. */
5248
+ readonly credential?: {
5249
+ readonly subject: "provider" | "identity";
5250
+ readonly name: string;
5251
+ readonly summary: CredentialSummary;
5252
+ };
5253
+ /** Which daemons the launch would route through. */
5254
+ readonly routing: {
5255
+ readonly frontDoor: boolean;
5256
+ readonly headroom: boolean;
5257
+ };
5258
+ /** The names of the environment variables the launch would set or unset, sorted. Values are never reported: the launcher's environment carries tokens and per-launch capabilities that mean nothing outside it. */
5259
+ readonly environment: readonly string[];
5260
+ }
5261
+ /**
5262
+ * Resolves one launch exactly as `prepareLaunch` decides it and reports the result, changing nothing: no farm recovery or resync, no daemon started or session registered, no pool pick recorded or waited for, no credential command run or token read.
5263
+ *
5264
+ * Refusals surface as `prepareLaunch` surfaces them: logged through `params.log` and ended in `params.proc.exit`.
5265
+ */
5266
+ declare function resolveLaunch(params: PrepareLaunchParams): LaunchResolution;
5267
+ /**
5268
+ * Runs the child a `plan` describes under `spawn` and returns its exit code, in the order every launch observes: the update check's notice is suppressed from the moment the child takes the terminal, the child runs to completion, and the plan's session registrations are released whether it exited, was signalled or could not be spawned. A spawn failure is thrown after the release rather than turned into an exit code.
5269
+ */
5270
+ declare function runLaunchPlan(plan: LaunchPlan, spawn: SpawnPort): number;
5271
+ /**
5272
+ * Runs one `claude` launch: `prepareLaunch`, then the child under `params.spawn`, whose exit code becomes this process's.
5273
+ *
5274
+ * The session registrations are released by `runLaunchPlan` before `proc.exit` runs, because the real `process.exit` never unwinds a `finally` block.
5275
+ */
5276
+ declare function runLauncher(params: RunLauncherParams): void;
5277
+
5278
+ /**
5279
+ * The door's launch resolution as a typed oRPC API: what a launch from one directory would resolve to, as data, so a consumer that picks identities and spawns sessions elsewhere can ask the door for the decision without running the launcher.
5280
+ *
5281
+ * `launch.resolve` is the launcher's own decision (identity, pool pick, configuration profile, provider, launch flags, pinned version, binary and arguments) with its effects left out: nothing is spawned, the farm is not touched, no daemon is started or session registered, no pool pick is recorded, and no credential is resolved, so the answer names a credential by its block and never carries a token. It spawns nothing by design: a procedure that starts a process on the door's host with caller-chosen arguments is remote command execution, so the consumer spawns from the answer on its own host.
5282
+ */
5283
+ /** Everything the launch procedures need, injected so they serve against fakes in tests exactly as the door's real wiring serves against this machine. */
5284
+ interface LaunchApiDeps {
5285
+ /** This generation's control token: the same value every router on the mount checks. */
5286
+ readonly expectedToken: string;
5287
+ /** Resolves one launch from a directory without performing it, returning the resolution and the warnings it raised. A refusal is thrown as the launcher raises it (a `CliError`). */
5288
+ readonly resolveLaunch: (request: {
5289
+ readonly path: string;
5290
+ readonly argv: readonly string[];
5291
+ readonly env: Readonly<Record<string, string>>;
5292
+ }) => {
5293
+ readonly resolution: LaunchResolution;
5294
+ readonly warnings: readonly string[];
5295
+ };
5296
+ }
5297
+ /** Builds the launch router: one read, behind the control-token middleware. */
5298
+ declare function createLaunchApiRouter(deps: LaunchApiDeps): {
5299
+ launch: {
5300
+ resolve: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
5301
+ path: zod.ZodString;
5302
+ argv: zod.ZodOptional<zod.ZodReadonly<zod.ZodArray<zod.ZodString>>>;
5303
+ env: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodString>>;
5304
+ }, zod_v4_core.$strict>, zod.ZodObject<{
5305
+ decision: zod.ZodObject<{
5306
+ identity: zod.ZodOptional<zod.ZodString>;
5307
+ identitySource: zod.ZodEnum<{
5308
+ none: "none";
5309
+ "config-dir-escape-hatch": "config-dir-escape-hatch";
5310
+ argv: "argv";
5311
+ env: "env";
5312
+ "directory-pin": "directory-pin";
5313
+ "active-identity-file": "active-identity-file";
5314
+ }>;
5315
+ pool: zod.ZodOptional<zod.ZodObject<{
5316
+ name: zod.ZodString;
5317
+ reasons: zod.ZodReadonly<zod.ZodArray<zod.ZodString>>;
5318
+ movedOff: zod.ZodOptional<zod.ZodObject<{
5319
+ identity: zod.ZodString;
5320
+ reason: zod.ZodString;
5321
+ }, zod_v4_core.$strict>>;
5322
+ }, zod_v4_core.$strict>>;
5323
+ configDirEscapeHatch: zod.ZodBoolean;
5324
+ configDir: zod.ZodOptional<zod.ZodString>;
5325
+ configProfile: zod.ZodOptional<zod.ZodString>;
5326
+ configProfileSource: zod.ZodEnum<{
5327
+ "directory-rule": "directory-rule";
5328
+ none: "none";
5329
+ env: "env";
5330
+ "cli-flag": "cli-flag";
5331
+ "identity-default": "identity-default";
5332
+ "global-default": "global-default";
5333
+ }>;
5334
+ provider: zod.ZodOptional<zod.ZodString>;
5335
+ }, zod_v4_core.$strict>;
5336
+ flags: zod.ZodObject<{
5337
+ skipPermissions: zod.ZodBoolean;
5338
+ remoteControl: zod.ZodBoolean;
5339
+ headroom: zod.ZodBoolean;
5340
+ trackUsage: zod.ZodBoolean;
5341
+ }, zod_v4_core.$strict>;
5342
+ claudeVersion: zod.ZodOptional<zod.ZodObject<{
5343
+ version: zod.ZodString;
5344
+ source: zod.ZodEnum<{
5345
+ flag: "flag";
5346
+ environment: "environment";
5347
+ cascade: "cascade";
5348
+ }>;
5349
+ }, zod_v4_core.$strict>>;
5350
+ bin: zod.ZodString;
5351
+ args: zod.ZodReadonly<zod.ZodArray<zod.ZodString>>;
5352
+ credential: zod.ZodOptional<zod.ZodObject<{
5353
+ subject: zod.ZodEnum<{
5354
+ identity: "identity";
5355
+ provider: "provider";
5356
+ }>;
5357
+ name: zod.ZodString;
5358
+ summary: zod.ZodObject<{
5359
+ target: zod.ZodEnum<{
5360
+ bearer: "bearer";
5361
+ apiKey: "apiKey";
5362
+ oauthToken: "oauthToken";
5363
+ }>;
5364
+ sources: zod.ZodReadonly<zod.ZodArray<zod.ZodUnion<readonly [zod.ZodObject<{
5365
+ kind: zod.ZodLiteral<"env">;
5366
+ variable: zod.ZodString;
5367
+ }, zod_v4_core.$strict>, zod.ZodObject<{
5368
+ kind: zod.ZodLiteral<"file">;
5369
+ path: zod.ZodString;
5370
+ }, zod_v4_core.$strict>, zod.ZodObject<{
5371
+ kind: zod.ZodLiteral<"command">;
5372
+ program: zod.ZodString;
5373
+ }, zod_v4_core.$strict>, zod.ZodObject<{
5374
+ kind: zod.ZodLiteral<"op">;
5375
+ reference: zod.ZodString;
5376
+ }, zod_v4_core.$strict>, zod.ZodObject<{
5377
+ kind: zod.ZodLiteral<"keychain">;
5378
+ service: zod.ZodString;
5379
+ account: zod.ZodOptional<zod.ZodString>;
5380
+ }, zod_v4_core.$strict>, zod.ZodObject<{
5381
+ kind: zod.ZodLiteral<"literal">;
5382
+ }, zod_v4_core.$strict>]>>>;
5383
+ cache: zod.ZodOptional<zod.ZodObject<{
5384
+ ttl: zod.ZodOptional<zod.ZodString>;
5385
+ store: zod.ZodOptional<zod.ZodEnum<{
5386
+ file: "file";
5387
+ keychain: "keychain";
5388
+ }>>;
5389
+ }, zod_v4_core.$strict>>;
5390
+ }, zod_v4_core.$strict>;
5391
+ }, zod_v4_core.$strict>>;
5392
+ routing: zod.ZodObject<{
5393
+ frontDoor: zod.ZodBoolean;
5394
+ headroom: zod.ZodBoolean;
5395
+ }, zod_v4_core.$strict>;
5396
+ environment: zod.ZodReadonly<zod.ZodArray<zod.ZodString>>;
5397
+ warnings: zod.ZodReadonly<zod.ZodArray<zod.ZodString>>;
5398
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
5399
+ };
5400
+ };
5401
+ /** The launch router, as the merged mount's and the client's own types are derived from it. */
5402
+ type LaunchApiRouter = ReturnType<typeof createLaunchApiRouter>;
4937
5403
 
4938
5404
  /**
4939
5405
  * The front door's read-only status: the data `agent-shim frontdoor status` prints and the door's own typed `frontdoor.status` procedure returns, collected without starting or stopping anything. Kept here, beside the state file and session registry it reads, so both the command layer and the typed API's schema layer share one shape and one collector with no dependency on the CLI's command wiring.
@@ -4969,7 +5435,7 @@ declare function formatFrontDoorStatus(status: FrontDoorStatus, caCertPath: stri
4969
5435
  * - `check.run` and `doctor.run` return the reports `agent-shim check` and `agent-shim doctor` print, as data, `check.run` parameterised by an absolute directory path.
4970
5436
  * - `pool.pick` returns what `agent-shim pool pick` prints, the ranked pick for one pool exactly as a launch from the named absolute directory would make it right now, so a programmatic consumer can ask which identity to use without reading the door host's files.
4971
5437
  *
4972
- * Read-only by design: identity, configuration-profile, provider, pool and directory-rule management stay CLI-side, and adding writes over this mount is a decision of its own rather than a gap here. `createDoorApiNodeHandler` mounts these routers and the door-wide `events.subscribe` router beside the Remote Control router on the one prefix the provider listener already serves, so a consumer dials one address with one token for the whole door.
5438
+ * This router is reads only; the door's writes live in routers of their own so each is a decision of its own (`lifecycleApi.ts` for the restart and the update check, `codexApi.ts` for the Codex sign-in), and identity, configuration-profile, provider, pool and directory-rule management stay CLI-side. `createDoorApiNodeHandler` mounts these routers and the door-wide `events.subscribe` router beside the Remote Control router on the one prefix the provider listener already serves, so a consumer dials one address with one token for the whole door.
4973
5439
  */
4974
5440
  /** Everything the control-plane procedures need, injected so they serve against fakes in tests exactly as the door's real wiring serves against this machine. */
4975
5441
  interface ControlApiDeps {
@@ -5001,7 +5467,7 @@ interface ControlApiDeps {
5001
5467
  /** Builds the control-plane routers: one procedure per read, every one behind the control-token middleware. */
5002
5468
  declare function createControlApiRouter(deps: ControlApiDeps): {
5003
5469
  usage: {
5004
- list: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, Schema<unknown, unknown>, zod.ZodObject<{
5470
+ list: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, InitialInputSchema, zod.ZodObject<{
5005
5471
  snapshots: zod.ZodReadonly<zod.ZodArray<zod.ZodObject<{
5006
5472
  schemaVersion: zod.ZodLiteral<1>;
5007
5473
  identity: zod.ZodString;
@@ -5095,8 +5561,8 @@ declare function createControlApiRouter(deps: ControlApiDeps): {
5095
5561
  }, zod_v4_core.$strict>>;
5096
5562
  }, zod_v4_core.$strict>>;
5097
5563
  }, zod_v4_core.$strict>>>;
5098
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
5099
- effectiveWindow: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
5564
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
5565
+ effectiveWindow: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
5100
5566
  identity: zod.ZodString;
5101
5567
  provider: zod.ZodOptional<zod.ZodString>;
5102
5568
  }, zod_v4_core.$strict>, zod.ZodObject<{
@@ -5115,8 +5581,8 @@ declare function createControlApiRouter(deps: ControlApiDeps): {
5115
5581
  resetsAtMs: zod.ZodOptional<zod.ZodNumber>;
5116
5582
  status: zod.ZodOptional<zod.ZodString>;
5117
5583
  }, zod_v4_core.$strict>>;
5118
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
5119
- live: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
5584
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
5585
+ live: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
5120
5586
  session: zod.ZodOptional<zod.ZodString>;
5121
5587
  }, zod_v4_core.$strict>, zod.ZodObject<{
5122
5588
  latest: zod.ZodOptional<zod.ZodObject<{
@@ -5173,10 +5639,10 @@ declare function createControlApiRouter(deps: ControlApiDeps): {
5173
5639
  }, zod_v4_core.$loose>>;
5174
5640
  }, zod_v4_core.$loose>;
5175
5641
  }, zod_v4_core.$strict>>>;
5176
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
5642
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
5177
5643
  };
5178
5644
  frontdoor: {
5179
- status: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, Schema<unknown, unknown>, zod.ZodObject<{
5645
+ status: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, InitialInputSchema, zod.ZodObject<{
5180
5646
  state: zod.ZodObject<{
5181
5647
  protocol: zod.ZodOptional<zod.ZodNumber>;
5182
5648
  supervisorPid: zod.ZodOptional<zod.ZodNumber>;
@@ -5201,29 +5667,29 @@ declare function createControlApiRouter(deps: ControlApiDeps): {
5201
5667
  }, zod_v4_core.$strict>]>>;
5202
5668
  logPath: zod.ZodString;
5203
5669
  logExists: zod.ZodBoolean;
5204
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
5205
- sessions: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, Schema<unknown, unknown>, zod.ZodObject<{
5670
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
5671
+ sessions: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, InitialInputSchema, zod.ZodObject<{
5206
5672
  sessions: zod.ZodReadonly<zod.ZodArray<zod.ZodObject<{
5207
5673
  pid: zod.ZodInt;
5208
5674
  startedAt: zod.ZodNumber;
5209
5675
  alive: zod.ZodBoolean;
5210
5676
  }, zod_v4_core.$strict>>>;
5211
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
5677
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
5212
5678
  };
5213
5679
  check: {
5214
- run: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
5680
+ run: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
5215
5681
  path: zod.ZodString;
5216
5682
  identity: zod.ZodOptional<zod.ZodString>;
5217
5683
  }, zod_v4_core.$strict>, zod.ZodObject<{
5218
5684
  identity: zod.ZodObject<{
5219
5685
  name: zod.ZodNullable<zod.ZodString>;
5220
5686
  source: zod.ZodEnum<{
5687
+ none: "none";
5221
5688
  "config-dir-escape-hatch": "config-dir-escape-hatch";
5222
5689
  argv: "argv";
5223
5690
  env: "env";
5224
5691
  "directory-pin": "directory-pin";
5225
5692
  "active-identity-file": "active-identity-file";
5226
- none: "none";
5227
5693
  }>;
5228
5694
  }, zod_v4_core.$strict>;
5229
5695
  pool: zod.ZodOptional<zod.ZodObject<{
@@ -5271,8 +5737,8 @@ declare function createControlApiRouter(deps: ControlApiDeps): {
5271
5737
  name: zod.ZodNullable<zod.ZodString>;
5272
5738
  source: zod.ZodEnum<{
5273
5739
  "directory-rule": "directory-rule";
5274
- env: "env";
5275
5740
  none: "none";
5741
+ env: "env";
5276
5742
  "cli-flag": "cli-flag";
5277
5743
  "identity-default": "identity-default";
5278
5744
  "global-default": "global-default";
@@ -5514,10 +5980,10 @@ declare function createControlApiRouter(deps: ControlApiDeps): {
5514
5980
  highestInstalled: zod.ZodOptional<zod.ZodString>;
5515
5981
  installed: zod.ZodReadonly<zod.ZodArray<zod.ZodString>>;
5516
5982
  }, zod_v4_core.$strict>>;
5517
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
5983
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
5518
5984
  };
5519
5985
  doctor: {
5520
- run: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, Schema<unknown, unknown>, zod.ZodObject<{
5986
+ run: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, InitialInputSchema, zod.ZodObject<{
5521
5987
  ok: zod.ZodBoolean;
5522
5988
  findings: zod.ZodReadonly<zod.ZodArray<zod.ZodObject<{
5523
5989
  section: zod.ZodEnum<{
@@ -5526,12 +5992,12 @@ declare function createControlApiRouter(deps: ControlApiDeps): {
5526
5992
  identity: "identity";
5527
5993
  provider: "provider";
5528
5994
  pool: "pool";
5529
- keychain: "keychain";
5530
5995
  "ambient-credential": "ambient-credential";
5531
5996
  "binary-discovery": "binary-discovery";
5532
5997
  "claude-shim": "claude-shim";
5533
5998
  "path-resolution": "path-resolution";
5534
5999
  "legacy-name": "legacy-name";
6000
+ keychain: "keychain";
5535
6001
  "directory-rules": "directory-rules";
5536
6002
  "categories-local": "categories-local";
5537
6003
  "active-identity": "active-identity";
@@ -5545,10 +6011,10 @@ declare function createControlApiRouter(deps: ControlApiDeps): {
5545
6011
  }>;
5546
6012
  message: zod.ZodString;
5547
6013
  }, zod_v4_core.$strict>>>;
5548
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
6014
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
5549
6015
  };
5550
6016
  pool: {
5551
- pick: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
6017
+ pick: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
5552
6018
  pool: zod.ZodString;
5553
6019
  path: zod.ZodString;
5554
6020
  }, zod_v4_core.$strict>, zod.ZodObject<{
@@ -5591,7 +6057,7 @@ declare function createControlApiRouter(deps: ControlApiDeps): {
5591
6057
  reason: zod.ZodString;
5592
6058
  }, zod_v4_core.$strict>>;
5593
6059
  stickyProblem: zod.ZodOptional<zod.ZodString>;
5594
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
6060
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
5595
6061
  };
5596
6062
  };
5597
6063
  /** The control-plane routers, as the merged mount's and the client's own types are derived from them. */
@@ -5599,17 +6065,188 @@ type ControlApiRouter = ReturnType<typeof createControlApiRouter>;
5599
6065
  /** The control plane alone as a client sees it: every call presents the control token, over TLS trusting only the CA file the door's own state names. */
5600
6066
  type ControlApiClient = RouterClient<ControlApiRouter>;
5601
6067
  /** Everything the door's whole typed API needs: the Remote Control operations, the control-plane reads and the door-wide event stream, one deps object because one mount serves them under one token. */
5602
- interface DoorApiDeps extends RcApiDeps, ControlApiDeps, DoorEventsApiDeps {
6068
+ interface DoorApiDeps extends RcApiDeps, ControlApiDeps, DoorEventsApiDeps, LifecycleApiDeps, CodexApiDeps, LaunchApiDeps {
5603
6069
  }
5604
6070
  /** Builds the door's whole typed API: the Remote Control router, the control-plane routers and the events router beside them, one object for the one handler the provider listener mounts. */
5605
6071
  declare function createDoorApiRouter(deps: DoorApiDeps): {
6072
+ frontdoor: {
6073
+ restart: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, InitialInputSchema, zod.ZodObject<{
6074
+ action: zod.ZodLiteral<"restarting">;
6075
+ previousPid: zod.ZodInt;
6076
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
6077
+ status: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, InitialInputSchema, zod.ZodObject<{
6078
+ state: zod.ZodObject<{
6079
+ protocol: zod.ZodOptional<zod.ZodNumber>;
6080
+ supervisorPid: zod.ZodOptional<zod.ZodNumber>;
6081
+ port: zod.ZodOptional<zod.ZodNumber>;
6082
+ lastPort: zod.ZodOptional<zod.ZodNumber>;
6083
+ connectPort: zod.ZodOptional<zod.ZodNumber>;
6084
+ lastConnectPort: zod.ZodOptional<zod.ZodNumber>;
6085
+ directPort: zod.ZodOptional<zod.ZodNumber>;
6086
+ lastDirectPort: zod.ZodOptional<zod.ZodNumber>;
6087
+ lastError: zod.ZodOptional<zod.ZodString>;
6088
+ }, zod_v4_core.$strict>;
6089
+ supervisorAlive: zod.ZodBoolean;
6090
+ sessions: zod.ZodReadonly<zod.ZodArray<zod.ZodObject<{
6091
+ pid: zod.ZodInt;
6092
+ startedAt: zod.ZodNumber;
6093
+ alive: zod.ZodBoolean;
6094
+ }, zod_v4_core.$strict>>>;
6095
+ headroomSocket: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodObject<{
6096
+ socketPath: zod.ZodString;
6097
+ }, zod_v4_core.$strict>, zod.ZodObject<{
6098
+ refused: zod.ZodString;
6099
+ }, zod_v4_core.$strict>]>>;
6100
+ logPath: zod.ZodString;
6101
+ logExists: zod.ZodBoolean;
6102
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
6103
+ sessions: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, InitialInputSchema, zod.ZodObject<{
6104
+ sessions: zod.ZodReadonly<zod.ZodArray<zod.ZodObject<{
6105
+ pid: zod.ZodInt;
6106
+ startedAt: zod.ZodNumber;
6107
+ alive: zod.ZodBoolean;
6108
+ }, zod_v4_core.$strict>>>;
6109
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
6110
+ };
5606
6111
  events: {
5607
- subscribe: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
6112
+ subscribe: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
5608
6113
  sources: zod.ZodOptional<zod.ZodArray<zod.ZodString>>;
5609
- }, zod_v4_core.$strict>, any, Record<never, never>, Record<never, never>>;
6114
+ }, zod_v4_core.$strict>, any, MergedErrorMap<$ErrorMap, TErrorMap>>;
6115
+ };
6116
+ launch: {
6117
+ resolve: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
6118
+ path: zod.ZodString;
6119
+ argv: zod.ZodOptional<zod.ZodReadonly<zod.ZodArray<zod.ZodString>>>;
6120
+ env: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodString>>;
6121
+ }, zod_v4_core.$strict>, zod.ZodObject<{
6122
+ decision: zod.ZodObject<{
6123
+ identity: zod.ZodOptional<zod.ZodString>;
6124
+ identitySource: zod.ZodEnum<{
6125
+ none: "none";
6126
+ "config-dir-escape-hatch": "config-dir-escape-hatch";
6127
+ argv: "argv";
6128
+ env: "env";
6129
+ "directory-pin": "directory-pin";
6130
+ "active-identity-file": "active-identity-file";
6131
+ }>;
6132
+ pool: zod.ZodOptional<zod.ZodObject<{
6133
+ name: zod.ZodString;
6134
+ reasons: zod.ZodReadonly<zod.ZodArray<zod.ZodString>>;
6135
+ movedOff: zod.ZodOptional<zod.ZodObject<{
6136
+ identity: zod.ZodString;
6137
+ reason: zod.ZodString;
6138
+ }, zod_v4_core.$strict>>;
6139
+ }, zod_v4_core.$strict>>;
6140
+ configDirEscapeHatch: zod.ZodBoolean;
6141
+ configDir: zod.ZodOptional<zod.ZodString>;
6142
+ configProfile: zod.ZodOptional<zod.ZodString>;
6143
+ configProfileSource: zod.ZodEnum<{
6144
+ "directory-rule": "directory-rule";
6145
+ none: "none";
6146
+ env: "env";
6147
+ "cli-flag": "cli-flag";
6148
+ "identity-default": "identity-default";
6149
+ "global-default": "global-default";
6150
+ }>;
6151
+ provider: zod.ZodOptional<zod.ZodString>;
6152
+ }, zod_v4_core.$strict>;
6153
+ flags: zod.ZodObject<{
6154
+ skipPermissions: zod.ZodBoolean;
6155
+ remoteControl: zod.ZodBoolean;
6156
+ headroom: zod.ZodBoolean;
6157
+ trackUsage: zod.ZodBoolean;
6158
+ }, zod_v4_core.$strict>;
6159
+ claudeVersion: zod.ZodOptional<zod.ZodObject<{
6160
+ version: zod.ZodString;
6161
+ source: zod.ZodEnum<{
6162
+ flag: "flag";
6163
+ environment: "environment";
6164
+ cascade: "cascade";
6165
+ }>;
6166
+ }, zod_v4_core.$strict>>;
6167
+ bin: zod.ZodString;
6168
+ args: zod.ZodReadonly<zod.ZodArray<zod.ZodString>>;
6169
+ credential: zod.ZodOptional<zod.ZodObject<{
6170
+ subject: zod.ZodEnum<{
6171
+ identity: "identity";
6172
+ provider: "provider";
6173
+ }>;
6174
+ name: zod.ZodString;
6175
+ summary: zod.ZodObject<{
6176
+ target: zod.ZodEnum<{
6177
+ bearer: "bearer";
6178
+ apiKey: "apiKey";
6179
+ oauthToken: "oauthToken";
6180
+ }>;
6181
+ sources: zod.ZodReadonly<zod.ZodArray<zod.ZodUnion<readonly [zod.ZodObject<{
6182
+ kind: zod.ZodLiteral<"env">;
6183
+ variable: zod.ZodString;
6184
+ }, zod_v4_core.$strict>, zod.ZodObject<{
6185
+ kind: zod.ZodLiteral<"file">;
6186
+ path: zod.ZodString;
6187
+ }, zod_v4_core.$strict>, zod.ZodObject<{
6188
+ kind: zod.ZodLiteral<"command">;
6189
+ program: zod.ZodString;
6190
+ }, zod_v4_core.$strict>, zod.ZodObject<{
6191
+ kind: zod.ZodLiteral<"op">;
6192
+ reference: zod.ZodString;
6193
+ }, zod_v4_core.$strict>, zod.ZodObject<{
6194
+ kind: zod.ZodLiteral<"keychain">;
6195
+ service: zod.ZodString;
6196
+ account: zod.ZodOptional<zod.ZodString>;
6197
+ }, zod_v4_core.$strict>, zod.ZodObject<{
6198
+ kind: zod.ZodLiteral<"literal">;
6199
+ }, zod_v4_core.$strict>]>>>;
6200
+ cache: zod.ZodOptional<zod.ZodObject<{
6201
+ ttl: zod.ZodOptional<zod.ZodString>;
6202
+ store: zod.ZodOptional<zod.ZodEnum<{
6203
+ file: "file";
6204
+ keychain: "keychain";
6205
+ }>>;
6206
+ }, zod_v4_core.$strict>>;
6207
+ }, zod_v4_core.$strict>;
6208
+ }, zod_v4_core.$strict>>;
6209
+ routing: zod.ZodObject<{
6210
+ frontDoor: zod.ZodBoolean;
6211
+ headroom: zod.ZodBoolean;
6212
+ }, zod_v4_core.$strict>;
6213
+ environment: zod.ZodReadonly<zod.ZodArray<zod.ZodString>>;
6214
+ warnings: zod.ZodReadonly<zod.ZodArray<zod.ZodString>>;
6215
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
6216
+ };
6217
+ codex: {
6218
+ status: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, InitialInputSchema, zod.ZodObject<{
6219
+ signIn: zod.ZodDiscriminatedUnion<[zod.ZodObject<{
6220
+ state: zod.ZodLiteral<"none">;
6221
+ }, zod_v4_core.$strict>, zod.ZodObject<{
6222
+ state: zod.ZodLiteral<"signed-in">;
6223
+ email: zod.ZodOptional<zod.ZodString>;
6224
+ planScope: zod.ZodBoolean;
6225
+ accessTokenExpiresAt: zod.ZodNumber;
6226
+ }, zod_v4_core.$strict>, zod.ZodObject<{
6227
+ state: zod.ZodLiteral<"unreadable">;
6228
+ message: zod.ZodString;
6229
+ }, zod_v4_core.$strict>], "state">;
6230
+ codexProviders: zod.ZodReadonly<zod.ZodArray<zod.ZodString>>;
6231
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
6232
+ logout: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, InitialInputSchema, zod.ZodObject<{
6233
+ hadGrant: zod.ZodBoolean;
6234
+ revoked: zod.ZodBoolean;
6235
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
6236
+ };
6237
+ update: {
6238
+ check: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, InitialInputSchema, zod.ZodObject<{
6239
+ current: zod.ZodString;
6240
+ latest: zod.ZodString;
6241
+ action: zod.ZodEnum<{
6242
+ current: "current";
6243
+ available: "available";
6244
+ updated: "updated";
6245
+ }>;
6246
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
5610
6247
  };
5611
6248
  usage: {
5612
- list: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, Schema<unknown, unknown>, zod.ZodObject<{
6249
+ list: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, InitialInputSchema, zod.ZodObject<{
5613
6250
  snapshots: zod.ZodReadonly<zod.ZodArray<zod.ZodObject<{
5614
6251
  schemaVersion: zod.ZodLiteral<1>;
5615
6252
  identity: zod.ZodString;
@@ -5703,8 +6340,8 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
5703
6340
  }, zod_v4_core.$strict>>;
5704
6341
  }, zod_v4_core.$strict>>;
5705
6342
  }, zod_v4_core.$strict>>>;
5706
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
5707
- effectiveWindow: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
6343
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
6344
+ effectiveWindow: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
5708
6345
  identity: zod.ZodString;
5709
6346
  provider: zod.ZodOptional<zod.ZodString>;
5710
6347
  }, zod_v4_core.$strict>, zod.ZodObject<{
@@ -5723,8 +6360,8 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
5723
6360
  resetsAtMs: zod.ZodOptional<zod.ZodNumber>;
5724
6361
  status: zod.ZodOptional<zod.ZodString>;
5725
6362
  }, zod_v4_core.$strict>>;
5726
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
5727
- live: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
6363
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
6364
+ live: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
5728
6365
  session: zod.ZodOptional<zod.ZodString>;
5729
6366
  }, zod_v4_core.$strict>, zod.ZodObject<{
5730
6367
  latest: zod.ZodOptional<zod.ZodObject<{
@@ -5781,57 +6418,22 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
5781
6418
  }, zod_v4_core.$loose>>;
5782
6419
  }, zod_v4_core.$loose>;
5783
6420
  }, zod_v4_core.$strict>>>;
5784
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
5785
- };
5786
- frontdoor: {
5787
- status: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, Schema<unknown, unknown>, zod.ZodObject<{
5788
- state: zod.ZodObject<{
5789
- protocol: zod.ZodOptional<zod.ZodNumber>;
5790
- supervisorPid: zod.ZodOptional<zod.ZodNumber>;
5791
- port: zod.ZodOptional<zod.ZodNumber>;
5792
- lastPort: zod.ZodOptional<zod.ZodNumber>;
5793
- connectPort: zod.ZodOptional<zod.ZodNumber>;
5794
- lastConnectPort: zod.ZodOptional<zod.ZodNumber>;
5795
- directPort: zod.ZodOptional<zod.ZodNumber>;
5796
- lastDirectPort: zod.ZodOptional<zod.ZodNumber>;
5797
- lastError: zod.ZodOptional<zod.ZodString>;
5798
- }, zod_v4_core.$strict>;
5799
- supervisorAlive: zod.ZodBoolean;
5800
- sessions: zod.ZodReadonly<zod.ZodArray<zod.ZodObject<{
5801
- pid: zod.ZodInt;
5802
- startedAt: zod.ZodNumber;
5803
- alive: zod.ZodBoolean;
5804
- }, zod_v4_core.$strict>>>;
5805
- headroomSocket: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodObject<{
5806
- socketPath: zod.ZodString;
5807
- }, zod_v4_core.$strict>, zod.ZodObject<{
5808
- refused: zod.ZodString;
5809
- }, zod_v4_core.$strict>]>>;
5810
- logPath: zod.ZodString;
5811
- logExists: zod.ZodBoolean;
5812
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
5813
- sessions: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, Schema<unknown, unknown>, zod.ZodObject<{
5814
- sessions: zod.ZodReadonly<zod.ZodArray<zod.ZodObject<{
5815
- pid: zod.ZodInt;
5816
- startedAt: zod.ZodNumber;
5817
- alive: zod.ZodBoolean;
5818
- }, zod_v4_core.$strict>>>;
5819
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
6421
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
5820
6422
  };
5821
6423
  check: {
5822
- run: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
6424
+ run: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
5823
6425
  path: zod.ZodString;
5824
6426
  identity: zod.ZodOptional<zod.ZodString>;
5825
6427
  }, zod_v4_core.$strict>, zod.ZodObject<{
5826
6428
  identity: zod.ZodObject<{
5827
6429
  name: zod.ZodNullable<zod.ZodString>;
5828
6430
  source: zod.ZodEnum<{
6431
+ none: "none";
5829
6432
  "config-dir-escape-hatch": "config-dir-escape-hatch";
5830
6433
  argv: "argv";
5831
6434
  env: "env";
5832
6435
  "directory-pin": "directory-pin";
5833
6436
  "active-identity-file": "active-identity-file";
5834
- none: "none";
5835
6437
  }>;
5836
6438
  }, zod_v4_core.$strict>;
5837
6439
  pool: zod.ZodOptional<zod.ZodObject<{
@@ -5879,8 +6481,8 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
5879
6481
  name: zod.ZodNullable<zod.ZodString>;
5880
6482
  source: zod.ZodEnum<{
5881
6483
  "directory-rule": "directory-rule";
5882
- env: "env";
5883
6484
  none: "none";
6485
+ env: "env";
5884
6486
  "cli-flag": "cli-flag";
5885
6487
  "identity-default": "identity-default";
5886
6488
  "global-default": "global-default";
@@ -6122,10 +6724,10 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
6122
6724
  highestInstalled: zod.ZodOptional<zod.ZodString>;
6123
6725
  installed: zod.ZodReadonly<zod.ZodArray<zod.ZodString>>;
6124
6726
  }, zod_v4_core.$strict>>;
6125
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
6727
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
6126
6728
  };
6127
6729
  doctor: {
6128
- run: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, Schema<unknown, unknown>, zod.ZodObject<{
6730
+ run: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, InitialInputSchema, zod.ZodObject<{
6129
6731
  ok: zod.ZodBoolean;
6130
6732
  findings: zod.ZodReadonly<zod.ZodArray<zod.ZodObject<{
6131
6733
  section: zod.ZodEnum<{
@@ -6134,12 +6736,12 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
6134
6736
  identity: "identity";
6135
6737
  provider: "provider";
6136
6738
  pool: "pool";
6137
- keychain: "keychain";
6138
6739
  "ambient-credential": "ambient-credential";
6139
6740
  "binary-discovery": "binary-discovery";
6140
6741
  "claude-shim": "claude-shim";
6141
6742
  "path-resolution": "path-resolution";
6142
6743
  "legacy-name": "legacy-name";
6744
+ keychain: "keychain";
6143
6745
  "directory-rules": "directory-rules";
6144
6746
  "categories-local": "categories-local";
6145
6747
  "active-identity": "active-identity";
@@ -6153,10 +6755,10 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
6153
6755
  }>;
6154
6756
  message: zod.ZodString;
6155
6757
  }, zod_v4_core.$strict>>>;
6156
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
6758
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
6157
6759
  };
6158
6760
  pool: {
6159
- pick: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
6761
+ pick: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
6160
6762
  pool: zod.ZodString;
6161
6763
  path: zod.ZodString;
6162
6764
  }, zod_v4_core.$strict>, zod.ZodObject<{
@@ -6199,17 +6801,17 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
6199
6801
  reason: zod.ZodString;
6200
6802
  }, zod_v4_core.$strict>>;
6201
6803
  stickyProblem: zod.ZodOptional<zod.ZodString>;
6202
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
6804
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
6203
6805
  };
6204
6806
  rc: {
6205
- list: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, Schema<unknown, unknown>, zod.ZodObject<{
6807
+ list: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, InitialInputSchema, zod.ZodObject<{
6206
6808
  sessions: zod.ZodReadonly<zod.ZodArray<zod.ZodObject<{
6207
6809
  id: zod.ZodString;
6208
6810
  createdAt: zod.ZodNumber;
6209
6811
  lastSeenAt: zod.ZodNumber;
6210
6812
  }, zod_v4_core.$strict>>>;
6211
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
6212
- status: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
6813
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
6814
+ status: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
6213
6815
  session: zod.ZodOptional<zod.ZodString>;
6214
6816
  }, zod_v4_core.$strict>, zod.ZodObject<{
6215
6817
  statuses: zod.ZodReadonly<zod.ZodArray<zod.ZodObject<{
@@ -6232,8 +6834,8 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
6232
6834
  createdAt: zod.ZodNumber;
6233
6835
  lastSeenAt: zod.ZodNumber;
6234
6836
  }, zod_v4_core.$strict>>>;
6235
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
6236
- pending: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
6837
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
6838
+ pending: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
6237
6839
  session: zod.ZodOptional<zod.ZodString>;
6238
6840
  }, zod_v4_core.$strict>, zod.ZodObject<{
6239
6841
  pending: zod.ZodReadonly<zod.ZodArray<zod.ZodObject<{
@@ -6243,15 +6845,15 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
6243
6845
  summary: zod.ZodString;
6244
6846
  observedAt: zod.ZodNumber;
6245
6847
  }, zod_v4_core.$strict>>>;
6246
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
6247
- send: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
6848
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
6849
+ send: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
6248
6850
  session: zod.ZodString;
6249
6851
  text: zod.ZodString;
6250
6852
  }, zod_v4_core.$strict>, zod.ZodObject<{
6251
6853
  session: zod.ZodString;
6252
6854
  sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
6253
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
6254
- answer: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
6855
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
6856
+ answer: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
6255
6857
  session: zod.ZodString;
6256
6858
  request: zod.ZodString;
6257
6859
  approve: zod.ZodBoolean;
@@ -6260,23 +6862,23 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
6260
6862
  session: zod.ZodString;
6261
6863
  request: zod.ZodString;
6262
6864
  sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
6263
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
6264
- interrupt: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
6865
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
6866
+ interrupt: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
6265
6867
  session: zod.ZodString;
6266
6868
  }, zod_v4_core.$strict>, zod.ZodObject<{
6267
6869
  session: zod.ZodString;
6268
6870
  request: zod.ZodString;
6269
6871
  sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
6270
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
6271
- setModel: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
6872
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
6873
+ setModel: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
6272
6874
  session: zod.ZodString;
6273
6875
  model: zod.ZodString;
6274
6876
  }, zod_v4_core.$strict>, zod.ZodObject<{
6275
6877
  session: zod.ZodString;
6276
6878
  request: zod.ZodString;
6277
6879
  sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
6278
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
6279
- setPermissionMode: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
6880
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
6881
+ setPermissionMode: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
6280
6882
  session: zod.ZodString;
6281
6883
  mode: zod.ZodEnum<{
6282
6884
  default: "default";
@@ -6290,24 +6892,24 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
6290
6892
  session: zod.ZodString;
6291
6893
  request: zod.ZodString;
6292
6894
  sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
6293
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
6294
- endSession: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
6895
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
6896
+ endSession: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
6295
6897
  session: zod.ZodString;
6296
6898
  reason: zod.ZodOptional<zod.ZodString>;
6297
6899
  }, zod_v4_core.$strict>, zod.ZodObject<{
6298
6900
  session: zod.ZodString;
6299
6901
  request: zod.ZodString;
6300
6902
  sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
6301
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
6302
- getUsage: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
6903
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
6904
+ getUsage: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
6303
6905
  session: zod.ZodString;
6304
6906
  skipBehaviors: zod.ZodOptional<zod.ZodBoolean>;
6305
6907
  }, zod_v4_core.$strict>, zod.ZodObject<{
6306
6908
  session: zod.ZodString;
6307
6909
  request: zod.ZodString;
6308
6910
  sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
6309
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
6310
- getContextUsage: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
6911
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
6912
+ getContextUsage: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
6311
6913
  session: zod.ZodString;
6312
6914
  detail: zod.ZodOptional<zod.ZodEnum<{
6313
6915
  summary: "summary";
@@ -6317,8 +6919,8 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
6317
6919
  session: zod.ZodString;
6318
6920
  request: zod.ZodString;
6319
6921
  sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
6320
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
6321
- readFile: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
6922
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
6923
+ readFile: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
6322
6924
  session: zod.ZodString;
6323
6925
  path: zod.ZodString;
6324
6926
  maxBytes: zod.ZodOptional<zod.ZodNumber>;
@@ -6330,37 +6932,37 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
6330
6932
  session: zod.ZodString;
6331
6933
  request: zod.ZodString;
6332
6934
  sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
6333
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
6334
- fileSuggestions: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
6935
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
6936
+ fileSuggestions: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
6335
6937
  session: zod.ZodString;
6336
6938
  query: zod.ZodString;
6337
6939
  }, zod_v4_core.$strict>, zod.ZodObject<{
6338
6940
  session: zod.ZodString;
6339
6941
  request: zod.ZodString;
6340
6942
  sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
6341
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
6342
- keepAlive: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
6943
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
6944
+ keepAlive: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
6343
6945
  session: zod.ZodString;
6344
6946
  }, zod_v4_core.$strict>, zod.ZodObject<{
6345
6947
  session: zod.ZodString;
6346
6948
  sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
6347
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
6348
- mcpStatus: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
6949
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
6950
+ mcpStatus: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
6349
6951
  session: zod.ZodString;
6350
6952
  }, zod_v4_core.$strict>, zod.ZodObject<{
6351
6953
  session: zod.ZodString;
6352
6954
  request: zod.ZodString;
6353
6955
  sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
6354
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
6355
- mcpReconnect: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
6956
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
6957
+ mcpReconnect: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
6356
6958
  session: zod.ZodString;
6357
6959
  serverName: zod.ZodString;
6358
6960
  }, zod_v4_core.$strict>, zod.ZodObject<{
6359
6961
  session: zod.ZodString;
6360
6962
  request: zod.ZodString;
6361
6963
  sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
6362
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
6363
- mcpAuthenticate: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
6964
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
6965
+ mcpAuthenticate: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
6364
6966
  session: zod.ZodString;
6365
6967
  serverName: zod.ZodString;
6366
6968
  redirectUri: zod.ZodString;
@@ -6368,8 +6970,8 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
6368
6970
  session: zod.ZodString;
6369
6971
  request: zod.ZodString;
6370
6972
  sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
6371
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
6372
- mcpOAuthCallbackUrl: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
6973
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
6974
+ mcpOAuthCallbackUrl: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
6373
6975
  session: zod.ZodString;
6374
6976
  serverName: zod.ZodString;
6375
6977
  callbackUrl: zod.ZodString;
@@ -6377,17 +6979,17 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
6377
6979
  session: zod.ZodString;
6378
6980
  request: zod.ZodString;
6379
6981
  sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
6380
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
6381
- teleport: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
6982
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
6983
+ teleport: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
6382
6984
  session: zod.ZodString;
6383
6985
  marker: zod.ZodString;
6384
6986
  }, zod_v4_core.$strict>, zod.ZodObject<{
6385
6987
  session: zod.ZodString;
6386
6988
  sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
6387
- }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
6388
- subscribe: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
6989
+ }, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
6990
+ subscribe: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
6389
6991
  session: zod.ZodOptional<zod.ZodString>;
6390
- }, zod_v4_core.$strict>, any, Record<never, never>, Record<never, never>>;
6992
+ }, zod_v4_core.$strict>, any, MergedErrorMap<$ErrorMap, TErrorMap>>;
6391
6993
  };
6392
6994
  };
6393
6995
  /** The door's whole typed API, as the client the door's own verbs and library consumers use is derived from it. */
@@ -6674,12 +7276,12 @@ declare const DoctorFindingSchema: z.ZodObject<{
6674
7276
  identity: "identity";
6675
7277
  provider: "provider";
6676
7278
  pool: "pool";
6677
- keychain: "keychain";
6678
7279
  "ambient-credential": "ambient-credential";
6679
7280
  "binary-discovery": "binary-discovery";
6680
7281
  "claude-shim": "claude-shim";
6681
7282
  "path-resolution": "path-resolution";
6682
7283
  "legacy-name": "legacy-name";
7284
+ keychain: "keychain";
6683
7285
  "directory-rules": "directory-rules";
6684
7286
  "categories-local": "categories-local";
6685
7287
  "active-identity": "active-identity";
@@ -6703,12 +7305,12 @@ declare const DoctorRunOutputSchema: z.ZodObject<{
6703
7305
  identity: "identity";
6704
7306
  provider: "provider";
6705
7307
  pool: "pool";
6706
- keychain: "keychain";
6707
7308
  "ambient-credential": "ambient-credential";
6708
7309
  "binary-discovery": "binary-discovery";
6709
7310
  "claude-shim": "claude-shim";
6710
7311
  "path-resolution": "path-resolution";
6711
7312
  "legacy-name": "legacy-name";
7313
+ keychain: "keychain";
6712
7314
  "directory-rules": "directory-rules";
6713
7315
  "categories-local": "categories-local";
6714
7316
  "active-identity": "active-identity";
@@ -6723,6 +7325,159 @@ declare const DoctorRunOutputSchema: z.ZodObject<{
6723
7325
  message: z.ZodString;
6724
7326
  }, z.core.$strict>>>;
6725
7327
  }, z.core.$strict>;
7328
+ /** The restart's answer: the pid of the door being replaced, which is the only part of the new generation the caller cannot yet know. The caller reopens its client from the state root once the door's supervisor pid differs from this one, because the replacement mints its own control token. */
7329
+ declare const FrontDoorRestartOutputSchema: z.ZodObject<{
7330
+ action: z.ZodLiteral<"restarting">;
7331
+ previousPid: z.ZodInt;
7332
+ }, z.core.$strict>;
7333
+ /** `update --check`'s report: the running version, the latest release, and whether they differ (`available`) or match (`current`). A check never installs, so `updated` is not an answer here. */
7334
+ declare const UpdateCheckOutputSchema: z.ZodObject<{
7335
+ current: z.ZodString;
7336
+ latest: z.ZodString;
7337
+ action: z.ZodEnum<{
7338
+ current: "current";
7339
+ available: "available";
7340
+ updated: "updated";
7341
+ }>;
7342
+ }, z.core.$strict>;
7343
+ /** The Sign in with ChatGPT login's state as `codex status` reports it: no sign-in yet, signed in (with who, whether the plan scope was granted, and when the access token lapses), or a file that cannot be read. */
7344
+ declare const CodexSignInSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7345
+ state: z.ZodLiteral<"none">;
7346
+ }, z.core.$strict>, z.ZodObject<{
7347
+ state: z.ZodLiteral<"signed-in">;
7348
+ email: z.ZodOptional<z.ZodString>;
7349
+ planScope: z.ZodBoolean;
7350
+ accessTokenExpiresAt: z.ZodNumber;
7351
+ }, z.core.$strict>, z.ZodObject<{
7352
+ state: z.ZodLiteral<"unreadable">;
7353
+ message: z.ZodString;
7354
+ }, z.core.$strict>], "state">;
7355
+ /** What `codex status` reports about the translation's sign-in and the codex providers the machine defines; the door's own status and sessions are `frontdoor.status` and `frontdoor.sessions`. */
7356
+ declare const CodexStatusOutputSchema: z.ZodObject<{
7357
+ signIn: z.ZodDiscriminatedUnion<[z.ZodObject<{
7358
+ state: z.ZodLiteral<"none">;
7359
+ }, z.core.$strict>, z.ZodObject<{
7360
+ state: z.ZodLiteral<"signed-in">;
7361
+ email: z.ZodOptional<z.ZodString>;
7362
+ planScope: z.ZodBoolean;
7363
+ accessTokenExpiresAt: z.ZodNumber;
7364
+ }, z.core.$strict>, z.ZodObject<{
7365
+ state: z.ZodLiteral<"unreadable">;
7366
+ message: z.ZodString;
7367
+ }, z.core.$strict>], "state">;
7368
+ codexProviders: z.ZodReadonly<z.ZodArray<z.ZodString>>;
7369
+ }, z.core.$strict>;
7370
+ /** `codex logout`'s result: whether there was a login to remove, and whether the issuer was told to revoke it (a failed revocation still removes the login here). */
7371
+ declare const CodexLogoutOutputSchema: z.ZodObject<{
7372
+ hadGrant: z.ZodBoolean;
7373
+ revoked: z.ZodBoolean;
7374
+ }, z.core.$strict>;
7375
+
7376
+ /**
7377
+ * The Zod schemas of the door's launch resolution: what a launch from one directory would resolve to, as data. The output is a closed shape of names, flags, paths and credential summaries (a target and each source's kind and non-secret identifier), so a token has nowhere to appear in it: a value outside the shape fails the door's own output validation instead of reaching the caller.
7378
+ */
7379
+ /** The launch to resolve: the directory it is for (absolute, since the door has no working directory of the caller's to resolve a relative path against), the arguments after `agent-shim run` exactly as the command line takes them, and the environment the launch would inherit. */
7380
+ declare const LaunchResolveInputSchema: z.ZodObject<{
7381
+ path: z.ZodString;
7382
+ argv: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
7383
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
7384
+ }, z.core.$strict>;
7385
+ /** One launch resolved, with the warnings the resolution raised. Nothing was started, written or recorded to produce it. */
7386
+ declare const LaunchResolveOutputSchema: z.ZodObject<{
7387
+ decision: z.ZodObject<{
7388
+ identity: z.ZodOptional<z.ZodString>;
7389
+ identitySource: z.ZodEnum<{
7390
+ none: "none";
7391
+ "config-dir-escape-hatch": "config-dir-escape-hatch";
7392
+ argv: "argv";
7393
+ env: "env";
7394
+ "directory-pin": "directory-pin";
7395
+ "active-identity-file": "active-identity-file";
7396
+ }>;
7397
+ pool: z.ZodOptional<z.ZodObject<{
7398
+ name: z.ZodString;
7399
+ reasons: z.ZodReadonly<z.ZodArray<z.ZodString>>;
7400
+ movedOff: z.ZodOptional<z.ZodObject<{
7401
+ identity: z.ZodString;
7402
+ reason: z.ZodString;
7403
+ }, z.core.$strict>>;
7404
+ }, z.core.$strict>>;
7405
+ configDirEscapeHatch: z.ZodBoolean;
7406
+ configDir: z.ZodOptional<z.ZodString>;
7407
+ configProfile: z.ZodOptional<z.ZodString>;
7408
+ configProfileSource: z.ZodEnum<{
7409
+ "directory-rule": "directory-rule";
7410
+ none: "none";
7411
+ env: "env";
7412
+ "cli-flag": "cli-flag";
7413
+ "identity-default": "identity-default";
7414
+ "global-default": "global-default";
7415
+ }>;
7416
+ provider: z.ZodOptional<z.ZodString>;
7417
+ }, z.core.$strict>;
7418
+ flags: z.ZodObject<{
7419
+ skipPermissions: z.ZodBoolean;
7420
+ remoteControl: z.ZodBoolean;
7421
+ headroom: z.ZodBoolean;
7422
+ trackUsage: z.ZodBoolean;
7423
+ }, z.core.$strict>;
7424
+ claudeVersion: z.ZodOptional<z.ZodObject<{
7425
+ version: z.ZodString;
7426
+ source: z.ZodEnum<{
7427
+ flag: "flag";
7428
+ environment: "environment";
7429
+ cascade: "cascade";
7430
+ }>;
7431
+ }, z.core.$strict>>;
7432
+ bin: z.ZodString;
7433
+ args: z.ZodReadonly<z.ZodArray<z.ZodString>>;
7434
+ credential: z.ZodOptional<z.ZodObject<{
7435
+ subject: z.ZodEnum<{
7436
+ identity: "identity";
7437
+ provider: "provider";
7438
+ }>;
7439
+ name: z.ZodString;
7440
+ summary: z.ZodObject<{
7441
+ target: z.ZodEnum<{
7442
+ bearer: "bearer";
7443
+ apiKey: "apiKey";
7444
+ oauthToken: "oauthToken";
7445
+ }>;
7446
+ sources: z.ZodReadonly<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
7447
+ kind: z.ZodLiteral<"env">;
7448
+ variable: z.ZodString;
7449
+ }, z.core.$strict>, z.ZodObject<{
7450
+ kind: z.ZodLiteral<"file">;
7451
+ path: z.ZodString;
7452
+ }, z.core.$strict>, z.ZodObject<{
7453
+ kind: z.ZodLiteral<"command">;
7454
+ program: z.ZodString;
7455
+ }, z.core.$strict>, z.ZodObject<{
7456
+ kind: z.ZodLiteral<"op">;
7457
+ reference: z.ZodString;
7458
+ }, z.core.$strict>, z.ZodObject<{
7459
+ kind: z.ZodLiteral<"keychain">;
7460
+ service: z.ZodString;
7461
+ account: z.ZodOptional<z.ZodString>;
7462
+ }, z.core.$strict>, z.ZodObject<{
7463
+ kind: z.ZodLiteral<"literal">;
7464
+ }, z.core.$strict>]>>>;
7465
+ cache: z.ZodOptional<z.ZodObject<{
7466
+ ttl: z.ZodOptional<z.ZodString>;
7467
+ store: z.ZodOptional<z.ZodEnum<{
7468
+ file: "file";
7469
+ keychain: "keychain";
7470
+ }>>;
7471
+ }, z.core.$strict>>;
7472
+ }, z.core.$strict>;
7473
+ }, z.core.$strict>>;
7474
+ routing: z.ZodObject<{
7475
+ frontDoor: z.ZodBoolean;
7476
+ headroom: z.ZodBoolean;
7477
+ }, z.core.$strict>;
7478
+ environment: z.ZodReadonly<z.ZodArray<z.ZodString>>;
7479
+ warnings: z.ZodReadonly<z.ZodArray<z.ZodString>>;
7480
+ }, z.core.$strict>;
6726
7481
 
6727
7482
  /**
6728
7483
  * The launch lifecycle publisher: the door's first event source of its own, turning the session registry the supervisor already reads each tick into source-tagged backbone events. A launch registering, a capability pruned because its launcher died, and a session ending by its launcher's own exit hook are all registry facts before they are events, which is why the publisher emits nothing of its own: it is fed the tick's listing and the pids the prune removed, and publishes the diff against the previous tick.
@@ -7760,170 +8515,6 @@ interface LaunchSelection {
7760
8515
  */
7761
8516
  declare function resolveLaunchSelection(params: ResolveLaunchSelectionParams): LaunchSelection;
7762
8517
 
7763
- /** What a launch's one-off command-line/environment overrides resolve to: the `cliOverride` layer `src/resolve/walk.ts`'s `assembleCascade` composes last, so it beats every other layer. */
7764
- interface CliOverride {
7765
- readonly categories?: CategoryMap;
7766
- readonly entries?: Entries;
7767
- readonly launch?: {
7768
- readonly provider?: string;
7769
- };
7770
- }
7771
-
7772
- /**
7773
- * Everything the launch-time update check needs from its host, injected so tests run it against scripted answers and no launch ever reaches GitHub by accident. Deliberately narrower than `UpdatePorts`: the launch path never downloads anything (the detached `agent-shim update` does), so only the release check, the cooldown stamp, the clock, the background spawn and the terminal are wired.
7774
- */
7775
- interface UpdateLaunchPort {
7776
- /** Resolves the URL the `releases/latest` redirect lands on, exactly as `agent-shim update` resolves the newest version. */
7777
- readonly effectiveUrl: (url: string) => Promise<string>;
7778
- /** Reads the cooldown stamp, or undefined when it does not exist. */
7779
- readonly readStamp: (filePath: string) => string | undefined;
7780
- /** Writes the cooldown stamp atomically: a reader either sees the previous whole stamp or the new one, never a partial write. */
7781
- readonly writeStamp: (filePath: string, contents: string) => void;
7782
- /** The clock the cooldown reads, in epoch milliseconds. */
7783
- readonly now: () => number;
7784
- /** Re-invokes this very binary with `args` as a detached child whose stdio is ignored and which is unref'd, so it outlives the launch and never holds the terminal. */
7785
- readonly spawnDetached: (args: readonly string[]) => void;
7786
- /** Writes one line to the launching terminal's stderr. */
7787
- readonly writeErr: (line: string) => void;
7788
- }
7789
-
7790
- /**
7791
- * Everything the farm resync needs that the launcher itself has no way to produce: a real filesystem, a real clock, the working directory, and a way to load the cascade for it.
7792
- *
7793
- * Supplied by `src/cli.ts` in normal operation. A caller that omits it launches with no farm at all, which is the right behaviour in exactly the cases where there is no agent-shim-managed farm to resync — and is what the launcher's own pre-farm tests exercise.
7794
- */
7795
- interface FarmRuntime {
7796
- readonly fs: FarmFs;
7797
- /** The canonical `~/.claude` every farm symlink points back into. */
7798
- readonly claudeHome: string;
7799
- readonly home: string;
7800
- readonly cwd: string;
7801
- /** The git branch at `cwd`, for `when: { branch }` conditions. Undefined when `cwd` is not in a repository. */
7802
- readonly branch?: string;
7803
- readonly branchDetached?: boolean;
7804
- readonly classification: {
7805
- readonly defaults: CategoryClassification;
7806
- readonly overlay?: CategoryClassificationOverlay;
7807
- };
7808
- /** Loads and assembles the cascade for `cwd` under the given configuration profile and one-off command-line/environment overrides. Injected so the launcher never reads a config file itself. */
7809
- readonly loadCascade: (baseConfigProfile: string | undefined, cliOverride: CliOverride | undefined) => CascadeInput;
7810
- readonly now: () => number;
7811
- /** Distinguishes this process's scratch and superseded farm directories from any other's. */
7812
- readonly uniqueSuffix: string;
7813
- readonly lock: {
7814
- readonly pid: number;
7815
- readonly isRunning: (pid: number) => boolean;
7816
- readonly sleep: (ms: number) => void;
7817
- readonly staleAfterMs?: number;
7818
- readonly retryDelayMs?: number;
7819
- readonly maxAttempts?: number;
7820
- };
7821
- }
7822
- /** Inputs to `prepareLaunch`: everything a launch needs except the means of spawning the child. */
7823
- interface PrepareLaunchParams {
7824
- readonly paths: LayoutPaths;
7825
- readonly fs: FsPort;
7826
- readonly proc: ProcPort;
7827
- readonly log: LogPort;
7828
- /** Discovers the real `claude` binary to spawn. Injected so `runLauncher` never depends on `src/versionDiscovery.ts`'s own filesystem/PATH inputs directly — the caller (`src/cli.ts`) wires the real discovery, tests wire a fake that returns a fixed path. */
7829
- readonly resolveClaudeBinary: ClaudeBinaryResolver;
7830
- /** An identity pinned to `$PWD` by a directory rule. Accepted as an already-resolved value — the rules-loading code that produces it lands in Phase 4/5. */
7831
- readonly directoryPinnedIdentity?: string;
7832
- /** A directory rule's `configProfile` selection for `$PWD`. Accepted as an already-resolved value for the same reason. */
7833
- readonly directoryRuleConfigProfile?: string;
7834
- /** An explicit `--config-profile` value, when the caller wants to force one regardless of argv — normal operation instead relies on `parseLauncherArgv` finding `--config-profile` in `proc.argv` itself, so this is only needed to override that. */
7835
- readonly cliFlagConfigProfile?: string;
7836
- /** The user-global `~/.agent-shim/config.json` default configuration profile, when one is configured. */
7837
- readonly globalDefaultConfigProfile?: string;
7838
- /** The user-global `pools`, which a `pool:<name>` selector picks a member of. */
7839
- readonly pools?: Readonly<Record<string, Pool>>;
7840
- /** Wires the farm resync. Omitted only by a caller that has no farm to manage. */
7841
- readonly farm?: FarmRuntime;
7842
- /** Wires headroom routing. Omitted by a caller that cannot route through the daemon; a launch that resolves `headroom` on with no port wired is refused loudly rather than silently bypassing it. */
7843
- readonly headroom?: HeadroomPort;
7844
- /** Wires the front-door daemon. Omitted by a caller that cannot run it; a launch that routes anything (a provider, or headroom) with no port wired is refused rather than started against an address nothing serves. */
7845
- readonly frontdoor?: FrontDoorPort;
7846
- /** Resolves credential blocks (a provider's, or the launching identity's own). Omitted by a caller that cannot read secret files or run commands; a launch that needs a credential is then refused rather than started without it. */
7847
- readonly credentials?: CredentialPort;
7848
- /** True when the user was asked on a terminal whether to create the selected configuration profile and chose to launch without it. Without that explicit choice, a selected profile with no file is refused rather than silently skipped. */
7849
- readonly allowMissingConfigProfile?: boolean;
7850
- /** The user-global `update.mode`, resolved from the same global config the launcher already loads. Absent means `off`, and `off` runs no launch-time update check at all. */
7851
- readonly updateMode?: UpdateMode;
7852
- /** Wires the launch-time update check behind `update.mode`. Omitted by a caller that cannot resolve releases, re-invoke this binary, or write to the terminal; a mode of `notify` or `auto` with no port wired simply checks nothing. */
7853
- readonly update?: UpdateLaunchPort;
7854
- }
7855
- /** Inputs to `runLauncher`: a launch's inputs plus the port that spawns the child. */
7856
- interface RunLauncherParams extends PrepareLaunchParams {
7857
- readonly spawn: SpawnPort;
7858
- }
7859
- /** The pick a pool made for a launch: the pool, why the ranking chose the member it did, and, for a resumed conversation, the member it left. */
7860
- interface LaunchPoolDecision {
7861
- /** The pool the launch selected with `pool:<name>`. */
7862
- readonly name: string;
7863
- /** Every reason the ranking gave for the chosen member, in the ranking's order. */
7864
- readonly reasons: readonly string[];
7865
- /** The member a resumed conversation left, and why the ranking could not keep it. */
7866
- readonly movedOff?: {
7867
- readonly identity: string;
7868
- readonly reason: string;
7869
- };
7870
- }
7871
- /**
7872
- * What a launch resolved to, and where each decision came from. Everything here is a name or a path, never a credential.
7873
- */
7874
- interface LaunchDecision {
7875
- /** The identity the launch runs as. Absent when the escape hatch applied or nothing resolved one. */
7876
- readonly identity?: string;
7877
- /** Which precedence rule selected the identity (or the pool the identity was picked from). */
7878
- readonly identitySource: IdentityDecisionSource;
7879
- /** The pool pick behind `identity`, when the launch selected a pool. */
7880
- readonly pool?: LaunchPoolDecision;
7881
- /** True when `CLAUDE_CONFIG_DIR` was already set, so no identity was resolved and no farm was managed. */
7882
- readonly configDirEscapeHatch: boolean;
7883
- /** The configuration directory the child runs with: the identity's own, or the one the caller named. Absent when none is set. */
7884
- readonly configDir?: string;
7885
- /** The configuration profile that applied, when one did. */
7886
- readonly configProfile?: string;
7887
- /** Which precedence rule selected the configuration profile. */
7888
- readonly configProfileSource: ConfigProfileDecisionSource;
7889
- /** The provider the launch routes through, when it selected one. */
7890
- readonly provider?: string;
7891
- }
7892
- /**
7893
- * What one launch resolved to, once every effect its child depends on is in place (the identity's farm resynced, the front door and headroom up and this launch registered with them): the real binary, its arguments and its environment.
7894
- */
7895
- interface LaunchPlan {
7896
- readonly bin: string;
7897
- readonly args: readonly string[];
7898
- readonly env: Readonly<Record<string, string | undefined>>;
7899
- /** Releases the daemon session registrations this launch holds. Call it when the child has exited; it is safe to call more than once. */
7900
- readonly release: () => void;
7901
- /** What the launch resolved to, as data: the facts the launcher's decision line reports. */
7902
- readonly decision: LaunchDecision;
7903
- /** Marks the moment this plan's child is spawned: the launch-time update check suppresses its notify line from then on, since a line printed after the child took over the terminal would land mid-session. Call it immediately before spawning; it is safe to call more than once. */
7904
- readonly markChildStarted: () => void;
7905
- }
7906
- /**
7907
- * Prepares one `claude` launch, in order:
7908
- *
7909
- * `CLAUDE_CONFIG_DIR` escape-hatch check, then the identity/config-profile decision, the provider decision, the identity's own credential, the ambient-credential guard, the config-gated launch-time update check (fired after the decision line and never awaited; see `runLaunchUpdateCheck`), farm resync, version discovery, flag resolution (and, when headroom resolved on, daemon bring-up), the extra-flags split, and the final argument list and environment, returned as a `LaunchPlan` for the caller to spawn. It refuses through `params.proc.exit`, so a caller that is not a command line process passes a `proc` whose `exit` throws.
7910
- *
7911
- * A launch that resolves an identity with no `identity.json`, or a configuration profile with no file, is refused with exit 1 naming the missing name and how it was selected: silently proceeding would create a brand-new login for a mistyped `@name`, or launch with a whole cascade layer missing. On a terminal, `src/runClaude.ts` offers to create either before this runs.
7912
- *
7913
- * The farm resync is skipped when `CLAUDE_CONFIG_DIR` was already set (the escape hatch means the user has named a configuration directory explicitly, and agent-shim manages neither its contents nor its lifetime) and when no identity resolved at all (a bare launch against plain `~/.claude`, matching the legacy tool's own behaviour). In both cases there is no agent-shim-managed farm for a resync to act on.
7914
- */
7915
- declare function prepareLaunch(params: PrepareLaunchParams): LaunchPlan;
7916
- /**
7917
- * Runs the child a `plan` describes under `spawn` and returns its exit code, in the order every launch observes: the update check's notice is suppressed from the moment the child takes the terminal, the child runs to completion, and the plan's session registrations are released whether it exited, was signalled or could not be spawned. A spawn failure is thrown after the release rather than turned into an exit code.
7918
- */
7919
- declare function runLaunchPlan(plan: LaunchPlan, spawn: SpawnPort): number;
7920
- /**
7921
- * Runs one `claude` launch: `prepareLaunch`, then the child under `params.spawn`, whose exit code becomes this process's.
7922
- *
7923
- * The session registrations are released by `runLaunchPlan` before `proc.exit` runs, because the real `process.exit` never unwinds a `finally` block.
7924
- */
7925
- declare function runLauncher(params: RunLauncherParams): void;
7926
-
7927
8518
  /** Inputs to `spawnClaude`. */
7928
8519
  interface SpawnClaudeParams {
7929
8520
  /** Full path to the real `claude` binary to run, as discovered by `src/versionDiscovery.ts`. */
@@ -7968,6 +8559,19 @@ interface PrepareClaudeLaunchOptions {
7968
8559
  * A refused launch throws `LaunchRefusedError` carrying the launcher's own message. Interactive offers (creating a missing identity or profile on a terminal) belong to the command line and are not made here.
7969
8560
  */
7970
8561
  declare function prepareClaudeLaunch(options: PrepareClaudeLaunchOptions): LaunchPlan;
8562
+ /** What `resolveClaudeLaunch` needs from its caller: the launch `prepareClaudeLaunch` takes, less the daemon executable, since a resolution starts no daemon. */
8563
+ type ResolveClaudeLaunchOptions = Omit<PrepareClaudeLaunchOptions, "agentShim">;
8564
+ /** A launch's resolution and the warnings resolving it raised (a quota the front door last saw, a pool member whose identity is gone). */
8565
+ interface ClaudeLaunchResolution {
8566
+ readonly resolution: LaunchResolution;
8567
+ readonly warnings: readonly string[];
8568
+ }
8569
+ /**
8570
+ * Reports what a launch for `options.cwd` would resolve to on this machine, changing nothing: the identity (and the pool pick behind it), configuration profile, provider, launch flags, pinned version, binary, arguments, the credential by its block and the names of the environment variables it would set. It recovers and resyncs no farm, starts no daemon, registers no session, records no pool pick and runs no credential command, so it is safe to call from a read.
8571
+ *
8572
+ * A launch that would be refused throws `LaunchRefusedError` carrying the launcher's own message, exactly as `prepareClaudeLaunch` does.
8573
+ */
8574
+ declare function resolveClaudeLaunch(options: ResolveClaudeLaunchOptions): ClaudeLaunchResolution;
7971
8575
 
7972
8576
  /** How one refresh ended. */
7973
8577
  type AnthropicRefreshOutcome = {
@@ -8057,5 +8661,5 @@ declare const OWN_CLI_FILE_NAME = "cli.cjs";
8057
8661
  */
8058
8662
  declare function agentShimCliPath(distDir?: string | undefined): string;
8059
8663
 
8060
- export { AMBIENT_CREDENTIAL_VARS, CHECK_CREDENTIAL_APPLIES, CONNECT_INTERCEPT_HOST, CONNECT_INTERCEPT_HOSTS, CONNECT_LIMITS, CONTROL_PATH_PREFIX, CategoryClassificationOverlaySchema, CategoryClassificationSchema, CategoryMapSchema, CheckReportJsonSchema, CheckRunInputSchema, CliError, ConfigProfileSchema, CredentialCacheSchema, CredentialSchema, CredentialSourceSchema, DOOR_EVENT_BUFFER_EVENTS, DOOR_EVENT_SOURCE_RC, DOOR_HEALTH_EVENT_SOURCE, DirectoryRuleAlreadyExistsError, DirectoryRuleMissingTargetError, DirectoryRuleNotFoundError, DirectoryRuleSchema, DirectoryRulesSchema, DoctorFindingSchema, DoctorRunOutputSchema, DoorEventSchema, DoorEventSourceQuerySchema, DoorHealthEventSchema, EXIT_FAILURE, EXIT_USAGE, EffectiveWindowSchema, EntryValueSchema, FARM_MANIFEST_FILENAME, FrontDoorControlMaterialError, FrontDoorNotServingError, FrontDoorSessionStatusSchema, FrontDoorSessionsOutputSchema, FrontDoorStartError, FrontDoorStateSchema, FrontDoorStatusOutputSchema, GlobalConfigSchema, HeadroomSocketTargetSchema, HeadroomStartError, IdentityAlreadyExistsError, IdentityNotFoundError, IdentitySchema, InvalidCategoryNameError, InvalidIdentityNameError, InvalidProviderNameError, LAUNCH_EVENT_SOURCE, LaunchLifecycleEventSchema, LaunchRefusedError, LegacyProviderFileError, 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, USAGE_EVENT_SOURCE, UsageError, UsageListOutputSchema, UsageLiveOutputSchema, UsageSnapshotError, UsageSnapshotSchema, UsageWindowsInputSchema, UsageWindowsOutputSchema, WhenSchema, addDirectoryRule, addIdentity, addPool, addProvider, agentShimCliPath, answerRcControlRequest, authenticateRcSessionMcpServer, buildEntryFacts, buildLayoutPaths, buildRcControlRequestPayload, buildRcControlResponsePayload, buildRcEndSessionPayload, buildRcEventWriteBody, buildRcFileSuggestionsPayload, buildRcGetContextUsagePayload, buildRcGetUsagePayload, buildRcInterruptPayload, buildRcKeepAlivePayload, buildRcMarkReadBody, buildRcMcpAuthenticatePayload, buildRcMcpOAuthCallbackUrlPayload, buildRcMcpReconnectPayload, buildRcMcpStatusPayload, buildRcReadFilePayload, buildRcSetModelPayload, buildRcSetPermissionModePayload, buildRcUserMessagePayload, carryOver, checkReportHasWarnings, checkReportToJson, collectCheckReport, collectDoctorReport, collectFrontDoorStatus, collectPoolPick, createControlApiRouter, createDoorApiNodeHandler, createDoorApiRouter, createDoorEventHub, createDoorHealthPublisher, createEventsApiRouter, createLaunchEventPublisher, createLeafCache, createProfile, createQuotaExpiringPublisher, createRcApiNodeHandler, createRcApiRouter, createRcControlHandler, createRcCredentialStore, createRcEventFanout, createRcLiveUsage, createRcSelfHostSurface, createRcSessionTracker, createRcStreamHub, createSseParser, describeProviderEndpoint, detectAmbientCredential, doorApiAuth, doorApiNodeHandlerOf, effectiveWindow, endRcSession, ensureCa, ensureFrontDoor, ensureHeadroom, evaluateAmbientCredentialGuard, evaluateWhen, fetchThroughWebProxy, formatAmbientCredentialGuardMessage, formatCheckReport, formatDoctorReport, formatFrontDoorStatus, forwardableHeaders, frontDoorApiClient, frontDoorApiFromState, frontDoorApiLink, frontDoorRcApiClient, frontDoorRcControl, generateCa, getRcSessionContextUsage, getRcSessionMcpStatus, getRcSessionUsage, headroomSocketTarget, identityExists, injectRcUserMessage, interruptRcSession, isIdentityDirectoryName, isInterceptedHost, isPrivateAddress, isRcContextUsageDetail, isRcPermissionMode, isRcReadFileEncoding, lateRcEventDial, lateRcStreamDial, listDirectoryRules, listIdentities, listProfiles, listProviders, listUsageSnapshots, matchBranch, mintLeaf, mintRcSelfHostCredential, observingRoutedRoute, parseConnectTarget, parseRcStreamEnvelope, planOf, poolIdentities, poolSelectedByLaunch, prepareClaudeLaunch, prepareLaunch, profileExists, providerExists, rankPool, rcEventWriteResultFromAnswer, rcFanoutOnDoorHub, rcObserverAsPassthrough, rcRateLimitInfoOf, rcSelfHostFromEnv, rcWebFetchAllowsPrivateFromEnv, readActiveIdentity, readDirectoryRules, readFarmManifest, readFrontDoorControlMaterial, readGlobalConfig, readIdentity, readPools, readProfile, readProvider, readRcSelfHostRecord, readRcSessionFile, readUsageSnapshot, realConnectCertStore, realConnectEffects, realRcControlTransport, realRcEventDial, realRcStreamDial, realRcWebFetch, reconnectRcSessionMcpServer, recoverFarm, recoveryDiagnostics, refreshLaunchPoolUsage, refreshPoolUsage, refreshStalePoolMembers, removeDirectoryRule, removeIdentity, removePool, removeProfile, removeProvider, requirePool, resolveAgentShimHome, resolveClaudeHome, resolveDecisions, resolveLaunchSelection, resolveLayoutPaths, resolveSupervisorConfig, resyncFarm, runCheck, runClaudeLaunch, runDoctor, runFrontDoorSupervisor, runLaunchPlan, runLauncher, runSupervisor, sendRcKeepAlive, servedByPipeline, setAllowAmbientCredential, setDefaultConfigProfile, setGlobalDefaultProfile, setIdentityCredential, setPool, setProfileCategories, setProfileEntries, setProfileLaunchFlags, setProfileMetadata, setRcSessionModel, setRcSessionPermissionMode, snapshotPath, spawnClaude, startConnectServer, submitRcSessionMcpOAuthCallbackUrl, suggestRcSessionFiles, teleportRcSession, topLevelNames, updateDirectoryRule, updateProvider, useIdentity, watchedInstallEntry, writeDirectoryRules };
8061
- export type { AddDirectoryRuleOptions, AddProviderInput, AmbientCredentialDetection, AmbientCredentialGuardResult, AmbientCredentialVar, AnthropicUsageRefresher, BuildEntryFactsParams, CaMaterial, Candidate, CarryOverParams, CarryOverResult, CategoryMap, CheckReport, CheckReportJson, CollectCheckReportParams, CollectDoctorReportParams, CompiledRule, ConditionContext, ConfigProfile, ConnectCertStore, ConnectEffects, ConnectLimits, ConnectLocalSurface, ConnectServerConfig, ConnectServerHandle, ConnectTarget, ControlApiClient, ControlApiDeps, ControlApiRouter, Credential, CredentialSource, Decision, Diagnostic, DirectoryRule, DirectoryRules, DoctorReport, DoorApiClient, DoorApiContext, DoorApiDeps, DoorApiRouter, DoorEvent, DoorEventHub, DoorEventPublisher, DoorEventStream, DoorEventsApiDeps, DoorHealthEvent, DoorHealthPublisher, EffectiveWindow, EliminatedRule, EnsureFrontDoorPorts, EnsureHeadroomPorts, EntryFact, EntryFacts, EntryValue, EvaluateAmbientCredentialGuardParams, FlattenedCascade, FrontDoorControlMaterial, FrontDoorRcControl, FrontDoorSessionStatus, FrontDoorStatus, FrontDoorSupervisorPorts, GlobalConfig, HeadroomSupervisorConfig, Identity, IdentityCredentialChange, IdentityListEntry, IdentityListing, InjectedCredential, LaunchDecision, LaunchEventPublisher, LaunchLifecycleEvent, LaunchPlan, LaunchPoolDecision, LaunchSelection, Layer, LayerId, LayoutPaths, LeafCert, NestedContribution, OwnExecutableStat, PlanClass, Pool, PoolMember, PoolPickReport, PoolRanking, PortableConfig, PrepareClaudeLaunchOptions, PrepareLaunchParams, ProfileListEntry, Provider, ProviderListEntry, QuotaExpiringEvent, QuotaExpiringPublisher, RankPoolInput, RcAnswerDecision, RcAnswerDeps, RcApiClient, RcApiDeps, RcApiRouter, RcContextUsageDetail, RcControlAnswer, RcControlHandlerDeps, RcControlRequestDeps, RcControlTransport, RcCredentialStore, RcDialAnswer, RcDialTarget, RcEventDial, RcEventFanout, RcEventWriteResult, RcExchangeObserver, RcInjectDeps, RcLiveRateLimit, RcLiveUsage, RcLiveUsageDeps, RcObservedCredential, RcObservedRequest, RcPendingRequestSummary, RcPermissionMode, RcPresenceAnswer, RcRateLimitInfo, RcRateLimitWindow, RcReadFileEncoding, RcReadFileOptions, RcSelfHostCredentialRecord, RcSelfHostDeps, RcSelfHostMintResult, RcSelfHostSurface, RcSessionStatus, RcSessionSummary, RcSessionTracker, RcSessionTrackerDeps, RcStreamAnswer, RcStreamDial, RcStreamEnvelope, RcStreamEvent, RcStreamHub, RcStreamHubDeps, RcWebFetchDeps, RcWebFetchHop, RcWebFetchOutcome, RcWebFetcher, RcWorkerFact, RcWriteHeaders, RecoverFarmParams, RecoveryResult, RefreshLaunchPoolUsageOptions, RefreshPoolUsageParams, RefreshStalePoolMembersParams, ResolveDecisionsInput, ResolveLaunchSelectionParams, ResolvedState, ResyncFarmParams, ResyncFarmResult, RunCheckParams, RunClaudeLaunchOptions, RunDoctorParams, RunFrontDoorSupervisorOptions, RunLauncherParams, RunSupervisorOptions, SpawnClaudeParams, SseParsedEvent, StickyPick, SupervisorPorts, UnreadableIdentityListEntry, UpdateDirectoryRuleOptions, UpdateProviderInput, UsageChangeEvent, UsageReadFs, UsageSnapshot, WhenCondition, WhenEvaluation };
8664
+ export { AMBIENT_CREDENTIAL_VARS, CHECK_CREDENTIAL_APPLIES, CONNECT_INTERCEPT_HOST, CONNECT_INTERCEPT_HOSTS, CONNECT_LIMITS, CONTROL_PATH_PREFIX, CategoryClassificationOverlaySchema, CategoryClassificationSchema, CategoryMapSchema, CheckReportJsonSchema, CheckRunInputSchema, CliError, CodexLogoutOutputSchema, CodexSignInSchema, CodexStatusOutputSchema, ConfigProfileSchema, CredentialCacheSchema, CredentialSchema, CredentialSourceSchema, DOOR_EVENT_BUFFER_EVENTS, DOOR_EVENT_SOURCE_RC, DOOR_HEALTH_EVENT_SOURCE, DirectoryRuleAlreadyExistsError, DirectoryRuleMissingTargetError, DirectoryRuleNotFoundError, DirectoryRuleSchema, DirectoryRulesSchema, DoctorFindingSchema, DoctorRunOutputSchema, DoorEventSchema, DoorEventSourceQuerySchema, DoorHealthEventSchema, EXIT_FAILURE, EXIT_USAGE, EffectiveWindowSchema, EntryValueSchema, FARM_MANIFEST_FILENAME, FrontDoorControlMaterialError, FrontDoorNotServingError, FrontDoorRestartOutputSchema, FrontDoorSessionStatusSchema, FrontDoorSessionsOutputSchema, FrontDoorStartError, FrontDoorStateSchema, FrontDoorStatusOutputSchema, GlobalConfigSchema, HeadroomSocketTargetSchema, HeadroomStartError, IdentityAlreadyExistsError, IdentityNotFoundError, IdentitySchema, InvalidCategoryNameError, InvalidIdentityNameError, InvalidProviderNameError, LAUNCH_EVENT_SOURCE, LaunchLifecycleEventSchema, LaunchRefusedError, LaunchResolveInputSchema, LaunchResolveOutputSchema, LegacyProviderFileError, 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, USAGE_EVENT_SOURCE, UpdateCheckOutputSchema, UsageError, UsageListOutputSchema, UsageLiveOutputSchema, UsageSnapshotError, UsageSnapshotSchema, UsageWindowsInputSchema, UsageWindowsOutputSchema, WhenSchema, addDirectoryRule, addIdentity, addPool, addProvider, agentShimCliPath, answerRcControlRequest, authenticateRcSessionMcpServer, buildEntryFacts, buildLayoutPaths, buildRcControlRequestPayload, buildRcControlResponsePayload, buildRcEndSessionPayload, buildRcEventWriteBody, buildRcFileSuggestionsPayload, buildRcGetContextUsagePayload, buildRcGetUsagePayload, buildRcInterruptPayload, buildRcKeepAlivePayload, buildRcMarkReadBody, buildRcMcpAuthenticatePayload, buildRcMcpOAuthCallbackUrlPayload, buildRcMcpReconnectPayload, buildRcMcpStatusPayload, buildRcReadFilePayload, buildRcSetModelPayload, buildRcSetPermissionModePayload, buildRcUserMessagePayload, carryOver, checkReportHasWarnings, checkReportToJson, collectCheckReport, collectDoctorReport, collectFrontDoorStatus, collectPoolPick, createCodexApiRouter, createControlApiRouter, createDoorApiNodeHandler, createDoorApiRouter, createDoorEventHub, createDoorHealthPublisher, createEventsApiRouter, createLaunchApiRouter, createLaunchEventPublisher, createLeafCache, createLifecycleApiRouter, createProfile, createQuotaExpiringPublisher, createRcApiNodeHandler, createRcApiRouter, createRcControlHandler, createRcCredentialStore, createRcEventFanout, createRcLiveUsage, createRcSelfHostSurface, createRcSessionTracker, createRcStreamHub, createSseParser, describeProviderEndpoint, detectAmbientCredential, doorApiAuth, doorApiNodeHandlerOf, effectiveWindow, endRcSession, ensureCa, ensureFrontDoor, ensureHeadroom, evaluateAmbientCredentialGuard, evaluateWhen, fetchThroughWebProxy, formatAmbientCredentialGuardMessage, formatCheckReport, formatDoctorReport, formatFrontDoorStatus, forwardableHeaders, frontDoorApiClient, frontDoorApiFromState, frontDoorApiLink, frontDoorRcApiClient, frontDoorRcControl, generateCa, getRcSessionContextUsage, getRcSessionMcpStatus, getRcSessionUsage, headroomSocketTarget, identityExists, injectRcUserMessage, interruptRcSession, isIdentityDirectoryName, isInterceptedHost, isPrivateAddress, isRcContextUsageDetail, isRcPermissionMode, isRcReadFileEncoding, lateRcEventDial, lateRcStreamDial, listDirectoryRules, listIdentities, listProfiles, listProviders, listUsageSnapshots, matchBranch, mintLeaf, mintRcSelfHostCredential, observingRoutedRoute, parseConnectTarget, parseRcStreamEnvelope, planOf, poolIdentities, poolSelectedByLaunch, prepareClaudeLaunch, prepareLaunch, profileExists, providerExists, rankPool, rcEventWriteResultFromAnswer, rcFanoutOnDoorHub, rcObserverAsPassthrough, rcRateLimitInfoOf, rcSelfHostFromEnv, rcWebFetchAllowsPrivateFromEnv, readActiveIdentity, readDirectoryRules, readFarmManifest, readFrontDoorControlMaterial, readGlobalConfig, readIdentity, readPools, readProfile, readProvider, readRcSelfHostRecord, readRcSessionFile, readUsageSnapshot, realConnectCertStore, realConnectEffects, realRcControlTransport, realRcEventDial, realRcStreamDial, realRcWebFetch, reconnectRcSessionMcpServer, recoverFarm, recoveryDiagnostics, refreshLaunchPoolUsage, refreshPoolUsage, refreshStalePoolMembers, removeDirectoryRule, removeIdentity, removePool, removeProfile, removeProvider, requirePool, resolveAgentShimHome, resolveClaudeHome, resolveClaudeLaunch, resolveDecisions, resolveLaunch, resolveLaunchSelection, resolveLayoutPaths, resolveSupervisorConfig, resyncFarm, runCheck, runClaudeLaunch, runDoctor, runFrontDoorSupervisor, runLaunchPlan, runLauncher, runSupervisor, sendRcKeepAlive, servedByPipeline, setAllowAmbientCredential, setDefaultConfigProfile, setGlobalDefaultProfile, setIdentityCredential, setPool, setProfileCategories, setProfileEntries, setProfileLaunchFlags, setProfileMetadata, setRcSessionModel, setRcSessionPermissionMode, snapshotPath, spawnClaude, startConnectServer, submitRcSessionMcpOAuthCallbackUrl, suggestRcSessionFiles, teleportRcSession, topLevelNames, updateDirectoryRule, updateProvider, useIdentity, watchedInstallEntry, writeDirectoryRules };
8665
+ export type { AddDirectoryRuleOptions, AddProviderInput, AmbientCredentialDetection, AmbientCredentialGuardResult, AmbientCredentialVar, AnthropicUsageRefresher, BuildEntryFactsParams, CaMaterial, Candidate, CarryOverParams, CarryOverResult, CategoryMap, CheckReport, CheckReportJson, ClaudeLaunchResolution, CodexApiClient, CodexApiDeps, CodexApiRouter, CollectCheckReportParams, CollectDoctorReportParams, CompiledRule, ConditionContext, ConfigProfile, ConnectCertStore, ConnectEffects, ConnectLimits, ConnectLocalSurface, ConnectServerConfig, ConnectServerHandle, ConnectTarget, ControlApiClient, ControlApiDeps, ControlApiRouter, Credential, CredentialSource, Decision, Diagnostic, DirectoryRule, DirectoryRules, DoctorReport, DoorApiClient, DoorApiContext, DoorApiDeps, DoorApiRouter, DoorEvent, DoorEventHub, DoorEventPublisher, DoorEventStream, DoorEventsApiDeps, DoorHealthEvent, DoorHealthPublisher, EffectiveWindow, EliminatedRule, EnsureFrontDoorPorts, EnsureHeadroomPorts, EntryFact, EntryFacts, EntryValue, EvaluateAmbientCredentialGuardParams, FlattenedCascade, FrontDoorControlMaterial, FrontDoorRcControl, FrontDoorSessionStatus, FrontDoorStatus, FrontDoorSupervisorPorts, GlobalConfig, HeadroomSupervisorConfig, Identity, IdentityCredentialChange, IdentityListEntry, IdentityListing, InjectedCredential, LaunchApiDeps, LaunchApiRouter, LaunchDecision, LaunchEventPublisher, LaunchLifecycleEvent, LaunchPlan, LaunchPoolDecision, LaunchResolution, LaunchSelection, Layer, LayerId, LayoutPaths, LeafCert, LifecycleApiClient, LifecycleApiDeps, LifecycleApiRouter, NestedContribution, OwnExecutableStat, PlanClass, Pool, PoolMember, PoolPickReport, PoolRanking, PortableConfig, PrepareClaudeLaunchOptions, PrepareLaunchParams, ProfileListEntry, Provider, ProviderListEntry, QuotaExpiringEvent, QuotaExpiringPublisher, RankPoolInput, RcAnswerDecision, RcAnswerDeps, RcApiClient, RcApiDeps, RcApiRouter, RcContextUsageDetail, RcControlAnswer, RcControlHandlerDeps, RcControlRequestDeps, RcControlTransport, RcCredentialStore, RcDialAnswer, RcDialTarget, RcEventDial, RcEventFanout, RcEventWriteResult, RcExchangeObserver, RcInjectDeps, RcLiveRateLimit, RcLiveUsage, RcLiveUsageDeps, RcObservedCredential, RcObservedRequest, RcPendingRequestSummary, RcPermissionMode, RcPresenceAnswer, RcRateLimitInfo, RcRateLimitWindow, RcReadFileEncoding, RcReadFileOptions, RcSelfHostCredentialRecord, RcSelfHostDeps, RcSelfHostMintResult, RcSelfHostSurface, RcSessionStatus, RcSessionSummary, RcSessionTracker, RcSessionTrackerDeps, RcStreamAnswer, RcStreamDial, RcStreamEnvelope, RcStreamEvent, RcStreamHub, RcStreamHubDeps, RcWebFetchDeps, RcWebFetchHop, RcWebFetchOutcome, RcWebFetcher, RcWorkerFact, RcWriteHeaders, RecoverFarmParams, RecoveryResult, RefreshLaunchPoolUsageOptions, RefreshPoolUsageParams, RefreshStalePoolMembersParams, ResolveClaudeLaunchOptions, ResolveDecisionsInput, ResolveLaunchSelectionParams, ResolvedState, ResyncFarmParams, ResyncFarmResult, RunCheckParams, RunClaudeLaunchOptions, RunDoctorParams, RunFrontDoorSupervisorOptions, RunLauncherParams, RunSupervisorOptions, SpawnClaudeParams, SseParsedEvent, StickyPick, SupervisorPorts, UnreadableIdentityListEntry, UpdateDirectoryRuleOptions, UpdateProviderInput, UsageChangeEvent, UsageReadFs, UsageSnapshot, WhenCondition, WhenEvaluation };