@camstack/types 1.2.304 → 1.2.305

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.
@@ -508,8 +508,31 @@ export interface PhaseTransitionPayload {
508
508
  cooldownMs?: number;
509
509
  /** Ms epoch of the transition. */
510
510
  timestamp?: number;
511
+ /**
512
+ * Why the phase changed. `motion`: the runner's motion gate (an `on-motion`
513
+ * registration) — `source` and `cooldownMs` are set. `attach` / `detach`:
514
+ * the camera was attached `always-on` (every on-motion detection SESSION
515
+ * is) or detached while active. An attach names the motion that opened the
516
+ * session (`source` + `triggeredBy`) when the orchestrator sent it; a
517
+ * detach names none. `cooldownMs` is absent on both. Absent on a runner older than 2026-10-06,
518
+ * whose attach claimed `source: 'analyzer'` and whose detach emitted
519
+ * nothing.
520
+ */
521
+ cause?: PhaseTransitionCause;
522
+ /**
523
+ * On a `cause: 'attach'` of an on-motion SESSION: what raised the motion
524
+ * that opened it (D672) — the camera itself, or an attached sensor with its
525
+ * deviceId. `source` is then the motion source that passed the camera's
526
+ * gate. Absent on an attach with no motion behind it (occupancy burst,
527
+ * standing always-on camera, re-dispatch) and from an orchestrator that does
528
+ * not send `sessionTrigger`.
529
+ */
530
+ triggeredBy?: import('../pipeline/camera-sensors.js').MotionTriggeredBy;
531
+ /** The attached sensor's device name when `triggeredBy.kind === 'sensor'` and it is known. */
532
+ sensorName?: string;
511
533
  [key: string]: unknown;
512
534
  }
535
+ export type PhaseTransitionCause = 'motion' | 'attach' | 'detach';
513
536
  /**
514
537
  * Scope of a readiness transition — the "who does this ready/down apply to".
515
538
  *
@@ -37,6 +37,12 @@ export interface RunnerCameraConfig {
37
37
  * as `['pipeline']` — today's behaviour, unchanged.
38
38
  */
39
39
  readonly detectionSources?: import('../capabilities/pipeline-runner.cap.js').DetectionSources;
40
+ /**
41
+ * What opened this attach — a SESSION attach only (`SessionTriggerSchema`,
42
+ * D672 rule 11 as amended 2026-10-06). The runner names it on the phase
43
+ * event and decides nothing on it. Absent ⇒ no source is named.
44
+ */
45
+ readonly sessionTrigger?: import('../capabilities/pipeline-runner.cap.js').SessionTrigger;
40
46
  readonly pipelineEnabled: boolean;
41
47
  /**
42
48
  * Which of the node's inference accelerators this session runs on
@@ -9,6 +9,31 @@ import { type NcAlarmBlocking, type NcAlarmBlockingEdit, type NcAlarmModeDelays,
9
9
  export type NcAlarmDelayField = 'exitDelaySec' | 'entryDelaySec' | 'triggeredDurationSec';
10
10
  export declare const NC_ALARM_DELAY_FIELDS: readonly NcAlarmDelayField[];
11
11
  export type NcAlarmDelaySource = 'mode' | 'default';
12
+ /**
13
+ * The STOCK after-trigger duration a panel seeds and every mode inherits unless it sets its
14
+ * own (D706: 30 s, was 10 s under D701). Only the seed: a persisted value is never rewritten.
15
+ * The panel's defaults, its one-shot migration and the admin UI's "pick a timed action" fill
16
+ * all read this one constant.
17
+ */
18
+ export declare const NC_ALARM_DEFAULT_TRIGGERED_DURATION_SEC = 30;
19
+ /** The per-mode notification switches (D706), both off unless the mode sets them. */
20
+ export type NcAlarmNotifyField = 'notifyDuringEntryDelay' | 'notifySensorRewatched';
21
+ export declare const NC_ALARM_NOTIFY_FIELDS: readonly NcAlarmNotifyField[];
22
+ /** What one mode's notification switches resolve to (D706). */
23
+ export interface NcAlarmModeNotifyPolicy {
24
+ /** The alarm rules' own pushes go out during this mode's entry delay. */
25
+ readonly notifyDuringEntryDelay: boolean;
26
+ /** A bypassed sensor that rejoins the watch is announced. */
27
+ readonly notifySensorRewatched: boolean;
28
+ }
29
+ /**
30
+ * The switches `mode` runs on. There is no global value: absent is OFF (operator decision
31
+ * 2026-10-06 — the entry-delay notification is the only one by default, and "watched again"
32
+ * is not sent). An answer from an older hub carries no switch and reads as off.
33
+ */
34
+ export declare function resolveModeNotifyPolicy(settings: {
35
+ readonly modeDelays?: readonly NcAlarmModeDelays[];
36
+ }, mode: AlarmArmMode): NcAlarmModeNotifyPolicy;
12
37
  /**
13
38
  * Derive the post-triggered action from a stored blob that may predate the field:
14
39
  * a positive duration meant re-arm; zero/absent meant stay triggered.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/types",
3
- "version": "1.2.304",
3
+ "version": "1.2.305",
4
4
  "description": "Shared types, interfaces, and model catalogs for the CamStack detection ecosystem",
5
5
  "keywords": [
6
6
  "camstack",