@camstack/system 1.2.139 → 1.2.141

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.
Files changed (64) hide show
  1. package/dist/addon-runner.js +1 -1
  2. package/dist/addon-runner.mjs +1 -1
  3. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  4. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  5. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  6. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  7. package/dist/builtins/alerts/alerts.addon.js +1 -1
  8. package/dist/builtins/alerts/alerts.addon.mjs +1 -1
  9. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +1 -1
  10. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +1 -1
  11. package/dist/builtins/console-logging/index.js +1 -1
  12. package/dist/builtins/console-logging/index.mjs +1 -1
  13. package/dist/builtins/core-blocks/core-blocks.addon.js +1 -1
  14. package/dist/builtins/core-blocks/core-blocks.addon.mjs +1 -1
  15. package/dist/builtins/device-manager/device-linked-devices.d.ts +4 -2
  16. package/dist/builtins/device-manager/device-manager.addon.js +210 -21
  17. package/dist/builtins/device-manager/device-manager.addon.mjs +210 -21
  18. package/dist/builtins/device-manager/device-meta-actions.d.ts +27 -0
  19. package/dist/builtins/device-manager/device-row-store.d.ts +21 -3
  20. package/dist/builtins/device-manager/fleet-read-census.d.ts +20 -1
  21. package/dist/builtins/doorbell/virtual-doorbell.addon.js +1 -1
  22. package/dist/builtins/doorbell/virtual-doorbell.addon.mjs +1 -1
  23. package/dist/builtins/hub-forwarder/index.js +1 -1
  24. package/dist/builtins/hub-forwarder/index.mjs +1 -1
  25. package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  26. package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  27. package/dist/builtins/local-auth/local-auth.addon.js +1 -1
  28. package/dist/builtins/local-auth/local-auth.addon.mjs +1 -1
  29. package/dist/builtins/local-network/local-network.addon.js +1 -1
  30. package/dist/builtins/local-network/local-network.addon.mjs +1 -1
  31. package/dist/builtins/loki-logging/index.js +1 -1
  32. package/dist/builtins/loki-logging/index.mjs +1 -1
  33. package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  34. package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  35. package/dist/builtins/platform-probe/index.js +1 -1
  36. package/dist/builtins/platform-probe/index.mjs +1 -1
  37. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  38. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  39. package/dist/builtins/snapshot/index.js +1 -1
  40. package/dist/builtins/snapshot/index.mjs +1 -1
  41. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  42. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  43. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +0 -0
  44. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +0 -0
  45. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  46. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  47. package/dist/builtins/system-config/system-config.addon.js +1 -1
  48. package/dist/builtins/system-config/system-config.addon.mjs +1 -1
  49. package/dist/builtins/winston-logging/index.js +1 -1
  50. package/dist/builtins/winston-logging/index.mjs +1 -1
  51. package/dist/{dist-D595vzqY.mjs → dist-6mn3LQvB.mjs} +2521 -2333
  52. package/dist/{dist-MqjCyx1E.js → dist-BNhvXrQk.js} +2521 -2333
  53. package/dist/index.js +28 -17
  54. package/dist/index.mjs +29 -17
  55. package/dist/kernel/cap-router-builder.d.ts +13 -0
  56. package/dist/kernel/index.d.ts +1 -1
  57. package/dist/kernel/moleculer/trpc-links.d.ts +1 -12
  58. package/dist/kernel/transport/cap-route-resolver.d.ts +35 -1
  59. package/dist/kernel/transport/child-cap-protocol.d.ts +14 -0
  60. package/dist/{manifest-python-deps-08rqn6xN.mjs → manifest-python-deps-D3zYlMEa.mjs} +49 -47
  61. package/dist/{manifest-python-deps-C9x9vrqt.js → manifest-python-deps-DBQarwp9.js} +48 -52
  62. package/dist/{retired-settings-keys-IVq6xR9i.js → retired-settings-keys-DVgdWTd7.js} +1 -1
  63. package/dist/{retired-settings-keys-BvxgnDT1.mjs → retired-settings-keys-SYwVv_Ym.mjs} +1 -1
  64. package/package.json +1 -1
@@ -4739,6 +4739,24 @@ function extractNodeId(args) {
4739
4739
  const raw = Reflect.get(args, "nodeId");
4740
4740
  return typeof raw === "string" && raw.length > 0 ? raw : void 0;
4741
4741
  }
4742
+ /**
4743
+ * Merge `callerAddonId` into `args` as an extra field — the SAME "provider
4744
+ * destructures what it needs and ignores the rest" convention
4745
+ * {@link extractNodeId} already relies on for the inline `nodeId` pin.
4746
+ * `undefined` (the overwhelmingly common case: no caller hint, or the census
4747
+ * consuming it is disarmed) returns `args` unchanged — no allocation. A
4748
+ * non-object `args` (or `null`/array) is returned unchanged too: there is
4749
+ * nowhere to attach an extra key without changing the payload's shape, and a
4750
+ * provider taking a bare value never reads `callerAddonId` off it anyway.
4751
+ */
4752
+ function withCallerAddonId(args, callerAddonId) {
4753
+ if (callerAddonId === void 0) return args;
4754
+ if (args === null || typeof args !== "object" || Array.isArray(args)) return args;
4755
+ return {
4756
+ ...args,
4757
+ callerAddonId
4758
+ };
4759
+ }
4742
4760
  var CapRouteResolver = class {
4743
4761
  hubNodeId;
4744
4762
  broker;
@@ -4796,9 +4814,30 @@ var CapRouteResolver = class {
4796
4814
  childId
4797
4815
  };
4798
4816
  }
4799
- async dispatch(route, method, args) {
4817
+ /**
4818
+ * @param addonId Optional out-of-band PROVIDER-selection hint (Task 7.5a):
4819
+ * the addonId of the provider the CALLER already resolved (e.g.
4820
+ * `buildCapCallFn`'s `deps.addonId` for a registered grouped-runner
4821
+ * provider). Only meaningful for `agent-child-forward` — a `remote-moleculer`
4822
+ * route already encodes the provider in its action name
4823
+ * (`${addonId}.${cap}.${method}`, via `NodeCapAuthority.getAddonId`), and a
4824
+ * `hub-local-uds` caller that already knows the addonId (`buildCapCallFn`)
4825
+ * talks to `LocalChildRegistry.callCapOnChild` directly rather than through
4826
+ * `dispatch`.
4827
+ * @param callerAddonId Optional out-of-band CALLER-identity hint — the
4828
+ * addon that ORIGINATED the call, distinct from `addonId` above (which
4829
+ * names the resolved PROVIDER, not the caller). Set by
4830
+ * `onUnownedCall` from `CapCallInput.callerAddonId`
4831
+ * (`LocalChildRegistry` stamped it off the registered `childId`). Only
4832
+ * the `hub-in-process` branch consumes it — merged into `args` so a
4833
+ * diagnostic tool deep in that provider (e.g. device-manager's
4834
+ * fleet-read census) can read it without every provider method changing
4835
+ * signature, the same "extra field the provider destructures or
4836
+ * ignores" convention `nodeId` already uses on this path.
4837
+ */
4838
+ async dispatch(route, method, args, addonId, callerAddonId) {
4800
4839
  try {
4801
- return await this.dispatchInner(route, method, args);
4840
+ return await this.dispatchInner(route, method, args, addonId, callerAddonId);
4802
4841
  } catch (err) {
4803
4842
  if (err instanceof CapRouteError) throw err;
4804
4843
  const nodeId = this.routeNodeId(route);
@@ -4817,9 +4856,9 @@ var CapRouteResolver = class {
4817
4856
  * Inner dispatch: may throw CapRouteError (validation failures) or arbitrary
4818
4857
  * transport errors. The outer `dispatch` wraps non-CapRouteErrors.
4819
4858
  */
4820
- async dispatchInner(route, method, args) {
4859
+ async dispatchInner(route, method, args, addonId, callerAddonId) {
4821
4860
  switch (route.kind) {
4822
- case "hub-in-process": return route.ref.invoke(method, args);
4861
+ case "hub-in-process": return route.ref.invoke(method, withCallerAddonId(args, callerAddonId));
4823
4862
  case "hub-local-uds": {
4824
4863
  const registry = this.hubLocalRegistry;
4825
4864
  if (registry === null) throw new CapRouteError(route.capName, method, {
@@ -4863,7 +4902,8 @@ var CapRouteResolver = class {
4863
4902
  method,
4864
4903
  args,
4865
4904
  ...route.childId !== void 0 ? { childId: route.childId } : {},
4866
- ...deviceId !== void 0 ? { deviceId } : {}
4905
+ ...deviceId !== void 0 ? { deviceId } : {},
4906
+ ...addonId !== void 0 ? { addonId } : {}
4867
4907
  };
4868
4908
  return callWithServiceDiscovery(this.broker, AGENT_CAP_FWD_SERVICE, AGENT_CAP_FWD_ACTION, params, {
4869
4909
  nodeID: route.agentNodeId,
@@ -5360,7 +5400,8 @@ var LocalChildRegistry = class {
5360
5400
  args: out.args,
5361
5401
  ...out.deviceId !== void 0 ? { deviceId: out.deviceId } : {},
5362
5402
  ...out.nodeId !== void 0 ? { nodeId: out.nodeId } : {},
5363
- ...out.native === true ? { native: true } : {}
5403
+ ...out.native === true ? { native: true } : {},
5404
+ ...childId !== null ? { callerAddonId: childId } : {}
5364
5405
  };
5365
5406
  const pinnedNodeId = out.nodeId ?? extractNodeId(out.args);
5366
5407
  const pinTargetsThisNode = pinnedNodeId !== void 0 && this.ownNodeId !== void 0 && pinnedNodeId === this.ownNodeId;
@@ -5969,7 +6010,7 @@ function createParentUnownedCallHandler(deps) {
5969
6010
  ...nodeId !== void 0 ? { nodeId } : {},
5970
6011
  ...deviceId !== void 0 ? { deviceId } : {}
5971
6012
  });
5972
- return await resolver.dispatch(route, input.method, input.args);
6013
+ return input.callerAddonId !== void 0 ? await resolver.dispatch(route, input.method, input.args, void 0, input.callerAddonId) : await resolver.dispatch(route, input.method, input.args);
5973
6014
  } catch (err) {
5974
6015
  if (!(err instanceof CapRouteError) || err.reason !== "no-provider") throw err;
5975
6016
  }
@@ -6448,45 +6489,6 @@ function brokerTransportLink(broker, serviceMap, observerOpts, linkOptions) {
6448
6489
  };
6449
6490
  }
6450
6491
  /**
6451
- * Middle link that routes a cap op to a LOCAL addon-runner over UDS via the
6452
- * `LocalChildRegistry`. If no local child owns `(capName, deviceId?)`, the op
6453
- * passes through to `next(op)` (e.g. `brokerTransportLink` for remote agents),
6454
- * so this link is transparent for everything it does not own.
6455
- *
6456
- * `deviceId` for device-scoped caps is read from `op.input` (the same place
6457
- * the codegen'd device-scoped routers carry it); the full `op.input` is
6458
- * forwarded as the child method's argument.
6459
- */
6460
- function ipcChildLink(registry) {
6461
- return () => {
6462
- return ({ op, next }) => {
6463
- const parsed = parsePath(op.path);
6464
- if (!parsed) return next(op);
6465
- const input = op.input;
6466
- const inputObj = input && typeof input === "object" && !Array.isArray(input) ? input : null;
6467
- const deviceId = inputObj && typeof inputObj.deviceId === "number" ? inputObj.deviceId : void 0;
6468
- if (registry.resolveChildId(parsed.capName, deviceId) === null) return next(op);
6469
- return observable((observer) => {
6470
- registry.callCap({
6471
- capName: parsed.capName,
6472
- method: parsed.method,
6473
- args: op.input,
6474
- deviceId
6475
- }).then((data) => {
6476
- observer.next({ result: {
6477
- type: "data",
6478
- data
6479
- } });
6480
- observer.complete();
6481
- }).catch((cause) => {
6482
- observer.error(_trpc_client.TRPCClientError.from(cause instanceof Error ? cause : new Error(String(cause))));
6483
- });
6484
- return () => {};
6485
- });
6486
- };
6487
- };
6488
- }
6489
- /**
6490
6492
  * Middle link that routes a child addon's outbound `ctx.api` cap call to the
6491
6493
  * parent hub over UDS via `callOut` (obtained at call-time so the child can
6492
6494
  * reconnect without rebuilding its tRPC client).
@@ -8581,12 +8583,6 @@ Object.defineProperty(exports, "installManifestPythonDeps", {
8581
8583
  return installManifestPythonDeps;
8582
8584
  }
8583
8585
  });
8584
- Object.defineProperty(exports, "ipcChildLink", {
8585
- enumerable: true,
8586
- get: function() {
8587
- return ipcChildLink;
8588
- }
8589
- });
8590
8586
  Object.defineProperty(exports, "ipcParentLink", {
8591
8587
  enumerable: true,
8592
8588
  get: function() {
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-MqjCyx1E.js");
1
+ const require_dist = require("./dist-BNhvXrQk.js");
2
2
  //#region src/builtins/sqlite-storage/retired-settings-keys.ts
3
3
  /**
4
4
  * Is THIS node the one whose settings store is the cluster's authority?
@@ -1,4 +1,4 @@
1
- import { At as asJsonObject } from "./dist-D595vzqY.mjs";
1
+ import { At as asJsonObject } from "./dist-6mn3LQvB.mjs";
2
2
  //#region src/builtins/sqlite-storage/retired-settings-keys.ts
3
3
  /**
4
4
  * Is THIS node the one whose settings store is the cluster's authority?
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/system",
3
- "version": "1.2.139",
3
+ "version": "1.2.141",
4
4
  "description": "Core addon for CamStack — builtins, pipeline, process management, auth, logging, events",
5
5
  "keywords": [
6
6
  "camstack",