agent-shim 8.22.0 → 8.24.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.
@@ -542,6 +542,11 @@ declare const HeadroomGlobalConfigSchema: z.ZodObject<{
542
542
  readMaturation: z.ZodOptional<z.ZodBoolean>;
543
543
  }, z.core.$strict>;
544
544
  type HeadroomGlobalConfig = z.infer<typeof HeadroomGlobalConfigSchema>;
545
+ /**
546
+ * The launch-time update modes. `off` never touches the network at launch; `notify` checks for a newer release on a cooldown and prints one line naming it and the command to apply it; `auto` additionally applies the update in the background.
547
+ */
548
+ declare const UPDATE_MODES: readonly ["off", "notify", "auto"];
549
+ type UpdateMode = (typeof UPDATE_MODES)[number];
545
550
  /** The user-global `~/.agent-shim/config.json`. */
546
551
  declare const GlobalConfigSchema: z.ZodObject<{
547
552
  $schema: z.ZodOptional<z.ZodString>;
@@ -602,6 +607,13 @@ declare const GlobalConfigSchema: z.ZodObject<{
602
607
  frontdoor: z.ZodOptional<z.ZodObject<{
603
608
  idleShutdownMinutes: z.ZodOptional<z.ZodNumber>;
604
609
  }, z.core.$strict>>;
610
+ update: z.ZodOptional<z.ZodObject<{
611
+ mode: z.ZodOptional<z.ZodEnum<{
612
+ auto: "auto";
613
+ off: "off";
614
+ notify: "notify";
615
+ }>>;
616
+ }, z.core.$strict>>;
605
617
  pools: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
606
618
  identities: z.ZodArray<z.ZodString>;
607
619
  preference: z.ZodOptional<z.ZodEnum<{
@@ -1763,7 +1775,7 @@ interface FrontDoorRoute {
1763
1775
  }
1764
1776
 
1765
1777
  /**
1766
- * Remote Control session tracking and the client-half writes the front door performs: the record of the `cse_` sessions whose traffic crosses its terminated API-host session, the prompt injected into one, the answer delivered to one of its pending control requests, and the client-originated control requests sent into one (interrupt, set_model, set_permission_mode).
1778
+ * Remote Control session tracking: the record of the `cse_` sessions whose traffic crosses the door's terminated API-host session, and of the control requests awaiting an answer inside them. The client-half writes themselves (the prompt inject, the `control_response` answer, and every client-originated control request) live in `rcWrites.ts`, built on the observed credential this tracker holds.
1767
1779
  *
1768
1780
  * The tracker is observational: the door already terminates the API host's TLS, so it sees the CLI's own `POST /v1/code/sessions` (whose answer carries the new session's `cse_` id) and every recurring `/v1/code/sessions/...` call (heartbeat, presence), each carrying the session's Authorization bearer and the protocol headers a client-half replay needs. Per session the tracker retains the latest of each, because those calls recur and the freshest value is the live one. It also reads the request bodies of the exchanges whose payloads matter: the worker's event batches (whose `control_request` payloads, `can_use_tool` above all, are the approvals awaiting an answer), the worker heartbeats (whose bodies carry `idle_seconds`), the worker registration (whose body carries the worker state), and the client-half event writes (whose `control_response` payloads complete a pending request). Everything is held in this process's memory only: nothing here is written to a log, to the capture, or to disk, and the summary the control surface lists never includes the credential. The capture's existing redaction is untouched; a capture and this tracker observe the same exchanges through entirely separate paths.
1769
1781
  *
@@ -1880,6 +1892,14 @@ declare function observingRoutedRoute(route: FrontDoorRoute, tracker: RcSessionT
1880
1892
  }): FrontDoorRoute;
1881
1893
  /** Adapts the tracker's exchange observer to the passthrough forwarding's observer shape, so the connect test world (which forwards rather than routes) observes through the same tracker. */
1882
1894
  declare function rcObserverAsPassthrough(observer: RcExchangeObserver): PassthroughObserver;
1895
+
1896
+ /**
1897
+ * The Remote Control client-half writes: the payload builders, the write engine and one typed operation per control verb the door can send into an observed session, every one an event write to `/v1/code/sessions/{id}/events` over the door's interception-proof dials, authenticated by the observed bearer and protocol headers the tracker (`rcSessions.ts`) holds.
1898
+ *
1899
+ * Every request-shaped write goes through one envelope builder (`buildRcControlRequestPayload`) so the family cannot drift apart in shape, and one delivery engine (`deliverRcClientPayload`, module-local) so the two credential guards, the dial and the sequence-cursor advance exist exactly once. The fields each subtype carries are the SDK's own (`@anthropic-ai/claude-agent-sdk` `sdk.d.ts`) where it declares the subtype, and the CLI bundle's own request builders where it does not (`mcp_authenticate`, `mcp_oauth_callback_url`), each named in its builder's doc comment.
1900
+ *
1901
+ * A write that carried a `control_request` returns the request id it minted, because the worker's `control_response` echoes exactly that id on the stream the door already fans out: a consumer that wants the answer matches it there, and the id is surfaced by the result since only the door ever knew it.
1902
+ */
1883
1903
  /**
1884
1904
  * Builds the user-message payload event for one injected prompt: the Agent SDK stream-json `user` message shape (`type`, `uuid`, `session_id`, `parent_tool_use_id`, `message` with a `user` role), the same envelope a claude.ai client sends as a turn. The content is the plain string form, which is the shape validated end to end against the real API by the third-party client survey that settled this protocol.
1885
1905
  */
@@ -1901,10 +1921,13 @@ interface RcDialAnswer {
1901
1921
  interface RcEventDial {
1902
1922
  readonly writeEvents: (sessionId: string, headers: Readonly<Record<string, string>>, body: string) => Promise<RcDialAnswer>;
1903
1923
  }
1904
- /** What one client-half write produced: the sequence numbers the real service assigned, or a verbose failure message ready to show a user. */
1924
+ /**
1925
+ * What one client-half write produced: the sequence numbers the real service assigned, or a verbose failure message ready to show a user. A write that carried a `control_request` also names the request id it minted, because the worker's `control_response` echoes exactly that id on the stream: a consumer that wants the answer matches it there, and the id is surfaced here since only the door ever knew it.
1926
+ */
1905
1927
  type RcEventWriteResult = {
1906
1928
  readonly ok: true;
1907
1929
  readonly sequenceNums: readonly number[];
1930
+ readonly requestId?: string;
1908
1931
  } | {
1909
1932
  readonly ok: false;
1910
1933
  readonly message: string;
@@ -1947,7 +1970,11 @@ type RcPermissionMode = (typeof RC_PERMISSION_MODES)[number];
1947
1970
  /** Whether a value is one of the SDK's own permission modes, the narrowing the CLI and the control route apply to untrusted input. */
1948
1971
  declare function isRcPermissionMode(value: unknown): value is RcPermissionMode;
1949
1972
  /**
1950
- * Builds the `control_request` payload event for one interrupt: the SDK's request envelope (`SDKControlRequest`: `type`, `request_id`, `request`), carrying the `interrupt` subtype's own shape (`subtype` alone; its optional `cancel_queued` is absent, which the SDK reads as false, so queued commands survive the interrupt exactly as a plain stop button's would). The request id is the caller's minted uuid, the id the worker's `control_response` echoes.
1973
+ * Builds the `control_request` payload event's envelope around one subtype's own request shape: the SDK's own envelope (`SDKControlRequest`: `type`, `request_id`, `request`), with the request id the caller minted, the id the worker's `control_response` echoes. Every client-originated control request below goes through this one envelope so the family cannot drift apart in shape.
1974
+ */
1975
+ declare function buildRcControlRequestPayload(requestId: string, request: Record<string, unknown>): Record<string, unknown>;
1976
+ /**
1977
+ * Builds the `control_request` payload event for one interrupt: the SDK's request envelope, carrying the `interrupt` subtype's own shape (`subtype` alone; its optional `cancel_queued` is absent, which the SDK reads as false, so queued commands survive the interrupt exactly as a plain stop button's would). The request id is the caller's minted uuid, the id the worker's `control_response` echoes.
1951
1978
  */
1952
1979
  declare function buildRcInterruptPayload(requestId: string): Record<string, unknown>;
1953
1980
  /**
@@ -1958,6 +1985,69 @@ declare function buildRcSetModelPayload(requestId: string, model: string): Recor
1958
1985
  * Builds the `control_request` payload event for one permission-mode change: the SDK's request envelope carrying the `set_permission_mode` subtype's own shape, whose one field is the `mode` from the SDK's own `PermissionMode` enum (`RC_PERMISSION_MODES`).
1959
1986
  */
1960
1987
  declare function buildRcSetPermissionModePayload(requestId: string, mode: RcPermissionMode): Record<string, unknown>;
1988
+ /**
1989
+ * Builds the `control_request` payload event for one session end: the SDK's request envelope carrying the `end_session` subtype's own shape, whose one field is the optional `reason` string (the CLI's own sender passes `reason: "session_not_found"` and its receiver logs `reason ?? "unspecified"`, both verified in the 2.1.267 bundle; an omitted reason is the protocol's own unnamed form, so the builder omits the field entirely rather than sending an empty string).
1990
+ */
1991
+ declare function buildRcEndSessionPayload(requestId: string, reason: string | undefined): Record<string, unknown>;
1992
+ /**
1993
+ * Builds the `control_request` payload event for one usage query: the SDK's request envelope carrying the `get_usage` subtype's own shape, whose one field is the optional `skip_behaviors` boolean (the CLI's own client sends the field only when true, so this builder does the same; the SDK documents the field as skipping the local-transcript scan that fills the response's behaviours section).
1994
+ */
1995
+ declare function buildRcGetUsagePayload(requestId: string, skipBehaviors: boolean | undefined): Record<string, unknown>;
1996
+ /**
1997
+ * The detail levels the SDK's own `get_context_usage` control request accepts: exactly the strings its `detail` field declares (`'summary' | 'full'`), nothing looser. A runtime list as well as a type, because the CLI and the control route both narrow untrusted strings through it before a write is ever attempted.
1998
+ */
1999
+ declare const RC_CONTEXT_USAGE_DETAILS: readonly ["summary", "full"];
2000
+ /** One detail level the SDK's `get_context_usage` control request accepts. */
2001
+ type RcContextUsageDetail = (typeof RC_CONTEXT_USAGE_DETAILS)[number];
2002
+ /** Whether a value is one of the SDK's own context-usage detail levels, the narrowing the CLI and the control route apply to untrusted input. */
2003
+ declare function isRcContextUsageDetail(value: unknown): value is RcContextUsageDetail;
2004
+ /**
2005
+ * Builds the `control_request` payload event for one context-usage query: the SDK's request envelope carrying the `get_context_usage` subtype's own shape, whose one field is the optional `detail` level (`'summary'` or `'full'`, defaulting to `'full'` server-side when omitted, so the builder omits the field rather than restating the default).
2006
+ */
2007
+ declare function buildRcGetContextUsagePayload(requestId: string, detail: RcContextUsageDetail | undefined): Record<string, unknown>;
2008
+ /**
2009
+ * The encodings the SDK's own `read_file` control request accepts: exactly the strings its `encoding` field declares, nothing looser. A runtime list as well as a type, because the CLI and the control route both narrow untrusted strings through it before a write is ever attempted.
2010
+ */
2011
+ declare const RC_READ_FILE_ENCODINGS: readonly ["utf-8", "base64"];
2012
+ /** One encoding the SDK's `read_file` control request accepts. */
2013
+ type RcReadFileEncoding = (typeof RC_READ_FILE_ENCODINGS)[number];
2014
+ /** Whether a value is one of the SDK's own read-file encodings, the narrowing the CLI and the control route apply to untrusted input. */
2015
+ declare function isRcReadFileEncoding(value: unknown): value is RcReadFileEncoding;
2016
+ /** The optional parts of one read-file request: the byte cap and the encoding the SDK's own fields name. */
2017
+ interface RcReadFileOptions {
2018
+ /** The `max_bytes` cap, a positive number of bytes. */
2019
+ readonly maxBytes?: number;
2020
+ /** The `encoding` the answer's `contents` carry; the SDK's own default is `utf-8`. */
2021
+ readonly encoding?: RcReadFileEncoding;
2022
+ }
2023
+ /**
2024
+ * Builds the `control_request` payload event for one file read: the SDK's request envelope carrying the `read_file` subtype's own shape, whose fields are the required `path` string and the optional `max_bytes` number and `encoding` level (`'utf-8' | 'base64'`), each sent only when the caller named it (the CLI's own client builds exactly this shape, verified in the 2.1.267 bundle).
2025
+ */
2026
+ declare function buildRcReadFilePayload(requestId: string, path: string, options: RcReadFileOptions | undefined): Record<string, unknown>;
2027
+ /**
2028
+ * Builds the `control_request` payload event for one file-suggestion query: the SDK's request envelope carrying the `file_suggestions` subtype's own shape, whose one required field is the `query` string (the partial path prefix the TUI's at-mention autocomplete fuzzy-matches; the SDK imposes no minimum, so an empty query is sent as the empty prefix it is).
2029
+ */
2030
+ declare function buildRcFileSuggestionsPayload(requestId: string, query: string): Record<string, unknown>;
2031
+ /**
2032
+ * Builds the `control_request` payload event for one MCP status query: the SDK's request envelope carrying the `mcp_status` subtype's own shape, which declares no fields of its own (the CLI's own client requests it the same way and reads its answer's `mcpServers`).
2033
+ */
2034
+ declare function buildRcMcpStatusPayload(requestId: string): Record<string, unknown>;
2035
+ /**
2036
+ * Builds the `control_request` payload event for one MCP server reconnect: the SDK's request envelope carrying the `mcp_reconnect` subtype's own shape, whose one field is the `serverName` string (the casing the SDK and the CLI's own client both use for this family, unlike the snake_case the older subtypes carry).
2037
+ */
2038
+ declare function buildRcMcpReconnectPayload(requestId: string, serverName: string): Record<string, unknown>;
2039
+ /**
2040
+ * Builds the `control_request` payload event for one MCP OAuth handshake start: the SDK's request envelope carrying the `mcp_authenticate` subtype's own shape, whose fields are the `serverName` and the `redirectUri` the server's OAuth flow redirects back to (the exact object the CLI's own `mcpAuthenticate` builds, verified in the 2.1.267 bundle; this subtype is absent from the published SDK types, so the bundle is the field's only source).
2041
+ */
2042
+ declare function buildRcMcpAuthenticatePayload(requestId: string, serverName: string, redirectUri: string): Record<string, unknown>;
2043
+ /**
2044
+ * Builds the `control_request` payload event for one MCP OAuth callback hand-in: the SDK's request envelope carrying the `mcp_oauth_callback_url` subtype's own shape, whose fields are the `serverName` and the `callbackUrl` the browser landed on (the exact object the CLI's own `mcpSubmitOAuthCallbackUrl` builds, verified in the 2.1.267 bundle; this subtype is absent from the published SDK types, so the bundle is the field's only source).
2045
+ */
2046
+ declare function buildRcMcpOAuthCallbackUrlPayload(requestId: string, serverName: string, callbackUrl: string): Record<string, unknown>;
2047
+ /**
2048
+ * Builds the liveness payload event on its own, with no request envelope around it: the SDK's own `SDKKeepAliveMessage` is a top-level stream payload (`type` alone, no `request_id`, no `request`), which either side may send at any time and receivers must ignore, so this is the one client-half write that neither expects nor can receive an answer. The CLI's own transports write exactly this object into their event streams, verified in the 2.1.267 bundle.
2049
+ */
2050
+ declare function buildRcKeepAlivePayload(): Record<string, unknown>;
1961
2051
  /** Everything one answer needs, injected so the decision logic runs against fakes in unit tests. */
1962
2052
  interface RcAnswerDeps {
1963
2053
  /** Reads the observed credential for a session: the tracker's accessor, in production. */
@@ -1987,17 +2077,57 @@ interface RcControlRequestDeps {
1987
2077
  readonly newUuid: () => string;
1988
2078
  }
1989
2079
  /**
1990
- * Interrupts one observed session's running turn: the same documented client-half write the inject and answer paths perform, carrying the SDK's `control_request` envelope for the `interrupt` subtype, authenticated by the observed bearer and protocol headers. The result is the sequence numbers the real service assigned, or a verbose failure. A dial that cannot reach the API host is reported rather than thrown, so a caller with no exception handling still shows the user exactly what failed.
2080
+ * Interrupts one observed session's running turn: the same documented client-half write the inject and answer paths perform, carrying the SDK's `control_request` envelope for the `interrupt` subtype, authenticated by the observed bearer and protocol headers. The result names the minted request id (the id the worker's `control_response` echoes on the stream) and the sequence numbers the real service assigned, or a verbose failure. A dial that cannot reach the API host is reported rather than thrown, so a caller with no exception handling still shows the user exactly what failed.
1991
2081
  */
1992
2082
  declare function interruptRcSession(deps: RcControlRequestDeps, sessionId: string): Promise<RcEventWriteResult>;
1993
2083
  /**
1994
- * Sets the model one observed session's subsequent turns use: the same documented client-half write the inject and answer paths perform, carrying the SDK's `control_request` envelope for the `set_model` subtype with the model id its own field names. The id is validated only as non-empty, because the SDK's field gives the empty-free forms their own meaning (omitted or null resets to the session default) and this operation sends neither. The result is the sequence numbers the real service assigned, or a verbose failure.
2084
+ * Sets the model one observed session's subsequent turns use: the same documented client-half write the inject and answer paths perform, carrying the SDK's `control_request` envelope for the `set_model` subtype with the model id its own field names. The id is validated only as non-empty, because the SDK's field gives the empty-free forms their own meaning (omitted or null resets to the session default) and this operation sends neither. The result names the minted request id and the sequence numbers the real service assigned, or a verbose failure.
1995
2085
  */
1996
2086
  declare function setRcSessionModel(deps: RcControlRequestDeps, sessionId: string, model: string): Promise<RcEventWriteResult>;
1997
2087
  /**
1998
- * Sets one observed session's permission mode: the same documented client-half write the inject and answer paths perform, carrying the SDK's `control_request` envelope for the `set_permission_mode` subtype with a mode from the SDK's own enum (`RC_PERMISSION_MODES`; the type accepts nothing looser, and the CLI and control route narrow untrusted strings through `isRcPermissionMode` before they ever reach this operation). The result is the sequence numbers the real service assigned, or a verbose failure.
2088
+ * Sets one observed session's permission mode: the same documented client-half write the inject and answer paths perform, carrying the SDK's `control_request` envelope for the `set_permission_mode` subtype with a mode from the SDK's own enum (`RC_PERMISSION_MODES`; the type accepts nothing looser, and the CLI and control route narrow untrusted strings through `isRcPermissionMode` before they ever reach this operation). The result names the minted request id and the sequence numbers the real service assigned, or a verbose failure.
1999
2089
  */
2000
2090
  declare function setRcSessionPermissionMode(deps: RcControlRequestDeps, sessionId: string, mode: RcPermissionMode): Promise<RcEventWriteResult>;
2091
+ /**
2092
+ * Ends one observed session: the documented client-half write carrying the SDK's `control_request` envelope for the `end_session` subtype, the request whose receipt makes the worker abort its turn and shut down by its own rules (verified in the CLI's source: its print loop logs `end_session received` and ends the child). The reason is optional and sent only when non-empty, because the receiver reads an absent reason as its own "unspecified" form and an empty string is neither. The result names the minted request id and the sequence numbers the real service assigned, or a verbose failure.
2093
+ */
2094
+ declare function endRcSession(deps: RcControlRequestDeps, sessionId: string, reason: string | undefined): Promise<RcEventWriteResult>;
2095
+ /**
2096
+ * Asks one observed session's worker for its structured usage: the documented client-half write carrying the SDK's `control_request` envelope for the `get_usage` subtype. The worker's answer (session cost and usage totals plus the plan's rate-limit utilisation) arrives later as the `control_response` echoing the minted request id on the stream the door already fans out, which is why the result names that id; the door invents no usage state of its own.
2097
+ */
2098
+ declare function getRcSessionUsage(deps: RcControlRequestDeps, sessionId: string, skipBehaviors: boolean | undefined): Promise<RcEventWriteResult>;
2099
+ /**
2100
+ * Asks one observed session's worker for its context-window breakdown: the documented client-half write carrying the SDK's `control_request` envelope for the `get_context_usage` subtype. The worker's answer (the per-category breakdown) arrives later as the `control_response` echoing the minted request id on the stream the door already fans out; the detail level is the SDK's own enum, narrowed by `isRcContextUsageDetail` before this operation is reached.
2101
+ */
2102
+ declare function getRcSessionContextUsage(deps: RcControlRequestDeps, sessionId: string, detail: RcContextUsageDetail | undefined): Promise<RcEventWriteResult>;
2103
+ /**
2104
+ * Asks one observed session's worker to read one file from the session filesystem: the documented client-half write carrying the SDK's `control_request` envelope for the `read_file` subtype, the request the remote sidebar viewer rides. The path is resolved by the worker against its own cwd and gated by its own read-permission rules; the answer (the contents) arrives later as the `control_response` echoing the minted request id on the stream the door already fans out.
2105
+ */
2106
+ declare function readRcSessionFile(deps: RcControlRequestDeps, sessionId: string, path: string, options: RcReadFileOptions | undefined): Promise<RcEventWriteResult>;
2107
+ /**
2108
+ * Asks one observed session's worker for its at-mention file suggestions: the documented client-half write carrying the SDK's `control_request` envelope for the `file_suggestions` subtype, the request the TUI's own autocomplete rides, answered with the same fuzzy-matched results. The answer arrives later as the `control_response` echoing the minted request id on the stream the door already fans out; the query may be empty, because the SDK's own field imposes no minimum and an empty prefix is the autocomplete's root listing.
2109
+ */
2110
+ declare function suggestRcSessionFiles(deps: RcControlRequestDeps, sessionId: string, query: string): Promise<RcEventWriteResult>;
2111
+ /**
2112
+ * Asks one observed session's worker for the status of its MCP server connections: the documented client-half write carrying the SDK's `control_request` envelope for the `mcp_status` subtype, which declares no fields of its own. The answer arrives later as the `control_response` echoing the minted request id on the stream the door already fans out.
2113
+ */
2114
+ declare function getRcSessionMcpStatus(deps: RcControlRequestDeps, sessionId: string): Promise<RcEventWriteResult>;
2115
+ /**
2116
+ * Asks one observed session's worker to reconnect one MCP server: the documented client-half write carrying the SDK's `control_request` envelope for the `mcp_reconnect` subtype, whose one field is the server name exactly as `mcp_status` reports it. The answer arrives later as the `control_response` echoing the minted request id on the stream the door already fans out.
2117
+ */
2118
+ declare function reconnectRcSessionMcpServer(deps: RcControlRequestDeps, sessionId: string, serverName: string): Promise<RcEventWriteResult>;
2119
+ /**
2120
+ * Starts one MCP server's OAuth handshake on an observed session: the documented client-half write carrying the `control_request` envelope for the `mcp_authenticate` subtype, whose fields name the server and the redirect URI its OAuth flow redirects back to. The answer arrives later as the `control_response` echoing the minted request id on the stream the door already fans out.
2121
+ */
2122
+ declare function authenticateRcSessionMcpServer(deps: RcControlRequestDeps, sessionId: string, serverName: string, redirectUri: string): Promise<RcEventWriteResult>;
2123
+ /**
2124
+ * Hands one MCP server's OAuth callback to an observed session's worker: the documented client-half write carrying the `control_request` envelope for the `mcp_oauth_callback_url` subtype, whose fields name the server and the callback URL the browser landed on, completing the handshake `mcp_authenticate` started. The answer arrives later as the `control_response` echoing the minted request id on the stream the door already fans out.
2125
+ */
2126
+ declare function submitRcSessionMcpOAuthCallbackUrl(deps: RcControlRequestDeps, sessionId: string, serverName: string, callbackUrl: string): Promise<RcEventWriteResult>;
2127
+ /**
2128
+ * Sends one liveness heartbeat into an observed session: the documented client-half write carrying the `keep_alive` payload on its own, with no request envelope, because the SDK declares it a top-level stream message either side may send at any time and receivers must ignore. The minted sequence numbers confirm delivery and nothing else will ever answer, which is the payload's own contract; this write is how a door-driven client keeps its half of the stream warm without saying anything.
2129
+ */
2130
+ declare function sendRcKeepAlive(deps: RcControlRequestDeps, sessionId: string): Promise<RcEventWriteResult>;
2001
2131
 
2002
2132
  /**
2003
2133
  * How long a failed attachment backs off before retrying. Not a fresh number: it is the session's own liveness bound (`RC_IDLE_EXPIRY_MS`, the 45 s stream timeout the tracker's idle expiry already derives from), so an attachment that cannot be re-established retries at exactly the cadence the protocol itself gives up on a quiet session at. Production passes that constant; tests pass small values so a backoff is reached in milliseconds.
@@ -2129,7 +2259,7 @@ declare function realRcStreamDial(target?: RcDialTarget): RcStreamDial;
2129
2259
  declare function realConnectEffects(ports?: SourcePortRange): ConnectEffects;
2130
2260
 
2131
2261
  /**
2132
- * The Remote Control control surface: the small HTTP namespace the serving door answers on its provider listener, next to `/healthz`, through which `agent-shim frontdoor rc` lists the observed sessions, reports each one's status and pending control requests, injects a prompt into one, answers one of its pending requests, and sends its own control requests into one (interrupt, set-model, set-permission-mode).
2262
+ * The Remote Control control surface: the small HTTP namespace the serving door answers on its provider listener, next to `/healthz`, through which `agent-shim frontdoor rc` lists the observed sessions, reports each one's status and pending control requests, injects a prompt into one, answers one of its pending requests, and sends its own control requests into one (interrupt, set-model, set-permission-mode, and the wider client-half verb family: end-session, the usage and context queries, read-file, file-suggestions, keep-alive, and the mcp_* family).
2133
2263
  *
2134
2264
  * This rides the listener `frontdoor status` already knows the door by (its address comes from the same state file, its trust anchor from the same CA path) rather than any second channel. The routes sit under one prefix the routed pipeline never serves, and every request must present the serving generation's control token as a Bearer credential: a fresh random value per door start, written owner-only under the front door's state directory so only this user's CLI can read it, and checked in constant time like every other capability the door accepts. An inject, answer or control request is carried out by the door itself over its interception-proof dials, which is the whole point: the CLI never dials the API host directly, so nothing about the write depends on the caller's own network path.
2135
2265
  */
@@ -2155,6 +2285,26 @@ interface RcControlHandlerDeps {
2155
2285
  readonly setModel: (sessionId: string, model: string) => Promise<RcEventWriteResult>;
2156
2286
  /** The set-permission-mode operation, already wired to the tracker and the door's API-host dial. */
2157
2287
  readonly setPermissionMode: (sessionId: string, mode: RcPermissionMode) => Promise<RcEventWriteResult>;
2288
+ /** The end-session operation, already wired to the tracker and the door's API-host dial. */
2289
+ readonly endSession: (sessionId: string, reason: string | undefined) => Promise<RcEventWriteResult>;
2290
+ /** The get-usage operation, already wired to the tracker and the door's API-host dial. */
2291
+ readonly getUsage: (sessionId: string, skipBehaviors: boolean | undefined) => Promise<RcEventWriteResult>;
2292
+ /** The get-context-usage operation, already wired to the tracker and the door's API-host dial. */
2293
+ readonly getContextUsage: (sessionId: string, detail: RcContextUsageDetail | undefined) => Promise<RcEventWriteResult>;
2294
+ /** The read-file operation, already wired to the tracker and the door's API-host dial. */
2295
+ readonly readFile: (sessionId: string, path: string, options: RcReadFileOptions | undefined) => Promise<RcEventWriteResult>;
2296
+ /** The file-suggestions operation, already wired to the tracker and the door's API-host dial. */
2297
+ readonly fileSuggestions: (sessionId: string, query: string) => Promise<RcEventWriteResult>;
2298
+ /** The keep-alive operation, already wired to the tracker and the door's API-host dial. */
2299
+ readonly keepAlive: (sessionId: string) => Promise<RcEventWriteResult>;
2300
+ /** The mcp-status operation, already wired to the tracker and the door's API-host dial. */
2301
+ readonly mcpStatus: (sessionId: string) => Promise<RcEventWriteResult>;
2302
+ /** The mcp-reconnect operation, already wired to the tracker and the door's API-host dial. */
2303
+ readonly mcpReconnect: (sessionId: string, serverName: string) => Promise<RcEventWriteResult>;
2304
+ /** The mcp-authenticate operation, already wired to the tracker and the door's API-host dial. */
2305
+ readonly mcpAuthenticate: (sessionId: string, serverName: string, redirectUri: string) => Promise<RcEventWriteResult>;
2306
+ /** The mcp-oauth-callback-url operation, already wired to the tracker and the door's API-host dial. */
2307
+ readonly mcpOAuthCallbackUrl: (sessionId: string, serverName: string, callbackUrl: string) => Promise<RcEventWriteResult>;
2158
2308
  }
2159
2309
  /**
2160
2310
  * Builds the control handler the provider listener serves under `CONTROL_PATH_PREFIX`. Every route demands the generation's control token first, so nothing about the sessions (their ids, their timing, and most of all the prompts and approvals carried into them) is reachable by a process that did not read the owner-only token file.
@@ -2176,7 +2326,7 @@ interface RcControlTransport {
2176
2326
  }
2177
2327
  /** The real transport: HTTPS to the door's provider listener on loopback, trusting only the CA file the door's own state names, so a process merely holding the port cannot answer as the door. */
2178
2328
  declare function realRcControlTransport(port: number, ca: string): RcControlTransport;
2179
- /** The door-facing client the `frontdoor rc` verbs use: the session list, the status and pending reads, the inject and answer operations, and the door's own control requests (interrupt, set-model, set-permission-mode), over the injected transport. */
2329
+ /** The door-facing client the `frontdoor rc` verbs use: the session list, the status and pending reads, the inject and answer operations, and the door's own control requests (interrupt, set-model, set-permission-mode, and the wider verb family: end-session, the usage and context queries, read-file, file-suggestions, keep-alive, and the mcp_* family), over the injected transport. */
2180
2330
  interface FrontDoorRcControl {
2181
2331
  /** The observed sessions, oldest-created first. Throws with the door's verbose reason when the list cannot be had. */
2182
2332
  readonly listSessions: () => Promise<readonly RcSessionSummary[]>;
@@ -2188,12 +2338,32 @@ interface FrontDoorRcControl {
2188
2338
  readonly sendPrompt: (sessionId: string, text: string) => Promise<RcEventWriteResult>;
2189
2339
  /** Answers one pending control request, returning the sequence numbers the real service assigned or the verbose failure. */
2190
2340
  readonly answerRequest: (sessionId: string, requestId: string, decision: RcAnswerDecision) => Promise<RcEventWriteResult>;
2191
- /** Interrupts one session's running turn, returning the sequence numbers the real service assigned or the verbose failure. */
2341
+ /** Interrupts one session's running turn, returning the minted request id and the sequence numbers the real service assigned, or the verbose failure. */
2192
2342
  readonly interruptSession: (sessionId: string) => Promise<RcEventWriteResult>;
2193
- /** Sets the model one session's subsequent turns use, returning the sequence numbers the real service assigned or the verbose failure. */
2343
+ /** Sets the model one session's subsequent turns use, returning the minted request id and the sequence numbers the real service assigned, or the verbose failure. */
2194
2344
  readonly setModel: (sessionId: string, model: string) => Promise<RcEventWriteResult>;
2195
- /** Sets one session's permission mode, returning the sequence numbers the real service assigned or the verbose failure. */
2345
+ /** Sets one session's permission mode, returning the minted request id and the sequence numbers the real service assigned, or the verbose failure. */
2196
2346
  readonly setPermissionMode: (sessionId: string, mode: RcPermissionMode) => Promise<RcEventWriteResult>;
2347
+ /** Ends one session, returning the minted request id and the sequence numbers the real service assigned, or the verbose failure. */
2348
+ readonly endSession: (sessionId: string, reason: string | undefined) => Promise<RcEventWriteResult>;
2349
+ /** Asks one session's worker for its structured usage, returning the minted request id (the id its `control_response` answer echoes) and the sequence numbers, or the verbose failure. */
2350
+ readonly getUsage: (sessionId: string, skipBehaviors: boolean | undefined) => Promise<RcEventWriteResult>;
2351
+ /** Asks one session's worker for its context-window breakdown, returning the minted request id and the sequence numbers, or the verbose failure. */
2352
+ readonly getContextUsage: (sessionId: string, detail: RcContextUsageDetail | undefined) => Promise<RcEventWriteResult>;
2353
+ /** Asks one session's worker to read one file, returning the minted request id and the sequence numbers, or the verbose failure. */
2354
+ readonly readFile: (sessionId: string, path: string, options: RcReadFileOptions | undefined) => Promise<RcEventWriteResult>;
2355
+ /** Asks one session's worker for its at-mention file suggestions, returning the minted request id and the sequence numbers, or the verbose failure. */
2356
+ readonly fileSuggestions: (sessionId: string, query: string) => Promise<RcEventWriteResult>;
2357
+ /** Sends one liveness heartbeat into a session, returning the sequence numbers the real service assigned or the verbose failure. */
2358
+ readonly keepAlive: (sessionId: string) => Promise<RcEventWriteResult>;
2359
+ /** Asks one session's worker for the status of its MCP server connections, returning the minted request id and the sequence numbers, or the verbose failure. */
2360
+ readonly mcpStatus: (sessionId: string) => Promise<RcEventWriteResult>;
2361
+ /** Asks one session's worker to reconnect one MCP server, returning the minted request id and the sequence numbers, or the verbose failure. */
2362
+ readonly mcpReconnect: (sessionId: string, serverName: string) => Promise<RcEventWriteResult>;
2363
+ /** Starts one MCP server's OAuth handshake on a session, returning the minted request id and the sequence numbers, or the verbose failure. */
2364
+ readonly mcpAuthenticate: (sessionId: string, serverName: string, redirectUri: string) => Promise<RcEventWriteResult>;
2365
+ /** Hands one MCP server's OAuth callback to a session's worker, returning the minted request id and the sequence numbers, or the verbose failure. */
2366
+ readonly mcpOAuthCallbackUrl: (sessionId: string, serverName: string, callbackUrl: string) => Promise<RcEventWriteResult>;
2197
2367
  }
2198
2368
  /** Builds the control client: every request presents the control token, and a non-2xx answer becomes the verbose message the door sent with it. */
2199
2369
  declare function frontDoorRcControl(transport: RcControlTransport, token: string): FrontDoorRcControl;
@@ -2268,6 +2438,26 @@ interface RcApiDeps {
2268
2438
  readonly setModel: (sessionId: string, model: string) => Promise<RcEventWriteResult>;
2269
2439
  /** The set-permission-mode operation, already wired to the tracker and the door's API-host dial. */
2270
2440
  readonly setPermissionMode: (sessionId: string, mode: RcPermissionMode) => Promise<RcEventWriteResult>;
2441
+ /** The end-session operation, already wired to the tracker and the door's API-host dial. */
2442
+ readonly endSession: (sessionId: string, reason: string | undefined) => Promise<RcEventWriteResult>;
2443
+ /** The get-usage operation, already wired to the tracker and the door's API-host dial. */
2444
+ readonly getUsage: (sessionId: string, skipBehaviors: boolean | undefined) => Promise<RcEventWriteResult>;
2445
+ /** The get-context-usage operation, already wired to the tracker and the door's API-host dial. */
2446
+ readonly getContextUsage: (sessionId: string, detail: RcContextUsageDetail | undefined) => Promise<RcEventWriteResult>;
2447
+ /** The read-file operation, already wired to the tracker and the door's API-host dial. */
2448
+ readonly readFile: (sessionId: string, path: string, options: RcReadFileOptions | undefined) => Promise<RcEventWriteResult>;
2449
+ /** The file-suggestions operation, already wired to the tracker and the door's API-host dial. */
2450
+ readonly fileSuggestions: (sessionId: string, query: string) => Promise<RcEventWriteResult>;
2451
+ /** The keep-alive operation, already wired to the tracker and the door's API-host dial. */
2452
+ readonly keepAlive: (sessionId: string) => Promise<RcEventWriteResult>;
2453
+ /** The mcp-status operation, already wired to the tracker and the door's API-host dial. */
2454
+ readonly mcpStatus: (sessionId: string) => Promise<RcEventWriteResult>;
2455
+ /** The mcp-reconnect operation, already wired to the tracker and the door's API-host dial. */
2456
+ readonly mcpReconnect: (sessionId: string, serverName: string) => Promise<RcEventWriteResult>;
2457
+ /** The mcp-authenticate operation, already wired to the tracker and the door's API-host dial. */
2458
+ readonly mcpAuthenticate: (sessionId: string, serverName: string, redirectUri: string) => Promise<RcEventWriteResult>;
2459
+ /** The mcp-oauth-callback-url operation, already wired to the tracker and the door's API-host dial. */
2460
+ readonly mcpOAuthCallbackUrl: (sessionId: string, serverName: string, callbackUrl: string) => Promise<RcEventWriteResult>;
2271
2461
  /** The client attachment's fan-out, whose events the subscription yields. */
2272
2462
  readonly fanout: RcEventFanout;
2273
2463
  }
@@ -2343,6 +2533,7 @@ declare function createRcApiRouter(deps: RcApiDeps): {
2343
2533
  session: zod.ZodString;
2344
2534
  }, zod_v4_core.$strict>, zod.ZodObject<{
2345
2535
  session: zod.ZodString;
2536
+ request: zod.ZodString;
2346
2537
  sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
2347
2538
  }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
2348
2539
  setModel: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
@@ -2350,6 +2541,7 @@ declare function createRcApiRouter(deps: RcApiDeps): {
2350
2541
  model: zod.ZodString;
2351
2542
  }, zod_v4_core.$strict>, zod.ZodObject<{
2352
2543
  session: zod.ZodString;
2544
+ request: zod.ZodString;
2353
2545
  sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
2354
2546
  }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
2355
2547
  setPermissionMode: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
@@ -2364,6 +2556,94 @@ declare function createRcApiRouter(deps: RcApiDeps): {
2364
2556
  }>;
2365
2557
  }, zod_v4_core.$strict>, zod.ZodObject<{
2366
2558
  session: zod.ZodString;
2559
+ request: zod.ZodString;
2560
+ sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
2561
+ }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
2562
+ endSession: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
2563
+ session: zod.ZodString;
2564
+ reason: zod.ZodOptional<zod.ZodString>;
2565
+ }, zod_v4_core.$strict>, zod.ZodObject<{
2566
+ session: zod.ZodString;
2567
+ request: zod.ZodString;
2568
+ sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
2569
+ }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
2570
+ getUsage: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
2571
+ session: zod.ZodString;
2572
+ skipBehaviors: zod.ZodOptional<zod.ZodBoolean>;
2573
+ }, zod_v4_core.$strict>, zod.ZodObject<{
2574
+ session: zod.ZodString;
2575
+ request: zod.ZodString;
2576
+ sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
2577
+ }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
2578
+ getContextUsage: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
2579
+ session: zod.ZodString;
2580
+ detail: zod.ZodOptional<zod.ZodEnum<{
2581
+ summary: "summary";
2582
+ full: "full";
2583
+ }>>;
2584
+ }, zod_v4_core.$strict>, zod.ZodObject<{
2585
+ session: zod.ZodString;
2586
+ request: zod.ZodString;
2587
+ sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
2588
+ }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
2589
+ readFile: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
2590
+ session: zod.ZodString;
2591
+ path: zod.ZodString;
2592
+ maxBytes: zod.ZodOptional<zod.ZodNumber>;
2593
+ encoding: zod.ZodOptional<zod.ZodEnum<{
2594
+ "utf-8": "utf-8";
2595
+ base64: "base64";
2596
+ }>>;
2597
+ }, zod_v4_core.$strict>, zod.ZodObject<{
2598
+ session: zod.ZodString;
2599
+ request: zod.ZodString;
2600
+ sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
2601
+ }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
2602
+ fileSuggestions: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
2603
+ session: zod.ZodString;
2604
+ query: zod.ZodString;
2605
+ }, zod_v4_core.$strict>, zod.ZodObject<{
2606
+ session: zod.ZodString;
2607
+ request: zod.ZodString;
2608
+ sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
2609
+ }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
2610
+ keepAlive: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
2611
+ session: zod.ZodString;
2612
+ }, zod_v4_core.$strict>, zod.ZodObject<{
2613
+ session: zod.ZodString;
2614
+ sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
2615
+ }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
2616
+ mcpStatus: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
2617
+ session: zod.ZodString;
2618
+ }, zod_v4_core.$strict>, zod.ZodObject<{
2619
+ session: zod.ZodString;
2620
+ request: zod.ZodString;
2621
+ sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
2622
+ }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
2623
+ mcpReconnect: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
2624
+ session: zod.ZodString;
2625
+ serverName: zod.ZodString;
2626
+ }, zod_v4_core.$strict>, zod.ZodObject<{
2627
+ session: zod.ZodString;
2628
+ request: zod.ZodString;
2629
+ sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
2630
+ }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
2631
+ mcpAuthenticate: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
2632
+ session: zod.ZodString;
2633
+ serverName: zod.ZodString;
2634
+ redirectUri: zod.ZodString;
2635
+ }, zod_v4_core.$strict>, zod.ZodObject<{
2636
+ session: zod.ZodString;
2637
+ request: zod.ZodString;
2638
+ sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
2639
+ }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
2640
+ mcpOAuthCallbackUrl: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
2641
+ session: zod.ZodString;
2642
+ serverName: zod.ZodString;
2643
+ callbackUrl: zod.ZodString;
2644
+ }, zod_v4_core.$strict>, zod.ZodObject<{
2645
+ session: zod.ZodString;
2646
+ request: zod.ZodString;
2367
2647
  sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
2368
2648
  }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
2369
2649
  subscribe: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
@@ -3998,13 +4278,13 @@ declare function createControlApiRouter(deps: ControlApiDeps): {
3998
4278
  "config-profile": "config-profile";
3999
4279
  identity: "identity";
4000
4280
  provider: "provider";
4281
+ pool: "pool";
4282
+ keychain: "keychain";
4001
4283
  "ambient-credential": "ambient-credential";
4002
4284
  "binary-discovery": "binary-discovery";
4003
4285
  "claude-shim": "claude-shim";
4004
4286
  "path-resolution": "path-resolution";
4005
4287
  "legacy-name": "legacy-name";
4006
- pool: "pool";
4007
- keychain: "keychain";
4008
4288
  "directory-rules": "directory-rules";
4009
4289
  "categories-local": "categories-local";
4010
4290
  "active-identity": "active-identity";
@@ -4475,13 +4755,13 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
4475
4755
  "config-profile": "config-profile";
4476
4756
  identity: "identity";
4477
4757
  provider: "provider";
4758
+ pool: "pool";
4759
+ keychain: "keychain";
4478
4760
  "ambient-credential": "ambient-credential";
4479
4761
  "binary-discovery": "binary-discovery";
4480
4762
  "claude-shim": "claude-shim";
4481
4763
  "path-resolution": "path-resolution";
4482
4764
  "legacy-name": "legacy-name";
4483
- pool: "pool";
4484
- keychain: "keychain";
4485
4765
  "directory-rules": "directory-rules";
4486
4766
  "categories-local": "categories-local";
4487
4767
  "active-identity": "active-identity";
@@ -4561,6 +4841,7 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
4561
4841
  session: zod.ZodString;
4562
4842
  }, zod_v4_core.$strict>, zod.ZodObject<{
4563
4843
  session: zod.ZodString;
4844
+ request: zod.ZodString;
4564
4845
  sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
4565
4846
  }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
4566
4847
  setModel: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
@@ -4568,6 +4849,7 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
4568
4849
  model: zod.ZodString;
4569
4850
  }, zod_v4_core.$strict>, zod.ZodObject<{
4570
4851
  session: zod.ZodString;
4852
+ request: zod.ZodString;
4571
4853
  sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
4572
4854
  }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
4573
4855
  setPermissionMode: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
@@ -4582,6 +4864,94 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
4582
4864
  }>;
4583
4865
  }, zod_v4_core.$strict>, zod.ZodObject<{
4584
4866
  session: zod.ZodString;
4867
+ request: zod.ZodString;
4868
+ sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
4869
+ }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
4870
+ endSession: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
4871
+ session: zod.ZodString;
4872
+ reason: zod.ZodOptional<zod.ZodString>;
4873
+ }, zod_v4_core.$strict>, zod.ZodObject<{
4874
+ session: zod.ZodString;
4875
+ request: zod.ZodString;
4876
+ sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
4877
+ }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
4878
+ getUsage: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
4879
+ session: zod.ZodString;
4880
+ skipBehaviors: zod.ZodOptional<zod.ZodBoolean>;
4881
+ }, zod_v4_core.$strict>, zod.ZodObject<{
4882
+ session: zod.ZodString;
4883
+ request: zod.ZodString;
4884
+ sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
4885
+ }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
4886
+ getContextUsage: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
4887
+ session: zod.ZodString;
4888
+ detail: zod.ZodOptional<zod.ZodEnum<{
4889
+ summary: "summary";
4890
+ full: "full";
4891
+ }>>;
4892
+ }, zod_v4_core.$strict>, zod.ZodObject<{
4893
+ session: zod.ZodString;
4894
+ request: zod.ZodString;
4895
+ sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
4896
+ }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
4897
+ readFile: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
4898
+ session: zod.ZodString;
4899
+ path: zod.ZodString;
4900
+ maxBytes: zod.ZodOptional<zod.ZodNumber>;
4901
+ encoding: zod.ZodOptional<zod.ZodEnum<{
4902
+ "utf-8": "utf-8";
4903
+ base64: "base64";
4904
+ }>>;
4905
+ }, zod_v4_core.$strict>, zod.ZodObject<{
4906
+ session: zod.ZodString;
4907
+ request: zod.ZodString;
4908
+ sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
4909
+ }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
4910
+ fileSuggestions: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
4911
+ session: zod.ZodString;
4912
+ query: zod.ZodString;
4913
+ }, zod_v4_core.$strict>, zod.ZodObject<{
4914
+ session: zod.ZodString;
4915
+ request: zod.ZodString;
4916
+ sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
4917
+ }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
4918
+ keepAlive: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
4919
+ session: zod.ZodString;
4920
+ }, zod_v4_core.$strict>, zod.ZodObject<{
4921
+ session: zod.ZodString;
4922
+ sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
4923
+ }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
4924
+ mcpStatus: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
4925
+ session: zod.ZodString;
4926
+ }, zod_v4_core.$strict>, zod.ZodObject<{
4927
+ session: zod.ZodString;
4928
+ request: zod.ZodString;
4929
+ sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
4930
+ }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
4931
+ mcpReconnect: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
4932
+ session: zod.ZodString;
4933
+ serverName: zod.ZodString;
4934
+ }, zod_v4_core.$strict>, zod.ZodObject<{
4935
+ session: zod.ZodString;
4936
+ request: zod.ZodString;
4937
+ sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
4938
+ }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
4939
+ mcpAuthenticate: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
4940
+ session: zod.ZodString;
4941
+ serverName: zod.ZodString;
4942
+ redirectUri: zod.ZodString;
4943
+ }, zod_v4_core.$strict>, zod.ZodObject<{
4944
+ session: zod.ZodString;
4945
+ request: zod.ZodString;
4946
+ sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
4947
+ }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
4948
+ mcpOAuthCallbackUrl: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
4949
+ session: zod.ZodString;
4950
+ serverName: zod.ZodString;
4951
+ callbackUrl: zod.ZodString;
4952
+ }, zod_v4_core.$strict>, zod.ZodObject<{
4953
+ session: zod.ZodString;
4954
+ request: zod.ZodString;
4585
4955
  sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
4586
4956
  }, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
4587
4957
  subscribe: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<DoorApiContext & Record<never, never>, DoorApiContext, DoorApiContext>, any, zod.ZodObject<{
@@ -4769,13 +5139,13 @@ declare const DoctorFindingSchema: z.ZodObject<{
4769
5139
  "config-profile": "config-profile";
4770
5140
  identity: "identity";
4771
5141
  provider: "provider";
5142
+ pool: "pool";
5143
+ keychain: "keychain";
4772
5144
  "ambient-credential": "ambient-credential";
4773
5145
  "binary-discovery": "binary-discovery";
4774
5146
  "claude-shim": "claude-shim";
4775
5147
  "path-resolution": "path-resolution";
4776
5148
  "legacy-name": "legacy-name";
4777
- pool: "pool";
4778
- keychain: "keychain";
4779
5149
  "directory-rules": "directory-rules";
4780
5150
  "categories-local": "categories-local";
4781
5151
  "active-identity": "active-identity";
@@ -4798,13 +5168,13 @@ declare const DoctorRunOutputSchema: z.ZodObject<{
4798
5168
  "config-profile": "config-profile";
4799
5169
  identity: "identity";
4800
5170
  provider: "provider";
5171
+ pool: "pool";
5172
+ keychain: "keychain";
4801
5173
  "ambient-credential": "ambient-credential";
4802
5174
  "binary-discovery": "binary-discovery";
4803
5175
  "claude-shim": "claude-shim";
4804
5176
  "path-resolution": "path-resolution";
4805
5177
  "legacy-name": "legacy-name";
4806
- pool: "pool";
4807
- keychain: "keychain";
4808
5178
  "directory-rules": "directory-rules";
4809
5179
  "categories-local": "categories-local";
4810
5180
  "active-identity": "active-identity";
@@ -5672,6 +6042,24 @@ interface CliOverride {
5672
6042
  };
5673
6043
  }
5674
6044
 
6045
+ /**
6046
+ * 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.
6047
+ */
6048
+ interface UpdateLaunchPort {
6049
+ /** Resolves the URL the `releases/latest` redirect lands on, exactly as `agent-shim update` resolves the newest version. */
6050
+ readonly effectiveUrl: (url: string) => Promise<string>;
6051
+ /** Reads the cooldown stamp, or undefined when it does not exist. */
6052
+ readonly readStamp: (filePath: string) => string | undefined;
6053
+ /** Writes the cooldown stamp atomically: a reader either sees the previous whole stamp or the new one, never a partial write. */
6054
+ readonly writeStamp: (filePath: string, contents: string) => void;
6055
+ /** The clock the cooldown reads, in epoch milliseconds. */
6056
+ readonly now: () => number;
6057
+ /** 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. */
6058
+ readonly spawnDetached: (args: readonly string[]) => void;
6059
+ /** Writes one line to the launching terminal's stderr. */
6060
+ readonly writeErr: (line: string) => void;
6061
+ }
6062
+
5675
6063
  /**
5676
6064
  * 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.
5677
6065
  *
@@ -5732,6 +6120,10 @@ interface PrepareLaunchParams {
5732
6120
  readonly credentials?: CredentialPort;
5733
6121
  /** 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. */
5734
6122
  readonly allowMissingConfigProfile?: boolean;
6123
+ /** 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. */
6124
+ readonly updateMode?: UpdateMode;
6125
+ /** 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. */
6126
+ readonly update?: UpdateLaunchPort;
5735
6127
  }
5736
6128
  /** Inputs to `runLauncher`: a launch's inputs plus the port that spawns the child. */
5737
6129
  interface RunLauncherParams extends PrepareLaunchParams {
@@ -5746,11 +6138,13 @@ interface LaunchPlan {
5746
6138
  readonly env: Readonly<Record<string, string | undefined>>;
5747
6139
  /** Releases the daemon session registrations this launch holds. Call it when the child has exited; it is safe to call more than once. */
5748
6140
  readonly release: () => void;
6141
+ /** 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. */
6142
+ readonly markChildStarted: () => void;
5749
6143
  }
5750
6144
  /**
5751
6145
  * Prepares one `claude` launch, in order:
5752
6146
  *
5753
- * `CLAUDE_CONFIG_DIR` escape-hatch check, then the identity/config-profile decision, the provider decision, the identity's own credential, the ambient-credential guard, 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.
6147
+ * `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.
5754
6148
  *
5755
6149
  * 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.
5756
6150
  *
@@ -5809,5 +6203,5 @@ interface PrepareClaudeLaunchOptions {
5809
6203
  */
5810
6204
  declare function prepareClaudeLaunch(options: PrepareClaudeLaunchOptions): LaunchPlan;
5811
6205
 
5812
- export { AMBIENT_CREDENTIAL_VARS, CHECK_CREDENTIAL_APPLIES, CONNECT_INTERCEPT_HOST, CONNECT_INTERCEPT_HOSTS, CONNECT_LIMITS, CONTROL_PATH_PREFIX, CategoryClassificationOverlaySchema, CategoryClassificationSchema, CategoryMapSchema, CheckReportJsonSchema, CheckRunInputSchema, CliError, ConfigProfileSchema, CredentialCacheSchema, CredentialSchema, CredentialSourceSchema, DOOR_EVENT_BUFFER_EVENTS, DOOR_EVENT_SOURCE_RC, DirectoryRuleAlreadyExistsError, DirectoryRuleMissingTargetError, DirectoryRuleNotFoundError, DirectoryRuleSchema, DirectoryRulesSchema, DoctorFindingSchema, DoctorRunOutputSchema, DoorEventSchema, DoorEventSourceQuerySchema, EXIT_FAILURE, EXIT_USAGE, EffectiveWindowSchema, EntryValueSchema, FARM_MANIFEST_FILENAME, FrontDoorSessionStatusSchema, FrontDoorSessionsOutputSchema, FrontDoorStartError, FrontDoorStateSchema, FrontDoorStatusOutputSchema, GlobalConfigSchema, HeadroomSocketTargetSchema, HeadroomStartError, IdentityAlreadyExistsError, IdentityNotFoundError, IdentitySchema, InvalidCategoryNameError, InvalidIdentityNameError, InvalidProviderNameError, LAUNCH_EVENT_SOURCE, LaunchLifecycleEventSchema, LaunchRefusedError, LegacyProviderFileError, PROMPT_CACHE_TTL_MS, PlanClassSchema, PoolNameSchema, PoolNotFoundError, PoolPickReportSchema, PoolSchema, PortableConfigSchema, ProfileAlreadyExistsError, ProfileNotFoundError, ProviderAlreadyExistsError, ProviderKindMismatchError, ProviderNotFoundError, ProviderSchema, RC_IDLE_EXPIRY_MS, RC_ORPC_PATH_PREFIX, RC_PENDING_DEADLINE_MS, RC_PERMISSION_MODES, 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, RcPermissionModeSchema, RcStreamEnvelopeSchema, RcStreamEventSchema, UsageError, UsageListOutputSchema, UsageSnapshotError, UsageSnapshotSchema, UsageWindowsInputSchema, UsageWindowsOutputSchema, WhenSchema, addDirectoryRule, addIdentity, addPool, addProvider, answerRcControlRequest, buildEntryFacts, buildLayoutPaths, buildRcControlResponsePayload, buildRcEventWriteBody, buildRcInterruptPayload, buildRcSetModelPayload, buildRcSetPermissionModePayload, buildRcUserMessagePayload, carryOver, checkReportHasWarnings, checkReportToJson, collectCheckReport, collectDoctorReport, collectFrontDoorStatus, collectPoolPick, createControlApiRouter, createDoorApiNodeHandler, createDoorApiRouter, createDoorEventHub, createEventsApiRouter, createLaunchEventPublisher, createLeafCache, createProfile, createRcApiNodeHandler, createRcApiRouter, createRcControlHandler, createRcCredentialStore, createRcEventFanout, createRcSelfHostSurface, createRcSessionTracker, createRcStreamHub, createSseParser, describeProviderEndpoint, detectAmbientCredential, doorApiAuth, doorApiNodeHandlerOf, effectiveWindow, ensureCa, ensureFrontDoor, ensureHeadroom, evaluateAmbientCredentialGuard, evaluateWhen, fetchThroughWebProxy, formatAmbientCredentialGuardMessage, formatCheckReport, formatDoctorReport, formatFrontDoorStatus, forwardableHeaders, frontDoorApiClient, frontDoorApiLink, frontDoorRcApiClient, frontDoorRcControl, generateCa, headroomSocketTarget, identityExists, injectRcUserMessage, interruptRcSession, isIdentityDirectoryName, isInterceptedHost, isPrivateAddress, isRcPermissionMode, lateRcEventDial, lateRcStreamDial, listDirectoryRules, listIdentities, listProfiles, listProviders, listUsageSnapshots, matchBranch, mintLeaf, mintRcSelfHostCredential, observingRoutedRoute, parseConnectTarget, parseRcStreamEnvelope, planOf, prepareClaudeLaunch, prepareLaunch, profileExists, providerExists, rankPool, rcEventWriteResultFromAnswer, rcFanoutOnDoorHub, rcObserverAsPassthrough, rcSelfHostFromEnv, rcWebFetchAllowsPrivateFromEnv, readActiveIdentity, readDirectoryRules, readFarmManifest, readGlobalConfig, readIdentity, readPools, readProfile, readProvider, readRcSelfHostRecord, readUsageSnapshot, realConnectCertStore, realConnectEffects, realRcControlTransport, realRcEventDial, realRcStreamDial, realRcWebFetch, recoverFarm, recoveryDiagnostics, removeDirectoryRule, removeIdentity, removePool, removeProfile, removeProvider, requirePool, resolveAgentShimHome, resolveClaudeHome, resolveDecisions, resolveLayoutPaths, resolveSupervisorConfig, resyncFarm, runCheck, runDoctor, runFrontDoorSupervisor, runLauncher, runSupervisor, servedByPipeline, setAllowAmbientCredential, setDefaultConfigProfile, setGlobalDefaultProfile, setIdentityCredential, setPool, setProfileCategories, setProfileEntries, setProfileLaunchFlags, setProfileMetadata, setRcSessionModel, setRcSessionPermissionMode, snapshotPath, spawnClaude, startConnectServer, topLevelNames, updateDirectoryRule, updateProvider, useIdentity, writeDirectoryRules };
5813
- export type { AddDirectoryRuleOptions, AddProviderInput, AmbientCredentialDetection, AmbientCredentialGuardResult, AmbientCredentialVar, BuildEntryFactsParams, CaMaterial, Candidate, CarryOverParams, CarryOverResult, CategoryMap, CheckReport, CheckReportJson, CollectCheckReportParams, CollectDoctorReportParams, CompiledRule, ConditionContext, ConfigProfile, ConnectCertStore, ConnectEffects, ConnectLimits, ConnectLocalSurface, ConnectServerConfig, ConnectServerHandle, ConnectTarget, ControlApiClient, ControlApiDeps, ControlApiRouter, Credential, CredentialSource, Decision, Diagnostic, DirectoryRule, DirectoryRules, DoctorReport, DoorApiClient, DoorApiContext, DoorApiDeps, DoorApiRouter, DoorEvent, DoorEventHub, DoorEventPublisher, DoorEventStream, DoorEventsApiDeps, EffectiveWindow, EliminatedRule, EnsureFrontDoorPorts, EnsureHeadroomPorts, EntryFact, EntryFacts, EntryValue, EvaluateAmbientCredentialGuardParams, FlattenedCascade, FrontDoorRcControl, FrontDoorSessionStatus, FrontDoorStatus, FrontDoorSupervisorPorts, GlobalConfig, HeadroomSupervisorConfig, Identity, IdentityCredentialChange, IdentityListEntry, IdentityListing, InjectedCredential, LaunchEventPublisher, LaunchLifecycleEvent, LaunchPlan, Layer, LayerId, LayoutPaths, LeafCert, NestedContribution, PlanClass, Pool, PoolMember, PoolPickReport, PoolRanking, PortableConfig, PrepareClaudeLaunchOptions, PrepareLaunchParams, ProfileListEntry, Provider, ProviderListEntry, RankPoolInput, RcAnswerDecision, RcAnswerDeps, RcApiClient, RcApiDeps, RcApiRouter, RcControlAnswer, RcControlHandlerDeps, RcControlRequestDeps, RcControlTransport, RcCredentialStore, RcDialAnswer, RcDialTarget, RcEventDial, RcEventFanout, RcEventWriteResult, RcExchangeObserver, RcInjectDeps, RcObservedCredential, RcObservedRequest, RcPendingRequestSummary, RcPermissionMode, RcPresenceAnswer, RcSelfHostCredentialRecord, RcSelfHostDeps, RcSelfHostMintResult, RcSelfHostSurface, RcSessionStatus, RcSessionSummary, RcSessionTracker, RcSessionTrackerDeps, RcStreamAnswer, RcStreamDial, RcStreamEnvelope, RcStreamEvent, RcStreamHub, RcStreamHubDeps, RcWebFetchDeps, RcWebFetchHop, RcWebFetchOutcome, RcWebFetcher, RcWorkerFact, RcWriteHeaders, RecoverFarmParams, RecoveryResult, ResolveDecisionsInput, ResolvedState, ResyncFarmParams, ResyncFarmResult, RunCheckParams, RunDoctorParams, RunFrontDoorSupervisorOptions, RunLauncherParams, RunSupervisorOptions, SpawnClaudeParams, SseParsedEvent, StickyPick, SupervisorPorts, UnreadableIdentityListEntry, UpdateDirectoryRuleOptions, UpdateProviderInput, UsageReadFs, UsageSnapshot, WhenCondition, WhenEvaluation };
6206
+ export { AMBIENT_CREDENTIAL_VARS, CHECK_CREDENTIAL_APPLIES, CONNECT_INTERCEPT_HOST, CONNECT_INTERCEPT_HOSTS, CONNECT_LIMITS, CONTROL_PATH_PREFIX, CategoryClassificationOverlaySchema, CategoryClassificationSchema, CategoryMapSchema, CheckReportJsonSchema, CheckRunInputSchema, CliError, ConfigProfileSchema, CredentialCacheSchema, CredentialSchema, CredentialSourceSchema, DOOR_EVENT_BUFFER_EVENTS, DOOR_EVENT_SOURCE_RC, DirectoryRuleAlreadyExistsError, DirectoryRuleMissingTargetError, DirectoryRuleNotFoundError, DirectoryRuleSchema, DirectoryRulesSchema, DoctorFindingSchema, DoctorRunOutputSchema, DoorEventSchema, DoorEventSourceQuerySchema, EXIT_FAILURE, EXIT_USAGE, EffectiveWindowSchema, EntryValueSchema, FARM_MANIFEST_FILENAME, FrontDoorSessionStatusSchema, FrontDoorSessionsOutputSchema, FrontDoorStartError, FrontDoorStateSchema, FrontDoorStatusOutputSchema, GlobalConfigSchema, HeadroomSocketTargetSchema, HeadroomStartError, IdentityAlreadyExistsError, IdentityNotFoundError, IdentitySchema, InvalidCategoryNameError, InvalidIdentityNameError, InvalidProviderNameError, LAUNCH_EVENT_SOURCE, LaunchLifecycleEventSchema, LaunchRefusedError, LegacyProviderFileError, PROMPT_CACHE_TTL_MS, PlanClassSchema, PoolNameSchema, PoolNotFoundError, PoolPickReportSchema, PoolSchema, PortableConfigSchema, ProfileAlreadyExistsError, ProfileNotFoundError, ProviderAlreadyExistsError, ProviderKindMismatchError, ProviderNotFoundError, ProviderSchema, RC_CONTEXT_USAGE_DETAILS, RC_IDLE_EXPIRY_MS, RC_ORPC_PATH_PREFIX, RC_PENDING_DEADLINE_MS, RC_PERMISSION_MODES, RC_READ_FILE_ENCODINGS, RC_REQUEST_PARSE_CAP_BYTES, RC_SELF_HOST_ENV, RC_SELF_HOST_KEEPALIVE_MS, RC_SELF_HOST_RECORD_DIR, RC_SELF_HOST_RECORD_FILE, RC_SELF_HOST_RETENTION_MS, RC_SELF_HOST_SCOPE_LIST, RC_SELF_HOST_WORKER_JWT_TTL_SECONDS, RC_SESSIONS_PATH_PREFIX, RC_STREAM_BACKOFF_MS, RC_WEB_FETCH_ALLOW_PRIVATE_ENV, RC_WEB_FETCH_DEADLINE_MS, RC_WEB_FETCH_MAX_BYTES, RC_WEB_FETCH_MAX_REDIRECTS, ROUTED_PATH_PREFIX, RcPermissionModeSchema, RcStreamEnvelopeSchema, RcStreamEventSchema, UsageError, UsageListOutputSchema, UsageSnapshotError, UsageSnapshotSchema, UsageWindowsInputSchema, UsageWindowsOutputSchema, WhenSchema, addDirectoryRule, addIdentity, addPool, addProvider, answerRcControlRequest, authenticateRcSessionMcpServer, buildEntryFacts, buildLayoutPaths, buildRcControlRequestPayload, buildRcControlResponsePayload, buildRcEndSessionPayload, buildRcEventWriteBody, buildRcFileSuggestionsPayload, buildRcGetContextUsagePayload, buildRcGetUsagePayload, buildRcInterruptPayload, buildRcKeepAlivePayload, buildRcMcpAuthenticatePayload, buildRcMcpOAuthCallbackUrlPayload, buildRcMcpReconnectPayload, buildRcMcpStatusPayload, buildRcReadFilePayload, buildRcSetModelPayload, buildRcSetPermissionModePayload, buildRcUserMessagePayload, carryOver, checkReportHasWarnings, checkReportToJson, collectCheckReport, collectDoctorReport, collectFrontDoorStatus, collectPoolPick, createControlApiRouter, createDoorApiNodeHandler, createDoorApiRouter, createDoorEventHub, createEventsApiRouter, createLaunchEventPublisher, createLeafCache, createProfile, createRcApiNodeHandler, createRcApiRouter, createRcControlHandler, createRcCredentialStore, createRcEventFanout, createRcSelfHostSurface, createRcSessionTracker, createRcStreamHub, createSseParser, describeProviderEndpoint, detectAmbientCredential, doorApiAuth, doorApiNodeHandlerOf, effectiveWindow, endRcSession, ensureCa, ensureFrontDoor, ensureHeadroom, evaluateAmbientCredentialGuard, evaluateWhen, fetchThroughWebProxy, formatAmbientCredentialGuardMessage, formatCheckReport, formatDoctorReport, formatFrontDoorStatus, forwardableHeaders, frontDoorApiClient, frontDoorApiLink, frontDoorRcApiClient, frontDoorRcControl, generateCa, getRcSessionContextUsage, getRcSessionMcpStatus, getRcSessionUsage, headroomSocketTarget, identityExists, injectRcUserMessage, interruptRcSession, isIdentityDirectoryName, isInterceptedHost, isPrivateAddress, isRcContextUsageDetail, isRcPermissionMode, isRcReadFileEncoding, lateRcEventDial, lateRcStreamDial, listDirectoryRules, listIdentities, listProfiles, listProviders, listUsageSnapshots, matchBranch, mintLeaf, mintRcSelfHostCredential, observingRoutedRoute, parseConnectTarget, parseRcStreamEnvelope, planOf, prepareClaudeLaunch, prepareLaunch, profileExists, providerExists, rankPool, rcEventWriteResultFromAnswer, rcFanoutOnDoorHub, rcObserverAsPassthrough, rcSelfHostFromEnv, rcWebFetchAllowsPrivateFromEnv, readActiveIdentity, readDirectoryRules, readFarmManifest, readGlobalConfig, readIdentity, readPools, readProfile, readProvider, readRcSelfHostRecord, readRcSessionFile, readUsageSnapshot, realConnectCertStore, realConnectEffects, realRcControlTransport, realRcEventDial, realRcStreamDial, realRcWebFetch, reconnectRcSessionMcpServer, recoverFarm, recoveryDiagnostics, removeDirectoryRule, removeIdentity, removePool, removeProfile, removeProvider, requirePool, resolveAgentShimHome, resolveClaudeHome, resolveDecisions, resolveLayoutPaths, resolveSupervisorConfig, resyncFarm, runCheck, runDoctor, runFrontDoorSupervisor, runLauncher, runSupervisor, sendRcKeepAlive, servedByPipeline, setAllowAmbientCredential, setDefaultConfigProfile, setGlobalDefaultProfile, setIdentityCredential, setPool, setProfileCategories, setProfileEntries, setProfileLaunchFlags, setProfileMetadata, setRcSessionModel, setRcSessionPermissionMode, snapshotPath, spawnClaude, startConnectServer, submitRcSessionMcpOAuthCallbackUrl, suggestRcSessionFiles, topLevelNames, updateDirectoryRule, updateProvider, useIdentity, writeDirectoryRules };
6207
+ export type { AddDirectoryRuleOptions, AddProviderInput, AmbientCredentialDetection, AmbientCredentialGuardResult, AmbientCredentialVar, BuildEntryFactsParams, CaMaterial, Candidate, CarryOverParams, CarryOverResult, CategoryMap, CheckReport, CheckReportJson, CollectCheckReportParams, CollectDoctorReportParams, CompiledRule, ConditionContext, ConfigProfile, ConnectCertStore, ConnectEffects, ConnectLimits, ConnectLocalSurface, ConnectServerConfig, ConnectServerHandle, ConnectTarget, ControlApiClient, ControlApiDeps, ControlApiRouter, Credential, CredentialSource, Decision, Diagnostic, DirectoryRule, DirectoryRules, DoctorReport, DoorApiClient, DoorApiContext, DoorApiDeps, DoorApiRouter, DoorEvent, DoorEventHub, DoorEventPublisher, DoorEventStream, DoorEventsApiDeps, EffectiveWindow, EliminatedRule, EnsureFrontDoorPorts, EnsureHeadroomPorts, EntryFact, EntryFacts, EntryValue, EvaluateAmbientCredentialGuardParams, FlattenedCascade, FrontDoorRcControl, FrontDoorSessionStatus, FrontDoorStatus, FrontDoorSupervisorPorts, GlobalConfig, HeadroomSupervisorConfig, Identity, IdentityCredentialChange, IdentityListEntry, IdentityListing, InjectedCredential, LaunchEventPublisher, LaunchLifecycleEvent, LaunchPlan, Layer, LayerId, LayoutPaths, LeafCert, NestedContribution, PlanClass, Pool, PoolMember, PoolPickReport, PoolRanking, PortableConfig, PrepareClaudeLaunchOptions, PrepareLaunchParams, ProfileListEntry, Provider, ProviderListEntry, RankPoolInput, RcAnswerDecision, RcAnswerDeps, RcApiClient, RcApiDeps, RcApiRouter, RcContextUsageDetail, RcControlAnswer, RcControlHandlerDeps, RcControlRequestDeps, RcControlTransport, RcCredentialStore, RcDialAnswer, RcDialTarget, RcEventDial, RcEventFanout, RcEventWriteResult, RcExchangeObserver, RcInjectDeps, RcObservedCredential, RcObservedRequest, RcPendingRequestSummary, RcPermissionMode, RcPresenceAnswer, RcReadFileEncoding, RcReadFileOptions, RcSelfHostCredentialRecord, RcSelfHostDeps, RcSelfHostMintResult, RcSelfHostSurface, RcSessionStatus, RcSessionSummary, RcSessionTracker, RcSessionTrackerDeps, RcStreamAnswer, RcStreamDial, RcStreamEnvelope, RcStreamEvent, RcStreamHub, RcStreamHubDeps, RcWebFetchDeps, RcWebFetchHop, RcWebFetchOutcome, RcWebFetcher, RcWorkerFact, RcWriteHeaders, RecoverFarmParams, RecoveryResult, ResolveDecisionsInput, ResolvedState, ResyncFarmParams, ResyncFarmResult, RunCheckParams, RunDoctorParams, RunFrontDoorSupervisorOptions, RunLauncherParams, RunSupervisorOptions, SpawnClaudeParams, SseParsedEvent, StickyPick, SupervisorPorts, UnreadableIdentityListEntry, UpdateDirectoryRuleOptions, UpdateProviderInput, UsageReadFs, UsageSnapshot, WhenCondition, WhenEvaluation };