@camstack/server 1.2.843 → 1.2.844

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/CHANGELOG.md CHANGED
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.2.844] - 2026-11-12
11
+
12
+ ### Changed
13
+
14
+ - A device's capability list no longer includes cluster-wide capabilities (broker, adoption, auth); exports such as Alexa see only the device's own.
15
+
10
16
  ## [1.2.843] - 2026-11-12
11
17
 
12
18
  ### Changed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/server",
3
- "version": "1.2.843",
3
+ "version": "1.2.844",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -66,9 +66,7 @@
66
66
  ],
67
67
  "requires": {
68
68
  "addons": {
69
- "@camstack/addon-admin-ui": ">=1.2.647",
70
- "@camstack/addon-agent-ui": ">=1.2.368",
71
- "@camstack/addon-export-alexa": ">=1.2.195"
69
+ "@camstack/addon-post-analysis": ">=1.2.695"
72
70
  },
73
71
  "wrapper": {
74
72
  "desktop": ">=0.0.1",
@@ -85,7 +83,7 @@
85
83
  "@camstack/addon-notifiers": "1.2.637",
86
84
  "@camstack/addon-pipeline": "1.2.650",
87
85
  "@camstack/addon-pipeline-orchestrator": "1.2.681",
88
- "@camstack/addon-post-analysis": "1.2.694",
86
+ "@camstack/addon-post-analysis": "1.2.695",
89
87
  "@camstack/develop": "0.1.52",
90
88
  "@camstack/sdk": "1.2.157",
91
89
  "@camstack/types": "1.2.551",
@@ -1532,6 +1532,15 @@ function capAppliesToDeviceType(def, deviceType, role) {
1532
1532
  return require_dist.capAppliesToDeviceKind(def, deviceType, role);
1533
1533
  }
1534
1534
  /**
1535
+ * A `scope: 'system'` cap is cluster-wide (broker, adoption, auth). It is
1536
+ * never a device binding, even when it declares no `deviceTypes` — that
1537
+ * omission means "every device" only for a device-scoped cap (D4, D12).
1538
+ * An unknown definition is not system-scoped: a missing read changes nothing.
1539
+ */
1540
+ function isSystemScopedCap(def) {
1541
+ return def?.scope === "system";
1542
+ }
1543
+ /**
1535
1544
  * An addon's identity, with the node it happens to run on stripped.
1536
1545
  *
1537
1546
  * A capability registered on an agent arrives under `<addonId>@<nodeId>` —
@@ -1551,7 +1560,9 @@ function addonIdentityOf(addonId) {
1551
1560
  * Deduped by {@link addonIdentityOf}, so the hub-local registration, the
1552
1561
  * agent's `<addon>@<node>` one and the device's native registration of the same
1553
1562
  * addon are ONE provider — the defect this exists to make unrepresentable.
1554
- * Gated only by the cap's declared `deviceTypes` (D4), like step 2's auto-bind.
1563
+ * Gated by the cap's declared scope and `deviceTypes` (D4), like step 2's
1564
+ * auto-bind. A system-scoped collection is skipped: with no `deviceTypes`
1565
+ * it would otherwise bind onto every device (D12).
1555
1566
  */
1556
1567
  function collectionBindings(deps, deviceId, deviceType, role) {
1557
1568
  const registry = deps.capabilityRegistry;
@@ -1559,7 +1570,9 @@ function collectionBindings(deps, deviceId, deviceType, role) {
1559
1570
  const out = [];
1560
1571
  for (const declared of registry.listCapabilities()) {
1561
1572
  if (declared.mode !== "collection") continue;
1562
- if (!capAppliesToDeviceType(registry.getDefinition(declared.name), deviceType, role)) continue;
1573
+ const definition = registry.getDefinition(declared.name);
1574
+ if (isSystemScopedCap(definition)) continue;
1575
+ if (!capAppliesToDeviceType(definition, deviceType, role)) continue;
1563
1576
  const nativeAddonId = registry.getNativeAddonId(declared.name, deviceId);
1564
1577
  const seen = /* @__PURE__ */ new Set();
1565
1578
  for (const addonId of [...declared.providers, ...nativeAddonId ? [nativeAddonId] : []]) {
@@ -1650,9 +1663,15 @@ async function resolveBindingsForDevice(deps, deviceId, row, pass) {
1650
1663
  if (presence === "absent") deps.ctx.logger.debug("bindings requested for absent device — returning none", { tags: { deviceId } });
1651
1664
  else if (deps.capabilityRegistry) {
1652
1665
  const skippedForType = [];
1666
+ const skippedSystem = [];
1653
1667
  for (const capName of deps.capabilityRegistry.getCapsWithDefaultWrapper()) {
1654
1668
  if (seenCaps.has(capName)) continue;
1655
- if (!capAppliesToDeviceType(deps.capabilityRegistry.getDefinition(capName), deviceType, deviceRole)) {
1669
+ const definition = deps.capabilityRegistry.getDefinition(capName);
1670
+ if (isSystemScopedCap(definition)) {
1671
+ skippedSystem.push(capName);
1672
+ continue;
1673
+ }
1674
+ if (!capAppliesToDeviceType(definition, deviceType, deviceRole)) {
1656
1675
  skippedForType.push(capName);
1657
1676
  continue;
1658
1677
  }
@@ -1677,6 +1696,10 @@ async function resolveBindingsForDevice(deps, deviceId, row, pass) {
1677
1696
  skipped: skippedForType
1678
1697
  }
1679
1698
  });
1699
+ if (skippedSystem.length > 0) deps.ctx.logger.debug("getBindings: default wrappers skipped — system scope", {
1700
+ tags: { deviceId },
1701
+ meta: { skipped: skippedSystem }
1702
+ });
1680
1703
  }
1681
1704
  if (deps.capabilityRegistry) for (const capName of deps.capabilityRegistry.getNativeCapsForDevice(deviceId)) {
1682
1705
  if (seenCaps.has(capName)) continue;
@@ -1526,6 +1526,15 @@ function capAppliesToDeviceType(def, deviceType, role) {
1526
1526
  return capAppliesToDeviceKind(def, deviceType, role);
1527
1527
  }
1528
1528
  /**
1529
+ * A `scope: 'system'` cap is cluster-wide (broker, adoption, auth). It is
1530
+ * never a device binding, even when it declares no `deviceTypes` — that
1531
+ * omission means "every device" only for a device-scoped cap (D4, D12).
1532
+ * An unknown definition is not system-scoped: a missing read changes nothing.
1533
+ */
1534
+ function isSystemScopedCap(def) {
1535
+ return def?.scope === "system";
1536
+ }
1537
+ /**
1529
1538
  * An addon's identity, with the node it happens to run on stripped.
1530
1539
  *
1531
1540
  * A capability registered on an agent arrives under `<addonId>@<nodeId>` —
@@ -1545,7 +1554,9 @@ function addonIdentityOf(addonId) {
1545
1554
  * Deduped by {@link addonIdentityOf}, so the hub-local registration, the
1546
1555
  * agent's `<addon>@<node>` one and the device's native registration of the same
1547
1556
  * addon are ONE provider — the defect this exists to make unrepresentable.
1548
- * Gated only by the cap's declared `deviceTypes` (D4), like step 2's auto-bind.
1557
+ * Gated by the cap's declared scope and `deviceTypes` (D4), like step 2's
1558
+ * auto-bind. A system-scoped collection is skipped: with no `deviceTypes`
1559
+ * it would otherwise bind onto every device (D12).
1549
1560
  */
1550
1561
  function collectionBindings(deps, deviceId, deviceType, role) {
1551
1562
  const registry = deps.capabilityRegistry;
@@ -1553,7 +1564,9 @@ function collectionBindings(deps, deviceId, deviceType, role) {
1553
1564
  const out = [];
1554
1565
  for (const declared of registry.listCapabilities()) {
1555
1566
  if (declared.mode !== "collection") continue;
1556
- if (!capAppliesToDeviceType(registry.getDefinition(declared.name), deviceType, role)) continue;
1567
+ const definition = registry.getDefinition(declared.name);
1568
+ if (isSystemScopedCap(definition)) continue;
1569
+ if (!capAppliesToDeviceType(definition, deviceType, role)) continue;
1557
1570
  const nativeAddonId = registry.getNativeAddonId(declared.name, deviceId);
1558
1571
  const seen = /* @__PURE__ */ new Set();
1559
1572
  for (const addonId of [...declared.providers, ...nativeAddonId ? [nativeAddonId] : []]) {
@@ -1644,9 +1657,15 @@ async function resolveBindingsForDevice(deps, deviceId, row, pass) {
1644
1657
  if (presence === "absent") deps.ctx.logger.debug("bindings requested for absent device — returning none", { tags: { deviceId } });
1645
1658
  else if (deps.capabilityRegistry) {
1646
1659
  const skippedForType = [];
1660
+ const skippedSystem = [];
1647
1661
  for (const capName of deps.capabilityRegistry.getCapsWithDefaultWrapper()) {
1648
1662
  if (seenCaps.has(capName)) continue;
1649
- if (!capAppliesToDeviceType(deps.capabilityRegistry.getDefinition(capName), deviceType, deviceRole)) {
1663
+ const definition = deps.capabilityRegistry.getDefinition(capName);
1664
+ if (isSystemScopedCap(definition)) {
1665
+ skippedSystem.push(capName);
1666
+ continue;
1667
+ }
1668
+ if (!capAppliesToDeviceType(definition, deviceType, deviceRole)) {
1650
1669
  skippedForType.push(capName);
1651
1670
  continue;
1652
1671
  }
@@ -1671,6 +1690,10 @@ async function resolveBindingsForDevice(deps, deviceId, row, pass) {
1671
1690
  skipped: skippedForType
1672
1691
  }
1673
1692
  });
1693
+ if (skippedSystem.length > 0) deps.ctx.logger.debug("getBindings: default wrappers skipped — system scope", {
1694
+ tags: { deviceId },
1695
+ meta: { skipped: skippedSystem }
1696
+ });
1674
1697
  }
1675
1698
  if (deps.capabilityRegistry) for (const capName of deps.capabilityRegistry.getNativeCapsForDevice(deviceId)) {
1676
1699
  if (seenCaps.has(capName)) continue;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/server",
3
- "version": "1.2.843",
3
+ "version": "1.2.844",
4
4
  "description": "CamStack builtins — shipped inside @camstack/server (generated, do not edit)",
5
5
  "license": "MIT",
6
6
  "camstack": {