@camstack/server 1.2.823 → 1.2.825

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 (104) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/api/trpc/generated-cap-routers.js +0 -45
  3. package/package.json +10 -10
  4. package/system/dist/addon-runner.js +24 -2
  5. package/system/dist/addon-runner.mjs +25 -3
  6. package/system/dist/addon-utils.d.ts +1 -0
  7. package/system/dist/addon-utils.js +2 -0
  8. package/system/dist/addon-utils.mjs +3 -2
  9. package/system/dist/{agent-https-Df53Fvk1.js → agent-https-B2nqARmj.js} +1 -1
  10. package/system/dist/{agent-https-CDl7mB_F.mjs → agent-https-BBO2OtNH.mjs} +1 -1
  11. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  12. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +4 -4
  13. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  14. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +5 -5
  15. package/system/dist/builtins/alerts/alerts.addon.js +1 -1
  16. package/system/dist/builtins/alerts/alerts.addon.mjs +3 -3
  17. package/system/dist/builtins/autotrack/index.js +1 -1
  18. package/system/dist/builtins/autotrack/index.mjs +1 -1
  19. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
  20. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +5 -5
  21. package/system/dist/builtins/calendars/calendars.addon.js +1 -1
  22. package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
  23. package/system/dist/builtins/camera-grid/index.js +1 -1
  24. package/system/dist/builtins/camera-grid/index.mjs +1 -1
  25. package/system/dist/builtins/composer/composer.addon.js +4 -4
  26. package/system/dist/builtins/composer/composer.addon.mjs +4 -4
  27. package/system/dist/builtins/console-logging/index.js +1 -1
  28. package/system/dist/builtins/console-logging/index.mjs +1 -1
  29. package/system/dist/builtins/core-blocks/actions-service.d.ts +8 -0
  30. package/system/dist/builtins/core-blocks/core-blocks.addon.js +78 -22
  31. package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +79 -23
  32. package/system/dist/builtins/core-blocks/record-kinds.d.ts +1 -0
  33. package/system/dist/builtins/device-history/device-history.addon.js +2 -2
  34. package/system/dist/builtins/device-history/device-history.addon.mjs +2 -2
  35. package/system/dist/builtins/device-manager/device-manager.addon.js +8 -3
  36. package/system/dist/builtins/device-manager/device-manager.addon.mjs +8 -3
  37. package/system/dist/builtins/hub-forwarder/index.js +1 -1
  38. package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
  39. package/system/dist/builtins/keychain/index.js +4 -4
  40. package/system/dist/builtins/keychain/index.mjs +4 -4
  41. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  42. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  43. package/system/dist/builtins/local-auth/local-auth.addon.js +2 -2
  44. package/system/dist/builtins/local-auth/local-auth.addon.mjs +5 -5
  45. package/system/dist/builtins/local-network/local-network.addon.js +2 -2
  46. package/system/dist/builtins/local-network/local-network.addon.mjs +2 -2
  47. package/system/dist/builtins/loki-logging/index.js +1 -1
  48. package/system/dist/builtins/loki-logging/index.mjs +1 -1
  49. package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  50. package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +10 -10
  51. package/system/dist/builtins/platform-probe/index.js +1 -1
  52. package/system/dist/builtins/platform-probe/index.mjs +10 -10
  53. package/system/dist/builtins/record-entries/index.js +1 -1
  54. package/system/dist/builtins/record-entries/index.mjs +1 -1
  55. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  56. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  57. package/system/dist/builtins/snapshot/index.js +1 -1
  58. package/system/dist/builtins/snapshot/index.mjs +1 -1
  59. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  60. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +20 -20
  61. package/system/dist/builtins/sqlite-storage/index.js +1 -1
  62. package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
  63. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +3 -3
  64. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +3 -3
  65. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  66. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  67. package/system/dist/builtins/system-config/system-config.addon.js +3 -3
  68. package/system/dist/builtins/system-config/system-config.addon.mjs +115 -115
  69. package/system/dist/builtins/winston-logging/index.js +1 -1
  70. package/system/dist/builtins/winston-logging/index.mjs +1 -1
  71. package/system/dist/cap-call-scope-8eiugfLl.js +46 -0
  72. package/system/dist/cap-call-scope-Bic6Ekfw.mjs +30 -0
  73. package/system/dist/{capture-engine-D_GQBgrZ.mjs → capture-engine-C-rHYVFq.mjs} +1 -1
  74. package/system/dist/{capture-engine-C0Z5rwCO.js → capture-engine-DP4HbT3W.js} +1 -1
  75. package/system/dist/{composition-sources-mx-2yCDv.mjs → composition-sources-CL9JFN4y.mjs} +1 -1
  76. package/system/dist/{composition-sources-DIZx3mW3.js → composition-sources-CM9c_jAj.js} +1 -1
  77. package/system/dist/{constants-BQlx9HDp.mjs → constants-DzGFnCKZ.mjs} +1 -1
  78. package/system/dist/{constants-CAOcKiWT.js → constants-jk7JccZ0.js} +1 -1
  79. package/system/dist/{coral-accelerators-BW3OcrLD.mjs → coral-accelerators-DBlgWB8k.mjs} +6 -6
  80. package/system/dist/{custom-action-registry-N7flBDwT.mjs → custom-action-registry-B9zFBNVa.mjs} +37 -37
  81. package/system/dist/{device-ca-93LsCF_Q.js → device-ca-B7_R5WJh.js} +1 -1
  82. package/system/dist/{device-ca-CK6GTnNh.mjs → device-ca-DZ_OQiCc.mjs} +1 -1
  83. package/system/dist/{dist-BQiyo22b.mjs → dist-BgRMQHuL.mjs} +97 -160
  84. package/system/dist/{dist-izXDzt4g.js → dist-BpTL3uNe.js} +108 -159
  85. package/system/dist/file-host-worker.js +1 -1
  86. package/system/dist/file-host-worker.mjs +1 -1
  87. package/system/dist/{hub-mdns-ciao-srpOrqIP.mjs → hub-mdns-ciao-DIcBingB.mjs} +2 -2
  88. package/system/dist/{hub-mdns-ciao-Dt_tgvol.js → hub-mdns-ciao-DPUaYAD3.js} +2 -2
  89. package/system/dist/index.d.ts +1 -0
  90. package/system/dist/index.js +47 -29
  91. package/system/dist/index.mjs +257 -242
  92. package/system/dist/kernel/cap-call-scope.d.ts +10 -0
  93. package/system/dist/kernel/transport/cap-route-resolver.d.ts +27 -1
  94. package/system/dist/kernel/transport/child-cap-protocol.d.ts +1 -1
  95. package/system/dist/kernel/transport/parent-unowned-call.d.ts +0 -11
  96. package/system/dist/{legacy-integration-rows-door-wu2GWY6U.mjs → legacy-integration-rows-door-1GnkpMgH.mjs} +1 -1
  97. package/system/dist/{legacy-integration-rows-door-BH43eDu6.js → legacy-integration-rows-door-DYNePgj4.js} +1 -1
  98. package/system/dist/{rename-composition-block-CH6ZoSJA.mjs → rename-composition-block-Cp0_nwAI.mjs} +1 -1
  99. package/system/dist/{rename-composition-block-6oLQVzft.js → rename-composition-block-Dn2z4fnA.js} +1 -1
  100. package/system/dist/{restore-archive-C4rR2SYV.mjs → restore-archive-B3FEpUfz.mjs} +94 -94
  101. package/system/dist/{restore-archive-DpZ2PbLN.js → restore-archive-BGa5pdp9.js} +1 -1
  102. package/system/dist/{wal-maintenance-CNfp0HHX.mjs → wal-maintenance-BLWLlVfF.mjs} +0 -0
  103. package/system/dist/{wal-maintenance-DAA2qJja.js → wal-maintenance-GWFxnSnE.js} +0 -0
  104. package/system/package.json +1 -1
@@ -0,0 +1,10 @@
1
+ import { type CommandOriginClaim } from "@camstack/types/addon";
2
+ /** The tRPC-shaped context of the cap call on this stack, or `undefined` outside one. */
3
+ export declare function currentCapCallContext(): unknown;
4
+ /** The command origin of the cap call on this stack, if the call carried a well-formed one. */
5
+ export declare function readCurrentCommandOrigin(): CommandOriginClaim | undefined;
6
+ /**
7
+ * Run `fn` as a cap call whose context is `context` (`commandOrigin(claim).context`,
8
+ * or the raw `op.context`). `undefined` is a call that carried no claim.
9
+ */
10
+ export declare function runWithCapCallContext<T>(context: unknown, fn: () => T): T;
@@ -1,3 +1,29 @@
1
+ /**
2
+ * CapRouteResolver — builds a live CapRouteSnapshot from injected deps and
3
+ * dispatches a resolved CapRoute to the appropriate transport.
4
+ *
5
+ * Layer boundary: this file lives in `@camstack/kernel` and MUST NOT import
6
+ * from `server/backend`. All server-side state is injected via narrow named
7
+ * interfaces (NodeCapAuthority, InProcessProviderLookup, BrokerHandle).
8
+ *
9
+ * Wire conventions (kept here as the single source of truth):
10
+ *
11
+ * remote-moleculer dispatch
12
+ * action : `${addonId}.${capName}.${method}`
13
+ * params : methodArgs (passed through)
14
+ * options : { nodeID: route.nodeId, timeout: 60_000 }
15
+ * note : addonId is resolved by NodeCapAuthority.getAddonId(nodeId, cap)
16
+ *
17
+ * agent-child-forward dispatch
18
+ * service : `$agent-cap-fwd`
19
+ * action : `$agent-cap-fwd.forward`
20
+ * params : { capName, method, args, childId, deviceId? }
21
+ * options : { nodeID: route.agentNodeId, timeout: 60_000 }
22
+ * note : Task 6's agent-side service MUST register the Moleculer service
23
+ * `$agent-cap-fwd` with action `forward` that accepts this shape
24
+ * and fans the call over UDS to route.childId.
25
+ */
26
+ import { type CommandOriginClaim } from "@camstack/types/addon";
1
27
  import type { ServiceDiscoveryBroker } from "../moleculer/resilient-cap-call.js";
2
28
  import type { CapRoute, CapRouteOpts, HubLocalUdsRoute, InProcessProviderRef } from "./cap-route.js";
3
29
  import type { CapCallInput } from "./child-cap-protocol.js";
@@ -219,7 +245,7 @@ export declare class CapRouteResolver {
219
245
  * {@link CapCallInput.callerAddonId} so the child can stamp before invoke
220
246
  * (without it, `stampCallerAddonId` strips an args-only claim).
221
247
  */
222
- dispatch(route: CapRoute, method: string, args: unknown, addonId?: string, callerAddonId?: string): Promise<unknown>;
248
+ dispatch(route: CapRoute, method: string, args: unknown, addonId?: string, callerAddonId?: string, origin?: CommandOriginClaim): Promise<unknown>;
223
249
  /**
224
250
  * Inner dispatch: may throw CapRouteError (validation failures) or arbitrary
225
251
  * transport errors. The outer `dispatch` wraps non-CapRouteErrors.
@@ -179,7 +179,7 @@ export interface CapCallMessage {
179
179
  readonly deviceId?: number;
180
180
  /** Optional per-call node pin (out-of-band routing hint; see {@link CapCallOutMessage.nodeId}). */
181
181
  readonly nodeId?: string;
182
- /** Optional command origin claim (see {@link CapCallOutMessage.origin}); child → parent leg only. */
182
+ /** Optional command origin claim (see {@link CapCallOutMessage.origin}). Both legs carry it. */
183
183
  readonly origin?: CommandOriginClaim;
184
184
  /**
185
185
  * Out-of-band PROVIDER-selection hint: the addonId of the provider the hub
@@ -279,15 +279,4 @@ export interface ParentUnownedCallDeps {
279
279
  /** Optional logger for the broker-fallback diagnostic line. */
280
280
  readonly logger?: ParentUnownedCallLogger;
281
281
  }
282
- /**
283
- * Build the `onUnownedCall` handler the hub / agent passes into
284
- * `new LocalChildRegistry({ ..., onUnownedCall })`.
285
- *
286
- * The returned handler:
287
- * - tries the resolver first (when present),
288
- * - falls back to the broker for `no-provider` resolver misses (the
289
- * `$`-infra / core services), and
290
- * - surfaces a clear error when the call is genuinely unroutable (so the
291
- * child's call rejects rather than hanging).
292
- */
293
282
  export declare function createParentUnownedCallHandler(deps: ParentUnownedCallDeps): (input: CapCallInput) => Promise<unknown>;
@@ -1,4 +1,4 @@
1
- import { Qs as collectSecretMarkerRefs } from "./dist-BQiyo22b.mjs";
1
+ import { $s as collectSecretMarkerRefs } from "./dist-BgRMQHuL.mjs";
2
2
  //#region src/builtins/sqlite-storage/migrations/legacy-integration-rows-door.ts
3
3
  /**
4
4
  * Migration-only door for the leftover integration rows (planning#416).
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-izXDzt4g.js");
1
+ const require_dist = require("./dist-BpTL3uNe.js");
2
2
  //#region src/builtins/sqlite-storage/migrations/legacy-integration-rows-door.ts
3
3
  /**
4
4
  * Migration-only door for the leftover integration rows (planning#416).
@@ -1,4 +1,4 @@
1
- import { $c as COMPOSED_DEVICE_STABLE_ID_PREFIX, rl as errMsg } from "./dist-BQiyo22b.mjs";
1
+ import { al as errMsg, tl as COMPOSED_DEVICE_STABLE_ID_PREFIX } from "./dist-BgRMQHuL.mjs";
2
2
  //#region src/builtins/core-blocks/rename-composition-block.ts
3
3
  /**
4
4
  * An operator rename of a composed device writes the composition block's
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-izXDzt4g.js");
1
+ const require_dist = require("./dist-BpTL3uNe.js");
2
2
  //#region src/builtins/core-blocks/rename-composition-block.ts
3
3
  /**
4
4
  * An operator rename of a composed device writes the composition block's