agent-shim 8.40.0 → 8.42.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.
Files changed (5) hide show
  1. package/dist/cli.cjs +100607 -91287
  2. package/dist/index.cjs +12180 -10889
  3. package/dist/index.mjs +11822 -10540
  4. package/dist/types/index.d.ts +160 -3
  5. package/package.json +1 -1
@@ -4202,9 +4202,24 @@ declare function evaluateAmbientCredentialGuard(params: EvaluateAmbientCredentia
4202
4202
  /** Which precedence rule produced an identity decision. */
4203
4203
  declare const IDENTITY_DECISION_SOURCES: readonly ["config-dir-escape-hatch", "argv", "env", "directory-pin", "active-identity-file", "none"];
4204
4204
  type IdentityDecisionSource = (typeof IDENTITY_DECISION_SOURCES)[number];
4205
+ /** The result of deciding which identity applies to this launch. */
4206
+ interface IdentityDecision {
4207
+ /** The resolved identity name. Absent when the escape hatch applied, when nothing resolved one, or when a pool was selected (the launcher picks a member from `pool`). */
4208
+ readonly name?: string;
4209
+ /** The pool selected by a `pool:<name>` selector, when the launch named a pool instead of an identity. */
4210
+ readonly pool?: string;
4211
+ readonly source: IdentityDecisionSource;
4212
+ /** True when `CLAUDE_CONFIG_DIR` was already set and every step below was skipped as a result. */
4213
+ readonly configDirEscapeHatch: boolean;
4214
+ }
4205
4215
  /** Which precedence rule produced a configuration-profile decision. */
4206
4216
  declare const CONFIG_PROFILE_DECISION_SOURCES: readonly ["cli-flag", "env", "directory-rule", "identity-default", "global-default", "none"];
4207
4217
  type ConfigProfileDecisionSource = (typeof CONFIG_PROFILE_DECISION_SOURCES)[number];
4218
+ /** The result of deciding which configuration profile applies to this launch. */
4219
+ interface ConfigProfileDecision {
4220
+ readonly name?: string;
4221
+ readonly source: ConfigProfileDecisionSource;
4222
+ }
4208
4223
 
4209
4224
  /** What `pool pick` reports: the ranking a launch from `directory` would act on right now. */
4210
4225
  declare const PoolPickReportSchema: z.ZodObject<{
@@ -6298,6 +6313,33 @@ type DoorApiClient = RouterClient<DoorApiRouter>;
6298
6313
  /** Builds the client for the door's whole typed API: the same address, CA and per-generation control token the Remote Control client uses, with the control-plane procedures beside `rc.*`. */
6299
6314
  declare function frontDoorApiClient(port: number, ca: string, token: string): DoorApiClient;
6300
6315
 
6316
+ /** Raised when the front door is not serving, so there is no listener to open a client to. */
6317
+ declare class FrontDoorNotServingError extends CliError {
6318
+ constructor();
6319
+ }
6320
+ /** Raised when the serving door's CA certificate or per-generation control token cannot be read, so a client could not authenticate the listener or itself. */
6321
+ declare class FrontDoorControlMaterialError extends CliError {
6322
+ constructor(message: string);
6323
+ }
6324
+ /** What a client of the serving door's control surface needs: the provider listener's port, the CA that signs its certificate, and this generation's owner-only control token. */
6325
+ interface FrontDoorControlMaterial {
6326
+ readonly port: number;
6327
+ readonly ca: string;
6328
+ readonly token: string;
6329
+ }
6330
+ /**
6331
+ * Reads the serving door's control material from the state file `frontdoor status` reads, the CA path and the owner-only control token file. `purpose` completes the CA refusal's sentence ("so `purpose` cannot be authenticated") for the client being opened.
6332
+ *
6333
+ * Throws `FrontDoorNotServingError` when the state names no serving port, and `FrontDoorControlMaterialError` naming the missing file when the CA or the token cannot be read.
6334
+ */
6335
+ declare function readFrontDoorControlMaterial(fsPort: HeadroomFs, paths: LayoutPaths, purpose: string): FrontDoorControlMaterial;
6336
+ /**
6337
+ * Opens the whole typed API of the serving front door from the state root: the Remote Control operations (`rc.*`), the control plane (usage, status, check and doctor) and the door-wide event stream (`events.subscribe`), every call presenting the control token over TLS trusting only the door's own CA. It reads the same files the `frontdoor` verbs read, and no credential.
6338
+ *
6339
+ * Throws `FrontDoorNotServingError` when the door is not serving and `FrontDoorControlMaterialError` when its CA or control token is missing. The token belongs to one door generation, so a client opened before a restart is refused afterwards: open a new one.
6340
+ */
6341
+ declare function frontDoorApiFromState(paths: LayoutPaths, fsPort?: HeadroomFs): DoorApiClient;
6342
+
6301
6343
  /**
6302
6344
  * The Zod schemas of the door's general control plane: the usage snapshots a remote consumer reads, the live rate-limit observations the event backbone files, the front door's own status and session registry, the check report over a path, and the doctor report, each one the input or output of a procedure in `controlApi.ts`. Like `rcSchemas.ts` this module is a plain Zod leaf (nothing here imports oRPC), and every shape it asserts is one the implementation already defines: the usage snapshot and front-door state schemas are the store's and the registry's own, the check report's is `checkReportSchema.ts`'s (`CheckReportJsonSchema`, imported straight by the procedure), and the doctor vocabulary is `doctorReport.ts`'s own, so contract and behaviour share one source and a drift fails the procedures' own validation rather than shipping silently.
6303
6345
  */
@@ -7545,6 +7587,38 @@ declare function updateDirectoryRule(paths: LayoutPaths, rulePath: string, optio
7545
7587
  /** Removes the directory rule for `rulePath`. Throws `DirectoryRuleNotFoundError` when no rule matches that exact path. */
7546
7588
  declare function removeDirectoryRule(paths: LayoutPaths, rulePath: string): void;
7547
7589
 
7590
+ /** What `resolveLaunchSelection` needs from its caller. */
7591
+ interface ResolveLaunchSelectionParams {
7592
+ readonly paths: LayoutPaths;
7593
+ /** The directory a launch would run in, already a real path. */
7594
+ readonly cwd: string;
7595
+ /** The identity or `pool:<name>` selector the launch names on its command line, as `@name` or `--identity` gives it. Absent when the launch names none. */
7596
+ readonly identity?: string;
7597
+ /** The configuration profile the launch names on its command line, as `--config-profile` gives it. Absent when the launch names none. */
7598
+ readonly configProfile?: string;
7599
+ /** The environment the launch inherits: `CLAUDE_CONFIG_DIR`, `AGENT_SHIM_IDENTITY` and `AGENT_SHIM_CONFIG_PROFILE` are read from it. */
7600
+ readonly env: Readonly<Record<string, string | undefined>>;
7601
+ }
7602
+ /** The identity and configuration profile a launch in a directory would use, with where each decision came from. */
7603
+ interface LaunchSelection {
7604
+ /**
7605
+ * The identity decision. When the launch selected a pool, `pool` names it and `name` is the member a launch here would run as now (absent when no member can be picked), the same read-only pick `agent-shim pool pick` reports.
7606
+ */
7607
+ readonly identity: IdentityDecision;
7608
+ /** The pool pick behind `identity`, with every member's reasons, when the launch selected a pool. */
7609
+ readonly poolPick?: PoolPickReport;
7610
+ /** The configuration profile decision, taken with the chosen identity's own default profile. */
7611
+ readonly configProfile: ConfigProfileDecision;
7612
+ }
7613
+ /**
7614
+ * Which identity (or pool member) and configuration profile a launch in `params.cwd` would use on this machine, weighing the sources the launcher weighs, in its order: the command line, `CLAUDE_CONFIG_DIR`, the environment, a directory rule or a committed `.agent-shim.json` or `.agent-shim.local.json` pinning the directory, the active identity, and each profile source below the flag. It answers without launching, resyncing a farm or registering with a daemon, and reads no credential, Keychain item or credential command.
7615
+ *
7616
+ * A directory rule's `when` guards the rule's sharing decisions; the launcher, `check` and this function all apply the rule's identity and profile selections regardless of it, so there is no undecided condition to report.
7617
+ *
7618
+ * Throws `PoolNotFoundError` when the launch selects a pool that is not defined.
7619
+ */
7620
+ declare function resolveLaunchSelection(params: ResolveLaunchSelectionParams): LaunchSelection;
7621
+
7548
7622
  /** What a launch's one-off command-line/environment overrides resolve to: the `cliOverride` layer `src/resolve/walk.ts`'s `assembleCascade` composes last, so it beats every other layer. */
7549
7623
  interface CliOverride {
7550
7624
  readonly categories?: CategoryMap;
@@ -7698,10 +7772,14 @@ interface LaunchPlan {
7698
7772
  * The farm resync is skipped when `CLAUDE_CONFIG_DIR` was already set (the escape hatch means the user has named a configuration directory explicitly, and agent-shim manages neither its contents nor its lifetime) and when no identity resolved at all (a bare launch against plain `~/.claude`, matching the legacy tool's own behaviour). In both cases there is no agent-shim-managed farm for a resync to act on.
7699
7773
  */
7700
7774
  declare function prepareLaunch(params: PrepareLaunchParams): LaunchPlan;
7775
+ /**
7776
+ * Runs the child a `plan` describes under `spawn` and returns its exit code, in the order every launch observes: the update check's notice is suppressed from the moment the child takes the terminal, the child runs to completion, and the plan's session registrations are released whether it exited, was signalled or could not be spawned. A spawn failure is thrown after the release rather than turned into an exit code.
7777
+ */
7778
+ declare function runLaunchPlan(plan: LaunchPlan, spawn: SpawnPort): number;
7701
7779
  /**
7702
7780
  * Runs one `claude` launch: `prepareLaunch`, then the child under `params.spawn`, whose exit code becomes this process's.
7703
7781
  *
7704
- * The session registrations are released twice by design: `beforeExit` covers the real success path (where `process.exit` never unwinds a `finally`), and the `finally` below covers a thrown spawn error, where it does.
7782
+ * The session registrations are released by `runLaunchPlan` before `proc.exit` runs, because the real `process.exit` never unwinds a `finally` block.
7705
7783
  */
7706
7784
  declare function runLauncher(params: RunLauncherParams): void;
7707
7785
 
@@ -7750,6 +7828,85 @@ interface PrepareClaudeLaunchOptions {
7750
7828
  */
7751
7829
  declare function prepareClaudeLaunch(options: PrepareClaudeLaunchOptions): LaunchPlan;
7752
7830
 
7831
+ /** How one refresh ended. */
7832
+ type AnthropicRefreshOutcome = {
7833
+ readonly status: "refreshed";
7834
+ }
7835
+ /** The endpoint answered without plan windows: the account has none to report, which is itself recorded so the question is not asked again for one freshness period. */
7836
+ | {
7837
+ readonly status: "unavailable";
7838
+ } | {
7839
+ readonly status: "failed";
7840
+ readonly message: string;
7841
+ };
7842
+ /** Refreshes the Anthropic rate-limit state of identities whose recorded state has gone stale. */
7843
+ interface AnthropicUsageRefresher {
7844
+ /** Fetches and records one identity's usage, regardless of its freshness, though never twice at once. */
7845
+ readonly refresh: (identity: string) => Promise<AnthropicRefreshOutcome>;
7846
+ /** Refreshes, up to the configured concurrency at a time, each of `members` whose usage is stale and that no recent failure suppresses. Never throws: a failure is logged and the member keeps its recorded state. */
7847
+ readonly refreshStale: (members: readonly PoolMember[]) => Promise<void>;
7848
+ }
7849
+
7850
+ /** What `refreshPoolUsage` needs from its caller. */
7851
+ interface RefreshPoolUsageParams {
7852
+ /** The state root; defaults to the one the command line resolves. */
7853
+ readonly paths?: LayoutPaths;
7854
+ /** The directory launches are planned for. */
7855
+ readonly cwd: string;
7856
+ /** The pools to refresh the members of, each with the pools it nests. */
7857
+ readonly poolNames: readonly string[];
7858
+ /** The agent-shim executable the daemons a probe routes through start with; the package's own command line bundle when absent, as for `prepareClaudeLaunch`. */
7859
+ readonly agentShim?: string;
7860
+ /** Receives one line per failed or skipped refresh; ignored when absent. */
7861
+ readonly log?: (line: string) => void;
7862
+ /** Refreshes by other means than Claude Code's usage report; the real one when absent. */
7863
+ readonly refresher?: AnthropicUsageRefresher;
7864
+ }
7865
+ /**
7866
+ * Refreshes, on demand, the recorded Anthropic usage of every member of the named pools (and of the pools they nest) whose record has gone stale, so a quota display or a launch the caller plans itself reads current figures. A member is stale once its record is older than one percent of the five-hour window; each is asked for its plan windows through Claude Code's usage report, which makes no model request. A failed fetch is logged and the member keeps its recorded state; this never throws for one.
7867
+ *
7868
+ * Needs the Agent SDK package (a dependency of this one), loaded only when a pool is named. The command line bundle carries the SDK inside it and gives it a stand-in for `import.meta.url`, which the SDK, an ES module, hands to `createRequire` and a CommonJS bundle leaves undefined; the library files leave the SDK external, so a consumer that bundles them into CommonJS output of its own must supply the same stand-in.
7869
+ */
7870
+ declare function refreshPoolUsage(params: RefreshPoolUsageParams): Promise<void>;
7871
+ /** What `refreshLaunchPoolUsage` needs: the launch to be planned, and the refresh's own options. */
7872
+ interface RefreshLaunchPoolUsageOptions extends PrepareClaudeLaunchOptions {
7873
+ /** Receives one line per failed or skipped refresh; ignored when absent. */
7874
+ readonly log?: (line: string) => void;
7875
+ /** Refreshes by other means than Claude Code's usage report; the real one when absent. */
7876
+ readonly refresher?: AnthropicUsageRefresher;
7877
+ }
7878
+ /**
7879
+ * The pool a launch with these arguments, environment and directory would select, by the launcher's own precedence (the command line, `AGENT_SHIM_IDENTITY`, a directory rule or portable file, the active identity), or undefined when it selects an identity or none. It reads configuration only, never usage.
7880
+ */
7881
+ declare function poolSelectedByLaunch(options: Pick<PrepareClaudeLaunchOptions, "argv" | "env" | "cwd" | "paths">): string | undefined;
7882
+ /**
7883
+ * Refreshes the stale usage of the pool a launch would select (`poolSelectedByLaunch`), so the pick that launch makes ranks on current figures. Run it before `prepareClaudeLaunch`, which stays synchronous and ranks on whatever is recorded; `runClaudeLaunch` does. Does nothing when the launch selects no pool. See `refreshPoolUsage` for what a refresh asks, and for the Agent SDK requirement.
7884
+ */
7885
+ declare function refreshLaunchPoolUsage(options: RefreshLaunchPoolUsageOptions): Promise<void>;
7886
+
7887
+ /** What `runClaudeLaunch` needs: the launch to run, and the stale-usage refresh's own options. */
7888
+ type RunClaudeLaunchOptions = RefreshLaunchPoolUsageOptions;
7889
+ /**
7890
+ * Runs one `claude` launch for `options.cwd` on this machine as `agent-shim run` does, and resolves to the child's exit code: a pool the launch selects first has its stale usage refreshed (`refreshLaunchPoolUsage`) so the pick ranks on current figures, then the launch is prepared (`prepareClaudeLaunch`), the child runs with the terminal's standard streams until it ends, and the launch's front door and headroom registrations are released whether it exited, was signalled (`128` plus the signal number) or could not be spawned. It does not exit this process, so the host decides what to do with the code.
7891
+ *
7892
+ * Rejects with `LaunchRefusedError` before anything is spawned when the launch is refused, and with the spawn failure, after releasing, when the child could not be started. Interactive offers (creating a missing identity or profile) and the launch-time update notice belong to the command line and are not made here.
7893
+ */
7894
+ declare function runClaudeLaunch(options: RunClaudeLaunchOptions): Promise<number>;
7895
+
7896
+ /** What refreshing pools needs, injected so it runs against fakes. */
7897
+ interface RefreshStalePoolMembersParams {
7898
+ /** The pools to refresh the members of, each with the pools it nests. */
7899
+ readonly poolNames: readonly string[];
7900
+ readonly pools: Readonly<Record<string, Pool>>;
7901
+ /** Loads each named identity's recorded usage as the pool ranking reads it. */
7902
+ readonly loadMembers: (identities: readonly string[]) => readonly PoolMember[];
7903
+ readonly refresher: AnthropicUsageRefresher;
7904
+ }
7905
+ /**
7906
+ * Refreshes the Anthropic usage of every member of the named pools (and of the pools they nest) whose recorded state is stale, so a pick ranks on current figures. A launch runs it before `prepareLaunch`, which stays synchronous because it is part of the library surface; the front door runs it on a timer. A member whose fetch fails keeps its recorded state, and nothing here refuses a launch. An identity named by several pools is fetched once.
7907
+ */
7908
+ declare function refreshStalePoolMembers(params: RefreshStalePoolMembersParams): Promise<void>;
7909
+
7753
7910
  /** The file name of the command line bundle that ships beside the library files in `dist/`. */
7754
7911
  declare const OWN_CLI_FILE_NAME = "cli.cjs";
7755
7912
  /**
@@ -7759,5 +7916,5 @@ declare const OWN_CLI_FILE_NAME = "cli.cjs";
7759
7916
  */
7760
7917
  declare function agentShimCliPath(distDir?: string | undefined): string;
7761
7918
 
7762
- export { AMBIENT_CREDENTIAL_VARS, CHECK_CREDENTIAL_APPLIES, CONNECT_INTERCEPT_HOST, CONNECT_INTERCEPT_HOSTS, CONNECT_LIMITS, CONTROL_PATH_PREFIX, CategoryClassificationOverlaySchema, CategoryClassificationSchema, CategoryMapSchema, CheckReportJsonSchema, CheckRunInputSchema, CliError, ConfigProfileSchema, CredentialCacheSchema, CredentialSchema, CredentialSourceSchema, DOOR_EVENT_BUFFER_EVENTS, DOOR_EVENT_SOURCE_RC, DOOR_HEALTH_EVENT_SOURCE, DirectoryRuleAlreadyExistsError, DirectoryRuleMissingTargetError, DirectoryRuleNotFoundError, DirectoryRuleSchema, DirectoryRulesSchema, DoctorFindingSchema, DoctorRunOutputSchema, DoorEventSchema, DoorEventSourceQuerySchema, DoorHealthEventSchema, EXIT_FAILURE, EXIT_USAGE, EffectiveWindowSchema, EntryValueSchema, FARM_MANIFEST_FILENAME, FrontDoorSessionStatusSchema, FrontDoorSessionsOutputSchema, FrontDoorStartError, FrontDoorStateSchema, FrontDoorStatusOutputSchema, GlobalConfigSchema, HeadroomSocketTargetSchema, HeadroomStartError, IdentityAlreadyExistsError, IdentityNotFoundError, IdentitySchema, InvalidCategoryNameError, InvalidIdentityNameError, InvalidProviderNameError, LAUNCH_EVENT_SOURCE, LaunchLifecycleEventSchema, LaunchRefusedError, LegacyProviderFileError, OWN_CLI_FILE_NAME, PROMPT_CACHE_TTL_MS, PlanClassSchema, PoolNameSchema, PoolNotFoundError, PoolPickReportSchema, PoolSchema, PortableConfigSchema, ProfileAlreadyExistsError, ProfileNotFoundError, ProviderAlreadyExistsError, ProviderKindMismatchError, ProviderNotFoundError, ProviderSchema, QUOTA_EXPIRING_EVENT_SOURCE, QuotaExpiringEventSchema, RC_CONTEXT_USAGE_DETAILS, RC_IDLE_EXPIRY_MS, RC_ORPC_PATH_PREFIX, RC_PENDING_DEADLINE_MS, RC_PERMISSION_MODES, RC_READ_FILE_ENCODINGS, RC_REQUEST_PARSE_CAP_BYTES, RC_SELF_HOST_ENV, RC_SELF_HOST_KEEPALIVE_MS, RC_SELF_HOST_RECORD_DIR, RC_SELF_HOST_RECORD_FILE, RC_SELF_HOST_RETENTION_MS, RC_SELF_HOST_SCOPE_LIST, RC_SELF_HOST_WORKER_JWT_TTL_SECONDS, RC_SESSIONS_PATH_PREFIX, RC_STREAM_BACKOFF_MS, RC_WEB_FETCH_ALLOW_PRIVATE_ENV, RC_WEB_FETCH_DEADLINE_MS, RC_WEB_FETCH_MAX_BYTES, RC_WEB_FETCH_MAX_REDIRECTS, ROUTED_PATH_PREFIX, RcLiveRateLimitSchema, RcPermissionModeSchema, RcRateLimitInfoSchema, RcRateLimitWindowSchema, RcStreamEnvelopeSchema, RcStreamEventSchema, USAGE_EVENT_SOURCE, UsageError, UsageListOutputSchema, UsageLiveOutputSchema, UsageSnapshotError, UsageSnapshotSchema, UsageWindowsInputSchema, UsageWindowsOutputSchema, WhenSchema, addDirectoryRule, addIdentity, addPool, addProvider, agentShimCliPath, answerRcControlRequest, authenticateRcSessionMcpServer, buildEntryFacts, buildLayoutPaths, buildRcControlRequestPayload, buildRcControlResponsePayload, buildRcEndSessionPayload, buildRcEventWriteBody, buildRcFileSuggestionsPayload, buildRcGetContextUsagePayload, buildRcGetUsagePayload, buildRcInterruptPayload, buildRcKeepAlivePayload, buildRcMarkReadBody, buildRcMcpAuthenticatePayload, buildRcMcpOAuthCallbackUrlPayload, buildRcMcpReconnectPayload, buildRcMcpStatusPayload, buildRcReadFilePayload, buildRcSetModelPayload, buildRcSetPermissionModePayload, buildRcUserMessagePayload, carryOver, checkReportHasWarnings, checkReportToJson, collectCheckReport, collectDoctorReport, collectFrontDoorStatus, collectPoolPick, createControlApiRouter, createDoorApiNodeHandler, createDoorApiRouter, createDoorEventHub, createDoorHealthPublisher, createEventsApiRouter, createLaunchEventPublisher, createLeafCache, createProfile, createQuotaExpiringPublisher, createRcApiNodeHandler, createRcApiRouter, createRcControlHandler, createRcCredentialStore, createRcEventFanout, createRcLiveUsage, createRcSelfHostSurface, createRcSessionTracker, createRcStreamHub, createSseParser, describeProviderEndpoint, detectAmbientCredential, doorApiAuth, doorApiNodeHandlerOf, effectiveWindow, endRcSession, ensureCa, ensureFrontDoor, ensureHeadroom, evaluateAmbientCredentialGuard, evaluateWhen, fetchThroughWebProxy, formatAmbientCredentialGuardMessage, formatCheckReport, formatDoctorReport, formatFrontDoorStatus, forwardableHeaders, frontDoorApiClient, frontDoorApiLink, frontDoorRcApiClient, frontDoorRcControl, generateCa, getRcSessionContextUsage, getRcSessionMcpStatus, getRcSessionUsage, headroomSocketTarget, identityExists, injectRcUserMessage, interruptRcSession, isIdentityDirectoryName, isInterceptedHost, isPrivateAddress, isRcContextUsageDetail, isRcPermissionMode, isRcReadFileEncoding, lateRcEventDial, lateRcStreamDial, listDirectoryRules, listIdentities, listProfiles, listProviders, listUsageSnapshots, matchBranch, mintLeaf, mintRcSelfHostCredential, observingRoutedRoute, parseConnectTarget, parseRcStreamEnvelope, planOf, poolIdentities, prepareClaudeLaunch, prepareLaunch, profileExists, providerExists, rankPool, rcEventWriteResultFromAnswer, rcFanoutOnDoorHub, rcObserverAsPassthrough, rcRateLimitInfoOf, 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, teleportRcSession, topLevelNames, updateDirectoryRule, updateProvider, useIdentity, writeDirectoryRules };
7763
- 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, DoorHealthEvent, DoorHealthPublisher, EffectiveWindow, EliminatedRule, EnsureFrontDoorPorts, EnsureHeadroomPorts, EntryFact, EntryFacts, EntryValue, EvaluateAmbientCredentialGuardParams, FlattenedCascade, FrontDoorRcControl, FrontDoorSessionStatus, FrontDoorStatus, FrontDoorSupervisorPorts, GlobalConfig, HeadroomSupervisorConfig, Identity, IdentityCredentialChange, IdentityListEntry, IdentityListing, InjectedCredential, LaunchDecision, LaunchEventPublisher, LaunchLifecycleEvent, LaunchPlan, LaunchPoolDecision, Layer, LayerId, LayoutPaths, LeafCert, NestedContribution, PlanClass, Pool, PoolMember, PoolPickReport, PoolRanking, PortableConfig, PrepareClaudeLaunchOptions, PrepareLaunchParams, ProfileListEntry, Provider, ProviderListEntry, QuotaExpiringEvent, QuotaExpiringPublisher, RankPoolInput, RcAnswerDecision, RcAnswerDeps, RcApiClient, RcApiDeps, RcApiRouter, RcContextUsageDetail, RcControlAnswer, RcControlHandlerDeps, RcControlRequestDeps, RcControlTransport, RcCredentialStore, RcDialAnswer, RcDialTarget, RcEventDial, RcEventFanout, RcEventWriteResult, RcExchangeObserver, RcInjectDeps, RcLiveRateLimit, RcLiveUsage, RcLiveUsageDeps, RcObservedCredential, RcObservedRequest, RcPendingRequestSummary, RcPermissionMode, RcPresenceAnswer, RcRateLimitInfo, RcRateLimitWindow, RcReadFileEncoding, RcReadFileOptions, RcSelfHostCredentialRecord, RcSelfHostDeps, RcSelfHostMintResult, RcSelfHostSurface, RcSessionStatus, RcSessionSummary, RcSessionTracker, RcSessionTrackerDeps, RcStreamAnswer, RcStreamDial, RcStreamEnvelope, RcStreamEvent, RcStreamHub, RcStreamHubDeps, RcWebFetchDeps, RcWebFetchHop, RcWebFetchOutcome, RcWebFetcher, RcWorkerFact, RcWriteHeaders, RecoverFarmParams, RecoveryResult, ResolveDecisionsInput, ResolvedState, ResyncFarmParams, ResyncFarmResult, RunCheckParams, RunDoctorParams, RunFrontDoorSupervisorOptions, RunLauncherParams, RunSupervisorOptions, SpawnClaudeParams, SseParsedEvent, StickyPick, SupervisorPorts, UnreadableIdentityListEntry, UpdateDirectoryRuleOptions, UpdateProviderInput, UsageChangeEvent, UsageReadFs, UsageSnapshot, WhenCondition, WhenEvaluation };
7919
+ export { AMBIENT_CREDENTIAL_VARS, CHECK_CREDENTIAL_APPLIES, CONNECT_INTERCEPT_HOST, CONNECT_INTERCEPT_HOSTS, CONNECT_LIMITS, CONTROL_PATH_PREFIX, CategoryClassificationOverlaySchema, CategoryClassificationSchema, CategoryMapSchema, CheckReportJsonSchema, CheckRunInputSchema, CliError, ConfigProfileSchema, CredentialCacheSchema, CredentialSchema, CredentialSourceSchema, DOOR_EVENT_BUFFER_EVENTS, DOOR_EVENT_SOURCE_RC, DOOR_HEALTH_EVENT_SOURCE, DirectoryRuleAlreadyExistsError, DirectoryRuleMissingTargetError, DirectoryRuleNotFoundError, DirectoryRuleSchema, DirectoryRulesSchema, DoctorFindingSchema, DoctorRunOutputSchema, DoorEventSchema, DoorEventSourceQuerySchema, DoorHealthEventSchema, EXIT_FAILURE, EXIT_USAGE, EffectiveWindowSchema, EntryValueSchema, FARM_MANIFEST_FILENAME, FrontDoorControlMaterialError, FrontDoorNotServingError, FrontDoorSessionStatusSchema, FrontDoorSessionsOutputSchema, FrontDoorStartError, FrontDoorStateSchema, FrontDoorStatusOutputSchema, GlobalConfigSchema, HeadroomSocketTargetSchema, HeadroomStartError, IdentityAlreadyExistsError, IdentityNotFoundError, IdentitySchema, InvalidCategoryNameError, InvalidIdentityNameError, InvalidProviderNameError, LAUNCH_EVENT_SOURCE, LaunchLifecycleEventSchema, LaunchRefusedError, LegacyProviderFileError, OWN_CLI_FILE_NAME, PROMPT_CACHE_TTL_MS, PlanClassSchema, PoolNameSchema, PoolNotFoundError, PoolPickReportSchema, PoolSchema, PortableConfigSchema, ProfileAlreadyExistsError, ProfileNotFoundError, ProviderAlreadyExistsError, ProviderKindMismatchError, ProviderNotFoundError, ProviderSchema, QUOTA_EXPIRING_EVENT_SOURCE, QuotaExpiringEventSchema, RC_CONTEXT_USAGE_DETAILS, RC_IDLE_EXPIRY_MS, RC_ORPC_PATH_PREFIX, RC_PENDING_DEADLINE_MS, RC_PERMISSION_MODES, RC_READ_FILE_ENCODINGS, RC_REQUEST_PARSE_CAP_BYTES, RC_SELF_HOST_ENV, RC_SELF_HOST_KEEPALIVE_MS, RC_SELF_HOST_RECORD_DIR, RC_SELF_HOST_RECORD_FILE, RC_SELF_HOST_RETENTION_MS, RC_SELF_HOST_SCOPE_LIST, RC_SELF_HOST_WORKER_JWT_TTL_SECONDS, RC_SESSIONS_PATH_PREFIX, RC_STREAM_BACKOFF_MS, RC_WEB_FETCH_ALLOW_PRIVATE_ENV, RC_WEB_FETCH_DEADLINE_MS, RC_WEB_FETCH_MAX_BYTES, RC_WEB_FETCH_MAX_REDIRECTS, ROUTED_PATH_PREFIX, RcLiveRateLimitSchema, RcPermissionModeSchema, RcRateLimitInfoSchema, RcRateLimitWindowSchema, RcStreamEnvelopeSchema, RcStreamEventSchema, USAGE_EVENT_SOURCE, UsageError, UsageListOutputSchema, UsageLiveOutputSchema, UsageSnapshotError, UsageSnapshotSchema, UsageWindowsInputSchema, UsageWindowsOutputSchema, WhenSchema, addDirectoryRule, addIdentity, addPool, addProvider, agentShimCliPath, answerRcControlRequest, authenticateRcSessionMcpServer, buildEntryFacts, buildLayoutPaths, buildRcControlRequestPayload, buildRcControlResponsePayload, buildRcEndSessionPayload, buildRcEventWriteBody, buildRcFileSuggestionsPayload, buildRcGetContextUsagePayload, buildRcGetUsagePayload, buildRcInterruptPayload, buildRcKeepAlivePayload, buildRcMarkReadBody, buildRcMcpAuthenticatePayload, buildRcMcpOAuthCallbackUrlPayload, buildRcMcpReconnectPayload, buildRcMcpStatusPayload, buildRcReadFilePayload, buildRcSetModelPayload, buildRcSetPermissionModePayload, buildRcUserMessagePayload, carryOver, checkReportHasWarnings, checkReportToJson, collectCheckReport, collectDoctorReport, collectFrontDoorStatus, collectPoolPick, createControlApiRouter, createDoorApiNodeHandler, createDoorApiRouter, createDoorEventHub, createDoorHealthPublisher, createEventsApiRouter, createLaunchEventPublisher, createLeafCache, createProfile, createQuotaExpiringPublisher, createRcApiNodeHandler, createRcApiRouter, createRcControlHandler, createRcCredentialStore, createRcEventFanout, createRcLiveUsage, createRcSelfHostSurface, createRcSessionTracker, createRcStreamHub, createSseParser, describeProviderEndpoint, detectAmbientCredential, doorApiAuth, doorApiNodeHandlerOf, effectiveWindow, endRcSession, ensureCa, ensureFrontDoor, ensureHeadroom, evaluateAmbientCredentialGuard, evaluateWhen, fetchThroughWebProxy, formatAmbientCredentialGuardMessage, formatCheckReport, formatDoctorReport, formatFrontDoorStatus, forwardableHeaders, frontDoorApiClient, frontDoorApiFromState, frontDoorApiLink, frontDoorRcApiClient, frontDoorRcControl, generateCa, getRcSessionContextUsage, getRcSessionMcpStatus, getRcSessionUsage, headroomSocketTarget, identityExists, injectRcUserMessage, interruptRcSession, isIdentityDirectoryName, isInterceptedHost, isPrivateAddress, isRcContextUsageDetail, isRcPermissionMode, isRcReadFileEncoding, lateRcEventDial, lateRcStreamDial, listDirectoryRules, listIdentities, listProfiles, listProviders, listUsageSnapshots, matchBranch, mintLeaf, mintRcSelfHostCredential, observingRoutedRoute, parseConnectTarget, parseRcStreamEnvelope, planOf, poolIdentities, poolSelectedByLaunch, prepareClaudeLaunch, prepareLaunch, profileExists, providerExists, rankPool, rcEventWriteResultFromAnswer, rcFanoutOnDoorHub, rcObserverAsPassthrough, rcRateLimitInfoOf, rcSelfHostFromEnv, rcWebFetchAllowsPrivateFromEnv, readActiveIdentity, readDirectoryRules, readFarmManifest, readFrontDoorControlMaterial, readGlobalConfig, readIdentity, readPools, readProfile, readProvider, readRcSelfHostRecord, readRcSessionFile, readUsageSnapshot, realConnectCertStore, realConnectEffects, realRcControlTransport, realRcEventDial, realRcStreamDial, realRcWebFetch, reconnectRcSessionMcpServer, recoverFarm, recoveryDiagnostics, refreshLaunchPoolUsage, refreshPoolUsage, refreshStalePoolMembers, removeDirectoryRule, removeIdentity, removePool, removeProfile, removeProvider, requirePool, resolveAgentShimHome, resolveClaudeHome, resolveDecisions, resolveLaunchSelection, resolveLayoutPaths, resolveSupervisorConfig, resyncFarm, runCheck, runClaudeLaunch, runDoctor, runFrontDoorSupervisor, runLaunchPlan, runLauncher, runSupervisor, sendRcKeepAlive, servedByPipeline, setAllowAmbientCredential, setDefaultConfigProfile, setGlobalDefaultProfile, setIdentityCredential, setPool, setProfileCategories, setProfileEntries, setProfileLaunchFlags, setProfileMetadata, setRcSessionModel, setRcSessionPermissionMode, snapshotPath, spawnClaude, startConnectServer, submitRcSessionMcpOAuthCallbackUrl, suggestRcSessionFiles, teleportRcSession, topLevelNames, updateDirectoryRule, updateProvider, useIdentity, writeDirectoryRules };
7920
+ export type { AddDirectoryRuleOptions, AddProviderInput, AmbientCredentialDetection, AmbientCredentialGuardResult, AmbientCredentialVar, AnthropicUsageRefresher, BuildEntryFactsParams, CaMaterial, Candidate, CarryOverParams, CarryOverResult, CategoryMap, CheckReport, CheckReportJson, CollectCheckReportParams, CollectDoctorReportParams, CompiledRule, ConditionContext, ConfigProfile, ConnectCertStore, ConnectEffects, ConnectLimits, ConnectLocalSurface, ConnectServerConfig, ConnectServerHandle, ConnectTarget, ControlApiClient, ControlApiDeps, ControlApiRouter, Credential, CredentialSource, Decision, Diagnostic, DirectoryRule, DirectoryRules, DoctorReport, DoorApiClient, DoorApiContext, DoorApiDeps, DoorApiRouter, DoorEvent, DoorEventHub, DoorEventPublisher, DoorEventStream, DoorEventsApiDeps, DoorHealthEvent, DoorHealthPublisher, EffectiveWindow, EliminatedRule, EnsureFrontDoorPorts, EnsureHeadroomPorts, EntryFact, EntryFacts, EntryValue, EvaluateAmbientCredentialGuardParams, FlattenedCascade, FrontDoorControlMaterial, FrontDoorRcControl, FrontDoorSessionStatus, FrontDoorStatus, FrontDoorSupervisorPorts, GlobalConfig, HeadroomSupervisorConfig, Identity, IdentityCredentialChange, IdentityListEntry, IdentityListing, InjectedCredential, LaunchDecision, LaunchEventPublisher, LaunchLifecycleEvent, LaunchPlan, LaunchPoolDecision, LaunchSelection, Layer, LayerId, LayoutPaths, LeafCert, NestedContribution, PlanClass, Pool, PoolMember, PoolPickReport, PoolRanking, PortableConfig, PrepareClaudeLaunchOptions, PrepareLaunchParams, ProfileListEntry, Provider, ProviderListEntry, QuotaExpiringEvent, QuotaExpiringPublisher, RankPoolInput, RcAnswerDecision, RcAnswerDeps, RcApiClient, RcApiDeps, RcApiRouter, RcContextUsageDetail, RcControlAnswer, RcControlHandlerDeps, RcControlRequestDeps, RcControlTransport, RcCredentialStore, RcDialAnswer, RcDialTarget, RcEventDial, RcEventFanout, RcEventWriteResult, RcExchangeObserver, RcInjectDeps, RcLiveRateLimit, RcLiveUsage, RcLiveUsageDeps, RcObservedCredential, RcObservedRequest, RcPendingRequestSummary, RcPermissionMode, RcPresenceAnswer, RcRateLimitInfo, RcRateLimitWindow, RcReadFileEncoding, RcReadFileOptions, RcSelfHostCredentialRecord, RcSelfHostDeps, RcSelfHostMintResult, RcSelfHostSurface, RcSessionStatus, RcSessionSummary, RcSessionTracker, RcSessionTrackerDeps, RcStreamAnswer, RcStreamDial, RcStreamEnvelope, RcStreamEvent, RcStreamHub, RcStreamHubDeps, RcWebFetchDeps, RcWebFetchHop, RcWebFetchOutcome, RcWebFetcher, RcWorkerFact, RcWriteHeaders, RecoverFarmParams, RecoveryResult, RefreshLaunchPoolUsageOptions, RefreshPoolUsageParams, RefreshStalePoolMembersParams, ResolveDecisionsInput, ResolveLaunchSelectionParams, ResolvedState, ResyncFarmParams, ResyncFarmResult, RunCheckParams, RunClaudeLaunchOptions, RunDoctorParams, RunFrontDoorSupervisorOptions, RunLauncherParams, RunSupervisorOptions, SpawnClaudeParams, SseParsedEvent, StickyPick, SupervisorPorts, UnreadableIdentityListEntry, UpdateDirectoryRuleOptions, UpdateProviderInput, UsageChangeEvent, UsageReadFs, UsageSnapshot, WhenCondition, WhenEvaluation };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-shim",
3
- "version": "8.40.0",
3
+ "version": "8.42.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>",