claude-use 11.62.2 → 11.63.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 +1380 -942
- package/dist/index.cjs +117 -42
- package/dist/index.mjs +117 -42
- package/dist/types/index.d.ts +98 -42
- package/package.json +1 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import * as zod from 'zod';
|
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import { IncomingHttpHeaders, IncomingMessage, ServerResponse } from 'node:http';
|
|
6
6
|
import * as net from 'node:net';
|
|
7
|
+
import net__default from 'node:net';
|
|
7
8
|
import { Duplex, Readable } from 'node:stream';
|
|
8
9
|
import * as _orpc_client from '@orpc/client';
|
|
9
10
|
import * as zod_v4_core from 'zod/v4/core';
|
|
@@ -296,8 +297,8 @@ declare const LaunchSchema: z.ZodObject<{
|
|
|
296
297
|
}>>;
|
|
297
298
|
layout: z.ZodOptional<z.ZodObject<{
|
|
298
299
|
header: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
299
|
-
model: "model";
|
|
300
300
|
account: "account";
|
|
301
|
+
model: "model";
|
|
301
302
|
identity: "identity";
|
|
302
303
|
provider: "provider";
|
|
303
304
|
version: "version";
|
|
@@ -1427,8 +1428,8 @@ declare const ConfigProfileSchema: z.ZodObject<{
|
|
|
1427
1428
|
}>>;
|
|
1428
1429
|
layout: z.ZodOptional<z.ZodObject<{
|
|
1429
1430
|
header: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
1430
|
-
model: "model";
|
|
1431
1431
|
account: "account";
|
|
1432
|
+
model: "model";
|
|
1432
1433
|
identity: "identity";
|
|
1433
1434
|
provider: "provider";
|
|
1434
1435
|
version: "version";
|
|
@@ -2178,8 +2179,8 @@ declare const DirectoryRuleSchema: z.ZodObject<{
|
|
|
2178
2179
|
}>>;
|
|
2179
2180
|
layout: z.ZodOptional<z.ZodObject<{
|
|
2180
2181
|
header: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
2181
|
-
model: "model";
|
|
2182
2182
|
account: "account";
|
|
2183
|
+
model: "model";
|
|
2183
2184
|
identity: "identity";
|
|
2184
2185
|
provider: "provider";
|
|
2185
2186
|
version: "version";
|
|
@@ -2856,8 +2857,8 @@ declare const DirectoryRulesSchema: z.ZodObject<{
|
|
|
2856
2857
|
}>>;
|
|
2857
2858
|
layout: z.ZodOptional<z.ZodObject<{
|
|
2858
2859
|
header: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
2859
|
-
model: "model";
|
|
2860
2860
|
account: "account";
|
|
2861
|
+
model: "model";
|
|
2861
2862
|
identity: "identity";
|
|
2862
2863
|
provider: "provider";
|
|
2863
2864
|
version: "version";
|
|
@@ -3534,8 +3535,8 @@ declare const PortableConfigSchema: z.ZodObject<{
|
|
|
3534
3535
|
}>>;
|
|
3535
3536
|
layout: z.ZodOptional<z.ZodObject<{
|
|
3536
3537
|
header: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
3537
|
-
model: "model";
|
|
3538
3538
|
account: "account";
|
|
3539
|
+
model: "model";
|
|
3539
3540
|
identity: "identity";
|
|
3540
3541
|
provider: "provider";
|
|
3541
3542
|
version: "version";
|
|
@@ -4193,8 +4194,8 @@ declare const GlobalConfigSchema: z.ZodObject<{
|
|
|
4193
4194
|
}>>;
|
|
4194
4195
|
layout: z.ZodOptional<z.ZodObject<{
|
|
4195
4196
|
header: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
4196
|
-
model: "model";
|
|
4197
4197
|
account: "account";
|
|
4198
|
+
model: "model";
|
|
4198
4199
|
identity: "identity";
|
|
4199
4200
|
provider: "provider";
|
|
4200
4201
|
version: "version";
|
|
@@ -5785,6 +5786,42 @@ interface ConnectCapture {
|
|
|
5785
5786
|
readonly upgrade: (request: CapturedRequestShape) => void;
|
|
5786
5787
|
}
|
|
5787
5788
|
|
|
5789
|
+
/**
|
|
5790
|
+
* The listening-socket handover between a serving front door and the successor it starts for a planned replacement (`agent-shim frontdoor restart`, `agent-shim update --restart-door`), so the sticky addresses never stop accepting: the kernel's accept queue for each listener is held by the old door until the successor holds it too, and only then does the old door stop accepting and drain.
|
|
5791
|
+
*
|
|
5792
|
+
* The two doors speak over the IPC channel Node opens between a parent and the child it spawns with one, and each listening socket crosses it as a handle attached to a message (`child.send(message, server)`), which is the only way Node passes a listening socket between processes. The successor asks for each listener only once its own server for that listener is built, and adopts the handle in the same turn the message is delivered in: Node starts accepting on a received listening handle inside a server of its own before it hands the handle over, and a connection accepted there before the successor's server adopts it would reach a server with no connection listener and hang. Asking per listener keeps every adoption inside one delivery.
|
|
5793
|
+
*
|
|
5794
|
+
* The exchange, in order: the successor sends `take` naming one listener; the old door answers with `listener` naming it and carrying the handle; once the successor has adopted all three and recorded itself as the owner in the state file, it sends `serving` and ends the channel. The old door then drains exactly as it does on `SIGTERM`. Any other outcome (the successor exits or ends the channel early, sends something this release cannot read, or is still not serving when the budget ends) ends the successor if it is still running and leaves the old door to drain the ordinary way, so the replacement still happens, through the path that has a gap.
|
|
5795
|
+
*/
|
|
5796
|
+
/** Where a listener's socket comes from: bound afresh, preferring the sticky port and taking any free one when it is held, or adopted from the door being replaced. */
|
|
5797
|
+
type ListenSource = {
|
|
5798
|
+
readonly preferredPort: number | undefined;
|
|
5799
|
+
} | {
|
|
5800
|
+
readonly inherit: () => Promise<net__default.Server>;
|
|
5801
|
+
};
|
|
5802
|
+
/** The listeners a door hands over: the HTTPS provider listener, the CONNECT surface, and the plain-HTTP direct listener. */
|
|
5803
|
+
declare const HANDOVER_LISTENERS: readonly ["provider", "connect", "direct"];
|
|
5804
|
+
type HandoverListenerName = (typeof HANDOVER_LISTENERS)[number];
|
|
5805
|
+
/** The listening sockets a door hands over, one per listener. */
|
|
5806
|
+
type HandoverSockets = Readonly<Record<HandoverListenerName, net__default.Server>>;
|
|
5807
|
+
/** How a handover ended, as the old door sees it. */
|
|
5808
|
+
type HandoverOutcome = {
|
|
5809
|
+
readonly ok: true;
|
|
5810
|
+
readonly successorPid: number;
|
|
5811
|
+
} | {
|
|
5812
|
+
readonly ok: false;
|
|
5813
|
+
readonly reason: string;
|
|
5814
|
+
};
|
|
5815
|
+
/** What a successor door does with the channel to the door it replaces: take each listener's socket, then report that it serves. */
|
|
5816
|
+
interface Predecessor {
|
|
5817
|
+
/**
|
|
5818
|
+
* Asks for one listener's socket and resolves with it in the turn the old door's answer is delivered in, so the caller's continuation (which must adopt it at once, see the module comment) runs before the event loop can accept a connection on it. Rejects when the channel ends first or the answer cannot be read.
|
|
5819
|
+
*/
|
|
5820
|
+
readonly take: (listener: HandoverListenerName) => Promise<net__default.Server>;
|
|
5821
|
+
/** Tells the old door this door accepts on every listener and owns the state file, then ends the channel. */
|
|
5822
|
+
readonly serving: () => void;
|
|
5823
|
+
}
|
|
5824
|
+
|
|
5788
5825
|
/**
|
|
5789
5826
|
* The front door's CONNECT surface, so an OAuth session can have agent-shim's routing AND Claude Code's Remote Control at once: Remote Control refuses any `ANTHROPIC_BASE_URL` other than the real API, but happily honours `HTTPS_PROXY`, so OAuth launches route at the proxy layer instead.
|
|
5790
5827
|
*
|
|
@@ -5892,6 +5929,8 @@ type ConnectRequestHandler = (request: IncomingMessage, response: ServerResponse
|
|
|
5892
5929
|
/** A bound loopback listener and how to stop it. */
|
|
5893
5930
|
interface ConnectListenerHandle {
|
|
5894
5931
|
readonly port: number;
|
|
5932
|
+
/** The listening socket itself, which a planned replacement hands to the successor door (see `./handover.ts`). */
|
|
5933
|
+
readonly listening: net.Server;
|
|
5895
5934
|
/** Stops accepting and releases the port at once, leaving every connection already accepted open: a successor can bind the same port while they finish. */
|
|
5896
5935
|
readonly stopAccepting: () => void;
|
|
5897
5936
|
/** Stops accepting, ends every live connection, and resolves once the port is released. */
|
|
@@ -5920,8 +5959,8 @@ interface HttpParserSession {
|
|
|
5920
5959
|
* Every effect the MITM proxy performs, injected so the routing decisions and lifecycle run against fakes in unit tests (the SupervisorPorts pattern): TCP listening, TLS termination, HTTP parsing, plain TCP tunnels, and request forwarding. The real implementation is `realConnectEffects`; the TLS round-trip test uses it with redirected targets.
|
|
5921
5960
|
*/
|
|
5922
5961
|
interface ConnectEffects {
|
|
5923
|
-
/** Binds a loopback TCP listener
|
|
5924
|
-
readonly listenLoopback: (
|
|
5962
|
+
/** Binds a loopback TCP listener, or adopts the one `source` inherits from the door being replaced; a bound one tries the preferred port first and uses any free port when it is taken (bind, do not probe: check-then-bind races). Resolves with the bound port and a close handle. */
|
|
5963
|
+
readonly listenLoopback: (source: ListenSource, onSocket: (socket: net.Socket) => void) => Promise<ConnectListenerHandle>;
|
|
5925
5964
|
/** Builds the TLS terminator for one leaf, handing each successfully handshaked session to `onSecure` together with the context its `accept` call carried. `alpnProtocols`, when given, is advertised during the handshake, which is how a tap host's session can offer HTTP/2 the way its real server does. */
|
|
5926
5965
|
readonly createTlsAcceptor: (leaf: LeafCert, onSecure: (secure: net.Socket, context: string) => void, alpnProtocols?: readonly string[]) => TlsAcceptor;
|
|
5927
5966
|
/** Builds the transparent surface's TLS terminator: one handshake whose SNI name selects which served host's leaf answers it, so a connection redirected from any of the hosts sharing the redirected address is terminated as the host it named. A name the surface does not serve is answered with no certificate at all (a client that sends no SNI never reaches the selection and finds no default certificate either), because the only leaf that could answer such a name is another host's, which the client's own hostname check would reject anyway. No ALPN is offered: node's TLS server negotiates ALPN from the listener's own options and ignores protocols named on an SNI-selected secure context, and the API host's terminated session is parsed as HTTP/1.1, which a negotiated `h2` would strand. */
|
|
@@ -5975,12 +6014,14 @@ interface ConnectServerConfig {
|
|
|
5975
6014
|
/** A running connect surface. */
|
|
5976
6015
|
interface ConnectServerHandle {
|
|
5977
6016
|
readonly port: number;
|
|
6017
|
+
/** The CONNECT listener's listening socket, which a planned replacement hands to the successor door (see `./handover.ts`). The transparent listener is not handed over: it exists only when the door's own environment asks for it, which a successor decides for itself. */
|
|
6018
|
+
readonly listening: net.Server;
|
|
5978
6019
|
/** The transparent listener's port, when one was requested: what an operating-system redirect should point at. */
|
|
5979
6020
|
readonly transparentPort?: number;
|
|
5980
6021
|
/** How many authenticated connections (blind tunnels and terminated sessions together) are open now: what closing this surface, or exiting its process, drops. */
|
|
5981
6022
|
readonly openTunnels: () => number;
|
|
5982
6023
|
/**
|
|
5983
|
-
* Retires the surface without cutting off the tunnels it carries: the port is released at once so a successor can bind it,
|
|
6024
|
+
* Retires the surface without cutting off the tunnels it carries: the port is released at once so a successor can bind it, the terminated sessions (which carry this door's own routing state) are ended so their clients reconnect to the successor, and the blind tunnels, which are byte pumps to hosts the door never looks into, keep running until they end by themselves or their launch ends. A connection the listener accepted before it stopped but whose head has not arrived yet is still answered: its blind tunnel runs like any other, its terminated session serves one request and ends, and one whose head never comes is refused at its deadline. Resolves when the last connection has closed, with the surface fully closed.
|
|
5984
6025
|
*/
|
|
5985
6026
|
readonly drain: () => Promise<void>;
|
|
5986
6027
|
/** Stops the listener, drops every live tunnel and terminated session, and resolves once the port is released. */
|
|
@@ -6002,7 +6043,7 @@ interface ConnectLocalSurface {
|
|
|
6002
6043
|
*
|
|
6003
6044
|
* The connection flow: read the CONNECT head within the deadline (never more of the stream than that, so an early ClientHello glued to the head is pushed back with `unshift` and still seen by whatever consumes the socket next), authenticate it, then either blind-tunnel the target or terminate its TLS and parse HTTP on the session. Every network effect flows through `effects`; nothing here touches the network or filesystem itself.
|
|
6004
6045
|
*/
|
|
6005
|
-
declare function startConnectServer(config: ConnectServerConfig, effects: ConnectEffects,
|
|
6046
|
+
declare function startConnectServer(config: ConnectServerConfig, effects: ConnectEffects, source: ListenSource): Promise<ConnectServerHandle>;
|
|
6006
6047
|
/** The real `ConnectCertStore` on the filesystem: `ca.pem` world-readable (it is public material), `ca.key` mode 0600 exactly, chmod'ed after the write because a create's mode bits pass through the process umask. */
|
|
6007
6048
|
declare function realConnectCertStore(paths: {
|
|
6008
6049
|
readonly frontdoorCaDir: string;
|
|
@@ -9019,6 +9060,7 @@ declare function createConfigApiRouter(deps: ConfigApiDeps): {
|
|
|
9019
9060
|
kind: zod.ZodLiteral<"profile">;
|
|
9020
9061
|
name: zod.ZodString;
|
|
9021
9062
|
value: zod.ZodObject<{
|
|
9063
|
+
description: zod.ZodOptional<zod.ZodString>;
|
|
9022
9064
|
entries: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodUnion<readonly [zod.ZodBoolean, zod.ZodObject<{
|
|
9023
9065
|
value: zod.ZodBoolean;
|
|
9024
9066
|
when: zod.ZodUnion<readonly [zod.ZodObject<{
|
|
@@ -9094,7 +9136,6 @@ declare function createConfigApiRouter(deps: ConfigApiDeps): {
|
|
|
9094
9136
|
key: zod.ZodType<trilean.JsonValue, unknown, zod_v4_core.$ZodTypeInternals<trilean.JsonValue, unknown>>;
|
|
9095
9137
|
}, zod_v4_core.$strip>], "kind">]>;
|
|
9096
9138
|
}, zod_v4_core.$strict>]>>>;
|
|
9097
|
-
description: zod.ZodOptional<zod.ZodString>;
|
|
9098
9139
|
models: zod.ZodOptional<zod.ZodObject<{
|
|
9099
9140
|
virtual: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodUnion<readonly [zod.ZodObject<{
|
|
9100
9141
|
mode: zod.ZodEnum<{
|
|
@@ -9182,8 +9223,8 @@ declare function createConfigApiRouter(deps: ConfigApiDeps): {
|
|
|
9182
9223
|
}>>;
|
|
9183
9224
|
layout: zod.ZodOptional<zod.ZodObject<{
|
|
9184
9225
|
header: zod.ZodOptional<zod.ZodArray<zod.ZodEnum<{
|
|
9185
|
-
model: "model";
|
|
9186
9226
|
account: "account";
|
|
9227
|
+
model: "model";
|
|
9187
9228
|
identity: "identity";
|
|
9188
9229
|
provider: "provider";
|
|
9189
9230
|
version: "version";
|
|
@@ -9645,6 +9686,7 @@ declare function createConfigApiRouter(deps: ConfigApiDeps): {
|
|
|
9645
9686
|
kind: zod.ZodLiteral<"profile">;
|
|
9646
9687
|
name: zod.ZodString;
|
|
9647
9688
|
value: zod.ZodObject<{
|
|
9689
|
+
description: zod.ZodOptional<zod.ZodString>;
|
|
9648
9690
|
entries: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodUnion<readonly [zod.ZodBoolean, zod.ZodObject<{
|
|
9649
9691
|
value: zod.ZodBoolean;
|
|
9650
9692
|
when: zod.ZodUnion<readonly [zod.ZodObject<{
|
|
@@ -9720,7 +9762,6 @@ declare function createConfigApiRouter(deps: ConfigApiDeps): {
|
|
|
9720
9762
|
key: zod.ZodType<trilean.JsonValue, unknown, zod_v4_core.$ZodTypeInternals<trilean.JsonValue, unknown>>;
|
|
9721
9763
|
}, zod_v4_core.$strip>], "kind">]>;
|
|
9722
9764
|
}, zod_v4_core.$strict>]>>>;
|
|
9723
|
-
description: zod.ZodOptional<zod.ZodString>;
|
|
9724
9765
|
models: zod.ZodOptional<zod.ZodObject<{
|
|
9725
9766
|
virtual: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodUnion<readonly [zod.ZodObject<{
|
|
9726
9767
|
mode: zod.ZodEnum<{
|
|
@@ -9808,8 +9849,8 @@ declare function createConfigApiRouter(deps: ConfigApiDeps): {
|
|
|
9808
9849
|
}>>;
|
|
9809
9850
|
layout: zod.ZodOptional<zod.ZodObject<{
|
|
9810
9851
|
header: zod.ZodOptional<zod.ZodArray<zod.ZodEnum<{
|
|
9811
|
-
model: "model";
|
|
9812
9852
|
account: "account";
|
|
9853
|
+
model: "model";
|
|
9813
9854
|
identity: "identity";
|
|
9814
9855
|
provider: "provider";
|
|
9815
9856
|
version: "version";
|
|
@@ -10910,8 +10951,8 @@ declare function createConfigApiRouter(deps: ConfigApiDeps): {
|
|
|
10910
10951
|
}>>;
|
|
10911
10952
|
layout: zod.ZodOptional<zod.ZodObject<{
|
|
10912
10953
|
header: zod.ZodOptional<zod.ZodArray<zod.ZodEnum<{
|
|
10913
|
-
model: "model";
|
|
10914
10954
|
account: "account";
|
|
10955
|
+
model: "model";
|
|
10915
10956
|
identity: "identity";
|
|
10916
10957
|
provider: "provider";
|
|
10917
10958
|
version: "version";
|
|
@@ -11593,8 +11634,8 @@ declare function createConfigApiRouter(deps: ConfigApiDeps): {
|
|
|
11593
11634
|
}>>;
|
|
11594
11635
|
layout: zod.ZodOptional<zod.ZodObject<{
|
|
11595
11636
|
header: zod.ZodOptional<zod.ZodArray<zod.ZodEnum<{
|
|
11596
|
-
model: "model";
|
|
11597
11637
|
account: "account";
|
|
11638
|
+
model: "model";
|
|
11598
11639
|
identity: "identity";
|
|
11599
11640
|
provider: "provider";
|
|
11600
11641
|
version: "version";
|
|
@@ -12365,8 +12406,8 @@ declare const StatuslineSchema: z.ZodObject<{
|
|
|
12365
12406
|
}>>;
|
|
12366
12407
|
layout: z.ZodOptional<z.ZodObject<{
|
|
12367
12408
|
header: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
12368
|
-
model: "model";
|
|
12369
12409
|
account: "account";
|
|
12410
|
+
model: "model";
|
|
12370
12411
|
identity: "identity";
|
|
12371
12412
|
provider: "provider";
|
|
12372
12413
|
version: "version";
|
|
@@ -13128,8 +13169,8 @@ declare function createLaunchApiRouter(deps: LaunchApiDeps): {
|
|
|
13128
13169
|
}>>;
|
|
13129
13170
|
layout: zod.ZodOptional<zod.ZodObject<{
|
|
13130
13171
|
header: zod.ZodOptional<zod.ZodArray<zod.ZodEnum<{
|
|
13131
|
-
model: "model";
|
|
13132
13172
|
account: "account";
|
|
13173
|
+
model: "model";
|
|
13133
13174
|
identity: "identity";
|
|
13134
13175
|
provider: "provider";
|
|
13135
13176
|
version: "version";
|
|
@@ -14702,8 +14743,8 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
|
|
|
14702
14743
|
}>>;
|
|
14703
14744
|
layout: zod.ZodOptional<zod.ZodObject<{
|
|
14704
14745
|
header: zod.ZodOptional<zod.ZodArray<zod.ZodEnum<{
|
|
14705
|
-
model: "model";
|
|
14706
14746
|
account: "account";
|
|
14747
|
+
model: "model";
|
|
14707
14748
|
identity: "identity";
|
|
14708
14749
|
provider: "provider";
|
|
14709
14750
|
version: "version";
|
|
@@ -15405,6 +15446,7 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
|
|
|
15405
15446
|
kind: zod.ZodLiteral<"profile">;
|
|
15406
15447
|
name: zod.ZodString;
|
|
15407
15448
|
value: zod.ZodObject<{
|
|
15449
|
+
description: zod.ZodOptional<zod.ZodString>;
|
|
15408
15450
|
entries: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodUnion<readonly [zod.ZodBoolean, zod.ZodObject<{
|
|
15409
15451
|
value: zod.ZodBoolean;
|
|
15410
15452
|
when: zod.ZodUnion<readonly [zod.ZodObject<{
|
|
@@ -15480,7 +15522,6 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
|
|
|
15480
15522
|
key: zod.ZodType<trilean.JsonValue, unknown, zod_v4_core.$ZodTypeInternals<trilean.JsonValue, unknown>>;
|
|
15481
15523
|
}, zod_v4_core.$strip>], "kind">]>;
|
|
15482
15524
|
}, zod_v4_core.$strict>]>>>;
|
|
15483
|
-
description: zod.ZodOptional<zod.ZodString>;
|
|
15484
15525
|
models: zod.ZodOptional<zod.ZodObject<{
|
|
15485
15526
|
virtual: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodUnion<readonly [zod.ZodObject<{
|
|
15486
15527
|
mode: zod.ZodEnum<{
|
|
@@ -15568,8 +15609,8 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
|
|
|
15568
15609
|
}>>;
|
|
15569
15610
|
layout: zod.ZodOptional<zod.ZodObject<{
|
|
15570
15611
|
header: zod.ZodOptional<zod.ZodArray<zod.ZodEnum<{
|
|
15571
|
-
model: "model";
|
|
15572
15612
|
account: "account";
|
|
15613
|
+
model: "model";
|
|
15573
15614
|
identity: "identity";
|
|
15574
15615
|
provider: "provider";
|
|
15575
15616
|
version: "version";
|
|
@@ -16031,6 +16072,7 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
|
|
|
16031
16072
|
kind: zod.ZodLiteral<"profile">;
|
|
16032
16073
|
name: zod.ZodString;
|
|
16033
16074
|
value: zod.ZodObject<{
|
|
16075
|
+
description: zod.ZodOptional<zod.ZodString>;
|
|
16034
16076
|
entries: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodUnion<readonly [zod.ZodBoolean, zod.ZodObject<{
|
|
16035
16077
|
value: zod.ZodBoolean;
|
|
16036
16078
|
when: zod.ZodUnion<readonly [zod.ZodObject<{
|
|
@@ -16106,7 +16148,6 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
|
|
|
16106
16148
|
key: zod.ZodType<trilean.JsonValue, unknown, zod_v4_core.$ZodTypeInternals<trilean.JsonValue, unknown>>;
|
|
16107
16149
|
}, zod_v4_core.$strip>], "kind">]>;
|
|
16108
16150
|
}, zod_v4_core.$strict>]>>>;
|
|
16109
|
-
description: zod.ZodOptional<zod.ZodString>;
|
|
16110
16151
|
models: zod.ZodOptional<zod.ZodObject<{
|
|
16111
16152
|
virtual: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodUnion<readonly [zod.ZodObject<{
|
|
16112
16153
|
mode: zod.ZodEnum<{
|
|
@@ -16194,8 +16235,8 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
|
|
|
16194
16235
|
}>>;
|
|
16195
16236
|
layout: zod.ZodOptional<zod.ZodObject<{
|
|
16196
16237
|
header: zod.ZodOptional<zod.ZodArray<zod.ZodEnum<{
|
|
16197
|
-
model: "model";
|
|
16198
16238
|
account: "account";
|
|
16239
|
+
model: "model";
|
|
16199
16240
|
identity: "identity";
|
|
16200
16241
|
provider: "provider";
|
|
16201
16242
|
version: "version";
|
|
@@ -17296,8 +17337,8 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
|
|
|
17296
17337
|
}>>;
|
|
17297
17338
|
layout: zod.ZodOptional<zod.ZodObject<{
|
|
17298
17339
|
header: zod.ZodOptional<zod.ZodArray<zod.ZodEnum<{
|
|
17299
|
-
model: "model";
|
|
17300
17340
|
account: "account";
|
|
17341
|
+
model: "model";
|
|
17301
17342
|
identity: "identity";
|
|
17302
17343
|
provider: "provider";
|
|
17303
17344
|
version: "version";
|
|
@@ -17979,8 +18020,8 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
|
|
|
17979
18020
|
}>>;
|
|
17980
18021
|
layout: zod.ZodOptional<zod.ZodObject<{
|
|
17981
18022
|
header: zod.ZodOptional<zod.ZodArray<zod.ZodEnum<{
|
|
17982
|
-
model: "model";
|
|
17983
18023
|
account: "account";
|
|
18024
|
+
model: "model";
|
|
17984
18025
|
identity: "identity";
|
|
17985
18026
|
provider: "provider";
|
|
17986
18027
|
version: "version";
|
|
@@ -19540,6 +19581,7 @@ declare const ConfigProfileAddOutputSchema: z.ZodObject<{
|
|
|
19540
19581
|
kind: z.ZodLiteral<"profile">;
|
|
19541
19582
|
name: z.ZodString;
|
|
19542
19583
|
value: z.ZodObject<{
|
|
19584
|
+
description: z.ZodOptional<z.ZodString>;
|
|
19543
19585
|
entries: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
|
|
19544
19586
|
value: z.ZodBoolean;
|
|
19545
19587
|
when: z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -19615,7 +19657,6 @@ declare const ConfigProfileAddOutputSchema: z.ZodObject<{
|
|
|
19615
19657
|
key: z.ZodType<trilean.JsonValue, unknown, z.core.$ZodTypeInternals<trilean.JsonValue, unknown>>;
|
|
19616
19658
|
}, z.core.$strip>], "kind">]>;
|
|
19617
19659
|
}, z.core.$strict>]>>>;
|
|
19618
|
-
description: z.ZodOptional<z.ZodString>;
|
|
19619
19660
|
models: z.ZodOptional<z.ZodObject<{
|
|
19620
19661
|
virtual: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
19621
19662
|
mode: z.ZodEnum<{
|
|
@@ -19703,8 +19744,8 @@ declare const ConfigProfileAddOutputSchema: z.ZodObject<{
|
|
|
19703
19744
|
}>>;
|
|
19704
19745
|
layout: z.ZodOptional<z.ZodObject<{
|
|
19705
19746
|
header: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
19706
|
-
model: "model";
|
|
19707
19747
|
account: "account";
|
|
19748
|
+
model: "model";
|
|
19708
19749
|
identity: "identity";
|
|
19709
19750
|
provider: "provider";
|
|
19710
19751
|
version: "version";
|
|
@@ -20168,6 +20209,7 @@ declare const ConfigProfileSetOutputSchema: z.ZodObject<{
|
|
|
20168
20209
|
kind: z.ZodLiteral<"profile">;
|
|
20169
20210
|
name: z.ZodString;
|
|
20170
20211
|
value: z.ZodObject<{
|
|
20212
|
+
description: z.ZodOptional<z.ZodString>;
|
|
20171
20213
|
entries: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
|
|
20172
20214
|
value: z.ZodBoolean;
|
|
20173
20215
|
when: z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -20243,7 +20285,6 @@ declare const ConfigProfileSetOutputSchema: z.ZodObject<{
|
|
|
20243
20285
|
key: z.ZodType<trilean.JsonValue, unknown, z.core.$ZodTypeInternals<trilean.JsonValue, unknown>>;
|
|
20244
20286
|
}, z.core.$strip>], "kind">]>;
|
|
20245
20287
|
}, z.core.$strict>]>>>;
|
|
20246
|
-
description: z.ZodOptional<z.ZodString>;
|
|
20247
20288
|
models: z.ZodOptional<z.ZodObject<{
|
|
20248
20289
|
virtual: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
20249
20290
|
mode: z.ZodEnum<{
|
|
@@ -20331,8 +20372,8 @@ declare const ConfigProfileSetOutputSchema: z.ZodObject<{
|
|
|
20331
20372
|
}>>;
|
|
20332
20373
|
layout: z.ZodOptional<z.ZodObject<{
|
|
20333
20374
|
header: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
20334
|
-
model: "model";
|
|
20335
20375
|
account: "account";
|
|
20376
|
+
model: "model";
|
|
20336
20377
|
identity: "identity";
|
|
20337
20378
|
provider: "provider";
|
|
20338
20379
|
version: "version";
|
|
@@ -21435,8 +21476,8 @@ declare const ConfigRuleAddOutputSchema: z.ZodObject<{
|
|
|
21435
21476
|
}>>;
|
|
21436
21477
|
layout: z.ZodOptional<z.ZodObject<{
|
|
21437
21478
|
header: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
21438
|
-
model: "model";
|
|
21439
21479
|
account: "account";
|
|
21480
|
+
model: "model";
|
|
21440
21481
|
identity: "identity";
|
|
21441
21482
|
provider: "provider";
|
|
21442
21483
|
version: "version";
|
|
@@ -22120,8 +22161,8 @@ declare const ConfigRuleSetOutputSchema: z.ZodObject<{
|
|
|
22120
22161
|
}>>;
|
|
22121
22162
|
layout: z.ZodOptional<z.ZodObject<{
|
|
22122
22163
|
header: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
22123
|
-
model: "model";
|
|
22124
22164
|
account: "account";
|
|
22165
|
+
model: "model";
|
|
22125
22166
|
identity: "identity";
|
|
22126
22167
|
provider: "provider";
|
|
22127
22168
|
version: "version";
|
|
@@ -23062,8 +23103,8 @@ declare const LaunchResolveOutputSchema: z.ZodObject<{
|
|
|
23062
23103
|
}>>;
|
|
23063
23104
|
layout: z.ZodOptional<z.ZodObject<{
|
|
23064
23105
|
header: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
23065
|
-
model: "model";
|
|
23066
23106
|
account: "account";
|
|
23107
|
+
model: "model";
|
|
23067
23108
|
identity: "identity";
|
|
23068
23109
|
provider: "provider";
|
|
23069
23110
|
version: "version";
|
|
@@ -23843,6 +23884,10 @@ interface EnsureFrontDoorPorts {
|
|
|
23843
23884
|
readonly verifyListener: (port: number) => ListenerVerdict;
|
|
23844
23885
|
/** Asks a running front-door supervisor to exit, without waiting for it to: the caller polls `isRunning`. Only ever called for a pid whose recorded listener has just authenticated as agent-shim's own, or whose process is agent-shim's front-door supervisor (`isFrontDoorSupervisor`). */
|
|
23845
23886
|
readonly stopSupervisor: (pid: number) => void;
|
|
23887
|
+
/**
|
|
23888
|
+
* Asks a running front-door supervisor to hand its listening sockets to a successor it starts itself (see `./handover.ts`), without waiting for it to: the caller polls the state file for the successor. Only ever called for a pid whose listener has just authenticated, whose recorded protocol is `FRONT_DOOR_HANDOVER_PROTOCOL` or later, and whose process is agent-shim's own front-door supervisor, the process that installs the handler for the request. Absent where the platform has no way to deliver the request (Windows, which has no user signals), so every replacement there takes the stop-and-start path.
|
|
23889
|
+
*/
|
|
23890
|
+
readonly requestHandover?: (pid: number) => void;
|
|
23846
23891
|
/** Appends one line to the front door's own log. Called before every signal sent to a door, so the door's log names the cause of its own exit. */
|
|
23847
23892
|
readonly recordReplacement: (line: string) => void;
|
|
23848
23893
|
/** Ends a supervisor that did not exit when asked to, without giving it the chance to refuse: a door whose event loop is blocked never runs its signal handler. Called only for a pid `isFrontDoorSupervisor` has just confirmed, after `stopSupervisor` and a grace period. */
|
|
@@ -23869,10 +23914,8 @@ declare function ensureFrontDoor(params: {
|
|
|
23869
23914
|
readonly token: string;
|
|
23870
23915
|
};
|
|
23871
23916
|
|
|
23872
|
-
/** What the supervisor holds: a beat
|
|
23917
|
+
/** What the supervisor holds: a stop for when it begins to retire. The beat that tells the watchdog the main event loop ran comes from the watchdog's own timer on that loop (see `startThreadWatchdog`), not from the supervisor's tick, so nothing a tick awaits (a `ps` run a loaded machine is slow to finish) is taken for a loop that did not run. */
|
|
23873
23918
|
interface DoorWatchdog {
|
|
23874
|
-
/** Records that the main event loop ran. Called from the supervisor's tick, which only runs while the loop serves. */
|
|
23875
|
-
readonly beat: () => void;
|
|
23876
23919
|
/** Ends the watchdog before the door begins an orderly retirement, so a slow close is never taken for a stall. Idempotent. */
|
|
23877
23920
|
readonly stop: () => void;
|
|
23878
23921
|
}
|
|
@@ -23880,6 +23923,8 @@ interface DoorWatchdog {
|
|
|
23880
23923
|
/** A bound front-door listener in this process, and how to stop it. */
|
|
23881
23924
|
interface FrontDoorListenerHandle {
|
|
23882
23925
|
readonly port: number;
|
|
23926
|
+
/** The listening socket itself, which a planned replacement hands to the successor door (see `./handover.ts`). */
|
|
23927
|
+
readonly listening: net__default.Server;
|
|
23883
23928
|
/** Stops accepting, ends every live connection, and resolves once the port is released. */
|
|
23884
23929
|
readonly close: () => Promise<void>;
|
|
23885
23930
|
/** Releases the port at once (before the first await) and leaves the work already in progress to finish; resolves when the listener has nothing left to carry. */
|
|
@@ -23913,29 +23958,40 @@ interface FrontDoorSupervisorPorts {
|
|
|
23913
23958
|
*/
|
|
23914
23959
|
readonly runningAmong: (pids: readonly number[]) => Promise<ReadonlySet<number>>;
|
|
23915
23960
|
/**
|
|
23916
|
-
* Starts the provider listener in this process
|
|
23961
|
+
* Starts the provider listener in this process from `source`: bound on its preferred port (falling back to any free port when the sticky one is taken, decided at bind time rather than by a racy check-then-bind probe), or adopted from the door this one replaces. Resolves once it accepts and has answered its own health probe over TLS. This is the HTTPS listener every provider session's base URL points at, serving a loopback leaf signed by agent-shim's CA.
|
|
23917
23962
|
*/
|
|
23918
|
-
readonly startProviderListener: (
|
|
23963
|
+
readonly startProviderListener: (source: ListenSource) => Promise<FrontDoorListenerHandle>;
|
|
23919
23964
|
/**
|
|
23920
|
-
* Starts the CONNECT surface in this process
|
|
23965
|
+
* Starts the CONNECT surface in this process from `source` (same bind-time fallback, or adopted): the TLS-terminating listener an OAuth session's HTTPS_PROXY points at. Bound before any state names it, so an OAuth launch never finds one listener up without the other.
|
|
23921
23966
|
*/
|
|
23922
|
-
readonly startConnectListener: (
|
|
23967
|
+
readonly startConnectListener: (source: ListenSource) => Promise<FrontDoorListenerHandle>;
|
|
23923
23968
|
/**
|
|
23924
|
-
* Starts the direct listener
|
|
23969
|
+
* Starts the direct listener from `source` (same bind-time fallback, or adopted): the same routes as the provider listener, minus the headroom hop, over plain HTTP because headroom is what connects to it. Headroom forwards routed traffic back here, which is what keeps the hop from looping, and the port is sticky like the others because headroom's allowlist admits its exact origin. It admits only the hop's own requests and holds no credential until it redeems one from the hop's custody.
|
|
23925
23970
|
*/
|
|
23926
|
-
readonly startDirectListener: (
|
|
23971
|
+
readonly startDirectListener: (source: ListenSource) => Promise<FrontDoorListenerHandle>;
|
|
23927
23972
|
/**
|
|
23928
23973
|
* Stops the Remote Control stream hub: persists every live attachment's sequence cursor synchronously, then frees the dials. Called exactly once on every exit the supervisor owns, after every listener has stopped accepting. A closing exit has every listener down by then; a drain still has responses settling, which is safe because the hub refuses to attach once it is closed (otherwise the reconcile after an observed exchange would re-attach a stream the close had just ended).
|
|
23929
23974
|
*/
|
|
23930
23975
|
readonly closeRcStreamHub: () => void;
|
|
23931
23976
|
/**
|
|
23932
|
-
* Starts the watchdog that ends this process when its main event loop stops running: it lives on its own thread, so a loop that is blocked cannot stall it.
|
|
23977
|
+
* Starts the watchdog that ends this process when its main event loop stops running: it lives on its own thread, so a loop that is blocked cannot stall it. It beats from its own timer on the main loop rather than from the tick, so a tick waiting on a slow `ps` is never taken for a loop that stopped, and the supervisor stops it before it begins to retire, so it only ever judges a door that is meant to be serving. Optional because ending the process is only right when the process is the door: the CLI's `__frontdoor-supervisor` supplies it, and a library host that runs the door inside its own process does not get its application killed by default.
|
|
23933
23978
|
*/
|
|
23934
23979
|
readonly startWatchdog?: () => DoorWatchdog;
|
|
23935
23980
|
/**
|
|
23936
23981
|
* Aborted when the process is asked to exit (the CLI's `__frontdoor-supervisor` aborts it on its first SIGTERM or SIGINT). The door then retires by draining: it releases its listening addresses at once, so a successor can bind the same sticky ports, ends what holds its own routing state, and stays up only as long as the connections it still carries (blind tunnels, a response being streamed) take to end. Optional for a host that decides when the door stops by other means.
|
|
23937
23982
|
*/
|
|
23938
23983
|
readonly retire?: AbortSignal;
|
|
23984
|
+
/**
|
|
23985
|
+
* A planned replacement that keeps every address accepting (see `./handover.ts`): `requested` is aborted when a launcher asks this door to hand its listeners to a successor (the CLI's `__frontdoor-supervisor` aborts it on `SIGUSR2`), and `run` starts the successor, hands it the three listening sockets and resolves once it serves them or with why it did not. The door keeps accepting throughout and drains afterwards either way, so a failed handover still ends in the ordinary replacement. Optional because only a door whose process can start a successor of itself can offer it.
|
|
23986
|
+
*/
|
|
23987
|
+
readonly handover?: {
|
|
23988
|
+
readonly requested: AbortSignal;
|
|
23989
|
+
readonly run: (sockets: HandoverSockets) => Promise<HandoverOutcome>;
|
|
23990
|
+
};
|
|
23991
|
+
/**
|
|
23992
|
+
* The door this one replaces through a handover, when it was started for one: its listeners are adopted from that door's sockets instead of bound, the state file is not written until this door accepts on all three (the old door owns it and keeps serving until then), and the old door is told once this door serves. Absent for every other start.
|
|
23993
|
+
*/
|
|
23994
|
+
readonly predecessor?: Predecessor;
|
|
23939
23995
|
/** Stops the work the door runs on its own account rather than for a request (the usage, window, job and catalogue keepers), called once when a drain begins so the successor's are the only ones acting. Optional because a host without such work has nothing to stop. */
|
|
23940
23996
|
readonly stopBackgroundWork?: () => void;
|
|
23941
23997
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-use",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.63.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>",
|