@camstack/addon-osd-manager 0.1.132 → 0.1.134

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-BVKF49rs.mjs → MotionZonesSettings-DjSGOYEZ.mjs} +2 -2
  2. package/dist/{PrivacyMaskSettings-DoIRAuP_.mjs → PrivacyMaskSettings-BrJjxUTV.mjs} +4 -4
  3. package/dist/{SceneMonitorEditor-3ApQNn3a.mjs → SceneMonitorEditor-lFwk-5Ag.mjs} +3 -3
  4. package/dist/_stub.js +939 -889
  5. package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_osd_manager_page-mIgOkpXI.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_osd_manager_page-D98-RlNY.mjs} +3 -3
  6. package/dist/_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-MNSRdKcG.mjs +26 -0
  7. package/dist/{hostInit-vbrbPLQg.mjs → hostInit-C4Y_aRuZ.mjs} +2 -2
  8. package/dist/index.js +1515 -1004
  9. package/dist/index.mjs +1515 -1004
  10. package/dist/{player-overlays-BPpRI9aB.mjs → player-overlays-8DJJmri3.mjs} +1 -1
  11. package/dist/remoteEntry.js +1 -1
  12. package/dist/{responsive-BEcoyxvC.mjs → responsive-BJTLnN-p.mjs} +1 -1
  13. package/dist/{scene-monitor-copy-1LhlrkfK.mjs → scene-monitor-copy-CXXU8X6V.mjs} +1 -1
  14. package/dist/{square-Bw9o8y6p.mjs → square-CxBZyzy5.mjs} +1 -1
  15. package/dist/{trash-2-ClX9SCS6.mjs → trash-2-CDkpE8nN.mjs} +1 -1
  16. package/dist/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_osd_manager_page__remoteEntry_js-BNiwvK5v.mjs → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_osd_manager_page__remoteEntry_js-D5wQZ-Cc.mjs} +1 -1
  17. package/package.json +1 -1
  18. package/dist/_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-D47POQ8_.mjs +0 -26
package/dist/index.js CHANGED
@@ -5363,7 +5363,7 @@ var ZodIssueCode = {
5363
5363
  var ZodFirstPartyTypeKind;
5364
5364
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5365
5365
  //#endregion
5366
- //#region ../types/dist/sleep-COWaSCAi.mjs
5366
+ //#region ../types/dist/sleep-pM_J7YnY.mjs
5367
5367
  /**
5368
5368
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5369
5369
  * window to float samples (D455).
@@ -6499,6 +6499,24 @@ function normalizeAddonInitResult(result) {
6499
6499
  if (Array.isArray(result)) return { providers: result };
6500
6500
  return result;
6501
6501
  }
6502
+ /** The wire shape of {@link PeerBytesTicket} — see the type for what it is. */
6503
+ var PeerBytesTicketSchema = object({
6504
+ /** `http://127.0.0.1:<port>/<token>`. One `GET` takes it. */
6505
+ url: string().min(1),
6506
+ /**
6507
+ * The HOST node this URL means something on — the hub or a named agent,
6508
+ * never a runner. {@link AddonPeerBytes.open} compares it to its own and
6509
+ * refuses `cross-node` by name when they differ, without dialling.
6510
+ */
6511
+ hostNodeId: string().min(1),
6512
+ expiresAtMs: number().int().nonnegative(),
6513
+ /**
6514
+ * What the producer DECLARED the body to be, when it knows — `null` when it
6515
+ * does not. Never `0` for unknown (D393): a consumer sizing a bound off this
6516
+ * must be able to tell "the producer did not say" from "the body is empty".
6517
+ */
6518
+ declaredBytes: number().int().nonnegative().nullable()
6519
+ });
6502
6520
  /** Shared Zod schemas used across streaming capabilities. */
6503
6521
  var CamProfileSchema = _enum([
6504
6522
  "high",
@@ -7629,24 +7647,6 @@ object({
7629
7647
  unreachable: number()
7630
7648
  })
7631
7649
  });
7632
- /** The wire shape of {@link PeerBytesTicket} — see the type for what it is. */
7633
- var PeerBytesTicketSchema = object({
7634
- /** `http://127.0.0.1:<port>/<token>`. One `GET` takes it. */
7635
- url: string().min(1),
7636
- /**
7637
- * The HOST node this URL means something on — the hub or a named agent,
7638
- * never a runner. {@link AddonPeerBytes.open} compares it to its own and
7639
- * refuses `cross-node` by name when they differ, without dialling.
7640
- */
7641
- hostNodeId: string().min(1),
7642
- expiresAtMs: number().int().nonnegative(),
7643
- /**
7644
- * What the producer DECLARED the body to be, when it knows — `null` when it
7645
- * does not. Never `0` for unknown (D393): a consumer sizing a bound off this
7646
- * must be able to tell "the producer did not say" from "the body is empty".
7647
- */
7648
- declaredBytes: number().int().nonnegative().nullable()
7649
- });
7650
7650
  /**
7651
7651
  * Adoption job — the background form of `device-adoption.adopt`.
7652
7652
  *
@@ -7758,7 +7758,7 @@ var AdoptionJobSchema = object({
7758
7758
  * component's original options — detection to the detection-pipeline wrapper
7759
7759
  * binding, audio analysis to its own, recording to `RecordingConfig.enabled`
7760
7760
  * (which was always first-class; the switch was a veneer over
7761
- * `recording.setDeviceConfig`), notifications to a notification-center
7761
+ * `recordingArchive.setDeviceConfig`), notifications to a notification-center
7762
7762
  * per-device setting, the two camera planes to their own components.
7763
7763
  *
7764
7764
  * What survives is {@link composeSwitchedOff}: `CameraStatus.switchedOff`, the
@@ -7784,7 +7784,7 @@ var AdoptionJobSchema = object({
7784
7784
  * | `stream-broker` | `deviceManager.setDisabled` | `StreamBrokerManager.reconcileAllCatalogs` releases the brokers; `ensureBroker` refuses re-creation |
7785
7785
  * | `object-detection` | `deviceManager.setWrapperActive('detection-pipeline')` | `PipelineSettingsStore.resolvePipelineForDevice` returns `{ steps: [], audio: null }` |
7786
7786
  * | `audio-analysis` | `deviceManager.setWrapperActive('audio-analysis')` | `AudioSubscriptionController.subscribeAudioStream` returns `null` before opening the stream |
7787
- * | `recording` | `recording.setDeviceConfig` → `RecordingConfig.enabled` | `band-decision.shouldRecord` returns false; the controller detaches the device |
7787
+ * | `recording` | `recordingArchive.setDeviceConfig` → `RecordingConfig.enabled` | `band-decision.shouldRecord` returns false; the controller detaches the device |
7788
7788
  * | `notifications` | `notificationRules.setDeviceMuted` | `NotificationCenter.evaluateAndEnqueue` returns before any rule is evaluated |
7789
7789
  * | `privacy-mask` | `privacyMask.setMask({ enabled })` → the CAMERA | the camera blanks the masked regions itself; every stream and recording carries the black boxes |
7790
7790
  * | `device-audio` | `privacyMask.setAudioEnabled` → the CAMERA | the camera stops encoding an audio track at all; every consumer sees silent video |
@@ -12104,87 +12104,6 @@ var cameraPipelineConfigCapability = {
12104
12104
  exposesDeviceSettings: true,
12105
12105
  methods: {}
12106
12106
  };
12107
- /**
12108
- * The signals a device can emit to WAKE its own stream.
12109
- *
12110
- * A camera whose stream is built on demand sleeps until something asks for it,
12111
- * and "something" cannot be a consumer that is merely attached — a Frigate-style
12112
- * puller holds a session open for ever, and treating that as demand would keep
12113
- * a battery camera awake for ever, which is the whole thing the battery is for
12114
- * (D173). So the wake has to come from the CAMERA: an event it noticed by
12115
- * itself, with no stream running.
12116
- *
12117
- * ## The vocabulary is the PROVIDER'S, not ours
12118
- *
12119
- * Like `consumables`, this cap declares no vocabulary of its own. A provider
12120
- * names each signal with a `code` it chooses and a `label` an operator reads.
12121
- * Reolink offers motion and camera-native detection; another provider may offer
12122
- * a tamper, a doorbell press, a PIR, or something no camera in this fleet has
12123
- * yet. A fixed enum here would mean every new signal is a framework release.
12124
- *
12125
- * It is deliberately NOT derived from the caps a device already binds. Whether
12126
- * a camera CAN push firmware motion is expressed by `motionSources` containing
12127
- * `'onboard'`, and whether it does AI on-camera by the `native-object-detection`
12128
- * binding — but both answer "what drives the detection pipeline", which is a
12129
- * different question from "what may wake a sleeping stream". A camera can do
12130
- * the first and not be trusted with the second, and the operator picks per
12131
- * camera. Two questions, two authorities.
12132
- *
12133
- * ## Availability is not permission
12134
- *
12135
- * `listSignals` says what the device CAN emit. Whether a given signal actually
12136
- * wakes the stream is the operator's per-camera choice, held by the broker
12137
- * alongside the cooldown — see the stream-broker cap's wake settings. A
12138
- * provider declaring a signal is not a provider enabling it.
12139
- */
12140
- /** One signal a device can emit. */
12141
- var StreamSignalSchema = object({
12142
- /** Stable id chosen by the provider, e.g. `'motion'`, `'person'`, `'tamper'`. */
12143
- code: string().min(1),
12144
- /** What an operator reads in the picker. The provider's own wording. */
12145
- label: string().min(1),
12146
- /**
12147
- * Whether the provider recommends this signal ON when a camera is first set
12148
- * up. A provider knows which of its signals are cheap and reliable; an
12149
- * operator should not have to discover that by trial. Reolink recommends
12150
- * both of its own.
12151
- */
12152
- recommended: boolean()
12153
- });
12154
- var StreamSignalsStatusSchema = object({
12155
- signals: array(StreamSignalSchema),
12156
- lastFetchedAt: number()
12157
- });
12158
- var streamSignalsCapability = {
12159
- name: "stream-signals",
12160
- scope: "device",
12161
- deviceNative: true,
12162
- mode: "singleton",
12163
- deviceTypes: Object.values(DeviceType),
12164
- runtimeState: StreamSignalsStatusSchema,
12165
- /**
12166
- * Runtime-state durability: **session** — mirrored in RAM, never written.
12167
- *
12168
- * The slice holds what the DEVICE says it can emit. That is a probed fact,
12169
- * not an operator choice: the provider re-declares it on every registration,
12170
- * so losing it loses nothing and persisting it would freeze an answer the
12171
- * camera is entitled to change. Measured the same day on the sibling case —
12172
- * `native-object-detection.supportedClasses` was persisted, and a firmware
12173
- * class the camera really detected stayed missing for the life of the row
12174
- * because the fix could not reach it.
12175
- *
12176
- * See `RuntimeStateDurability`. Enforced by
12177
- * `scripts/check-runtime-state-durability.ts`.
12178
- */
12179
- durability: "session",
12180
- methods: {
12181
- /**
12182
- * What this device can emit. Empty is a valid and common answer — most
12183
- * cameras have nothing to offer here, and an empty list is what makes the
12184
- * broker's picker show nothing rather than a false choice.
12185
- */
12186
- listSignals: method(_void(), array(StreamSignalSchema).readonly()) }
12187
- };
12188
12107
  /** Stream delivery format. (Relocated from the retired `streaming-engine` cap.) */
12189
12108
  var StreamFormatSchema = _enum([
12190
12109
  "webrtc",
@@ -14309,6 +14228,118 @@ var detectionPipelineCapability = {
14309
14228
  methods: {}
14310
14229
  };
14311
14230
  /**
14231
+ * device-admin-link — "this device has a management page of its own, and here
14232
+ * is its address".
14233
+ *
14234
+ * ## Why this is not a `deviceConfig` cap
14235
+ *
14236
+ * There is nothing to edit. A `deviceConfig` cap (D14) exists so the framework
14237
+ * can DERIVE a settings form from `getOptions` + `getStatus` and route a flat
14238
+ * patch back through a setter; it costs a `builderId` reducer in
14239
+ * `device-config-contribution.ts` and a `*-config-schema.ts` beside it, and it
14240
+ * renders a form section. This cap answers ONE question with ONE read and
14241
+ * renders a button. Nothing about it is a form, so it carries no `deviceConfig`
14242
+ * block, no `settings`, no `runtimeState` and no reducer — exactly like
14243
+ * `reboot`, the other pure-RPC device-native cap.
14244
+ *
14245
+ * ## Absent, and the difference between "no page" and "we cannot say"
14246
+ *
14247
+ * The two are answered at DIFFERENT layers, on purpose:
14248
+ *
14249
+ * - **"We cannot say"** → the provider never registers the cap for that
14250
+ * device. A VeSync humidifier, a Petkit feeder, a Dreame vacuum and a Dreo
14251
+ * fan are reached only through a vendor cloud; there is no address to hand
14252
+ * out and no page to open. A Tuya plug, a Wyze camera and a Gree air
14253
+ * conditioner DO have a LAN IP, and still have no HTTP management page
14254
+ * behind it. None of them register, so `deviceManager.getBindings` never
14255
+ * lists the cap and no surface asks.
14256
+ * - **"This device has no page, and I know that"** → the provider registers
14257
+ * and `getAdminLink` returns `null`. This is the answer for a device whose
14258
+ * sibling DOES have a page: a Reolink battery camera reached over UDP by
14259
+ * `uid` with a blank `host`, an Ecowitt gateway configured in `listener`
14260
+ * transport, a Home Assistant broker authenticated by supervisor token
14261
+ * (which carries no `baseUrl` at all).
14262
+ *
14263
+ * Both draw NOTHING. A button that opens a browser error is worse than no
14264
+ * button, and D62 is the same rule from the other side: an off switch is
14265
+ * reported off, never made to look broken. There is no third state where the
14266
+ * UI renders a disabled button "because the device might have a page".
14267
+ *
14268
+ * ## The URL never carries credentials
14269
+ *
14270
+ * Not in userinfo, not in a query string. Every provider builds through
14271
+ * `buildDeviceAdminUrl` (`device-admin-link-url.ts`), which takes host, port,
14272
+ * scheme and path as separate arguments — there is no parameter a secret could
14273
+ * arrive in — and re-checks its own output for the `scheme://user:pass@` shape
14274
+ * that `scripts/check-no-credential-urls-in-fixtures.ts` bans from recorded
14275
+ * output. `scripts/check-admin-link-builder-is-the-only-url-source.ts` is what
14276
+ * keeps providers from hand-rolling one anyway.
14277
+ *
14278
+ * This matters here more than anywhere else in the repo, because every provider
14279
+ * that knows a device's host knows its PASSWORD too: `{ host, port, username,
14280
+ * password }` sit in one object on Hikvision, Amcrest, Reolink and ONVIF alike,
14281
+ * and `http://admin:hunter2@192.168.50.139/` is a URL a browser accepts. The
14282
+ * camera's own page will ask for its own login. That is correct, and pre-
14283
+ * filling it is the operator's business, not ours.
14284
+ *
14285
+ * ## It is a LAN fact
14286
+ *
14287
+ * The URL addresses the device where the NODE can see it. It is not proxied,
14288
+ * not made reachable from outside, and not sent anywhere. A surface renders it
14289
+ * as a link the operator's own browser follows, on the operator's own network,
14290
+ * or renders nothing.
14291
+ */
14292
+ /**
14293
+ * Whose page is it. The distinction is for the OPERATOR, who needs to know
14294
+ * before clicking whether he is about to land on a camera's own web server or
14295
+ * inside Home Assistant.
14296
+ */
14297
+ var AdminLinkTargetEnum = _enum(["device", "integration"]);
14298
+ var DeviceAdminLinkSchema = object({
14299
+ /**
14300
+ * Absolute `http(s)://` URL. Built by `buildDeviceAdminUrl` and therefore
14301
+ * free of userinfo and of any credential-shaped query key.
14302
+ */
14303
+ url: string(),
14304
+ /**
14305
+ * What the surface calls it — "Web UI", "Home Assistant", "UniFi controller".
14306
+ * The PROVIDER names it, because only the provider knows what the page is;
14307
+ * a UI that invented the label from the addon id would call the Home
14308
+ * Assistant device page "Provider Homeassistant".
14309
+ */
14310
+ label: string(),
14311
+ target: AdminLinkTargetEnum,
14312
+ /**
14313
+ * Host the URL points at, without scheme, port or path — for the tooltip, so
14314
+ * an operator can see WHERE the button goes before he follows it. Redundant
14315
+ * with `url` by construction; carried separately so no surface has to parse
14316
+ * a URL to show it.
14317
+ */
14318
+ host: string()
14319
+ });
14320
+ var deviceAdminLinkCapability = {
14321
+ name: "device-admin-link",
14322
+ scope: "device",
14323
+ deviceNative: true,
14324
+ mode: "singleton",
14325
+ methods: {
14326
+ /**
14327
+ * The device's management page, or `null` when this device has none.
14328
+ *
14329
+ * `auth: 'admin'` deliberately. This is administration, not actuation —
14330
+ * the same bucket as `reboot` and `camera-credentials`, and explicitly NOT
14331
+ * the actuation set `scripts/check-actuation-not-admin.ts` protects (D403).
14332
+ * The URL is also a statement about the LAN, which a household member with
14333
+ * a `view` grant on a light has no reason to be handed.
14334
+ *
14335
+ * The surfaces gate on the QUERY, never on a role they guessed: a caller
14336
+ * without the right loses the query and draws nothing, which is the same
14337
+ * thing a device with no page draws. There is no path on which a button
14338
+ * appears and then fails — the D403 failure mode, from the other end.
14339
+ */
14340
+ getAdminLink: method(object({ deviceId: number().int().nonnegative() }), DeviceAdminLinkSchema.nullable(), { auth: "admin" }) }
14341
+ };
14342
+ /**
14312
14343
  * Identity envelope for a device's upstream-system metadata.
14313
14344
  *
14314
14345
  * Two jobs:
@@ -14700,118 +14731,6 @@ var deviceAdoptionCapability = {
14700
14731
  }
14701
14732
  };
14702
14733
  /**
14703
- * device-admin-link — "this device has a management page of its own, and here
14704
- * is its address".
14705
- *
14706
- * ## Why this is not a `deviceConfig` cap
14707
- *
14708
- * There is nothing to edit. A `deviceConfig` cap (D14) exists so the framework
14709
- * can DERIVE a settings form from `getOptions` + `getStatus` and route a flat
14710
- * patch back through a setter; it costs a `builderId` reducer in
14711
- * `device-config-contribution.ts` and a `*-config-schema.ts` beside it, and it
14712
- * renders a form section. This cap answers ONE question with ONE read and
14713
- * renders a button. Nothing about it is a form, so it carries no `deviceConfig`
14714
- * block, no `settings`, no `runtimeState` and no reducer — exactly like
14715
- * `reboot`, the other pure-RPC device-native cap.
14716
- *
14717
- * ## Absent, and the difference between "no page" and "we cannot say"
14718
- *
14719
- * The two are answered at DIFFERENT layers, on purpose:
14720
- *
14721
- * - **"We cannot say"** → the provider never registers the cap for that
14722
- * device. A VeSync humidifier, a Petkit feeder, a Dreame vacuum and a Dreo
14723
- * fan are reached only through a vendor cloud; there is no address to hand
14724
- * out and no page to open. A Tuya plug, a Wyze camera and a Gree air
14725
- * conditioner DO have a LAN IP, and still have no HTTP management page
14726
- * behind it. None of them register, so `deviceManager.getBindings` never
14727
- * lists the cap and no surface asks.
14728
- * - **"This device has no page, and I know that"** → the provider registers
14729
- * and `getAdminLink` returns `null`. This is the answer for a device whose
14730
- * sibling DOES have a page: a Reolink battery camera reached over UDP by
14731
- * `uid` with a blank `host`, an Ecowitt gateway configured in `listener`
14732
- * transport, a Home Assistant broker authenticated by supervisor token
14733
- * (which carries no `baseUrl` at all).
14734
- *
14735
- * Both draw NOTHING. A button that opens a browser error is worse than no
14736
- * button, and D62 is the same rule from the other side: an off switch is
14737
- * reported off, never made to look broken. There is no third state where the
14738
- * UI renders a disabled button "because the device might have a page".
14739
- *
14740
- * ## The URL never carries credentials
14741
- *
14742
- * Not in userinfo, not in a query string. Every provider builds through
14743
- * `buildDeviceAdminUrl` (`device-admin-link-url.ts`), which takes host, port,
14744
- * scheme and path as separate arguments — there is no parameter a secret could
14745
- * arrive in — and re-checks its own output for the `scheme://user:pass@` shape
14746
- * that `scripts/check-no-credential-urls-in-fixtures.ts` bans from recorded
14747
- * output. `scripts/check-admin-link-builder-is-the-only-url-source.ts` is what
14748
- * keeps providers from hand-rolling one anyway.
14749
- *
14750
- * This matters here more than anywhere else in the repo, because every provider
14751
- * that knows a device's host knows its PASSWORD too: `{ host, port, username,
14752
- * password }` sit in one object on Hikvision, Amcrest, Reolink and ONVIF alike,
14753
- * and `http://admin:hunter2@192.168.50.139/` is a URL a browser accepts. The
14754
- * camera's own page will ask for its own login. That is correct, and pre-
14755
- * filling it is the operator's business, not ours.
14756
- *
14757
- * ## It is a LAN fact
14758
- *
14759
- * The URL addresses the device where the NODE can see it. It is not proxied,
14760
- * not made reachable from outside, and not sent anywhere. A surface renders it
14761
- * as a link the operator's own browser follows, on the operator's own network,
14762
- * or renders nothing.
14763
- */
14764
- /**
14765
- * Whose page is it. The distinction is for the OPERATOR, who needs to know
14766
- * before clicking whether he is about to land on a camera's own web server or
14767
- * inside Home Assistant.
14768
- */
14769
- var AdminLinkTargetEnum = _enum(["device", "integration"]);
14770
- var DeviceAdminLinkSchema = object({
14771
- /**
14772
- * Absolute `http(s)://` URL. Built by `buildDeviceAdminUrl` and therefore
14773
- * free of userinfo and of any credential-shaped query key.
14774
- */
14775
- url: string(),
14776
- /**
14777
- * What the surface calls it — "Web UI", "Home Assistant", "UniFi controller".
14778
- * The PROVIDER names it, because only the provider knows what the page is;
14779
- * a UI that invented the label from the addon id would call the Home
14780
- * Assistant device page "Provider Homeassistant".
14781
- */
14782
- label: string(),
14783
- target: AdminLinkTargetEnum,
14784
- /**
14785
- * Host the URL points at, without scheme, port or path — for the tooltip, so
14786
- * an operator can see WHERE the button goes before he follows it. Redundant
14787
- * with `url` by construction; carried separately so no surface has to parse
14788
- * a URL to show it.
14789
- */
14790
- host: string()
14791
- });
14792
- var deviceAdminLinkCapability = {
14793
- name: "device-admin-link",
14794
- scope: "device",
14795
- deviceNative: true,
14796
- mode: "singleton",
14797
- methods: {
14798
- /**
14799
- * The device's management page, or `null` when this device has none.
14800
- *
14801
- * `auth: 'admin'` deliberately. This is administration, not actuation —
14802
- * the same bucket as `reboot` and `camera-credentials`, and explicitly NOT
14803
- * the actuation set `scripts/check-actuation-not-admin.ts` protects (D403).
14804
- * The URL is also a statement about the LAN, which a household member with
14805
- * a `view` grant on a light has no reason to be handed.
14806
- *
14807
- * The surfaces gate on the QUERY, never on a role they guessed: a caller
14808
- * without the right loses the query and draws nothing, which is the same
14809
- * thing a device with no page draws. There is no path on which a button
14810
- * appears and then fails — the D403 failure mode, from the other end.
14811
- */
14812
- getAdminLink: method(object({ deviceId: number().int().nonnegative() }), DeviceAdminLinkSchema.nullable(), { auth: "admin" }) }
14813
- };
14814
- /**
14815
14734
  * `device-export` — collection cap for addons that export camstack
14816
14735
  * devices to external ecosystems (HomeAssistant via MQTT discovery,
14817
14736
  * HomeKit/HAP, Alexa Smart Home, …).
@@ -19088,6 +19007,7 @@ sub("presence", "sensor", "sensor", "#22c55e", "presence", "Presence");
19088
19007
  sub("enum-sensor", "sensor", "sensor", TAXONOMY_COLORS.sensor, "generic", "Sensor state");
19089
19008
  sub("device-event", "sensor", "sensor", "#10b981", "button", "Device event");
19090
19009
  sub("lock", "control", "control", "#0ea5e9", "lock", "Lock");
19010
+ sub("cover", "control", "control", "#0ea5e9", "door", "Cover");
19091
19011
  sub("switch", "control", "control", TAXONOMY_COLORS.control, "switch", "Switch");
19092
19012
  sub("siren", "control", "control", "#dc2626", "siren", "Siren");
19093
19013
  sub("button", "control", "control", "#10b981", "button", "Button");
@@ -19406,6 +19326,10 @@ var NcSystemEventKindSchema = _enum([
19406
19326
  "alarm-disarmed",
19407
19327
  "alarm-arming",
19408
19328
  "alarm-arm-refused",
19329
+ "alarm-pending",
19330
+ "alarm-rearmed",
19331
+ "alarm-sensor-bypass",
19332
+ "alarm-check-failed",
19409
19333
  "addon-updated",
19410
19334
  "server-updated",
19411
19335
  "export-completed",
@@ -20001,6 +19925,19 @@ var NcMediaFrameSchema = _enum([
20001
19925
  "full",
20002
19926
  "boxed"
20003
19927
  ]);
19928
+ /**
19929
+ * How a SENSOR notification shows the cameras that link the sensor.
19930
+ *
19931
+ * `mosaic` — one image composed of every linked camera's photograph, taken at
19932
+ * the trigger. `each` — one image per camera where the target takes several
19933
+ * attachments; a target that takes one keeps the first camera's (the degrade
19934
+ * engine drops the rest by order). Either way ONE notification per event.
19935
+ * Absent = `mosaic`, applied by the Notification Center and deliberately NOT
19936
+ * a Zod default (see NcRulePatchSchema: a default materialises on every
19937
+ * partial patch). Meaningless for a rule whose subject is not a sensor, and a
19938
+ * sensor linked to one camera ships that camera's plain snapshot either way.
19939
+ */
19940
+ var NcLinkedCameraModeSchema = _enum(["mosaic", "each"]);
20004
19941
  var NcMediaPolicySchema = object({
20005
19942
  attach: _enum([
20006
19943
  "best",
@@ -20046,7 +19983,9 @@ var NcMediaPolicySchema = object({
20046
19983
  * A profile that is not assigned falls back to the cheapest, and the render
20047
19984
  * reports which one actually ran.
20048
19985
  */
20049
- profile: CamProfileSchema.optional()
19986
+ profile: CamProfileSchema.optional(),
19987
+ /** See {@link NcLinkedCameraModeSchema}. */
19988
+ linkedCameras: NcLinkedCameraModeSchema.optional()
20050
19989
  });
20051
19990
  /**
20052
19991
  * Cooldown GRANULARITY over the subject's class — how much a fired
@@ -20166,7 +20105,7 @@ var NcRuleInputSchema = object({
20166
20105
  cooldownSec: 60,
20167
20106
  scope: "rule-device"
20168
20107
  }),
20169
- /** `{{var}}` templating over camera/class/label/zones/confidence/time. */
20108
+ /** `{{var}}` title/body. The variables are declared in `NC_TEMPLATE_VARS` (@camstack/types) and depend on the rule kind — see `templateVarsFor`. */
20170
20109
  template: object({
20171
20110
  title: string().max(500).optional(),
20172
20111
  body: string().max(2e3).optional()
@@ -20346,6 +20285,22 @@ var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
20346
20285
  throttle: NcThrottleSchema.optional(),
20347
20286
  priority: number().int().min(1).max(5).optional()
20348
20287
  });
20288
+ var NcRuleClearableKeySchema = _enum([
20289
+ "template",
20290
+ "schedule",
20291
+ "targetUsers",
20292
+ "snoozeOptions",
20293
+ "snoozeAllowGlobal",
20294
+ "waitForEnhancement",
20295
+ "actions",
20296
+ "confirm",
20297
+ "groupIdleSec"
20298
+ ]);
20299
+ var NcRuleUpdateInputSchema = object({
20300
+ ruleId: string(),
20301
+ patch: NcRulePatchSchema,
20302
+ clear: array(NcRuleClearableKeySchema).optional()
20303
+ });
20349
20304
  /** A persisted rule. */
20350
20305
  var NcRuleSchema = NcRuleInputSchema.extend({
20351
20306
  id: string(),
@@ -20377,6 +20332,85 @@ var NcTestResultSchema = object({
20377
20332
  className: string().optional(),
20378
20333
  label: string().optional()
20379
20334
  });
20335
+ /** The five rule kinds, as data. `NcRuleKind` in `notification/rule-kinds.ts`
20336
+ * is the same union; the template-vars spec pins the two together. */
20337
+ var NcRuleKindSchema = _enum([
20338
+ "detection",
20339
+ "sensor",
20340
+ "occupancy",
20341
+ "sound",
20342
+ "system"
20343
+ ]);
20344
+ /** Which producer renders a template: an ordinary rule, a timelapse, a digest. */
20345
+ var NcTemplateFamilySchema = _enum([
20346
+ "rule",
20347
+ "timelapse",
20348
+ "summary"
20349
+ ]);
20350
+ /** Which text field of that producer. `previewText` is the timelapse frame
20351
+ * caption, `captionText` the digest mosaic caption — both see fewer vars. */
20352
+ var NcTemplateFieldSchema = _enum([
20353
+ "title",
20354
+ "body",
20355
+ "previewText",
20356
+ "captionText"
20357
+ ]);
20358
+ var NcTemplateVarGroupSchema = _enum([
20359
+ "subject",
20360
+ "place",
20361
+ "time",
20362
+ "rule",
20363
+ "occupancy",
20364
+ "sound",
20365
+ "sensor",
20366
+ "system",
20367
+ "digest",
20368
+ "ai"
20369
+ ]);
20370
+ /**
20371
+ * ONE `{{var}}` a notification template may name.
20372
+ *
20373
+ * `families` / `fields` / `kinds` / `deliveries` / `systemEventKinds` say WHERE
20374
+ * it has a value; absent = no restriction on that axis. `systemEventKinds` is
20375
+ * read only for a `system` rule. `dynamic` declares a FAMILY of names
20376
+ * (`count_<class>`): the descriptor's `name` is the example member.
20377
+ */
20378
+ var NcTemplateVarDescriptorSchema = object({
20379
+ name: string().regex(/^\w+$/),
20380
+ label: string(),
20381
+ description: string().optional(),
20382
+ example: string(),
20383
+ group: NcTemplateVarGroupSchema,
20384
+ families: array(NcTemplateFamilySchema).min(1),
20385
+ fields: array(NcTemplateFieldSchema).optional(),
20386
+ kinds: array(NcRuleKindSchema).optional(),
20387
+ deliveries: array(NcDeliverySchema).optional(),
20388
+ systemEventKinds: array(NcSystemEventKindSchema).optional(),
20389
+ dynamic: object({
20390
+ prefix: literal("count_"),
20391
+ from: literal("classes")
20392
+ }).optional()
20393
+ });
20394
+ /** Input to `previewTemplate` — the editor's own context, plus the draft text. */
20395
+ var NcTemplatePreviewInputSchema = object({
20396
+ context: object({
20397
+ family: NcTemplateFamilySchema,
20398
+ field: NcTemplateFieldSchema,
20399
+ kind: NcRuleKindSchema.optional(),
20400
+ delivery: NcDeliverySchema.optional(),
20401
+ systemEventKinds: array(NcSystemEventKindSchema).optional()
20402
+ }),
20403
+ template: object({
20404
+ title: string().max(500).optional(),
20405
+ body: string().max(2e3).optional()
20406
+ })
20407
+ });
20408
+ var NcTemplatePreviewSchema = object({
20409
+ title: string().nullable(),
20410
+ body: string().nullable(),
20411
+ /** Names the template uses that this context never fills — they render empty. */
20412
+ unknown: array(string())
20413
+ });
20380
20414
  var NcConditionDescriptorSchema = object({
20381
20415
  /** Field id inside `NcConditions` (or `'schedule'` for the rule-level group). */
20382
20416
  id: string(),
@@ -20540,6 +20574,14 @@ var NC_CONDITION_CATALOG = [
20540
20574
  value: "backup-completed",
20541
20575
  label: "Backup completed"
20542
20576
  },
20577
+ {
20578
+ value: "alarm-arm-refused",
20579
+ label: "Alarm arm refused"
20580
+ },
20581
+ {
20582
+ value: "alarm-check-failed",
20583
+ label: "Alarm check failed (armed anyway)"
20584
+ },
20543
20585
  {
20544
20586
  value: "alarm-arming",
20545
20587
  label: "Alarm arming (exit delay)"
@@ -20548,10 +20590,22 @@ var NC_CONDITION_CATALOG = [
20548
20590
  value: "alarm-armed",
20549
20591
  label: "Alarm armed"
20550
20592
  },
20593
+ {
20594
+ value: "alarm-pending",
20595
+ label: "Alarm entry delay started"
20596
+ },
20551
20597
  {
20552
20598
  value: "alarm-triggered",
20553
20599
  label: "Alarm triggered"
20554
20600
  },
20601
+ {
20602
+ value: "alarm-rearmed",
20603
+ label: "Alarm re-armed after siren"
20604
+ },
20605
+ {
20606
+ value: "alarm-sensor-bypass",
20607
+ label: "Alarm sensor bypass"
20608
+ },
20555
20609
  {
20556
20610
  value: "alarm-disarmed",
20557
20611
  label: "Alarm disarmed"
@@ -21101,8 +21155,17 @@ object({
21101
21155
  lastAt: number()
21102
21156
  });
21103
21157
  /**
21104
- * The three durations the panel's state machine runs on, plus who hears about
21105
- * an arm.
21158
+ * The per-mode lists, at most one per mode. Two lists for one mode have no
21159
+ * meaning a reader could agree on (union? the last one?), so they are refused
21160
+ * at the boundary rather than interpreted.
21161
+ */
21162
+ var NcAlarmNonBlockingListSchema = array(object({
21163
+ mode: AlarmArmModeSchema,
21164
+ deviceIds: array(number().int()).max(200)
21165
+ })).max(8).refine((lists) => new Set(lists.map((l) => l.mode)).size === lists.length, { message: "nonBlocking: at most one list per arm mode" });
21166
+ /**
21167
+ * The three durations the panel's state machine runs on, who hears about its
21168
+ * transitions, and which openings each mode tolerates.
21106
21169
  *
21107
21170
  * They live on the NOTIFICATION-RULES cap, not on `alarm-panel`, on purpose:
21108
21171
  * `alarm-panel` is `deviceNative` and its other provider mirrors somebody
@@ -21121,21 +21184,39 @@ var NcAlarmSettingsSchema = object({
21121
21184
  * existed, and therefore what an untouched install keeps doing.
21122
21185
  */
21123
21186
  triggeredDurationSec: number().int().min(0).max(3600),
21124
- /** Send a notification when a mode takes effect. */
21125
- announceArm: boolean(),
21126
21187
  /**
21127
- * Where that notification goes. Target ids from `notification-output`.
21188
+ * Deprecated by D630 — every transition is announced. Parsed, never read;
21189
+ * remove after one release. Optional so an older admin's patch (which still
21190
+ * sends it) parses rather than failing the whole save.
21191
+ */
21192
+ announceArm: boolean().optional(),
21193
+ /**
21194
+ * Target ids from `notification-output`: every alarm transition goes here.
21128
21195
  *
21129
- * Explicit rather than "everyone": an arm announcement is a household
21196
+ * Explicit rather than "everyone": an alarm announcement is a household
21130
21197
  * message, and broadcasting it to every configured endpoint (including a
21131
21198
  * webhook wired to something else) is not a default anybody would choose.
21132
- * Empty with `announceArm: true` sends nothing, and the server logs that —
21133
- * silence must be attributable.
21199
+ * Empty sends nothing, and the server logs that — silence must be
21200
+ * attributable.
21134
21201
  */
21135
- announceTargets: array(string().min(1)).max(16)
21202
+ announceTargets: array(string().min(1)).max(16),
21203
+ /**
21204
+ * Per arm mode, the covered devices whose being OPEN does not refuse the
21205
+ * arm (a window left ajar for the cat under `home`, say). At most one entry
21206
+ * per mode is meaningful. Defaulted to `[]` so a blob stored before D630
21207
+ * parses as "every opening blocks" — the behaviour it was written under.
21208
+ */
21209
+ nonBlocking: NcAlarmNonBlockingListSchema.default([])
21136
21210
  });
21137
- /** Every field optional — a tab edits one control at a time. */
21138
- var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.partial();
21211
+ /**
21212
+ * Every field optional — a tab edits one control at a time.
21213
+ *
21214
+ * `nonBlocking` is re-declared WITHOUT its default: `.partial()` does not
21215
+ * remove an inner `.default()`, so a patch that never named the field would
21216
+ * parse to `nonBlocking: []` and wipe every mode's list on an unrelated edit
21217
+ * (the same trap {@link NcRulePatchSchema} documents).
21218
+ */
21219
+ var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.extend({ nonBlocking: NcAlarmNonBlockingListSchema }).partial();
21139
21220
  /**
21140
21221
  * What one arm mode actually arms, DERIVED from the enabled rules gated on it.
21141
21222
  * Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
@@ -21180,6 +21261,36 @@ var NcAlarmModeCoverageSchema = object({
21180
21261
  */
21181
21262
  skippedDevices: array(NcAlarmSkippedDeviceSchema).default([])
21182
21263
  });
21264
+ /** One covered device that reads open, and whether that refuses the arm. */
21265
+ var NcAlarmOpeningSchema = object({
21266
+ deviceId: number().int(),
21267
+ name: string(),
21268
+ /** The device's state word as read (`open`, `unlocked`, …). */
21269
+ state: string(),
21270
+ /** False when the mode's non-blocking list names this device. */
21271
+ blocking: boolean()
21272
+ });
21273
+ /** A device the panel is currently ignoring, and which side of it it is on. */
21274
+ var NcAlarmExclusionViewSchema = object({
21275
+ deviceId: number().int(),
21276
+ name: string(),
21277
+ phase: _enum(["open", "closed"])
21278
+ });
21279
+ /** One mode's openings: devices read open, plus those whose state is unknown. */
21280
+ var NcAlarmModeOpeningsSchema = object({
21281
+ mode: AlarmArmModeSchema,
21282
+ devices: array(NcAlarmOpeningSchema),
21283
+ /** Covered devices whose state could not be read (D49): neither open nor closed. */
21284
+ unknown: array(number().int())
21285
+ });
21286
+ var NcAlarmLiveSchema = object({
21287
+ state: AlarmStateSchema,
21288
+ /** The mode being armed into (exit delay) or held; null when disarmed. */
21289
+ targetMode: AlarmArmModeSchema.nullable(),
21290
+ availableModes: array(AlarmArmModeSchema),
21291
+ openings: array(NcAlarmModeOpeningsSchema),
21292
+ exclusions: array(NcAlarmExclusionViewSchema)
21293
+ });
21183
21294
  var NcAlarmConfigSchema = object({
21184
21295
  /**
21185
21296
  * The panel's device id, or null when this install has no panel (the ensure
@@ -21189,7 +21300,13 @@ var NcAlarmConfigSchema = object({
21189
21300
  */
21190
21301
  deviceId: number().int().nullable(),
21191
21302
  settings: NcAlarmSettingsSchema,
21192
- coverage: array(NcAlarmModeCoverageSchema)
21303
+ coverage: array(NcAlarmModeCoverageSchema),
21304
+ /**
21305
+ * The panel as it is NOW — state, what each mode would find open, what is
21306
+ * excluded. Optional: a panel-less hub answers without it, and a client
21307
+ * must not read its absence as "nothing is open".
21308
+ */
21309
+ live: NcAlarmLiveSchema.optional()
21193
21310
  });
21194
21311
  /**
21195
21312
  * ONE rule's demand on ONE camera's clip ring.
@@ -21245,10 +21362,7 @@ var notificationRulesCapability = {
21245
21362
  auth: "admin",
21246
21363
  caller: "required"
21247
21364
  }),
21248
- updateRule: method(object({
21249
- ruleId: string(),
21250
- patch: NcRulePatchSchema
21251
- }), object({ rule: NcRuleSchema }), {
21365
+ updateRule: method(NcRuleUpdateInputSchema, object({ rule: NcRuleSchema }), {
21252
21366
  kind: "mutation",
21253
21367
  auth: "admin",
21254
21368
  caller: "required"
@@ -21336,6 +21450,18 @@ var notificationRulesCapability = {
21336
21450
  catalog: array(NcConditionDescriptorSchema),
21337
21451
  taxonomy: NcTaxonomySchema.optional()
21338
21452
  })),
21453
+ /** The declared `{{var}}` vocabulary; editors filter it with `templateVarsFor`. */
21454
+ getTemplateCatalog: method(object({}), object({ vars: array(NcTemplateVarDescriptorSchema) })),
21455
+ /**
21456
+ * Render a template with example values, through the hub's text catalog.
21457
+ * Pure: sends nothing. A MUTATION only for transport — a 2.5k-char draft in
21458
+ * a batched GET URL risks length limits — so access stays `view`, the same
21459
+ * as `getTemplateCatalog`.
21460
+ */
21461
+ previewTemplate: method(NcTemplatePreviewInputSchema, NcTemplatePreviewSchema, {
21462
+ kind: "mutation",
21463
+ access: "view"
21464
+ }),
21339
21465
  /**
21340
21466
  * Queryable delivery history — a read-only view over the durable outbox
21341
21467
  * (fired rule, subject summary, target, status, timestamps, error on a
@@ -21390,7 +21516,10 @@ var notificationRulesCapability = {
21390
21516
  caller: "required"
21391
21517
  }),
21392
21518
  /**
21393
- * The alarm panel's durations, plus what each mode ACTUALLY arms.
21519
+ * The alarm panel's settings, what each mode ACTUALLY arms, and — when a
21520
+ * panel exists — its `live` state: current state and target mode, what
21521
+ * each mode would find open (blocking or not, and what is unknown), and
21522
+ * the devices currently excluded.
21394
21523
  *
21395
21524
  * Coverage is returned by the same call as the settings on purpose: they
21396
21525
  * are read together or not at all. An editor that showed the delays
@@ -21400,7 +21529,9 @@ var notificationRulesCapability = {
21400
21529
  */
21401
21530
  getAlarmConfig: method(object({}), NcAlarmConfigSchema, { auth: "admin" }),
21402
21531
  /**
21403
- * Patch the durations. Returns the WHOLE config, coverage included, so a
21532
+ * Patch the settings (durations, recipients, per-mode non-blocking lists;
21533
+ * `announceArm` is accepted and ignored — D630). Returns the WHOLE config,
21534
+ * coverage and `live` included, so a
21404
21535
  * client never has to guess what the server settled on — the panel clamps
21405
21536
  * and normalises, and a form that re-rendered from its own input would
21406
21537
  * show a value the alarm is not using.
@@ -27257,6 +27388,7 @@ var CAP_TO_KIND = {
27257
27388
  "enum-sensor": "enum-sensor",
27258
27389
  "event-emitter": "device-event",
27259
27390
  "lock-control": "lock",
27391
+ cover: "cover",
27260
27392
  switch: "switch",
27261
27393
  button: "button",
27262
27394
  doorbell: "doorbell"
@@ -28452,6 +28584,87 @@ var storageProviderCapability = {
28452
28584
  })
28453
28585
  }
28454
28586
  };
28587
+ /**
28588
+ * The signals a device can emit to WAKE its own stream.
28589
+ *
28590
+ * A camera whose stream is built on demand sleeps until something asks for it,
28591
+ * and "something" cannot be a consumer that is merely attached — a Frigate-style
28592
+ * puller holds a session open for ever, and treating that as demand would keep
28593
+ * a battery camera awake for ever, which is the whole thing the battery is for
28594
+ * (D173). So the wake has to come from the CAMERA: an event it noticed by
28595
+ * itself, with no stream running.
28596
+ *
28597
+ * ## The vocabulary is the PROVIDER'S, not ours
28598
+ *
28599
+ * Like `consumables`, this cap declares no vocabulary of its own. A provider
28600
+ * names each signal with a `code` it chooses and a `label` an operator reads.
28601
+ * Reolink offers motion and camera-native detection; another provider may offer
28602
+ * a tamper, a doorbell press, a PIR, or something no camera in this fleet has
28603
+ * yet. A fixed enum here would mean every new signal is a framework release.
28604
+ *
28605
+ * It is deliberately NOT derived from the caps a device already binds. Whether
28606
+ * a camera CAN push firmware motion is expressed by `motionSources` containing
28607
+ * `'onboard'`, and whether it does AI on-camera by the `native-object-detection`
28608
+ * binding — but both answer "what drives the detection pipeline", which is a
28609
+ * different question from "what may wake a sleeping stream". A camera can do
28610
+ * the first and not be trusted with the second, and the operator picks per
28611
+ * camera. Two questions, two authorities.
28612
+ *
28613
+ * ## Availability is not permission
28614
+ *
28615
+ * `listSignals` says what the device CAN emit. Whether a given signal actually
28616
+ * wakes the stream is the operator's per-camera choice, held by the broker
28617
+ * alongside the cooldown — see the stream-broker cap's wake settings. A
28618
+ * provider declaring a signal is not a provider enabling it.
28619
+ */
28620
+ /** One signal a device can emit. */
28621
+ var StreamSignalSchema = object({
28622
+ /** Stable id chosen by the provider, e.g. `'motion'`, `'person'`, `'tamper'`. */
28623
+ code: string().min(1),
28624
+ /** What an operator reads in the picker. The provider's own wording. */
28625
+ label: string().min(1),
28626
+ /**
28627
+ * Whether the provider recommends this signal ON when a camera is first set
28628
+ * up. A provider knows which of its signals are cheap and reliable; an
28629
+ * operator should not have to discover that by trial. Reolink recommends
28630
+ * both of its own.
28631
+ */
28632
+ recommended: boolean()
28633
+ });
28634
+ var StreamSignalsStatusSchema = object({
28635
+ signals: array(StreamSignalSchema),
28636
+ lastFetchedAt: number()
28637
+ });
28638
+ var streamSignalsCapability = {
28639
+ name: "stream-signals",
28640
+ scope: "device",
28641
+ deviceNative: true,
28642
+ mode: "singleton",
28643
+ deviceTypes: Object.values(DeviceType),
28644
+ runtimeState: StreamSignalsStatusSchema,
28645
+ /**
28646
+ * Runtime-state durability: **session** — mirrored in RAM, never written.
28647
+ *
28648
+ * The slice holds what the DEVICE says it can emit. That is a probed fact,
28649
+ * not an operator choice: the provider re-declares it on every registration,
28650
+ * so losing it loses nothing and persisting it would freeze an answer the
28651
+ * camera is entitled to change. Measured the same day on the sibling case —
28652
+ * `native-object-detection.supportedClasses` was persisted, and a firmware
28653
+ * class the camera really detected stayed missing for the life of the row
28654
+ * because the fix could not reach it.
28655
+ *
28656
+ * See `RuntimeStateDurability`. Enforced by
28657
+ * `scripts/check-runtime-state-durability.ts`.
28658
+ */
28659
+ durability: "session",
28660
+ methods: {
28661
+ /**
28662
+ * What this device can emit. Empty is a valid and common answer — most
28663
+ * cameras have nothing to offer here, and an empty list is what makes the
28664
+ * broker's picker show nothing rather than a false choice.
28665
+ */
28666
+ listSignals: method(_void(), array(StreamSignalSchema).readonly()) }
28667
+ };
28455
28668
  /** Profile-exported FormBuilder schema. Shape is ConfigUISchema at the UI. */
28456
28669
  var ProfileSettingsSchemaBridge = unknown().nullable();
28457
28670
  var ProfileSettingsBagSchema = record(string(), unknown());
@@ -31685,6 +31898,179 @@ getCredentials: method(object({ deviceId: number() }), CameraCredentialsSchema.n
31685
31898
  }
31686
31899
  };
31687
31900
  /**
31901
+ * camera-grid-layout — the geometry of a COMPOSITE camera, on the camera's own
31902
+ * page.
31903
+ *
31904
+ * ## Why this is a capability and not an addon settings schema
31905
+ *
31906
+ * It was one, and it did not render. The addon declared the editor as a
31907
+ * `type: 'widget'` field inside its own `deviceSettingsSchema()`; the hub
31908
+ * returned that section correctly and `ConfigFormField` renders `type:'widget'`
31909
+ * perfectly well — and nothing ever asked camera-grid for it. The Cluster →
31910
+ * Pipeline → Device Overrides page interrogates a HAND-WRITTEN list of four
31911
+ * addons (`PIPELINE_CLUSTER_DEVICE_ADDONS`), whose own comment says an addon
31912
+ * not on it "falls off silently".
31913
+ *
31914
+ * Adding a fifth name to that list would have been the wrong fix twice over:
31915
+ * that page is per-camera DETECTION tuning, and a grid's geometry belongs
31916
+ * beside PTZ and motion zones on the camera itself. The device page is
31917
+ * BINDING-driven (D12), so the way in is a capability bound to the device —
31918
+ * and this cap carries its section the way `recording` does, by RETURNING it
31919
+ * from `getDeviceSettingsContribution`.
31920
+ *
31921
+ * Seven other widgets are still declared the other way, through a
31922
+ * `deviceConfig.ui` block the framework derives a section from. That route
31923
+ * gives the addon no say in where its own panel lands and no way to decline
31924
+ * for a device the panel does not suit, which is why this one does not use it.
31925
+ *
31926
+ * ## Why one addon may implement it
31927
+ *
31928
+ * It is a device-scoped NATIVE cap, registered by the grid camera device
31929
+ * itself. Nothing else declares a composite camera, so nothing else has a
31930
+ * layout — and the device-scoped route means the widget asks THE camera, not
31931
+ * "the camera-grid addon", which is what let the old custom-action pair be
31932
+ * reached only by a caller that already knew the addon id.
31933
+ *
31934
+ * ## The tab
31935
+ *
31936
+ * `streaming`, not a top-tab of its own. A grid's geometry IS what its stream
31937
+ * is, so the Streaming tab is where it belongs; a `grid` top-tab would need an
31938
+ * entry in `WELL_KNOWN_TAB_MAP` or the device page renders the raw id as the
31939
+ * label (measured on the robot camera, 2026-09-06 — a tab called "navigation"
31940
+ * next to "PTZ").
31941
+ */
31942
+ /** A rectangle in normalized [0,1] coordinates of whatever contains it. */
31943
+ var GridNormalizedRectSchema = object({
31944
+ x: number().min(0).max(1),
31945
+ y: number().min(0).max(1),
31946
+ width: number().gt(0).max(1),
31947
+ height: number().gt(0).max(1)
31948
+ });
31949
+ /**
31950
+ * One source camera, the part of its picture taken, and where that part lands.
31951
+ *
31952
+ * Both rectangles are NORMALIZED (D519): a source camera can change resolution
31953
+ * — a profile switch, a firmware update, a substream that comes back different
31954
+ * — and a stored PIXEL rectangle would quietly start cutting the wrong region,
31955
+ * which is the class of bug nobody files.
31956
+ */
31957
+ var GridLayoutCellSchema = object({
31958
+ deviceId: number().int().positive(),
31959
+ /** The part of the SOURCE taken, normalized against the source. */
31960
+ source: GridNormalizedRectSchema,
31961
+ /** Where it lands, normalized against the CANVAS. */
31962
+ cell: GridNormalizedRectSchema
31963
+ });
31964
+ /**
31965
+ * Which profiles this grid can actually compose, and why not.
31966
+ *
31967
+ * A grid's `high` composes its sources' `high` and its `low` their `low`, so a
31968
+ * profile is on offer only when EVERY source can serve it. The refusal NAMES
31969
+ * the sources, because "this grid has no low" is not a finding — "615 has no
31970
+ * low" is, and it is the one an operator can act on.
31971
+ */
31972
+ var GridProfileOfferSchema = object({
31973
+ profile: _enum([
31974
+ "high",
31975
+ "mid",
31976
+ "low"
31977
+ ]),
31978
+ offered: boolean(),
31979
+ /** Sources that cannot serve it. Empty when it is offered, or when there are no cells. */
31980
+ missingSources: array(number().int().positive()),
31981
+ /**
31982
+ * The canvas this profile composes onto, `WxH`, or empty when it is not
31983
+ * offered. DERIVED from the cells and the sources' own size at this profile —
31984
+ * it is reported because nothing else in the system would ever say what the
31985
+ * grid came out as, and because it is the number an operator would otherwise
31986
+ * expect to type.
31987
+ */
31988
+ canvas: string(),
31989
+ /**
31990
+ * Whether this profile is PUBLISHED, of the ones the grid could serve.
31991
+ *
31992
+ * A grid's `high` is composed of its sources' `high`, so on a 4K fleet it is
31993
+ * a 4K canvas built from 4K decodes — something to opt into, not something a
31994
+ * viewer's adaptive should be handed by climbing to the top rung it can see.
31995
+ * Default is `mid` + `low`.
31996
+ */
31997
+ published: boolean()
31998
+ });
31999
+ var GridLayoutViewSchema = object({
32000
+ /** The persisted grid row this camera was declared from. */
32001
+ instanceId: string(),
32002
+ deviceId: number().int().nonnegative(),
32003
+ name: string(),
32004
+ /**
32005
+ * NO canvas size. A grid's resolution is not authored: each profile derives
32006
+ * its own from the cells and its sources' dimensions. The two numbers that
32007
+ * used to be here were a text field that silently decided both how much the
32008
+ * composite cost and how sharp it was — see `profiles[].canvas` for what it
32009
+ * came out as.
32010
+ */
32011
+ fps: number().int(),
32012
+ cells: array(GridLayoutCellSchema),
32013
+ /** What the catalog will publish, and what it refuses to. Read-only. */
32014
+ profiles: array(GridProfileOfferSchema)
32015
+ });
32016
+ var GridLayoutPatchSchema = object({
32017
+ deviceId: number().int().nonnegative(),
32018
+ name: string().min(1).max(160).optional(),
32019
+ fps: number().int().min(1).max(60).optional(),
32020
+ /** Which profiles to publish. See `GridProfileOffer.published`. */
32021
+ publishedProfiles: array(_enum([
32022
+ "high",
32023
+ "mid",
32024
+ "low"
32025
+ ])).max(3).optional(),
32026
+ /**
32027
+ * The whole cell list at once. A per-cell patch would need an ordering the
32028
+ * editor does not have, and a half-applied layout is a picture nobody asked
32029
+ * for.
32030
+ */
32031
+ cells: array(GridLayoutCellSchema).max(16)
32032
+ });
32033
+ var cameraGridLayoutCapability = {
32034
+ name: "camera-grid-layout",
32035
+ scope: "device",
32036
+ deviceNative: true,
32037
+ mode: "singleton",
32038
+ deviceTypes: [DeviceType.Camera],
32039
+ /**
32040
+ * The section is built by the ADDON and returned from
32041
+ * `getDeviceSettingsContribution`, not derived by the framework from a
32042
+ * `deviceConfig.ui` block.
32043
+ *
32044
+ * Both mechanisms render the same widget. This one hands the addon two
32045
+ * things the framework-derived route cannot give it:
32046
+ *
32047
+ * - it chooses its own section, `tab`, `location` and `order`, the way any
32048
+ * other setting does, instead of receiving them from a cap declaration;
32049
+ * - it can DECLINE per device. A camera that is not a grid gets no section
32050
+ * at all, rather than a widget that renders its own "not a grid" state.
32051
+ *
32052
+ * `recording` is the precedent (`recorder/recording-device-settings.ts`): it
32053
+ * returns `null` for anything that is not a camera, so the Recording tab
32054
+ * never appears there.
32055
+ */
32056
+ exposesDeviceSettings: true,
32057
+ methods: {
32058
+ /**
32059
+ * The grid behind this device.
32060
+ *
32061
+ * `null` means ANSWERED and this camera is not a grid — not "not yet
32062
+ * known". The widget renders its "this is not a grid camera" state only
32063
+ * from this answer, never from an unresolved query (D315).
32064
+ */
32065
+ getLayout: method(object({ deviceId: number().int().nonnegative() }), GridLayoutViewSchema.nullable(), { auth: "admin" }),
32066
+ /** Write the geometry back. Returns the grid as it now stands, profiles included. */
32067
+ saveLayout: method(GridLayoutPatchSchema, GridLayoutViewSchema, {
32068
+ kind: "mutation",
32069
+ auth: "admin"
32070
+ })
32071
+ }
32072
+ };
32073
+ /**
31688
32074
  * Carbon-monoxide alarm sensor. Drives Home Assistant `binary_sensor`
31689
32075
  * entries with `device_class: carbon_monoxide`. Push-driven.
31690
32076
  */
@@ -32495,346 +32881,6 @@ var dayNightCapability = {
32495
32881
  volatileStateFields: ["lastFetchedAt"]
32496
32882
  };
32497
32883
  /**
32498
- * Vendor-neutral **onboard** recording + storage cap — what the CAMERA
32499
- * writes to the CAMERA's own card, on the camera's own schedule.
32500
- *
32501
- * This is NOT `recording.cap.ts`. That one is CamStack's recorder: our
32502
- * footage ledger, our storage locations, our retention. This one has a
32503
- * different authority — the camera's firmware — and per D62 it stores
32504
- * nothing of its own. Every value here is read from the camera and every
32505
- * write goes back to the camera; there is no CamStack-side mirror that
32506
- * could disagree with the device.
32507
- *
32508
- * ## One shape, two firmwares
32509
- *
32510
- * Measured 2026-09-22 against the live fleet:
32511
- *
32512
- * | fact | Hikvision (ISAPI) | Reolink (Baichuan) |
32513
- * | --- | --- | --- |
32514
- * | storage | `ContentMgmt/Storage` `<hdd>` rows: status, capacity, freeSpace (MB) | `getHddInfoList` (cmd 102): `mount`, `format`, `capacity` GB + `capacityM` MB remainder |
32515
- * | tracks | several (101 **and** 103 on both 1436 and 3833), each with its own schedule | one per channel |
32516
- * | schedule | per track, 7 `ScheduleAction` blocks: DayOfWeek + TimeOfDay range + ONE `ActionRecordingMode` | per trigger type, a 168-char weekly HOUR mask |
32517
- * | triggers | `CMR`, `MOTION` | `Normal`, `MD`, `people`, `vehicle`, `dog_cat`, `crossline`, `intrude`, `loitering` |
32518
- * | pre-record | `PreRecordTimeSeconds` | `preRecordTime` |
32519
- * | post-record | `PostRecordTimeSeconds` | `recordDelayTime` |
32520
- * | overwrite | per track `LoopEnable` | `cycle`, with `cycleList` enumerating the accepted values |
32521
- * | segment length | not exposed on V5.7.1 | `packageTime` (minutes) |
32522
- *
32523
- * The two schedule models look different and are the same thing in
32524
- * different coordinates: both answer "for this trigger, during which
32525
- * weekly windows does the camera record". {@link RecordWindow} is that
32526
- * question in one shape — Hikvision's ranges map straight onto it,
32527
- * Reolink's mask expands into hour-aligned windows.
32528
- *
32529
- * ## Union, not intersection
32530
- *
32531
- * **The same fields exist on every camera.** What differs per device is
32532
- * which VALUES that device accepts, and that is what {@link
32533
- * RecordingOnboardOptions} reports — a `{ readable, writable, reason }`
32534
- * per field plus the schedule's own limits. A control a camera cannot
32535
- * honour is rendered DISABLED WITH ITS REASON, never missing and never
32536
- * dead: disabled must not look like broken.
32537
- *
32538
- * ## Refusal by name
32539
- *
32540
- * A write a camera cannot honour is refused with a sentence the operator
32541
- * can read — never accepted and dropped. Both providers refuse through
32542
- * {@link describeOnboardRefusal}, so the vocabulary is one function and
32543
- * one test, not two hand-written vendor opinions.
32544
- *
32545
- * Follows the D14 `deviceConfig` archetype (see `stream-params.cap.ts`):
32546
- * `getOptions` advertises per-camera availability, `getStatus` (auto-
32547
- * injected from `status`) reports the live values, and a single
32548
- * `setSettings` mutation applies a partial change. No hand-written
32549
- * settings-contribution methods.
32550
- */
32551
- /**
32552
- * What makes the camera start recording during a window.
32553
- *
32554
- * The union of both vendors' vocabularies. `continuous` is Hikvision's
32555
- * `CMR` and Reolink's `Normal`; `motion` is `MOTION` / `MD`. The
32556
- * object-class triggers are Reolink-only today and the smart-event ones
32557
- * (`lineCrossing`, `intrusion`, `loitering`) are Reolink-only on the
32558
- * firmwares measured — a camera that cannot record on a trigger simply
32559
- * does not list it in `options.schedule.triggers`, and a window naming
32560
- * it is REFUSED, not dropped.
32561
- */
32562
- var RecordTriggerSchema = _enum([
32563
- "continuous",
32564
- "motion",
32565
- "person",
32566
- "vehicle",
32567
- "animal",
32568
- "lineCrossing",
32569
- "intrusion",
32570
- "loitering",
32571
- "alarmInput"
32572
- ]);
32573
- /**
32574
- * One weekly recording window: "on `day`, from `startMinute` to
32575
- * `endMinute`, record on `trigger`".
32576
- *
32577
- * `day` is 0 = Monday … 6 = Sunday (ISO order, which is also the order
32578
- * both firmwares enumerate). Minutes are local camera time since
32579
- * midnight; `endMinute` may be 1440, meaning end of day — that is
32580
- * Hikvision's literal `24:00` and Reolink's 24th mask slot, and
32581
- * collapsing it to 0 would turn a whole-day window into an empty one.
32582
- */
32583
- var RecordWindowSchema = object({
32584
- trigger: RecordTriggerSchema,
32585
- day: number().int().min(0).max(6),
32586
- startMinute: number().int().min(0).max(1439),
32587
- endMinute: number().int().min(1).max(1440)
32588
- });
32589
- /** Status of one physical volume, as the camera itself describes it. */
32590
- var OnboardStorageVolumeSchema = object({
32591
- /** The camera's own id for the volume (`hdd/id`, Reolink `HddInfo/number`). */
32592
- id: string(),
32593
- /** The camera's own name for it, when it gives one (`hddName`). */
32594
- label: string().optional(),
32595
- status: _enum([
32596
- "ok",
32597
- "unformatted",
32598
- "error",
32599
- "offline",
32600
- "unknown"
32601
- ]),
32602
- /**
32603
- * Total size in MB, or **null when the camera did not say**.
32604
- *
32605
- * Never 0 for an unreadable value: a measurement that failed is not a
32606
- * measurement (D393), and a card whose size is unknown must not be
32607
- * rendered as a card of size zero.
32608
- */
32609
- capacityMb: number().nullable(),
32610
- /**
32611
- * Free space in MB, or null when unknown.
32612
- *
32613
- * **Not a proxy for "has footage".** Measured 2026-09-22: 1436 and
32614
- * 1439 both report exactly 11776 MB free — the fixed reserve a looping
32615
- * card converges on once it has wrapped. At loop steady state the
32616
- * number is identical whether the camera recorded yesterday or stopped
32617
- * a month ago.
32618
- */
32619
- freeMb: number().nullable(),
32620
- /** True when the camera reports the volume writable (`property` RW). */
32621
- writable: boolean().optional()
32622
- });
32623
- /**
32624
- * What the camera is doing with its own storage, right now.
32625
- *
32626
- * Every scalar is nullable and **null means the camera did not answer**,
32627
- * never a default. A form that seeds `0` from an unanswered read invites
32628
- * the operator to save that 0 back onto the camera.
32629
- */
32630
- var RecordingOnboardStatusSchema = object({
32631
- storage: discriminatedUnion("kind", [
32632
- object({
32633
- kind: literal("present"),
32634
- volumes: array(OnboardStorageVolumeSchema)
32635
- }),
32636
- object({
32637
- kind: literal("absent"),
32638
- reason: string()
32639
- }),
32640
- object({
32641
- kind: literal("unknown"),
32642
- reason: string()
32643
- })
32644
- ]),
32645
- tracks: array(object({
32646
- id: string(),
32647
- enabled: boolean(),
32648
- isVideo: boolean(),
32649
- /** From the camera's own track description. Null when it does not say. */
32650
- codec: string().nullable(),
32651
- resolution: string().nullable(),
32652
- /** Per-track overwrite flag, where the firmware keeps it per track. */
32653
- overwriteWhenFull: boolean().nullable()
32654
- })),
32655
- /**
32656
- * The track the write path targets — the enabled VIDEO one. Null when
32657
- * no track could be identified, which is itself a refusal reason.
32658
- */
32659
- primaryTrackId: string().nullable(),
32660
- /** Master "record to the card at all" switch. */
32661
- enabled: boolean().nullable(),
32662
- overwriteWhenFull: boolean().nullable(),
32663
- preRecordSec: number().nullable(),
32664
- postRecordSec: number().nullable(),
32665
- /** Length of one recorded file, in minutes. */
32666
- segmentMinutes: number().nullable(),
32667
- /** The primary track's weekly windows, flattened. */
32668
- windows: array(RecordWindowSchema),
32669
- /**
32670
- * How many windows the camera described that CamStack could NOT read —
32671
- * an unrecognised trigger, an unparseable clock, a weekday it does not
32672
- * name.
32673
- *
32674
- * A dropped window is work the reader threw away, and a schedule that
32675
- * silently shows fewer rows than the camera holds is how an operator
32676
- * saves back a schedule shorter than the one they were looking at
32677
- * (D391). Non-zero means the window list is INCOMPLETE and a write
32678
- * that replaces it would delete what was not shown — which is why a
32679
- * provider reporting a non-zero count also reports the schedule as not
32680
- * writable.
32681
- */
32682
- unreadableWindows: number(),
32683
- /**
32684
- * The camera is scheduled to record and has NO usable storage.
32685
- *
32686
- * A first-class fact because it is the fleet's most common silent
32687
- * defect: measured 2026-09-22, 1441 and 3831 are both motion-recording
32688
- * to a card that is not there. Neither the schedule nor the storage
32689
- * read says anything wrong on its own; only the pair does.
32690
- */
32691
- recordingToNowhere: boolean(),
32692
- lastFetchedAt: number()
32693
- });
32694
- /** Numeric range descriptor — `{ min, max, step }` per the getOptions convention. */
32695
- var RangeSchema = object({
32696
- min: number(),
32697
- max: number(),
32698
- step: number()
32699
- });
32700
- /**
32701
- * The values a camera actually takes for a numeric field, when they are a SET
32702
- * rather than a range.
32703
- *
32704
- * `{min,max,step}` cannot say what these two firmwares do. Measured on 1436
32705
- * (I91DN) on 2026-09-22 by writing each value and reading it back:
32706
- *
32707
- * - pre-record: `0, 5, 10, 15, 20, 25, 30` and `2147483647` (INT32_MAX, the
32708
- * camera's "no limit" — `-1` and `4294967295` both land on it);
32709
- * - post-record: `5, 10, 30, 60, 120, 300, 600`.
32710
- *
32711
- * Neither is expressible as a step: the first has a sentinel two billion away
32712
- * from its neighbours, the second doubles and then jumps. A range that tried
32713
- * would forbid values the camera takes AND permit values it silently replaces
32714
- * with 5 — wrong in both directions at once.
32715
- *
32716
- * `sentinel` names the member that is not a duration, so a surface can render
32717
- * "no limit" instead of `2147483647` seconds.
32718
- */
32719
- var AllowedValuesSchema = object({
32720
- values: array(number()).min(1),
32721
- sentinel: object({
32722
- value: number(),
32723
- meaning: _enum(["no-limit", "disabled"])
32724
- }).optional()
32725
- });
32726
- /**
32727
- * Per-field availability on ONE camera.
32728
- *
32729
- * The field exists on every camera — this says whether this one can be
32730
- * read and whether it can be written, and `reason` says why not when
32731
- * either is false. The UI renders the control DISABLED with the reason
32732
- * rather than hiding it, so a limitation is legible instead of looking
32733
- * like a missing feature.
32734
- */
32735
- var OnboardFieldSupportSchema = object({
32736
- readable: boolean(),
32737
- writable: boolean(),
32738
- /** Required whenever `readable` or `writable` is false. */
32739
- reason: string().optional()
32740
- });
32741
- /** What this camera's schedule model can express. */
32742
- var OnboardScheduleSupportSchema = object({
32743
- support: OnboardFieldSupportSchema,
32744
- /**
32745
- * The smallest time step the camera can express, in minutes.
32746
- *
32747
- * Hikvision takes arbitrary minutes (`00:05:00`–`23:57:00` observed on
32748
- * 1436's track 103). Reolink's schedule is a 7×24 HOUR mask, so 60. A
32749
- * window whose edges are not a multiple of this is REFUSED rather than
32750
- * quietly rounded — rounding is how an operator's 06:30 becomes 06:00
32751
- * and nothing says so.
32752
- */
32753
- granularityMinutes: number(),
32754
- /** Triggers this camera can record on. A window naming another is refused. */
32755
- triggers: array(RecordTriggerSchema),
32756
- /**
32757
- * False when the camera stores ONE trigger per time range, so two
32758
- * windows overlapping on the same day cannot carry different triggers.
32759
- * True on Reolink, whose mask is per-trigger and independent.
32760
- */
32761
- supportsOverlappingTriggers: boolean()
32762
- });
32763
- var RecordingOnboardOptionsSchema = object({
32764
- enabled: OnboardFieldSupportSchema,
32765
- overwriteWhenFull: OnboardFieldSupportSchema,
32766
- preRecordSec: OnboardFieldSupportSchema,
32767
- preRecordSecRange: RangeSchema.optional(),
32768
- /** Preferred over the range when the camera takes a SET, not a span. */
32769
- preRecordSecAllowed: AllowedValuesSchema.optional(),
32770
- postRecordSec: OnboardFieldSupportSchema,
32771
- postRecordSecRange: RangeSchema.optional(),
32772
- /** Preferred over the range when the camera takes a SET, not a span. */
32773
- postRecordSecAllowed: AllowedValuesSchema.optional(),
32774
- segmentMinutes: OnboardFieldSupportSchema,
32775
- segmentMinutesRange: RangeSchema.optional(),
32776
- /** Preferred over the range when the camera takes a SET, not a span. */
32777
- segmentMinutesAllowed: AllowedValuesSchema.optional(),
32778
- schedule: OnboardScheduleSupportSchema
32779
- });
32780
- /**
32781
- * A partial change. Every field optional.
32782
- *
32783
- * Unlike the other `deviceConfig` caps, a provider here does **NOT**
32784
- * silently ignore a field it cannot support — it refuses, by name,
32785
- * through {@link describeOnboardRefusal}. Silence on a recording setting
32786
- * is the failure D62 exists to prevent: the operator believes the camera
32787
- * is recording the way the form says, and it is not.
32788
- */
32789
- var RecordingOnboardPatchSchema = object({
32790
- enabled: boolean().optional(),
32791
- overwriteWhenFull: boolean().optional(),
32792
- preRecordSec: number().optional(),
32793
- postRecordSec: number().optional(),
32794
- segmentMinutes: number().optional(),
32795
- /** The complete new window set for the primary track — not a delta. */
32796
- windows: array(RecordWindowSchema).optional()
32797
- });
32798
- var recordingOnboardCapability = {
32799
- name: "recording-onboard",
32800
- scope: "device",
32801
- deviceNative: true,
32802
- mode: "singleton",
32803
- deviceTypes: [DeviceType.Camera],
32804
- deviceConfig: { ui: {
32805
- kind: "derived-form",
32806
- builderId: "recording-onboard",
32807
- tab: "recording"
32808
- } },
32809
- methods: {
32810
- getOptions: method(object({ deviceId: number() }), RecordingOnboardOptionsSchema),
32811
- setSettings: method(object({
32812
- deviceId: number(),
32813
- settings: RecordingOnboardPatchSchema
32814
- }), _void(), {
32815
- kind: "mutation",
32816
- auth: "admin"
32817
- })
32818
- },
32819
- status: {
32820
- schema: RecordingOnboardStatusSchema,
32821
- kind: "poll"
32822
- },
32823
- runtimeState: RecordingOnboardStatusSchema,
32824
- /**
32825
- * Runtime-state durability: **restored** — operator-set camera-side
32826
- * recording config; mutation-driven, and the storage half is the last
32827
- * thing the camera said about its own card.
32828
- *
32829
- * See `RuntimeStateDurability`. Enforced by
32830
- * `scripts/check-runtime-state-durability.ts`.
32831
- */
32832
- durability: "restored",
32833
- /** Clock fields: written, but excluded from the compare that decides
32834
- * whether persisting is worth a SQLite commit. */
32835
- volatileStateFields: ["lastFetchedAt"]
32836
- };
32837
- /**
32838
32884
  * Generic device-level status snapshot. Auto-registered by `BaseDevice`
32839
32885
  * for every device, regardless of provider — the kernel needs a uniform
32840
32886
  * cap-keyed slice for the basic device flags every consumer expects to
@@ -33053,40 +33099,6 @@ var eventEmitterCapability = {
33053
33099
  */
33054
33100
  durability: "session"
33055
33101
  };
33056
- var EventItemSchema = object({
33057
- id: string(),
33058
- type: string(),
33059
- timestamp: number(),
33060
- label: string().optional(),
33061
- thumbnailUrl: string().optional(),
33062
- clipUrl: string().optional(),
33063
- metadata: record(string(), unknown()).optional()
33064
- });
33065
- var eventsCapability = {
33066
- name: "events",
33067
- scope: "device",
33068
- mode: "singleton",
33069
- deviceTypes: [DeviceType.Camera],
33070
- methods: {
33071
- getEvents: method(object({
33072
- deviceId: number(),
33073
- from: number().optional(),
33074
- to: number().optional(),
33075
- limit: number().optional()
33076
- }), array(EventItemSchema)),
33077
- getEventThumbnail: method(object({
33078
- deviceId: number(),
33079
- eventId: string()
33080
- }), object({
33081
- base64: string(),
33082
- contentType: string()
33083
- }).nullable()),
33084
- getEventClipUrl: method(object({
33085
- deviceId: number(),
33086
- eventId: string()
33087
- }), string().nullable())
33088
- }
33089
- };
33090
33102
  var IdentitySchema = object({
33091
33103
  id: string(),
33092
33104
  name: string(),
@@ -35574,179 +35586,6 @@ var motionTriggerCapability = {
35574
35586
  durability: "session"
35575
35587
  };
35576
35588
  /**
35577
- * camera-grid-layout — the geometry of a COMPOSITE camera, on the camera's own
35578
- * page.
35579
- *
35580
- * ## Why this is a capability and not an addon settings schema
35581
- *
35582
- * It was one, and it did not render. The addon declared the editor as a
35583
- * `type: 'widget'` field inside its own `deviceSettingsSchema()`; the hub
35584
- * returned that section correctly and `ConfigFormField` renders `type:'widget'`
35585
- * perfectly well — and nothing ever asked camera-grid for it. The Cluster →
35586
- * Pipeline → Device Overrides page interrogates a HAND-WRITTEN list of four
35587
- * addons (`PIPELINE_CLUSTER_DEVICE_ADDONS`), whose own comment says an addon
35588
- * not on it "falls off silently".
35589
- *
35590
- * Adding a fifth name to that list would have been the wrong fix twice over:
35591
- * that page is per-camera DETECTION tuning, and a grid's geometry belongs
35592
- * beside PTZ and motion zones on the camera itself. The device page is
35593
- * BINDING-driven (D12), so the way in is a capability bound to the device —
35594
- * and this cap carries its section the way `recording` does, by RETURNING it
35595
- * from `getDeviceSettingsContribution`.
35596
- *
35597
- * Seven other widgets are still declared the other way, through a
35598
- * `deviceConfig.ui` block the framework derives a section from. That route
35599
- * gives the addon no say in where its own panel lands and no way to decline
35600
- * for a device the panel does not suit, which is why this one does not use it.
35601
- *
35602
- * ## Why one addon may implement it
35603
- *
35604
- * It is a device-scoped NATIVE cap, registered by the grid camera device
35605
- * itself. Nothing else declares a composite camera, so nothing else has a
35606
- * layout — and the device-scoped route means the widget asks THE camera, not
35607
- * "the camera-grid addon", which is what let the old custom-action pair be
35608
- * reached only by a caller that already knew the addon id.
35609
- *
35610
- * ## The tab
35611
- *
35612
- * `streaming`, not a top-tab of its own. A grid's geometry IS what its stream
35613
- * is, so the Streaming tab is where it belongs; a `grid` top-tab would need an
35614
- * entry in `WELL_KNOWN_TAB_MAP` or the device page renders the raw id as the
35615
- * label (measured on the robot camera, 2026-09-06 — a tab called "navigation"
35616
- * next to "PTZ").
35617
- */
35618
- /** A rectangle in normalized [0,1] coordinates of whatever contains it. */
35619
- var GridNormalizedRectSchema = object({
35620
- x: number().min(0).max(1),
35621
- y: number().min(0).max(1),
35622
- width: number().gt(0).max(1),
35623
- height: number().gt(0).max(1)
35624
- });
35625
- /**
35626
- * One source camera, the part of its picture taken, and where that part lands.
35627
- *
35628
- * Both rectangles are NORMALIZED (D519): a source camera can change resolution
35629
- * — a profile switch, a firmware update, a substream that comes back different
35630
- * — and a stored PIXEL rectangle would quietly start cutting the wrong region,
35631
- * which is the class of bug nobody files.
35632
- */
35633
- var GridLayoutCellSchema = object({
35634
- deviceId: number().int().positive(),
35635
- /** The part of the SOURCE taken, normalized against the source. */
35636
- source: GridNormalizedRectSchema,
35637
- /** Where it lands, normalized against the CANVAS. */
35638
- cell: GridNormalizedRectSchema
35639
- });
35640
- /**
35641
- * Which profiles this grid can actually compose, and why not.
35642
- *
35643
- * A grid's `high` composes its sources' `high` and its `low` their `low`, so a
35644
- * profile is on offer only when EVERY source can serve it. The refusal NAMES
35645
- * the sources, because "this grid has no low" is not a finding — "615 has no
35646
- * low" is, and it is the one an operator can act on.
35647
- */
35648
- var GridProfileOfferSchema = object({
35649
- profile: _enum([
35650
- "high",
35651
- "mid",
35652
- "low"
35653
- ]),
35654
- offered: boolean(),
35655
- /** Sources that cannot serve it. Empty when it is offered, or when there are no cells. */
35656
- missingSources: array(number().int().positive()),
35657
- /**
35658
- * The canvas this profile composes onto, `WxH`, or empty when it is not
35659
- * offered. DERIVED from the cells and the sources' own size at this profile —
35660
- * it is reported because nothing else in the system would ever say what the
35661
- * grid came out as, and because it is the number an operator would otherwise
35662
- * expect to type.
35663
- */
35664
- canvas: string(),
35665
- /**
35666
- * Whether this profile is PUBLISHED, of the ones the grid could serve.
35667
- *
35668
- * A grid's `high` is composed of its sources' `high`, so on a 4K fleet it is
35669
- * a 4K canvas built from 4K decodes — something to opt into, not something a
35670
- * viewer's adaptive should be handed by climbing to the top rung it can see.
35671
- * Default is `mid` + `low`.
35672
- */
35673
- published: boolean()
35674
- });
35675
- var GridLayoutViewSchema = object({
35676
- /** The persisted grid row this camera was declared from. */
35677
- instanceId: string(),
35678
- deviceId: number().int().nonnegative(),
35679
- name: string(),
35680
- /**
35681
- * NO canvas size. A grid's resolution is not authored: each profile derives
35682
- * its own from the cells and its sources' dimensions. The two numbers that
35683
- * used to be here were a text field that silently decided both how much the
35684
- * composite cost and how sharp it was — see `profiles[].canvas` for what it
35685
- * came out as.
35686
- */
35687
- fps: number().int(),
35688
- cells: array(GridLayoutCellSchema),
35689
- /** What the catalog will publish, and what it refuses to. Read-only. */
35690
- profiles: array(GridProfileOfferSchema)
35691
- });
35692
- var GridLayoutPatchSchema = object({
35693
- deviceId: number().int().nonnegative(),
35694
- name: string().min(1).max(160).optional(),
35695
- fps: number().int().min(1).max(60).optional(),
35696
- /** Which profiles to publish. See `GridProfileOffer.published`. */
35697
- publishedProfiles: array(_enum([
35698
- "high",
35699
- "mid",
35700
- "low"
35701
- ])).max(3).optional(),
35702
- /**
35703
- * The whole cell list at once. A per-cell patch would need an ordering the
35704
- * editor does not have, and a half-applied layout is a picture nobody asked
35705
- * for.
35706
- */
35707
- cells: array(GridLayoutCellSchema).max(16)
35708
- });
35709
- var cameraGridLayoutCapability = {
35710
- name: "camera-grid-layout",
35711
- scope: "device",
35712
- deviceNative: true,
35713
- mode: "singleton",
35714
- deviceTypes: [DeviceType.Camera],
35715
- /**
35716
- * The section is built by the ADDON and returned from
35717
- * `getDeviceSettingsContribution`, not derived by the framework from a
35718
- * `deviceConfig.ui` block.
35719
- *
35720
- * Both mechanisms render the same widget. This one hands the addon two
35721
- * things the framework-derived route cannot give it:
35722
- *
35723
- * - it chooses its own section, `tab`, `location` and `order`, the way any
35724
- * other setting does, instead of receiving them from a cap declaration;
35725
- * - it can DECLINE per device. A camera that is not a grid gets no section
35726
- * at all, rather than a widget that renders its own "not a grid" state.
35727
- *
35728
- * `recording` is the precedent (`recorder/recording-device-settings.ts`): it
35729
- * returns `null` for anything that is not a camera, so the Recording tab
35730
- * never appears there.
35731
- */
35732
- exposesDeviceSettings: true,
35733
- methods: {
35734
- /**
35735
- * The grid behind this device.
35736
- *
35737
- * `null` means ANSWERED and this camera is not a grid — not "not yet
35738
- * known". The widget renders its "this is not a grid camera" state only
35739
- * from this answer, never from an unresolved query (D315).
35740
- */
35741
- getLayout: method(object({ deviceId: number().int().nonnegative() }), GridLayoutViewSchema.nullable(), { auth: "admin" }),
35742
- /** Write the geometry back. Returns the grid as it now stands, profiles included. */
35743
- saveLayout: method(GridLayoutPatchSchema, GridLayoutViewSchema, {
35744
- kind: "mutation",
35745
- auth: "admin"
35746
- })
35747
- }
35748
- };
35749
- /**
35750
35589
  * Motion-zones share the same MaskShape vocabulary as privacy-mask — the
35751
35590
  * on-camera motion-detection mask is a single `grid` region (a row-major
35752
35591
  * boolean cell lattice the camera's onboard VMD evaluates). Composing it as
@@ -38416,37 +38255,37 @@ var rebootCapability = {
38416
38255
  auth: "admin"
38417
38256
  }) }
38418
38257
  };
38419
- /**
38420
- * `recording` cap — footage availability + HLS playback manifests + per-device
38421
- * recording config. NOTE on events (source of truth, R5/C3): this cap carries
38422
- * NO event surface — `getPlaybackManifest` returns playlist URLs only. Timeline
38423
- * events (motion/object/audio) come from `pipelineAnalytics` (durable SQLite
38424
- * rows) and are the ONLY event surface — the recorder has none. The in-RAM
38425
- * playback markers it used to build were deleted on 2026-08-29 because nothing
38426
- * ever read them. Event<->footage joins are by time, padded with the shared
38427
- * `EVENT_PAD_MS` (`interfaces/recording-config.ts`).
38428
- */
38429
- var RecordingStatusSchema = object({
38430
- deviceId: number(),
38431
- enabled: boolean(),
38432
- /** THE derived storage mode, from the one definition
38433
- * (`deriveRecordingMode`) — never a second enum. A duplicated list is how
38434
- * `on-device-decision` could have reached the recorder and not the status. */
38435
- activeMode: RecordingStorageModeSchema,
38436
- nodeId: string(),
38437
- storageBytes: number()
38438
- });
38439
38258
  var RecordingRangeSchema = object({
38440
38259
  profile: string(),
38441
38260
  startMs: number(),
38442
38261
  endMs: number()
38443
38262
  });
38263
+ /**
38264
+ * How a source ANSWERED, on every singular read of this cap.
38265
+ *
38266
+ * `'read'` — it looked. `ranges: []` / `days: []` is then a real claim: this
38267
+ * source has no coverage in the window. `'unreadable'` — nobody could look
38268
+ * (the camera was unreachable, the calendar rung threw, the location is
38269
+ * unmounted, the node is still on the old build), and the emptiness beside it
38270
+ * means NOTHING.
38271
+ *
38272
+ * The batch rows have carried this since the grid existed; the SINGULAR
38273
+ * answers gained it with the collection (D625 §10.4), because they are the
38274
+ * ones the single-camera picker uses and because a half-converted fleet makes
38275
+ * "nobody looked" common for the length of a deploy. Without it the timeline
38276
+ * has no vocabulary for it, and `(data ?? [])` in a viewer turns a rollout into
38277
+ * a fleet of cameras that appear to have lost their recordings (D315, D393).
38278
+ */
38279
+ var RecordingReadSchema = _enum(["read", "unreadable"]);
38444
38280
  var RecordingAvailabilitySchema = object({
38445
38281
  deviceId: number(),
38282
+ /** See {@link RecordingReadSchema}. An `'unreadable'` answer carries an empty
38283
+ * `ranges` that means nothing — never draw it as "no footage". */
38284
+ read: RecordingReadSchema,
38446
38285
  ranges: array(RecordingRangeSchema),
38447
38286
  /**
38448
- * Every profile this camera has footage in — not only the one `ranges`
38449
- * describes (D433).
38287
+ * Every profile this camera has footage in AT THIS SOURCE — not only the one
38288
+ * `ranges` describes (D433).
38450
38289
  *
38451
38290
  * `ranges` answers for ONE profile by design: the timeline is a single bar,
38452
38291
  * and enumerating all of them triples the directory reads for a bar that
@@ -38463,15 +38302,344 @@ var RecordingAvailabilitySchema = object({
38463
38302
  });
38464
38303
  var RecordingDaysSchema = object({
38465
38304
  deviceId: number(),
38305
+ /** See {@link RecordingReadSchema}. `days: []` on an `'unreadable'` answer is
38306
+ * "nobody could look", and the date-picker must not spell it the same as
38307
+ * "no footage this month". */
38308
+ read: RecordingReadSchema,
38466
38309
  /** Local-midnight epochs (UTC ms) of days that have ≥1 recorded segment. */
38467
38310
  days: array(number())
38468
38311
  });
38312
+ var RecordingManifestSchema = object({
38313
+ deviceId: number(),
38314
+ /** Local filesystem path to the master playlist; null when no recording exists for the requested range. */
38315
+ localMasterPath: string().nullable(),
38316
+ /** HTTP(S) URL to the master playlist on the recording node's playback server
38317
+ * (the PRIMARY candidate); null when no recording / server. Carries the
38318
+ * scoped playback token in its path. */
38319
+ playbackUrl: string().nullable(),
38320
+ /**
38321
+ * Candidate master-playlist URLs the client tries in order (LAN first, then
38322
+ * remote — Tailscale/Cloudflare if the operator configured extra hosts), each
38323
+ * carrying the same scoped token. `playbackUrl` is the first entry. Empty when
38324
+ * there is no recording / server.
38325
+ */
38326
+ playbackEndpoints: array(string())
38327
+ });
38328
+ var RecordingSourceAvailabilitySchema = object({
38329
+ state: _enum([
38330
+ "ok",
38331
+ "sleeping",
38332
+ "unreachable",
38333
+ "no-storage",
38334
+ "index-empty"
38335
+ ]),
38336
+ /** Free text, shown verbatim. Names the camera's own refusal when there is one. */
38337
+ reason: string().optional(),
38338
+ /** When this source's coverage was last CONFIRMED. A cached answer is never
38339
+ * drawn as current: the surface shows the age whenever it is older than the
38340
+ * refresh interval. The clip catalog's `catalogAsOf`, under the name the
38341
+ * timeline uses for it. */
38342
+ coverageAsOf: number().optional()
38343
+ });
38344
+ /**
38345
+ * One SOURCE of recorded coverage for a camera — a row of the picker.
38346
+ *
38347
+ * A provider lists the sources IT serves for that device, and answers for each
38348
+ * of them whether it can answer at all. A provider with nothing to offer on a
38349
+ * camera returns `[]` — it is not that camera's business. The five availability
38350
+ * states are `ClipSourceAvailability`'s verbatim: they mean exactly the same
38351
+ * things about a coverage index as about a clip catalog, and `sleeping` in
38352
+ * particular is what stops a battery camera being woken to paint a bar.
38353
+ */
38354
+ var RecordingSourceSchema = object({
38355
+ /** The source id. {@link RECORDING_SOURCE_CAMSTACK} for ours (RESERVED), a
38356
+ * vendor namespace (`native:reolink:onboard`, …) for a camera's own store. */
38357
+ source: string(),
38358
+ /** Operator-facing name of the source ("CamStack recordings", "SD card"). */
38359
+ label: string(),
38360
+ /**
38361
+ * The addon that SERVES this row, and the value a later call passes as
38362
+ * `provider`.
38363
+ *
38364
+ * Optional for version skew only. The collection dispatcher stamps it from
38365
+ * the registry, so a row that travelled through the fan-out carries the
38366
+ * authoritative id whatever the provider filled in (D557 §4).
38367
+ */
38368
+ addonId: string().optional(),
38369
+ availability: RecordingSourceAvailabilitySchema
38370
+ });
38371
+ /**
38372
+ * What a surface may DRAW for this (camera, source) — D612's rule applied to a
38373
+ * timeline: **the source declares what it can do, and the surface draws what
38374
+ * was declared. It never assumes, and never offers a gesture it will then
38375
+ * refuse.** D612 exists because `8` and `16` were offered as clip rates, the
38376
+ * broker clamped them to `4`, and no line anywhere said so.
38377
+ *
38378
+ * Asked once per (camera, source) before anything is drawn — never replaced by
38379
+ * a constant the surface keeps, which is the second authority D612 ends.
38380
+ */
38381
+ var RecordingSourceOptionsSchema = object({
38382
+ /** How this source's media reaches the player.
38383
+ * `archive` = our own indexed segment tree; `stream` = the provider's
38384
+ * forward-only fMP4 (D597); `realtime` = a replay bound to wall clock. */
38385
+ transport: _enum([
38386
+ "archive",
38387
+ "stream",
38388
+ "realtime"
38389
+ ]),
38390
+ /** What the BAR means. `continuous` = gaps are holes in a recording;
38391
+ * `sparse` = gaps are the absence of one, and must be drawn as such.
38392
+ *
38393
+ * Not an onboard-only concession: measured 2026-09-24, OUR bar covers 98.8 %
38394
+ * of 592's day and 1.2 % of 1436's. It is a fact about a (source, camera)
38395
+ * pair, and ours answers it per camera from `deriveRecordingMode`. */
38396
+ coverage: _enum(["continuous", "sparse"]),
38397
+ /** Where the playhead may be put.
38398
+ * `free` — anywhere, to the frame.
38399
+ * `forward` — only ahead of the current position.
38400
+ * `segment` — a position SNAPS to the head of the covering segment; a finer
38401
+ * ask is accepted by the camera and SILENTLY IGNORED. Measured
38402
+ * on 1436 (Hikvision V5.7.1, 2026-09-23): a window-narrowed
38403
+ * `ContentMgmt/search` returns a row and a `playbackURI`, the
38404
+ * replay opens 200 and delivers media — and the burned-in OSD of
38405
+ * the first frame reads the SEGMENT HEAD every time. Calling
38406
+ * that `forward` would tell the surface it may move the playhead
38407
+ * ahead within a loaded segment, which it may not. */
38408
+ seek: _enum([
38409
+ "free",
38410
+ "forward",
38411
+ "segment"
38412
+ ]),
38413
+ /** Frame-step BACKWARD is meaningful. */
38414
+ stepBack: boolean(),
38415
+ /** Whether the drag-scrub gesture is served, as opposed to refused by name. */
38416
+ scrub: boolean(),
38417
+ /** Deliverable rates, ascending, always containing `1`. The surface draws its
38418
+ * picker from this and from NOTHING else (D612, D620, D621). `0` is not a
38419
+ * member: pause is the absence of a rate. */
38420
+ rates: array(number().positive()).min(1).readonly(),
38421
+ /** TRUE when a read of this source HOLDS the camera's only playback session.
38422
+ * A surface with this set makes at most ONE read at a time and draws no
38423
+ * scrub-thumbnail strip, no hover preview, no prefetch and no background
38424
+ * refresh. The precedent is exact and expensive: filling one screen of
38425
+ * Hikvision thumbnails at 1.01× realtime consumed fifteen minutes of that
38426
+ * camera's only playback session (1.2.126, reported within minutes), and a
38427
+ * timeline is a screenful of reads by construction. */
38428
+ exclusive: boolean()
38429
+ });
38430
+ /**
38431
+ * How to PLAY the instant that was asked for, from the chosen source.
38432
+ *
38433
+ * No new media transport is built for onboard sources: the `clip` arm is a
38434
+ * DELEGATION to the `videoclips` transport that vendor already has (D597 /
38435
+ * D616 / D617). The onboard half of this collection is a PROJECTION of
38436
+ * `videoclips` for coverage and a delegation to it for bytes.
38437
+ */
38438
+ var RecordingPlaybackSchema = discriminatedUnion("kind", [
38439
+ object({
38440
+ kind: literal("hls"),
38441
+ manifest: RecordingManifestSchema
38442
+ }),
38443
+ object({
38444
+ kind: literal("clip"),
38445
+ /** The `videoclips` source namespace this clip id belongs to. */
38446
+ source: string(),
38447
+ clipId: string(),
38448
+ /** Where this clip actually STARTS. On a `seek: 'segment'` source the
38449
+ * playhead lands here, not at the requested instant — the surface must be
38450
+ * TOLD, not left to discover it from a burned-in OSD. */
38451
+ startsAtMs: number()
38452
+ }),
38453
+ object({
38454
+ kind: literal("none"),
38455
+ reason: string()
38456
+ })
38457
+ ]);
38458
+ var recordingCapability = {
38459
+ name: "recording",
38460
+ scope: "device",
38461
+ /** Several sources per camera, listed beside each other. The mount stays
38462
+ * `device-scoped` — see `resolveCapMount`'s ordering and D554: per-device
38463
+ * wins over the global collection fan-out. */
38464
+ mode: "collection",
38465
+ kind: "wrapper",
38466
+ defaultActive: true,
38467
+ /** Recorded coverage is a property of a camera — the cap is meaningless on a
38468
+ * sensor, a button or an event emitter, and the `defaultActive` auto-bind
38469
+ * reads this to decide which devices it may claim. */
38470
+ deviceTypes: [DeviceType.Camera],
38471
+ methods: {
38472
+ /**
38473
+ * The sources this camera has, WITH the reason any of them cannot answer.
38474
+ *
38475
+ * Asked separately from `getAvailability` because an empty bar is
38476
+ * ambiguous and this is the only place the ambiguity is resolved: every
38477
+ * bound provider contributes its own rows, and a provider that could not be
38478
+ * reached at all still produces one row saying so. A surface that draws "no
38479
+ * recordings" without reading this is drawing a guess.
38480
+ *
38481
+ * The ONLY method here without a `provider` — it is the call that tells the
38482
+ * caller what to put there.
38483
+ */
38484
+ listSources: method(object({ deviceId: number() }), array(RecordingSourceSchema).readonly(), {
38485
+ kind: "query",
38486
+ auth: "protected"
38487
+ }),
38488
+ /**
38489
+ * Recorded coverage of `[fromMs, toMs)` at ONE source — the timeline bar.
38490
+ *
38491
+ * `protected`, not `admin`: a per-camera read is exactly what a camera
38492
+ * viewer is FOR, and the device-scoped mount routes through
38493
+ * `getProviderForDevice`, so a camera outside the caller's scope is refused
38494
+ * before a provider is reached.
38495
+ */
38496
+ getAvailability: method(object({
38497
+ deviceId: number(),
38498
+ /**
38499
+ * WHICH provider to ask — the `addonId` a {@link RecordingSourceSchema}
38500
+ * row carries, never a source id and never a list. **REQUIRED**, in the
38501
+ * schema, where the generated types make it unomittable rather than
38502
+ * merely discouraged (D554 amended).
38503
+ *
38504
+ * It was learned the expensive way on `videoclips.listClips`: measured
38505
+ * on the live hub 2026-09-20, device 592 bound to `recorder` AND
38506
+ * `provider-reolink`, a bare call with `limit: 3` answered SIX rows,
38507
+ * three from each source, merged — `device-collection-dispatch.ts`
38508
+ * leaves an unpinned fan-out un-narrowed, so absence buys the union the
38509
+ * method exists not to be. An un-narrowed `getAvailability` would do
38510
+ * that to a TIMELINE: our ranges and the card's clips unioned into one
38511
+ * bar, which is "two sources are never drawn together" broken in the
38512
+ * one place it matters most.
38513
+ *
38514
+ * A provider the device is not bound to is refused BY NAME (D552's
38515
+ * `rejectUnresolvedAddonPin`), never answered by another one.
38516
+ */
38517
+ provider: string().min(1),
38518
+ fromMs: number(),
38519
+ toMs: number(),
38520
+ /**
38521
+ * Answer for THIS profile instead of the source's preferred one (D433).
38522
+ * Absent keeps the timeline's behaviour — one bar, one profile, one set
38523
+ * of reads. `profilesWithFootage` on the answer says what may be asked
38524
+ * for.
38525
+ */
38526
+ profile: string().optional()
38527
+ }), RecordingAvailabilitySchema, {
38528
+ kind: "query",
38529
+ auth: "protected"
38530
+ }),
38531
+ /** Which calendar days in [fromMs,toMs) this source has ≥1 recording in,
38532
+ * bucketed by the client's local day (`tzOffsetMinutes` = minutes to add
38533
+ * to UTC). Drives the theater date-picker's day dots. `provider` is
38534
+ * REQUIRED for the reason `getAvailability` states. */
38535
+ getDaysWithRecordings: method(object({
38536
+ deviceId: number(),
38537
+ provider: string().min(1),
38538
+ fromMs: number(),
38539
+ toMs: number(),
38540
+ tzOffsetMinutes: number()
38541
+ }), RecordingDaysSchema, {
38542
+ kind: "query",
38543
+ auth: "protected"
38544
+ }),
38545
+ /**
38546
+ * How to PLAY `[fromMs, toMs)` at this source.
38547
+ *
38548
+ * It was `getPlaybackManifest`, and the rename is not cosmetic: a
38549
+ * "manifest" is an HLS master playlist, which is a property of OUR recorder
38550
+ * and of nothing else. Keeping the name would make every onboard
38551
+ * implementation a lie in its signature. The old shape survives verbatim
38552
+ * inside the union's `hls` arm, so the recorder's implementation is
38553
+ * unchanged behind it.
38554
+ */
38555
+ getPlayback: method(object({
38556
+ deviceId: number(),
38557
+ provider: string().min(1),
38558
+ fromMs: number(),
38559
+ toMs: number(),
38560
+ profile: CamProfileSchema.optional()
38561
+ }), RecordingPlaybackSchema, {
38562
+ kind: "query",
38563
+ auth: "protected"
38564
+ }),
38565
+ /**
38566
+ * What this (camera, source) can actually DO — asked before anything is
38567
+ * drawn. See {@link RecordingSourceOptionsSchema}; a constant the surface
38568
+ * keeps instead is the second authority D612 exists to end.
38569
+ */
38570
+ getPlaybackOptions: method(object({
38571
+ deviceId: number(),
38572
+ provider: string().min(1)
38573
+ }), RecordingSourceOptionsSchema, {
38574
+ kind: "query",
38575
+ auth: "protected"
38576
+ })
38577
+ }
38578
+ };
38579
+ /**
38580
+ * `recording-archive` — OUR archive, and the intent that fills it.
38581
+ *
38582
+ * The system-singleton half of the 2026-09-24 cut (D625). `recording` used to
38583
+ * be one 33-method system singleton holding two unrelated subjects: three
38584
+ * per-camera READS about coverage and playback, and everything else — storage
38585
+ * locations, retention, relocation, rebalance, the ops log, the placement
38586
+ * table and the byte-plane primitives our scrub and export are built on.
38587
+ *
38588
+ * The reads became a device-scoped COLLECTION, so a camera's own card can be a
38589
+ * source beside ours (`recording.cap.ts`). Everything that is about OUR store,
38590
+ * or unimplementable by a camera, stayed here.
38591
+ *
38592
+ * ## On the name
38593
+ *
38594
+ * `recording-storage` was the obvious choice and is wrong: this cap also holds
38595
+ * `getDeviceConfig`/`setDeviceConfig`, which are recording INTENT — bands,
38596
+ * retention, the D62 switch authority — and a name that says "storage" invites
38597
+ * the next reader to move them out again. An archive is a thing we keep, and
38598
+ * what we keep it under is a policy; the name covers both halves honestly and
38599
+ * sits in the existing family (`recording-onboard`, `recording-export`,
38600
+ * `recording-signal`).
38601
+ *
38602
+ * ## What must NOT happen to it
38603
+ *
38604
+ * It stays a SINGLETON. It is registered by `recorder`, which is
38605
+ * `placement: 'any-node'` and runs on every recording node; the hub dispatches
38606
+ * to one of them. Putting the ledger, the placement table or the relocation
38607
+ * jobs behind a fan-out is the one genuinely dangerous move in this cut.
38608
+ *
38609
+ * `getDeviceConfig` / `setDeviceConfig` in particular are the D62 recording
38610
+ * authority (`CameraSwitch.authority`). If a write reached a different provider
38611
+ * than the read — which a collection fan-out permits — two authorities would
38612
+ * decide when one camera records, and the symptom (recording silently off, or
38613
+ * a `bands` array clobbered by a partial write) is durable and silent. Keeping
38614
+ * them here means the worst case during a rollout is a 412: the switch refuses
38615
+ * to flip and SAYS so. **Do not move them into the collection, at any point,
38616
+ * for any reason.**
38617
+ *
38618
+ * ## The two batch reads
38619
+ *
38620
+ * `getAvailabilityBatch` / `getDaysWithRecordingsBatch` take `deviceIds:
38621
+ * number[]` with no single `deviceId`, and a device-scoped mount routes
38622
+ * through `getProviderForDevice(deviceId)` — there is nothing for it to route
38623
+ * on. They stay here, and on this cap the batch is explicitly OURS: a grid has
38624
+ * no per-camera picker, and a caller that wants another source's coverage asks
38625
+ * `recording.getAvailability` per device with that source's `provider`.
38626
+ */
38627
+ var RecordingStatusSchema = object({
38628
+ deviceId: number(),
38629
+ enabled: boolean(),
38630
+ /** THE derived storage mode, from the one definition
38631
+ * (`deriveRecordingMode`) — never a second enum. A duplicated list is how
38632
+ * `on-device-decision` could have reached the recorder and not the status. */
38633
+ activeMode: RecordingStorageModeSchema,
38634
+ nodeId: string(),
38635
+ storageBytes: number()
38636
+ });
38469
38637
  /**
38470
38638
  * One camera's row in a `getAvailabilityBatch` answer.
38471
38639
  *
38472
- * `ranges` is EXACTLY what `getAvailability` returns for that camera — the
38473
- * batch collapses the transport, not the work — plus the one thing the singular
38474
- * method never had to say:
38640
+ * `ranges` is EXACTLY what `recording.getAvailability` returns for that camera
38641
+ * at OUR source — the batch collapses the transport, not the work — plus the
38642
+ * `read` mark the singular answer now carries too (D625):
38475
38643
  *
38476
38644
  * - `read: 'read'` — answered. `ranges: []` means "read, and this camera has
38477
38645
  * no footage in the window", which is a real claim.
@@ -38503,22 +38671,6 @@ var RecordingDaysForDeviceSchema = object({
38503
38671
  /** Local-midnight epochs (UTC ms) of days that have ≥1 recorded segment. */
38504
38672
  days: array(number()).readonly()
38505
38673
  });
38506
- var RecordingManifestSchema = object({
38507
- deviceId: number(),
38508
- /** Local filesystem path to the master playlist; null when no recording exists for the requested range. */
38509
- localMasterPath: string().nullable(),
38510
- /** HTTP(S) URL to the master playlist on the recording node's playback server
38511
- * (the PRIMARY candidate); null when no recording / server. Carries the
38512
- * scoped playback token in its path. */
38513
- playbackUrl: string().nullable(),
38514
- /**
38515
- * Candidate master-playlist URLs the client tries in order (LAN first, then
38516
- * remote — Tailscale/Cloudflare if the operator configured extra hosts), each
38517
- * carrying the same scoped token. `playbackUrl` is the first entry. Empty when
38518
- * there is no recording / server.
38519
- */
38520
- playbackEndpoints: array(string())
38521
- });
38522
38674
  /**
38523
38675
  * Recording storage usage for one camera — what the ARCHIVE holds for it,
38524
38676
  * across every profile and every resolvable location on this node.
@@ -38776,33 +38928,22 @@ var ReadWindowBytesResultSchema = discriminatedUnion("kind", [object({
38776
38928
  * not a retry hint (retrying the same window would refuse again). */
38777
38929
  segmentEndMs: number()
38778
38930
  })]);
38779
- var recordingCapability = {
38780
- name: "recording",
38931
+ var recordingArchiveCapability = {
38932
+ name: "recording-archive",
38781
38933
  scope: "system",
38782
38934
  mode: "singleton",
38935
+ /** Moves here with the config pair — the derived Recording settings
38936
+ * section is a view over `getDeviceConfig`/`setDeviceConfig` (D14), and
38937
+ * those did not move (D625). */
38783
38938
  exposesDeviceSettings: true,
38784
38939
  status: {
38785
38940
  schema: RecordingStatusSchema,
38786
38941
  kind: "command-driven"
38787
38942
  },
38788
38943
  methods: {
38789
- getAvailability: method(object({
38790
- deviceId: number(),
38791
- fromMs: number(),
38792
- toMs: number(),
38793
- /**
38794
- * Answer for THIS profile instead of the preferred one (D433). Absent
38795
- * keeps the timeline's behaviour — one bar, one profile, one set of
38796
- * reads. `profilesWithFootage` on the answer says what may be asked
38797
- * for.
38798
- */
38799
- profile: string().optional()
38800
- }), RecordingAvailabilitySchema, {
38801
- kind: "query",
38802
- auth: "protected"
38803
- }),
38804
38944
  /**
38805
- * `getAvailability` for a SET of cameras, in one round trip.
38945
+ * `recording.getAvailability` for a SET of cameras, in one round trip, at
38946
+ * OUR source.
38806
38947
  *
38807
38948
  * A multi-camera timeline re-asks availability for every camera in the grid
38808
38949
  * on every day change; fanned out that is one request per camera for N
@@ -38810,6 +38951,13 @@ var recordingCapability = {
38810
38951
  * `availabilityProfileFor` + `rangesIn`, run concurrently inside the
38811
38952
  * recorder) — only the transport collapses.
38812
38953
  *
38954
+ * It lives on the ARCHIVE, not on the `recording` collection, because it
38955
+ * takes `deviceIds` with no single `deviceId` and a device-scoped mount has
38956
+ * nothing to route on (D625 §10.2). The consequence is stated rather than
38957
+ * hidden: the batch answers for OURS. A caller that needs another source's
38958
+ * coverage asks `recording.getAvailability` per device, naming that
38959
+ * source's provider.
38960
+ *
38813
38961
  * `protected` for the same reason the singular method is: every id in
38814
38962
  * `deviceIds` is a device reference, so the F1 #3 gate refuses any camera
38815
38963
  * outside the caller's scope — one id out of scope refuses the CALL, it
@@ -38827,20 +38975,10 @@ var recordingCapability = {
38827
38975
  kind: "query",
38828
38976
  auth: "protected"
38829
38977
  }),
38830
- /** Which calendar days in [fromMs,toMs) have ≥1 recorded segment, bucketed by
38831
- * the client's local day (`tzOffsetMinutes` = minutes to add to UTC). Drives
38832
- * the theater date-picker's day dots. */
38833
- getDaysWithRecordings: method(object({
38834
- deviceId: number(),
38835
- fromMs: number(),
38836
- toMs: number(),
38837
- tzOffsetMinutes: number()
38838
- }), RecordingDaysSchema, {
38839
- kind: "query",
38840
- auth: "protected"
38841
- }),
38842
38978
  /**
38843
- * `getDaysWithRecordings` for a SET of cameras, in one round trip.
38979
+ * `recording.getDaysWithRecordings` for a SET of cameras, in one round
38980
+ * trip, at OUR source. Same placement argument as
38981
+ * {@link getAvailabilityBatch}.
38844
38982
  *
38845
38983
  * The cheapest question in the product, asked once per camera per month
38846
38984
  * change. One directory read per day per camera at the owner, unchanged;
@@ -38859,14 +38997,6 @@ var recordingCapability = {
38859
38997
  kind: "query",
38860
38998
  auth: "protected"
38861
38999
  }),
38862
- getPlaybackManifest: method(object({
38863
- deviceId: number(),
38864
- fromMs: number(),
38865
- toMs: number()
38866
- }), RecordingManifestSchema, {
38867
- kind: "query",
38868
- auth: "protected"
38869
- }),
38870
39000
  getStorageUsage: method(object({}), RecordingStorageUsageSchema, {
38871
39001
  kind: "query",
38872
39002
  auth: "admin"
@@ -38882,6 +39012,10 @@ var recordingCapability = {
38882
39012
  * value (D315, D393, D590). It carries schedules and retention, no secret,
38883
39013
  * and the per-device gate in `scope-access.ts` still applies; `setDeviceConfig`
38884
39014
  * stays `admin`.
39015
+ *
39016
+ * It is a SINGLETON method and stays one (D625 §16.2): it is the D62
39017
+ * recording authority, and an authority that several providers could answer
39018
+ * is the "two knobs over one decision" D62 forbids.
38885
39019
  */
38886
39020
  getDeviceConfig: method(object({ deviceId: number() }), RecordingConfigSchema, {
38887
39021
  kind: "query",
@@ -38889,7 +39023,13 @@ var recordingCapability = {
38889
39023
  }),
38890
39024
  /** Locate footage at a wall-clock instant: the covering segment's window,
38891
39025
  * or a gap with the forward nearest covered edge. Used by a feeder running
38892
- * in another addon process to seek recorded footage over tRPC. */
39026
+ * in another addon process to seek recorded footage over tRPC.
39027
+ *
39028
+ * BYTE PLANE: defined by `mfra` byte ranges over OUR own MP4 segment tree.
39029
+ * There is no vendor-neutral statement of it, its only callers are feeders
39030
+ * in other addon processes (the stream broker, the replay-clip source),
39031
+ * and an onboard source that ever needs bytes delegates to the
39032
+ * `videoclips` transport its vendor already has (D625 §9.3, §10.5). */
38893
39033
  locateSegment: method(object({
38894
39034
  deviceId: number(),
38895
39035
  profile: string(),
@@ -39504,6 +39644,346 @@ var recordingExportCapability = {
39504
39644
  }
39505
39645
  };
39506
39646
  /**
39647
+ * Vendor-neutral **onboard** recording + storage cap — what the CAMERA
39648
+ * writes to the CAMERA's own card, on the camera's own schedule.
39649
+ *
39650
+ * This is NOT `recording.cap.ts`. That one is CamStack's recorder: our
39651
+ * footage ledger, our storage locations, our retention. This one has a
39652
+ * different authority — the camera's firmware — and per D62 it stores
39653
+ * nothing of its own. Every value here is read from the camera and every
39654
+ * write goes back to the camera; there is no CamStack-side mirror that
39655
+ * could disagree with the device.
39656
+ *
39657
+ * ## One shape, two firmwares
39658
+ *
39659
+ * Measured 2026-09-22 against the live fleet:
39660
+ *
39661
+ * | fact | Hikvision (ISAPI) | Reolink (Baichuan) |
39662
+ * | --- | --- | --- |
39663
+ * | storage | `ContentMgmt/Storage` `<hdd>` rows: status, capacity, freeSpace (MB) | `getHddInfoList` (cmd 102): `mount`, `format`, `capacity` GB + `capacityM` MB remainder |
39664
+ * | tracks | several (101 **and** 103 on both 1436 and 3833), each with its own schedule | one per channel |
39665
+ * | schedule | per track, 7 `ScheduleAction` blocks: DayOfWeek + TimeOfDay range + ONE `ActionRecordingMode` | per trigger type, a 168-char weekly HOUR mask |
39666
+ * | triggers | `CMR`, `MOTION` | `Normal`, `MD`, `people`, `vehicle`, `dog_cat`, `crossline`, `intrude`, `loitering` |
39667
+ * | pre-record | `PreRecordTimeSeconds` | `preRecordTime` |
39668
+ * | post-record | `PostRecordTimeSeconds` | `recordDelayTime` |
39669
+ * | overwrite | per track `LoopEnable` | `cycle`, with `cycleList` enumerating the accepted values |
39670
+ * | segment length | not exposed on V5.7.1 | `packageTime` (minutes) |
39671
+ *
39672
+ * The two schedule models look different and are the same thing in
39673
+ * different coordinates: both answer "for this trigger, during which
39674
+ * weekly windows does the camera record". {@link RecordWindow} is that
39675
+ * question in one shape — Hikvision's ranges map straight onto it,
39676
+ * Reolink's mask expands into hour-aligned windows.
39677
+ *
39678
+ * ## Union, not intersection
39679
+ *
39680
+ * **The same fields exist on every camera.** What differs per device is
39681
+ * which VALUES that device accepts, and that is what {@link
39682
+ * RecordingOnboardOptions} reports — a `{ readable, writable, reason }`
39683
+ * per field plus the schedule's own limits. A control a camera cannot
39684
+ * honour is rendered DISABLED WITH ITS REASON, never missing and never
39685
+ * dead: disabled must not look like broken.
39686
+ *
39687
+ * ## Refusal by name
39688
+ *
39689
+ * A write a camera cannot honour is refused with a sentence the operator
39690
+ * can read — never accepted and dropped. Both providers refuse through
39691
+ * {@link describeOnboardRefusal}, so the vocabulary is one function and
39692
+ * one test, not two hand-written vendor opinions.
39693
+ *
39694
+ * Follows the D14 `deviceConfig` archetype (see `stream-params.cap.ts`):
39695
+ * `getOptions` advertises per-camera availability, `getStatus` (auto-
39696
+ * injected from `status`) reports the live values, and a single
39697
+ * `setSettings` mutation applies a partial change. No hand-written
39698
+ * settings-contribution methods.
39699
+ */
39700
+ /**
39701
+ * What makes the camera start recording during a window.
39702
+ *
39703
+ * The union of both vendors' vocabularies. `continuous` is Hikvision's
39704
+ * `CMR` and Reolink's `Normal`; `motion` is `MOTION` / `MD`. The
39705
+ * object-class triggers are Reolink-only today and the smart-event ones
39706
+ * (`lineCrossing`, `intrusion`, `loitering`) are Reolink-only on the
39707
+ * firmwares measured — a camera that cannot record on a trigger simply
39708
+ * does not list it in `options.schedule.triggers`, and a window naming
39709
+ * it is REFUSED, not dropped.
39710
+ */
39711
+ var RecordTriggerSchema = _enum([
39712
+ "continuous",
39713
+ "motion",
39714
+ "person",
39715
+ "vehicle",
39716
+ "animal",
39717
+ "lineCrossing",
39718
+ "intrusion",
39719
+ "loitering",
39720
+ "alarmInput"
39721
+ ]);
39722
+ /**
39723
+ * One weekly recording window: "on `day`, from `startMinute` to
39724
+ * `endMinute`, record on `trigger`".
39725
+ *
39726
+ * `day` is 0 = Monday … 6 = Sunday (ISO order, which is also the order
39727
+ * both firmwares enumerate). Minutes are local camera time since
39728
+ * midnight; `endMinute` may be 1440, meaning end of day — that is
39729
+ * Hikvision's literal `24:00` and Reolink's 24th mask slot, and
39730
+ * collapsing it to 0 would turn a whole-day window into an empty one.
39731
+ */
39732
+ var RecordWindowSchema = object({
39733
+ trigger: RecordTriggerSchema,
39734
+ day: number().int().min(0).max(6),
39735
+ startMinute: number().int().min(0).max(1439),
39736
+ endMinute: number().int().min(1).max(1440)
39737
+ });
39738
+ /** Status of one physical volume, as the camera itself describes it. */
39739
+ var OnboardStorageVolumeSchema = object({
39740
+ /** The camera's own id for the volume (`hdd/id`, Reolink `HddInfo/number`). */
39741
+ id: string(),
39742
+ /** The camera's own name for it, when it gives one (`hddName`). */
39743
+ label: string().optional(),
39744
+ status: _enum([
39745
+ "ok",
39746
+ "unformatted",
39747
+ "error",
39748
+ "offline",
39749
+ "unknown"
39750
+ ]),
39751
+ /**
39752
+ * Total size in MB, or **null when the camera did not say**.
39753
+ *
39754
+ * Never 0 for an unreadable value: a measurement that failed is not a
39755
+ * measurement (D393), and a card whose size is unknown must not be
39756
+ * rendered as a card of size zero.
39757
+ */
39758
+ capacityMb: number().nullable(),
39759
+ /**
39760
+ * Free space in MB, or null when unknown.
39761
+ *
39762
+ * **Not a proxy for "has footage".** Measured 2026-09-22: 1436 and
39763
+ * 1439 both report exactly 11776 MB free — the fixed reserve a looping
39764
+ * card converges on once it has wrapped. At loop steady state the
39765
+ * number is identical whether the camera recorded yesterday or stopped
39766
+ * a month ago.
39767
+ */
39768
+ freeMb: number().nullable(),
39769
+ /** True when the camera reports the volume writable (`property` RW). */
39770
+ writable: boolean().optional()
39771
+ });
39772
+ /**
39773
+ * What the camera is doing with its own storage, right now.
39774
+ *
39775
+ * Every scalar is nullable and **null means the camera did not answer**,
39776
+ * never a default. A form that seeds `0` from an unanswered read invites
39777
+ * the operator to save that 0 back onto the camera.
39778
+ */
39779
+ var RecordingOnboardStatusSchema = object({
39780
+ storage: discriminatedUnion("kind", [
39781
+ object({
39782
+ kind: literal("present"),
39783
+ volumes: array(OnboardStorageVolumeSchema)
39784
+ }),
39785
+ object({
39786
+ kind: literal("absent"),
39787
+ reason: string()
39788
+ }),
39789
+ object({
39790
+ kind: literal("unknown"),
39791
+ reason: string()
39792
+ })
39793
+ ]),
39794
+ tracks: array(object({
39795
+ id: string(),
39796
+ enabled: boolean(),
39797
+ isVideo: boolean(),
39798
+ /** From the camera's own track description. Null when it does not say. */
39799
+ codec: string().nullable(),
39800
+ resolution: string().nullable(),
39801
+ /** Per-track overwrite flag, where the firmware keeps it per track. */
39802
+ overwriteWhenFull: boolean().nullable()
39803
+ })),
39804
+ /**
39805
+ * The track the write path targets — the enabled VIDEO one. Null when
39806
+ * no track could be identified, which is itself a refusal reason.
39807
+ */
39808
+ primaryTrackId: string().nullable(),
39809
+ /** Master "record to the card at all" switch. */
39810
+ enabled: boolean().nullable(),
39811
+ overwriteWhenFull: boolean().nullable(),
39812
+ preRecordSec: number().nullable(),
39813
+ postRecordSec: number().nullable(),
39814
+ /** Length of one recorded file, in minutes. */
39815
+ segmentMinutes: number().nullable(),
39816
+ /** The primary track's weekly windows, flattened. */
39817
+ windows: array(RecordWindowSchema),
39818
+ /**
39819
+ * How many windows the camera described that CamStack could NOT read —
39820
+ * an unrecognised trigger, an unparseable clock, a weekday it does not
39821
+ * name.
39822
+ *
39823
+ * A dropped window is work the reader threw away, and a schedule that
39824
+ * silently shows fewer rows than the camera holds is how an operator
39825
+ * saves back a schedule shorter than the one they were looking at
39826
+ * (D391). Non-zero means the window list is INCOMPLETE and a write
39827
+ * that replaces it would delete what was not shown — which is why a
39828
+ * provider reporting a non-zero count also reports the schedule as not
39829
+ * writable.
39830
+ */
39831
+ unreadableWindows: number(),
39832
+ /**
39833
+ * The camera is scheduled to record and has NO usable storage.
39834
+ *
39835
+ * A first-class fact because it is the fleet's most common silent
39836
+ * defect: measured 2026-09-22, 1441 and 3831 are both motion-recording
39837
+ * to a card that is not there. Neither the schedule nor the storage
39838
+ * read says anything wrong on its own; only the pair does.
39839
+ */
39840
+ recordingToNowhere: boolean(),
39841
+ lastFetchedAt: number()
39842
+ });
39843
+ /** Numeric range descriptor — `{ min, max, step }` per the getOptions convention. */
39844
+ var RangeSchema = object({
39845
+ min: number(),
39846
+ max: number(),
39847
+ step: number()
39848
+ });
39849
+ /**
39850
+ * The values a camera actually takes for a numeric field, when they are a SET
39851
+ * rather than a range.
39852
+ *
39853
+ * `{min,max,step}` cannot say what these two firmwares do. Measured on 1436
39854
+ * (I91DN) on 2026-09-22 by writing each value and reading it back:
39855
+ *
39856
+ * - pre-record: `0, 5, 10, 15, 20, 25, 30` and `2147483647` (INT32_MAX, the
39857
+ * camera's "no limit" — `-1` and `4294967295` both land on it);
39858
+ * - post-record: `5, 10, 30, 60, 120, 300, 600`.
39859
+ *
39860
+ * Neither is expressible as a step: the first has a sentinel two billion away
39861
+ * from its neighbours, the second doubles and then jumps. A range that tried
39862
+ * would forbid values the camera takes AND permit values it silently replaces
39863
+ * with 5 — wrong in both directions at once.
39864
+ *
39865
+ * `sentinel` names the member that is not a duration, so a surface can render
39866
+ * "no limit" instead of `2147483647` seconds.
39867
+ */
39868
+ var AllowedValuesSchema = object({
39869
+ values: array(number()).min(1),
39870
+ sentinel: object({
39871
+ value: number(),
39872
+ meaning: _enum(["no-limit", "disabled"])
39873
+ }).optional()
39874
+ });
39875
+ /**
39876
+ * Per-field availability on ONE camera.
39877
+ *
39878
+ * The field exists on every camera — this says whether this one can be
39879
+ * read and whether it can be written, and `reason` says why not when
39880
+ * either is false. The UI renders the control DISABLED with the reason
39881
+ * rather than hiding it, so a limitation is legible instead of looking
39882
+ * like a missing feature.
39883
+ */
39884
+ var OnboardFieldSupportSchema = object({
39885
+ readable: boolean(),
39886
+ writable: boolean(),
39887
+ /** Required whenever `readable` or `writable` is false. */
39888
+ reason: string().optional()
39889
+ });
39890
+ /** What this camera's schedule model can express. */
39891
+ var OnboardScheduleSupportSchema = object({
39892
+ support: OnboardFieldSupportSchema,
39893
+ /**
39894
+ * The smallest time step the camera can express, in minutes.
39895
+ *
39896
+ * Hikvision takes arbitrary minutes (`00:05:00`–`23:57:00` observed on
39897
+ * 1436's track 103). Reolink's schedule is a 7×24 HOUR mask, so 60. A
39898
+ * window whose edges are not a multiple of this is REFUSED rather than
39899
+ * quietly rounded — rounding is how an operator's 06:30 becomes 06:00
39900
+ * and nothing says so.
39901
+ */
39902
+ granularityMinutes: number(),
39903
+ /** Triggers this camera can record on. A window naming another is refused. */
39904
+ triggers: array(RecordTriggerSchema),
39905
+ /**
39906
+ * False when the camera stores ONE trigger per time range, so two
39907
+ * windows overlapping on the same day cannot carry different triggers.
39908
+ * True on Reolink, whose mask is per-trigger and independent.
39909
+ */
39910
+ supportsOverlappingTriggers: boolean()
39911
+ });
39912
+ var RecordingOnboardOptionsSchema = object({
39913
+ enabled: OnboardFieldSupportSchema,
39914
+ overwriteWhenFull: OnboardFieldSupportSchema,
39915
+ preRecordSec: OnboardFieldSupportSchema,
39916
+ preRecordSecRange: RangeSchema.optional(),
39917
+ /** Preferred over the range when the camera takes a SET, not a span. */
39918
+ preRecordSecAllowed: AllowedValuesSchema.optional(),
39919
+ postRecordSec: OnboardFieldSupportSchema,
39920
+ postRecordSecRange: RangeSchema.optional(),
39921
+ /** Preferred over the range when the camera takes a SET, not a span. */
39922
+ postRecordSecAllowed: AllowedValuesSchema.optional(),
39923
+ segmentMinutes: OnboardFieldSupportSchema,
39924
+ segmentMinutesRange: RangeSchema.optional(),
39925
+ /** Preferred over the range when the camera takes a SET, not a span. */
39926
+ segmentMinutesAllowed: AllowedValuesSchema.optional(),
39927
+ schedule: OnboardScheduleSupportSchema
39928
+ });
39929
+ /**
39930
+ * A partial change. Every field optional.
39931
+ *
39932
+ * Unlike the other `deviceConfig` caps, a provider here does **NOT**
39933
+ * silently ignore a field it cannot support — it refuses, by name,
39934
+ * through {@link describeOnboardRefusal}. Silence on a recording setting
39935
+ * is the failure D62 exists to prevent: the operator believes the camera
39936
+ * is recording the way the form says, and it is not.
39937
+ */
39938
+ var RecordingOnboardPatchSchema = object({
39939
+ enabled: boolean().optional(),
39940
+ overwriteWhenFull: boolean().optional(),
39941
+ preRecordSec: number().optional(),
39942
+ postRecordSec: number().optional(),
39943
+ segmentMinutes: number().optional(),
39944
+ /** The complete new window set for the primary track — not a delta. */
39945
+ windows: array(RecordWindowSchema).optional()
39946
+ });
39947
+ var recordingOnboardCapability = {
39948
+ name: "recording-onboard",
39949
+ scope: "device",
39950
+ deviceNative: true,
39951
+ mode: "singleton",
39952
+ deviceTypes: [DeviceType.Camera],
39953
+ deviceConfig: { ui: {
39954
+ kind: "derived-form",
39955
+ builderId: "recording-onboard",
39956
+ tab: "recording"
39957
+ } },
39958
+ methods: {
39959
+ getOptions: method(object({ deviceId: number() }), RecordingOnboardOptionsSchema),
39960
+ setSettings: method(object({
39961
+ deviceId: number(),
39962
+ settings: RecordingOnboardPatchSchema
39963
+ }), _void(), {
39964
+ kind: "mutation",
39965
+ auth: "admin"
39966
+ })
39967
+ },
39968
+ status: {
39969
+ schema: RecordingOnboardStatusSchema,
39970
+ kind: "poll"
39971
+ },
39972
+ runtimeState: RecordingOnboardStatusSchema,
39973
+ /**
39974
+ * Runtime-state durability: **restored** — operator-set camera-side
39975
+ * recording config; mutation-driven, and the storage half is the last
39976
+ * thing the camera said about its own card.
39977
+ *
39978
+ * See `RuntimeStateDurability`. Enforced by
39979
+ * `scripts/check-runtime-state-durability.ts`.
39980
+ */
39981
+ durability: "restored",
39982
+ /** Clock fields: written, but excluded from the compare that decides
39983
+ * whether persisting is worth a SQLite commit. */
39984
+ volatileStateFields: ["lastFetchedAt"]
39985
+ };
39986
+ /**
39507
39987
  * A camera's own "record me NOW" LEVEL — a signal the device raises while
39508
39988
  * something it knows about is happening (a robot vacuum cleaning, a machine
39509
39989
  * running, a gate open) and lowers when it stops.
@@ -42119,9 +42599,8 @@ var DEVICE_STATE_READERS = [
42119
42599
  field: "state"
42120
42600
  },
42121
42601
  {
42122
- cap: "lock",
42123
- field: "locked",
42124
- booleanWords: ["locked", "unlocked"]
42602
+ cap: "lock-control",
42603
+ field: "state"
42125
42604
  },
42126
42605
  {
42127
42606
  cap: "contact",
@@ -43587,7 +44066,6 @@ var ALL_CAPABILITY_DEFINITIONS = [
43587
44066
  embeddingEncoderCapability,
43588
44067
  enumSensorCapability,
43589
44068
  eventEmitterCapability,
43590
- eventsCapability,
43591
44069
  faceGalleryCapability,
43592
44070
  failureContributionCapability,
43593
44071
  fanControlCapability,
@@ -43648,6 +44126,7 @@ var ALL_CAPABILITY_DEFINITIONS = [
43648
44126
  ptzAutotrackCapability,
43649
44127
  rebootCapability,
43650
44128
  recordingCapability,
44129
+ recordingArchiveCapability,
43651
44130
  recordingExportCapability,
43652
44131
  recordingOnboardCapability,
43653
44132
  recordingSignalCapability,
@@ -45882,24 +46361,6 @@ Object.freeze({
45882
46361
  addonId: null,
45883
46362
  access: "view"
45884
46363
  },
45885
- "events.getEventClipUrl": {
45886
- capName: "events",
45887
- capScope: "device",
45888
- addonId: null,
45889
- access: "view"
45890
- },
45891
- "events.getEvents": {
45892
- capName: "events",
45893
- capScope: "device",
45894
- addonId: null,
45895
- access: "view"
45896
- },
45897
- "events.getEventThumbnail": {
45898
- capName: "events",
45899
- capScope: "device",
45900
- addonId: null,
45901
- access: "view"
45902
- },
45903
46364
  "faceGallery.assignFace": {
45904
46365
  capName: "face-gallery",
45905
46366
  capScope: "system",
@@ -47220,6 +47681,12 @@ Object.freeze({
47220
47681
  addonId: null,
47221
47682
  access: "view"
47222
47683
  },
47684
+ "notificationRules.getTemplateCatalog": {
47685
+ capName: "notification-rules",
47686
+ capScope: "system",
47687
+ addonId: null,
47688
+ access: "view"
47689
+ },
47223
47690
  "notificationRules.listDeviceMutes": {
47224
47691
  capName: "notification-rules",
47225
47692
  capScope: "system",
@@ -47238,6 +47705,12 @@ Object.freeze({
47238
47705
  addonId: null,
47239
47706
  access: "view"
47240
47707
  },
47708
+ "notificationRules.previewTemplate": {
47709
+ capName: "notification-rules",
47710
+ capScope: "system",
47711
+ addonId: null,
47712
+ access: "view"
47713
+ },
47241
47714
  "notificationRules.resolveArtifactUrl": {
47242
47715
  capName: "notification-rules",
47243
47716
  capScope: "system",
@@ -48774,224 +49247,236 @@ Object.freeze({
48774
49247
  addonId: null,
48775
49248
  access: "create"
48776
49249
  },
48777
- "recording.applyDeviceSettingsPatch": {
49250
+ "recording.getAvailability": {
48778
49251
  capName: "recording",
48779
- capScope: "system",
49252
+ capScope: "device",
48780
49253
  addonId: null,
48781
- access: "create"
49254
+ access: "view"
48782
49255
  },
48783
- "recording.cancelRelocateJob": {
49256
+ "recording.getDaysWithRecordings": {
48784
49257
  capName: "recording",
48785
- capScope: "system",
49258
+ capScope: "device",
48786
49259
  addonId: null,
48787
- access: "create"
49260
+ access: "view"
48788
49261
  },
48789
- "recording.cancelStorageMigrationMove": {
49262
+ "recording.getPlayback": {
48790
49263
  capName: "recording",
48791
- capScope: "system",
49264
+ capScope: "device",
48792
49265
  addonId: null,
48793
- access: "create"
49266
+ access: "view"
48794
49267
  },
48795
- "recording.deleteFootprint": {
49268
+ "recording.getPlaybackOptions": {
48796
49269
  capName: "recording",
48797
- capScope: "system",
49270
+ capScope: "device",
48798
49271
  addonId: null,
48799
- access: "delete"
49272
+ access: "view"
48800
49273
  },
48801
- "recording.getAvailability": {
49274
+ "recording.listSources": {
48802
49275
  capName: "recording",
48803
- capScope: "system",
49276
+ capScope: "device",
48804
49277
  addonId: null,
48805
49278
  access: "view"
48806
49279
  },
48807
- "recording.getAvailabilityBatch": {
48808
- capName: "recording",
49280
+ "recordingArchive.applyDeviceSettingsPatch": {
49281
+ capName: "recording-archive",
48809
49282
  capScope: "system",
48810
49283
  addonId: null,
48811
- access: "view"
49284
+ access: "create"
48812
49285
  },
48813
- "recording.getDaysWithRecordings": {
48814
- capName: "recording",
49286
+ "recordingArchive.cancelRelocateJob": {
49287
+ capName: "recording-archive",
48815
49288
  capScope: "system",
48816
49289
  addonId: null,
48817
- access: "view"
49290
+ access: "create"
48818
49291
  },
48819
- "recording.getDaysWithRecordingsBatch": {
48820
- capName: "recording",
49292
+ "recordingArchive.cancelStorageMigrationMove": {
49293
+ capName: "recording-archive",
49294
+ capScope: "system",
49295
+ addonId: null,
49296
+ access: "create"
49297
+ },
49298
+ "recordingArchive.deleteFootprint": {
49299
+ capName: "recording-archive",
49300
+ capScope: "system",
49301
+ addonId: null,
49302
+ access: "delete"
49303
+ },
49304
+ "recordingArchive.getAvailabilityBatch": {
49305
+ capName: "recording-archive",
48821
49306
  capScope: "system",
48822
49307
  addonId: null,
48823
49308
  access: "view"
48824
49309
  },
48825
- "recording.getDeviceConfig": {
48826
- capName: "recording",
49310
+ "recordingArchive.getDaysWithRecordingsBatch": {
49311
+ capName: "recording-archive",
48827
49312
  capScope: "system",
48828
49313
  addonId: null,
48829
49314
  access: "view"
48830
49315
  },
48831
- "recording.getDeviceLiveContribution": {
48832
- capName: "recording",
49316
+ "recordingArchive.getDeviceConfig": {
49317
+ capName: "recording-archive",
48833
49318
  capScope: "system",
48834
49319
  addonId: null,
48835
49320
  access: "view"
48836
49321
  },
48837
- "recording.getDeviceSettingsContribution": {
48838
- capName: "recording",
49322
+ "recordingArchive.getDeviceLiveContribution": {
49323
+ capName: "recording-archive",
48839
49324
  capScope: "system",
48840
49325
  addonId: null,
48841
49326
  access: "view"
48842
49327
  },
48843
- "recording.getPlacement": {
48844
- capName: "recording",
49328
+ "recordingArchive.getDeviceSettingsContribution": {
49329
+ capName: "recording-archive",
48845
49330
  capScope: "system",
48846
49331
  addonId: null,
48847
49332
  access: "view"
48848
49333
  },
48849
- "recording.getPlaybackManifest": {
48850
- capName: "recording",
49334
+ "recordingArchive.getPlacement": {
49335
+ capName: "recording-archive",
48851
49336
  capScope: "system",
48852
49337
  addonId: null,
48853
49338
  access: "view"
48854
49339
  },
48855
- "recording.getRelocateResidue": {
48856
- capName: "recording",
49340
+ "recordingArchive.getRelocateResidue": {
49341
+ capName: "recording-archive",
48857
49342
  capScope: "system",
48858
49343
  addonId: null,
48859
49344
  access: "view"
48860
49345
  },
48861
- "recording.getStatus": {
48862
- capName: "recording",
49346
+ "recordingArchive.getStatus": {
49347
+ capName: "recording-archive",
48863
49348
  capScope: "system",
48864
49349
  addonId: null,
48865
49350
  access: "view"
48866
49351
  },
48867
- "recording.getStorageMigrationMoveStatus": {
48868
- capName: "recording",
49352
+ "recordingArchive.getStorageMigrationMoveStatus": {
49353
+ capName: "recording-archive",
48869
49354
  capScope: "system",
48870
49355
  addonId: null,
48871
49356
  access: "view"
48872
49357
  },
48873
- "recording.getStorageUsage": {
48874
- capName: "recording",
49358
+ "recordingArchive.getStorageUsage": {
49359
+ capName: "recording-archive",
48875
49360
  capScope: "system",
48876
49361
  addonId: null,
48877
49362
  access: "view"
48878
49363
  },
48879
- "recording.listOpsLog": {
48880
- capName: "recording",
49364
+ "recordingArchive.listOpsLog": {
49365
+ capName: "recording-archive",
48881
49366
  capScope: "system",
48882
49367
  addonId: null,
48883
49368
  access: "view"
48884
49369
  },
48885
- "recording.listRelocateJobs": {
48886
- capName: "recording",
49370
+ "recordingArchive.listRelocateJobs": {
49371
+ capName: "recording-archive",
48887
49372
  capScope: "system",
48888
49373
  addonId: null,
48889
49374
  access: "view"
48890
49375
  },
48891
- "recording.locateSegment": {
48892
- capName: "recording",
49376
+ "recordingArchive.locateSegment": {
49377
+ capName: "recording-archive",
48893
49378
  capScope: "system",
48894
49379
  addonId: null,
48895
49380
  access: "view"
48896
49381
  },
48897
- "recording.pauseForStorageMigration": {
48898
- capName: "recording",
49382
+ "recordingArchive.pauseForStorageMigration": {
49383
+ capName: "recording-archive",
48899
49384
  capScope: "system",
48900
49385
  addonId: null,
48901
49386
  access: "create"
48902
49387
  },
48903
- "recording.planStorageRebalance": {
48904
- capName: "recording",
49388
+ "recordingArchive.planStorageRebalance": {
49389
+ capName: "recording-archive",
48905
49390
  capScope: "system",
48906
49391
  addonId: null,
48907
49392
  access: "view"
48908
49393
  },
48909
- "recording.pruneFootage": {
48910
- capName: "recording",
49394
+ "recordingArchive.pruneFootage": {
49395
+ capName: "recording-archive",
48911
49396
  capScope: "system",
48912
49397
  addonId: null,
48913
49398
  access: "create"
48914
49399
  },
48915
- "recording.readGopBytes": {
48916
- capName: "recording",
49400
+ "recordingArchive.readGopBytes": {
49401
+ capName: "recording-archive",
48917
49402
  capScope: "system",
48918
49403
  addonId: null,
48919
49404
  access: "view"
48920
49405
  },
48921
- "recording.readSegmentBytes": {
48922
- capName: "recording",
49406
+ "recordingArchive.readSegmentBytes": {
49407
+ capName: "recording-archive",
48923
49408
  capScope: "system",
48924
49409
  addonId: null,
48925
49410
  access: "view"
48926
49411
  },
48927
- "recording.readWindowBytes": {
48928
- capName: "recording",
49412
+ "recordingArchive.readWindowBytes": {
49413
+ capName: "recording-archive",
48929
49414
  capScope: "system",
48930
49415
  addonId: null,
48931
49416
  access: "view"
48932
49417
  },
48933
- "recording.reconcileLedgerAgainstDisk": {
48934
- capName: "recording",
49418
+ "recordingArchive.reconcileLedgerAgainstDisk": {
49419
+ capName: "recording-archive",
48935
49420
  capScope: "system",
48936
49421
  addonId: null,
48937
49422
  access: "create"
48938
49423
  },
48939
- "recording.refreshStorageLocationsForMigration": {
48940
- capName: "recording",
49424
+ "recordingArchive.refreshStorageLocationsForMigration": {
49425
+ capName: "recording-archive",
48941
49426
  capScope: "system",
48942
49427
  addonId: null,
48943
49428
  access: "create"
48944
49429
  },
48945
- "recording.relocateFootage": {
48946
- capName: "recording",
49430
+ "recordingArchive.relocateFootage": {
49431
+ capName: "recording-archive",
48947
49432
  capScope: "system",
48948
49433
  addonId: null,
48949
49434
  access: "create"
48950
49435
  },
48951
- "recording.renderClip": {
48952
- capName: "recording",
49436
+ "recordingArchive.renderClip": {
49437
+ capName: "recording-archive",
48953
49438
  capScope: "system",
48954
49439
  addonId: null,
48955
49440
  access: "create"
48956
49441
  },
48957
- "recording.renderGif": {
48958
- capName: "recording",
49442
+ "recordingArchive.renderGif": {
49443
+ capName: "recording-archive",
48959
49444
  capScope: "system",
48960
49445
  addonId: null,
48961
49446
  access: "create"
48962
49447
  },
48963
- "recording.rescanStorage": {
48964
- capName: "recording",
49448
+ "recordingArchive.rescanStorage": {
49449
+ capName: "recording-archive",
48965
49450
  capScope: "system",
48966
49451
  addonId: null,
48967
49452
  access: "create"
48968
49453
  },
48969
- "recording.resumeForStorageMigration": {
48970
- capName: "recording",
49454
+ "recordingArchive.resumeForStorageMigration": {
49455
+ capName: "recording-archive",
48971
49456
  capScope: "system",
48972
49457
  addonId: null,
48973
49458
  access: "create"
48974
49459
  },
48975
- "recording.setDeviceConfig": {
48976
- capName: "recording",
49460
+ "recordingArchive.setDeviceConfig": {
49461
+ capName: "recording-archive",
48977
49462
  capScope: "system",
48978
49463
  addonId: null,
48979
49464
  access: "create"
48980
49465
  },
48981
- "recording.setDevicePlacement": {
48982
- capName: "recording",
49466
+ "recordingArchive.setDevicePlacement": {
49467
+ capName: "recording-archive",
48983
49468
  capScope: "system",
48984
49469
  addonId: null,
48985
49470
  access: "create"
48986
49471
  },
48987
- "recording.startStorageMigrationMove": {
48988
- capName: "recording",
49472
+ "recordingArchive.startStorageMigrationMove": {
49473
+ capName: "recording-archive",
48989
49474
  capScope: "system",
48990
49475
  addonId: null,
48991
49476
  access: "create"
48992
49477
  },
48993
- "recording.startStorageRebalance": {
48994
- capName: "recording",
49478
+ "recordingArchive.startStorageRebalance": {
49479
+ capName: "recording-archive",
48995
49480
  capScope: "system",
48996
49481
  addonId: null,
48997
49482
  access: "create"
@@ -51296,21 +51781,6 @@ Object.freeze({
51296
51781
  form: "single",
51297
51782
  optional: false
51298
51783
  }],
51299
- "events.getEventClipUrl": [{
51300
- name: "deviceId",
51301
- form: "single",
51302
- optional: false
51303
- }],
51304
- "events.getEvents": [{
51305
- name: "deviceId",
51306
- form: "single",
51307
- optional: false
51308
- }],
51309
- "events.getEventThumbnail": [{
51310
- name: "deviceId",
51311
- form: "single",
51312
- optional: false
51313
- }],
51314
51784
  "faceGallery.getFaceByTrack": [{
51315
51785
  name: "deviceId",
51316
51786
  form: "single",
@@ -52229,107 +52699,117 @@ Object.freeze({
52229
52699
  form: "single",
52230
52700
  optional: false
52231
52701
  }],
52232
- "recording.deleteFootprint": [{
52702
+ "recording.getAvailability": [{
52233
52703
  name: "deviceId",
52234
52704
  form: "single",
52235
52705
  optional: false
52236
52706
  }],
52237
- "recording.getAvailability": [{
52707
+ "recording.getDaysWithRecordings": [{
52238
52708
  name: "deviceId",
52239
52709
  form: "single",
52240
52710
  optional: false
52241
52711
  }],
52242
- "recording.getAvailabilityBatch": [{
52243
- name: "deviceIds",
52244
- form: "array",
52712
+ "recording.getPlayback": [{
52713
+ name: "deviceId",
52714
+ form: "single",
52245
52715
  optional: false
52246
52716
  }],
52247
- "recording.getDaysWithRecordings": [{
52717
+ "recording.getPlaybackOptions": [{
52248
52718
  name: "deviceId",
52249
52719
  form: "single",
52250
52720
  optional: false
52251
52721
  }],
52252
- "recording.getDaysWithRecordingsBatch": [{
52253
- name: "deviceIds",
52254
- form: "array",
52722
+ "recording.listSources": [{
52723
+ name: "deviceId",
52724
+ form: "single",
52255
52725
  optional: false
52256
52726
  }],
52257
- "recording.getDeviceConfig": [{
52727
+ "recordingArchive.deleteFootprint": [{
52258
52728
  name: "deviceId",
52259
52729
  form: "single",
52260
52730
  optional: false
52261
52731
  }],
52262
- "recording.getPlaybackManifest": [{
52732
+ "recordingArchive.getAvailabilityBatch": [{
52733
+ name: "deviceIds",
52734
+ form: "array",
52735
+ optional: false
52736
+ }],
52737
+ "recordingArchive.getDaysWithRecordingsBatch": [{
52738
+ name: "deviceIds",
52739
+ form: "array",
52740
+ optional: false
52741
+ }],
52742
+ "recordingArchive.getDeviceConfig": [{
52263
52743
  name: "deviceId",
52264
52744
  form: "single",
52265
52745
  optional: false
52266
52746
  }],
52267
- "recording.listOpsLog": [{
52747
+ "recordingArchive.listOpsLog": [{
52268
52748
  name: "deviceId",
52269
52749
  form: "single",
52270
52750
  optional: true
52271
52751
  }],
52272
- "recording.locateSegment": [{
52752
+ "recordingArchive.locateSegment": [{
52273
52753
  name: "deviceId",
52274
52754
  form: "single",
52275
52755
  optional: false
52276
52756
  }],
52277
- "recording.pruneFootage": [{
52757
+ "recordingArchive.pruneFootage": [{
52278
52758
  name: "deviceId",
52279
52759
  form: "single",
52280
52760
  optional: false
52281
52761
  }],
52282
- "recording.readGopBytes": [{
52762
+ "recordingArchive.readGopBytes": [{
52283
52763
  name: "deviceId",
52284
52764
  form: "single",
52285
52765
  optional: false
52286
52766
  }],
52287
- "recording.readSegmentBytes": [{
52767
+ "recordingArchive.readSegmentBytes": [{
52288
52768
  name: "deviceId",
52289
52769
  form: "single",
52290
52770
  optional: false
52291
52771
  }],
52292
- "recording.readWindowBytes": [{
52772
+ "recordingArchive.readWindowBytes": [{
52293
52773
  name: "deviceId",
52294
52774
  form: "single",
52295
52775
  optional: false
52296
52776
  }],
52297
- "recording.reconcileLedgerAgainstDisk": [{
52777
+ "recordingArchive.reconcileLedgerAgainstDisk": [{
52298
52778
  name: "deviceId",
52299
52779
  form: "single",
52300
52780
  optional: true
52301
52781
  }],
52302
- "recording.relocateFootage": [{
52782
+ "recordingArchive.relocateFootage": [{
52303
52783
  name: "deviceId",
52304
52784
  form: "single",
52305
52785
  optional: true
52306
52786
  }],
52307
- "recording.renderClip": [{
52787
+ "recordingArchive.renderClip": [{
52308
52788
  name: "deviceId",
52309
52789
  form: "single",
52310
52790
  optional: false
52311
52791
  }],
52312
- "recording.renderGif": [{
52792
+ "recordingArchive.renderGif": [{
52313
52793
  name: "deviceId",
52314
52794
  form: "single",
52315
52795
  optional: false
52316
52796
  }],
52317
- "recording.rescanStorage": [{
52797
+ "recordingArchive.rescanStorage": [{
52318
52798
  name: "deviceId",
52319
52799
  form: "single",
52320
52800
  optional: false
52321
52801
  }],
52322
- "recording.setDeviceConfig": [{
52802
+ "recordingArchive.setDeviceConfig": [{
52323
52803
  name: "deviceId",
52324
52804
  form: "single",
52325
52805
  optional: false
52326
52806
  }],
52327
- "recording.setDevicePlacement": [{
52807
+ "recordingArchive.setDevicePlacement": [{
52328
52808
  name: "deviceId",
52329
52809
  form: "single",
52330
52810
  optional: false
52331
52811
  }],
52332
- "recording.startStorageMigrationMove": [{
52812
+ "recordingArchive.startStorageMigrationMove": [{
52333
52813
  name: "deviceId",
52334
52814
  form: "single",
52335
52815
  optional: true
@@ -52858,6 +53338,37 @@ function isScheduleActive(schedule, atMs) {
52858
53338
  }
52859
53339
  return schedule.invert === true ? !inside : inside;
52860
53340
  }
53341
+ var RULE_BODY_ONLY = ["body"];
53342
+ var RULE_TEXT = ["title", "body"];
53343
+ var BATTERY = ["device-battery-low", "device-battery-normal"];
53344
+ var CONSUMABLE = ["device-consumable-low", "device-consumable-normal"];
53345
+ var UPDATES = [
53346
+ "addon-update-available",
53347
+ "server-update-available",
53348
+ "wrapper-update-available"
53349
+ ];
53350
+ var PACKAGE_UPDATES = ["addon-update-available", "server-update-available"];
53351
+ var ALARM = [
53352
+ "alarm-triggered",
53353
+ "alarm-armed",
53354
+ "alarm-disarmed",
53355
+ "alarm-arming",
53356
+ "alarm-arm-refused"
53357
+ ];
53358
+ var COMBINED_ALARM = ["alarm-triggered"];
53359
+ var DEVICE_EVENTS = [
53360
+ "device-online",
53361
+ "device-offline",
53362
+ "device-disabled",
53363
+ "device-enabled",
53364
+ ...BATTERY,
53365
+ ...CONSUMABLE,
53366
+ "stream-online",
53367
+ "stream-offline",
53368
+ "detection-blind",
53369
+ ...ALARM
53370
+ ];
53371
+ [...DEVICE_EVENTS], [...RULE_TEXT], [...COMBINED_ALARM], [...RULE_TEXT], [...COMBINED_ALARM], [...RULE_TEXT], [...RULE_TEXT], [...COMBINED_ALARM], [...RULE_TEXT], [...PACKAGE_UPDATES], [...RULE_TEXT], [...RULE_TEXT], [...COMBINED_ALARM], [...RULE_TEXT], [...COMBINED_ALARM], [...RULE_TEXT], [...COMBINED_ALARM], [...RULE_TEXT], [...RULE_TEXT], [...RULE_TEXT], [...RULE_TEXT], [...RULE_TEXT], [...RULE_TEXT], [...RULE_TEXT], [...RULE_TEXT], [...RULE_BODY_ONLY], [...RULE_TEXT], [...RULE_TEXT], [...DEVICE_EVENTS], [...RULE_TEXT], [...DEVICE_EVENTS], [...RULE_TEXT], [...BATTERY, ...CONSUMABLE], [...RULE_TEXT], [...CONSUMABLE], [...RULE_TEXT], [...RULE_TEXT], [...UPDATES], [...RULE_TEXT], [...UPDATES], [...RULE_TEXT], [...RULE_TEXT], [...RULE_TEXT], [...RULE_TEXT], [...UPDATES], [...RULE_TEXT], [...PACKAGE_UPDATES], [...RULE_TEXT], [...PACKAGE_UPDATES], [...RULE_TEXT], [...UPDATES], [...RULE_TEXT], [...UPDATES], [...RULE_TEXT], [...PACKAGE_UPDATES], [...RULE_TEXT], [...RULE_TEXT], [...RULE_TEXT], [...RULE_TEXT], [...RULE_TEXT], [...RULE_TEXT], [...RULE_TEXT], [...RULE_TEXT], [...RULE_TEXT], [...RULE_TEXT], [...RULE_TEXT], [...RULE_TEXT], [...RULE_TEXT], [...RULE_TEXT], [...RULE_TEXT], [...RULE_TEXT], [...RULE_TEXT], [...RULE_TEXT], [...RULE_TEXT], [...RULE_TEXT], [...RULE_TEXT], [...RULE_TEXT], [...RULE_TEXT], [...RULE_TEXT];
52861
53372
  /**
52862
53373
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
52863
53374
  *