@camstack/addon-ai 0.4.77 → 0.4.79

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
@@ -8052,17 +8052,29 @@ var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
8052
8052
  /**
8053
8053
  * DERIVED per-camera storage summary — the single field cheap consumers read
8054
8054
  * (the viewer's status dot, the camera list) instead of walking `bands`:
8055
- * - `off` — no band covers the camera (or it is disabled).
8056
- * - `events` — every band records around triggers only.
8057
- * - `continuous` — at least one band records continuously.
8058
- *
8059
- * NEVER authored: the recorder stamps it from the authoritative `bands` on
8060
- * every save (`activeModeForConfig`). Writing it has no effect.
8055
+ * - `off` — no band covers the camera (or it is disabled).
8056
+ * - `events` — every band records around triggers only.
8057
+ * - `continuous` — at least one band records continuously.
8058
+ * - `on-device-decision`— the DEVICE decides: recording runs for as long as the
8059
+ * camera raises its own `recording-signal` level (a robot that cleans). There
8060
+ * is no schedule to author, because there is no hour to program — see
8061
+ * {@link RecordingConfigSchema}`.deviceDecision`.
8062
+ *
8063
+ * NEVER authored: the recorder stamps it from the authoritative intent
8064
+ * (`bands` + `deviceDecision`) on every save (`activeModeForConfig`). Writing it
8065
+ * has no effect.
8066
+ *
8067
+ * `on-device-decision` is named for WHO decides, not for how the recording is
8068
+ * requested. `on-demand` was rejected: in this repo's vocabulary a "demand" is
8069
+ * something the operator makes (the live gate is the recorder's own "demand
8070
+ * window"), and a knob whose name suggests the operator starts it while the
8071
+ * device actually does is the D62 shape — a control nobody can predict.
8061
8072
  */
8062
8073
  var RecordingStorageModeSchema = _enum([
8063
8074
  "off",
8064
8075
  "events",
8065
- "continuous"
8076
+ "continuous",
8077
+ "on-device-decision"
8066
8078
  ]);
8067
8079
  /**
8068
8080
  * Le macro classi che possono aprire una finestra di registrazione — le stesse
@@ -8112,22 +8124,7 @@ var RecordingTriggersSchema = object({
8112
8124
  * il livello: un contatto trovato già aperto al riavvio del runner non fa
8113
8125
  * registrare.
8114
8126
  */
8115
- sensorDeviceIds: array(number$1().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional(),
8116
- /**
8117
- * La camera registra per tutta la durata del SEGNALE che lei stessa
8118
- * pubblica — la cap `recording-signal` (`active: true` mentre il device è in
8119
- * funzione: un robot che pulisce). È un LIVELLO, non un fronte: la finestra
8120
- * resta aperta finché il segnale è alto e si chiude `postBufferSec` dopo la
8121
- * caduta, così una pulizia di quaranta minuti è UNA clip.
8122
- *
8123
- * Non nomina un device: il segnale è della camera stessa, tenuto fresco dal
8124
- * suo provider (D224); il recorder lo ascolta su `DeviceStateChanged` e lo
8125
- * riconcilia leggendo la slice via RPC, con un tetto oltre il quale un
8126
- * segnale mai abbassato (un evento perso) non può tenere aperta una
8127
- * registrazione (D11). Vedi `recorder/addon/band-decision.ts`
8128
- * (`holdTrigger` / `releaseTrigger`).
8129
- */
8130
- deviceSignal: boolean().optional()
8127
+ sensorDeviceIds: array(number$1().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
8131
8128
  });
8132
8129
  /**
8133
8130
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -8157,13 +8154,28 @@ var RecordingBandSchema = object({
8157
8154
  end: string().regex(HHMM),
8158
8155
  mode: RecordingBandModeSchema,
8159
8156
  triggers: RecordingBandTriggersSchema.optional(),
8157
+ /**
8158
+ * RETIRED (D381). A band no longer carries a pre-buffer of its own.
8159
+ *
8160
+ * It was the retroactive KEEP bound — which already-written segments survive
8161
+ * a trigger — and it had to be at least as wide as the widest pre-roll the
8162
+ * broker could serve, or the gate would delete the seconds the ring had just
8163
+ * handed the writer. That "at least as wide as" is the tell: it was a second
8164
+ * expression of the broker's retention, in different units, in a different
8165
+ * addon, with an invariant the operator had to maintain by hand. The keep
8166
+ * bound is now derived from the one prebuffer ceiling and there is nothing
8167
+ * left to configure here.
8168
+ *
8169
+ * The key survives in the SHAPE so a config written before that record still
8170
+ * parses and can be migrated deliberately — `RecordingBandSchema` is not
8171
+ * strict, so simply deleting it would strip an operator's value in silence on
8172
+ * the next save (the failure D380 came one commit from shipping). Nothing
8173
+ * reads it: {@link stripRetiredBandPreBufferSec} removes it on load.
8174
+ */
8160
8175
  preBufferSec: number$1().min(0).optional(),
8161
8176
  postBufferSec: number$1().min(0).optional()
8162
8177
  });
8163
- ({
8164
- preBufferSec: 15,
8165
- postBufferSec: 30
8166
- }).postBufferSec * 1e3;
8178
+ ({ postBufferSec: 30 }).postBufferSec * 1e3;
8167
8179
  /**
8168
8180
  * Per-device retention overrides. Every field is optional; an unset or `0`
8169
8181
  * value inherits the node-wide recorder default. Only footage-lifetime limits
@@ -8211,8 +8223,29 @@ var RecordingConfigSchema = object({
8211
8223
  * "off" is the absence of a covering band, never a band value.
8212
8224
  */
8213
8225
  bands: array(RecordingBandSchema).default([]),
8226
+ /**
8227
+ * THE device-decided intent: record for as long as the camera itself raises
8228
+ * `recording-signal` (`active: true` while the device is in function — a
8229
+ * robot that cleans). AUTHORED, unlike `mode`, and the only authored
8230
+ * recording intent that is not a band.
8231
+ *
8232
+ * It carries NO schedule on purpose. A band is an HOUR, and this feature has
8233
+ * no hour to program: the device decides. What it costs the operator is one
8234
+ * flag — "this camera can record on its own" — and what it buys is the same
8235
+ * hold/release the recorder already implements (D371, `holdTrigger` /
8236
+ * `releaseTrigger`): the window opens on the rise, stays open for the whole
8237
+ * job however long it is, and closes one pad after the fall.
8238
+ *
8239
+ * EXCLUSIVE with `bands` (below): two authorities deciding when the same
8240
+ * camera records is the D62 failure. `off` remains `enabled: false`, so an
8241
+ * operator switching this camera off is REPORTED off, never as broken.
8242
+ */
8243
+ deviceDecision: boolean().optional(),
8214
8244
  retention: RecordingRetentionSchema.optional()
8215
- }).strict();
8245
+ }).strict().refine((config) => config.deviceDecision !== true || config.bands.length === 0, {
8246
+ message: "deviceDecision is a whole-config mode and carries no schedule: it cannot be combined with bands",
8247
+ path: ["bands"]
8248
+ });
8216
8249
  /**
8217
8250
  * Entity-relocation job state (storage entity-routing spec, Phase 4).
8218
8251
  *
@@ -20954,11 +20987,7 @@ var CameraAudioStatusSchema = object({
20954
20987
  });
20955
20988
  /** Recording block — null when no recording cap is active for this device. */
20956
20989
  var CameraRecordingStatusSchema = object({
20957
- mode: _enum([
20958
- "off",
20959
- "continuous",
20960
- "events"
20961
- ]),
20990
+ mode: RecordingStorageModeSchema,
20962
20991
  active: boolean(),
20963
20992
  storageBytes: number$1()
20964
20993
  });
@@ -27364,11 +27393,10 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceI
27364
27393
  var RecordingStatusSchema = object({
27365
27394
  deviceId: number$1(),
27366
27395
  enabled: boolean(),
27367
- activeMode: _enum([
27368
- "off",
27369
- "continuous",
27370
- "events"
27371
- ]),
27396
+ /** THE derived storage mode, from the one definition
27397
+ * (`deriveRecordingMode`) — never a second enum. A duplicated list is how
27398
+ * `on-device-decision` could have reached the recorder and not the status. */
27399
+ activeMode: RecordingStorageModeSchema,
27372
27400
  nodeId: string(),
27373
27401
  storageBytes: number$1()
27374
27402
  });
package/dist/addon.mjs CHANGED
@@ -8079,17 +8079,29 @@ var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
8079
8079
  /**
8080
8080
  * DERIVED per-camera storage summary — the single field cheap consumers read
8081
8081
  * (the viewer's status dot, the camera list) instead of walking `bands`:
8082
- * - `off` — no band covers the camera (or it is disabled).
8083
- * - `events` — every band records around triggers only.
8084
- * - `continuous` — at least one band records continuously.
8085
- *
8086
- * NEVER authored: the recorder stamps it from the authoritative `bands` on
8087
- * every save (`activeModeForConfig`). Writing it has no effect.
8082
+ * - `off` — no band covers the camera (or it is disabled).
8083
+ * - `events` — every band records around triggers only.
8084
+ * - `continuous` — at least one band records continuously.
8085
+ * - `on-device-decision`— the DEVICE decides: recording runs for as long as the
8086
+ * camera raises its own `recording-signal` level (a robot that cleans). There
8087
+ * is no schedule to author, because there is no hour to program — see
8088
+ * {@link RecordingConfigSchema}`.deviceDecision`.
8089
+ *
8090
+ * NEVER authored: the recorder stamps it from the authoritative intent
8091
+ * (`bands` + `deviceDecision`) on every save (`activeModeForConfig`). Writing it
8092
+ * has no effect.
8093
+ *
8094
+ * `on-device-decision` is named for WHO decides, not for how the recording is
8095
+ * requested. `on-demand` was rejected: in this repo's vocabulary a "demand" is
8096
+ * something the operator makes (the live gate is the recorder's own "demand
8097
+ * window"), and a knob whose name suggests the operator starts it while the
8098
+ * device actually does is the D62 shape — a control nobody can predict.
8088
8099
  */
8089
8100
  var RecordingStorageModeSchema = _enum([
8090
8101
  "off",
8091
8102
  "events",
8092
- "continuous"
8103
+ "continuous",
8104
+ "on-device-decision"
8093
8105
  ]);
8094
8106
  /**
8095
8107
  * Le macro classi che possono aprire una finestra di registrazione — le stesse
@@ -8139,22 +8151,7 @@ var RecordingTriggersSchema = object({
8139
8151
  * il livello: un contatto trovato già aperto al riavvio del runner non fa
8140
8152
  * registrare.
8141
8153
  */
8142
- sensorDeviceIds: array(number$1().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional(),
8143
- /**
8144
- * La camera registra per tutta la durata del SEGNALE che lei stessa
8145
- * pubblica — la cap `recording-signal` (`active: true` mentre il device è in
8146
- * funzione: un robot che pulisce). È un LIVELLO, non un fronte: la finestra
8147
- * resta aperta finché il segnale è alto e si chiude `postBufferSec` dopo la
8148
- * caduta, così una pulizia di quaranta minuti è UNA clip.
8149
- *
8150
- * Non nomina un device: il segnale è della camera stessa, tenuto fresco dal
8151
- * suo provider (D224); il recorder lo ascolta su `DeviceStateChanged` e lo
8152
- * riconcilia leggendo la slice via RPC, con un tetto oltre il quale un
8153
- * segnale mai abbassato (un evento perso) non può tenere aperta una
8154
- * registrazione (D11). Vedi `recorder/addon/band-decision.ts`
8155
- * (`holdTrigger` / `releaseTrigger`).
8156
- */
8157
- deviceSignal: boolean().optional()
8154
+ sensorDeviceIds: array(number$1().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
8158
8155
  });
8159
8156
  /**
8160
8157
  * Mode of a single recording band — the recorder per-band vocabulary.
@@ -8184,13 +8181,28 @@ var RecordingBandSchema = object({
8184
8181
  end: string().regex(HHMM),
8185
8182
  mode: RecordingBandModeSchema,
8186
8183
  triggers: RecordingBandTriggersSchema.optional(),
8184
+ /**
8185
+ * RETIRED (D381). A band no longer carries a pre-buffer of its own.
8186
+ *
8187
+ * It was the retroactive KEEP bound — which already-written segments survive
8188
+ * a trigger — and it had to be at least as wide as the widest pre-roll the
8189
+ * broker could serve, or the gate would delete the seconds the ring had just
8190
+ * handed the writer. That "at least as wide as" is the tell: it was a second
8191
+ * expression of the broker's retention, in different units, in a different
8192
+ * addon, with an invariant the operator had to maintain by hand. The keep
8193
+ * bound is now derived from the one prebuffer ceiling and there is nothing
8194
+ * left to configure here.
8195
+ *
8196
+ * The key survives in the SHAPE so a config written before that record still
8197
+ * parses and can be migrated deliberately — `RecordingBandSchema` is not
8198
+ * strict, so simply deleting it would strip an operator's value in silence on
8199
+ * the next save (the failure D380 came one commit from shipping). Nothing
8200
+ * reads it: {@link stripRetiredBandPreBufferSec} removes it on load.
8201
+ */
8187
8202
  preBufferSec: number$1().min(0).optional(),
8188
8203
  postBufferSec: number$1().min(0).optional()
8189
8204
  });
8190
- ({
8191
- preBufferSec: 15,
8192
- postBufferSec: 30
8193
- }).postBufferSec * 1e3;
8205
+ ({ postBufferSec: 30 }).postBufferSec * 1e3;
8194
8206
  /**
8195
8207
  * Per-device retention overrides. Every field is optional; an unset or `0`
8196
8208
  * value inherits the node-wide recorder default. Only footage-lifetime limits
@@ -8238,8 +8250,29 @@ var RecordingConfigSchema = object({
8238
8250
  * "off" is the absence of a covering band, never a band value.
8239
8251
  */
8240
8252
  bands: array(RecordingBandSchema).default([]),
8253
+ /**
8254
+ * THE device-decided intent: record for as long as the camera itself raises
8255
+ * `recording-signal` (`active: true` while the device is in function — a
8256
+ * robot that cleans). AUTHORED, unlike `mode`, and the only authored
8257
+ * recording intent that is not a band.
8258
+ *
8259
+ * It carries NO schedule on purpose. A band is an HOUR, and this feature has
8260
+ * no hour to program: the device decides. What it costs the operator is one
8261
+ * flag — "this camera can record on its own" — and what it buys is the same
8262
+ * hold/release the recorder already implements (D371, `holdTrigger` /
8263
+ * `releaseTrigger`): the window opens on the rise, stays open for the whole
8264
+ * job however long it is, and closes one pad after the fall.
8265
+ *
8266
+ * EXCLUSIVE with `bands` (below): two authorities deciding when the same
8267
+ * camera records is the D62 failure. `off` remains `enabled: false`, so an
8268
+ * operator switching this camera off is REPORTED off, never as broken.
8269
+ */
8270
+ deviceDecision: boolean().optional(),
8241
8271
  retention: RecordingRetentionSchema.optional()
8242
- }).strict();
8272
+ }).strict().refine((config) => config.deviceDecision !== true || config.bands.length === 0, {
8273
+ message: "deviceDecision is a whole-config mode and carries no schedule: it cannot be combined with bands",
8274
+ path: ["bands"]
8275
+ });
8243
8276
  /**
8244
8277
  * Entity-relocation job state (storage entity-routing spec, Phase 4).
8245
8278
  *
@@ -20981,11 +21014,7 @@ var CameraAudioStatusSchema = object({
20981
21014
  });
20982
21015
  /** Recording block — null when no recording cap is active for this device. */
20983
21016
  var CameraRecordingStatusSchema = object({
20984
- mode: _enum([
20985
- "off",
20986
- "continuous",
20987
- "events"
20988
- ]),
21017
+ mode: RecordingStorageModeSchema,
20989
21018
  active: boolean(),
20990
21019
  storageBytes: number$1()
20991
21020
  });
@@ -27391,11 +27420,10 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceI
27391
27420
  var RecordingStatusSchema = object({
27392
27421
  deviceId: number$1(),
27393
27422
  enabled: boolean(),
27394
- activeMode: _enum([
27395
- "off",
27396
- "continuous",
27397
- "events"
27398
- ]),
27423
+ /** THE derived storage mode, from the one definition
27424
+ * (`deriveRecordingMode`) — never a second enum. A duplicated list is how
27425
+ * `on-device-decision` could have reached the recorder and not the status. */
27426
+ activeMode: RecordingStorageModeSchema,
27399
27427
  nodeId: string(),
27400
27428
  storageBytes: number$1()
27401
27429
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-ai",
3
- "version": "0.4.77",
3
+ "version": "0.4.79",
4
4
  "description": "AI addon for CamStack — the `llm` collection provider (cloud, LAN, and camstack-managed local llama.cpp profiles) plus the per-node `llm-runtime` managed executor.",
5
5
  "keywords": [
6
6
  "camstack",