@camstack/types 1.2.283 → 1.2.284

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 (37) hide show
  1. package/dist/addon.js +2 -2
  2. package/dist/addon.mjs +2 -2
  3. package/dist/capabilities/device-extension.cap.d.ts +8 -25
  4. package/dist/capabilities/device-manager.cap.d.ts +2 -2
  5. package/dist/capabilities/device-state.cap.d.ts +2 -2
  6. package/dist/capabilities/doorbell.cap.d.ts +13 -64
  7. package/dist/capabilities/index.d.ts +1 -1
  8. package/dist/capabilities/motion.cap.d.ts +9 -8
  9. package/dist/capabilities/pipeline-orchestrator.cap.d.ts +147 -15
  10. package/dist/capabilities/pipeline-runner.cap.d.ts +2 -0
  11. package/dist/capabilities/ptz-autotrack.cap.d.ts +2 -3
  12. package/dist/catalogs/sensor-active-state.d.ts +8 -10
  13. package/dist/composition/presets/doorbell-feature.d.ts +1 -1
  14. package/dist/{composition-Dq42XWp0.mjs → composition-43aqsZQj.mjs} +6 -7
  15. package/dist/{composition-DG4jVTfB.js → composition-w3gBWMer.js} +6 -7
  16. package/dist/device/hub-motion-read.d.ts +22 -0
  17. package/dist/device-extension/slot-descriptor.d.ts +3 -3
  18. package/dist/enums/event-category.d.ts +9 -0
  19. package/dist/enums.js +1 -1
  20. package/dist/enums.mjs +1 -1
  21. package/dist/{event-category-C5xZWqz6.mjs → event-category-BGmz_oxW.mjs} +9 -0
  22. package/dist/{event-category-MbnB-6AN.js → event-category-DmS_tLsU.js} +9 -0
  23. package/dist/generated/extension-slots.d.ts +2 -6
  24. package/dist/index.d.ts +4 -1
  25. package/dist/index.js +252 -201
  26. package/dist/index.mjs +243 -199
  27. package/dist/interfaces/event-bus.d.ts +5 -3
  28. package/dist/interfaces/pipeline-runner-capability.d.ts +2 -0
  29. package/dist/node.js +1 -1
  30. package/dist/node.mjs +1 -1
  31. package/dist/pipeline/camera-sensors.d.ts +133 -9
  32. package/dist/pipeline/motion-ownership.d.ts +13 -0
  33. package/dist/pipeline/provider-motion.d.ts +33 -0
  34. package/dist/{sleep-gU6hqv4_.mjs → sleep-CDCONfkt.mjs} +1 -1
  35. package/dist/{sleep-DCbD8sdg.js → sleep-G4F3X9X_.js} +1 -1
  36. package/dist/utils/addon-id.d.ts +2 -2
  37. package/package.json +1 -1
@@ -67,8 +67,7 @@ export declare const ptzAutotrackCapability: {
67
67
  readonly deviceNative: true;
68
68
  readonly mode: "singleton";
69
69
  /**
70
- * Two kinds of provider behind one name, the same shape `snapshot` and
71
- * `doorbell` use:
70
+ * Two kinds of provider behind one name, the same shape `snapshot` uses:
72
71
  *
73
72
  * - **Native**: the camera's own firmware autotrack, registered per device by
74
73
  * the driver when the probe says it exists (Reolink: yes; Hikvision:
@@ -76,7 +75,7 @@ export declare const ptzAutotrackCapability: {
76
75
  * - **Wrapper**: the emulated implementation (`@camstack/system`'s `autotrack` builtin),
77
76
  * which follows a subject with `ptz.move` pulses driven by the detection
78
77
  * pipeline. `defaultActive: false` — the operator binds it per camera in
79
- * the bindings UI, exactly as `virtual-doorbell` is bound.
78
+ * the bindings UI.
80
79
  *
81
80
  * The binding chooses WHICH implementation answers; `setEnabled` stays the
82
81
  * one switch for the function either way. A camera never has both driving its
@@ -2,13 +2,12 @@
2
2
  * LA tabella "quale booleano di questo tipo di device conta come ALTO", e il
3
3
  * valutatore puro del suo FRONTE.
4
4
  *
5
- * Viveva dentro il builtin virtual-doorbell
6
- * (`@camstack/system` — `builtins/doorbell/trigger-engine.ts`) e i suoi
7
- * predicati erano privati al modulo. Il recorder ne ha bisogno per il trigger
8
- * `RecordingTriggers.sensorDeviceIds`: copiarla avrebbe creato la SECONDA
9
- * tabella, che diverge alla prima cap aggiunta e il cui sintomo — "il sensore
10
- * fa suonare il campanello ma non registra" — è esattamente D62. Quindi si
11
- * SPOSTA qui e il doorbell la ri-esporta.
5
+ * UNA tabella per tutti quelli che chiedono "questo device è ALTO?": il
6
+ * trigger `RecordingTriggers.sensorDeviceIds` del recorder, i marker dei
7
+ * sensori della post-analysis, il bridge camera-sensors dell'orchestratore e
8
+ * le sorgenti di un campanello composto (`doorbellFeatureSources`, D671).
9
+ * Una seconda copia divergerebbe alla prima cap aggiunta, e il sintomo — "il
10
+ * sensore fa suonare il campanello ma non registra" — è esattamente D62.
12
11
  *
13
12
  * ⚠ NON è `DEVICE_STATE_READERS` (`catalogs/device-state-vocabulary.ts`), e le
14
13
  * due non vanno unificate: quella risponde a "qual è la PAROLA di stato per una
@@ -65,9 +64,8 @@ export declare function sliceActiveValue(capName: string, slice: Readonly<Record
65
64
  * it is absent, non-numeric or the zero "never observed" sentinel. */
66
65
  export declare function sliceChangedAt(capName: string, slice: Readonly<Record<string, unknown>>): number | null;
67
66
  /**
68
- * Perché una slice non ha portato un fronte alto. Stesso vocabolario che il
69
- * virtual-doorbell riporta dal 2026-08-05: UN enum, così "perché non è scattato
70
- * niente" ha una risposta sola, chiunque lo chieda.
67
+ * Perché una slice non ha portato un fronte alto. UN enum, così "perché non è
68
+ * scattato niente" ha una risposta sola, chiunque lo chieda.
71
69
  */
72
70
  export type SensorEdgeIgnoreReason =
73
71
  /** Not a recognised binary/switch source cap. */
@@ -16,5 +16,5 @@ export interface DoorbellFeatureInput {
16
16
  }
17
17
  /** Every source cap of `source` that `SOURCE_CAP_ACTIVE_FIELD` knows AND the device has bound. */
18
18
  export declare function doorbellFeatureSources(source: CompositionSourceRef, boundCaps: readonly string[]): readonly DoorbellFeatureSource[];
19
- /** The D671 feature, byte for byte what the migration writes. Throws on zero sources. */
19
+ /** The canonical D671 doorbell feature. Throws on zero sources. */
20
20
  export declare function buildDoorbellCompositionFeature(input: DoorbellFeatureInput): CompositionFieldsFeature;
@@ -904,13 +904,12 @@ function chooseFfmpegBinary(input) {
904
904
  * LA tabella "quale booleano di questo tipo di device conta come ALTO", e il
905
905
  * valutatore puro del suo FRONTE.
906
906
  *
907
- * Viveva dentro il builtin virtual-doorbell
908
- * (`@camstack/system` — `builtins/doorbell/trigger-engine.ts`) e i suoi
909
- * predicati erano privati al modulo. Il recorder ne ha bisogno per il trigger
910
- * `RecordingTriggers.sensorDeviceIds`: copiarla avrebbe creato la SECONDA
911
- * tabella, che diverge alla prima cap aggiunta e il cui sintomo — "il sensore
912
- * fa suonare il campanello ma non registra" — è esattamente D62. Quindi si
913
- * SPOSTA qui e il doorbell la ri-esporta.
907
+ * UNA tabella per tutti quelli che chiedono "questo device è ALTO?": il
908
+ * trigger `RecordingTriggers.sensorDeviceIds` del recorder, i marker dei
909
+ * sensori della post-analysis, il bridge camera-sensors dell'orchestratore e
910
+ * le sorgenti di un campanello composto (`doorbellFeatureSources`, D671).
911
+ * Una seconda copia divergerebbe alla prima cap aggiunta, e il sintomo — "il
912
+ * sensore fa suonare il campanello ma non registra" — è esattamente D62.
914
913
  *
915
914
  * ⚠ NON è `DEVICE_STATE_READERS` (`catalogs/device-state-vocabulary.ts`), e le
916
915
  * due non vanno unificate: quella risponde a "qual è la PAROLA di stato per una
@@ -904,13 +904,12 @@ function chooseFfmpegBinary(input) {
904
904
  * LA tabella "quale booleano di questo tipo di device conta come ALTO", e il
905
905
  * valutatore puro del suo FRONTE.
906
906
  *
907
- * Viveva dentro il builtin virtual-doorbell
908
- * (`@camstack/system` — `builtins/doorbell/trigger-engine.ts`) e i suoi
909
- * predicati erano privati al modulo. Il recorder ne ha bisogno per il trigger
910
- * `RecordingTriggers.sensorDeviceIds`: copiarla avrebbe creato la SECONDA
911
- * tabella, che diverge alla prima cap aggiunta e il cui sintomo — "il sensore
912
- * fa suonare il campanello ma non registra" — è esattamente D62. Quindi si
913
- * SPOSTA qui e il doorbell la ri-esporta.
907
+ * UNA tabella per tutti quelli che chiedono "questo device è ALTO?": il
908
+ * trigger `RecordingTriggers.sensorDeviceIds` del recorder, i marker dei
909
+ * sensori della post-analysis, il bridge camera-sensors dell'orchestratore e
910
+ * le sorgenti di un campanello composto (`doorbellFeatureSources`, D671).
911
+ * Una seconda copia divergerebbe alla prima cap aggiunta, e il sintomo — "il
912
+ * sensore fa suonare il campanello ma non registra" — è esattamente D62.
914
913
  *
915
914
  * ⚠ NON è `DEVICE_STATE_READERS` (`catalogs/device-state-vocabulary.ts`), e le
916
915
  * due non vanno unificate: quella risponde a "qual è la PAROLA di stato per una
@@ -0,0 +1,22 @@
1
+ /**
2
+ * A camera's `motion` slice, read from the HUB (D696).
3
+ *
4
+ * The orchestrator is the only writer of a camera's `motion` runtime slice, and
5
+ * it writes the EFFECTIVE value on the hub. A camera provider's local runtime
6
+ * state therefore holds no `motion` slice, and its `motion.isDetected` answers
7
+ * from here. Two answers are UNKNOWN, and both make the call fail rather than
8
+ * answer `false` (D49, D393):
9
+ * - the read did not answer (the hub is unreachable, the call threw);
10
+ * - the read answered with no `detected`: nobody has published the camera's
11
+ * motion since the hub started (the slice is session-durable).
12
+ */
13
+ /** The one `deviceState` read this needs. `ctx.api.deviceState` satisfies it. */
14
+ export interface HubMotionSliceReader {
15
+ readonly getCapSlice: {
16
+ readonly query: (input: {
17
+ deviceId: number;
18
+ capName: string;
19
+ }) => Promise<Readonly<Record<string, unknown>> | null>;
20
+ };
21
+ }
22
+ export declare function readHubMotionDetected(deviceState: HubMotionSliceReader, deviceId: number): Promise<boolean>;
@@ -3,15 +3,15 @@
3
3
  * declared by the capability that already owns the function (D648).
4
4
  *
5
5
  * A slot is metadata, and behavioural metadata lives in the owning `*.cap.ts`
6
- * (D4): `device-manager.cap.ts` declares `linked-devices`, `doorbell.cap.ts`
7
- * declares `doorbell-source`. `npm run codegen` folds every declaration into
6
+ * (D4): `device-manager.cap.ts` declares `linked-devices`, today the only
7
+ * slot. `npm run codegen` folds every declaration into
8
8
  * `generated/extension-slots.ts` (the id enum, the table and the discriminated
9
9
  * union of slot values), and `device-extension` is the device-scoped
10
10
  * collection contract that lists and writes them. The contract persists
11
11
  * NOTHING: each slot is served by the addon that owns its store (D62).
12
12
  *
13
13
  * One shape, `association` — the host LISTS other devices (a camera's linked
14
- * devices, its doorbell trigger sources). Removing every source is "off";
14
+ * devices). Removing every source is "off";
15
15
  * there is no separate switch.
16
16
  *
17
17
  * A host that GAINS a whole capability from other devices is not a slot: that
@@ -530,6 +530,15 @@ export declare enum EventCategory {
530
530
  */
531
531
  PipelineAudioInferenceResult = "pipeline.audio-inference-result",
532
532
  DetectionPhaseTransition = "detection.phase-transition",
533
+ /**
534
+ * A camera provider's RAW onboard motion push (D673): the `MotionOnMotionChanged`
535
+ * data shape without `triggeredBy`, built by `providerMotionEvent`. Its one
536
+ * consumer is the orchestrator's camera-sensors bridge, which re-emits the
537
+ * camera's EFFECTIVE onboard motion as `MotionOnMotionChanged` (a pass-through
538
+ * for a camera with no attached sensor). Providers must not emit
539
+ * `MotionOnMotionChanged` themselves; `scripts/check-onboard-motion-emitters.ts`
540
+ * keeps it so (camera-grid is a named, deferred exception).
541
+ */
533
542
  ProviderMotion = "provider.motion",
534
543
  ProviderDetection = "provider.detection",
535
544
  EnrichmentEmbeddingStored = "enrichment.embedding.stored",
package/dist/enums.js CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_event_category = require("./event-category-MbnB-6AN.js");
2
+ const require_event_category = require("./event-category-DmS_tLsU.js");
3
3
  //#region src/enums/event-source-type.ts
4
4
  var EventSourceType = /* @__PURE__ */ function(EventSourceType) {
5
5
  EventSourceType["Addon"] = "addon";
package/dist/enums.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { t as EventCategory } from "./event-category-C5xZWqz6.mjs";
1
+ import { t as EventCategory } from "./event-category-BGmz_oxW.mjs";
2
2
  //#region src/enums/event-source-type.ts
3
3
  var EventSourceType = /* @__PURE__ */ function(EventSourceType) {
4
4
  EventSourceType["Addon"] = "addon";
@@ -531,6 +531,15 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
531
531
  */
532
532
  EventCategory["PipelineAudioInferenceResult"] = "pipeline.audio-inference-result";
533
533
  EventCategory["DetectionPhaseTransition"] = "detection.phase-transition";
534
+ /**
535
+ * A camera provider's RAW onboard motion push (D673): the `MotionOnMotionChanged`
536
+ * data shape without `triggeredBy`, built by `providerMotionEvent`. Its one
537
+ * consumer is the orchestrator's camera-sensors bridge, which re-emits the
538
+ * camera's EFFECTIVE onboard motion as `MotionOnMotionChanged` (a pass-through
539
+ * for a camera with no attached sensor). Providers must not emit
540
+ * `MotionOnMotionChanged` themselves; `scripts/check-onboard-motion-emitters.ts`
541
+ * keeps it so (camera-grid is a named, deferred exception).
542
+ */
534
543
  EventCategory["ProviderMotion"] = "provider.motion";
535
544
  EventCategory["ProviderDetection"] = "provider.detection";
536
545
  EventCategory["EnrichmentEmbeddingStored"] = "enrichment.embedding.stored";
@@ -531,6 +531,15 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
531
531
  */
532
532
  EventCategory["PipelineAudioInferenceResult"] = "pipeline.audio-inference-result";
533
533
  EventCategory["DetectionPhaseTransition"] = "detection.phase-transition";
534
+ /**
535
+ * A camera provider's RAW onboard motion push (D673): the `MotionOnMotionChanged`
536
+ * data shape without `triggeredBy`, built by `providerMotionEvent`. Its one
537
+ * consumer is the orchestrator's camera-sensors bridge, which re-emits the
538
+ * camera's EFFECTIVE onboard motion as `MotionOnMotionChanged` (a pass-through
539
+ * for a camera with no attached sensor). Providers must not emit
540
+ * `MotionOnMotionChanged` themselves; `scripts/check-onboard-motion-emitters.ts`
541
+ * keeps it so (camera-grid is a named, deferred exception).
542
+ */
534
543
  EventCategory["ProviderMotion"] = "provider.motion";
535
544
  EventCategory["ProviderDetection"] = "provider.detection";
536
545
  EventCategory["EnrichmentEmbeddingStored"] = "enrichment.embedding.stored";
@@ -6,16 +6,15 @@
6
6
  * caps' descriptors and value schemas — never the caps barrel — so
7
7
  * `device-extension.cap.ts` can import this module without a cycle.
8
8
  *
9
- * Coverage: 2 slot(s).
9
+ * Coverage: 1 slot(s).
10
10
  */
11
11
  import { z } from 'zod';
12
12
  import { DeviceType } from '../device/device-type.js';
13
13
  import type { ExtensionSlotDescriptor } from '../device-extension/slot-descriptor.js';
14
14
  /** Every declared slot id, in table order. */
15
- export declare const EXTENSION_SLOT_IDS: readonly ["doorbell-source", "linked-devices"];
15
+ export declare const EXTENSION_SLOT_IDS: readonly ["linked-devices"];
16
16
  export declare const ExtensionSlotIdSchema: z.ZodEnum<{
17
17
  "linked-devices": "linked-devices";
18
- "doorbell-source": "doorbell-source";
19
18
  }>;
20
19
  export type ExtensionSlotId = z.infer<typeof ExtensionSlotIdSchema>;
21
20
  /** One row of the table: the descriptor, who declared it, where it is offered. */
@@ -28,9 +27,6 @@ export interface ExtensionSlotEntry {
28
27
  export declare const EXTENSION_SLOTS: Readonly<Record<ExtensionSlotId, ExtensionSlotEntry>>;
29
28
  /** A slot's editable value, discriminated on `slot`. */
30
29
  export declare const ExtensionSlotValueSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
31
- deviceIds: z.ZodArray<z.ZodNumber>;
32
- slot: z.ZodLiteral<"doorbell-source">;
33
- }, z.core.$strip>, z.ZodObject<{
34
30
  deviceIds: z.ZodArray<z.ZodNumber>;
35
31
  trackedDeviceIds: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
36
32
  slot: z.ZodLiteral<"linked-devices">;
package/dist/index.d.ts CHANGED
@@ -250,7 +250,10 @@ export type { StateLabel, StateLabelKey, StateLabelLocale } from './i18n/state-l
250
250
  export { isStateLabelKey, STATE_LABEL_KEYS, STATE_LABELS, stateLabel, } from './i18n/state-labels.js';
251
251
  export { assertTimelapseCadences, DEFAULT_TIMELAPSE_PREVIEW_TEXT, readTimelapseGeneratedAt, TIMELAPSE_DENSE_FLOOR_SEC, TimelapseRuleInputSchema, TimelapseRulePatchSchema, TimelapseRuleSchema, TimelapseTemplateSchema, } from './notification/timelapse-rule.js';
252
252
  export { CLUSTER_MODEL_SCOPED_STEPS, CLUSTER_MODEL_SECTION_ID, CLUSTER_STEP_SETTING_FIELDS, type ClusterModelScopedStep, type ClusterStepModels, type ClusterStepSettingField, type ClusterStepSettings, clusterModelSettingKey, clusterStepSettingFieldsFor, clusterStepSettingKey, DEFAULT_CLUSTER_STEP_MODELS, DEFAULT_CLUSTER_STEP_SETTINGS, DEFAULT_MIN_LANDMARK_FACE_SIZE_PX, type HydratedClusterSection, type HydratedClusterView, interpretStoredClusterModel, type InvalidClusterStepModelEntry, invalidClusterStepModelEntries, isClusterScopedStep, overlayClusterStepSettings, pickClusterStepModels, pickClusterStepSettings, pickInvalidClusterStepModels, readClusterStepModels, readClusterStepSettings, resolveClusterStepModelId, type StepModelScope, type StoredClusterModelInterpretation, } from './pipeline/cluster-model-scope.js';
253
- export { CAMERA_SENSORS_NOT_LOADED, CAMERA_SENSORS_SETTINGS_KEY, CAMERA_TRIGGER, type CameraSensorAttachment, CameraSensorAttachmentSchema, type CameraSensorRef, CameraSensorRefSchema, cameraSensorRefKey, type CameraSensorsConfig, CameraSensorsConfigSchema, type CameraSensorsMode, CameraSensorsModeSchema, type CameraSensorsNotForwarded, CameraSensorsNotForwardedSchema, type CameraSensorsStatus, CameraSensorsStatusSchema, MAX_CAMERA_SENSORS, type MotionTriggeredBy, type MotionTriggeredByReading, MotionTriggeredBySchema, readMotionTriggeredBy, } from './pipeline/camera-sensors.js';
253
+ export { CAMERA_SENSORS_NOT_LOADED, CAMERA_SENSORS_SETTINGS_KEY, CAMERA_TRIGGER, type CameraSensorAttachment, CameraSensorAttachmentSchema, type CameraSensorRef, CameraSensorRefSchema, cameraSensorRefKey, type CameraSensorsConfig, CameraSensorsConfigSchema, type CameraOwnMotion, CameraOwnMotionSchema, type CameraRawLevel, CameraRawLevelSchema, type CameraSensorEntry, CameraSensorEntrySchema, type CameraSensorMode, CameraSensorModeSchema, type CameraSensorsNotEnforced, CameraSensorsNotEnforcedSchema, type CameraSensorsNotForwarded, CameraSensorsNotForwardedSchema, type CameraSensorsStatus, CameraSensorsStatusSchema, DEFAULT_CAMERA_SENSOR_MODE, MAX_CAMERA_SENSORS, type MotionTriggeredBy, type MotionTriggeredByReading, MotionTriggeredBySchema, readMotionTriggeredBy, } from './pipeline/camera-sensors.js';
254
+ export { cameraOwnsMotionViaSensor } from './pipeline/motion-ownership.js';
255
+ export { readHubMotionDetected } from './device/hub-motion-read.js';
256
+ export { type ProviderMotionData, ProviderMotionDataSchema, providerMotionEvent, } from './pipeline/provider-motion.js';
254
257
  export { type FormatRunnableModel, stepModelRunsOnFormat, } from './pipeline/step-format-runnable.js';
255
258
  export { DEFAULT_DETAIL_CROP_CONVENTION, DETAIL_CROP_PADDING_FIELD, DETAIL_CROP_PADDING_KEY, DETAIL_CROP_SECTION_ID, DETAIL_CROP_SQUARE_KEY, type DetailCropConvention, DetailCropConventionSchema, type DetailCropRect, deriveDetailCropRect, FULL_IMAGE_BBOX, type HydratedSettingsSection, type HydratedSettingsView, pickDetailCropConvention, readDetailCropConvention, } from './pipeline/detail-crop.js';
256
259
  export { DEFAULT_NATIVE_LEASE_SETTINGS, NATIVE_LEASE_ACTIVITY_FIELD, NATIVE_LEASE_ACTIVITY_KEY, NATIVE_LEASE_ADMISSION_FIELD, NATIVE_LEASE_ADMISSION_KEY, NATIVE_LEASE_BUDGET_FIELD, NATIVE_LEASE_BUDGET_KEY, NATIVE_LEASE_HOLD_FIELD, NATIVE_LEASE_HOLD_KEY, NATIVE_LEASE_SCENE_BUDGET_FIELD, NATIVE_LEASE_SCENE_BUDGET_KEY, NATIVE_LEASE_SECTION_ID, NATIVE_LEASE_TILE_BUDGET_FIELD, NATIVE_LEASE_TILE_BUDGET_KEY, type NativeLeaseAdmission, NativeLeaseAdmissionSchema, type NativeLeaseKnob, type NativeLeaseNumberKnob, type NativeLeaseSettings, type NativeLeaseSettingsOverride, NativeLeaseSettingsSchema, pickNativeLeaseOverride, readNativeLeaseOverride, } from './pipeline/native-lease.js';