@hediet/linkrpc 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +383 -0
- package/dist/chunks/_empty-crypto-Bi0tGx5K.js +8 -0
- package/dist/chunks/boundedTrafficSubscription-1L592xc7.js +1126 -0
- package/dist/chunks/boundedTrafficSubscription-1L592xc7.js.map +1 -0
- package/dist/chunks/hub.interfaces-BzWfsVT2.js +526 -0
- package/dist/chunks/hub.interfaces-BzWfsVT2.js.map +1 -0
- package/dist/chunks/hubAccess-DwTZPiI8.d.ts +79 -0
- package/dist/chunks/hubAccess-DwTZPiI8.d.ts.map +1 -0
- package/dist/chunks/hubFacade-CQflVkVC.js +85 -0
- package/dist/chunks/hubFacade-CQflVkVC.js.map +1 -0
- package/dist/chunks/hubFacade-Dkgw2pTi.d.ts +101 -0
- package/dist/chunks/hubFacade-Dkgw2pTi.d.ts.map +1 -0
- package/dist/chunks/linkRpcConnection-CtlQmetO.d.ts +3623 -0
- package/dist/chunks/linkRpcConnection-CtlQmetO.d.ts.map +1 -0
- package/dist/chunks/rolldown-runtime-4LSo1kEK.js +17 -0
- package/dist/chunks/src-D3NUIwyo.js +7795 -0
- package/dist/chunks/src-D3NUIwyo.js.map +1 -0
- package/dist/hub/client/index.d.ts +50 -0
- package/dist/hub/client/index.d.ts.map +1 -0
- package/dist/hub/client/index.js +97 -0
- package/dist/hub/client/index.js.map +1 -0
- package/dist/hub/common/index.d.ts +1189 -0
- package/dist/hub/common/index.d.ts.map +1 -0
- package/dist/hub/common/index.js +267 -0
- package/dist/hub/common/index.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +7 -0
- package/dist/inspection/index.d.ts +66 -0
- package/dist/inspection/index.d.ts.map +1 -0
- package/dist/inspection/index.js +6 -0
- package/dist/node.d.ts +548 -0
- package/dist/node.d.ts.map +1 -0
- package/dist/node.js +1087 -0
- package/dist/node.js.map +1 -0
- package/dist/web.d.ts +44 -0
- package/dist/web.d.ts.map +1 -0
- package/dist/web.js +58 -0
- package/dist/web.js.map +1 -0
- package/package.json +59 -0
package/dist/node.d.ts
ADDED
|
@@ -0,0 +1,548 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { $ as ManagedIdentityStorageBackend, $i as DiscriminatorSchema, $n as signedHash, $r as zTopologyLinkEndpoint, $t as Result, A as VerifyRpcCallResult, Ai as InterfaceMemberRefMap, An as Capability, Ar as nodeInterface, At as WsNoInitEndpoint, B as OneShotCapStaging, Bi as RequestType, Bn as permissionPermits, Br as TopologyTransportInfo, Bt as ExpBackoffOptions, C as VerifyCallOptions, Ca as JsonValue, Ci as computeInterfaceHash, Cn as ParsedMethodName, Cr as StreamControlReason, Ct as CmdEnvEndpoint, D as SignRpcCallOptions, Di as InterfaceHandlers, Dn as Call, Dr as streamInterface, Dt as ResolvedEndpoint, E as verifyCall, Ei as InterfaceDefinitionOpts, En as Ability, Er as StreamSendParams, Et as FormatEndpointOptions, F as identityStorageInterface, Fi as defineInterface, Fn as TargetPattern, Fr as TopologyLink, Ft as DEFAULT_RPC_TIMEOUT_MS, G as createManagedPrincipal, Gi as zodToSvcJsonSchema, Gn as LINKRPC_META_KEY, Gr as TrafficWatchResult, Gt as Channel, H as SigningSender, Hi as ZodToSvcJsonSchemaOptions, Hn as HUBRPC_META_KEY, Hr as TrafficOverflowEvent, Ht as OnChannelConnect, I as crypto_d_exports, Ii as interfaceFromSchema, In as capabilityPermits, Ir as TopologyLinkEndpoint, It as withRpcTimeout, J as CapBagOptions, Ji as MemberAnnotations, Jn as SignDomain, Jr as zParticipantDescriptor, Jt as IRequestSender, K as Principal, Ki as ErrorSchema, Kn as LINKRPC_SIGNATURE_KEY, Kr as topologyInterface, Kt as ChannelTransport, L as CapProvider, Li as MemberDocs, Ln as hasSignedCapabilityShape, Lr as TopologyNode, Lt as JsonRpcChannel, M as signRpcCall, Mi as StreamApi, Mn as Pattern, Mr as ParticipantDescriptorSource, Mt as isHubEndpoint, N as verifyRpcCall, Ni as StreamCallOptions, Nn as Permission, Nr as RouteClaim, Nt as parseEndpointUri, O as SignedRpcCall, Oi as InterfaceInfo, On as CallBind, Or as NodeInfo, Ot as SocketEndpoint, P as identityInterface, Pi as StreamingCall, Pn as SignedCapability, Pr as TopologyGraph, Pt as CancellableRequest, Q as ManagedIdentityStorage, Qi as ConstSchema, Qn as readSignature, Qr as zTopologyLink, Qt as RawStreamingCall, R as CapProviderResult, Ri as MemberType, Rn as matchParams, Rr as TopologyPort, Rt as ChannelConnector, S as SignParamsOptions, Sa as isResponse, Si as EXTENSION_PREFIX, Sn as stripLinkRpcWireMeta, Sr as STREAM_METHOD, St as WrappingIdentity, T as signParams, Ti as InterfaceDefinition, Tn as parseMethodName, Tr as StreamDir, Tt as EndpointCommand, U as SigningSenderConfig, Ui as notificationType, Un as HUBRPC_SIGNATURE_KEY, Ur as TrafficTransitEndpoint, Ut as BareInterfaceTarget, V as SigningCallCtx, Vi as Schema, Vn as Base64Sha256, Vr as TrafficEvent, Vt as KeepConnectedHandle, W as PrincipalWithStore, Wi as requestType, Wn as HUBRPC_UNSIGNED_KEY, Wr as TrafficTransitEvent, Wt as bareInterfaceTarget, X as InMemoryManagedIdentityStorage, Xi as ArraySchema, Xn as Signatures, Xr as zRouteClaim, Xt as IncomingStream, Y as InMemoryManagedIdentity, Yi as MethodSchema, Yn as SignatureEnvelope, Yr as zParticipantDescriptorSource, Yt as IncomingCall, Z as ManagedIdentity, Zi as BooleanSchema, Zn as getKeyId, Zr as zTopologyGraph, Zt as MessageWithCtx, _ as SeededPrincipalOptions, _a as JsonRpcResponse, _i as componentSchemaName, _n as LinkRpcJsonRpcRequest, _r as principalForPublicKey, _t as KeypairSigningIdentity, a as LinkRpcConnection, aa as ObjectSchema, ai as zTrafficOverflowEvent, an as IMessageTransport, ar as Keypair, at as ParamMatcherFor, b as createSeededSigningIdentity, ba as isNotification, bi as isAssignable, bn as LinkRpcWireParams, br as jcsCanonicalize, bt as SerializedKeypairSigningIdentity, c as ServiceHandle, ca as SchemaBase, ci as zTrafficWatchResult, cn as MessageTransportWithContext, cr as PrivateKey, ct as capBagFreshAt, d as ServiceIdPattern, da as UnionSchema, di as SchemaToZodContext, dn as connectTransports, dr as Signature, dt as issueCapability, ea as EnumSchema, ei as zTopologyNode, en as RpcError, er as signingDomainValue, et as createManagedIdentity, f as defaultsInterface, fa as ErrorCode, fi as createSchemaToZod, fn as traceMessageTransport, fr as X25519Keypair, ft as permits, g as zServiceIdPattern, ga as JsonRpcRequest, gi as assertSchemaReferences, gn as LinkRpcJsonRpcNotification, gr as keyIdForPublicKey, gt as KeypairIdentity, h as schemasInterface, ha as JsonRpcNotification, hi as materializeJsonSchema, hn as LinkRpcJsonRpcMessage, hr as keyIdForPrincipal, ht as Identity, i as InterfaceRegistration, ia as NumberSchema, ii as zTrafficEvent, in as MuxEnvelope, ir as KeyId, it as IssueCapabilityOptions, j as attachCapabilities, ji as MemberMap, jn as ParamMatcher, jr as ParticipantDescriptor, jt as formatEndpointUri, k as VerifyRpcCallOptions, ki as InterfaceMemberRef, kn as CallTarget, kr as TopologyIdGenerator, kt as WsEndpoint, l as RootPrincipalReq, la as StringSchema, li as GenerateInterfaceOptions, ln as MessageWithContext, lr as PublicKey, lt as capabilityFreshAt, m as directoryWatchNever, ma as JsonRpcMessage, mi as MaterializedJsonSchema, mn as CallMeta, mr as bytesToBase64Url, mt as signCapability, n as GetOptions, na as LinkRpcJsonSchema, ni as zTopologyTransportEndpoint, nn as StreamSendOpts, nr as withSignature, nt as registerLazyIdentityOnOverlay, o as LinkRpcConnectionOptions, oa as OneOfSchema, oi as zTrafficTransitEndpoint, on as MessageTransportDirection, or as PRINCIPAL_PREFIX, ot as ParamMatchers, p as directoryInterface, pa as JsonRpcError, pi as schemaToZod, pn as IDisposable, pr as base64UrlToBytes, pt as prefix, q as CapBag, qi as LinkRpcInterfaceSchema, qn as LINKRPC_UNSIGNED_KEY, qr as trafficInterface, qt as IRequestHandler, r as InspectionRegistration, ra as NullSchema, ri as zTopologyTransportInfo, rn as MultiplexedTransport, rr as KEY_ID_PREFIX, rt as AcceptedRootIssuer, s as RegisterOptions, sa as RefSchema, si as zTrafficTransitEvent, sn as MessageTransportTrace, sr as PrincipalId, st as PermitResult, t as BareGetOptions, ta as IntegerSchema, ti as zTopologyPort, tn as SendOpts, tr as signingInput, tt as registerIdentityOnOverlay, u as RootPrincipalSet, ua as TupleSchema, ui as generateTsInterface, un as TransportPair, ur as ResolveSigningKeyArgs, ut as invoke, v as createMemoryPrincipal, va as JsonRpcSuccess, vi as componentSchemaRef, vn as LinkRpcUnsigned, vr as publicKeyForKeyId, vt as PublicSigningIdentity, w as VerifyResult, wi as InterfaceClient, wn as methodNameToTarget, wr as StreamControlType, wt as CmdStdioEndpoint, x as JsonObject, xa as isRequest, xi as normalizeJsonSchema, xn as requireObjectParams, xr as jcsCanonicalizeBytes, xt as SigningIdentity, y as createSeededMemoryPrincipal, ya as RequestId, yi as Components, yn as LinkRpcWireMeta, yr as resolveSigningKey, yt as PublicWrappingIdentity, z as ManagedSigningChannel, zi as NotificationType, zn as permissionMatchesTarget, zr as TopologyTransportEndpoint, zt as ConnectableChannel } from "./chunks/linkRpcConnection-CtlQmetO.js";
|
|
6
|
+
import { t as Hub } from "./chunks/hubFacade-Dkgw2pTi.js";
|
|
7
|
+
//#region src/node/stdio.d.ts
|
|
8
|
+
/**
|
|
9
|
+
* Spawn a child process and connect to its stdio as a linkrpc connection.
|
|
10
|
+
*
|
|
11
|
+
* Pass a single command line (split on whitespace) or an array `[cmd, ...args]`.
|
|
12
|
+
* The child's stderr is piped to the parent's stderr so logs surface naturally.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* const c = await connectToCmdStdio("node ./ghConnector.js");
|
|
16
|
+
* const gh = c.get(ghInterface);
|
|
17
|
+
* await gh.createIssue({ title: "..." });
|
|
18
|
+
*/
|
|
19
|
+
declare function connectToCmdStdio(cmd: string | readonly string[]): Promise<LinkRpcConnection>;
|
|
20
|
+
/**
|
|
21
|
+
* For the child side: a linkrpc connection over this process's stdin/stdout.
|
|
22
|
+
* The child MUST NOT write user output to stdout — only RPC messages — or
|
|
23
|
+
* the parent's parser will choke.
|
|
24
|
+
*/
|
|
25
|
+
declare function serveOnStdio(): Promise<LinkRpcConnection>;
|
|
26
|
+
/**
|
|
27
|
+
* A raw, unsigned channel over this process's stdin/stdout — the stdio
|
|
28
|
+
* counterpart to `openHubChannel`. It *is* a {@link Channel} (so it plugs
|
|
29
|
+
* straight into {@link SigningSender.wrapChannel} / `new LinkRpcConnection`),
|
|
30
|
+
* augmented with a close signal for stdin end. Use {@link serveOnStdio}
|
|
31
|
+
* instead when no signing is needed.
|
|
32
|
+
*/
|
|
33
|
+
type StdioChannel = Channel<undefined, unknown> & {
|
|
34
|
+
/** Fires once when stdin ends/closes. Returns a disposable to unsubscribe. */
|
|
35
|
+
onClose(listener: () => void): IDisposable;
|
|
36
|
+
};
|
|
37
|
+
declare function openStdioChannel(): Promise<StdioChannel>;
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region src/node/hubClient.d.ts
|
|
40
|
+
/** Env var the hub publishes for its endpoint (named pipe / UDS path). */
|
|
41
|
+
declare const LINKRPC_ENDPOINT_VAR = "LINKRPC_ENDPOINT";
|
|
42
|
+
/** Env var the hub publishes for its shared attribution token. */
|
|
43
|
+
declare const LINKRPC_TOKEN_VAR = "LINKRPC_TOKEN";
|
|
44
|
+
interface ConnectToHubOptions {
|
|
45
|
+
/** Defaults to `process.env.LINKRPC_ENDPOINT`. */
|
|
46
|
+
readonly endpoint?: string;
|
|
47
|
+
/** Defaults to `process.env.LINKRPC_TOKEN`. */
|
|
48
|
+
readonly token?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Initial {@link Principal} (identity + persistent caps) for outbound
|
|
51
|
+
* calls. Stored on the returned handle's {@link HubClientHandle.signing}
|
|
52
|
+
* config; mutate that later to install or swap. `undefined` leaves the
|
|
53
|
+
* connection unsigned (plain JSON-RPC) until a principal is installed.
|
|
54
|
+
*/
|
|
55
|
+
readonly principal?: Principal;
|
|
56
|
+
/**
|
|
57
|
+
* Initial one-shot capability staging policy. Same lifecycle as
|
|
58
|
+
* {@link principal}; drained per outbound signed call.
|
|
59
|
+
*/
|
|
60
|
+
readonly oneShotCaps?: OneShotCapStaging;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Mutable signing config consulted per-call by the {@link SigningSender}
|
|
64
|
+
* wrapping a {@link HubClientHandle.connection}. Mutating either field
|
|
65
|
+
* takes effect on the next outbound call. No setter on the sender
|
|
66
|
+
* itself — it is a plain caller-owned {@link SigningSenderConfig}.
|
|
67
|
+
*/
|
|
68
|
+
type HubSigningHolder = {
|
|
69
|
+
principal?: Principal;
|
|
70
|
+
capProvider?: SigningSenderConfig['capProvider'];
|
|
71
|
+
oneShotCaps?: OneShotCapStaging;
|
|
72
|
+
};
|
|
73
|
+
interface HubClientHandle {
|
|
74
|
+
/** Full linkrpc connection wrapping the same transport. */
|
|
75
|
+
readonly connection: LinkRpcConnection<undefined, SigningCallCtx>;
|
|
76
|
+
/**
|
|
77
|
+
* Façade over the hub's own serviceId-routed services (`hubGrantedServiceId`,
|
|
78
|
+
* `hubAccess`, …) on this {@link connection}. Use it to read connection
|
|
79
|
+
* facts ({@link Hub.getConnectionInfo}) or claim this connection's granted
|
|
80
|
+
* serviceId namespace ({@link Hub.claimGrantedServiceIdNamespace}) without
|
|
81
|
+
* hand-routing the interface clients.
|
|
82
|
+
*/
|
|
83
|
+
readonly hub: Hub;
|
|
84
|
+
/** Configured endpoint + token (in case the caller defaulted from env). */
|
|
85
|
+
readonly endpoint: string;
|
|
86
|
+
readonly token: string;
|
|
87
|
+
/**
|
|
88
|
+
* Mutable signing config. Starts empty (every call goes out
|
|
89
|
+
* unsigned). `installManagedIdentitySigner` and `setupHubSigning`
|
|
90
|
+
* populate this; user code can also drive it directly.
|
|
91
|
+
*/
|
|
92
|
+
readonly signing: HubSigningHolder;
|
|
93
|
+
/**
|
|
94
|
+
* Register a callback that fires when the underlying socket closes
|
|
95
|
+
* (peer end, error, or explicit {@link close}). Fires at most once.
|
|
96
|
+
* Returns an unsubscribe function.
|
|
97
|
+
*/
|
|
98
|
+
onClose(listener: () => void): IDisposable;
|
|
99
|
+
/** Close the underlying socket and tear everything down. */
|
|
100
|
+
close(): void;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Open a connection to a running linkrpc hub. Reads `LINKRPC_ENDPOINT` and
|
|
104
|
+
* `LINKRPC_TOKEN` from the environment unless overridden. Sends the single-
|
|
105
|
+
* line `{"hello":1,"token":"..."}` preamble that the hub's socket server
|
|
106
|
+
* requires, then wraps the socket in an `LinkRpcConnection`.
|
|
107
|
+
*
|
|
108
|
+
* Throws if env vars are missing, if the socket cannot be opened, or if the
|
|
109
|
+
* hub refuses the preamble (the socket simply closes — callers should treat
|
|
110
|
+
* an immediate close of the channel as an auth failure).
|
|
111
|
+
*/
|
|
112
|
+
declare function connectToHub(options?: ConnectToHubOptions): Promise<HubClientHandle>;
|
|
113
|
+
/** Options for {@link openHubChannel}. Subset of {@link ConnectToHubOptions}. */
|
|
114
|
+
interface OpenHubChannelOptions {
|
|
115
|
+
/** Defaults to `process.env.LINKRPC_ENDPOINT`. */
|
|
116
|
+
readonly endpoint?: string;
|
|
117
|
+
/**
|
|
118
|
+
* Defaults to `process.env.LINKRPC_TOKEN`, or `''` when unset. The token
|
|
119
|
+
* is sent in the hello preamble; provenance-authenticated hubs (hubv2)
|
|
120
|
+
* ignore it, so an empty token is valid there.
|
|
121
|
+
*/
|
|
122
|
+
readonly token?: string;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* A raw, unsigned hub channel: the socket transport wrapped only in a
|
|
126
|
+
* {@link JsonRpcChannel}, with no signing applied. It *is* a {@link Channel}
|
|
127
|
+
* (so it plugs straight into {@link SigningSender.wrapChannel} /
|
|
128
|
+
* `new LinkRpcConnection`), augmented with the hub endpoint/token and the
|
|
129
|
+
* socket lifecycle. Identity/signing is composed on top by the caller;
|
|
130
|
+
* {@link connectToHub} is the batteries-included version that adds a
|
|
131
|
+
* mutable signing holder.
|
|
132
|
+
*/
|
|
133
|
+
type HubChannel = Channel<undefined, unknown> & {
|
|
134
|
+
readonly endpoint: string;
|
|
135
|
+
readonly token: string;
|
|
136
|
+
/**
|
|
137
|
+
* Register a callback that fires when the socket closes. Fires at most
|
|
138
|
+
* once. Returns an unsubscribe function.
|
|
139
|
+
*/
|
|
140
|
+
onClose(listener: () => void): IDisposable;
|
|
141
|
+
/** Close the underlying socket. */
|
|
142
|
+
close(): void;
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* Open the hub socket and send the preamble, returning the raw
|
|
146
|
+
* {@link HubChannel} without any signing. Use this when you want to
|
|
147
|
+
* compose identity yourself; otherwise prefer {@link connectToHub}.
|
|
148
|
+
*/
|
|
149
|
+
declare function openHubChannel(options?: OpenHubChannelOptions): Promise<HubChannel>;
|
|
150
|
+
/**
|
|
151
|
+
* Send the `linkrpc.hub::hubServiceIdRegistry::registerServiceId` call on an open
|
|
152
|
+
* hub connection. In `openMode` the hub accepts the unsigned call directly —
|
|
153
|
+
* pass no `identity`. Outside `openMode` the caller must sign the params
|
|
154
|
+
* with their `identity` keypair (via `signParams`) and present a
|
|
155
|
+
* capability that authorizes the claim — unless the signer is already an
|
|
156
|
+
* admin on the hub, in which case `capabilities` may be omitted.
|
|
157
|
+
*
|
|
158
|
+
* Resolves once the hub has registered the prefix; rejects on denial.
|
|
159
|
+
*/
|
|
160
|
+
interface RegisterHubPrefixOptions {
|
|
161
|
+
readonly handle: HubClientHandle;
|
|
162
|
+
readonly prefix: string;
|
|
163
|
+
/**
|
|
164
|
+
* Caller's signing identity. Required when the hub is not in openMode.
|
|
165
|
+
* The `principal` must encode the `publicKey` (round-tripped through
|
|
166
|
+
* `principalForPublicKey`). Bound to this transport on first successful
|
|
167
|
+
* `register` — subsequent calls on the same socket may not switch
|
|
168
|
+
* identity.
|
|
169
|
+
*/
|
|
170
|
+
readonly identity?: {
|
|
171
|
+
readonly principal: PrincipalId;
|
|
172
|
+
readonly keypair: Keypair;
|
|
173
|
+
};
|
|
174
|
+
/**
|
|
175
|
+
* Capabilities to present. Each must be issued (directly or
|
|
176
|
+
* transitively) by an admin and permit
|
|
177
|
+
* `<prefix>::hubServiceIdRegistry::registerServiceId`. Omit when the signer
|
|
178
|
+
* is already an admin.
|
|
179
|
+
*/
|
|
180
|
+
readonly capabilities?: readonly SignedCapability[];
|
|
181
|
+
}
|
|
182
|
+
declare function registerHubPrefix(opts: RegisterHubPrefixOptions): Promise<void>;
|
|
183
|
+
interface LoadOrCreateIdentityOptions {
|
|
184
|
+
/**
|
|
185
|
+
* Stable string that identifies this identity slot. Typically the calling
|
|
186
|
+
* module's `import.meta.filename` — each service then automatically gets
|
|
187
|
+
* its own slot.
|
|
188
|
+
*/
|
|
189
|
+
readonly id: string;
|
|
190
|
+
/** Override the storage directory (defaults to a per-user folder). */
|
|
191
|
+
readonly storeDir?: string;
|
|
192
|
+
/**
|
|
193
|
+
* Use this exact on-disk path for the keypair file instead of deriving one
|
|
194
|
+
* from `id` (and `storeDir`). Takes precedence over `storeDir`; the parent
|
|
195
|
+
* directory is created if missing.
|
|
196
|
+
*/
|
|
197
|
+
readonly file?: string;
|
|
198
|
+
}
|
|
199
|
+
interface PersistedIdentity {
|
|
200
|
+
readonly principal: PrincipalId;
|
|
201
|
+
readonly keypair: Keypair;
|
|
202
|
+
/** Long-lived X25519 keypair used for HPKE wrap/unwrap. */
|
|
203
|
+
readonly wrapKeypair: X25519Keypair;
|
|
204
|
+
/** Absolute path of the on-disk file. */
|
|
205
|
+
readonly file: string;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Load the Ed25519 + X25519 keypairs for `id` from disk, or
|
|
209
|
+
* generate-and-persist them on first call. The slot is keyed by SHA-256 of
|
|
210
|
+
* `id` so callers can pass any stable string (e.g. `import.meta.filename`)
|
|
211
|
+
* without worrying about filesystem-safe characters.
|
|
212
|
+
*
|
|
213
|
+
* Identity files written before wrapping support carried only the Ed25519
|
|
214
|
+
* keypair; on load they are transparently migrated — the Ed25519 keypair
|
|
215
|
+
* (and therefore the `nodeId`) is preserved and a fresh X25519 wrap keypair
|
|
216
|
+
* is generated and written back.
|
|
217
|
+
*
|
|
218
|
+
* NOTE: keys are stored unencrypted. Only suitable for local development
|
|
219
|
+
* identities — not for anything that must resist file-system attackers.
|
|
220
|
+
*/
|
|
221
|
+
declare function loadOrCreateIdentity(opts: LoadOrCreateIdentityOptions): Promise<PersistedIdentity>;
|
|
222
|
+
//#endregion
|
|
223
|
+
//#region src/node/hubReconnect.d.ts
|
|
224
|
+
interface ServeOverHubIdentityOptions {
|
|
225
|
+
/**
|
|
226
|
+
* Stable slot id for the on-disk keypair. Typically the caller's
|
|
227
|
+
* `import.meta.filename`. Same id always loads the same keypair, so
|
|
228
|
+
* persistent capabilities keep working across runs.
|
|
229
|
+
*/
|
|
230
|
+
readonly slot: string;
|
|
231
|
+
/**
|
|
232
|
+
* Override the on-disk identity / capability store directory (defaults
|
|
233
|
+
* to a per-user folder, see `loadOrCreateIdentity`).
|
|
234
|
+
*/
|
|
235
|
+
readonly storeDir?: string;
|
|
236
|
+
/**
|
|
237
|
+
* Override the form-3 method the helper uses to request a register
|
|
238
|
+
* capability when the hub rejects an unsigned / un-capped register.
|
|
239
|
+
* Defaults to
|
|
240
|
+
* `hub-admin::hub-admin.capabilities::issueRegisterCap`. Setting this
|
|
241
|
+
* to `null` disables the fallback (the helper just propagates the
|
|
242
|
+
* `permissionRequired` error).
|
|
243
|
+
*/
|
|
244
|
+
readonly issuerMethod?: string | null;
|
|
245
|
+
/**
|
|
246
|
+
* Optional human-friendly purpose string passed to the issuer service.
|
|
247
|
+
* Surfaced in the user-facing approval prompt.
|
|
248
|
+
*/
|
|
249
|
+
readonly purpose?: string;
|
|
250
|
+
}
|
|
251
|
+
interface ServeOverHubOptions {
|
|
252
|
+
/** Service prefix to register with the hub. */
|
|
253
|
+
readonly prefix: string;
|
|
254
|
+
/**
|
|
255
|
+
* Wires handlers onto the connection (registers interfaces, enables
|
|
256
|
+
* reflection, etc). Called once per successful connection attempt,
|
|
257
|
+
* after the prefix has been registered. Must not retain references to
|
|
258
|
+
* the connection across calls — a fresh connection is passed every
|
|
259
|
+
* reconnect.
|
|
260
|
+
*/
|
|
261
|
+
readonly setup: (connection: LinkRpcConnection<undefined, SigningCallCtx>) => void | Promise<void>;
|
|
262
|
+
/**
|
|
263
|
+
* Optional human-readable name used in log lines (defaults to `prefix`).
|
|
264
|
+
*/
|
|
265
|
+
readonly name?: string;
|
|
266
|
+
/** When set, prints connect/disconnect/retry lines to this sink. */
|
|
267
|
+
readonly log?: ((line: string) => void) | true;
|
|
268
|
+
/**
|
|
269
|
+
* Initial retry delay in ms (capped doubling on each consecutive
|
|
270
|
+
* failure). Defaults to 200 ms.
|
|
271
|
+
*/
|
|
272
|
+
readonly initialBackoffMs?: number;
|
|
273
|
+
/** Cap on backoff in ms. Defaults to 5000 ms. */
|
|
274
|
+
readonly maxBackoffMs?: number;
|
|
275
|
+
/**
|
|
276
|
+
* Abort the loop. When the signal is aborted, the current handle is
|
|
277
|
+
* closed and the loop exits. The returned promise resolves once the
|
|
278
|
+
* loop has finished.
|
|
279
|
+
*/
|
|
280
|
+
readonly signal?: AbortSignal;
|
|
281
|
+
/**
|
|
282
|
+
* When set, registration is performed against a secure-mode hub: the
|
|
283
|
+
* caller's `$hubrpc`-signed `hubServiceIdRegistry::registerServiceId` carries a
|
|
284
|
+
* presented capability. The first attempt loads any cached cap from
|
|
285
|
+
* disk; on `permissionRequired` the helper calls the hub-admin issuer
|
|
286
|
+
* service to obtain a fresh cap, persists it, and retries. Subsequent
|
|
287
|
+
* reconnects reuse the cached cap. Omit to use the legacy unsigned
|
|
288
|
+
* path (only works against an openMode hub).
|
|
289
|
+
*/
|
|
290
|
+
readonly identity?: ServeOverHubIdentityOptions;
|
|
291
|
+
}
|
|
292
|
+
interface ServeOverHubController {
|
|
293
|
+
/** Stops the loop and closes the current handle, if any. */
|
|
294
|
+
stop(): void;
|
|
295
|
+
/**
|
|
296
|
+
* Resolves when the loop exits (signal aborted or `stop()` called).
|
|
297
|
+
* Rejects only on programmer errors thrown by `setup`.
|
|
298
|
+
*/
|
|
299
|
+
readonly done: Promise<void>;
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Connect to the hub, register `prefix`, run `setup`, and keep the
|
|
303
|
+
* connection alive across hub restarts. When the socket closes, retries
|
|
304
|
+
* with exponential backoff (re-reading `LINKRPC_ENDPOINT` / `LINKRPC_TOKEN`
|
|
305
|
+
* from `process.env` on each attempt so rotated tokens published by the
|
|
306
|
+
* hub host get picked up if the parent shell re-exports them).
|
|
307
|
+
*
|
|
308
|
+
* The hub keeps recently-rotated tokens accepted for a grace window, so
|
|
309
|
+
* even processes that captured the env at spawn time can usually reconnect
|
|
310
|
+
* after a host reload without the parent re-exporting anything.
|
|
311
|
+
*/
|
|
312
|
+
declare function serveOverHubWithReconnect(options: ServeOverHubOptions): ServeOverHubController;
|
|
313
|
+
interface HubPrefixClaimerOptions {
|
|
314
|
+
/** Service prefix to register with the hub. */
|
|
315
|
+
readonly prefix: string;
|
|
316
|
+
/** Identity + capability-issuance options (see {@link ServeOverHubIdentityOptions}). */
|
|
317
|
+
readonly identity: ServeOverHubIdentityOptions;
|
|
318
|
+
/** When set, prints register/capability lines to this sink. */
|
|
319
|
+
readonly log?: (line: string) => void;
|
|
320
|
+
}
|
|
321
|
+
interface HubPrefixClaimer {
|
|
322
|
+
/**
|
|
323
|
+
* Register the configured prefix on `handle`'s hub, performing the
|
|
324
|
+
* `$hubrpc`-signed register plus capability dance: presents the cached
|
|
325
|
+
* cap, and on `permissionRequired` mints a fresh one via the hub-admin
|
|
326
|
+
* issuer, persists it, and retries. Call once per (re)connect, before
|
|
327
|
+
* serving handlers. The loaded identity and cap are cached across calls.
|
|
328
|
+
*/
|
|
329
|
+
claim(handle: HubClientHandle): Promise<void>;
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* Build a reusable, stateful claimer for the signed register + capability
|
|
333
|
+
* flow. Use this with {@link connectService}'s `reconnecting` connector to
|
|
334
|
+
* claim a prefix on each (re)connect:
|
|
335
|
+
*
|
|
336
|
+
* ```ts
|
|
337
|
+
* const claimer = createHubPrefixClaimer({ prefix, identity: { slot } });
|
|
338
|
+
* connectService({
|
|
339
|
+
* connector: reconnecting(async () => {
|
|
340
|
+
* const handle = await connectToHub();
|
|
341
|
+
* try { await claimer.claim(handle); } catch (e) { handle.close(); throw e; }
|
|
342
|
+
* return handle;
|
|
343
|
+
* }),
|
|
344
|
+
* onConnect: ({ connection }) => registerService(connection),
|
|
345
|
+
* });
|
|
346
|
+
* ```
|
|
347
|
+
*/
|
|
348
|
+
declare function createHubPrefixClaimer(opts: HubPrefixClaimerOptions): HubPrefixClaimer;
|
|
349
|
+
//#endregion
|
|
350
|
+
//#region src/node/fileManagedIdentityStorage.d.ts
|
|
351
|
+
/**
|
|
352
|
+
* A {@link ManagedIdentityStorage} backed by a single JSON file (one object
|
|
353
|
+
* keyed by the storage keys). Suitable for self-managed identities that
|
|
354
|
+
* persist their capability bag locally — e.g. pass it to `CapBag.load`.
|
|
355
|
+
*
|
|
356
|
+
* The file is created (mode 0o600) on first write; reads of a missing file
|
|
357
|
+
* yield an empty store. Not concurrency-safe across processes.
|
|
358
|
+
*/
|
|
359
|
+
declare function fileManagedIdentityStorage(file: string): ManagedIdentityStorage;
|
|
360
|
+
//#endregion
|
|
361
|
+
//#region src/node/principal.d.ts
|
|
362
|
+
/**
|
|
363
|
+
* Self-managed principal: a local Ed25519 + X25519 keypair (created/loaded on
|
|
364
|
+
* disk) signs and wraps/unwraps for outbound calls, and granted caps are
|
|
365
|
+
* cached in a sibling file. Purely local — no transport needed — and
|
|
366
|
+
* cheap/idempotent, so it can be re-derived on each reconnect. Used with
|
|
367
|
+
* `--use-non-managed-identity`.
|
|
368
|
+
*/
|
|
369
|
+
declare function createSelfManagedPrincipal(identityKey: string): Promise<Principal>;
|
|
370
|
+
/**
|
|
371
|
+
* Self-managed principal whose keypair lives at an explicit file path (rather
|
|
372
|
+
* than a slot derived from an id). Caps are cached in a sibling `.caps.json`.
|
|
373
|
+
* Used by callers that want to pin the identity to a specific file, e.g. the
|
|
374
|
+
* CLI's `--principal file:<path>`.
|
|
375
|
+
*/
|
|
376
|
+
declare function createSelfManagedPrincipalFromFile(file: string): Promise<Principal>;
|
|
377
|
+
//#endregion
|
|
378
|
+
//#region src/node/headerDelimitedTransport.d.ts
|
|
379
|
+
interface HeaderDelimitedTransportOptions {
|
|
380
|
+
readonly maxHeaderBytes?: number;
|
|
381
|
+
readonly maxContentLength?: number;
|
|
382
|
+
readonly maxPendingMessages?: number;
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* LSP "base protocol" framing over a Node Readable/Writable pair.
|
|
386
|
+
*
|
|
387
|
+
* The streams remain owned by the caller: close/dispose detach listeners but
|
|
388
|
+
* never end, destroy, or otherwise take ownership of either stream.
|
|
389
|
+
*/
|
|
390
|
+
declare class HeaderDelimitedTransport implements IMessageTransport {
|
|
391
|
+
private readonly _input;
|
|
392
|
+
private readonly _output;
|
|
393
|
+
private readonly _onClose?;
|
|
394
|
+
private _listener;
|
|
395
|
+
private readonly _pending;
|
|
396
|
+
private _residual;
|
|
397
|
+
private _expectedLength;
|
|
398
|
+
private _closed;
|
|
399
|
+
private _closeReason;
|
|
400
|
+
private readonly _maxHeaderBytes;
|
|
401
|
+
private readonly _maxContentLength;
|
|
402
|
+
private readonly _maxPendingMessages;
|
|
403
|
+
private readonly _onDataListener;
|
|
404
|
+
private readonly _onEndListener;
|
|
405
|
+
private readonly _onInputErrorListener;
|
|
406
|
+
private readonly _onOutputErrorListener;
|
|
407
|
+
constructor(_input: NodeJS.ReadableStream, _output: NodeJS.WritableStream, _onClose?: ((reason?: string) => void) | undefined, options?: HeaderDelimitedTransportOptions);
|
|
408
|
+
get closed(): boolean;
|
|
409
|
+
get closeReason(): string | undefined;
|
|
410
|
+
send(message: JsonRpcMessage): Promise<void>;
|
|
411
|
+
setListener(listener: ((message: JsonRpcMessage) => void) | undefined): void;
|
|
412
|
+
dispose(): void;
|
|
413
|
+
close(reason?: string): void;
|
|
414
|
+
private _onData;
|
|
415
|
+
private _onEnd;
|
|
416
|
+
private _deliver;
|
|
417
|
+
}
|
|
418
|
+
//#endregion
|
|
419
|
+
//#region src/node/initialize.d.ts
|
|
420
|
+
/**
|
|
421
|
+
* Reserved transport-handshake method. Sent as the very first message on a
|
|
422
|
+
* connection that authenticates and/or negotiates transport details. It is
|
|
423
|
+
* handled entirely by the transport layer (via {@link connectNdjson}) and is
|
|
424
|
+
* never forwarded to the hub or any service — it is not a routed call.
|
|
425
|
+
*/
|
|
426
|
+
declare const INITIALIZE_METHOD = "hubrpc::initialize";
|
|
427
|
+
/** Transitional alias accepted by servers created during the LinkRPC wire-name migration. */
|
|
428
|
+
declare const LINKRPC_INITIALIZE_METHOD_ALIAS = "linkrpc::initialize";
|
|
429
|
+
/** Current transport protocol version. */
|
|
430
|
+
declare const INITIALIZE_PROTOCOL_VERSION = 1;
|
|
431
|
+
interface InitializeParams {
|
|
432
|
+
readonly protocolVersion: number;
|
|
433
|
+
/** Shared-secret auth token, when the transport requires one. */
|
|
434
|
+
readonly token?: string;
|
|
435
|
+
}
|
|
436
|
+
interface InitializeResult {
|
|
437
|
+
readonly protocolVersion: number;
|
|
438
|
+
}
|
|
439
|
+
/**
|
|
440
|
+
* The handshake role for a connection:
|
|
441
|
+
* - `client`: send `hubrpc::initialize` and await the reply (the dialing side).
|
|
442
|
+
* - `server`: require `hubrpc::initialize` as the first message, validate the
|
|
443
|
+
* token, and reply (the accepting side).
|
|
444
|
+
*/
|
|
445
|
+
type InitializeRole = {
|
|
446
|
+
readonly kind: 'client';
|
|
447
|
+
readonly token?: string;
|
|
448
|
+
} | {
|
|
449
|
+
readonly kind: 'server';
|
|
450
|
+
readonly isTokenAccepted: (token: string | undefined) => Promise<boolean>;
|
|
451
|
+
};
|
|
452
|
+
interface ConnectNdjsonOptions {
|
|
453
|
+
readonly input: NodeJS.ReadableStream;
|
|
454
|
+
readonly output: NodeJS.WritableStream;
|
|
455
|
+
readonly onClose?: () => void;
|
|
456
|
+
/**
|
|
457
|
+
* Run a `hubrpc::initialize` handshake before the transport goes live. Omit
|
|
458
|
+
* for trusted links that need neither auth nor negotiation (e.g. stdio).
|
|
459
|
+
*/
|
|
460
|
+
readonly initialize?: InitializeRole;
|
|
461
|
+
/** Observe all messages, including the initialize handshake. */
|
|
462
|
+
readonly trace?: MessageTransportTrace;
|
|
463
|
+
/** Override the handshake timeout (ms). */
|
|
464
|
+
readonly handshakeTimeoutMs?: number;
|
|
465
|
+
}
|
|
466
|
+
interface ConnectedNdjson {
|
|
467
|
+
/**
|
|
468
|
+
* The connected transport, already past the handshake. Callers never see
|
|
469
|
+
* the pre-handshake transport, so the "initialize is the first message"
|
|
470
|
+
* invariant holds structurally and the wire setup stays free to evolve.
|
|
471
|
+
*/
|
|
472
|
+
readonly transport: IMessageTransport;
|
|
473
|
+
/** The token presented by the peer (server role); `undefined` otherwise. */
|
|
474
|
+
readonly token?: string;
|
|
475
|
+
}
|
|
476
|
+
/**
|
|
477
|
+
* The single supported way to build an ndjson transport. Constructs the
|
|
478
|
+
* transport over `input`/`output` and, when {@link ConnectNdjsonOptions.initialize}
|
|
479
|
+
* is set, runs the `hubrpc::initialize` handshake internally before resolving.
|
|
480
|
+
*
|
|
481
|
+
* Rejects (after disposing the transport) when the handshake fails — a bad or
|
|
482
|
+
* missing token, a wrong/absent first message, or a timeout. The accepting side
|
|
483
|
+
* should treat a rejection as "drop this connection".
|
|
484
|
+
*/
|
|
485
|
+
declare function connectNdjson(opts: ConnectNdjsonOptions): Promise<ConnectedNdjson>;
|
|
486
|
+
interface RunInitializeHandshakeOptions {
|
|
487
|
+
/** Override the handshake timeout (ms). */
|
|
488
|
+
readonly handshakeTimeoutMs?: number;
|
|
489
|
+
}
|
|
490
|
+
/**
|
|
491
|
+
* Run the `hubrpc::initialize` handshake on an already-constructed transport.
|
|
492
|
+
* Used for transports that the caller builds itself (e.g. WebSocket), where
|
|
493
|
+
* {@link connectNdjson} does not apply. On failure it throws but does NOT
|
|
494
|
+
* dispose the transport — the caller owns it and decides how to tear down.
|
|
495
|
+
*
|
|
496
|
+
* For ndjson links, prefer {@link connectNdjson}, which constructs the
|
|
497
|
+
* transport and runs this handshake atomically.
|
|
498
|
+
*/
|
|
499
|
+
declare function runInitializeHandshake(transport: IMessageTransport, role: InitializeRole, options?: RunInitializeHandshakeOptions): Promise<{
|
|
500
|
+
readonly token?: string;
|
|
501
|
+
}>;
|
|
502
|
+
//#endregion
|
|
503
|
+
//#region src/node/webSocketClientTransport.d.ts
|
|
504
|
+
/**
|
|
505
|
+
* Client-side WebSocket transport: one JSON-RPC message per text frame.
|
|
506
|
+
* Mirror of the hub's server-side `WebSocketTransport`, kept here so the
|
|
507
|
+
* core node entry can reach a `ws://` / `wss://` hub without depending on
|
|
508
|
+
* `@hediet/linkrpc-hub`.
|
|
509
|
+
*
|
|
510
|
+
* Uses the platform-global `WebSocket` (Node 22+, browsers), so no `ws`
|
|
511
|
+
* package dependency is required on the client side.
|
|
512
|
+
*
|
|
513
|
+
* Takes ownership of the socket: {@link dispose} closes it, and a peer
|
|
514
|
+
* close / error fires `onClose` exactly once.
|
|
515
|
+
*/
|
|
516
|
+
declare class WebSocketTransport implements IMessageTransport<JsonRpcMessage, JsonRpcMessage> {
|
|
517
|
+
private readonly _ws;
|
|
518
|
+
private readonly _onClose?;
|
|
519
|
+
private _listener;
|
|
520
|
+
private readonly _buffer;
|
|
521
|
+
private _closed;
|
|
522
|
+
constructor(_ws: WebSocket, _onClose?: (() => void) | undefined);
|
|
523
|
+
send(message: JsonRpcMessage): void;
|
|
524
|
+
setListener(listener: ((m: JsonRpcMessage) => void) | undefined): void;
|
|
525
|
+
dispose(): void;
|
|
526
|
+
private _deliver;
|
|
527
|
+
}
|
|
528
|
+
/** Options for {@link openWebSocket}. */
|
|
529
|
+
interface OpenWebSocketOptions {
|
|
530
|
+
/** Extra request headers to send on the upgrade. */
|
|
531
|
+
readonly headers?: Record<string, string>;
|
|
532
|
+
}
|
|
533
|
+
/**
|
|
534
|
+
* Open a WebSocket to `url` and resolve once it is connected. Rejects if the
|
|
535
|
+
* socket errors before open.
|
|
536
|
+
*
|
|
537
|
+
* Authentication is NOT done here: the hub's WebSocket server authenticates
|
|
538
|
+
* over the in-band `hubrpc::initialize` handshake (so browsers, which cannot
|
|
539
|
+
* set request headers on the `WebSocket` constructor, work too). Run
|
|
540
|
+
* {@link runInitializeHandshake} on the resulting {@link WebSocketTransport}.
|
|
541
|
+
*
|
|
542
|
+
* Headers ride on the upgrade request via the non-standard `headers` option
|
|
543
|
+
* supported by Node's global `WebSocket` (undici); browsers ignore it.
|
|
544
|
+
*/
|
|
545
|
+
declare function openWebSocket(url: string, opts?: OpenWebSocketOptions): Promise<WebSocket>;
|
|
546
|
+
//#endregion
|
|
547
|
+
export { Ability, type AcceptedRootIssuer, ArraySchema, BareGetOptions, type BareInterfaceTarget, Base64Sha256, BooleanSchema, Call, CallBind, CallMeta, CallTarget, type CancellableRequest, CapBag, CapBagOptions, type CapProvider, type CapProviderResult, Capability, Channel, ChannelConnector, type ChannelTransport, type CmdEnvEndpoint, type CmdStdioEndpoint, Components, type ConnectNdjsonOptions, type ConnectToHubOptions, type ConnectableChannel, type ConnectedNdjson, ConstSchema, DEFAULT_RPC_TIMEOUT_MS, DiscriminatorSchema, EXTENSION_PREFIX, type EndpointCommand, EnumSchema, ErrorCode, ErrorSchema, type ExpBackoffOptions, type FormatEndpointOptions, GenerateInterfaceOptions, GetOptions, HUBRPC_META_KEY, HUBRPC_SIGNATURE_KEY, HUBRPC_UNSIGNED_KEY, HeaderDelimitedTransport, type HeaderDelimitedTransportOptions, type HubChannel, type HubClientHandle, type HubPrefixClaimer, type HubPrefixClaimerOptions, IMessageTransport, INITIALIZE_METHOD, INITIALIZE_PROTOCOL_VERSION, type IRequestHandler, type IRequestSender, Identity, InMemoryManagedIdentity, InMemoryManagedIdentityStorage, type IncomingCall, type IncomingStream, type InitializeParams, type InitializeResult, type InitializeRole, InspectionRegistration, IntegerSchema, InterfaceClient, InterfaceDefinition, InterfaceDefinitionOpts, InterfaceHandlers, InterfaceInfo, InterfaceMemberRef, InterfaceMemberRefMap, InterfaceRegistration, type IssueCapabilityOptions, JsonObject, JsonRpcChannel, JsonRpcError, JsonRpcMessage, JsonRpcNotification, JsonRpcRequest, JsonRpcResponse, JsonRpcSuccess, JsonValue, KEY_ID_PREFIX, type KeepConnectedHandle, KeyId, Keypair, KeypairIdentity, KeypairSigningIdentity, LINKRPC_ENDPOINT_VAR, LINKRPC_INITIALIZE_METHOD_ALIAS, LINKRPC_META_KEY, LINKRPC_SIGNATURE_KEY, LINKRPC_TOKEN_VAR, LINKRPC_UNSIGNED_KEY, LinkRpcConnection, LinkRpcConnectionOptions, LinkRpcInterfaceSchema, LinkRpcJsonRpcMessage, LinkRpcJsonRpcNotification, LinkRpcJsonRpcRequest, LinkRpcJsonSchema, LinkRpcUnsigned, LinkRpcWireMeta, LinkRpcWireParams, type LoadOrCreateIdentityOptions, ManagedIdentity, ManagedIdentityStorage, ManagedIdentityStorageBackend, type ManagedSigningChannel, MaterializedJsonSchema, MemberAnnotations, MemberDocs, MemberMap, MemberType, MessageTransportDirection, MessageTransportTrace, MessageTransportWithContext, MessageWithContext, type MessageWithCtx, MethodSchema, MultiplexedTransport, MuxEnvelope, NodeInfo, NotificationType, NullSchema, NumberSchema, ObjectSchema, type OnChannelConnect, OneOfSchema, OneShotCapStaging, type OpenHubChannelOptions, type OpenWebSocketOptions, PRINCIPAL_PREFIX, ParamMatcher, type ParamMatcherFor, type ParamMatchers, ParsedMethodName, ParticipantDescriptor, ParticipantDescriptorSource, Pattern, Permission, type PermitResult, type PersistedIdentity, Principal, PrincipalId, PrincipalWithStore, PrivateKey, PublicKey, PublicSigningIdentity, PublicWrappingIdentity, type RawStreamingCall, RefSchema, type RegisterHubPrefixOptions, RegisterOptions, RequestId, RequestType, ResolveSigningKeyArgs, type ResolvedEndpoint, type Result, RootPrincipalReq, RootPrincipalSet, RouteClaim, RpcError, type RunInitializeHandshakeOptions, STREAM_METHOD, Schema, SchemaBase, SchemaToZodContext, SeededPrincipalOptions, type SendOpts, SerializedKeypairSigningIdentity, type ServeOverHubController, type ServeOverHubIdentityOptions, type ServeOverHubOptions, ServiceHandle, ServiceIdPattern, SignDomain, SignParamsOptions, SignRpcCallOptions, Signature, SignatureEnvelope, Signatures, SignedCapability, SignedRpcCall, type SigningCallCtx, SigningIdentity, SigningSender, type SigningSenderConfig, type SocketEndpoint, type StdioChannel, StreamApi, StreamCallOptions, StreamControlReason, StreamControlType, StreamDir, type StreamSendOpts, StreamSendParams, StreamingCall, StringSchema, TargetPattern, TopologyGraph, TopologyIdGenerator, TopologyLink, TopologyLinkEndpoint, TopologyNode, TopologyPort, TopologyTransportEndpoint, TopologyTransportInfo, TrafficEvent, TrafficOverflowEvent, TrafficTransitEndpoint, TrafficTransitEvent, TrafficWatchResult, TransportPair, TupleSchema, UnionSchema, VerifyCallOptions, VerifyResult, VerifyRpcCallOptions, VerifyRpcCallResult, WebSocketTransport, WrappingIdentity, type WsEndpoint, type WsNoInitEndpoint, X25519Keypair, ZodToSvcJsonSchemaOptions, assertSchemaReferences, attachCapabilities, bareInterfaceTarget, base64UrlToBytes, bytesToBase64Url, capBagFreshAt, capabilityFreshAt, capabilityPermits, componentSchemaName, componentSchemaRef, computeInterfaceHash, connectNdjson, connectToCmdStdio, connectToHub, connectTransports, createHubPrefixClaimer, createManagedIdentity, createManagedPrincipal, createMemoryPrincipal, createSchemaToZod, createSeededMemoryPrincipal, createSeededSigningIdentity, createSelfManagedPrincipal, createSelfManagedPrincipalFromFile, crypto_d_exports as crypto, defaultsInterface, defineInterface, directoryInterface, directoryWatchNever, fileManagedIdentityStorage, formatEndpointUri, generateTsInterface, getKeyId, hasSignedCapabilityShape, identityInterface, identityStorageInterface, interfaceFromSchema, invoke, isAssignable, isHubEndpoint, isNotification, isRequest, isResponse, issueCapability, jcsCanonicalize, jcsCanonicalizeBytes, keyIdForPrincipal, keyIdForPublicKey, loadOrCreateIdentity, matchParams, materializeJsonSchema, methodNameToTarget, nodeInterface, normalizeJsonSchema, notificationType, openHubChannel, openStdioChannel, openWebSocket, parseEndpointUri, parseMethodName, permissionMatchesTarget, permissionPermits, permits, prefix, principalForPublicKey, publicKeyForKeyId, readSignature, registerHubPrefix, registerIdentityOnOverlay, registerLazyIdentityOnOverlay, requestType, requireObjectParams, resolveSigningKey, runInitializeHandshake, schemaToZod, schemasInterface, serveOnStdio, serveOverHubWithReconnect, signCapability, signParams, signRpcCall, signedHash, signingDomainValue, signingInput, streamInterface, stripLinkRpcWireMeta, topologyInterface, traceMessageTransport, trafficInterface, verifyCall, verifyRpcCall, withRpcTimeout, withSignature, zParticipantDescriptor, zParticipantDescriptorSource, zRouteClaim, zServiceIdPattern, zTopologyGraph, zTopologyLink, zTopologyLinkEndpoint, zTopologyNode, zTopologyPort, zTopologyTransportEndpoint, zTopologyTransportInfo, zTrafficEvent, zTrafficOverflowEvent, zTrafficTransitEndpoint, zTrafficTransitEvent, zTrafficWatchResult, zodToSvcJsonSchema };
|
|
548
|
+
//# sourceMappingURL=node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.d.ts","names":[],"sources":["../src/node/stdio.ts","../src/node/hubClient.ts","../src/node/hubReconnect.ts","../src/node/fileManagedIdentityStorage.ts","../src/node/principal.ts","../src/node/headerDelimitedTransport.ts","../src/node/initialize.ts","../src/node/webSocketClientTransport.ts"],"mappings":";;;;;;;;;;;;;;;;;;iBAkBsB,kBAAkB,kCAAkC,QAAQ;;;;;;iBAyB5D,gBAAgB,QAAQ;;;;;;;;KAYlC,eAAe;;EAEvB,QAAQ,uBAAuB;;iBAGb,oBAAoB,QAAQ;;;;cCzBrC;;cAEA;UAEI;;WAEJ;;WAEA;;;;;;;WAOA,YAAY;;;;;WAKZ,cAAc;;;;;;;;KASf;EACR,YAAY;EACZ,cAAc;EACd,cAAc;;UAGD;;WAEJ,YAAY,6BAA6B;;;;;;;;WAQzC,KAAK;;WAEL;WACA;;;;;;WAMA,SAAS;;;;;;EAMlB,QAAQ,uBAAuB;;EAE/B;;;;;;;;;;;;iBAakB,aAAa,UAAS,sBAA2B,QAAQ;;UAuB9D;;WAEJ;;;;;;WAMA;;;;;;;;;;;KAYD,aAAa;WACZ;WACA;;;;;EAKT,QAAQ,uBAAuB;;EAE/B;;;;;;;iBAQkB,eAClB,UAAS,wBACV,QAAQ;;;;;;;;;;;UAwGM;WACJ,QAAQ;WACR;;;;;;;;WAQA;aAAsB,WAAW;aAAsB,SAAS;;;;;;;;WAOhE,wBAAwB;;iBAGf,kBAClB,MAAM,2BACP;UA6Bc;;;;;;WAMJ;;WAEA;;;;;;WAMA;;UAGI;WACJ,WAAW;WACX,SAAS;;WAET,aAAa;;WAEb;;;;;;;;;;;;;;;;iBAiBS,qBAClB,MAAM,8BACP,QAAQ;;;UCjWM;;;;;;WAMJ;;;;;WAMA;;;;;;;;;WASA;;;;;WAKA;;UAGI;;WAEJ;;;;;;;;WAQA,QAAQ,YAAY,6BAA6B,2BAA2B;;;;WAI5E;;WAEA,QAAQ;;;;;WAKR;;WAEA;;;;;;WAMA,SAAS;;;;;;;;;;WAUT,WAAW;;UAGP;;EAEb;;;;;WAKS,MAAM;;;;;;;;;;;;;iBAcH,0BACZ,SAAS,sBACV;UA8Dc;;WAEJ;;WAEA,UAAU;;WAEV,OAAO;;UAGH;;;;;;;;EAQb,MAAM,QAAQ,kBAAkB;;;;;;;;;;;;;;;;;;;iBAoBpB,uBAAuB,MAAM,0BAA0B;;;;;;;;;;;iBCrMvD,2BAA2B,eAAe;;;;;;;;;;iBCCpC,2BAA2B,sBAAsB,QAAQ;;;;;;;iBAUzD,mCAAmC,eAAe,QAAQ;;;UCf/D;WACJ;WACA;WACA;;;;;;;;cASA,oCAAoC;mBAmBxB;mBACA;mBACA;UApBb;mBACS;UACT;UACA;UACA;UACA;mBACS;mBACA;mBACA;mBAEA;mBACA;mBACA;mBAEA;EAII,YAAA,QAAQ,OAAO,gBACf,SAAS,OAAO,gBAChB,aAAY,uCAC7B,UAAS;MAkBF;MAIA;EAIJ,KAAK,SAAS,iBAAiB;EAsB/B,YAAY,YAAY,SAAS;EAOjC;EAIA,MAAM;UAYL;UAmDA;UAOA;;;;;;;;;;cC5JC;;cAEA;;cAGA;UAQI;WACJ;;WAEA;;UAGI;WACJ;;;;;;;;KASD;WACK;WAAyB;;WAEzB;WACA,kBAAkB,8BAA8B;;UAGhD;WACJ,OAAO,OAAO;WACd,QAAQ,OAAO;WACf;;;;;WAKA,aAAa;;WAEb,QAAQ;;WAER;;UAGI;;;;;;WAMJ,WAAW;;WAEX;;;;;;;;;;;iBAYS,cAAc,MAAM,uBAAuB,QAAQ;UAuCxD;;WAEJ;;;;;;;;;;;iBAYS,uBAClB,WAAW,mBACX,MAAM,gBACN,UAAS,gCACV;WAAmB;;;;;;;;;;;;;;;;cChIT,8BAA8B,kBAAkB,gBAAgB;mBAMpD;mBACA;UANb;mBACS;UACT;EAGa,YAAA,KAAK,WACL;EAiCd,KAAK,SAAS;EAMd,YAAY,YAAY,GAAG;EAU3B;UASC;;;UAOK;;WAEJ,UAAU;;;;;;;;;;;;;;iBAeP,cACZ,aACA,OAAM,uBACP,QAAQ"}
|