@camstack/addon-model-studio 1.1.187 → 1.1.189

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 (18) hide show
  1. package/dist/{MotionZonesSettings-Ctu2jUw5.mjs → MotionZonesSettings-FMiMjTOe.mjs} +2 -2
  2. package/dist/{PrivacyMaskSettings-BklhxSXj.mjs → PrivacyMaskSettings-C54kjXje.mjs} +4 -4
  3. package/dist/{SceneMonitorEditor-BZRgxah0.mjs → SceneMonitorEditor-D3mHd1Bs.mjs} +3 -3
  4. package/dist/_stub.js +12 -11
  5. package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_model_studio_page-CVGJSgs1.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_model_studio_page-DRuIjSMF.mjs} +3 -3
  6. package/dist/_virtual_mf___mfe_internal__addon_model_studio_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-C8mPXBuv.mjs +26 -0
  7. package/dist/{hostInit-D34VXjYA.mjs → hostInit-CWX7SB3f.mjs} +2 -2
  8. package/dist/model-studio.addon.js +234 -101
  9. package/dist/model-studio.addon.mjs +234 -101
  10. package/dist/{player-overlays-WyG3CO8M.mjs → player-overlays-BR1a0BDm.mjs} +1 -1
  11. package/dist/remoteEntry.js +1 -1
  12. package/dist/{responsive-DM13bMuN.mjs → responsive-BoGo5jZn.mjs} +1 -1
  13. package/dist/{scene-monitor-copy-NEMFgUTn.mjs → scene-monitor-copy-0evm2MrA.mjs} +1 -1
  14. package/dist/{square-BI5Xsmdj.mjs → square-NiMmxe53.mjs} +1 -1
  15. package/dist/{trash-2-D1YC9gXH.mjs → trash-2-DD3Sx3hW.mjs} +1 -1
  16. package/dist/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_model_studio_page__remoteEntry_js-C_9FXI-l.mjs → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_model_studio_page__remoteEntry_js-DM0hkCAJ.mjs} +1 -1
  17. package/package.json +1 -1
  18. package/dist/_virtual_mf___mfe_internal__addon_model_studio_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-a-ZV2LaP.mjs +0 -26
@@ -549,7 +549,7 @@ async function importScryptedCatalogModel(input, deps) {
549
549
  }
550
550
  }
551
551
  //#endregion
552
- //#region ../types/dist/event-category-C5xZWqz6.mjs
552
+ //#region ../types/dist/event-category-BGmz_oxW.mjs
553
553
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
554
554
  EventCategory["SystemBoot"] = "system.boot";
555
555
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -1082,6 +1082,15 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
1082
1082
  */
1083
1083
  EventCategory["PipelineAudioInferenceResult"] = "pipeline.audio-inference-result";
1084
1084
  EventCategory["DetectionPhaseTransition"] = "detection.phase-transition";
1085
+ /**
1086
+ * A camera provider's RAW onboard motion push (D673): the `MotionOnMotionChanged`
1087
+ * data shape without `triggeredBy`, built by `providerMotionEvent`. Its one
1088
+ * consumer is the orchestrator's camera-sensors bridge, which re-emits the
1089
+ * camera's EFFECTIVE onboard motion as `MotionOnMotionChanged` (a pass-through
1090
+ * for a camera with no attached sensor). Providers must not emit
1091
+ * `MotionOnMotionChanged` themselves; `scripts/check-onboard-motion-emitters.ts`
1092
+ * keeps it so (camera-grid is a named, deferred exception).
1093
+ */
1085
1094
  EventCategory["ProviderMotion"] = "provider.motion";
1086
1095
  EventCategory["ProviderDetection"] = "provider.detection";
1087
1096
  EventCategory["EnrichmentEmbeddingStored"] = "enrichment.embedding.stored";
@@ -5920,7 +5929,7 @@ var ZodIssueCode = {
5920
5929
  var ZodFirstPartyTypeKind;
5921
5930
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5922
5931
  //#endregion
5923
- //#region ../types/dist/sleep-gU6hqv4_.mjs
5932
+ //#region ../types/dist/sleep-CDCONfkt.mjs
5924
5933
  /**
5925
5934
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5926
5935
  * window to float samples (D455).
@@ -8030,7 +8039,7 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
8030
8039
  return DeviceRole;
8031
8040
  }({});
8032
8041
  //#endregion
8033
- //#region ../types/dist/composition-Dq42XWp0.mjs
8042
+ //#region ../types/dist/composition-43aqsZQj.mjs
8034
8043
  /**
8035
8044
  * The ffmpeg build every CamStack node downloads, per platform and arch.
8036
8045
  *
@@ -8087,13 +8096,12 @@ portable("linux64"), portable("linuxarm64"), portable("macarm64"), portable("mac
8087
8096
  * LA tabella "quale booleano di questo tipo di device conta come ALTO", e il
8088
8097
  * valutatore puro del suo FRONTE.
8089
8098
  *
8090
- * Viveva dentro il builtin virtual-doorbell
8091
- * (`@camstack/system` — `builtins/doorbell/trigger-engine.ts`) e i suoi
8092
- * predicati erano privati al modulo. Il recorder ne ha bisogno per il trigger
8093
- * `RecordingTriggers.sensorDeviceIds`: copiarla avrebbe creato la SECONDA
8094
- * tabella, che diverge alla prima cap aggiunta e il cui sintomo — "il sensore
8095
- * fa suonare il campanello ma non registra" — è esattamente D62. Quindi si
8096
- * SPOSTA qui e il doorbell la ri-esporta.
8099
+ * UNA tabella per tutti quelli che chiedono "questo device è ALTO?": il
8100
+ * trigger `RecordingTriggers.sensorDeviceIds` del recorder, i marker dei
8101
+ * sensori della post-analysis, il bridge camera-sensors dell'orchestratore e
8102
+ * le sorgenti di un campanello composto (`doorbellFeatureSources`, D671).
8103
+ * Una seconda copia divergerebbe alla prima cap aggiunta, e il sintomo — "il
8104
+ * sensore fa suonare il campanello ma non registra" — è esattamente D62.
8097
8105
  *
8098
8106
  * ⚠ NON è `DEVICE_STATE_READERS` (`catalogs/device-state-vocabulary.ts`), e le
8099
8107
  * due non vanno unificate: quella risponde a "qual è la PAROLA di stato per una
@@ -9828,7 +9836,7 @@ var RecordingTriggersSchema = object({
9828
9836
  *
9829
9837
  * Cosa vuol dire "alto" dipende dal TIPO di device e non è deciso qui:
9830
9838
  * `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) è LA tabella,
9831
- * la stessa che il virtual-doorbell usa dal 2026-08-05. Ed è il FRONTE, non
9839
+ * la stessa del campanello composto (D671). Ed è il FRONTE, non
9832
9840
  * il livello: un contatto trovato già aperto al riavvio del runner non fa
9833
9841
  * registrare.
9834
9842
  */
@@ -15948,28 +15956,10 @@ method(object({
15948
15956
  deviceIds: array(number()).readonly(),
15949
15957
  caps: array(string()).readonly().optional()
15950
15958
  }), record(string(), record(string(), unknown().nullable())));
15951
- object({
15952
- /** Ms epoch of the last press. null = never observed since this provider started. */
15953
- lastPressedAt: number().nullable(),
15954
- /** Counter since provider start. Resets on reboot. Useful for metrics/debug. */
15955
- pressCountSinceStart: number()
15956
- });
15957
- object({
15958
- deviceId: number(),
15959
- timestamp: number()
15960
- });
15961
- /**
15962
- * The `doorbell-source` extension slot's editable value (D648): the camera's
15963
- * virtual-doorbell trigger devices, exactly what the wrapper's
15964
- * `doorbellSources` persists (as `{ deviceId }` records).
15965
- */
15966
- var DoorbellSourceSlotValueSchema = object({ deviceIds: array(number().int().positive()) });
15959
+ var ExtensionSlotIdSchema = _enum(["linked-devices"]);
15967
15960
  DeviceType.Camera;
15968
- DeviceType.Button, DeviceType.Camera;
15969
- var ExtensionSlotIdSchema = _enum(["doorbell-source", "linked-devices"]);
15970
- DeviceType.Camera, DeviceType.Camera;
15971
15961
  /** A slot's editable value, discriminated on `slot`. */
15972
- var ExtensionSlotValueSchema = discriminatedUnion("slot", [DoorbellSourceSlotValueSchema.extend({ slot: literal("doorbell-source") }), LinkedDevicesSlotValueSchema.extend({ slot: literal("linked-devices") })]);
15962
+ var ExtensionSlotValueSchema = discriminatedUnion("slot", [LinkedDevicesSlotValueSchema.extend({ slot: literal("linked-devices") })]);
15973
15963
  DeviceType.Camera;
15974
15964
  var ExtensionSourceAvailabilitySchema = discriminatedUnion("state", [object({ state: literal("ok") }), object({
15975
15965
  state: literal("unreachable"),
@@ -16006,10 +15996,11 @@ var ExtensionSlotSourceSchema = object({
16006
15996
  });
16007
15997
  /**
16008
15998
  * A DIFFERENT authority that gates whether the slot's sources do anything —
16009
- * reported read-only, named, never written through this contract (D62). The
16010
- * virtual doorbell's sources ring only while the wrapper is bound to the
16011
- * camera, and that binding belongs to `deviceManager.setWrapperActive`.
16012
- * `unknown` means the gate could not be read; it is not "inactive" (D315).
15999
+ * reported read-only, named, never written through this contract (D62) — e.g.
16000
+ * a slot whose sources act only while a wrapper is bound to the host, a
16001
+ * binding that belongs to `deviceManager.setWrapperActive`. No slot reports
16002
+ * one today (`linked-devices` answers `null`). `unknown` means the gate could
16003
+ * not be read; it is not "inactive" (D315).
16013
16004
  */
16014
16005
  var ExtensionSlotActivationSchema = object({
16015
16006
  state: _enum([
@@ -16025,7 +16016,7 @@ var ExtensionSlotRowSchema = discriminatedUnion("state", [object({
16025
16016
  /** `<source>:<slotId>` — the routing key for `listCandidates` / `setSlot`. */
16026
16017
  slotRef: string(),
16027
16018
  slot: ExtensionSlotIdSchema,
16028
- /** Names the store written (D62), e.g. `virtual-doorbell:doorbellSources`. */
16019
+ /** Names the store written (D62), e.g. `device-manager:_linkedDeviceIds`. */
16029
16020
  authority: string(),
16030
16021
  activation: ExtensionSlotActivationSchema.nullable(),
16031
16022
  value: ExtensionSlotValueSchema,
@@ -20516,6 +20507,29 @@ object({
20516
20507
  firstAt: number(),
20517
20508
  lastAt: number()
20518
20509
  });
20510
+ var NC_ALARM_TRIGGERED_MAX_SEC = 3600;
20511
+ var NcAlarmDelaySecSchema = number().int().min(0).max(600);
20512
+ var NcAlarmTriggeredSecSchema = number().int().min(0).max(NC_ALARM_TRIGGERED_MAX_SEC);
20513
+ var uniqueModes = (entries) => new Set(entries.map((e) => e.mode)).size === entries.length;
20514
+ var NcAlarmModeDelaysListSchema = array(object({
20515
+ mode: AlarmArmModeSchema,
20516
+ exitDelaySec: NcAlarmDelaySecSchema.optional(),
20517
+ entryDelaySec: NcAlarmDelaySecSchema.optional(),
20518
+ triggeredDurationSec: NcAlarmTriggeredSecSchema.optional()
20519
+ })).max(8).refine(uniqueModes, { message: "modeDelays: at most one entry per arm mode" });
20520
+ var NcAlarmModeDelaysEditListSchema = array(object({
20521
+ mode: AlarmArmModeSchema,
20522
+ exitDelaySec: NcAlarmDelaySecSchema.nullable().optional(),
20523
+ entryDelaySec: NcAlarmDelaySecSchema.nullable().optional(),
20524
+ triggeredDurationSec: NcAlarmTriggeredSecSchema.nullable().optional()
20525
+ })).max(8).refine(uniqueModes, { message: "modeDelays: at most one edit per arm mode" });
20526
+ /** One switch of the alarm table: put ONE device on, or take it off, ONE mode's list. */
20527
+ var NcAlarmNonBlockingEditSchema = object({
20528
+ mode: AlarmArmModeSchema,
20529
+ deviceId: number().int().positive(),
20530
+ /** true = on the list (may be open, does not block); false = off the list (blocks). */
20531
+ nonBlocking: boolean()
20532
+ });
20519
20533
  /**
20520
20534
  * The per-mode lists, at most one per mode. Two lists for one mode have no
20521
20535
  * meaning a reader could agree on (union? the last one?), so they are refused
@@ -20524,10 +20538,10 @@ object({
20524
20538
  var NcAlarmNonBlockingListSchema = array(object({
20525
20539
  mode: AlarmArmModeSchema,
20526
20540
  deviceIds: array(number().int()).max(200)
20527
- })).max(8).refine((lists) => new Set(lists.map((l) => l.mode)).size === lists.length, { message: "nonBlocking: at most one list per arm mode" });
20541
+ })).max(8).refine(uniqueModes, { message: "nonBlocking: at most one list per arm mode" });
20528
20542
  /**
20529
- * The three durations the panel's state machine runs on, who hears about its
20530
- * transitions, and which openings each mode tolerates.
20543
+ * The three durations — global, and per mode since D697 — the panel's state
20544
+ * machine runs on, who hears about its transitions, and which openings each mode tolerates.
20531
20545
  *
20532
20546
  * They live on the NOTIFICATION-RULES cap, not on `alarm-panel`, on purpose:
20533
20547
  * `alarm-panel` is `deviceNative` and its other provider mirrors somebody
@@ -20537,15 +20551,15 @@ var NcAlarmNonBlockingListSchema = array(object({
20537
20551
  */
20538
20552
  var NcAlarmSettingsSchema = object({
20539
20553
  /** Grace period between arming and the mode taking effect. 0 = immediate. */
20540
- exitDelaySec: number().int().min(0).max(600),
20554
+ exitDelaySec: NcAlarmDelaySecSchema,
20541
20555
  /** Grace period between a trigger and the alarm firing. 0 = immediate. */
20542
- entryDelaySec: number().int().min(0).max(600),
20556
+ entryDelaySec: NcAlarmDelaySecSchema,
20543
20557
  /**
20544
20558
  * How long `triggered` lasts before the panel re-arms itself.
20545
20559
  * **0 = until an operator disarms it** — the behaviour before this field
20546
20560
  * existed, and therefore what an untouched install keeps doing.
20547
20561
  */
20548
- triggeredDurationSec: number().int().min(0).max(3600),
20562
+ triggeredDurationSec: NcAlarmTriggeredSecSchema,
20549
20563
  /**
20550
20564
  * Deprecated by D630 — every transition is announced. Parsed, never read;
20551
20565
  * remove after one release. Optional so an older admin's patch (which still
@@ -20568,17 +20582,30 @@ var NcAlarmSettingsSchema = object({
20568
20582
  * per mode is meaningful. Defaulted to `[]` so a blob stored before D630
20569
20583
  * parses as "every opening blocks" — the behaviour it was written under.
20570
20584
  */
20571
- nonBlocking: NcAlarmNonBlockingListSchema.default([])
20585
+ nonBlocking: NcAlarmNonBlockingListSchema.default([]),
20586
+ /**
20587
+ * Per arm mode, the delays that mode OVERRIDES (D697). A mode with no entry, or an entry
20588
+ * without a field, uses the global value above — so `[]`, the default, is exactly the
20589
+ * behaviour of a blob stored before this field existed. Read through `resolveModeDelays`.
20590
+ */
20591
+ modeDelays: NcAlarmModeDelaysListSchema.default([])
20572
20592
  });
20573
20593
  /**
20574
20594
  * Every field optional — a tab edits one control at a time.
20575
20595
  *
20576
- * `nonBlocking` is re-declared WITHOUT its default: `.partial()` does not
20577
- * remove an inner `.default()`, so a patch that never named the field would
20578
- * parse to `nonBlocking: []` and wipe every mode's list on an unrelated edit
20579
- * (the same trap {@link NcRulePatchSchema} documents).
20596
+ * `nonBlocking` and `modeDelays` are re-declared WITHOUT their defaults:
20597
+ * `.partial()` does not remove an inner `.default()`, so a patch that never
20598
+ * named the field would parse to `[]` and wipe every mode's list on an
20599
+ * unrelated edit (the same trap {@link NcRulePatchSchema} documents). Here
20600
+ * `modeDelays` means EDITS, not the stored overrides.
20580
20601
  */
20581
- var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.extend({ nonBlocking: NcAlarmNonBlockingListSchema }).partial();
20602
+ var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.extend({
20603
+ nonBlocking: NcAlarmNonBlockingListSchema,
20604
+ /** Per-mode, per-field edits — NOT the whole list (see NcAlarmModeDelaysEditSchema). */
20605
+ modeDelays: NcAlarmModeDelaysEditListSchema,
20606
+ /** ONE membership change; the panel applies it to the list it holds at its turn. */
20607
+ nonBlockingEdit: NcAlarmNonBlockingEditSchema
20608
+ }).partial().refine((p) => p.nonBlocking === void 0 || p.nonBlockingEdit === void 0, { message: "nonBlocking and nonBlockingEdit are exclusive — send the whole lists or one edit" });
20582
20609
  /**
20583
20610
  * What one arm mode actually arms, DERIVED from the enabled rules gated on it.
20584
20611
  * Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
@@ -20678,6 +20705,28 @@ var NcAlarmConfigSchema = object({
20678
20705
  */
20679
20706
  live: NcAlarmLiveSchema.optional()
20680
20707
  });
20708
+ var NcAlarmSensorReadingSchema = _enum([
20709
+ "open",
20710
+ "closed",
20711
+ "unknown",
20712
+ "not-opening"
20713
+ ]);
20714
+ /** One device's state as the alarm reads it — the classifier the arm check uses. */
20715
+ var NcAlarmSensorStateSchema = object({
20716
+ deviceId: number().int().positive(),
20717
+ reading: NcAlarmSensorReadingSchema,
20718
+ /** The word as read (`open`, `closed`, `unlocked`, `stopped`, …); null when unknown / not an opening. */
20719
+ state: string().nullable(),
20720
+ /** Why `unknown`: the read failed, or the slice holds no word its cap defines (a placeholder included). */
20721
+ unknownWhy: _enum(["read-failed", "unknown-word"]).nullable(),
20722
+ /** The device manager's liveness as the centre mirrors it; null = not known. */
20723
+ online: boolean().nullable()
20724
+ });
20725
+ var NcAlarmSensorsInputSchema = object({ deviceIds: array(number().int().positive()).max(500) });
20726
+ var NcAlarmSensorsSchema = object({
20727
+ sensors: array(NcAlarmSensorStateSchema),
20728
+ readAt: number().int().nonnegative()
20729
+ });
20681
20730
  /**
20682
20731
  * ONE rule's demand on ONE camera's clip ring.
20683
20732
  *
@@ -20768,7 +20817,7 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
20768
20817
  }), method(object({}), NcAlarmConfigSchema, { auth: "admin" }), method(object({ patch: NcAlarmSettingsPatchSchema }), NcAlarmConfigSchema, {
20769
20818
  kind: "mutation",
20770
20819
  auth: "admin"
20771
- });
20820
+ }), method(NcAlarmSensorsInputSchema, NcAlarmSensorsSchema, { auth: "admin" });
20772
20821
  /**
20773
20822
  * Zod schemas for persisted record types.
20774
20823
  *
@@ -21115,12 +21164,26 @@ var CameraSensorRefSchema = object({
21115
21164
  function cameraSensorRefKey(ref) {
21116
21165
  return `${ref.addonId}/${ref.stableId}`;
21117
21166
  }
21118
- /** CS-1 accepts exactly one mode; CS-2 (D673) widens it to confirm / replace. */
21119
- var CameraSensorsModeSchema = _enum(["in-addition"]);
21120
- var CameraSensorsConfigSchema = object({
21121
- mode: CameraSensorsModeSchema,
21122
- sensors: array(CameraSensorRefSchema).min(1).max(8)
21123
- }).superRefine((value, ctx) => {
21167
+ /**
21168
+ * A sensor's mode (D673). `in-addition`: its motion is the camera's motion too.
21169
+ * `replace`: its motion is the camera's, and while one is READY the camera's
21170
+ * own motion no longer counts on its own. `confirm`: while one is READY the
21171
+ * camera's own motion counts only while a confirm sensor is active — with or
21172
+ * without a replace sensor (spec C2, the controller's ruling on Q1).
21173
+ */
21174
+ var CameraSensorModeSchema = _enum([
21175
+ "in-addition",
21176
+ "confirm",
21177
+ "replace"
21178
+ ]);
21179
+ /** A stored sensor with no mode — every CS-1 row — is in addition. */
21180
+ var DEFAULT_CAMERA_SENSOR_MODE = "in-addition";
21181
+ /**
21182
+ * A camera's attached sensors. A CS-1 row carried an envelope
21183
+ * `mode: 'in-addition'`: `z.object` drops it on parse, and the PARSED value is
21184
+ * what the write stores (D672 rule 3), so it is never written again.
21185
+ */
21186
+ var CameraSensorsConfigSchema = object({ sensors: array(CameraSensorRefSchema.extend({ mode: CameraSensorModeSchema.default(DEFAULT_CAMERA_SENSOR_MODE) })).min(1).max(8) }).superRefine((value, ctx) => {
21124
21187
  const seen = /* @__PURE__ */ new Set();
21125
21188
  value.sensors.forEach((ref, index) => {
21126
21189
  const key = cameraSensorRefKey(ref);
@@ -21132,39 +21195,41 @@ var CameraSensorsConfigSchema = object({
21132
21195
  seen.add(key);
21133
21196
  });
21134
21197
  });
21135
- var RefFields = {
21198
+ /** Every attachment names its mode; an older orchestrator that does not is in addition. */
21199
+ var AttachmentFields = {
21136
21200
  addonId: string(),
21137
- stableId: string()
21201
+ stableId: string(),
21202
+ mode: CameraSensorModeSchema.default(DEFAULT_CAMERA_SENSOR_MODE)
21138
21203
  };
21139
21204
  var CameraSensorAttachmentSchema = discriminatedUnion("state", [
21140
21205
  object({
21141
- ...RefFields,
21206
+ ...AttachmentFields,
21142
21207
  state: literal("ready"),
21143
21208
  deviceId: number(),
21144
21209
  name: string(),
21145
21210
  caps: array(string()).readonly()
21146
21211
  }),
21147
21212
  object({
21148
- ...RefFields,
21213
+ ...AttachmentFields,
21149
21214
  state: literal("offline"),
21150
21215
  deviceId: number(),
21151
21216
  name: string(),
21152
21217
  reason: _enum(["offline", "disabled"])
21153
21218
  }),
21154
21219
  object({
21155
- ...RefFields,
21220
+ ...AttachmentFields,
21156
21221
  state: literal("missing"),
21157
21222
  reason: string()
21158
21223
  }),
21159
21224
  object({
21160
- ...RefFields,
21225
+ ...AttachmentFields,
21161
21226
  state: literal("unsupported"),
21162
21227
  deviceId: number(),
21163
21228
  name: string(),
21164
21229
  reason: string()
21165
21230
  }),
21166
21231
  object({
21167
- ...RefFields,
21232
+ ...AttachmentFields,
21168
21233
  state: literal("unreadable"),
21169
21234
  reason: string()
21170
21235
  })
@@ -21177,17 +21242,49 @@ var CameraSensorAttachmentSchema = discriminatedUnion("state", [
21177
21242
  * say.
21178
21243
  */
21179
21244
  var CameraSensorsNotForwardedSchema = _enum(["onboard-not-listed", "no-active-detection"]);
21245
+ /** Whether the camera's OWN motion counts on its own (D673 C2), from its READY sensors (C3). */
21246
+ var CameraOwnMotionSchema = _enum([
21247
+ "always",
21248
+ "when-confirmed",
21249
+ "never"
21250
+ ]);
21251
+ /** Confirm / Replace cannot suppress this camera's motion: its provider still emits it directly (D673 C13). */
21252
+ var CameraSensorsNotEnforcedSchema = _enum(["provider-not-split"]);
21253
+ /**
21254
+ * The camera's OWN onboard motion (D696): the raw input the bridge combines,
21255
+ * never the effective value. The camera's `motion` slice is the effective one,
21256
+ * so a view of the camera's own row reads this.
21257
+ * - `atMs`: when the bridge received the camera's last own edge.
21258
+ * - `detected`: evaluated WHEN THE STATUS IS ASKED — the last edge said `true`
21259
+ * AND it is younger than the window the bridge counts the camera's own motion
21260
+ * for (`motionCooldownMs`, floored at two sustain ticks). A camera that never
21261
+ * sends a clear (heartbeats only) therefore reads `false` once no push came
21262
+ * within the window; a status read is a snapshot, so a live view re-asks.
21263
+ * Absent = this orchestrator has not received the camera's own motion since it
21264
+ * started (unknown, never "quiet"), or an orchestrator older than D696.
21265
+ */
21266
+ var CameraRawLevelSchema = object({
21267
+ detected: boolean(),
21268
+ atMs: number()
21269
+ });
21180
21270
  var CameraSensorsStatusSchema = discriminatedUnion("state", [
21181
- object({ state: literal("not-configured") }),
21271
+ object({
21272
+ state: literal("not-configured"),
21273
+ cameraLevel: CameraRawLevelSchema.optional()
21274
+ }),
21182
21275
  object({
21183
21276
  state: literal("unreadable"),
21184
- reason: string()
21277
+ reason: string(),
21278
+ cameraLevel: CameraRawLevelSchema.optional()
21185
21279
  }),
21186
21280
  object({
21187
21281
  state: literal("configured"),
21188
- mode: CameraSensorsModeSchema,
21282
+ cameraLevel: CameraRawLevelSchema.optional(),
21189
21283
  sensors: array(CameraSensorAttachmentSchema).readonly(),
21190
- notForwarded: CameraSensorsNotForwardedSchema.optional()
21284
+ /** Absent = an orchestrator older than CS-2: it does not say (D315). */
21285
+ cameraMotion: CameraOwnMotionSchema.optional(),
21286
+ notForwarded: CameraSensorsNotForwardedSchema.optional(),
21287
+ notEnforced: CameraSensorsNotEnforcedSchema.optional()
21191
21288
  })
21192
21289
  ]);
21193
21290
  Object.freeze({
@@ -24378,8 +24475,10 @@ var RunnerCameraConfigSchema = object({
24378
24475
  * - `analyzer`: ML/frame-diff motion detection (motion-wasm or other
24379
24476
  * analyzer providers) running on decoded frames in this runner.
24380
24477
  * - `onboard`: camera-native motion pushes (Reolink Baichuan, ONVIF
24381
- * analytics). The provider emits ProviderMotion
24382
- * events; the orchestrator forwards to `reportMotion`.
24478
+ * analytics). The provider emits its raw push as `ProviderMotion`
24479
+ * (D673); the orchestrator's camera-sensors bridge re-emits the camera's
24480
+ * effective motion as `MotionOnMotionChanged`, which is what reaches
24481
+ * `reportMotion`.
24383
24482
  */
24384
24483
  motionSources: MotionSourcesSchema.default(["analyzer"]),
24385
24484
  /**
@@ -24556,7 +24655,15 @@ var RunnerLocalLoadSchema = object({
24556
24655
  hasGpu: boolean(),
24557
24656
  inferenceBackend: string().optional(),
24558
24657
  cpuCores: number().optional()
24559
- })
24658
+ }),
24659
+ /**
24660
+ * Who writes a camera's `motion` runtime slice (D696). `'orchestrator'`: this
24661
+ * runner never writes it. ABSENT = a runner older than D696, which still
24662
+ * writes the slice from its phase machine; the orchestrator does not write
24663
+ * while any runner node is absent-or-unanswered, so one slice never has two
24664
+ * writers.
24665
+ */
24666
+ motionSliceWriter: literal("orchestrator").optional()
24560
24667
  });
24561
24668
  /**
24562
24669
  * Aggregate runtime metrics for the runner's whole local pool. Mirrors the
@@ -29397,6 +29504,17 @@ object({
29397
29504
  deviceId: number(),
29398
29505
  status: DeviceStatusSchema
29399
29506
  });
29507
+ object({
29508
+ /** Ms epoch of the last press. null = never observed since this provider started. */
29509
+ lastPressedAt: number().nullable(),
29510
+ /** Counter since provider start. Resets on reboot. Useful for metrics/debug. */
29511
+ pressCountSinceStart: number()
29512
+ });
29513
+ object({
29514
+ deviceId: number(),
29515
+ timestamp: number()
29516
+ });
29517
+ DeviceType.Button, DeviceType.Camera;
29400
29518
  /**
29401
29519
  * Enum-state sensor — a string value picked from a finite option set.
29402
29520
  * Drives HA `sensor` entries with `state_class: enum` (HVAC action
@@ -31041,9 +31159,9 @@ object({
31041
31159
  /** Ms epoch of the last detected-true observation. Null if never detected. */
31042
31160
  lastDetectedAt: number().nullable(),
31043
31161
  /**
31044
- * `MOTION_CLOSE_AFTER_MS` while `detected: true` on a `Camera` device,
31045
- * `null` while false and on every `Sensor` device (D475) — see that
31046
- * constant's doc for the one-authority rule.
31162
+ * `MOTION_CLOSE_AFTER_MS` while `detected: true` on a `Camera` device (the
31163
+ * orchestrator writes it, D696), `null` while false and on every `Sensor`
31164
+ * device (D475) — see that constant's doc for the one-authority rule.
31047
31165
  *
31048
31166
  * ## Reading this field still arms nothing
31049
31167
  *
@@ -31061,38 +31179,41 @@ object({
31061
31179
  * `addon-export-alexa/src/motion-clear-hold.ts` and
31062
31180
  * `addon-export-hap`'s `RESET_DEBOUNCE_MS` both do.
31063
31181
  *
31064
- * ## Who writes it
31065
- *
31066
- * - **Cameras** — the runner's phase machine, `active → watching` on
31067
- * `cooldown_expired`, which then writes this slice with
31068
- * `detected: false` (`handlePhaseChanged` in
31069
- * `pipeline-runner/index.ts`). It produces the FALLING edge, which
31070
- * matters most for the sources that only ever push a rising one:
31071
- * Reolink emits `MotionOnMotionChanged { detected: true }` and never
31072
- * a false.
31073
- * - **Sensors** (Home Assistant binary sensors, Homematic) — the
31074
- * provider pushes the false itself, from the upstream system's own
31075
- * state change. No phase machine is involved.
31076
- *
31077
- * ### The phase machine is CANONICAL, not sole — and that is a defect
31078
- *
31079
- * An earlier revision of this docblock (mine, 2026-09-12) claimed the
31080
- * phase machine is the sole writer for a camera. It is not.
31081
- * `hikvision-camera.ts:3464` and `amcrest-camera.ts:445` both call
31082
- * `setCapSlice(motionCapability, …)` on their own rising edge, and
31083
- * Hikvision's comment says why: it read THIS docblock, agreed the
31084
- * runner is canonical, and wrote anyway to avoid per-tick churn. So
31085
- * two authorities can disagree about one slice, which this repo
31086
- * forbids, and the doc said otherwise — which is worse than saying
31087
- * nothing, because it reads as verification.
31088
- *
31089
- * This predates D475 and is not fixed there: the fix touches every
31090
- * camera provider. Recorded in D475's Consequences. Do not restore the
31091
- * "sole writer" wording without also removing the other writers.
31182
+ * ## Who writes it (D696)
31183
+ *
31184
+ * - **Cameras** — the orchestrator, and nothing else. It writes the camera's
31185
+ * EFFECTIVE motion (`addon-pipeline-orchestrator`
31186
+ * `camera-sensors/motion-slice.ts`), alongside the effective
31187
+ * `MotionOnMotionChanged` it emits or receives: the camera-sensors bridge
31188
+ * for a split camera, an unsplit emitter's direct event, the analyzer and
31189
+ * device activity, as the camera's `motionSources` counts them. A source
31190
+ * that never sends a clear falls one window after its last `true`.
31191
+ * `lastDetectedAt` moves only on an effective rise. No camera provider
31192
+ * writes this slice (not even a boot seed), and neither does the runner's
31193
+ * phase machine: its phase is "a session is attached" for every on-motion
31194
+ * session, not motion, and it now has its own `DetectionPhaseTransition`.
31195
+ * A provider's `isDetected` answers from the hub's slice.
31196
+ * - **Sensors** (Home Assistant binary sensors, Homematic, Matter, Alexa
31197
+ * imports) — the provider pushes both edges itself, from the upstream
31198
+ * system's own state change. That is the sensor's own fact.
31199
+ *
31200
+ * `scripts/check-onboard-motion-emitters.ts` refuses any other writer of a
31201
+ * `motion` slice; each sensor writer is a named exemption.
31202
+ *
31203
+ * This replaces the D475 §4 rule ("the phase machine is the sole writer").
31204
+ * That rule was never true: Hikvision and Amcrest wrote the slice raw beside
31205
+ * it, every provider seeded it at boot, and every session left it
31206
+ * `detected: true` after its detach.
31092
31207
  */
31093
31208
  autoClearAfterMs: number().nullable()
31094
31209
  });
31095
- object({
31210
+ /**
31211
+ * Payload of `motion.onMotionChanged` event + the corresponding bus
31212
+ * event `EventCategory.MotionOnMotionChanged`. Single source of truth
31213
+ * — both the cap event surface and the bus payload type alias to this
31214
+ * schema.
31215
+ */
31216
+ var MotionOnMotionChangedDataSchema = object({
31096
31217
  deviceId: number(),
31097
31218
  detected: boolean(),
31098
31219
  timestamp: number(),
@@ -41151,6 +41272,12 @@ Object.freeze({
41151
41272
  addonId: null,
41152
41273
  access: "view"
41153
41274
  },
41275
+ "notificationRules.getAlarmSensors": {
41276
+ capName: "notification-rules",
41277
+ capScope: "system",
41278
+ addonId: null,
41279
+ access: "view"
41280
+ },
41154
41281
  "notificationRules.getClipRetentionAsks": {
41155
41282
  capName: "notification-rules",
41156
41283
  capScope: "system",
@@ -45634,6 +45761,11 @@ Object.freeze({
45634
45761
  form: "single",
45635
45762
  optional: false
45636
45763
  }],
45764
+ "notificationRules.getAlarmSensors": [{
45765
+ name: "deviceIds",
45766
+ form: "array",
45767
+ optional: false
45768
+ }],
45637
45769
  "notificationRules.setDeviceMuted": [{
45638
45770
  name: "deviceId",
45639
45771
  form: "single",
@@ -47569,6 +47701,7 @@ TimelapseRuleInputSchema.extend({
47569
47701
  createdAt: number(),
47570
47702
  updatedAt: number()
47571
47703
  });
47704
+ MotionOnMotionChangedDataSchema.omit({ triggeredBy: true });
47572
47705
  object({
47573
47706
  /**
47574
47707
  * Fraction of the box's own size added on EACH side before cutting.
@@ -1,5 +1,5 @@
1
1
  import { h as e, l as t, u as n, y as r } from "./_virtual_mf___mfe_internal__addon_model_studio_page__loadShare__react__loadShare__.js-DJDHChgO.mjs";
2
- import { o as i, s as a } from "./responsive-DM13bMuN.mjs";
2
+ import { o as i, s as a } from "./responsive-BoGo5jZn.mjs";
3
3
  import { n as o, r as s, t as c } from "./_virtual_mf___mfe_internal__addon_model_studio_page__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-ds_Ehzaa.mjs";
4
4
  var l = a("chevron-down", [["path", {
5
5
  d: "m6 9 6 6 6-6",
@@ -1,2 +1,2 @@
1
- import { n as e, t } from "./virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_model_studio_page__remoteEntry_js-C_9FXI-l.mjs";
1
+ import { n as e, t } from "./virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_model_studio_page__remoteEntry_js-DM0hkCAJ.mjs";
2
2
  export { t as get, e as init };
@@ -1,6 +1,6 @@
1
1
  import { c as e, g as t, h as n, l as r, n as i, p as a, r as o, t as s, u as c, y as l } from "./_virtual_mf___mfe_internal__addon_model_studio_page__loadShare__react__loadShare__.js-DJDHChgO.mjs";
2
2
  import "./_virtual_mf___mfe_internal__addon_model_studio_page__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-ds_Ehzaa.mjs";
3
- import { n as u } from "./_virtual_mf___mfe_internal__addon_model_studio_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-a-ZV2LaP.mjs";
3
+ import { n as u } from "./_virtual_mf___mfe_internal__addon_model_studio_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-C8mPXBuv.mjs";
4
4
  //#region ../../node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.js
5
5
  l();
6
6
  var d = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), f = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), p = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), m = (e) => {
@@ -1,5 +1,5 @@
1
1
  import { c as e, h as t, p as n, y as r } from "./_virtual_mf___mfe_internal__addon_model_studio_page__loadShare__react__loadShare__.js-DJDHChgO.mjs";
2
- import { s as i } from "./responsive-DM13bMuN.mjs";
2
+ import { s as i } from "./responsive-BoGo5jZn.mjs";
3
3
  var a = i("camera", [["path", {
4
4
  d: "M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",
5
5
  key: "18u6gg"
@@ -1,4 +1,4 @@
1
- import { s as e } from "./responsive-DM13bMuN.mjs";
1
+ import { s as e } from "./responsive-BoGo5jZn.mjs";
2
2
  var t = e("eye-off", [
3
3
  ["path", {
4
4
  d: "M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",
@@ -1,4 +1,4 @@
1
- import { s as e } from "./responsive-DM13bMuN.mjs";
1
+ import { s as e } from "./responsive-BoGo5jZn.mjs";
2
2
  var t = e("trash-2", [
3
3
  ["path", {
4
4
  d: "M10 11v6",
@@ -2753,7 +2753,7 @@ async function rr(e) {
2753
2753
  }
2754
2754
  }
2755
2755
  async function ir() {
2756
- return tr ||= rr(() => import("./_virtual_mf-localSharedImportMap___mfe_internal__addon_model_studio_page-CVGJSgs1.mjs")).catch((e) => {
2756
+ return tr ||= rr(() => import("./_virtual_mf-localSharedImportMap___mfe_internal__addon_model_studio_page-DRuIjSMF.mjs")).catch((e) => {
2757
2757
  throw tr = void 0, e;
2758
2758
  }), tr;
2759
2759
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-model-studio",
3
- "version": "1.1.187",
3
+ "version": "1.1.189",
4
4
  "description": "Custom detection model registry, conversion & distribution for CamStack",
5
5
  "keywords": [
6
6
  "camstack",