agent-shim 8.8.0 → 8.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/cli.cjs +5927 -2018
- package/dist/index.cjs +1919 -1292
- package/dist/index.mjs +1908 -1294
- package/dist/types/index.d.ts +365 -21
- package/package.json +3 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
import * as zod from 'zod';
|
|
1
2
|
import { z } from 'zod';
|
|
2
3
|
import { IncomingHttpHeaders, IncomingMessage, ServerResponse } from 'node:http';
|
|
3
4
|
import * as net from 'node:net';
|
|
4
5
|
import { Duplex } from 'node:stream';
|
|
6
|
+
import * as zod_v4_core from 'zod/v4/core';
|
|
7
|
+
import * as _orpc_server from '@orpc/server';
|
|
8
|
+
import { RouterClient } from '@orpc/server';
|
|
5
9
|
|
|
6
10
|
/**
|
|
7
11
|
* Every category a `~/.claude` entry can be classified into. `secret` is deliberately part of this list — it is a real classification the resolver acts on — but it is NOT part of `CategoryMapSchema`'s shape, because no configuration layer may ever toggle it. See OVERRIDABLE_CATEGORIES.
|
|
@@ -1602,6 +1606,44 @@ declare function realConnectCertStore(paths: {
|
|
|
1602
1606
|
readonly frontdoorCaKeyFile: string;
|
|
1603
1607
|
}): ConnectCertStore;
|
|
1604
1608
|
|
|
1609
|
+
/**
|
|
1610
|
+
* The Zod schemas of the Remote Control surfaces: one definition each for the summaries, statuses and pending lists the tracker produces, the stream events the door's client attachment fans out, and every input and output the typed API accepts. The tracker's own TypeScript interfaces in `rcSessions.ts` stay the implementations' types; these schemas are what the oRPC contract validates through, and because the procedures wrap the very operations that 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 tracker and the stream half can share it without either depending on the API layer.
|
|
1611
|
+
*/
|
|
1612
|
+
/** The permission modes the SDK's own `set_permission_mode` control request accepts, as the input schema of the set-permission-mode operation and the subscribe-free vocabulary every surface narrows untrusted strings through. */
|
|
1613
|
+
declare const RcPermissionModeSchema: z.ZodEnum<{
|
|
1614
|
+
default: "default";
|
|
1615
|
+
acceptEdits: "acceptEdits";
|
|
1616
|
+
bypassPermissions: "bypassPermissions";
|
|
1617
|
+
plan: "plan";
|
|
1618
|
+
dontAsk: "dontAsk";
|
|
1619
|
+
auto: "auto";
|
|
1620
|
+
}>;
|
|
1621
|
+
/** One event off the client read stream, exactly as the door forwards it to subscribers: the envelope the API host sent, with the fields the door itself relies on typed and the rest (the payload above all) carried verbatim for the consumer to narrow. */
|
|
1622
|
+
declare const RcStreamEnvelopeSchema: z.ZodObject<{
|
|
1623
|
+
event_id: z.ZodOptional<z.ZodString>;
|
|
1624
|
+
event_type: z.ZodString;
|
|
1625
|
+
sequence_num: z.ZodInt;
|
|
1626
|
+
source: z.ZodString;
|
|
1627
|
+
payload: z.ZodOptional<z.ZodUnknown>;
|
|
1628
|
+
created_at: z.ZodOptional<z.ZodUnknown>;
|
|
1629
|
+
}, z.core.$loose>;
|
|
1630
|
+
/** One fan-out event: the session the stream it rode belongs to, beside the envelope itself. */
|
|
1631
|
+
declare const RcStreamEventSchema: z.ZodObject<{
|
|
1632
|
+
session: z.ZodString;
|
|
1633
|
+
envelope: z.ZodObject<{
|
|
1634
|
+
event_id: z.ZodOptional<z.ZodString>;
|
|
1635
|
+
event_type: z.ZodString;
|
|
1636
|
+
sequence_num: z.ZodInt;
|
|
1637
|
+
source: z.ZodString;
|
|
1638
|
+
payload: z.ZodOptional<z.ZodUnknown>;
|
|
1639
|
+
created_at: z.ZodOptional<z.ZodUnknown>;
|
|
1640
|
+
}, z.core.$loose>;
|
|
1641
|
+
}, z.core.$strict>;
|
|
1642
|
+
/** One event off the client read stream, as the TypeScript every in-process consumer of the fan-out handles it (the schema's own inferred type, so the two cannot drift). */
|
|
1643
|
+
type RcStreamEnvelope = z.output<typeof RcStreamEnvelopeSchema>;
|
|
1644
|
+
/** One fan-out event, as the TypeScript every in-process consumer handles it. */
|
|
1645
|
+
type RcStreamEvent = z.output<typeof RcStreamEventSchema>;
|
|
1646
|
+
|
|
1605
1647
|
/** What the identity step learned about one request from the launcher-injected headers. */
|
|
1606
1648
|
interface SessionIdentity {
|
|
1607
1649
|
/** The identity name the launch resolved, when it resolved one. */
|
|
@@ -1750,6 +1792,14 @@ interface RcSessionTracker {
|
|
|
1750
1792
|
readonly pendingOf: (sessionId?: string) => readonly RcPendingRequestSummary[];
|
|
1751
1793
|
/** The observed credential and protocol headers for one session, the client-half writes' accessor: present only while the session is tracked, and never surfaced anywhere a summary, log or capture goes. */
|
|
1752
1794
|
readonly credentialOf: (sessionId: string) => RcObservedCredential | undefined;
|
|
1795
|
+
/** Advances the session's sequence cursor to the highest number named, which every confirmed client-half write calls with the numbers the real service assigned its events. */
|
|
1796
|
+
readonly noteSequenceNums: (sessionId: string, sequenceNums: readonly number[]) => void;
|
|
1797
|
+
/** The session's sequence cursor: the highest number the door has seen, from the client read stream's envelopes or from its own confirmed writes; undefined while neither has been seen. */
|
|
1798
|
+
readonly sequenceNumOf: (sessionId: string) => number | undefined;
|
|
1799
|
+
/**
|
|
1800
|
+
* Files one client read stream envelope: advances the session's sequence cursor, and treats the payload exactly as an observed event-batch body's would be treated, which is how an approval reaches the pending list from the stream (the live finding behind the client attachment: the CLI routes `control_request`s only toward attached clients, so the stream, not the worker's own writes, is where a `can_use_tool` the door must answer becomes visible). A `control_request` whose envelope names the worker as its source births a pending entry; a `control_response` retires the request it answers, whoever answered it.
|
|
1801
|
+
*/
|
|
1802
|
+
readonly fileStreamEvent: (sessionId: string, event: RcStreamEnvelope) => void;
|
|
1753
1803
|
/** Retires one pending control request as answered: what a successful answer write calls, so the request stops being listed the moment it is answered. */
|
|
1754
1804
|
readonly completePending: (sessionId: string, requestId: string) => void;
|
|
1755
1805
|
/** Stops the idle sweep timer. The entries themselves are unreachable the moment the door drops them. */
|
|
@@ -1759,8 +1809,12 @@ interface RcSessionTracker {
|
|
|
1759
1809
|
declare function createRcSessionTracker(deps: RcSessionTrackerDeps): RcSessionTracker;
|
|
1760
1810
|
/**
|
|
1761
1811
|
* Wraps one route so the tracker sees every exchange the route serves: the request's facts are handed over first, and when they are Remote Control facts the request's body chunks and the response the route writes are teed to the tracker's observer while flowing on unchanged. Used on the door's route resolution, so the bare `/v1/` pass-through an OAuth session's Remote Control calls ride is where observation happens.
|
|
1812
|
+
*
|
|
1813
|
+
* `onExchangeSettled`, when given, is called once the exchange's response has ended and the observer has filed whatever it filed: it is where the door re-pokes the client stream attachment, so a session becomes attached the moment its create's own response completes rather than at whatever exchange happens to follow.
|
|
1762
1814
|
*/
|
|
1763
|
-
declare function observingRoutedRoute(route: FrontDoorRoute, tracker: RcSessionTracker
|
|
1815
|
+
declare function observingRoutedRoute(route: FrontDoorRoute, tracker: RcSessionTracker, hooks?: {
|
|
1816
|
+
readonly onExchangeSettled?: () => void;
|
|
1817
|
+
}): FrontDoorRoute;
|
|
1764
1818
|
/** 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. */
|
|
1765
1819
|
declare function rcObserverAsPassthrough(observer: RcExchangeObserver): PassthroughObserver;
|
|
1766
1820
|
/**
|
|
@@ -1800,6 +1854,8 @@ type RcObservedCredential = RcWriteHeaders;
|
|
|
1800
1854
|
interface RcInjectDeps {
|
|
1801
1855
|
/** Reads the observed credential for a session: the tracker's accessor, in production. */
|
|
1802
1856
|
readonly credentialOf: (sessionId: string) => RcObservedCredential | undefined;
|
|
1857
|
+
/** Advances the session's sequence cursor: the tracker's accessor, in production, so a delivered write's numbers are what a stream resume continues after. */
|
|
1858
|
+
readonly noteSequenceNums: (sessionId: string, sequenceNums: readonly number[]) => void;
|
|
1803
1859
|
/** The dial to the real API host. */
|
|
1804
1860
|
readonly dial: RcEventDial;
|
|
1805
1861
|
/** Mints the payload event's uuid: a v4 UUID or better in production. */
|
|
@@ -1847,6 +1903,8 @@ interface RcAnswerDeps {
|
|
|
1847
1903
|
readonly pendingOf: (sessionId: string) => readonly RcPendingRequestSummary[];
|
|
1848
1904
|
/** Retires a pending request as answered: the tracker's accessor, in production, called only once the write is confirmed delivered. */
|
|
1849
1905
|
readonly completePending: (sessionId: string, requestId: string) => void;
|
|
1906
|
+
/** Advances the session's sequence cursor: the tracker's accessor, in production, so a delivered write's numbers are what a stream resume continues after. */
|
|
1907
|
+
readonly noteSequenceNums: (sessionId: string, sequenceNums: readonly number[]) => void;
|
|
1850
1908
|
/** The dial to the real API host. */
|
|
1851
1909
|
readonly dial: RcEventDial;
|
|
1852
1910
|
}
|
|
@@ -1858,6 +1916,8 @@ declare function answerRcControlRequest(deps: RcAnswerDeps, sessionId: string, r
|
|
|
1858
1916
|
interface RcControlRequestDeps {
|
|
1859
1917
|
/** Reads the observed credential for a session: the tracker's accessor, in production. */
|
|
1860
1918
|
readonly credentialOf: (sessionId: string) => RcObservedCredential | undefined;
|
|
1919
|
+
/** Advances the session's sequence cursor: the tracker's accessor, in production, so a delivered write's numbers are what a stream resume continues after. */
|
|
1920
|
+
readonly noteSequenceNums: (sessionId: string, sequenceNums: readonly number[]) => void;
|
|
1861
1921
|
/** The dial to the real API host. */
|
|
1862
1922
|
readonly dial: RcEventDial;
|
|
1863
1923
|
/** Mints the request's id: a v4 UUID or better in production, the id the worker's `control_response` echoes. */
|
|
@@ -1876,6 +1936,88 @@ declare function setRcSessionModel(deps: RcControlRequestDeps, sessionId: string
|
|
|
1876
1936
|
*/
|
|
1877
1937
|
declare function setRcSessionPermissionMode(deps: RcControlRequestDeps, sessionId: string, mode: RcPermissionMode): Promise<RcEventWriteResult>;
|
|
1878
1938
|
|
|
1939
|
+
/**
|
|
1940
|
+
* 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.
|
|
1941
|
+
*/
|
|
1942
|
+
declare const RC_STREAM_BACKOFF_MS = 45000;
|
|
1943
|
+
/** One event the SSE parser completed: the fields the wire's own framing carried, before any protocol interpretation. */
|
|
1944
|
+
interface SseParsedEvent {
|
|
1945
|
+
/** The `event:` field's value, when the block carried one; the protocol's own events always do. */
|
|
1946
|
+
readonly event: string | undefined;
|
|
1947
|
+
/** The `id:` field's value in force at dispatch (the most recent one the connection saw, per the SSE framing rules); on this stream it carries the event's sequence number. */
|
|
1948
|
+
readonly id: string | undefined;
|
|
1949
|
+
/** The `data:` lines joined with newlines, exactly as the SSE framing defines. */
|
|
1950
|
+
readonly data: string;
|
|
1951
|
+
}
|
|
1952
|
+
/**
|
|
1953
|
+
* An incremental Server-Sent Events parser: feed it the stream's text chunks as they arrive and it returns the events each write completed. Chunks may split lines, fields and even a CRLF pair anywhere; the parser buffers until a line ending is certain, so a `\r` at a chunk's end waits for the byte that decides whether it is `\r\n`. Comments (`:`-prefixed lines, the protocol's 15 s keepalives) complete nothing, an event with no `data:` line dispatches nothing (the framing's own rule), and the `id:` value persists to the next dispatched event the same way, which is what carries the sequence number of an id-only block forward.
|
|
1954
|
+
*/
|
|
1955
|
+
declare function createSseParser(): {
|
|
1956
|
+
readonly write: (text: string) => readonly SseParsedEvent[];
|
|
1957
|
+
};
|
|
1958
|
+
/**
|
|
1959
|
+
* One parsed SSE event as the protocol's envelope, or undefined when the event is not a client event this half reads: a block under any other event name, or data that is not one JSON object carrying the fields the door relies on (`event_type`, `sequence_num`, `source`). An envelope the door cannot read is one it knows nothing about, never a failure: the stream stays up and the next event is read on its own merits.
|
|
1960
|
+
*/
|
|
1961
|
+
declare function parseRcStreamEnvelope(parsed: SseParsedEvent): RcStreamEnvelope | undefined;
|
|
1962
|
+
/** One answer from the API host the presence call dials: the status and the whole body. Presence answers one small JSON object, never a stream, so the body needs no cap of its own. */
|
|
1963
|
+
interface RcPresenceAnswer {
|
|
1964
|
+
readonly status: number;
|
|
1965
|
+
readonly body: string;
|
|
1966
|
+
}
|
|
1967
|
+
/** One answer from the API host the stream dial opens: the status and the body's chunks as they arrive. On a success the chunks are the live stream (consumed incrementally, never buffered); the production dial returns an already-drained empty iterable for any non-2xx answer, whose body is one small error document. */
|
|
1968
|
+
interface RcStreamAnswer {
|
|
1969
|
+
readonly status: number;
|
|
1970
|
+
readonly chunks: AsyncIterable<Uint8Array>;
|
|
1971
|
+
}
|
|
1972
|
+
/**
|
|
1973
|
+
* The one network effect the client read stream performs, injected so the attachment logic runs against fakes: announce a client's presence, and open the read stream. Production dials the real API host over the door's interception-proof agent; tests redirect to a local stand-in. `resume` names the documented resume pair's value: present only when the door has seen events for the session already, it sends `from_sequence_num` as a query parameter and `Last-Event-ID` as a header together.
|
|
1974
|
+
*/
|
|
1975
|
+
interface RcStreamDial {
|
|
1976
|
+
readonly announcePresence: (sessionId: string, headers: Readonly<Record<string, string>>, clientId: string) => Promise<RcPresenceAnswer>;
|
|
1977
|
+
readonly openStream: (sessionId: string, headers: Readonly<Record<string, string>>, resume: {
|
|
1978
|
+
readonly fromSequenceNum: number;
|
|
1979
|
+
} | undefined, signal: AbortSignal) => Promise<RcStreamAnswer>;
|
|
1980
|
+
}
|
|
1981
|
+
/** The fan-out every stream event is handed to: the tracker files what it recognises, and each subscriber receives the event beside it. */
|
|
1982
|
+
interface RcEventFanout {
|
|
1983
|
+
/** Delivers one event to every subscriber listening for its session (or for every session), synchronously, in publication order. */
|
|
1984
|
+
readonly publish: (event: RcStreamEvent) => void;
|
|
1985
|
+
/** Adds one listener, told every event whose session it matches; `undefined` listens to every session. Returns the detach function. */
|
|
1986
|
+
readonly subscribe: (session: string | undefined, listener: (event: RcStreamEvent) => void) => () => void;
|
|
1987
|
+
}
|
|
1988
|
+
/** Creates the fan-out: plain synchronous listener sets, one per session plus one for every-session listeners. Delivery is synchronous so the tracker's filing (which rides the same publish) and every subscriber observe the same order; a subscriber that cannot keep up is bounded where it is bridged to a pull (the typed API's subscription), not here. */
|
|
1989
|
+
declare function createRcEventFanout(): RcEventFanout;
|
|
1990
|
+
/** Everything the attachment hub needs, injected so its decisions run against fakes in unit tests. */
|
|
1991
|
+
interface RcStreamHubDeps {
|
|
1992
|
+
readonly now: () => number;
|
|
1993
|
+
/** The tracker's credential accessor: the OAuth-kind bearer and protocol headers the attachment replays, exactly as the write path does. */
|
|
1994
|
+
readonly credentialOf: (sessionId: string) => RcObservedCredential | undefined;
|
|
1995
|
+
/** The tracker's swept session list: an attachment whose session has expired is dropped, exactly when the tracker itself gives up on it. */
|
|
1996
|
+
readonly trackedSessions: () => readonly string[];
|
|
1997
|
+
/** Files one envelope with the tracker: advances the session's sequence cursor and births or retires pending control requests, exactly as an observed event-batch body does. */
|
|
1998
|
+
readonly fileStreamEvent: (sessionId: string, event: RcStreamEnvelope) => void;
|
|
1999
|
+
/** Reads the session's sequence cursor: the highest number the door has seen, from the stream or from its own confirmed writes. */
|
|
2000
|
+
readonly sequenceNumOf: (sessionId: string) => number | undefined;
|
|
2001
|
+
readonly dial: RcStreamDial;
|
|
2002
|
+
readonly fanout: RcEventFanout;
|
|
2003
|
+
/** Mints the stable client id one session's attachment announces: a v4 UUID or better in production. Stable means it survives reconnects, so the host sees one client, not a new one per drop. */
|
|
2004
|
+
readonly newClientId: () => string;
|
|
2005
|
+
/** How long a failed attachment backs off; production passes `RC_STREAM_BACKOFF_MS`, tests pass small values so a backoff is reached in milliseconds. */
|
|
2006
|
+
readonly backoffMs: number;
|
|
2007
|
+
readonly sleep: (ms: number) => Promise<void>;
|
|
2008
|
+
/** The door's log, for attachment lifecycle lines only: never an event payload, never a credential. */
|
|
2009
|
+
readonly log?: (line: string) => void;
|
|
2010
|
+
}
|
|
2011
|
+
/** The door's client read stream attachment: one stream per tracked session, fanned out to every subscriber. */
|
|
2012
|
+
interface RcStreamHub {
|
|
2013
|
+
/** Reconciles the attachments against the tracker: attaches a stream to every tracked session whose OAuth credential is known, and drops an attachment whose session has expired or lost its credential. Idempotent, synchronous and total (never throws): the door calls it after every observed Remote Control exchange, so an attachment follows the session it belongs to without any polling of its own. */
|
|
2014
|
+
readonly reconcile: () => void;
|
|
2015
|
+
/** Stops every attachment and frees their dials. */
|
|
2016
|
+
readonly close: () => void;
|
|
2017
|
+
}
|
|
2018
|
+
/** Creates the attachment hub. One per door process; everything it holds dies with it. */
|
|
2019
|
+
declare function createRcStreamHub(deps: RcStreamHubDeps): RcStreamHub;
|
|
2020
|
+
|
|
1879
2021
|
/** Where the Remote Control inject path dials: the API host's own address by default, over TLS with the door's interception-proof agent (real-name DNS resolution and the pf-exempt source-port range), so an injected event cannot be looped back into the door's own transparent surface. A test redirects the dial at a local stand-in presenting the host's name, exactly as the forwarding targets are redirected. */
|
|
1880
2022
|
interface RcDialTarget {
|
|
1881
2023
|
readonly host: string;
|
|
@@ -1891,6 +2033,7 @@ interface RcDialTarget {
|
|
|
1891
2033
|
* The real `RcEventDial`: one keep-alive TLS agent of the door's own exempt kind, so every injected event rides the same interception-proof dials the door's forwarded traffic does. The dial only ever reads small JSON answers (an event write's result, or an error), never a stream.
|
|
1892
2034
|
*/
|
|
1893
2035
|
declare function realRcEventDial(target?: RcDialTarget): RcEventDial;
|
|
2036
|
+
declare function realRcStreamDial(target?: RcDialTarget): RcStreamDial;
|
|
1894
2037
|
declare function realConnectEffects(): ConnectEffects;
|
|
1895
2038
|
|
|
1896
2039
|
/**
|
|
@@ -1966,6 +2109,225 @@ declare function frontDoorRcControl(transport: RcControlTransport, token: string
|
|
|
1966
2109
|
/** The filesystem operations headroom coordination needs: the same shape as `FarmFs`, injected so every decision over state, sessions, and the start lock runs against an in-memory fake in tests. */
|
|
1967
2110
|
type HeadroomFs = Pick<FarmFs, "mkdirp" | "mkdirPrivate" | "readFileUtf8" | "writeFileUtf8" | "writeFilePrivate" | "writeFileExclusive" | "readdir" | "removeRecursive">;
|
|
1968
2111
|
|
|
2112
|
+
/** What an `lstat` (which never follows symlinks) reports about one path, narrowed to what authenticating the socket needs. */
|
|
2113
|
+
interface SocketPathStat {
|
|
2114
|
+
readonly kind: "dir" | "socket" | "symlink" | "other";
|
|
2115
|
+
/** The owning user id. */
|
|
2116
|
+
readonly uid: number;
|
|
2117
|
+
/** The permission bits, without the file type bits. */
|
|
2118
|
+
readonly mode: number;
|
|
2119
|
+
}
|
|
2120
|
+
/** The platform facts and the one filesystem call the socket checks need, injected so every refusal is unit-testable without a real socket, directory or second user. */
|
|
2121
|
+
interface HeadroomSocketTrustPorts {
|
|
2122
|
+
/** `process.platform` in the real implementation. */
|
|
2123
|
+
readonly platform: string;
|
|
2124
|
+
/** This process's user id. Only called on a platform with unix sockets, which all have POSIX user ids. */
|
|
2125
|
+
readonly currentUid: () => number;
|
|
2126
|
+
/** Stats one path without following symlinks, or returns undefined when nothing is there. */
|
|
2127
|
+
readonly lstat: (target: string) => SocketPathStat | undefined;
|
|
2128
|
+
}
|
|
2129
|
+
|
|
2130
|
+
/**
|
|
2131
|
+
* A secondary pre-pipeline surface the listener answers under one path prefix: the typed Remote Control API. The listener owns only the dispatch (the prefix and the not-matched 404); the handle itself is whatever the door built, so this file stays independent of the API framework behind it.
|
|
2132
|
+
*/
|
|
2133
|
+
interface PrePipelineApi {
|
|
2134
|
+
/** The path prefix every request of this surface arrives under, outside the routed URL space. */
|
|
2135
|
+
readonly pathPrefix: string;
|
|
2136
|
+
/** Serves one request, resolving with whether a procedure under the prefix matched; the listener answers the 404 itself when one did not. */
|
|
2137
|
+
readonly handle: (request: IncomingMessage, response: ServerResponse) => Promise<{
|
|
2138
|
+
readonly matched: boolean;
|
|
2139
|
+
}>;
|
|
2140
|
+
}
|
|
2141
|
+
|
|
2142
|
+
/**
|
|
2143
|
+
* The Remote Control operations as a typed oRPC API, so programmatic consumers (automation, a mobile or web client, another of this user's tools) get a generated type-safe client instead of hand-rolled HTTP. One procedure per existing operation, each wrapping the same operation the bespoke token-gated routes wrap (the routes stay: the CLI uses them), with inputs and outputs validating through the Zod schemas of `rcSchemas.ts`, which the operations' own values must satisfy, so contract and behaviour share one schema source and cannot drift apart silently.
|
|
2144
|
+
*
|
|
2145
|
+
* Mounted on the provider listener beside the bespoke namespace, authenticated by the same per-generation owner-only control token as a Bearer credential: a fresh random value per door start, written owner-only under the front door's state directory, and checked in constant time like every other capability the door accepts. `rc.subscribe` streams the client attachment's fan-out: every event the door's held stream produced, SSE-framed by oRPC's event iterator, each carrying its sequence number as the SSE event id so a consumer's own reconnect can resume exactly as the door's does.
|
|
2146
|
+
*/
|
|
2147
|
+
/** The one path prefix the typed API is mounted under, answered before the routed pipeline like the bespoke control routes are. */
|
|
2148
|
+
declare const RC_ORPC_PATH_PREFIX = "/__agent-shim/orpc";
|
|
2149
|
+
/** Everything the typed API needs: the same operations the bespoke control routes take, the fan-out its subscription reads, and the token both surfaces demand. */
|
|
2150
|
+
interface RcApiDeps {
|
|
2151
|
+
/** This generation's control token: the value the door wrote owner-only for its callers to present. */
|
|
2152
|
+
readonly expectedToken: string;
|
|
2153
|
+
/** The observed sessions as the tracker lists them. */
|
|
2154
|
+
readonly list: () => readonly RcSessionSummary[];
|
|
2155
|
+
/** The observed sessions as the tracker reports their status, filtered to one when named. */
|
|
2156
|
+
readonly statusOf: (sessionId?: string) => readonly RcSessionStatus[];
|
|
2157
|
+
/** The control requests awaiting an answer, filtered to one session when named. */
|
|
2158
|
+
readonly pendingOf: (sessionId?: string) => readonly RcPendingRequestSummary[];
|
|
2159
|
+
/** The inject operation, already wired to the tracker and the door's API-host dial. */
|
|
2160
|
+
readonly inject: (sessionId: string, text: string) => Promise<RcEventWriteResult>;
|
|
2161
|
+
/** The answer operation, already wired to the tracker and the door's API-host dial. */
|
|
2162
|
+
readonly answer: (sessionId: string, requestId: string, decision: RcAnswerDecision) => Promise<RcEventWriteResult>;
|
|
2163
|
+
/** The interrupt operation, already wired to the tracker and the door's API-host dial. */
|
|
2164
|
+
readonly interrupt: (sessionId: string) => Promise<RcEventWriteResult>;
|
|
2165
|
+
/** The set-model operation, already wired to the tracker and the door's API-host dial. */
|
|
2166
|
+
readonly setModel: (sessionId: string, model: string) => Promise<RcEventWriteResult>;
|
|
2167
|
+
/** The set-permission-mode operation, already wired to the tracker and the door's API-host dial. */
|
|
2168
|
+
readonly setPermissionMode: (sessionId: string, mode: RcPermissionMode) => Promise<RcEventWriteResult>;
|
|
2169
|
+
/** The client attachment's fan-out, whose events the subscription yields. */
|
|
2170
|
+
readonly fanout: RcEventFanout;
|
|
2171
|
+
}
|
|
2172
|
+
/** Builds the typed API's router: one procedure per operation, every one behind the control-token middleware. */
|
|
2173
|
+
declare function createRcApiRouter(deps: RcApiDeps): {
|
|
2174
|
+
rc: {
|
|
2175
|
+
list: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<{
|
|
2176
|
+
readonly headers: IncomingHttpHeaders;
|
|
2177
|
+
} & Record<never, never>, {
|
|
2178
|
+
readonly headers: IncomingHttpHeaders;
|
|
2179
|
+
}, {
|
|
2180
|
+
readonly headers: IncomingHttpHeaders;
|
|
2181
|
+
}>, any, Schema<unknown, unknown>, zod.ZodObject<{
|
|
2182
|
+
sessions: zod.ZodReadonly<zod.ZodArray<zod.ZodObject<{
|
|
2183
|
+
id: zod.ZodString;
|
|
2184
|
+
createdAt: zod.ZodNumber;
|
|
2185
|
+
lastSeenAt: zod.ZodNumber;
|
|
2186
|
+
}, zod_v4_core.$strict>>>;
|
|
2187
|
+
}, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
|
|
2188
|
+
status: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<{
|
|
2189
|
+
readonly headers: IncomingHttpHeaders;
|
|
2190
|
+
} & Record<never, never>, {
|
|
2191
|
+
readonly headers: IncomingHttpHeaders;
|
|
2192
|
+
}, {
|
|
2193
|
+
readonly headers: IncomingHttpHeaders;
|
|
2194
|
+
}>, any, zod.ZodObject<{
|
|
2195
|
+
session: zod.ZodOptional<zod.ZodString>;
|
|
2196
|
+
}, zod_v4_core.$strict>, zod.ZodObject<{
|
|
2197
|
+
statuses: zod.ZodReadonly<zod.ZodArray<zod.ZodObject<{
|
|
2198
|
+
workerState: zod.ZodOptional<zod.ZodObject<{
|
|
2199
|
+
value: zod.ZodString;
|
|
2200
|
+
observedAt: zod.ZodNumber;
|
|
2201
|
+
}, zod_v4_core.$strict>>;
|
|
2202
|
+
workerIdleSeconds: zod.ZodOptional<zod.ZodObject<{
|
|
2203
|
+
value: zod.ZodNumber;
|
|
2204
|
+
observedAt: zod.ZodNumber;
|
|
2205
|
+
}, zod_v4_core.$strict>>;
|
|
2206
|
+
pending: zod.ZodReadonly<zod.ZodArray<zod.ZodObject<{
|
|
2207
|
+
sessionId: zod.ZodString;
|
|
2208
|
+
requestId: zod.ZodString;
|
|
2209
|
+
type: zod.ZodString;
|
|
2210
|
+
summary: zod.ZodString;
|
|
2211
|
+
observedAt: zod.ZodNumber;
|
|
2212
|
+
}, zod_v4_core.$strict>>>;
|
|
2213
|
+
id: zod.ZodString;
|
|
2214
|
+
createdAt: zod.ZodNumber;
|
|
2215
|
+
lastSeenAt: zod.ZodNumber;
|
|
2216
|
+
}, zod_v4_core.$strict>>>;
|
|
2217
|
+
}, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
|
|
2218
|
+
pending: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<{
|
|
2219
|
+
readonly headers: IncomingHttpHeaders;
|
|
2220
|
+
} & Record<never, never>, {
|
|
2221
|
+
readonly headers: IncomingHttpHeaders;
|
|
2222
|
+
}, {
|
|
2223
|
+
readonly headers: IncomingHttpHeaders;
|
|
2224
|
+
}>, any, zod.ZodObject<{
|
|
2225
|
+
session: zod.ZodOptional<zod.ZodString>;
|
|
2226
|
+
}, zod_v4_core.$strict>, zod.ZodObject<{
|
|
2227
|
+
pending: zod.ZodReadonly<zod.ZodArray<zod.ZodObject<{
|
|
2228
|
+
sessionId: zod.ZodString;
|
|
2229
|
+
requestId: zod.ZodString;
|
|
2230
|
+
type: zod.ZodString;
|
|
2231
|
+
summary: zod.ZodString;
|
|
2232
|
+
observedAt: zod.ZodNumber;
|
|
2233
|
+
}, zod_v4_core.$strict>>>;
|
|
2234
|
+
}, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
|
|
2235
|
+
send: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<{
|
|
2236
|
+
readonly headers: IncomingHttpHeaders;
|
|
2237
|
+
} & Record<never, never>, {
|
|
2238
|
+
readonly headers: IncomingHttpHeaders;
|
|
2239
|
+
}, {
|
|
2240
|
+
readonly headers: IncomingHttpHeaders;
|
|
2241
|
+
}>, any, zod.ZodObject<{
|
|
2242
|
+
session: zod.ZodString;
|
|
2243
|
+
text: zod.ZodString;
|
|
2244
|
+
}, zod_v4_core.$strict>, zod.ZodObject<{
|
|
2245
|
+
session: zod.ZodString;
|
|
2246
|
+
sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
|
|
2247
|
+
}, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
|
|
2248
|
+
answer: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<{
|
|
2249
|
+
readonly headers: IncomingHttpHeaders;
|
|
2250
|
+
} & Record<never, never>, {
|
|
2251
|
+
readonly headers: IncomingHttpHeaders;
|
|
2252
|
+
}, {
|
|
2253
|
+
readonly headers: IncomingHttpHeaders;
|
|
2254
|
+
}>, any, zod.ZodObject<{
|
|
2255
|
+
session: zod.ZodString;
|
|
2256
|
+
request: zod.ZodString;
|
|
2257
|
+
approve: zod.ZodBoolean;
|
|
2258
|
+
text: zod.ZodOptional<zod.ZodString>;
|
|
2259
|
+
}, zod_v4_core.$strict>, zod.ZodObject<{
|
|
2260
|
+
session: zod.ZodString;
|
|
2261
|
+
request: zod.ZodString;
|
|
2262
|
+
sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
|
|
2263
|
+
}, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
|
|
2264
|
+
interrupt: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<{
|
|
2265
|
+
readonly headers: IncomingHttpHeaders;
|
|
2266
|
+
} & Record<never, never>, {
|
|
2267
|
+
readonly headers: IncomingHttpHeaders;
|
|
2268
|
+
}, {
|
|
2269
|
+
readonly headers: IncomingHttpHeaders;
|
|
2270
|
+
}>, any, zod.ZodObject<{
|
|
2271
|
+
session: zod.ZodString;
|
|
2272
|
+
}, zod_v4_core.$strict>, zod.ZodObject<{
|
|
2273
|
+
session: zod.ZodString;
|
|
2274
|
+
sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
|
|
2275
|
+
}, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
|
|
2276
|
+
setModel: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<{
|
|
2277
|
+
readonly headers: IncomingHttpHeaders;
|
|
2278
|
+
} & Record<never, never>, {
|
|
2279
|
+
readonly headers: IncomingHttpHeaders;
|
|
2280
|
+
}, {
|
|
2281
|
+
readonly headers: IncomingHttpHeaders;
|
|
2282
|
+
}>, any, zod.ZodObject<{
|
|
2283
|
+
session: zod.ZodString;
|
|
2284
|
+
model: zod.ZodString;
|
|
2285
|
+
}, zod_v4_core.$strict>, zod.ZodObject<{
|
|
2286
|
+
session: zod.ZodString;
|
|
2287
|
+
sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
|
|
2288
|
+
}, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
|
|
2289
|
+
setPermissionMode: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<{
|
|
2290
|
+
readonly headers: IncomingHttpHeaders;
|
|
2291
|
+
} & Record<never, never>, {
|
|
2292
|
+
readonly headers: IncomingHttpHeaders;
|
|
2293
|
+
}, {
|
|
2294
|
+
readonly headers: IncomingHttpHeaders;
|
|
2295
|
+
}>, any, zod.ZodObject<{
|
|
2296
|
+
session: zod.ZodString;
|
|
2297
|
+
mode: zod.ZodEnum<{
|
|
2298
|
+
default: "default";
|
|
2299
|
+
acceptEdits: "acceptEdits";
|
|
2300
|
+
bypassPermissions: "bypassPermissions";
|
|
2301
|
+
plan: "plan";
|
|
2302
|
+
dontAsk: "dontAsk";
|
|
2303
|
+
auto: "auto";
|
|
2304
|
+
}>;
|
|
2305
|
+
}, zod_v4_core.$strict>, zod.ZodObject<{
|
|
2306
|
+
session: zod.ZodString;
|
|
2307
|
+
sequenceNums: zod.ZodReadonly<zod.ZodArray<zod.ZodNumber>>;
|
|
2308
|
+
}, zod_v4_core.$strict>, Record<never, never>, Record<never, never>>;
|
|
2309
|
+
subscribe: _orpc_server.DecoratedProcedure<_orpc_server.MergedInitialContext<{
|
|
2310
|
+
readonly headers: IncomingHttpHeaders;
|
|
2311
|
+
} & Record<never, never>, {
|
|
2312
|
+
readonly headers: IncomingHttpHeaders;
|
|
2313
|
+
}, {
|
|
2314
|
+
readonly headers: IncomingHttpHeaders;
|
|
2315
|
+
}>, any, zod.ZodObject<{
|
|
2316
|
+
session: zod.ZodOptional<zod.ZodString>;
|
|
2317
|
+
}, zod_v4_core.$strict>, any, Record<never, never>, Record<never, never>>;
|
|
2318
|
+
};
|
|
2319
|
+
};
|
|
2320
|
+
/** The typed API's router, as the CLI-side client's own type is derived from it. */
|
|
2321
|
+
type RcApiRouter = ReturnType<typeof createRcApiRouter>;
|
|
2322
|
+
/**
|
|
2323
|
+
* Builds the typed API's node handler, already bound to its mount prefix and context: the pre-pipeline surface the provider listener hands every request under `RC_ORPC_PATH_PREFIX`, answering with `matched: false` for a path under the prefix that names no procedure (which the listener itself answers as a 404). Request bodies are bounded by the same protocol cap the bespoke routes apply.
|
|
2324
|
+
*/
|
|
2325
|
+
declare function createRcApiNodeHandler(deps: RcApiDeps): PrePipelineApi;
|
|
2326
|
+
/** The typed API's client as the `frontdoor rc` verbs use it: every call presents the control token, over TLS trusting only the CA file the door's own state names. */
|
|
2327
|
+
type RcApiClient = RouterClient<RcApiRouter>;
|
|
2328
|
+
/** Builds the typed API's client for the door's provider listener: the same address, CA and per-generation control token the bespoke control client uses. */
|
|
2329
|
+
declare function frontDoorRcApiClient(port: number, ca: string, token: string): RcApiClient;
|
|
2330
|
+
|
|
1969
2331
|
/** The outcome of authenticating the listener a front-door state file names. */
|
|
1970
2332
|
type ListenerVerdict = {
|
|
1971
2333
|
readonly ok: true;
|
|
@@ -2417,24 +2779,6 @@ declare function ensureHeadroom(params: {
|
|
|
2417
2779
|
/** The token-saving settings of the `headroom` config block, without its install and lifecycle fields (`source`, `idleShutdownMinutes`). */
|
|
2418
2780
|
type HeadroomSettings = Pick<HeadroomGlobalConfig, "mode" | "targetRatio" | "ccr" | "rolloutChannel" | "interceptToolResults" | "readMaturation">;
|
|
2419
2781
|
|
|
2420
|
-
/** What an `lstat` (which never follows symlinks) reports about one path, narrowed to what authenticating the socket needs. */
|
|
2421
|
-
interface SocketPathStat {
|
|
2422
|
-
readonly kind: "dir" | "socket" | "symlink" | "other";
|
|
2423
|
-
/** The owning user id. */
|
|
2424
|
-
readonly uid: number;
|
|
2425
|
-
/** The permission bits, without the file type bits. */
|
|
2426
|
-
readonly mode: number;
|
|
2427
|
-
}
|
|
2428
|
-
/** The platform facts and the one filesystem call the socket checks need, injected so every refusal is unit-testable without a real socket, directory or second user. */
|
|
2429
|
-
interface HeadroomSocketTrustPorts {
|
|
2430
|
-
/** `process.platform` in the real implementation. */
|
|
2431
|
-
readonly platform: string;
|
|
2432
|
-
/** This process's user id. Only called on a platform with unix sockets, which all have POSIX user ids. */
|
|
2433
|
-
readonly currentUid: () => number;
|
|
2434
|
-
/** Stats one path without following symlinks, or returns undefined when nothing is there. */
|
|
2435
|
-
readonly lstat: (target: string) => SocketPathStat | undefined;
|
|
2436
|
-
}
|
|
2437
|
-
|
|
2438
2782
|
/** Everything the supervisor needs to run the daemon, resolved from the global config and the filesystem before it starts. */
|
|
2439
2783
|
interface HeadroomSupervisorConfig {
|
|
2440
2784
|
/** The install spec as configured (`headroom.source`), already defaulted. */
|
|
@@ -3387,5 +3731,5 @@ interface PrepareClaudeLaunchOptions {
|
|
|
3387
3731
|
*/
|
|
3388
3732
|
declare function prepareClaudeLaunch(options: PrepareClaudeLaunchOptions): LaunchPlan;
|
|
3389
3733
|
|
|
3390
|
-
export { AMBIENT_CREDENTIAL_VARS, CONNECT_INTERCEPT_HOST, CONNECT_INTERCEPT_HOSTS, CONNECT_LIMITS, CONTROL_PATH_PREFIX, CategoryClassificationOverlaySchema, CategoryClassificationSchema, CategoryMapSchema, CliError, ConfigProfileSchema, CredentialCacheSchema, CredentialSchema, CredentialSourceSchema, DirectoryRuleAlreadyExistsError, DirectoryRuleMissingTargetError, DirectoryRuleNotFoundError, DirectoryRuleSchema, DirectoryRulesSchema, EXIT_FAILURE, EXIT_USAGE, EntryValueSchema, FARM_MANIFEST_FILENAME, FrontDoorStartError, GlobalConfigSchema, HeadroomStartError, IdentityAlreadyExistsError, IdentityNotFoundError, IdentitySchema, InvalidCategoryNameError, InvalidIdentityNameError, InvalidProviderNameError, LaunchRefusedError, LegacyProviderFileError, PROMPT_CACHE_TTL_MS, PlanClassSchema, PoolNameSchema, PoolNotFoundError, PoolPickReportSchema, PoolSchema, PortableConfigSchema, ProfileAlreadyExistsError, ProfileNotFoundError, ProviderAlreadyExistsError, ProviderKindMismatchError, ProviderNotFoundError, ProviderSchema, RC_IDLE_EXPIRY_MS, RC_PENDING_DEADLINE_MS, RC_PERMISSION_MODES, RC_REQUEST_PARSE_CAP_BYTES, RC_SESSIONS_PATH_PREFIX, ROUTED_PATH_PREFIX, UsageError, UsageSnapshotError, UsageSnapshotSchema, WhenSchema, addDirectoryRule, addIdentity, addPool, addProvider, answerRcControlRequest, buildEntryFacts, buildLayoutPaths, buildRcControlResponsePayload, buildRcEventWriteBody, buildRcInterruptPayload, buildRcSetModelPayload, buildRcSetPermissionModePayload, buildRcUserMessagePayload, carryOver, checkReportHasWarnings, checkReportToJson, collectCheckReport, collectDoctorReport, collectPoolPick, createLeafCache, createProfile, createRcControlHandler, createRcSessionTracker, describeProviderEndpoint, detectAmbientCredential, effectiveWindow, ensureCa, ensureFrontDoor, ensureHeadroom, evaluateAmbientCredentialGuard, evaluateWhen, formatAmbientCredentialGuardMessage, formatCheckReport, formatDoctorReport, forwardableHeaders, frontDoorRcControl, generateCa, identityExists, injectRcUserMessage, interruptRcSession, isIdentityDirectoryName, isInterceptedHost, isRcPermissionMode, listDirectoryRules, listIdentities, listProfiles, listProviders, listUsageSnapshots, matchBranch, mintLeaf, observingRoutedRoute, parseConnectTarget, planOf, prepareClaudeLaunch, prepareLaunch, profileExists, providerExists, rankPool, rcEventWriteResultFromAnswer, rcObserverAsPassthrough, readActiveIdentity, readDirectoryRules, readFarmManifest, readGlobalConfig, readIdentity, readPools, readProfile, readProvider, readUsageSnapshot, realConnectCertStore, realConnectEffects, realRcControlTransport, realRcEventDial, recoverFarm, recoveryDiagnostics, removeDirectoryRule, removeIdentity, removePool, removeProfile, removeProvider, requirePool, resolveAgentShimHome, resolveClaudeHome, resolveDecisions, resolveLayoutPaths, resolveSupervisorConfig, resyncFarm, runCheck, runDoctor, runFrontDoorSupervisor, runSupervisor, servedByPipeline, setAllowAmbientCredential, setDefaultConfigProfile, setGlobalDefaultProfile, setIdentityCredential, setPool, setProfileCategories, setProfileEntries, setProfileLaunchFlags, setProfileMetadata, setRcSessionModel, setRcSessionPermissionMode, snapshotPath, startConnectServer, topLevelNames, updateDirectoryRule, updateProvider, useIdentity, writeDirectoryRules };
|
|
3391
|
-
export type { AddDirectoryRuleOptions, AddProviderInput, AmbientCredentialDetection, AmbientCredentialGuardResult, AmbientCredentialVar, BuildEntryFactsParams, CaMaterial, Candidate, CarryOverParams, CarryOverResult, CategoryMap, CheckReport, CollectCheckReportParams, CollectDoctorReportParams, CompiledRule, ConditionContext, ConfigProfile, ConnectCertStore, ConnectEffects, ConnectLimits, ConnectServerConfig, ConnectServerHandle, ConnectTarget, Credential, CredentialSource, Decision, Diagnostic, DirectoryRule, DirectoryRules, DoctorReport, EffectiveWindow, EliminatedRule, EnsureFrontDoorPorts, EnsureHeadroomPorts, EntryFact, EntryFacts, EntryValue, EvaluateAmbientCredentialGuardParams, FlattenedCascade, FrontDoorRcControl, FrontDoorSupervisorPorts, GlobalConfig, HeadroomSupervisorConfig, Identity, IdentityCredentialChange, IdentityListEntry, IdentityListing, InjectedCredential, LaunchPlan, Layer, LayerId, LayoutPaths, LeafCert, PlanClass, Pool, PoolMember, PoolPickReport, PoolRanking, PortableConfig, PrepareClaudeLaunchOptions, PrepareLaunchParams, ProfileListEntry, Provider, ProviderListEntry, RankPoolInput, RcAnswerDecision, RcAnswerDeps, RcControlAnswer, RcControlHandlerDeps, RcControlRequestDeps, RcControlTransport, RcDialAnswer, RcDialTarget, RcEventDial, RcEventWriteResult, RcExchangeObserver, RcInjectDeps, RcObservedCredential, RcObservedRequest, RcPendingRequestSummary, RcPermissionMode, RcSessionStatus, RcSessionSummary, RcSessionTracker, RcSessionTrackerDeps, RcWorkerFact, RcWriteHeaders, RecoverFarmParams, RecoveryResult, ResolveDecisionsInput, ResolvedState, ResyncFarmParams, ResyncFarmResult, RunCheckParams, RunDoctorParams, RunFrontDoorSupervisorOptions, RunSupervisorOptions, StickyPick, SupervisorPorts, UnreadableIdentityListEntry, UpdateDirectoryRuleOptions, UpdateProviderInput, UsageReadFs, UsageSnapshot, WhenCondition, WhenEvaluation };
|
|
3734
|
+
export { AMBIENT_CREDENTIAL_VARS, CONNECT_INTERCEPT_HOST, CONNECT_INTERCEPT_HOSTS, CONNECT_LIMITS, CONTROL_PATH_PREFIX, CategoryClassificationOverlaySchema, CategoryClassificationSchema, CategoryMapSchema, CliError, ConfigProfileSchema, CredentialCacheSchema, CredentialSchema, CredentialSourceSchema, DirectoryRuleAlreadyExistsError, DirectoryRuleMissingTargetError, DirectoryRuleNotFoundError, DirectoryRuleSchema, DirectoryRulesSchema, EXIT_FAILURE, EXIT_USAGE, EntryValueSchema, FARM_MANIFEST_FILENAME, FrontDoorStartError, GlobalConfigSchema, HeadroomStartError, IdentityAlreadyExistsError, IdentityNotFoundError, IdentitySchema, InvalidCategoryNameError, InvalidIdentityNameError, InvalidProviderNameError, 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_SESSIONS_PATH_PREFIX, RC_STREAM_BACKOFF_MS, ROUTED_PATH_PREFIX, RcPermissionModeSchema, RcStreamEnvelopeSchema, RcStreamEventSchema, UsageError, UsageSnapshotError, UsageSnapshotSchema, WhenSchema, addDirectoryRule, addIdentity, addPool, addProvider, answerRcControlRequest, buildEntryFacts, buildLayoutPaths, buildRcControlResponsePayload, buildRcEventWriteBody, buildRcInterruptPayload, buildRcSetModelPayload, buildRcSetPermissionModePayload, buildRcUserMessagePayload, carryOver, checkReportHasWarnings, checkReportToJson, collectCheckReport, collectDoctorReport, collectPoolPick, createLeafCache, createProfile, createRcApiNodeHandler, createRcApiRouter, createRcControlHandler, createRcEventFanout, createRcSessionTracker, createRcStreamHub, createSseParser, describeProviderEndpoint, detectAmbientCredential, effectiveWindow, ensureCa, ensureFrontDoor, ensureHeadroom, evaluateAmbientCredentialGuard, evaluateWhen, formatAmbientCredentialGuardMessage, formatCheckReport, formatDoctorReport, forwardableHeaders, frontDoorRcApiClient, frontDoorRcControl, generateCa, identityExists, injectRcUserMessage, interruptRcSession, isIdentityDirectoryName, isInterceptedHost, isRcPermissionMode, listDirectoryRules, listIdentities, listProfiles, listProviders, listUsageSnapshots, matchBranch, mintLeaf, observingRoutedRoute, parseConnectTarget, parseRcStreamEnvelope, planOf, prepareClaudeLaunch, prepareLaunch, profileExists, providerExists, rankPool, rcEventWriteResultFromAnswer, rcObserverAsPassthrough, readActiveIdentity, readDirectoryRules, readFarmManifest, readGlobalConfig, readIdentity, readPools, readProfile, readProvider, readUsageSnapshot, realConnectCertStore, realConnectEffects, realRcControlTransport, realRcEventDial, realRcStreamDial, recoverFarm, recoveryDiagnostics, removeDirectoryRule, removeIdentity, removePool, removeProfile, removeProvider, requirePool, resolveAgentShimHome, resolveClaudeHome, resolveDecisions, resolveLayoutPaths, resolveSupervisorConfig, resyncFarm, runCheck, runDoctor, runFrontDoorSupervisor, runSupervisor, servedByPipeline, setAllowAmbientCredential, setDefaultConfigProfile, setGlobalDefaultProfile, setIdentityCredential, setPool, setProfileCategories, setProfileEntries, setProfileLaunchFlags, setProfileMetadata, setRcSessionModel, setRcSessionPermissionMode, snapshotPath, startConnectServer, topLevelNames, updateDirectoryRule, updateProvider, useIdentity, writeDirectoryRules };
|
|
3735
|
+
export type { AddDirectoryRuleOptions, AddProviderInput, AmbientCredentialDetection, AmbientCredentialGuardResult, AmbientCredentialVar, BuildEntryFactsParams, CaMaterial, Candidate, CarryOverParams, CarryOverResult, CategoryMap, CheckReport, CollectCheckReportParams, CollectDoctorReportParams, CompiledRule, ConditionContext, ConfigProfile, ConnectCertStore, ConnectEffects, ConnectLimits, ConnectServerConfig, ConnectServerHandle, ConnectTarget, Credential, CredentialSource, Decision, Diagnostic, DirectoryRule, DirectoryRules, DoctorReport, EffectiveWindow, EliminatedRule, EnsureFrontDoorPorts, EnsureHeadroomPorts, EntryFact, EntryFacts, EntryValue, EvaluateAmbientCredentialGuardParams, FlattenedCascade, FrontDoorRcControl, FrontDoorSupervisorPorts, GlobalConfig, HeadroomSupervisorConfig, Identity, IdentityCredentialChange, IdentityListEntry, IdentityListing, InjectedCredential, LaunchPlan, Layer, LayerId, LayoutPaths, LeafCert, PlanClass, Pool, PoolMember, PoolPickReport, PoolRanking, PortableConfig, PrepareClaudeLaunchOptions, PrepareLaunchParams, ProfileListEntry, Provider, ProviderListEntry, RankPoolInput, RcAnswerDecision, RcAnswerDeps, RcApiClient, RcApiDeps, RcApiRouter, RcControlAnswer, RcControlHandlerDeps, RcControlRequestDeps, RcControlTransport, RcDialAnswer, RcDialTarget, RcEventDial, RcEventFanout, RcEventWriteResult, RcExchangeObserver, RcInjectDeps, RcObservedCredential, RcObservedRequest, RcPendingRequestSummary, RcPermissionMode, RcPresenceAnswer, RcSessionStatus, RcSessionSummary, RcSessionTracker, RcSessionTrackerDeps, RcStreamAnswer, RcStreamDial, RcStreamEnvelope, RcStreamEvent, RcStreamHub, RcStreamHubDeps, RcWorkerFact, RcWriteHeaders, RecoverFarmParams, RecoveryResult, ResolveDecisionsInput, ResolvedState, ResyncFarmParams, ResyncFarmResult, RunCheckParams, RunDoctorParams, RunFrontDoorSupervisorOptions, RunSupervisorOptions, SseParsedEvent, StickyPick, SupervisorPorts, UnreadableIdentityListEntry, UpdateDirectoryRuleOptions, UpdateProviderInput, UsageReadFs, UsageSnapshot, WhenCondition, WhenEvaluation };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-shim",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.9.0",
|
|
4
4
|
"description": "A profile manager and launcher for Claude Code that lets one person run multiple logins from one machine while controlling what gets shared between them.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Joseph Mearman <joseph@mearman.co.uk>",
|
|
@@ -50,6 +50,8 @@
|
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"@clack/prompts": "^1.8.0",
|
|
53
|
+
"@orpc/client": "1.15.4",
|
|
54
|
+
"@orpc/server": "1.15.4",
|
|
53
55
|
"commander": "^15.0.0",
|
|
54
56
|
"cosmiconfig": "^10.0.1",
|
|
55
57
|
"picomatch": "^4.0.7",
|