@hediet/linkrpc-cli 0.0.3-next.20261022.1 → 0.0.3-next.20261022.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
@@ -800,27 +800,30 @@ process's stdin/stdout (`--stdio`) or a `--target-endpoint*`. It keeps full
800
800
  LinkRPC semantics (service ids, streaming, cancellation) and adds what the
801
801
  participant cannot do itself:
802
802
 
803
- - `--outbound signed` (default) re-signs every call the participant emits as
804
- the CLI's `--principal` and negotiates capabilities, so a participant without
805
- signing support can call services behind `forwardChecking`.
806
- `--outbound verbatim` forwards calls unsigned (keeping any `$hubrpc` envelope
807
- the participant attached); `--outbound none` drops them.
803
+ - Calls the participant emits are forwarded to the hub unsigned by default,
804
+ keeping any `$hubrpc` envelope the participant attached. `--sign` (explicitly
805
+ on the `proxy` command line; the Hub profile's signing default does not
806
+ apply) re-signs them as `--principal`, by default the managed Hub identity,
807
+ and negotiates capabilities, so a participant without signing support can
808
+ call services behind `forwardChecking`. This lends the participant that
809
+ identity. `--no-outbound` drops its calls instead.
808
810
  - `--claim <serviceId>` claims the service id and forwards requests the hub
809
811
  routes to it to the participant, verbatim (callers' signatures are kept).
810
812
 
811
813
  ```sh
812
814
  # A Rust client that cannot sign yet reaches a gated remote service.
813
815
  # Point it at this cmd-stdio endpoint and address calls to the remote service id:
814
- # cmd-stdio:?argv=linkrpc&argv=hub&argv=proxy&argv=--stdio
815
- hub proxy --stdio
816
+ # cmd-stdio:?argv=linkrpc&argv=hub&argv=proxy&argv=--stdio&argv=--sign
817
+ hub proxy --stdio --sign
818
+ hub proxy --stdio --sign --principal user:automation
816
819
 
817
820
  # Serve a stdio program under a service id (equivalent to `tunnel`).
818
- hub proxy --claim my/service --outbound none --target-endpoint-cmd-stdio "my-server --stdio"
821
+ hub proxy --claim my/service --no-outbound --target-endpoint-cmd-stdio "my-server --stdio"
819
822
  ```
820
823
 
821
824
  With `--stdio`, the proxy exits when stdin closes. `tunnel <serviceId>` is
822
- `proxy --claim <serviceId>` with `--bidi` selecting `--outbound verbatim`
823
- instead of `none`.
825
+ `proxy --claim <serviceId> --no-outbound`; with `--bidi` it forwards the
826
+ target's calls unsigned.
824
827
 
825
828
  ### Capabilities
826
829
 
@@ -8967,19 +8967,20 @@ Batch options:
8967
8967
  local.close();
8968
8968
  }
8969
8969
  });
8970
- addTargetEndpointOptions(program.command("proxy").description("Stand in for a participant on the hub (--endpoint*). The participant is this process's stdin/stdout (--stdio) or a target endpoint (--target-endpoint*). Calls the participant emits are forwarded to the hub per --outbound: `signed` (default) re-signs them as this CLI's --principal with capability negotiation, so participants that cannot sign can call gated services; `verbatim` forwards them unsigned; `none` drops them. With --claim, requests the hub routes to <serviceId> are forwarded to the participant. Runs until the participant disconnects or Ctrl-C.")).option("--stdio", "use this process's stdin/stdout as the participant").option("--claim <serviceId>", "claim <serviceId> on the hub and forward its requests to the participant").addOption(new Option("--outbound <mode>", "how participant calls reach the hub").choices([
8971
- "signed",
8972
- "verbatim",
8973
- "none"
8974
- ]).default("signed")).action(async (cmdOpts) => {
8970
+ addTargetEndpointOptions(program.command("proxy").description("Stand in for a participant on the hub (--endpoint*). The participant is this process's stdin/stdout (--stdio) or a target endpoint (--target-endpoint*). Calls the participant emits are forwarded to the hub unsigned, keeping any signature the participant attached. Pass --sign explicitly to re-sign them as --principal (default: the managed Hub identity) with capability negotiation, so participants that cannot sign can call gated services; --no-outbound drops them instead. With --claim, requests the hub routes to <serviceId> are forwarded to the participant. Runs until the participant disconnects or Ctrl-C.")).option("--stdio", "use this process's stdin/stdout as the participant").option("--claim <serviceId>", "claim <serviceId> on the hub and forward its requests to the participant").option("--no-outbound", "do not forward calls the participant emits to the hub").action(async (cmdOpts) => {
8975
8971
  const localEp = needEndpoint(endpoint);
8976
8972
  if (cmdOpts.stdio === hasTargetEndpoint(cmdOpts)) {
8977
8973
  process.stderr.write("linkrpc: proxy requires exactly one of --stdio or --target-endpoint*.\n");
8978
8974
  process.exit(2);
8979
8975
  }
8976
+ const signOutbound = g_invocation?.cliOverrides.sign === true;
8977
+ if (signOutbound && !cmdOpts.outbound) {
8978
+ process.stderr.write("linkrpc: proxy --sign has no effect with --no-outbound.\n");
8979
+ process.exit(2);
8980
+ }
8980
8981
  const targetEp = cmdOpts.stdio ? void 0 : resolveTargetEndpointOrExit(cmdOpts, program.opts(), "proxy");
8981
8982
  const hub = await connect(localEp, wireLog("hub"));
8982
- reportIdentity(await setupSigning(hub.channel, hub.signing, getPrincipalSpec(), { negotiateHubCaps: isHubEndpoint(localEp) }));
8983
+ if (resolveSigning(g_invocation?.profile ?? "hub", g_invocation?.values ?? {})) reportIdentity(await setupSigning(hub.channel, hub.signing, getPrincipalSpec(), { negotiateHubCaps: isHubEndpoint(localEp) }));
8983
8984
  const participant = targetEp === void 0 ? await connectStdioParticipant() : {
8984
8985
  connection: await connectTargetEndpoint(targetEp, cmdOpts.claim ?? ""),
8985
8986
  closed: void 0
@@ -8988,7 +8989,7 @@ Batch options:
8988
8989
  await proxyCommand({
8989
8990
  hub,
8990
8991
  participant: participant.connection,
8991
- outbound: cmdOpts.outbound,
8992
+ outbound: !cmdOpts.outbound ? "none" : signOutbound ? "signed" : "verbatim",
8992
8993
  ...cmdOpts.claim !== void 0 ? { claimServiceId: cmdOpts.claim } : {},
8993
8994
  ...participant.closed !== void 0 ? { stop: participant.closed } : {}
8994
8995
  });
@@ -9118,7 +9119,7 @@ Batch options:
9118
9119
  process.once("SIGINT", onSignal);
9119
9120
  process.once("SIGTERM", onSignal);
9120
9121
  try {
9121
- const { runApprovalUi } = await import("./runApprovalUi-DpoUwBpd.js");
9122
+ const { runApprovalUi } = await import("./runApprovalUi-CkT1KK-X.js");
9122
9123
  await runApprovalUi({
9123
9124
  client,
9124
9125
  signal: stop.signal
@@ -9133,7 +9134,7 @@ Batch options:
9133
9134
  registerViewCommands(program, (action) => withChannel(endpoint, getPrincipalSpec(), action));
9134
9135
  program.command("ui").description("Launch the terminal UI (form-based browser of services + methods).").action(async () => {
9135
9136
  const acquired = await acquireConnection(endpoint);
9136
- const { runUi } = await import("./runUi-BbiA5lOP.js");
9137
+ const { runUi } = await import("./runUi-mpVqJ6QU.js");
9137
9138
  try {
9138
9139
  await runUi({
9139
9140
  endpoint: acquired.ep,
@@ -9669,4 +9670,4 @@ function safeJson(value) {
9669
9670
  //#endregion
9670
9671
  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 };
9671
9672
 
9672
- //# sourceMappingURL=cli-Cw9kg0Dt.js.map
9673
+ //# sourceMappingURL=cli-C0AV_fi4.js.map