@camstack/server 1.1.42 → 1.1.43

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.
@@ -5006,14 +5006,14 @@ function createCapRouter_pipelineExecutor(getProvider, createRemoteProxy) {
5006
5006
  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
5007
5007
  return p.setVideoPipelineSteps(methodInput);
5008
5008
  }),
5009
- resetToDefault: trpc_middleware_js_1.adminProcedure
5010
- .input(types_76.pipelineExecutorCapability.methods.resetToDefault.input.loose())
5011
- .output(types_76.pipelineExecutorCapability.methods.resetToDefault.output)
5009
+ clearDeviceOverrides: trpc_middleware_js_1.adminProcedure
5010
+ .input(types_76.pipelineExecutorCapability.methods.clearDeviceOverrides.input.loose())
5011
+ .output(types_76.pipelineExecutorCapability.methods.clearDeviceOverrides.output)
5012
5012
  .mutation(async ({ input, ctx }) => {
5013
5013
  const { nodeId, ...methodInput } = input;
5014
5014
  const p = resolveProvider('pipeline-executor', nodeId, () => getProvider(ctx), createRemoteProxy);
5015
5015
  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
5016
- return p.resetToDefault(methodInput);
5016
+ return p.clearDeviceOverrides(methodInput);
5017
5017
  }),
5018
5018
  getSchema: trpc_middleware_js_1.protectedProcedure
5019
5019
  .input(zod_1.z.object({ nodeId: zod_1.z.string().optional() }).optional())
@@ -5120,15 +5120,6 @@ function createCapRouter_pipelineExecutor(getProvider, createRemoteProxy) {
5120
5120
  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
5121
5121
  return p.deleteModel(methodInput);
5122
5122
  }),
5123
- detect: trpc_middleware_js_1.protectedProcedure
5124
- .input(types_76.pipelineExecutorCapability.methods.detect.input.loose())
5125
- .output(types_76.pipelineExecutorCapability.methods.detect.output)
5126
- .query(async ({ input, ctx }) => {
5127
- const { nodeId, ...methodInput } = input;
5128
- const p = resolveProvider('pipeline-executor', nodeId, () => getProvider(ctx), createRemoteProxy);
5129
- // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
5130
- return p.detect(methodInput);
5131
- }),
5132
5123
  runPipeline: trpc_middleware_js_1.protectedProcedure
5133
5124
  .input(types_76.pipelineExecutorCapability.methods.runPipeline.input.loose())
5134
5125
  .output(types_76.pipelineExecutorCapability.methods.runPipeline.output)
@@ -5377,30 +5368,6 @@ function createCapRouter_pipelineOrchestrator(getProvider, _createRemoteProxy) {
5377
5368
  const p = requireCapProvider('pipeline-orchestrator', () => getProvider(ctx));
5378
5369
  return p.getIngestOwner();
5379
5370
  }),
5380
- assignDecoder: trpc_middleware_js_1.adminProcedure
5381
- .input(types_77.pipelineOrchestratorCapability.methods.assignDecoder.input.loose())
5382
- .output(types_77.pipelineOrchestratorCapability.methods.assignDecoder.output)
5383
- .mutation(async ({ input, ctx }) => {
5384
- const p = requireCapProvider('pipeline-orchestrator', () => getProvider(ctx));
5385
- // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
5386
- return p.assignDecoder(input);
5387
- }),
5388
- unassignDecoder: trpc_middleware_js_1.adminProcedure
5389
- .input(types_77.pipelineOrchestratorCapability.methods.unassignDecoder.input.loose())
5390
- .output(types_77.pipelineOrchestratorCapability.methods.unassignDecoder.output)
5391
- .mutation(async ({ input, ctx }) => {
5392
- const p = requireCapProvider('pipeline-orchestrator', () => getProvider(ctx));
5393
- // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
5394
- return p.unassignDecoder(input);
5395
- }),
5396
- getDecoderAssignments: trpc_middleware_js_1.protectedProcedure
5397
- .input(zod_1.z.object({ nodeId: zod_1.z.string().optional() }).optional())
5398
- .output(types_77.pipelineOrchestratorCapability.methods.getDecoderAssignments.output)
5399
- .query(async ({ input, ctx }) => {
5400
- void input;
5401
- const p = requireCapProvider('pipeline-orchestrator', () => getProvider(ctx));
5402
- return p.getDecoderAssignments();
5403
- }),
5404
5371
  assignAudio: trpc_middleware_js_1.adminProcedure
5405
5372
  .input(types_77.pipelineOrchestratorCapability.methods.assignAudio.input.loose())
5406
5373
  .output(types_77.pipelineOrchestratorCapability.methods.assignAudio.output)
@@ -5441,14 +5408,6 @@ function createCapRouter_pipelineOrchestrator(getProvider, _createRemoteProxy) {
5441
5408
  const p = requireCapProvider('pipeline-orchestrator', () => getProvider(ctx));
5442
5409
  return p.getAudioAssignments();
5443
5410
  }),
5444
- getDecoderAssignment: trpc_middleware_js_1.protectedProcedure
5445
- .input(types_77.pipelineOrchestratorCapability.methods.getDecoderAssignment.input.loose())
5446
- .output(types_77.pipelineOrchestratorCapability.methods.getDecoderAssignment.output)
5447
- .query(async ({ input, ctx }) => {
5448
- const p = requireCapProvider('pipeline-orchestrator', () => getProvider(ctx));
5449
- // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
5450
- return p.getDecoderAssignment(input);
5451
- }),
5452
5411
  getAgentSettings: trpc_middleware_js_1.protectedProcedure
5453
5412
  .input(types_77.pipelineOrchestratorCapability.methods.getAgentSettings.input.loose())
5454
5413
  .output(types_77.pipelineOrchestratorCapability.methods.getAgentSettings.output)
@@ -5513,6 +5472,14 @@ function createCapRouter_pipelineOrchestrator(getProvider, _createRemoteProxy) {
5513
5472
  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
5514
5473
  return p.setAgentReachableHost(input);
5515
5474
  }),
5475
+ resetNodePipelineDefaults: trpc_middleware_js_1.adminProcedure
5476
+ .input(types_77.pipelineOrchestratorCapability.methods.resetNodePipelineDefaults.input.loose())
5477
+ .output(types_77.pipelineOrchestratorCapability.methods.resetNodePipelineDefaults.output)
5478
+ .mutation(async ({ input, ctx }) => {
5479
+ const p = requireCapProvider('pipeline-orchestrator', () => getProvider(ctx));
5480
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
5481
+ return p.resetNodePipelineDefaults(input);
5482
+ }),
5516
5483
  getCameraSettings: trpc_middleware_js_1.protectedProcedure
5517
5484
  .input(types_77.pipelineOrchestratorCapability.methods.getCameraSettings.input.loose())
5518
5485
  .output(types_77.pipelineOrchestratorCapability.methods.getCameraSettings.output)
@@ -30,6 +30,7 @@ function buildCapCallFn(deps) {
30
30
  method,
31
31
  args: params,
32
32
  ...(deviceId !== undefined ? { deviceId } : {}),
33
+ ...(deps.addonId !== undefined ? { addonId: deps.addonId } : {}),
33
34
  };
34
35
  return registry.callCapOnChild(deps.udsChildId, input);
35
36
  }
@@ -704,6 +704,7 @@ class MoleculerService {
704
704
  // - resolver not yet built (pre-init) → legacy Moleculer call.
705
705
  const callFn = (0, cap_call_fn_js_1.buildCapCallFn)({
706
706
  capName,
707
+ addonId,
707
708
  nodeId,
708
709
  udsChildId,
709
710
  getLocalChildRegistry: () => this.localChildRegistry,
@@ -954,39 +955,44 @@ exports.MoleculerService = MoleculerService;
954
955
  // Module-level helpers
955
956
  // ---------------------------------------------------------------------------
956
957
  /**
957
- * E1: Adapt a child's UDS `ChildCapDescriptor[]` (which has no `addonId`) into
958
- * a `RegisterNodeParams` that `onRegisterNode` / `applyNodeManifest` can consume.
958
+ * E1: Adapt a child's UDS `ChildCapDescriptor[]` into a `RegisterNodeParams`
959
+ * that `onRegisterNode` / `applyNodeManifest` can consume.
959
960
  *
960
- * Strategy: use `childId` as the synthetic `addonId`. For currently-shipped addons
961
- * `childId = runnerId = addonId` (one-addon-one-process, no shared group), so the
962
- * `registryKey = childId` produced here matches what the Moleculer `$hub.registerNode`
963
- * path uses making double-apply via both paths fully idempotent.
961
+ * Multi-addon manifest support (co-location): descriptors are grouped by the
962
+ * `addonId` each one carries, producing ONE `RegisteredAddonManifest` entry
963
+ * per hosted addon. A GROUPED runner (`execution.group`, e.g. `net-access`
964
+ * hosting cloudflare-tunnel + cloudflare-turn + tailscale-*) therefore
965
+ * registers each addon's caps under its REAL addon id — real provider
966
+ * registryKeys, per-addon settings/logs/restart, correct admin-UI display
967
+ * names. Before this, all of a group's caps collapsed under one synthetic
968
+ * `addonId = childId` (the group name) — the "@camstack/addon-net-access"
969
+ * admin-UI bug. A legacy child that omits `addonId` falls back to `childId`,
970
+ * which is identical to the historical single-addon behaviour
971
+ * (childId = runnerId = addonId when no group is declared).
964
972
  *
965
973
  * Singleton vs. device-scoped caps: `ChildCapDescriptor.deviceId` is present only
966
974
  * for device-scoped native caps. The `addons` array carries system (singleton/collection)
967
975
  * cap names; device-scoped native caps are handled separately via `nativeCaps` in the
968
- * full `RegisterNodeParams`. For the parallel-window phase (E1), we populate only
969
- * the `addons` portion — the Moleculer path carries `nativeCaps` on the re-handshake.
970
- *
971
- * TODO(co-location): This function synthesises ONE manifest entry with `addonId = childId`
972
- * (the runner id). This is correct under the current one-addon-one-process invariant
973
- * where `childId = runnerId = addonId`. If `execution.group` co-location is ever
974
- * activated (multiple addons sharing one runner), a single runner would host multiple
975
- * addonIds but this function would register all their caps under one synthetic addonId —
976
- * collapsing distinct provider registryKeys into one and breaking per-addon routing.
977
- * Multi-addon manifest support (splitting the `ChildCapDescriptor[]` by addonId once the
978
- * protocol carries addonId) would be needed here before enabling co-location post-Phase-F.
976
+ * full `RegisterNodeParams`.
979
977
  */
980
978
  function buildChildUdsManifest(nodeId, childId, caps) {
981
- // Collect unique system (non-device-scoped) cap names.
982
- const systemCapNames = new Set();
979
+ // Group unique system (non-device-scoped) cap names per hosted addon.
980
+ // Insertion order preserves the child's registration order.
981
+ const capsByAddon = new Map();
983
982
  for (const cap of caps) {
984
- if (cap.deviceId === undefined) {
985
- systemCapNames.add(cap.capName);
986
- }
983
+ if (cap.deviceId !== undefined)
984
+ continue;
985
+ const addonId = cap.addonId ?? childId;
986
+ const set = capsByAddon.get(addonId) ?? new Set();
987
+ set.add(cap.capName);
988
+ capsByAddon.set(addonId, set);
989
+ }
990
+ // A child with no system caps still registers an (empty) entry under its
991
+ // childId so node bookkeeping (previous-manifest diffing, disconnect
992
+ // cleanup) keeps a record for the node.
993
+ if (capsByAddon.size === 0) {
994
+ capsByAddon.set(childId, new Set());
987
995
  }
988
- const addons = [
989
- { addonId: childId, capabilities: [...systemCapNames] },
990
- ];
996
+ const addons = [...capsByAddon.entries()].map(([addonId, capNames]) => ({ addonId, capabilities: [...capNames] }));
991
997
  return { nodeId, addons };
992
998
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/server",
3
- "version": "1.1.42",
3
+ "version": "1.1.43",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist",
@@ -24,6 +24,7 @@
24
24
  "dependencies": {
25
25
  "@camstack/addon-admin-ui": "*",
26
26
  "@camstack/addon-advanced-notifier": "*",
27
+ "@camstack/addon-auth": "*",
27
28
  "@camstack/addon-decoder-nodeav": "*",
28
29
  "@camstack/addon-notifiers": "*",
29
30
  "@camstack/addon-pipeline": "*",