@camstack/types 1.2.595 → 1.2.596

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.596] - 2026-11-18
11
+
12
+ ### Changed
13
+
14
+ - fetchDevice accepts a fresh option that bypasses the per-context binding cache
15
+
10
16
  ## [1.2.595] - 2026-11-18
11
17
 
12
18
  ### Changed
@@ -8,6 +8,10 @@ import type { DeviceProxy } from '../generated/device-proxy.js';
8
8
  import type { DeviceMeta, InitialDeviceMeta } from './device-management.js';
9
9
  import type { DeviceType } from './device-type.js';
10
10
  import type { NativeCapOptions } from './command-hold.js';
11
+ /** Options of `fetchDevice`. `fresh` re-reads the binding instead of serving the per-context cache. */
12
+ export interface FetchDeviceOptions {
13
+ readonly fresh?: boolean;
14
+ }
11
15
  /** What a device states about the config it persists. */
12
16
  export interface DevicePersistConfigOptions {
13
17
  /** Dotted paths its schema declares secret (`collectZodSecretPaths`). */
@@ -80,7 +84,7 @@ export interface DeviceContext {
80
84
  * Always wired by the production context factory; test ctx
81
85
  * fixtures supply a stub.
82
86
  */
83
- readonly fetchDevice: (deviceId: number) => Promise<DeviceProxy>;
87
+ readonly fetchDevice: (deviceId: number, options?: FetchDeviceOptions) => Promise<DeviceProxy>;
84
88
  /**
85
89
  * Reverse-pointer hook called by `BaseDevice` constructor right
86
90
  * after building its `runtimeState`. The kernel context factory
@@ -12,7 +12,7 @@ export type { ExposeBlockDevicesInput, ReconcileBlockDevicesInput, } from './blo
12
12
  export { exposeBlockDevices, reconcileBlockDevices } from './block-declared-devices.js';
13
13
  export type { IDevice } from './device.js';
14
14
  export { DeviceConfig } from './device-config.js';
15
- export type { DeviceConstructor, DeviceContext, DeviceManagerApi, DevicePersistConfigOptions, IDeviceRegistry, IDeviceRegistryReader, } from './device-context.js';
15
+ export type { DeviceConstructor, DeviceContext, DeviceManagerApi, DevicePersistConfigOptions, FetchDeviceOptions, IDeviceRegistry, IDeviceRegistryReader, } from './device-context.js';
16
16
  export type { ChildLayout, ChildLayoutEntry, CreateDeviceSpec, DeviceDiscovery, DeviceManualCreation, DeviceMeta, DiscoveredDevice, InitialDeviceMeta, SavedDevice, } from './device-management.js';
17
17
  export { DEVICE_IDENTIFIER_KEYS, DeviceIdentifierEntrySchema, DeviceIdentifierKeySchema, DeviceIdentifierOriginSchema, DeviceIdentifiersSchema, identifierStrength, isEmptyIdentifiers, mergeIdentifiers, normaliseIdentifiers, sameIdentifiers, normaliseMac, } from './device-identifiers.js';
18
18
  export type { AcceptedValue, DeviceIdentifierEntry, DeviceIdentifierKey, DeviceIdentifierOrigin, DeviceIdentifiers, DeviceIdentifierStrength, NormaliseIdentifiersOptions, NormalisedIdentifiers, NormaliseResult, RawDeviceIdentifiers, RawSerialIdentifier, RawVendorUidIdentifier, RejectedIdentifier, RejectedReason, } from './device-identifiers.js';
package/dist/index.d.ts CHANGED
@@ -266,7 +266,7 @@ export { exposeBlockDevices, reconcileBlockDevices } from './device/block-declar
266
266
  export type { IDevice } from './device/device.js';
267
267
  export type { DeviceBinding, DeviceBindingEntry } from './device/device-binding.js';
268
268
  export { DeviceConfig } from './device/device-config.js';
269
- export type { DeviceConstructor, DeviceContext, DeviceManagerApi, DeviceNameWrite, DevicePersistConfigOptions, IDeviceRegistry, IDeviceRegistryReader, } from './device/device-context.js';
269
+ export type { DeviceConstructor, DeviceContext, DeviceManagerApi, DeviceNameWrite, DevicePersistConfigOptions, FetchDeviceOptions, IDeviceRegistry, IDeviceRegistryReader, } from './device/device-context.js';
270
270
  export { widenDeviceConstructor } from './device/device-context.js';
271
271
  export type { AccessoryControlInput, AccessoryControlKind, AccessoryControlPick, DeviceControlKind, SensorMapping, } from './device/device-control-resolution.js';
272
272
  export { DEVICE_TYPE_CONTROL_KIND, hasMotionTrigger, isNode, MOTION_TRIGGER_FEATURE, pickAccessoryControl, resolveDeviceControlKind, resolveMutate, SENSOR_FEATURES, SENSOR_MAP, } from './device/device-control-resolution.js';
@@ -1,4 +1,5 @@
1
1
  import type { z } from 'zod';
2
+ import type { FetchDeviceOptions } from '../device/device-context.js';
2
3
  import type { PackageRequires } from '../addon/package-requires.js';
3
4
  import type { ScopedSettingsDeclaration, ScopedSettingsScope } from '../addon/scoped-settings.js';
4
5
  import type { CapabilityDefinition, InferProvider } from '../capabilities/capability-definition.js';
@@ -718,9 +719,12 @@ export interface AddonContext<TConfig = Record<string, unknown>> {
718
719
  *
719
720
  * Bindings are cached per-addon-context: the first call resolves bindings
720
721
  * via `deviceManager.getBindings.query`, subsequent calls reuse the cache.
721
- * The cache is invalidated implicitly when the device is removed.
722
+ * The cache is invalidated implicitly when the device is removed, and by the
723
+ * droppable `device.bindings-changed` event. A caller that must see a cap
724
+ * grafted after the first read (a shape comparison) passes `{ fresh: true }`:
725
+ * the bindings are re-read and the cache refreshed for later callers.
722
726
  */
723
- fetchDevice(deviceId: number): Promise<import('../generated/device-proxy.js').DeviceProxy>;
727
+ fetchDevice(deviceId: number, options?: FetchDeviceOptions): Promise<import('../generated/device-proxy.js').DeviceProxy>;
724
728
  /**
725
729
  * HTTP **data-plane** facility — serve files/streams/large payloads through the
726
730
  * hub's own port with the ADDON producing the bytes (real Node `req`/`res`); the
@@ -58,9 +58,8 @@ import { type NormalizedRect, type RecoveryCrop, type RecoveryPlanInput } from '
58
58
  /**
59
59
  * Which region rule this camera's second pass runs.
60
60
  *
61
- * The selector is per camera and defaults to the shipped rule, exactly like
62
- * the motion area bar's own `minArea: 0` opt-in (D394): a deploy changes
63
- * nothing until an operator moves a camera.
61
+ * The selector is per camera and defaults to the shipped rule: a deploy
62
+ * changes nothing until an operator moves a camera.
64
63
  */
65
64
  export type RecoveryRecipe = 'uncovered-region' | 'motion-crop';
66
65
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/types",
3
- "version": "1.2.595",
3
+ "version": "1.2.596",
4
4
  "description": "Shared types, interfaces, and model catalogs for the CamStack detection ecosystem",
5
5
  "keywords": [
6
6
  "camstack",