claude-use 14.5.0 → 14.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.cjs +1555 -1124
- package/dist/index.cjs +506 -271
- package/dist/index.mjs +506 -271
- package/dist/types/index.d.ts +52 -12
- package/package.json +1 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -6023,6 +6023,7 @@ declare const FrontDoorSessionSchema: z.ZodObject<{
|
|
|
6023
6023
|
thinking: z.ZodOptional<z.ZodBoolean>;
|
|
6024
6024
|
}, z.core.$strict>>>;
|
|
6025
6025
|
}, z.core.$strict>>;
|
|
6026
|
+
configDir: z.ZodOptional<z.ZodString>;
|
|
6026
6027
|
}, z.core.$strict>;
|
|
6027
6028
|
type FrontDoorSession = z.infer<typeof FrontDoorSessionSchema>;
|
|
6028
6029
|
/** What names one launch: its launcher's pid and the time it registered. A launcher that registers again under its own pid (a relaunch after an account move, a `--resume`) writes a new start time, so per-launch state the door keeps never passes from one launch to the next, even when both carry the same session id. */
|
|
@@ -6055,6 +6056,8 @@ interface FrontDoorSessionDetails {
|
|
|
6055
6056
|
/** The id of the identity the launch runs as: what the door attributes the launch's requests to even when a request carries no identity header of its own (Remote Control's calls ride the capability the tunnel supplies). */
|
|
6056
6057
|
readonly identity?: string;
|
|
6057
6058
|
readonly models?: ModelsConfig;
|
|
6059
|
+
/** The configuration directory the launch's child runs with, whichever way it was chosen (the identity's own, one the caller named, or Claude Code's default): what tells the door which login the launch holding this record's capability runs as, renames and the escape hatch included. Every launcher that knows the field names it, so a record without it was written by an older launcher. */
|
|
6060
|
+
readonly configDir?: string;
|
|
6058
6061
|
}
|
|
6059
6062
|
/** A registered launch as status and the idle decision see it: the pid and start time, never the token, so nothing that prints or serialises a session can leak the capability. */
|
|
6060
6063
|
type FrontDoorSessionSummary = Pick<FrontDoorSession, "pid" | "startedAt" | "supervisorPid">;
|
|
@@ -6439,8 +6442,15 @@ interface ConnectCapture {
|
|
|
6439
6442
|
readonly host: string;
|
|
6440
6443
|
readonly port: number;
|
|
6441
6444
|
}, intercepted: boolean) => void;
|
|
6445
|
+
/** Records one CONNECT target the surface refused to tunnel to (the self-hosted mode's rule): nothing was dialled, so it is recorded apart from `connect`, whose blind entries are tunnels that ran. */
|
|
6446
|
+
readonly refusedTunnel: (target: {
|
|
6447
|
+
readonly host: string;
|
|
6448
|
+
readonly port: number;
|
|
6449
|
+
}) => void;
|
|
6442
6450
|
/** Records one non-routed request's head and returns the observer its forwarding drives, so the capture correlates every later chunk with the request it belongs to. */
|
|
6443
6451
|
readonly observePassthrough: (request: CapturedRequestShape) => PassthroughObserver;
|
|
6452
|
+
/** Records one request the routed pipeline's pass-through sends to Claude Code's own API: the head only, since the pass-through streams its body without a tap. Together with the piped exchanges it is everything that left for the real API. */
|
|
6453
|
+
readonly routedForward: (request: CapturedRequestShape) => void;
|
|
6444
6454
|
/** Records one HTTP upgrade request arriving on a terminated session. The surface destroys the socket afterwards either way, with or without a capture, matching Node's own no-listener behaviour exactly. */
|
|
6445
6455
|
readonly upgrade: (request: CapturedRequestShape) => void;
|
|
6446
6456
|
}
|
|
@@ -6534,7 +6544,7 @@ interface ConnectTarget {
|
|
|
6534
6544
|
declare function parseConnectTarget(authority: string): ConnectTarget | undefined;
|
|
6535
6545
|
/** Whether a CONNECT target's host (port already stripped) is one whose TLS this proxy terminates. */
|
|
6536
6546
|
declare function isInterceptedHost(host: string, interceptHosts: readonly string[]): boolean;
|
|
6537
|
-
/** Whether a request path on the terminated session is one the routed pipeline serves. The query string stays part of the path: `/v1/messages?beta=true` is still the pipeline's. */
|
|
6547
|
+
/** Whether a request path on the terminated session is one the routed pipeline serves. The query string stays part of the path: `/v1/messages?beta=true` is still the pipeline's. Callers pass a target already in `canonicalRequestTarget` form. */
|
|
6538
6548
|
declare function servedByPipeline(path: string | undefined): boolean;
|
|
6539
6549
|
/**
|
|
6540
6550
|
* Headers a forwarded HTTP message keeps: everything except the hop-by-hop set, which belongs to whichever connection carried it and must not leak onto the next one. The `Connection` header's own value can name further hop-by-hop headers (RFC 9110 section 7.6.1), so those go too. Returns a fresh object; the input is the live parser's map and is never mutated.
|
|
@@ -6669,6 +6679,8 @@ interface ConnectServerConfig {
|
|
|
6669
6679
|
readonly limits: ConnectLimits;
|
|
6670
6680
|
/** The diagnostic tap, when capturing is enabled; absent means nothing is recorded. */
|
|
6671
6681
|
readonly capture?: ConnectCapture;
|
|
6682
|
+
/** Where the surface writes one line per request it failed to serve; absent, such a failure is answered and not logged. */
|
|
6683
|
+
readonly log?: (line: string) => void;
|
|
6672
6684
|
}
|
|
6673
6685
|
/** A running connect surface. */
|
|
6674
6686
|
interface ConnectServerHandle {
|
|
@@ -6687,15 +6699,17 @@ interface ConnectServerHandle {
|
|
|
6687
6699
|
readonly close: () => Promise<void>;
|
|
6688
6700
|
}
|
|
6689
6701
|
/**
|
|
6690
|
-
* A surface the connect layer consults before it routes or pipes anything: the door's self-hosted Remote Control answers (see `rcSelfHost.ts`), which
|
|
6691
|
-
*
|
|
6692
|
-
* A host this surface needs to parse (`parsesHost`) is served as ordinary HTTP even when it is named as a tap host: the tap exists because that host's channel could not be safely parsed, so taking it over is the surface's own explicit decision, made only for the mode whose contract already excludes the traffic the tap protects.
|
|
6702
|
+
* A surface the connect layer consults before it routes or pipes anything: the door's self-hosted Remote Control answers (see `rcSelfHost.ts`). Which sessions it owns is decided once per terminated session, before the session is chosen and never from a request's headers: a CONNECT tunnel by the launch whose capability it presented (`ownsLaunch`), and a redirected connection, which carries no capability, by the process holding its other end (`ownsPeer`), failing closed when that process cannot be read. An owned session is served by a session set that parses every intercept host as HTTP (the tap hosts included, since the surface answers their traffic itself and the tap protects only traffic that is forwarded): its requests go to `serve` first, its upgrades and blind tunnels are refused, a request nothing serves is answered 404 rather than forwarded, and what it routes is stamped as the surface's so the resolver never rides it on the pass-through to the real API; the only thing it sends that leaves the machine is a provider session's inference, to its provider's own endpoint. Every other session is served by the ordinary set, exactly as with no surface at all, tap hosts tapped. Absent, every request keeps exactly the behaviour it has today.
|
|
6693
6703
|
*/
|
|
6694
6704
|
interface ConnectLocalSurface {
|
|
6695
|
-
/**
|
|
6696
|
-
readonly parsesHost: (host: string) => boolean;
|
|
6697
|
-
/** Serves one request locally; resolves false when the surface does not own the path, so routing or piping continues unchanged. */
|
|
6705
|
+
/** Serves one request of a session the surface owns (the connect surface consults it for no other); resolves false when the request is for the routed pipeline, so routing continues unchanged. */
|
|
6698
6706
|
readonly serve: (host: string, request: IncomingMessage, response: ServerResponse) => Promise<boolean>;
|
|
6707
|
+
/** Whether the launch whose capability a CONNECT tunnel presented is one this surface owns: its requests are served by `serve`, its upgrades refused and its blind tunnels refused, whatever any request presents. */
|
|
6708
|
+
readonly ownsLaunch: (capability: string) => boolean;
|
|
6709
|
+
/** Whether a redirected connection whose client end is on local port `port` is one this surface owns: attributed by the process holding that end, since a redirect carries no launch capability. Resolves true when the connection cannot be attributed at all, so an unattributable session fails closed. */
|
|
6710
|
+
readonly ownsPeer: (port: number) => Promise<boolean>;
|
|
6711
|
+
/** What the surface's ownership decisions currently rest on (for the self-hosted mode, the identity the credential is minted into): when it changes, every decision made under the old value is stale. */
|
|
6712
|
+
readonly mintGeneration: () => string;
|
|
6699
6713
|
}
|
|
6700
6714
|
/**
|
|
6701
6715
|
* Starts the connect surface: binds the listener, mints the intercept host's leaf, and wires the per-connection routing. Resolves once the listener is bound.
|
|
@@ -7339,6 +7353,8 @@ interface SessionIdentity {
|
|
|
7339
7353
|
readonly projectId: string | undefined;
|
|
7340
7354
|
/** The live launch whose capability the request presented, when the listener's admission identifies one. Two launches can carry one session id (`claude --resume` or `--continue` twice in one directory), so per-launch state is keyed on this, never on the session id. */
|
|
7341
7355
|
readonly launch?: FrontDoorLaunch;
|
|
7356
|
+
/** True when the connect surface stamped the request as a self-hosted session's (see `SELF_HOSTED_HEADER`); absent otherwise. */
|
|
7357
|
+
readonly selfHosted?: true;
|
|
7342
7358
|
}
|
|
7343
7359
|
/** One request as a route sees it: the transport's own request and abort signal, plus what the identity step resolved. */
|
|
7344
7360
|
interface RoutedRequest {
|
|
@@ -7395,6 +7411,10 @@ interface FrontDoorRoute {
|
|
|
7395
7411
|
* Serves the request directly: headroom has already been applied, or does not apply to this route. Writes the response through `response` and resolves once the response has ended.
|
|
7396
7412
|
*/
|
|
7397
7413
|
readonly serve: (request: RoutedRequest, response: RoutedResponse) => Promise<void>;
|
|
7414
|
+
/**
|
|
7415
|
+
* Told of every request the pipeline dispatches to this route, before it is either served directly or handed to the headroom hop in front of the route, so what the observer records covers both ways a request leaves. A throw refuses the request: the pipeline answers it with an internal error and dials nothing.
|
|
7416
|
+
*/
|
|
7417
|
+
readonly observeDispatch?: (request: RoutedRequest) => void;
|
|
7398
7418
|
}
|
|
7399
7419
|
|
|
7400
7420
|
/**
|
|
@@ -26719,11 +26739,17 @@ declare function createRcLiveUsage(deps: RcLiveUsageDeps): RcLiveUsage;
|
|
|
26719
26739
|
* The full scope list the minting writes and the local refresh echoes: the CLI's own claude.ai login scope set (`CLAUDE_AI_OAUTH_SCOPES` in its source), whose `user:inference` and `user:profile` members are exactly the two the Remote Control gate demands. Lives here, beside the refresh that echoes it, and is re-exported by the surface so the library surface it already published is unchanged.
|
|
26720
26740
|
*/
|
|
26721
26741
|
declare const RC_SELF_HOST_SCOPE_LIST: readonly string[];
|
|
26722
|
-
/** The local surface the self-hosted service hands to the connect surface: which
|
|
26742
|
+
/** The local surface the self-hosted service hands to the connect surface: which sessions are the mode's, and the requests it answers itself. */
|
|
26723
26743
|
interface RcSelfHostLocal {
|
|
26724
|
-
/**
|
|
26725
|
-
readonly
|
|
26726
|
-
/**
|
|
26744
|
+
/** Whether the launch holding a tunnel's capability is a self-hosted session's. */
|
|
26745
|
+
readonly ownsLaunch: (capability: string) => boolean;
|
|
26746
|
+
/** Whether the redirected connection whose client end is on local port `port` is a self-hosted session's, attributed by its peer process. */
|
|
26747
|
+
readonly ownsPeer: (port: number) => Promise<boolean>;
|
|
26748
|
+
/** The identity the credential is minted into, which every ownership decision rests on: `none` while nothing is minted, `every` for a mint that names none. */
|
|
26749
|
+
readonly mintGeneration: () => string;
|
|
26750
|
+
/**
|
|
26751
|
+
* Serves one request of a self-hosted session (the connect surface calls it for no other): everything except what the routed pipeline must serve, which resolves false so routing continues unchanged. That is the Remote Control session family on the API host, and every `/v1/` path of a provider session (it carries its provider's internal header), whose inference the resolver sends to that provider; every other path on either host is answered here, so nothing of a self-hosted session reaches a real host.
|
|
26752
|
+
*/
|
|
26727
26753
|
readonly serve: (host: string, request: IncomingMessage, response: ServerResponse) => Promise<boolean>;
|
|
26728
26754
|
}
|
|
26729
26755
|
|
|
@@ -26790,7 +26816,7 @@ declare function realRcWebFetch(options: {
|
|
|
26790
26816
|
*
|
|
26791
26817
|
* The protocol spoken is exactly the one the door already speaks as a client, which is what makes this honest: every path, envelope, sequence rule and resume pair below is the shape the merged client-half machinery (`rcSessions.ts`, `rcStream.ts`, `connectEffects.ts`) dials the real host with, cross-checked against the CLI source (the 2.1.88 source-map dump behind the issue's spike) and live 2.1.289 envelopes captured through the interception rig. The transport is version-unstable (CCRv1 websocket to CCRv2 SSE plus POST within the 2.1.x line), so this surface pins what the rig's pinned CLI speaks and must be re-verified on upgrades; that standing caveat is issue #207's own.
|
|
26792
26818
|
*
|
|
26793
|
-
* Division of the surface: the session family (`/v1/code/sessions...` and the `/v1/sessions` compatibility list) rides the routed pipeline as a `FrontDoorRoute`, so it flows through the same admission and middleware as any routed request and, above all, through the same observation wrapper that feeds the tracker (the door's own client half learns each session's credential precisely because the create is observed like any other exchange). The non-`/v1/` answers the CLI needs around activation (feature eval, profile, telemetry no-ops) and the OAuth refresh on the control-plane host have no pipeline to ride, so they are served by `local`, which the connect surface consults before routing or piping; that surface also takes over the control-plane host's terminated session as ordinary HTTP (it is normally byte-tapped) because answering `/v1/oauth/token` requires parsing it.
|
|
26819
|
+
* Division of the surface: the session family (`/v1/code/sessions...` and the `/v1/sessions` compatibility list) rides the routed pipeline as a `FrontDoorRoute`, so it flows through the same admission and middleware as any routed request and, above all, through the same observation wrapper that feeds the tracker (the door's own client half learns each session's credential precisely because the create is observed like any other exchange). The non-`/v1/` answers the CLI needs around activation (feature eval, profile, telemetry no-ops) and the OAuth refresh on the control-plane host have no pipeline to ride, so they are served by `local`, which the connect surface consults before routing or piping; that surface also takes over the control-plane host's terminated session as ordinary HTTP (it is normally byte-tapped) because answering `/v1/oauth/token` requires parsing it. Every other call a self-hosted session sends on those hosts (the start-up reads, the connector lists, the artifacts service) is answered by `local` from `rcSelfHostOffline.ts`, and the connect surface hands `local` every request of a session the launch check (`ownsLaunch`) attributes to the mode, so nothing a self-hosted session sends is forwarded to a real host.
|
|
26794
26820
|
*
|
|
26795
26821
|
* Above the sessions sits the conversation, the native service's own keying as observed through two bridged TUIs holding two distinct `cse_` ids over one live conversation (#238's finding): the event log and its sequence space belong to the conversation, and the `cse_` sessions are attachments to it. A create that names no conversation mints a fresh one, so the single-session shape every door-observed CLI runs keeps exactly its previous behaviour under a wrapper; a create that names one attaches to it, and every write through either attachment numbers in the one shared space and fans to every stream the conversation holds, each worker's own writes excepted (feeding a worker its own writes back would loop its REPL, while the other attachment's worker writes are the other client's half of the conversation, exactly what a second TUI joins to see). No observed wire shape names the link: the create body, the bridge answer and every envelope the captures and the 2.1.289 bundle show carry no conversation id, so the linking vocabulary here (the create body's `conversation` field, the `conv_` id prefix, the session rows' `conversation_id`, and the `/v1/code/conversations` family a sessionless client reads, writes and subscribes through) is this door's own design, named as such; should the real service's shape ever surface, these are the pieces to realign.
|
|
26796
26822
|
*
|
|
@@ -26822,6 +26848,8 @@ interface RcSelfHostCredentialRecord {
|
|
|
26822
26848
|
readonly refreshToken: string;
|
|
26823
26849
|
readonly organizationUuid: string;
|
|
26824
26850
|
readonly accountUuid: string;
|
|
26851
|
+
/** The id of the identity the credential was minted into: what attributes a launch to the mode (see `rcSelfHostLaunches.ts`). Absent from a record minted before the id was recorded, which attributes no launch until the identity is minted again. */
|
|
26852
|
+
readonly identityId?: string;
|
|
26825
26853
|
}
|
|
26826
26854
|
/** One search result a backend answers with: the three fields the CLI's web-search schema reads, of which only `url` must be present (the client filters on it). */
|
|
26827
26855
|
interface RcWebSearchResult {
|
|
@@ -26854,6 +26882,10 @@ interface RcSelfHostDeps {
|
|
|
26854
26882
|
readonly webFetch: RcWebFetcher;
|
|
26855
26883
|
/** A real search backend for the worker's web-search proxy, when one is wired; while undefined the proxy answers the clear refusal naming that no backend serves this door. */
|
|
26856
26884
|
readonly webSearch?: RcWebSearchBackend;
|
|
26885
|
+
/** Whether the launch holding a CONNECT tunnel's capability is a self-hosted session's (`createRcSelfHostLaunchCheck` in production): the one discriminator the connect surface decides every request, upgrade and blind tunnel of the mode by. */
|
|
26886
|
+
readonly ownsLaunch: (capability: string) => boolean;
|
|
26887
|
+
/** The same discriminator for a redirected connection, which carries no capability: whether the process holding its client end (on local port `port`) descends from a self-hosted launch, failing closed when it cannot be read. */
|
|
26888
|
+
readonly ownsPeer: (port: number) => Promise<boolean>;
|
|
26857
26889
|
readonly log?: (line: string) => void;
|
|
26858
26890
|
}
|
|
26859
26891
|
/** The self-hosted Remote Control service: the session-family route for the pipeline, and the local answers the connect surface consults before routing or piping. */
|
|
@@ -26900,6 +26932,12 @@ interface RcSelfHostMintResult {
|
|
|
26900
26932
|
}
|
|
26901
26933
|
/** Reads the door's previously minted record, or undefined when none exists (or what exists does not parse). */
|
|
26902
26934
|
declare function readRcSelfHostRecord(fs: Pick<FarmFs, "readFileUtf8">, frontdoorDir: string): RcSelfHostCredentialRecord | undefined;
|
|
26935
|
+
/** What `doctor` reports about the self-hosted mint: nothing when nothing is minted, and otherwise whether the mint can be attributed to one identity, either because its record names it or because exactly one identity holds its credential (which the door records at start). */
|
|
26936
|
+
interface RcSelfHostMintFacts {
|
|
26937
|
+
readonly attributable: boolean;
|
|
26938
|
+
/** How many identities hold the credential of a record that names none; absent for a record that names one. */
|
|
26939
|
+
readonly holders?: number;
|
|
26940
|
+
}
|
|
26903
26941
|
/**
|
|
26904
26942
|
* Mints the local credential for one identity and records the door's copy. Refuses, unless `force`, when the identity already holds an OAuth credential this door did not mint (a real claude.ai login): overwriting one silently would sign the identity out, and the mode's own contract is that no Anthropic credential is in play at all.
|
|
26905
26943
|
*/
|
|
@@ -28564,6 +28602,8 @@ interface RunDoctorParams {
|
|
|
28564
28602
|
readonly draining?: readonly number[];
|
|
28565
28603
|
/** What probing the serving door's listeners found: empty when no door serves or the platform cannot say. Omit to skip the listener checks. */
|
|
28566
28604
|
readonly listeners?: readonly FrontDoorListenerReading[];
|
|
28605
|
+
/** What is known of the self-hosted Remote Control mint, when one is minted: whether it can be attributed to one identity, since one that cannot makes a door in that mode refuse every launch's calls. Omit when nothing is minted. */
|
|
28606
|
+
readonly rcSelfHostMint?: RcSelfHostMintFacts;
|
|
28567
28607
|
};
|
|
28568
28608
|
}
|
|
28569
28609
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-use",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.6.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>",
|