@hediet/linkrpc-cli 0.0.3-next.20261104.1 → 0.0.3-next.20261104.3

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
@@ -1176,6 +1176,12 @@ Schema validation is mandatory for explicit requests: `--no-validate` and
1176
1176
  the permission; signed calls include that hash in their signed metadata.
1177
1177
  The default requested duration is `persistent`; `--cap:duration shortLived` and
1178
1178
  `--cap:duration longLived` are also supported. The Hub still decides what to grant.
1179
+ `call --cap:request --cap:duration once` instead requests a grant bound to the
1180
+ single call it executes (its exact params, nonce, and timestamp), so the approval
1181
+ authorizes that call only and is never stored. It cannot be combined with
1182
+ `caps request`, `--cap:allow-param`, or `--cap:delegate`, and needs a fully
1183
+ qualified `service::interface::method` reference. A durable grant that already
1184
+ covers the call is used without a new request.
1179
1185
  `--cap:delegate` also requests `canDelegate`, so the identity can issue narrower
1180
1186
  capabilities for that scope to other identities, e.g. a service it runs; a
1181
1187
  stored grant without delegation does not satisfy such a request.
@@ -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-OYpyPoaN.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-DegvES4g.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-CsEqIQZy.js");
415
+ const { startDaemon, nodeDaemonLaunch } = await import("./src-BMOjXlN5.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-CsEqIQZy.js");
435
+ const { startDaemon, stopDaemon, nodeDaemonLaunch } = await import("./src-BMOjXlN5.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);
@@ -1485,14 +1485,20 @@ async function callCommand(channel, opts) {
1485
1485
  if (!requestCap && opts.allowParams !== void 0) throw new Error("--cap:allow-param requires --cap:request.");
1486
1486
  if (requestCap && (opts.noValidate || opts.validation === "off")) throw new Error("Capability requests require schema validation; remove --no-validate/--validation off.");
1487
1487
  if (requestCap && opts.signingSession === void 0) throw new Error("Capability requests require a signed LinkRPC connection.");
1488
+ const once = requestCap && opts.duration === "once";
1489
+ if (once && opts.capabilityOnly) throw new Error("A once capability is bound to one call; use `call --cap:request --cap:duration once`.");
1490
+ if (once && (opts.allowParams !== void 0 || opts.delegate === true)) throw new Error("--cap:duration once cannot be combined with --cap:allow-param or --cap:delegate.");
1488
1491
  const onStreamChunk = opts.onStreamChunk ?? writeChunkToStderr;
1489
1492
  try {
1490
1493
  const validation = requestCap ? "required" : opts.noValidate ? "off" : opts.validation ?? "required";
1491
1494
  const schema = validation === "off" ? void 0 : await validateParams(channel, ref, params, "call", validation);
1492
1495
  if (requestCap) {
1493
1496
  if (schema === void 0 || opts.signingSession === void 0) throw new Error("Capability requests require a method schema and signing session.");
1494
- const result = await requestCallCapability(channel, opts.signingSession, ref, params, schema, opts);
1495
- if (opts.capabilityOnly) return result;
1497
+ if (once) opts.signingSession.requestOnceForNextCall(ref.getMethodOnWire());
1498
+ else {
1499
+ const result = await requestCallCapability(channel, opts.signingSession, ref, params, schema, opts);
1500
+ if (opts.capabilityOnly) return result;
1501
+ }
1496
1502
  }
1497
1503
  const result = await channel.sendRequestWithStream(ref.getMethodOnWire(), params, {
1498
1504
  onStreamMessage: onStreamChunk,
@@ -8968,7 +8974,8 @@ async function main(rawArgv, executableName = "linkrpc") {
8968
8974
  });
8969
8975
  });
8970
8976
  const capsRequest = caps?.command("request [methodRef]").description("Request and store a capability without invoking the method.");
8971
- const addCapabilityOptions = (cmd) => cmd.option("--cap:allow-param <kv...>", "top-level key=matcher JSON (exact, enum, prefix, subsetOf, any)").option("--cap:allow-prefix <prefix>", "allow a string prefix for the immediately preceding parameter").option("--cap:allow-any", "allow any JSON value for the immediately preceding parameter").option("--cap:allow-enum <json>", "allow one value from a JSON array for the preceding parameter").option("--cap:allow-subset <json>", "allow an array of items from a JSON string array for the preceding parameter").addOption(new Option("--cap:duration <duration>", "requested grant lifetime").choices([
8977
+ const addCapabilityOptions = (cmd) => cmd.option("--cap:allow-param <kv...>", "top-level key=matcher JSON (exact, enum, prefix, subsetOf, any)").option("--cap:allow-prefix <prefix>", "allow a string prefix for the immediately preceding parameter").option("--cap:allow-any", "allow any JSON value for the immediately preceding parameter").option("--cap:allow-enum <json>", "allow one value from a JSON array for the preceding parameter").option("--cap:allow-subset <json>", "allow an array of items from a JSON string array for the preceding parameter").addOption(new Option("--cap:duration <duration>", "requested grant lifetime; once (call --cap:request only) binds the grant to this single call").choices([
8978
+ "once",
8972
8979
  "shortLived",
8973
8980
  "longLived",
8974
8981
  "persistent"
@@ -9566,7 +9573,7 @@ Batch options:
9566
9573
  process.once("SIGINT", onSignal);
9567
9574
  process.once("SIGTERM", onSignal);
9568
9575
  try {
9569
- const { runApprovalUi } = await import("./runApprovalUi-CbPRNYG1.js");
9576
+ const { runApprovalUi } = await import("./runApprovalUi-DFPbTQBs.js");
9570
9577
  await runApprovalUi({
9571
9578
  client,
9572
9579
  signal: stop.signal
@@ -9581,7 +9588,7 @@ Batch options:
9581
9588
  registerViewCommands(program, (action) => withChannel(endpoint, getPrincipalSpec(), action));
9582
9589
  program.command("ui").description("Launch the terminal UI (form-based browser of services + methods).").action(async () => {
9583
9590
  const acquired = await acquireConnection(endpoint);
9584
- const { runUi } = await import("./runUi-C-bl-iFM.js");
9591
+ const { runUi } = await import("./runUi-CXojz1Yf.js");
9585
9592
  try {
9586
9593
  await runUi({
9587
9594
  endpoint: acquired.ep,
@@ -10161,4 +10168,4 @@ function definedEnv(env) {
10161
10168
  //#endregion
10162
10169
  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 };
10163
10170
 
10164
- //# sourceMappingURL=cli-Blk82JWJ.js.map
10171
+ //# sourceMappingURL=cli-Bpe0_qmw.js.map