@hediet/linkrpc-cli 0.0.3-next.20261116.1 → 0.0.3-next.20261116.2

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 CHANGED
@@ -1107,7 +1107,9 @@ participant cannot do itself:
1107
1107
  is rejected here to keep this choice explicit.
1108
1108
  - `--claim <serviceId>` registers the service id (that registration is signed
1109
1109
  as `--principal`) and forwards requests the hub routes to it to the
1110
- participant unchanged, keeping callers' signatures.
1110
+ participant unchanged, keeping callers' signatures. Repeat it to route
1111
+ several service ids to the same participant, e.g. the outbound routes of a
1112
+ nested hub whose uplink is this proxy.
1111
1113
 
1112
1114
  ```sh
1113
1115
  # A Rust client that cannot sign yet reaches a gated remote service.
@@ -1,4 +1,4 @@
1
- import { B as proxyCommand, Ct as mergeParams, F as disconnectBroker, G as parseConnectionLimit, H as claimServiceId, I as getBrokerStatus, K as parseConnectionLimitMilliseconds, L as readBrokerNotifications, M as readEndpointDiscovery, N as ContextStore, P as formatContextReference, R as stopConnectionBroker, Tt as MethodRefWithOptHash, U as resolveServiceIdToClaim, V as tunnelCommand, W as withStaticHubReflection, Y as resolveCliInvocation, _t as resolvedEndpointToConfig, a as resolveInvocationEndpoint, at as findMethodInSchema, bt as explainValidation, c as resolveLocalEndpoint, ct as cliIdentityTarget, dt as formatPrincipalSource, et as requestReflectionAccess, ft as parsePrincipalSpec, gt as resolveTargetEndpoint, ht as connectViaTransport, i as resolveInvocationContext, it as fetchSchema$1, lt as deleteCliIdentity, m as managedEndpointsInterface, mt as connectViaRootOverlay, n as loadStaticHubSchema, nt as setupSigning, o as resolveSigning, ot as walkHub, pt as connect, q as parseDuration, r as resolveStaticHubSchemaSource, rt as fetchDefaults, s as validationDefault, t as completeForLine, tt as requestTopologyAccess, ut as readCliIdentity, vt as describeObjectParams, wt as parseParamOverride, xt as validateValueAgainstSchema, y as HubHome, yt as describeSchema, z as ConnectionBroker } from "./runComplete-D9FsRgZ1.js";
1
+ import { B as proxyCommand, Ct as mergeParams, F as disconnectBroker, G as parseConnectionLimit, H as claimServiceId, I as getBrokerStatus, K as parseConnectionLimitMilliseconds, L as readBrokerNotifications, M as readEndpointDiscovery, N as ContextStore, P as formatContextReference, R as stopConnectionBroker, Tt as MethodRefWithOptHash, U as resolveServiceIdToClaim, V as tunnelCommand, W as withStaticHubReflection, Y as resolveCliInvocation, _t as resolvedEndpointToConfig, a as resolveInvocationEndpoint, at as findMethodInSchema, bt as explainValidation, c as resolveLocalEndpoint, ct as cliIdentityTarget, dt as formatPrincipalSource, et as requestReflectionAccess, ft as parsePrincipalSpec, gt as resolveTargetEndpoint, ht as connectViaTransport, i as resolveInvocationContext, it as fetchSchema$1, lt as deleteCliIdentity, m as managedEndpointsInterface, mt as connectViaRootOverlay, n as loadStaticHubSchema, nt as setupSigning, o as resolveSigning, ot as walkHub, pt as connect, q as parseDuration, r as resolveStaticHubSchemaSource, rt as fetchDefaults, s as validationDefault, t as completeForLine, tt as requestTopologyAccess, ut as readCliIdentity, vt as describeObjectParams, wt as parseParamOverride, xt as validateValueAgainstSchema, y as HubHome, yt as describeSchema, z as ConnectionBroker } from "./runComplete-CyiTsEXO.js";
2
2
  import { HubMcpAggregator, McpToolHost, hostMcpServer, mcpExposeConfigSchema, mcpServerConfigSchema, serveMcpForwardInstance, streamInstanceTransport } from "@hediet/linkrpc-mcp/hub";
3
3
  import { ErrorCode, INTERFACE_TEMPLATES_EXTENSION, LinkRpcConnection, RpcError, computeInterfaceHash, connectTransports, createSchemaToZod, directoryInterface, exportStaticHubSchema, generateTsContract, generateTsInterface, interfaceTemplateArgumentsEquivalent, interfaceTemplateMemberName, interfaceTemplatesEqual, isAssignable, jcsCanonicalize, matchParams, schemaToZod, validateInterfaceTemplates } from "@hediet/linkrpc";
4
4
  import { WebSocketTransport, connectNdjson, connectToHub, formatEndpointUri, isHubEndpoint, openWebSocket, parseEndpointUri, runInitializeHandshake, traceMessageTransport as traceMessageTransport$1 } from "@hediet/linkrpc/node";
@@ -412,7 +412,7 @@ function contextNamespace(reference) {
412
412
  async function useLocalManagement(start, action) {
413
413
  const home = HubHome.resolve();
414
414
  if (start) {
415
- const { startDaemon, nodeDaemonLaunch } = await import("./src-B7DEaKGS.js");
415
+ const { startDaemon, nodeDaemonLaunch } = await import("./src-D1ncNfTU.js");
416
416
  if (await startDaemon({
417
417
  home,
418
418
  launch: nodeDaemonLaunch(home)
@@ -432,7 +432,7 @@ async function useLocalManagement(start, action) {
432
432
  }
433
433
  }
434
434
  async function restartLocalDaemon() {
435
- const { startDaemon, stopDaemon, nodeDaemonLaunch } = await import("./src-B7DEaKGS.js");
435
+ const { startDaemon, stopDaemon, nodeDaemonLaunch } = await import("./src-D1ncNfTU.js");
436
436
  const home = HubHome.resolve();
437
437
  process.stderr.write("Restarting the local Hub daemon: clients will disconnect and managed workloads will stop. OS autostart settings are unchanged.\n");
438
438
  await stopDaemon(home);
@@ -9470,7 +9470,7 @@ Batch options:
9470
9470
  local.close();
9471
9471
  }
9472
9472
  });
9473
- addTargetEndpointOptions(program.command("proxy").description("Connect a participant to the hub (--endpoint*) through this process. The participant is this process's stdin/stdout (--stdio) or a target endpoint (--target-endpoint*). By default the proxy does not sign anything: calls the participant makes are forwarded to the hub as they are (unsigned, or with the signature the participant attached). --sign-as re-signs them with an identity of this machine, --no-outbound drops them, and --claim makes the hub route a service id to the participant. Runs until the participant disconnects or Ctrl-C.")).option("--stdio", "use this process's stdin/stdout as the participant").option("--sign-as [principal]", "sign every call the participant makes as <principal> (\"managed\", \"user:<id>\" or \"file:<path>\"; default: --principal, i.e. the managed Hub identity falling back to user:hubrpc-cli) and request capabilities for those calls, prompting for approval when needed. This lends the participant that identity; use it for participants that cannot sign but must call services behind forwardChecking").option("--claim <serviceId>", "register <serviceId> on the hub (this registration is signed as --principal) and forward requests for it to the participant unchanged, keeping callers' signatures").option("--no-outbound", "drop calls the participant makes instead of forwarding them to the hub").action(async (cmdOpts) => {
9473
+ addTargetEndpointOptions(program.command("proxy").description("Connect a participant to the hub (--endpoint*) through this process. The participant is this process's stdin/stdout (--stdio) or a target endpoint (--target-endpoint*). By default the proxy does not sign anything: calls the participant makes are forwarded to the hub as they are (unsigned, or with the signature the participant attached). --sign-as re-signs them with an identity of this machine, --no-outbound drops them, and --claim makes the hub route a service id to the participant. Runs until the participant disconnects or Ctrl-C.")).option("--stdio", "use this process's stdin/stdout as the participant").option("--sign-as [principal]", "sign every call the participant makes as <principal> (\"managed\", \"user:<id>\" or \"file:<path>\"; default: --principal, i.e. the managed Hub identity falling back to user:hubrpc-cli) and request capabilities for those calls, prompting for approval when needed. This lends the participant that identity; use it for participants that cannot sign but must call services behind forwardChecking").option("--claim <serviceId>", "register <serviceId> on the hub (this registration is signed as --principal) and forward requests for it to the participant unchanged, keeping callers' signatures (repeatable)", collectOption).option("--no-outbound", "drop calls the participant makes instead of forwarding them to the hub").action(async (cmdOpts) => {
9474
9474
  const localEp = needEndpoint(endpoint);
9475
9475
  if (cmdOpts.stdio === hasTargetEndpoint(cmdOpts)) {
9476
9476
  process.stderr.write("linkrpc: proxy requires exactly one of --stdio or --target-endpoint*.\n");
@@ -9490,7 +9490,7 @@ Batch options:
9490
9490
  const principal = typeof cmdOpts.signAs === "string" ? parsePrincipalSpec(cmdOpts.signAs) : getPrincipalSpec();
9491
9491
  reportIdentity(await setupSigning(hub.channel, hub.signing, principal, { negotiateHubCaps: isHubEndpoint(localEp) }));
9492
9492
  }
9493
- const participant = targetEp === void 0 ? await connectStdioParticipant() : await connectTargetEndpoint(targetEp, cmdOpts.claim ?? "").then((connection) => ({
9493
+ const participant = targetEp === void 0 ? await connectStdioParticipant() : await connectTargetEndpoint(targetEp, cmdOpts.claim?.[0] ?? "").then((connection) => ({
9494
9494
  connection,
9495
9495
  closed: connection.closed
9496
9496
  }));
@@ -9499,7 +9499,7 @@ Batch options:
9499
9499
  hub,
9500
9500
  participant: participant.connection,
9501
9501
  outbound: !cmdOpts.outbound ? "none" : cmdOpts.signAs !== void 0 ? "signed" : "verbatim",
9502
- ...cmdOpts.claim !== void 0 ? { claimServiceId: cmdOpts.claim } : {},
9502
+ ...cmdOpts.claim !== void 0 ? { claimServiceIds: cmdOpts.claim } : {},
9503
9503
  ...participant.closed !== void 0 ? { stop: participant.closed } : {}
9504
9504
  });
9505
9505
  } finally {
@@ -9630,7 +9630,7 @@ Batch options:
9630
9630
  process.once("SIGINT", onSignal);
9631
9631
  process.once("SIGTERM", onSignal);
9632
9632
  try {
9633
- const { runApprovalUi } = await import("./runApprovalUi-BLZTrXDW.js");
9633
+ const { runApprovalUi } = await import("./runApprovalUi-C2b67p27.js");
9634
9634
  await runApprovalUi({
9635
9635
  client,
9636
9636
  signal: stop.signal
@@ -9645,7 +9645,7 @@ Batch options:
9645
9645
  registerViewCommands(program, (action) => withChannel(endpoint, getPrincipalSpec(), action));
9646
9646
  program.command("ui").description("Launch the terminal UI (form-based browser of services + methods).").action(async () => {
9647
9647
  const acquired = await acquireConnection(endpoint);
9648
- const { runUi } = await import("./runUi-BusCK0Ka.js");
9648
+ const { runUi } = await import("./runUi-4K_zeLsr.js");
9649
9649
  try {
9650
9650
  await runUi({
9651
9651
  endpoint: acquired.ep,
@@ -10225,4 +10225,4 @@ function definedEnv(env) {
10225
10225
  //#endregion
10226
10226
  export { formatCondition as _, formatCommandLegend as a, targetId as b, safeTerminalText as c, ObservablePromise as d, observableValue as f, resolveViewTarget as g, Disposable as h, dispatchHostKey as i, approvalDetailLines as l, derived as m, views as n, hostCommands as o, autorun as p, ViewFrame as r, matchesKey as s, runCli as t, ObservableLazyPromise as u, interfaceTarget as v, matchesTarget as y };
10227
10227
 
10228
- //# sourceMappingURL=cli-DlRKUZEu.js.map
10228
+ //# sourceMappingURL=cli-GjdPZAgY.js.map