@camstack/addon-provider-petkit 0.2.75 → 0.2.77

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/dist/addon.js CHANGED
@@ -8951,17 +8951,29 @@ var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
8951
8951
  /**
8952
8952
  * DERIVED per-camera storage summary — the single field cheap consumers read
8953
8953
  * (the viewer's status dot, the camera list) instead of walking `bands`:
8954
- * - `off` — no band covers the camera (or it is disabled).
8955
- * - `events` — every band records around triggers only.
8956
- * - `continuous` — at least one band records continuously.
8957
- *
8958
- * NEVER authored: the recorder stamps it from the authoritative `bands` on
8959
- * every save (`activeModeForConfig`). Writing it has no effect.
8954
+ * - `off` — no band covers the camera (or it is disabled).
8955
+ * - `events` — every band records around triggers only.
8956
+ * - `continuous` — at least one band records continuously.
8957
+ * - `on-device-decision`— the DEVICE decides: recording runs for as long as the
8958
+ * camera raises its own `recording-signal` level (a robot that cleans). There
8959
+ * is no schedule to author, because there is no hour to program — see
8960
+ * {@link RecordingConfigSchema}`.deviceDecision`.
8961
+ *
8962
+ * NEVER authored: the recorder stamps it from the authoritative intent
8963
+ * (`bands` + `deviceDecision`) on every save (`activeModeForConfig`). Writing it
8964
+ * has no effect.
8965
+ *
8966
+ * `on-device-decision` is named for WHO decides, not for how the recording is
8967
+ * requested. `on-demand` was rejected: in this repo's vocabulary a "demand" is
8968
+ * something the operator makes (the live gate is the recorder's own "demand
8969
+ * window"), and a knob whose name suggests the operator starts it while the
8970
+ * device actually does is the D62 shape — a control nobody can predict.
8960
8971
  */
8961
8972
  var RecordingStorageModeSchema = _enum([
8962
8973
  "off",
8963
8974
  "events",
8964
- "continuous"
8975
+ "continuous",
8976
+ "on-device-decision"
8965
8977
  ]);
8966
8978
  /**
8967
8979
  * Le macro classi che possono aprire una finestra di registrazione — le stesse
@@ -9011,22 +9023,7 @@ var RecordingTriggersSchema = object({
9011
9023
  * il livello: un contatto trovato già aperto al riavvio del runner non fa
9012
9024
  * registrare.
9013
9025
  */
9014
- sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional(),
9015
- /**
9016
- * La camera registra per tutta la durata del SEGNALE che lei stessa
9017
- * pubblica — la cap `recording-signal` (`active: true` mentre il device è in
9018
- * funzione: un robot che pulisce). È un LIVELLO, non un fronte: la finestra
9019
- * resta aperta finché il segnale è alto e si chiude `postBufferSec` dopo la
9020
- * caduta, così una pulizia di quaranta minuti è UNA clip.
9021
- *
9022
- * Non nomina un device: il segnale è della camera stessa, tenuto fresco dal
9023
- * suo provider (D224); il recorder lo ascolta su `DeviceStateChanged` e lo
9024
- * riconcilia leggendo la slice via RPC, con un tetto oltre il quale un
9025
- * segnale mai abbassato (un evento perso) non può tenere aperta una
9026
- * registrazione (D11). Vedi `recorder/addon/band-decision.ts`
9027
- * (`holdTrigger` / `releaseTrigger`).
9028
- */
9029
- deviceSignal: boolean().optional()
9026
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
9030
9027
  });
9031
9028
  /**
9032
9029
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -9056,13 +9053,28 @@ var RecordingBandSchema = object({
9056
9053
  end: string().regex(HHMM),
9057
9054
  mode: RecordingBandModeSchema,
9058
9055
  triggers: RecordingBandTriggersSchema.optional(),
9056
+ /**
9057
+ * RETIRED (D381). A band no longer carries a pre-buffer of its own.
9058
+ *
9059
+ * It was the retroactive KEEP bound — which already-written segments survive
9060
+ * a trigger — and it had to be at least as wide as the widest pre-roll the
9061
+ * broker could serve, or the gate would delete the seconds the ring had just
9062
+ * handed the writer. That "at least as wide as" is the tell: it was a second
9063
+ * expression of the broker's retention, in different units, in a different
9064
+ * addon, with an invariant the operator had to maintain by hand. The keep
9065
+ * bound is now derived from the one prebuffer ceiling and there is nothing
9066
+ * left to configure here.
9067
+ *
9068
+ * The key survives in the SHAPE so a config written before that record still
9069
+ * parses and can be migrated deliberately — `RecordingBandSchema` is not
9070
+ * strict, so simply deleting it would strip an operator's value in silence on
9071
+ * the next save (the failure D380 came one commit from shipping). Nothing
9072
+ * reads it: {@link stripRetiredBandPreBufferSec} removes it on load.
9073
+ */
9059
9074
  preBufferSec: number().min(0).optional(),
9060
9075
  postBufferSec: number().min(0).optional()
9061
9076
  });
9062
- ({
9063
- preBufferSec: 15,
9064
- postBufferSec: 30
9065
- }).postBufferSec * 1e3;
9077
+ ({ postBufferSec: 30 }).postBufferSec * 1e3;
9066
9078
  /**
9067
9079
  * Per-device retention overrides. Every field is optional; an unset or `0`
9068
9080
  * value inherits the node-wide recorder default. Only footage-lifetime limits
@@ -9110,8 +9122,29 @@ var RecordingConfigSchema = object({
9110
9122
  * "off" is the absence of a covering band, never a band value.
9111
9123
  */
9112
9124
  bands: array(RecordingBandSchema).default([]),
9125
+ /**
9126
+ * THE device-decided intent: record for as long as the camera itself raises
9127
+ * `recording-signal` (`active: true` while the device is in function — a
9128
+ * robot that cleans). AUTHORED, unlike `mode`, and the only authored
9129
+ * recording intent that is not a band.
9130
+ *
9131
+ * It carries NO schedule on purpose. A band is an HOUR, and this feature has
9132
+ * no hour to program: the device decides. What it costs the operator is one
9133
+ * flag — "this camera can record on its own" — and what it buys is the same
9134
+ * hold/release the recorder already implements (D371, `holdTrigger` /
9135
+ * `releaseTrigger`): the window opens on the rise, stays open for the whole
9136
+ * job however long it is, and closes one pad after the fall.
9137
+ *
9138
+ * EXCLUSIVE with `bands` (below): two authorities deciding when the same
9139
+ * camera records is the D62 failure. `off` remains `enabled: false`, so an
9140
+ * operator switching this camera off is REPORTED off, never as broken.
9141
+ */
9142
+ deviceDecision: boolean().optional(),
9113
9143
  retention: RecordingRetentionSchema.optional()
9114
- }).strict();
9144
+ }).strict().refine((config) => config.deviceDecision !== true || config.bands.length === 0, {
9145
+ message: "deviceDecision is a whole-config mode and carries no schedule: it cannot be combined with bands",
9146
+ path: ["bands"]
9147
+ });
9115
9148
  /**
9116
9149
  * Entity-relocation job state (storage entity-routing spec, Phase 4).
9117
9150
  *
@@ -22144,11 +22177,7 @@ var CameraAudioStatusSchema = object({
22144
22177
  });
22145
22178
  /** Recording block — null when no recording cap is active for this device. */
22146
22179
  var CameraRecordingStatusSchema = object({
22147
- mode: _enum([
22148
- "off",
22149
- "continuous",
22150
- "events"
22151
- ]),
22180
+ mode: RecordingStorageModeSchema,
22152
22181
  active: boolean(),
22153
22182
  storageBytes: number()
22154
22183
  });
@@ -30410,11 +30439,10 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceI
30410
30439
  var RecordingStatusSchema = object({
30411
30440
  deviceId: number(),
30412
30441
  enabled: boolean(),
30413
- activeMode: _enum([
30414
- "off",
30415
- "continuous",
30416
- "events"
30417
- ]),
30442
+ /** THE derived storage mode, from the one definition
30443
+ * (`deriveRecordingMode`) — never a second enum. A duplicated list is how
30444
+ * `on-device-decision` could have reached the recorder and not the status. */
30445
+ activeMode: RecordingStorageModeSchema,
30418
30446
  nodeId: string(),
30419
30447
  storageBytes: number()
30420
30448
  });
package/dist/addon.mjs CHANGED
@@ -8950,17 +8950,29 @@ var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
8950
8950
  /**
8951
8951
  * DERIVED per-camera storage summary — the single field cheap consumers read
8952
8952
  * (the viewer's status dot, the camera list) instead of walking `bands`:
8953
- * - `off` — no band covers the camera (or it is disabled).
8954
- * - `events` — every band records around triggers only.
8955
- * - `continuous` — at least one band records continuously.
8956
- *
8957
- * NEVER authored: the recorder stamps it from the authoritative `bands` on
8958
- * every save (`activeModeForConfig`). Writing it has no effect.
8953
+ * - `off` — no band covers the camera (or it is disabled).
8954
+ * - `events` — every band records around triggers only.
8955
+ * - `continuous` — at least one band records continuously.
8956
+ * - `on-device-decision`— the DEVICE decides: recording runs for as long as the
8957
+ * camera raises its own `recording-signal` level (a robot that cleans). There
8958
+ * is no schedule to author, because there is no hour to program — see
8959
+ * {@link RecordingConfigSchema}`.deviceDecision`.
8960
+ *
8961
+ * NEVER authored: the recorder stamps it from the authoritative intent
8962
+ * (`bands` + `deviceDecision`) on every save (`activeModeForConfig`). Writing it
8963
+ * has no effect.
8964
+ *
8965
+ * `on-device-decision` is named for WHO decides, not for how the recording is
8966
+ * requested. `on-demand` was rejected: in this repo's vocabulary a "demand" is
8967
+ * something the operator makes (the live gate is the recorder's own "demand
8968
+ * window"), and a knob whose name suggests the operator starts it while the
8969
+ * device actually does is the D62 shape — a control nobody can predict.
8959
8970
  */
8960
8971
  var RecordingStorageModeSchema = _enum([
8961
8972
  "off",
8962
8973
  "events",
8963
- "continuous"
8974
+ "continuous",
8975
+ "on-device-decision"
8964
8976
  ]);
8965
8977
  /**
8966
8978
  * Le macro classi che possono aprire una finestra di registrazione — le stesse
@@ -9010,22 +9022,7 @@ var RecordingTriggersSchema = object({
9010
9022
  * il livello: un contatto trovato già aperto al riavvio del runner non fa
9011
9023
  * registrare.
9012
9024
  */
9013
- sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional(),
9014
- /**
9015
- * La camera registra per tutta la durata del SEGNALE che lei stessa
9016
- * pubblica — la cap `recording-signal` (`active: true` mentre il device è in
9017
- * funzione: un robot che pulisce). È un LIVELLO, non un fronte: la finestra
9018
- * resta aperta finché il segnale è alto e si chiude `postBufferSec` dopo la
9019
- * caduta, così una pulizia di quaranta minuti è UNA clip.
9020
- *
9021
- * Non nomina un device: il segnale è della camera stessa, tenuto fresco dal
9022
- * suo provider (D224); il recorder lo ascolta su `DeviceStateChanged` e lo
9023
- * riconcilia leggendo la slice via RPC, con un tetto oltre il quale un
9024
- * segnale mai abbassato (un evento perso) non può tenere aperta una
9025
- * registrazione (D11). Vedi `recorder/addon/band-decision.ts`
9026
- * (`holdTrigger` / `releaseTrigger`).
9027
- */
9028
- deviceSignal: boolean().optional()
9025
+ sensorDeviceIds: array(number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
9029
9026
  });
9030
9027
  /**
9031
9028
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -9055,13 +9052,28 @@ var RecordingBandSchema = object({
9055
9052
  end: string().regex(HHMM),
9056
9053
  mode: RecordingBandModeSchema,
9057
9054
  triggers: RecordingBandTriggersSchema.optional(),
9055
+ /**
9056
+ * RETIRED (D381). A band no longer carries a pre-buffer of its own.
9057
+ *
9058
+ * It was the retroactive KEEP bound — which already-written segments survive
9059
+ * a trigger — and it had to be at least as wide as the widest pre-roll the
9060
+ * broker could serve, or the gate would delete the seconds the ring had just
9061
+ * handed the writer. That "at least as wide as" is the tell: it was a second
9062
+ * expression of the broker's retention, in different units, in a different
9063
+ * addon, with an invariant the operator had to maintain by hand. The keep
9064
+ * bound is now derived from the one prebuffer ceiling and there is nothing
9065
+ * left to configure here.
9066
+ *
9067
+ * The key survives in the SHAPE so a config written before that record still
9068
+ * parses and can be migrated deliberately — `RecordingBandSchema` is not
9069
+ * strict, so simply deleting it would strip an operator's value in silence on
9070
+ * the next save (the failure D380 came one commit from shipping). Nothing
9071
+ * reads it: {@link stripRetiredBandPreBufferSec} removes it on load.
9072
+ */
9058
9073
  preBufferSec: number().min(0).optional(),
9059
9074
  postBufferSec: number().min(0).optional()
9060
9075
  });
9061
- ({
9062
- preBufferSec: 15,
9063
- postBufferSec: 30
9064
- }).postBufferSec * 1e3;
9076
+ ({ postBufferSec: 30 }).postBufferSec * 1e3;
9065
9077
  /**
9066
9078
  * Per-device retention overrides. Every field is optional; an unset or `0`
9067
9079
  * value inherits the node-wide recorder default. Only footage-lifetime limits
@@ -9109,8 +9121,29 @@ var RecordingConfigSchema = object({
9109
9121
  * "off" is the absence of a covering band, never a band value.
9110
9122
  */
9111
9123
  bands: array(RecordingBandSchema).default([]),
9124
+ /**
9125
+ * THE device-decided intent: record for as long as the camera itself raises
9126
+ * `recording-signal` (`active: true` while the device is in function — a
9127
+ * robot that cleans). AUTHORED, unlike `mode`, and the only authored
9128
+ * recording intent that is not a band.
9129
+ *
9130
+ * It carries NO schedule on purpose. A band is an HOUR, and this feature has
9131
+ * no hour to program: the device decides. What it costs the operator is one
9132
+ * flag — "this camera can record on its own" — and what it buys is the same
9133
+ * hold/release the recorder already implements (D371, `holdTrigger` /
9134
+ * `releaseTrigger`): the window opens on the rise, stays open for the whole
9135
+ * job however long it is, and closes one pad after the fall.
9136
+ *
9137
+ * EXCLUSIVE with `bands` (below): two authorities deciding when the same
9138
+ * camera records is the D62 failure. `off` remains `enabled: false`, so an
9139
+ * operator switching this camera off is REPORTED off, never as broken.
9140
+ */
9141
+ deviceDecision: boolean().optional(),
9112
9142
  retention: RecordingRetentionSchema.optional()
9113
- }).strict();
9143
+ }).strict().refine((config) => config.deviceDecision !== true || config.bands.length === 0, {
9144
+ message: "deviceDecision is a whole-config mode and carries no schedule: it cannot be combined with bands",
9145
+ path: ["bands"]
9146
+ });
9114
9147
  /**
9115
9148
  * Entity-relocation job state (storage entity-routing spec, Phase 4).
9116
9149
  *
@@ -22143,11 +22176,7 @@ var CameraAudioStatusSchema = object({
22143
22176
  });
22144
22177
  /** Recording block — null when no recording cap is active for this device. */
22145
22178
  var CameraRecordingStatusSchema = object({
22146
- mode: _enum([
22147
- "off",
22148
- "continuous",
22149
- "events"
22150
- ]),
22179
+ mode: RecordingStorageModeSchema,
22151
22180
  active: boolean(),
22152
22181
  storageBytes: number()
22153
22182
  });
@@ -30409,11 +30438,10 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceI
30409
30438
  var RecordingStatusSchema = object({
30410
30439
  deviceId: number(),
30411
30440
  enabled: boolean(),
30412
- activeMode: _enum([
30413
- "off",
30414
- "continuous",
30415
- "events"
30416
- ]),
30441
+ /** THE derived storage mode, from the one definition
30442
+ * (`deriveRecordingMode`) — never a second enum. A duplicated list is how
30443
+ * `on-device-decision` could have reached the recorder and not the status. */
30444
+ activeMode: RecordingStorageModeSchema,
30417
30445
  nodeId: string(),
30418
30446
  storageBytes: number()
30419
30447
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-petkit",
3
- "version": "0.2.75",
3
+ "version": "0.2.77",
4
4
  "description": "PetKit smart-feeder device-provider addon for CamStack — wraps the @apocaliss92/nodepetkit PetKit cloud client",
5
5
  "keywords": [
6
6
  "camstack",