@camstack/server 1.1.72 → 1.1.73

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.
@@ -48,13 +48,25 @@ function requireDeviceScoped(registry, capName) {
48
48
  message: `${String(capName)}.${prop}: input must carry numeric "deviceId"`,
49
49
  });
50
50
  }
51
- const native = registry.getNativeProvider(capName, deviceId);
52
- if (!native) {
53
- // No native provider. For `getStatus`, the device may still have a
54
- // SYNTHESIZED status from device-links (battery/consumables wired
55
- // from sibling sensors). Consult the resolver with a null base
56
- // (the synthesize path) before failing it returns null when the
57
- // device has no links for this cap, preserving today's error.
51
+ // Fast path (unchanged): a per-device native provider registered for
52
+ // the exact (cap, deviceId) pair.
53
+ let provider = registry.getNativeProvider(capName, deviceId);
54
+ // D13 fallback: a device cap may be served by a WRAPPER / system
55
+ // provider bound to this device (e.g. the `virtual-doorbell` builtin
56
+ // registers a SINGLETON wrapperno native). Consult the unified
57
+ // per-device resolver `getProviderForDevice` (native OR device-bound
58
+ // system) BEFORE the synthesize fallback + the final throw. This
59
+ // never runs when a native was found, keeping the fast path intact.
60
+ if (!provider) {
61
+ provider = registry.getProviderForDevice(capName, deviceId);
62
+ }
63
+ if (!provider) {
64
+ // No native and no device-bound provider. For `getStatus`, the
65
+ // device may still have a SYNTHESIZED status from device-links
66
+ // (battery/consumables wired from sibling sensors). Consult the
67
+ // resolver with a null base (the synthesize path) before failing —
68
+ // it returns null when the device has no links for this cap,
69
+ // preserving today's error.
58
70
  if (prop === 'getStatus') {
59
71
  const deviceManager = registry.getSingleton('device-manager');
60
72
  const synthesized = await deviceManager?.resolveLinkedStatus?.({
@@ -70,14 +82,14 @@ function requireDeviceScoped(registry, capName) {
70
82
  message: `Capability "${String(capName)}" not registered for device ${deviceId}`,
71
83
  });
72
84
  }
73
- const fn = native[prop];
85
+ const fn = provider[prop];
74
86
  if (typeof fn !== 'function') {
75
87
  throw new server_1.TRPCError({
76
88
  code: 'NOT_IMPLEMENTED',
77
89
  message: `Capability "${String(capName)}" provider for device ${deviceId} does not implement "${prop}"`,
78
90
  });
79
91
  }
80
- const result = await fn.call(native, input);
92
+ const result = await fn.call(provider, input);
81
93
  // Device-property-wiring overlay (read-time): only `getStatus`, and only
82
94
  // when the device has links for this cap (resolveLinkedStatus returns
83
95
  // null otherwise → base result untouched). One in-process singleton hop.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/server",
3
- "version": "1.1.72",
3
+ "version": "1.1.73",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist",
@@ -23,19 +23,19 @@
23
23
  "test:watch": "vitest"
24
24
  },
25
25
  "dependencies": {
26
- "@camstack/addon-admin-ui": "1.1.59",
26
+ "@camstack/addon-admin-ui": "1.1.60",
27
27
  "@camstack/addon-advanced-notifier": "1.1.30",
28
28
  "@camstack/addon-auth": "1.1.15",
29
29
  "@camstack/addon-decoder-nodeav": "1.1.18",
30
30
  "@camstack/addon-notifiers": "1.1.30",
31
- "@camstack/addon-pipeline": "1.1.65",
32
- "@camstack/addon-pipeline-orchestrator": "1.1.54",
33
- "@camstack/addon-post-analysis": "1.1.37",
31
+ "@camstack/addon-pipeline": "1.1.66",
32
+ "@camstack/addon-pipeline-orchestrator": "1.1.55",
33
+ "@camstack/addon-post-analysis": "1.1.38",
34
34
  "@camstack/sdk": "1.1.30",
35
35
  "@camstack/shm-ring": "1.0.29",
36
- "@camstack/system": "1.1.58",
37
- "@camstack/types": "1.1.52",
38
- "@camstack/ui-library": "1.1.43",
36
+ "@camstack/system": "1.1.59",
37
+ "@camstack/types": "1.1.53",
38
+ "@camstack/ui-library": "1.1.44",
39
39
  "@fastify/compress": "^9.0.0",
40
40
  "@fastify/cookie": "^11.0.2",
41
41
  "@fastify/multipart": "^10.0.0",