@camstack/addon-provider-homeassistant 1.2.142 → 1.2.143

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.
@@ -5359,7 +5359,7 @@ var ZodIssueCode = {
5359
5359
  var ZodFirstPartyTypeKind;
5360
5360
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5361
5361
  //#endregion
5362
- //#region ../types/dist/sleep-i3eUVc-d.mjs
5362
+ //#region ../types/dist/sleep-PEo0-Fz9.mjs
5363
5363
  /**
5364
5364
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5365
5365
  * window to float samples (D455).
@@ -6495,6 +6495,24 @@ function normalizeAddonInitResult(result) {
6495
6495
  if (Array.isArray(result)) return { providers: result };
6496
6496
  return result;
6497
6497
  }
6498
+ /** The wire shape of {@link PeerBytesTicket} — see the type for what it is. */
6499
+ var PeerBytesTicketSchema = object({
6500
+ /** `http://127.0.0.1:<port>/<token>`. One `GET` takes it. */
6501
+ url: string().min(1),
6502
+ /**
6503
+ * The HOST node this URL means something on — the hub or a named agent,
6504
+ * never a runner. {@link AddonPeerBytes.open} compares it to its own and
6505
+ * refuses `cross-node` by name when they differ, without dialling.
6506
+ */
6507
+ hostNodeId: string().min(1),
6508
+ expiresAtMs: number().int().nonnegative(),
6509
+ /**
6510
+ * What the producer DECLARED the body to be, when it knows — `null` when it
6511
+ * does not. Never `0` for unknown (D393): a consumer sizing a bound off this
6512
+ * must be able to tell "the producer did not say" from "the body is empty".
6513
+ */
6514
+ declaredBytes: number().int().nonnegative().nullable()
6515
+ });
6498
6516
  /** Shared Zod schemas used across streaming capabilities. */
6499
6517
  var CamProfileSchema = _enum([
6500
6518
  "high",
@@ -7816,7 +7834,7 @@ var AdoptionJobSchema = object({
7816
7834
  * component's original options — detection to the detection-pipeline wrapper
7817
7835
  * binding, audio analysis to its own, recording to `RecordingConfig.enabled`
7818
7836
  * (which was always first-class; the switch was a veneer over
7819
- * `recording.setDeviceConfig`), notifications to a notification-center
7837
+ * `recordingArchive.setDeviceConfig`), notifications to a notification-center
7820
7838
  * per-device setting, the two camera planes to their own components.
7821
7839
  *
7822
7840
  * What survives is {@link composeSwitchedOff}: `CameraStatus.switchedOff`, the
@@ -7842,7 +7860,7 @@ var AdoptionJobSchema = object({
7842
7860
  * | `stream-broker` | `deviceManager.setDisabled` | `StreamBrokerManager.reconcileAllCatalogs` releases the brokers; `ensureBroker` refuses re-creation |
7843
7861
  * | `object-detection` | `deviceManager.setWrapperActive('detection-pipeline')` | `PipelineSettingsStore.resolvePipelineForDevice` returns `{ steps: [], audio: null }` |
7844
7862
  * | `audio-analysis` | `deviceManager.setWrapperActive('audio-analysis')` | `AudioSubscriptionController.subscribeAudioStream` returns `null` before opening the stream |
7845
- * | `recording` | `recording.setDeviceConfig` → `RecordingConfig.enabled` | `band-decision.shouldRecord` returns false; the controller detaches the device |
7863
+ * | `recording` | `recordingArchive.setDeviceConfig` → `RecordingConfig.enabled` | `band-decision.shouldRecord` returns false; the controller detaches the device |
7846
7864
  * | `notifications` | `notificationRules.setDeviceMuted` | `NotificationCenter.evaluateAndEnqueue` returns before any rule is evaluated |
7847
7865
  * | `privacy-mask` | `privacyMask.setMask({ enabled })` → the CAMERA | the camera blanks the masked regions itself; every stream and recording carries the black boxes |
7848
7866
  * | `device-audio` | `privacyMask.setAudioEnabled` → the CAMERA | the camera stops encoding an audio track at all; every consumer sees silent video |
@@ -11835,87 +11853,6 @@ var brokerCapability = {
11835
11853
  }
11836
11854
  };
11837
11855
  DeviceType.Camera;
11838
- /**
11839
- * The signals a device can emit to WAKE its own stream.
11840
- *
11841
- * A camera whose stream is built on demand sleeps until something asks for it,
11842
- * and "something" cannot be a consumer that is merely attached — a Frigate-style
11843
- * puller holds a session open for ever, and treating that as demand would keep
11844
- * a battery camera awake for ever, which is the whole thing the battery is for
11845
- * (D173). So the wake has to come from the CAMERA: an event it noticed by
11846
- * itself, with no stream running.
11847
- *
11848
- * ## The vocabulary is the PROVIDER'S, not ours
11849
- *
11850
- * Like `consumables`, this cap declares no vocabulary of its own. A provider
11851
- * names each signal with a `code` it chooses and a `label` an operator reads.
11852
- * Reolink offers motion and camera-native detection; another provider may offer
11853
- * a tamper, a doorbell press, a PIR, or something no camera in this fleet has
11854
- * yet. A fixed enum here would mean every new signal is a framework release.
11855
- *
11856
- * It is deliberately NOT derived from the caps a device already binds. Whether
11857
- * a camera CAN push firmware motion is expressed by `motionSources` containing
11858
- * `'onboard'`, and whether it does AI on-camera by the `native-object-detection`
11859
- * binding — but both answer "what drives the detection pipeline", which is a
11860
- * different question from "what may wake a sleeping stream". A camera can do
11861
- * the first and not be trusted with the second, and the operator picks per
11862
- * camera. Two questions, two authorities.
11863
- *
11864
- * ## Availability is not permission
11865
- *
11866
- * `listSignals` says what the device CAN emit. Whether a given signal actually
11867
- * wakes the stream is the operator's per-camera choice, held by the broker
11868
- * alongside the cooldown — see the stream-broker cap's wake settings. A
11869
- * provider declaring a signal is not a provider enabling it.
11870
- */
11871
- /** One signal a device can emit. */
11872
- var StreamSignalSchema = object({
11873
- /** Stable id chosen by the provider, e.g. `'motion'`, `'person'`, `'tamper'`. */
11874
- code: string().min(1),
11875
- /** What an operator reads in the picker. The provider's own wording. */
11876
- label: string().min(1),
11877
- /**
11878
- * Whether the provider recommends this signal ON when a camera is first set
11879
- * up. A provider knows which of its signals are cheap and reliable; an
11880
- * operator should not have to discover that by trial. Reolink recommends
11881
- * both of its own.
11882
- */
11883
- recommended: boolean()
11884
- });
11885
- var StreamSignalsStatusSchema = object({
11886
- signals: array(StreamSignalSchema),
11887
- lastFetchedAt: number()
11888
- });
11889
- var streamSignalsCapability = {
11890
- name: "stream-signals",
11891
- scope: "device",
11892
- deviceNative: true,
11893
- mode: "singleton",
11894
- deviceTypes: Object.values(DeviceType),
11895
- runtimeState: StreamSignalsStatusSchema,
11896
- /**
11897
- * Runtime-state durability: **session** — mirrored in RAM, never written.
11898
- *
11899
- * The slice holds what the DEVICE says it can emit. That is a probed fact,
11900
- * not an operator choice: the provider re-declares it on every registration,
11901
- * so losing it loses nothing and persisting it would freeze an answer the
11902
- * camera is entitled to change. Measured the same day on the sibling case —
11903
- * `native-object-detection.supportedClasses` was persisted, and a firmware
11904
- * class the camera really detected stayed missing for the life of the row
11905
- * because the fix could not reach it.
11906
- *
11907
- * See `RuntimeStateDurability`. Enforced by
11908
- * `scripts/check-runtime-state-durability.ts`.
11909
- */
11910
- durability: "session",
11911
- methods: {
11912
- /**
11913
- * What this device can emit. Empty is a valid and common answer — most
11914
- * cameras have nothing to offer here, and an empty list is what makes the
11915
- * broker's picker show nothing rather than a false choice.
11916
- */
11917
- listSignals: method(_void(), array(StreamSignalSchema).readonly()) }
11918
- };
11919
11856
  /** Stream delivery format. (Relocated from the retired `streaming-engine` cap.) */
11920
11857
  var StreamFormatSchema = _enum([
11921
11858
  "webrtc",
@@ -13381,6 +13318,244 @@ method(object({ codec: string() }), boolean()), method(_void(), object({
13381
13318
  });
13382
13319
  DeviceType.Camera;
13383
13320
  /**
13321
+ * device-admin-link — "this device has a management page of its own, and here
13322
+ * is its address".
13323
+ *
13324
+ * ## Why this is not a `deviceConfig` cap
13325
+ *
13326
+ * There is nothing to edit. A `deviceConfig` cap (D14) exists so the framework
13327
+ * can DERIVE a settings form from `getOptions` + `getStatus` and route a flat
13328
+ * patch back through a setter; it costs a `builderId` reducer in
13329
+ * `device-config-contribution.ts` and a `*-config-schema.ts` beside it, and it
13330
+ * renders a form section. This cap answers ONE question with ONE read and
13331
+ * renders a button. Nothing about it is a form, so it carries no `deviceConfig`
13332
+ * block, no `settings`, no `runtimeState` and no reducer — exactly like
13333
+ * `reboot`, the other pure-RPC device-native cap.
13334
+ *
13335
+ * ## Absent, and the difference between "no page" and "we cannot say"
13336
+ *
13337
+ * The two are answered at DIFFERENT layers, on purpose:
13338
+ *
13339
+ * - **"We cannot say"** → the provider never registers the cap for that
13340
+ * device. A VeSync humidifier, a Petkit feeder, a Dreame vacuum and a Dreo
13341
+ * fan are reached only through a vendor cloud; there is no address to hand
13342
+ * out and no page to open. A Tuya plug, a Wyze camera and a Gree air
13343
+ * conditioner DO have a LAN IP, and still have no HTTP management page
13344
+ * behind it. None of them register, so `deviceManager.getBindings` never
13345
+ * lists the cap and no surface asks.
13346
+ * - **"This device has no page, and I know that"** → the provider registers
13347
+ * and `getAdminLink` returns `null`. This is the answer for a device whose
13348
+ * sibling DOES have a page: a Reolink battery camera reached over UDP by
13349
+ * `uid` with a blank `host`, an Ecowitt gateway configured in `listener`
13350
+ * transport, a Home Assistant broker authenticated by supervisor token
13351
+ * (which carries no `baseUrl` at all).
13352
+ *
13353
+ * Both draw NOTHING. A button that opens a browser error is worse than no
13354
+ * button, and D62 is the same rule from the other side: an off switch is
13355
+ * reported off, never made to look broken. There is no third state where the
13356
+ * UI renders a disabled button "because the device might have a page".
13357
+ *
13358
+ * ## The URL never carries credentials
13359
+ *
13360
+ * Not in userinfo, not in a query string. Every provider builds through
13361
+ * `buildDeviceAdminUrl` (`device-admin-link-url.ts`), which takes host, port,
13362
+ * scheme and path as separate arguments — there is no parameter a secret could
13363
+ * arrive in — and re-checks its own output for the `scheme://user:pass@` shape
13364
+ * that `scripts/check-no-credential-urls-in-fixtures.ts` bans from recorded
13365
+ * output. `scripts/check-admin-link-builder-is-the-only-url-source.ts` is what
13366
+ * keeps providers from hand-rolling one anyway.
13367
+ *
13368
+ * This matters here more than anywhere else in the repo, because every provider
13369
+ * that knows a device's host knows its PASSWORD too: `{ host, port, username,
13370
+ * password }` sit in one object on Hikvision, Amcrest, Reolink and ONVIF alike,
13371
+ * and `http://admin:hunter2@192.168.50.139/` is a URL a browser accepts. The
13372
+ * camera's own page will ask for its own login. That is correct, and pre-
13373
+ * filling it is the operator's business, not ours.
13374
+ *
13375
+ * ## It is a LAN fact
13376
+ *
13377
+ * The URL addresses the device where the NODE can see it. It is not proxied,
13378
+ * not made reachable from outside, and not sent anywhere. A surface renders it
13379
+ * as a link the operator's own browser follows, on the operator's own network,
13380
+ * or renders nothing.
13381
+ */
13382
+ /**
13383
+ * Whose page is it. The distinction is for the OPERATOR, who needs to know
13384
+ * before clicking whether he is about to land on a camera's own web server or
13385
+ * inside Home Assistant.
13386
+ */
13387
+ var AdminLinkTargetEnum = _enum(["device", "integration"]);
13388
+ var DeviceAdminLinkSchema = object({
13389
+ /**
13390
+ * Absolute `http(s)://` URL. Built by `buildDeviceAdminUrl` and therefore
13391
+ * free of userinfo and of any credential-shaped query key.
13392
+ */
13393
+ url: string(),
13394
+ /**
13395
+ * What the surface calls it — "Web UI", "Home Assistant", "UniFi controller".
13396
+ * The PROVIDER names it, because only the provider knows what the page is;
13397
+ * a UI that invented the label from the addon id would call the Home
13398
+ * Assistant device page "Provider Homeassistant".
13399
+ */
13400
+ label: string(),
13401
+ target: AdminLinkTargetEnum,
13402
+ /**
13403
+ * Host the URL points at, without scheme, port or path — for the tooltip, so
13404
+ * an operator can see WHERE the button goes before he follows it. Redundant
13405
+ * with `url` by construction; carried separately so no surface has to parse
13406
+ * a URL to show it.
13407
+ */
13408
+ host: string()
13409
+ });
13410
+ var deviceAdminLinkCapability = {
13411
+ name: "device-admin-link",
13412
+ scope: "device",
13413
+ deviceNative: true,
13414
+ mode: "singleton",
13415
+ methods: {
13416
+ /**
13417
+ * The device's management page, or `null` when this device has none.
13418
+ *
13419
+ * `auth: 'admin'` deliberately. This is administration, not actuation —
13420
+ * the same bucket as `reboot` and `camera-credentials`, and explicitly NOT
13421
+ * the actuation set `scripts/check-actuation-not-admin.ts` protects (D403).
13422
+ * The URL is also a statement about the LAN, which a household member with
13423
+ * a `view` grant on a light has no reason to be handed.
13424
+ *
13425
+ * The surfaces gate on the QUERY, never on a role they guessed: a caller
13426
+ * without the right loses the query and draws nothing, which is the same
13427
+ * thing a device with no page draws. There is no path on which a button
13428
+ * appears and then fails — the D403 failure mode, from the other end.
13429
+ */
13430
+ getAdminLink: method(object({ deviceId: number().int().nonnegative() }), DeviceAdminLinkSchema.nullable(), { auth: "admin" }) }
13431
+ };
13432
+ /**
13433
+ * Query keys that may never appear on an admin link. A credential smuggled as
13434
+ * `?password=` is the same leak as userinfo, in a form the userinfo check
13435
+ * cannot see: it survives copy-paste, referrer headers and proxy logs
13436
+ * identically.
13437
+ */
13438
+ var CREDENTIAL_QUERY_KEYS = [
13439
+ "password",
13440
+ "passwd",
13441
+ "pwd",
13442
+ "pass",
13443
+ "user",
13444
+ "username",
13445
+ "usr",
13446
+ "login",
13447
+ "token",
13448
+ "access_token",
13449
+ "auth",
13450
+ "authorization",
13451
+ "apikey",
13452
+ "api_key",
13453
+ "secret",
13454
+ "credential",
13455
+ "credentials",
13456
+ "session",
13457
+ "sessionid",
13458
+ "key"
13459
+ ];
13460
+ /**
13461
+ * The same userinfo shape `scripts/check-no-credential-urls-in-fixtures.ts`
13462
+ * scans recorded fixtures for, applied to what we are about to EMIT. Kept
13463
+ * structurally identical on purpose: a URL this function returns is a URL that
13464
+ * guard would pass.
13465
+ */
13466
+ var CREDENTIAL_URL = /[a-z][a-z0-9+.-]*:\/\/[^/\s:@'"]+:[^/\s:@'"]+@/i;
13467
+ /** A host that is safe to place in an authority component verbatim. */
13468
+ var PLAIN_HOST = /^[a-zA-Z0-9._-]+$/;
13469
+ /** A bracketed IPv6 literal, the only other authority form we emit. */
13470
+ var IPV6_HOST = /^\[[0-9a-fA-F:.]+\]$/;
13471
+ function defaultPortFor(scheme) {
13472
+ return scheme === "https" ? 443 : 80;
13473
+ }
13474
+ /**
13475
+ * Build the admin-page URL, or refuse by name.
13476
+ *
13477
+ * The refusal is never thrown: a provider answering "no page for this device"
13478
+ * is an ordinary answer (`getAdminLink` → `null`), and a throw here would turn
13479
+ * a missing host on one device into a failed query for the whole surface.
13480
+ */
13481
+ function buildDeviceAdminUrl(parts) {
13482
+ const host = parts.host.trim();
13483
+ if (host.length === 0) return {
13484
+ ok: false,
13485
+ reason: "empty-host"
13486
+ };
13487
+ if (host.includes("@")) return {
13488
+ ok: false,
13489
+ reason: "host-carries-userinfo"
13490
+ };
13491
+ if (!PLAIN_HOST.test(host) && !IPV6_HOST.test(host)) return {
13492
+ ok: false,
13493
+ reason: "host-not-plain"
13494
+ };
13495
+ if (parts.port !== null) {
13496
+ if (!Number.isInteger(parts.port) || parts.port < 1 || parts.port > 65535) return {
13497
+ ok: false,
13498
+ reason: "port-out-of-range"
13499
+ };
13500
+ }
13501
+ if (!parts.path.startsWith("/")) return {
13502
+ ok: false,
13503
+ reason: "path-not-absolute"
13504
+ };
13505
+ const query = parts.query ?? {};
13506
+ for (const key of Object.keys(query)) if (CREDENTIAL_QUERY_KEYS.includes(key.toLowerCase())) return {
13507
+ ok: false,
13508
+ reason: "credential-query-key"
13509
+ };
13510
+ const authority = parts.port === null || parts.port === defaultPortFor(parts.scheme) ? host : `${host}:${String(parts.port)}`;
13511
+ const search = new URLSearchParams();
13512
+ for (const [key, value] of Object.entries(query)) search.append(key, value);
13513
+ const suffix = search.size > 0 ? `?${search.toString()}` : "";
13514
+ const url = `${parts.scheme}://${authority}${parts.path}${suffix}`;
13515
+ if (CREDENTIAL_URL.test(url)) return {
13516
+ ok: false,
13517
+ reason: "userinfo-in-result"
13518
+ };
13519
+ return {
13520
+ ok: true,
13521
+ url
13522
+ };
13523
+ }
13524
+ function parseAdminBase(baseUrl) {
13525
+ const raw = baseUrl.trim();
13526
+ if (raw.length === 0) return {
13527
+ ok: false,
13528
+ reason: "empty"
13529
+ };
13530
+ let parsed;
13531
+ try {
13532
+ parsed = new URL(raw);
13533
+ } catch {
13534
+ return {
13535
+ ok: false,
13536
+ reason: "unparseable"
13537
+ };
13538
+ }
13539
+ if (parsed.username !== "" || parsed.password !== "") return {
13540
+ ok: false,
13541
+ reason: "base-carries-userinfo"
13542
+ };
13543
+ if (parsed.protocol !== "http:" && parsed.protocol !== "https:") return {
13544
+ ok: false,
13545
+ reason: "scheme-not-http"
13546
+ };
13547
+ const scheme = parsed.protocol === "https:" ? "https" : "http";
13548
+ const port = parsed.port === "" ? null : Number(parsed.port);
13549
+ const basePath = parsed.pathname === "/" ? "" : parsed.pathname.replace(/\/+$/, "");
13550
+ return {
13551
+ ok: true,
13552
+ host: parsed.hostname,
13553
+ port,
13554
+ scheme,
13555
+ basePath
13556
+ };
13557
+ }
13558
+ /**
13384
13559
  * Identity envelope for a device's upstream-system metadata.
13385
13560
  *
13386
13561
  * Two jobs:
@@ -13877,244 +14052,6 @@ var deviceAdoptionCapability = {
13877
14052
  }
13878
14053
  };
13879
14054
  /**
13880
- * device-admin-link — "this device has a management page of its own, and here
13881
- * is its address".
13882
- *
13883
- * ## Why this is not a `deviceConfig` cap
13884
- *
13885
- * There is nothing to edit. A `deviceConfig` cap (D14) exists so the framework
13886
- * can DERIVE a settings form from `getOptions` + `getStatus` and route a flat
13887
- * patch back through a setter; it costs a `builderId` reducer in
13888
- * `device-config-contribution.ts` and a `*-config-schema.ts` beside it, and it
13889
- * renders a form section. This cap answers ONE question with ONE read and
13890
- * renders a button. Nothing about it is a form, so it carries no `deviceConfig`
13891
- * block, no `settings`, no `runtimeState` and no reducer — exactly like
13892
- * `reboot`, the other pure-RPC device-native cap.
13893
- *
13894
- * ## Absent, and the difference between "no page" and "we cannot say"
13895
- *
13896
- * The two are answered at DIFFERENT layers, on purpose:
13897
- *
13898
- * - **"We cannot say"** → the provider never registers the cap for that
13899
- * device. A VeSync humidifier, a Petkit feeder, a Dreame vacuum and a Dreo
13900
- * fan are reached only through a vendor cloud; there is no address to hand
13901
- * out and no page to open. A Tuya plug, a Wyze camera and a Gree air
13902
- * conditioner DO have a LAN IP, and still have no HTTP management page
13903
- * behind it. None of them register, so `deviceManager.getBindings` never
13904
- * lists the cap and no surface asks.
13905
- * - **"This device has no page, and I know that"** → the provider registers
13906
- * and `getAdminLink` returns `null`. This is the answer for a device whose
13907
- * sibling DOES have a page: a Reolink battery camera reached over UDP by
13908
- * `uid` with a blank `host`, an Ecowitt gateway configured in `listener`
13909
- * transport, a Home Assistant broker authenticated by supervisor token
13910
- * (which carries no `baseUrl` at all).
13911
- *
13912
- * Both draw NOTHING. A button that opens a browser error is worse than no
13913
- * button, and D62 is the same rule from the other side: an off switch is
13914
- * reported off, never made to look broken. There is no third state where the
13915
- * UI renders a disabled button "because the device might have a page".
13916
- *
13917
- * ## The URL never carries credentials
13918
- *
13919
- * Not in userinfo, not in a query string. Every provider builds through
13920
- * `buildDeviceAdminUrl` (`device-admin-link-url.ts`), which takes host, port,
13921
- * scheme and path as separate arguments — there is no parameter a secret could
13922
- * arrive in — and re-checks its own output for the `scheme://user:pass@` shape
13923
- * that `scripts/check-no-credential-urls-in-fixtures.ts` bans from recorded
13924
- * output. `scripts/check-admin-link-builder-is-the-only-url-source.ts` is what
13925
- * keeps providers from hand-rolling one anyway.
13926
- *
13927
- * This matters here more than anywhere else in the repo, because every provider
13928
- * that knows a device's host knows its PASSWORD too: `{ host, port, username,
13929
- * password }` sit in one object on Hikvision, Amcrest, Reolink and ONVIF alike,
13930
- * and `http://admin:hunter2@192.168.50.139/` is a URL a browser accepts. The
13931
- * camera's own page will ask for its own login. That is correct, and pre-
13932
- * filling it is the operator's business, not ours.
13933
- *
13934
- * ## It is a LAN fact
13935
- *
13936
- * The URL addresses the device where the NODE can see it. It is not proxied,
13937
- * not made reachable from outside, and not sent anywhere. A surface renders it
13938
- * as a link the operator's own browser follows, on the operator's own network,
13939
- * or renders nothing.
13940
- */
13941
- /**
13942
- * Whose page is it. The distinction is for the OPERATOR, who needs to know
13943
- * before clicking whether he is about to land on a camera's own web server or
13944
- * inside Home Assistant.
13945
- */
13946
- var AdminLinkTargetEnum = _enum(["device", "integration"]);
13947
- var DeviceAdminLinkSchema = object({
13948
- /**
13949
- * Absolute `http(s)://` URL. Built by `buildDeviceAdminUrl` and therefore
13950
- * free of userinfo and of any credential-shaped query key.
13951
- */
13952
- url: string(),
13953
- /**
13954
- * What the surface calls it — "Web UI", "Home Assistant", "UniFi controller".
13955
- * The PROVIDER names it, because only the provider knows what the page is;
13956
- * a UI that invented the label from the addon id would call the Home
13957
- * Assistant device page "Provider Homeassistant".
13958
- */
13959
- label: string(),
13960
- target: AdminLinkTargetEnum,
13961
- /**
13962
- * Host the URL points at, without scheme, port or path — for the tooltip, so
13963
- * an operator can see WHERE the button goes before he follows it. Redundant
13964
- * with `url` by construction; carried separately so no surface has to parse
13965
- * a URL to show it.
13966
- */
13967
- host: string()
13968
- });
13969
- var deviceAdminLinkCapability = {
13970
- name: "device-admin-link",
13971
- scope: "device",
13972
- deviceNative: true,
13973
- mode: "singleton",
13974
- methods: {
13975
- /**
13976
- * The device's management page, or `null` when this device has none.
13977
- *
13978
- * `auth: 'admin'` deliberately. This is administration, not actuation —
13979
- * the same bucket as `reboot` and `camera-credentials`, and explicitly NOT
13980
- * the actuation set `scripts/check-actuation-not-admin.ts` protects (D403).
13981
- * The URL is also a statement about the LAN, which a household member with
13982
- * a `view` grant on a light has no reason to be handed.
13983
- *
13984
- * The surfaces gate on the QUERY, never on a role they guessed: a caller
13985
- * without the right loses the query and draws nothing, which is the same
13986
- * thing a device with no page draws. There is no path on which a button
13987
- * appears and then fails — the D403 failure mode, from the other end.
13988
- */
13989
- getAdminLink: method(object({ deviceId: number().int().nonnegative() }), DeviceAdminLinkSchema.nullable(), { auth: "admin" }) }
13990
- };
13991
- /**
13992
- * Query keys that may never appear on an admin link. A credential smuggled as
13993
- * `?password=` is the same leak as userinfo, in a form the userinfo check
13994
- * cannot see: it survives copy-paste, referrer headers and proxy logs
13995
- * identically.
13996
- */
13997
- var CREDENTIAL_QUERY_KEYS = [
13998
- "password",
13999
- "passwd",
14000
- "pwd",
14001
- "pass",
14002
- "user",
14003
- "username",
14004
- "usr",
14005
- "login",
14006
- "token",
14007
- "access_token",
14008
- "auth",
14009
- "authorization",
14010
- "apikey",
14011
- "api_key",
14012
- "secret",
14013
- "credential",
14014
- "credentials",
14015
- "session",
14016
- "sessionid",
14017
- "key"
14018
- ];
14019
- /**
14020
- * The same userinfo shape `scripts/check-no-credential-urls-in-fixtures.ts`
14021
- * scans recorded fixtures for, applied to what we are about to EMIT. Kept
14022
- * structurally identical on purpose: a URL this function returns is a URL that
14023
- * guard would pass.
14024
- */
14025
- var CREDENTIAL_URL = /[a-z][a-z0-9+.-]*:\/\/[^/\s:@'"]+:[^/\s:@'"]+@/i;
14026
- /** A host that is safe to place in an authority component verbatim. */
14027
- var PLAIN_HOST = /^[a-zA-Z0-9._-]+$/;
14028
- /** A bracketed IPv6 literal, the only other authority form we emit. */
14029
- var IPV6_HOST = /^\[[0-9a-fA-F:.]+\]$/;
14030
- function defaultPortFor(scheme) {
14031
- return scheme === "https" ? 443 : 80;
14032
- }
14033
- /**
14034
- * Build the admin-page URL, or refuse by name.
14035
- *
14036
- * The refusal is never thrown: a provider answering "no page for this device"
14037
- * is an ordinary answer (`getAdminLink` → `null`), and a throw here would turn
14038
- * a missing host on one device into a failed query for the whole surface.
14039
- */
14040
- function buildDeviceAdminUrl(parts) {
14041
- const host = parts.host.trim();
14042
- if (host.length === 0) return {
14043
- ok: false,
14044
- reason: "empty-host"
14045
- };
14046
- if (host.includes("@")) return {
14047
- ok: false,
14048
- reason: "host-carries-userinfo"
14049
- };
14050
- if (!PLAIN_HOST.test(host) && !IPV6_HOST.test(host)) return {
14051
- ok: false,
14052
- reason: "host-not-plain"
14053
- };
14054
- if (parts.port !== null) {
14055
- if (!Number.isInteger(parts.port) || parts.port < 1 || parts.port > 65535) return {
14056
- ok: false,
14057
- reason: "port-out-of-range"
14058
- };
14059
- }
14060
- if (!parts.path.startsWith("/")) return {
14061
- ok: false,
14062
- reason: "path-not-absolute"
14063
- };
14064
- const query = parts.query ?? {};
14065
- for (const key of Object.keys(query)) if (CREDENTIAL_QUERY_KEYS.includes(key.toLowerCase())) return {
14066
- ok: false,
14067
- reason: "credential-query-key"
14068
- };
14069
- const authority = parts.port === null || parts.port === defaultPortFor(parts.scheme) ? host : `${host}:${String(parts.port)}`;
14070
- const search = new URLSearchParams();
14071
- for (const [key, value] of Object.entries(query)) search.append(key, value);
14072
- const suffix = search.size > 0 ? `?${search.toString()}` : "";
14073
- const url = `${parts.scheme}://${authority}${parts.path}${suffix}`;
14074
- if (CREDENTIAL_URL.test(url)) return {
14075
- ok: false,
14076
- reason: "userinfo-in-result"
14077
- };
14078
- return {
14079
- ok: true,
14080
- url
14081
- };
14082
- }
14083
- function parseAdminBase(baseUrl) {
14084
- const raw = baseUrl.trim();
14085
- if (raw.length === 0) return {
14086
- ok: false,
14087
- reason: "empty"
14088
- };
14089
- let parsed;
14090
- try {
14091
- parsed = new URL(raw);
14092
- } catch {
14093
- return {
14094
- ok: false,
14095
- reason: "unparseable"
14096
- };
14097
- }
14098
- if (parsed.username !== "" || parsed.password !== "") return {
14099
- ok: false,
14100
- reason: "base-carries-userinfo"
14101
- };
14102
- if (parsed.protocol !== "http:" && parsed.protocol !== "https:") return {
14103
- ok: false,
14104
- reason: "scheme-not-http"
14105
- };
14106
- const scheme = parsed.protocol === "https:" ? "https" : "http";
14107
- const port = parsed.port === "" ? null : Number(parsed.port);
14108
- const basePath = parsed.pathname === "/" ? "" : parsed.pathname.replace(/\/+$/, "");
14109
- return {
14110
- ok: true,
14111
- host: parsed.hostname,
14112
- port,
14113
- scheme,
14114
- basePath
14115
- };
14116
- }
14117
- /**
14118
14055
  * `device-export` — collection cap for addons that export camstack
14119
14056
  * devices to external ecosystems (HomeAssistant via MQTT discovery,
14120
14057
  * HomeKit/HAP, Alexa Smart Home, …).
@@ -24448,6 +24385,87 @@ method(_void(), ProviderInfoSchema, { auth: "admin" }), method(object({ config:
24448
24385
  kind: "mutation",
24449
24386
  auth: "admin"
24450
24387
  });
24388
+ /**
24389
+ * The signals a device can emit to WAKE its own stream.
24390
+ *
24391
+ * A camera whose stream is built on demand sleeps until something asks for it,
24392
+ * and "something" cannot be a consumer that is merely attached — a Frigate-style
24393
+ * puller holds a session open for ever, and treating that as demand would keep
24394
+ * a battery camera awake for ever, which is the whole thing the battery is for
24395
+ * (D173). So the wake has to come from the CAMERA: an event it noticed by
24396
+ * itself, with no stream running.
24397
+ *
24398
+ * ## The vocabulary is the PROVIDER'S, not ours
24399
+ *
24400
+ * Like `consumables`, this cap declares no vocabulary of its own. A provider
24401
+ * names each signal with a `code` it chooses and a `label` an operator reads.
24402
+ * Reolink offers motion and camera-native detection; another provider may offer
24403
+ * a tamper, a doorbell press, a PIR, or something no camera in this fleet has
24404
+ * yet. A fixed enum here would mean every new signal is a framework release.
24405
+ *
24406
+ * It is deliberately NOT derived from the caps a device already binds. Whether
24407
+ * a camera CAN push firmware motion is expressed by `motionSources` containing
24408
+ * `'onboard'`, and whether it does AI on-camera by the `native-object-detection`
24409
+ * binding — but both answer "what drives the detection pipeline", which is a
24410
+ * different question from "what may wake a sleeping stream". A camera can do
24411
+ * the first and not be trusted with the second, and the operator picks per
24412
+ * camera. Two questions, two authorities.
24413
+ *
24414
+ * ## Availability is not permission
24415
+ *
24416
+ * `listSignals` says what the device CAN emit. Whether a given signal actually
24417
+ * wakes the stream is the operator's per-camera choice, held by the broker
24418
+ * alongside the cooldown — see the stream-broker cap's wake settings. A
24419
+ * provider declaring a signal is not a provider enabling it.
24420
+ */
24421
+ /** One signal a device can emit. */
24422
+ var StreamSignalSchema = object({
24423
+ /** Stable id chosen by the provider, e.g. `'motion'`, `'person'`, `'tamper'`. */
24424
+ code: string().min(1),
24425
+ /** What an operator reads in the picker. The provider's own wording. */
24426
+ label: string().min(1),
24427
+ /**
24428
+ * Whether the provider recommends this signal ON when a camera is first set
24429
+ * up. A provider knows which of its signals are cheap and reliable; an
24430
+ * operator should not have to discover that by trial. Reolink recommends
24431
+ * both of its own.
24432
+ */
24433
+ recommended: boolean()
24434
+ });
24435
+ var StreamSignalsStatusSchema = object({
24436
+ signals: array(StreamSignalSchema),
24437
+ lastFetchedAt: number()
24438
+ });
24439
+ var streamSignalsCapability = {
24440
+ name: "stream-signals",
24441
+ scope: "device",
24442
+ deviceNative: true,
24443
+ mode: "singleton",
24444
+ deviceTypes: Object.values(DeviceType),
24445
+ runtimeState: StreamSignalsStatusSchema,
24446
+ /**
24447
+ * Runtime-state durability: **session** — mirrored in RAM, never written.
24448
+ *
24449
+ * The slice holds what the DEVICE says it can emit. That is a probed fact,
24450
+ * not an operator choice: the provider re-declares it on every registration,
24451
+ * so losing it loses nothing and persisting it would freeze an answer the
24452
+ * camera is entitled to change. Measured the same day on the sibling case —
24453
+ * `native-object-detection.supportedClasses` was persisted, and a firmware
24454
+ * class the camera really detected stayed missing for the life of the row
24455
+ * because the fix could not reach it.
24456
+ *
24457
+ * See `RuntimeStateDurability`. Enforced by
24458
+ * `scripts/check-runtime-state-durability.ts`.
24459
+ */
24460
+ durability: "session",
24461
+ methods: {
24462
+ /**
24463
+ * What this device can emit. Empty is a valid and common answer — most
24464
+ * cameras have nothing to offer here, and an empty list is what makes the
24465
+ * broker's picker show nothing rather than a false choice.
24466
+ */
24467
+ listSignals: method(_void(), array(StreamSignalSchema).readonly()) }
24468
+ };
24451
24469
  /** Profile-exported FormBuilder schema. Shape is ConfigUISchema at the UI. */
24452
24470
  var ProfileSettingsSchemaBridge = unknown().nullable();
24453
24471
  var ProfileSettingsBagSchema = record(string(), unknown());
@@ -25020,6 +25038,7 @@ _enum([
25020
25038
  "sleeping",
25021
25039
  "camera-refused",
25022
25040
  "no-keyframe",
25041
+ "decode-failed",
25023
25042
  "no-catalog-row",
25024
25043
  "unsupported",
25025
25044
  "unknown-device",
@@ -25294,6 +25313,32 @@ var ClipBytesSchema = object({
25294
25313
  durationMs: number().positive().optional()
25295
25314
  });
25296
25315
  /**
25316
+ * Where a clip's finished bytes can be TAKEN (D613) — the answer to
25317
+ * {@link videoclipsCapability.methods.offerClipBytes}.
25318
+ *
25319
+ * Everything {@link ClipBytesSchema} carries except the bytes themselves, plus
25320
+ * the one-shot ticket that leads to them. The metadata is answered BEFORE the
25321
+ * transfer on purpose: a consumer learns which twin it got, what to call the
25322
+ * file and how long the clip runs without having to read a byte, so a decision
25323
+ * it would make on that metadata (a wrong twin, an implausible duration) costs
25324
+ * no transfer at all.
25325
+ */
25326
+ var ClipBytesOfferSchema = object({
25327
+ /**
25328
+ * One shot, seconds-long, loopback, on the PROVIDER's own host. Open it with
25329
+ * `ctx.peerBytes.open(...)`, which refuses a ticket from another node by
25330
+ * name rather than dialling a port that means something else here.
25331
+ */
25332
+ ticket: PeerBytesTicketSchema,
25333
+ contentType: string(),
25334
+ /** Suggested filename, extension included. */
25335
+ name: string(),
25336
+ /** Which twin was actually served — see {@link ClipBytesSchema.served}. */
25337
+ served: CamProfileSchema,
25338
+ /** See {@link ClipBytesSchema.durationMs}. Absent when nothing measured it. */
25339
+ durationMs: number().positive().optional()
25340
+ });
25341
+ /**
25297
25342
  * Where a clip's STREAM can be dialled (D597) — the answer to
25298
25343
  * {@link videoclipsCapability.methods.dialClipStream}.
25299
25344
  *
@@ -25369,6 +25414,44 @@ var ClipStreamDialSchema = object({
25369
25414
  /** Why `servedAudio` is `none` although sound was asked for. */
25370
25415
  audioReason: ClipStreamAudioReasonSchema.optional()
25371
25416
  });
25417
+ /**
25418
+ * What a surface may DRAW for this provider's clips — the answer to
25419
+ * {@link videoclipsCapability.methods.getPlaybackOptions} (D612).
25420
+ *
25421
+ * The envelope is a PROVIDER fact, not a clip fact, and that is measured, not
25422
+ * assumed: the broker's `chooseClipPath` reads exactly two inputs — whether
25423
+ * `dialClipStream` and `readClipBytes` are wired — and both are constants of
25424
+ * the broker's own closure over the provider's methods. The `profile` it is
25425
+ * handed is explicitly not read. So every clip of a provider is served the
25426
+ * same way, and a per-clip channel carried a value that could not vary. The
25427
+ * per-clip `clipTransport` server message was removed for exactly that reason.
25428
+ *
25429
+ * Queried per camera, before a clip is picked, so a control is rendered or
25430
+ * DISABLED rather than offered and refused at play time (D62: a disabled
25431
+ * control reads as unavailable, one that undoes the gesture reads as broken).
25432
+ */
25433
+ var ClipPlaybackOptionsSchema = object({
25434
+ /**
25435
+ * How this provider's clips reach the player. `stream` is the provider's
25436
+ * forward-only fMP4 (D597); `file` is one bounded by-handle fetch of the
25437
+ * whole clip, `stbl` indexed (D575).
25438
+ */
25439
+ transport: _enum(["stream", "file"]),
25440
+ /** `forward` = only ahead of the playhead. `free` = anywhere. */
25441
+ seek: _enum(["forward", "free"]),
25442
+ /** Frame-step BACKWARD is meaningful. Forward always is. */
25443
+ stepBack: boolean(),
25444
+ /** Whether the scrub gesture is served, as opposed to refused by name. */
25445
+ scrub: boolean(),
25446
+ /**
25447
+ * The rates that can be delivered, ascending, always containing `1`. The
25448
+ * viewer draws its picker from this and from nothing else — a constant it
25449
+ * keeps instead is the second authority that produced the defect: `8` and
25450
+ * `16` were offered, the broker clamped them to `4`, and no line anywhere
25451
+ * said so. `0` is not a member: pause is the absence of a rate.
25452
+ */
25453
+ rates: array(number().positive()).min(1).readonly()
25454
+ });
25372
25455
  var ClipSourceAvailabilitySchema = object({
25373
25456
  state: _enum([
25374
25457
  "ok",
@@ -25528,6 +25611,29 @@ DeviceType.Camera, method(object({
25528
25611
  }), ClipBytesSchema, {
25529
25612
  kind: "query",
25530
25613
  auth: "protected"
25614
+ }), optionalMethod(object({
25615
+ deviceId: number(),
25616
+ clipId: string().min(1),
25617
+ /** WHICH provider holds the bytes — see `readClipBytes.provider`. */
25618
+ provider: string().min(1),
25619
+ /** Which twin — `low | mid` → the sub file, `high` → the main twin. */
25620
+ profile: CamProfileSchema.optional(),
25621
+ /**
25622
+ * The CALLER's byte bound, so an over-size clip is refused before the
25623
+ * camera is touched rather than after. Capped by
25624
+ * {@link VIDEOCLIPS_MAX_OFFER_BYTES} whatever is passed; absent means
25625
+ * that ceiling.
25626
+ */
25627
+ maxBytes: number().int().positive().optional(),
25628
+ /**
25629
+ * The operator's authorisation to wake a sleeping camera for this
25630
+ * read. Absent — the default — means a sleeping standalone battery
25631
+ * camera is REFUSED by name, before any session is opened.
25632
+ */
25633
+ wake: ClipWakeSchema.optional()
25634
+ }), ClipBytesOfferSchema, {
25635
+ kind: "query",
25636
+ auth: "protected"
25531
25637
  }), optionalMethod(object({
25532
25638
  deviceId: number(),
25533
25639
  clipId: string().min(1),
@@ -25549,6 +25655,15 @@ DeviceType.Camera, method(object({
25549
25655
  }), ClipStreamDialSchema, {
25550
25656
  kind: "query",
25551
25657
  auth: "protected"
25658
+ }), optionalMethod(object({
25659
+ deviceId: number(),
25660
+ /** WHICH provider to ask — the `addonId` a {@link ClipSourceSchema}
25661
+ * row carries. Required for the same reason `listClips` requires it:
25662
+ * a collection cap has no "the bound one" to resolve to (D554). */
25663
+ provider: string().min(1)
25664
+ }), ClipPlaybackOptionsSchema, {
25665
+ kind: "query",
25666
+ auth: "protected"
25552
25667
  });
25553
25668
  /**
25554
25669
  * Optional client-side hints sent at session creation to help the provider
@@ -26998,6 +27113,143 @@ DeviceType.Camera, method(object({ deviceId: number() }), CameraCredentialsSchem
26998
27113
  auth: "admin"
26999
27114
  });
27000
27115
  /**
27116
+ * camera-grid-layout — the geometry of a COMPOSITE camera, on the camera's own
27117
+ * page.
27118
+ *
27119
+ * ## Why this is a capability and not an addon settings schema
27120
+ *
27121
+ * It was one, and it did not render. The addon declared the editor as a
27122
+ * `type: 'widget'` field inside its own `deviceSettingsSchema()`; the hub
27123
+ * returned that section correctly and `ConfigFormField` renders `type:'widget'`
27124
+ * perfectly well — and nothing ever asked camera-grid for it. The Cluster →
27125
+ * Pipeline → Device Overrides page interrogates a HAND-WRITTEN list of four
27126
+ * addons (`PIPELINE_CLUSTER_DEVICE_ADDONS`), whose own comment says an addon
27127
+ * not on it "falls off silently".
27128
+ *
27129
+ * Adding a fifth name to that list would have been the wrong fix twice over:
27130
+ * that page is per-camera DETECTION tuning, and a grid's geometry belongs
27131
+ * beside PTZ and motion zones on the camera itself. The device page is
27132
+ * BINDING-driven (D12), so the way in is a capability bound to the device —
27133
+ * and this cap carries its section the way `recording` does, by RETURNING it
27134
+ * from `getDeviceSettingsContribution`.
27135
+ *
27136
+ * Seven other widgets are still declared the other way, through a
27137
+ * `deviceConfig.ui` block the framework derives a section from. That route
27138
+ * gives the addon no say in where its own panel lands and no way to decline
27139
+ * for a device the panel does not suit, which is why this one does not use it.
27140
+ *
27141
+ * ## Why one addon may implement it
27142
+ *
27143
+ * It is a device-scoped NATIVE cap, registered by the grid camera device
27144
+ * itself. Nothing else declares a composite camera, so nothing else has a
27145
+ * layout — and the device-scoped route means the widget asks THE camera, not
27146
+ * "the camera-grid addon", which is what let the old custom-action pair be
27147
+ * reached only by a caller that already knew the addon id.
27148
+ *
27149
+ * ## The tab
27150
+ *
27151
+ * `streaming`, not a top-tab of its own. A grid's geometry IS what its stream
27152
+ * is, so the Streaming tab is where it belongs; a `grid` top-tab would need an
27153
+ * entry in `WELL_KNOWN_TAB_MAP` or the device page renders the raw id as the
27154
+ * label (measured on the robot camera, 2026-09-06 — a tab called "navigation"
27155
+ * next to "PTZ").
27156
+ */
27157
+ /** A rectangle in normalized [0,1] coordinates of whatever contains it. */
27158
+ var GridNormalizedRectSchema = object({
27159
+ x: number().min(0).max(1),
27160
+ y: number().min(0).max(1),
27161
+ width: number().gt(0).max(1),
27162
+ height: number().gt(0).max(1)
27163
+ });
27164
+ /**
27165
+ * One source camera, the part of its picture taken, and where that part lands.
27166
+ *
27167
+ * Both rectangles are NORMALIZED (D519): a source camera can change resolution
27168
+ * — a profile switch, a firmware update, a substream that comes back different
27169
+ * — and a stored PIXEL rectangle would quietly start cutting the wrong region,
27170
+ * which is the class of bug nobody files.
27171
+ */
27172
+ var GridLayoutCellSchema = object({
27173
+ deviceId: number().int().positive(),
27174
+ /** The part of the SOURCE taken, normalized against the source. */
27175
+ source: GridNormalizedRectSchema,
27176
+ /** Where it lands, normalized against the CANVAS. */
27177
+ cell: GridNormalizedRectSchema
27178
+ });
27179
+ /**
27180
+ * Which profiles this grid can actually compose, and why not.
27181
+ *
27182
+ * A grid's `high` composes its sources' `high` and its `low` their `low`, so a
27183
+ * profile is on offer only when EVERY source can serve it. The refusal NAMES
27184
+ * the sources, because "this grid has no low" is not a finding — "615 has no
27185
+ * low" is, and it is the one an operator can act on.
27186
+ */
27187
+ var GridProfileOfferSchema = object({
27188
+ profile: _enum([
27189
+ "high",
27190
+ "mid",
27191
+ "low"
27192
+ ]),
27193
+ offered: boolean(),
27194
+ /** Sources that cannot serve it. Empty when it is offered, or when there are no cells. */
27195
+ missingSources: array(number().int().positive()),
27196
+ /**
27197
+ * The canvas this profile composes onto, `WxH`, or empty when it is not
27198
+ * offered. DERIVED from the cells and the sources' own size at this profile —
27199
+ * it is reported because nothing else in the system would ever say what the
27200
+ * grid came out as, and because it is the number an operator would otherwise
27201
+ * expect to type.
27202
+ */
27203
+ canvas: string(),
27204
+ /**
27205
+ * Whether this profile is PUBLISHED, of the ones the grid could serve.
27206
+ *
27207
+ * A grid's `high` is composed of its sources' `high`, so on a 4K fleet it is
27208
+ * a 4K canvas built from 4K decodes — something to opt into, not something a
27209
+ * viewer's adaptive should be handed by climbing to the top rung it can see.
27210
+ * Default is `mid` + `low`.
27211
+ */
27212
+ published: boolean()
27213
+ });
27214
+ var GridLayoutViewSchema = object({
27215
+ /** The persisted grid row this camera was declared from. */
27216
+ instanceId: string(),
27217
+ deviceId: number().int().nonnegative(),
27218
+ name: string(),
27219
+ /**
27220
+ * NO canvas size. A grid's resolution is not authored: each profile derives
27221
+ * its own from the cells and its sources' dimensions. The two numbers that
27222
+ * used to be here were a text field that silently decided both how much the
27223
+ * composite cost and how sharp it was — see `profiles[].canvas` for what it
27224
+ * came out as.
27225
+ */
27226
+ fps: number().int(),
27227
+ cells: array(GridLayoutCellSchema),
27228
+ /** What the catalog will publish, and what it refuses to. Read-only. */
27229
+ profiles: array(GridProfileOfferSchema)
27230
+ });
27231
+ var GridLayoutPatchSchema = object({
27232
+ deviceId: number().int().nonnegative(),
27233
+ name: string().min(1).max(160).optional(),
27234
+ fps: number().int().min(1).max(60).optional(),
27235
+ /** Which profiles to publish. See `GridProfileOffer.published`. */
27236
+ publishedProfiles: array(_enum([
27237
+ "high",
27238
+ "mid",
27239
+ "low"
27240
+ ])).max(3).optional(),
27241
+ /**
27242
+ * The whole cell list at once. A per-cell patch would need an ordering the
27243
+ * editor does not have, and a half-applied layout is a picture nobody asked
27244
+ * for.
27245
+ */
27246
+ cells: array(GridLayoutCellSchema).max(16)
27247
+ });
27248
+ DeviceType.Camera, method(object({ deviceId: number().int().nonnegative() }), GridLayoutViewSchema.nullable(), { auth: "admin" }), method(GridLayoutPatchSchema, GridLayoutViewSchema, {
27249
+ kind: "mutation",
27250
+ auth: "admin"
27251
+ });
27252
+ /**
27001
27253
  * Carbon-monoxide alarm sensor. Drives Home Assistant `binary_sensor`
27002
27254
  * entries with `device_class: carbon_monoxide`. Push-driven.
27003
27255
  */
@@ -27800,346 +28052,6 @@ var dayNightCapability = {
27800
28052
  volatileStateFields: ["lastFetchedAt"]
27801
28053
  };
27802
28054
  /**
27803
- * Vendor-neutral **onboard** recording + storage cap — what the CAMERA
27804
- * writes to the CAMERA's own card, on the camera's own schedule.
27805
- *
27806
- * This is NOT `recording.cap.ts`. That one is CamStack's recorder: our
27807
- * footage ledger, our storage locations, our retention. This one has a
27808
- * different authority — the camera's firmware — and per D62 it stores
27809
- * nothing of its own. Every value here is read from the camera and every
27810
- * write goes back to the camera; there is no CamStack-side mirror that
27811
- * could disagree with the device.
27812
- *
27813
- * ## One shape, two firmwares
27814
- *
27815
- * Measured 2026-09-22 against the live fleet:
27816
- *
27817
- * | fact | Hikvision (ISAPI) | Reolink (Baichuan) |
27818
- * | --- | --- | --- |
27819
- * | storage | `ContentMgmt/Storage` `<hdd>` rows: status, capacity, freeSpace (MB) | `getHddInfoList` (cmd 102): `mount`, `format`, `capacity` GB + `capacityM` MB remainder |
27820
- * | tracks | several (101 **and** 103 on both 1436 and 3833), each with its own schedule | one per channel |
27821
- * | schedule | per track, 7 `ScheduleAction` blocks: DayOfWeek + TimeOfDay range + ONE `ActionRecordingMode` | per trigger type, a 168-char weekly HOUR mask |
27822
- * | triggers | `CMR`, `MOTION` | `Normal`, `MD`, `people`, `vehicle`, `dog_cat`, `crossline`, `intrude`, `loitering` |
27823
- * | pre-record | `PreRecordTimeSeconds` | `preRecordTime` |
27824
- * | post-record | `PostRecordTimeSeconds` | `recordDelayTime` |
27825
- * | overwrite | per track `LoopEnable` | `cycle`, with `cycleList` enumerating the accepted values |
27826
- * | segment length | not exposed on V5.7.1 | `packageTime` (minutes) |
27827
- *
27828
- * The two schedule models look different and are the same thing in
27829
- * different coordinates: both answer "for this trigger, during which
27830
- * weekly windows does the camera record". {@link RecordWindow} is that
27831
- * question in one shape — Hikvision's ranges map straight onto it,
27832
- * Reolink's mask expands into hour-aligned windows.
27833
- *
27834
- * ## Union, not intersection
27835
- *
27836
- * **The same fields exist on every camera.** What differs per device is
27837
- * which VALUES that device accepts, and that is what {@link
27838
- * RecordingOnboardOptions} reports — a `{ readable, writable, reason }`
27839
- * per field plus the schedule's own limits. A control a camera cannot
27840
- * honour is rendered DISABLED WITH ITS REASON, never missing and never
27841
- * dead: disabled must not look like broken.
27842
- *
27843
- * ## Refusal by name
27844
- *
27845
- * A write a camera cannot honour is refused with a sentence the operator
27846
- * can read — never accepted and dropped. Both providers refuse through
27847
- * {@link describeOnboardRefusal}, so the vocabulary is one function and
27848
- * one test, not two hand-written vendor opinions.
27849
- *
27850
- * Follows the D14 `deviceConfig` archetype (see `stream-params.cap.ts`):
27851
- * `getOptions` advertises per-camera availability, `getStatus` (auto-
27852
- * injected from `status`) reports the live values, and a single
27853
- * `setSettings` mutation applies a partial change. No hand-written
27854
- * settings-contribution methods.
27855
- */
27856
- /**
27857
- * What makes the camera start recording during a window.
27858
- *
27859
- * The union of both vendors' vocabularies. `continuous` is Hikvision's
27860
- * `CMR` and Reolink's `Normal`; `motion` is `MOTION` / `MD`. The
27861
- * object-class triggers are Reolink-only today and the smart-event ones
27862
- * (`lineCrossing`, `intrusion`, `loitering`) are Reolink-only on the
27863
- * firmwares measured — a camera that cannot record on a trigger simply
27864
- * does not list it in `options.schedule.triggers`, and a window naming
27865
- * it is REFUSED, not dropped.
27866
- */
27867
- var RecordTriggerSchema = _enum([
27868
- "continuous",
27869
- "motion",
27870
- "person",
27871
- "vehicle",
27872
- "animal",
27873
- "lineCrossing",
27874
- "intrusion",
27875
- "loitering",
27876
- "alarmInput"
27877
- ]);
27878
- /**
27879
- * One weekly recording window: "on `day`, from `startMinute` to
27880
- * `endMinute`, record on `trigger`".
27881
- *
27882
- * `day` is 0 = Monday … 6 = Sunday (ISO order, which is also the order
27883
- * both firmwares enumerate). Minutes are local camera time since
27884
- * midnight; `endMinute` may be 1440, meaning end of day — that is
27885
- * Hikvision's literal `24:00` and Reolink's 24th mask slot, and
27886
- * collapsing it to 0 would turn a whole-day window into an empty one.
27887
- */
27888
- var RecordWindowSchema = object({
27889
- trigger: RecordTriggerSchema,
27890
- day: number().int().min(0).max(6),
27891
- startMinute: number().int().min(0).max(1439),
27892
- endMinute: number().int().min(1).max(1440)
27893
- });
27894
- /** Status of one physical volume, as the camera itself describes it. */
27895
- var OnboardStorageVolumeSchema = object({
27896
- /** The camera's own id for the volume (`hdd/id`, Reolink `HddInfo/number`). */
27897
- id: string(),
27898
- /** The camera's own name for it, when it gives one (`hddName`). */
27899
- label: string().optional(),
27900
- status: _enum([
27901
- "ok",
27902
- "unformatted",
27903
- "error",
27904
- "offline",
27905
- "unknown"
27906
- ]),
27907
- /**
27908
- * Total size in MB, or **null when the camera did not say**.
27909
- *
27910
- * Never 0 for an unreadable value: a measurement that failed is not a
27911
- * measurement (D393), and a card whose size is unknown must not be
27912
- * rendered as a card of size zero.
27913
- */
27914
- capacityMb: number().nullable(),
27915
- /**
27916
- * Free space in MB, or null when unknown.
27917
- *
27918
- * **Not a proxy for "has footage".** Measured 2026-09-22: 1436 and
27919
- * 1439 both report exactly 11776 MB free — the fixed reserve a looping
27920
- * card converges on once it has wrapped. At loop steady state the
27921
- * number is identical whether the camera recorded yesterday or stopped
27922
- * a month ago.
27923
- */
27924
- freeMb: number().nullable(),
27925
- /** True when the camera reports the volume writable (`property` RW). */
27926
- writable: boolean().optional()
27927
- });
27928
- /**
27929
- * What the camera is doing with its own storage, right now.
27930
- *
27931
- * Every scalar is nullable and **null means the camera did not answer**,
27932
- * never a default. A form that seeds `0` from an unanswered read invites
27933
- * the operator to save that 0 back onto the camera.
27934
- */
27935
- var RecordingOnboardStatusSchema = object({
27936
- storage: discriminatedUnion("kind", [
27937
- object({
27938
- kind: literal("present"),
27939
- volumes: array(OnboardStorageVolumeSchema)
27940
- }),
27941
- object({
27942
- kind: literal("absent"),
27943
- reason: string()
27944
- }),
27945
- object({
27946
- kind: literal("unknown"),
27947
- reason: string()
27948
- })
27949
- ]),
27950
- tracks: array(object({
27951
- id: string(),
27952
- enabled: boolean(),
27953
- isVideo: boolean(),
27954
- /** From the camera's own track description. Null when it does not say. */
27955
- codec: string().nullable(),
27956
- resolution: string().nullable(),
27957
- /** Per-track overwrite flag, where the firmware keeps it per track. */
27958
- overwriteWhenFull: boolean().nullable()
27959
- })),
27960
- /**
27961
- * The track the write path targets — the enabled VIDEO one. Null when
27962
- * no track could be identified, which is itself a refusal reason.
27963
- */
27964
- primaryTrackId: string().nullable(),
27965
- /** Master "record to the card at all" switch. */
27966
- enabled: boolean().nullable(),
27967
- overwriteWhenFull: boolean().nullable(),
27968
- preRecordSec: number().nullable(),
27969
- postRecordSec: number().nullable(),
27970
- /** Length of one recorded file, in minutes. */
27971
- segmentMinutes: number().nullable(),
27972
- /** The primary track's weekly windows, flattened. */
27973
- windows: array(RecordWindowSchema),
27974
- /**
27975
- * How many windows the camera described that CamStack could NOT read —
27976
- * an unrecognised trigger, an unparseable clock, a weekday it does not
27977
- * name.
27978
- *
27979
- * A dropped window is work the reader threw away, and a schedule that
27980
- * silently shows fewer rows than the camera holds is how an operator
27981
- * saves back a schedule shorter than the one they were looking at
27982
- * (D391). Non-zero means the window list is INCOMPLETE and a write
27983
- * that replaces it would delete what was not shown — which is why a
27984
- * provider reporting a non-zero count also reports the schedule as not
27985
- * writable.
27986
- */
27987
- unreadableWindows: number(),
27988
- /**
27989
- * The camera is scheduled to record and has NO usable storage.
27990
- *
27991
- * A first-class fact because it is the fleet's most common silent
27992
- * defect: measured 2026-09-22, 1441 and 3831 are both motion-recording
27993
- * to a card that is not there. Neither the schedule nor the storage
27994
- * read says anything wrong on its own; only the pair does.
27995
- */
27996
- recordingToNowhere: boolean(),
27997
- lastFetchedAt: number()
27998
- });
27999
- /** Numeric range descriptor — `{ min, max, step }` per the getOptions convention. */
28000
- var RangeSchema = object({
28001
- min: number(),
28002
- max: number(),
28003
- step: number()
28004
- });
28005
- /**
28006
- * The values a camera actually takes for a numeric field, when they are a SET
28007
- * rather than a range.
28008
- *
28009
- * `{min,max,step}` cannot say what these two firmwares do. Measured on 1436
28010
- * (I91DN) on 2026-09-22 by writing each value and reading it back:
28011
- *
28012
- * - pre-record: `0, 5, 10, 15, 20, 25, 30` and `2147483647` (INT32_MAX, the
28013
- * camera's "no limit" — `-1` and `4294967295` both land on it);
28014
- * - post-record: `5, 10, 30, 60, 120, 300, 600`.
28015
- *
28016
- * Neither is expressible as a step: the first has a sentinel two billion away
28017
- * from its neighbours, the second doubles and then jumps. A range that tried
28018
- * would forbid values the camera takes AND permit values it silently replaces
28019
- * with 5 — wrong in both directions at once.
28020
- *
28021
- * `sentinel` names the member that is not a duration, so a surface can render
28022
- * "no limit" instead of `2147483647` seconds.
28023
- */
28024
- var AllowedValuesSchema = object({
28025
- values: array(number()).min(1),
28026
- sentinel: object({
28027
- value: number(),
28028
- meaning: _enum(["no-limit", "disabled"])
28029
- }).optional()
28030
- });
28031
- /**
28032
- * Per-field availability on ONE camera.
28033
- *
28034
- * The field exists on every camera — this says whether this one can be
28035
- * read and whether it can be written, and `reason` says why not when
28036
- * either is false. The UI renders the control DISABLED with the reason
28037
- * rather than hiding it, so a limitation is legible instead of looking
28038
- * like a missing feature.
28039
- */
28040
- var OnboardFieldSupportSchema = object({
28041
- readable: boolean(),
28042
- writable: boolean(),
28043
- /** Required whenever `readable` or `writable` is false. */
28044
- reason: string().optional()
28045
- });
28046
- /** What this camera's schedule model can express. */
28047
- var OnboardScheduleSupportSchema = object({
28048
- support: OnboardFieldSupportSchema,
28049
- /**
28050
- * The smallest time step the camera can express, in minutes.
28051
- *
28052
- * Hikvision takes arbitrary minutes (`00:05:00`–`23:57:00` observed on
28053
- * 1436's track 103). Reolink's schedule is a 7×24 HOUR mask, so 60. A
28054
- * window whose edges are not a multiple of this is REFUSED rather than
28055
- * quietly rounded — rounding is how an operator's 06:30 becomes 06:00
28056
- * and nothing says so.
28057
- */
28058
- granularityMinutes: number(),
28059
- /** Triggers this camera can record on. A window naming another is refused. */
28060
- triggers: array(RecordTriggerSchema),
28061
- /**
28062
- * False when the camera stores ONE trigger per time range, so two
28063
- * windows overlapping on the same day cannot carry different triggers.
28064
- * True on Reolink, whose mask is per-trigger and independent.
28065
- */
28066
- supportsOverlappingTriggers: boolean()
28067
- });
28068
- var RecordingOnboardOptionsSchema = object({
28069
- enabled: OnboardFieldSupportSchema,
28070
- overwriteWhenFull: OnboardFieldSupportSchema,
28071
- preRecordSec: OnboardFieldSupportSchema,
28072
- preRecordSecRange: RangeSchema.optional(),
28073
- /** Preferred over the range when the camera takes a SET, not a span. */
28074
- preRecordSecAllowed: AllowedValuesSchema.optional(),
28075
- postRecordSec: OnboardFieldSupportSchema,
28076
- postRecordSecRange: RangeSchema.optional(),
28077
- /** Preferred over the range when the camera takes a SET, not a span. */
28078
- postRecordSecAllowed: AllowedValuesSchema.optional(),
28079
- segmentMinutes: OnboardFieldSupportSchema,
28080
- segmentMinutesRange: RangeSchema.optional(),
28081
- /** Preferred over the range when the camera takes a SET, not a span. */
28082
- segmentMinutesAllowed: AllowedValuesSchema.optional(),
28083
- schedule: OnboardScheduleSupportSchema
28084
- });
28085
- /**
28086
- * A partial change. Every field optional.
28087
- *
28088
- * Unlike the other `deviceConfig` caps, a provider here does **NOT**
28089
- * silently ignore a field it cannot support — it refuses, by name,
28090
- * through {@link describeOnboardRefusal}. Silence on a recording setting
28091
- * is the failure D62 exists to prevent: the operator believes the camera
28092
- * is recording the way the form says, and it is not.
28093
- */
28094
- var RecordingOnboardPatchSchema = object({
28095
- enabled: boolean().optional(),
28096
- overwriteWhenFull: boolean().optional(),
28097
- preRecordSec: number().optional(),
28098
- postRecordSec: number().optional(),
28099
- segmentMinutes: number().optional(),
28100
- /** The complete new window set for the primary track — not a delta. */
28101
- windows: array(RecordWindowSchema).optional()
28102
- });
28103
- var recordingOnboardCapability = {
28104
- name: "recording-onboard",
28105
- scope: "device",
28106
- deviceNative: true,
28107
- mode: "singleton",
28108
- deviceTypes: [DeviceType.Camera],
28109
- deviceConfig: { ui: {
28110
- kind: "derived-form",
28111
- builderId: "recording-onboard",
28112
- tab: "recording"
28113
- } },
28114
- methods: {
28115
- getOptions: method(object({ deviceId: number() }), RecordingOnboardOptionsSchema),
28116
- setSettings: method(object({
28117
- deviceId: number(),
28118
- settings: RecordingOnboardPatchSchema
28119
- }), _void(), {
28120
- kind: "mutation",
28121
- auth: "admin"
28122
- })
28123
- },
28124
- status: {
28125
- schema: RecordingOnboardStatusSchema,
28126
- kind: "poll"
28127
- },
28128
- runtimeState: RecordingOnboardStatusSchema,
28129
- /**
28130
- * Runtime-state durability: **restored** — operator-set camera-side
28131
- * recording config; mutation-driven, and the storage half is the last
28132
- * thing the camera said about its own card.
28133
- *
28134
- * See `RuntimeStateDurability`. Enforced by
28135
- * `scripts/check-runtime-state-durability.ts`.
28136
- */
28137
- durability: "restored",
28138
- /** Clock fields: written, but excluded from the compare that decides
28139
- * whether persisting is worth a SQLite commit. */
28140
- volatileStateFields: ["lastFetchedAt"]
28141
- };
28142
- /**
28143
28055
  * Generic device-level status snapshot. Auto-registered by `BaseDevice`
28144
28056
  * for every device, regardless of provider — the kernel needs a uniform
28145
28057
  * cap-keyed slice for the basic device flags every consumer expects to
@@ -28358,30 +28270,6 @@ var eventEmitterCapability = {
28358
28270
  */
28359
28271
  durability: "session"
28360
28272
  };
28361
- var EventItemSchema = object({
28362
- id: string(),
28363
- type: string(),
28364
- timestamp: number(),
28365
- label: string().optional(),
28366
- thumbnailUrl: string().optional(),
28367
- clipUrl: string().optional(),
28368
- metadata: record(string(), unknown()).optional()
28369
- });
28370
- DeviceType.Camera, method(object({
28371
- deviceId: number(),
28372
- from: number().optional(),
28373
- to: number().optional(),
28374
- limit: number().optional()
28375
- }), array(EventItemSchema)), method(object({
28376
- deviceId: number(),
28377
- eventId: string()
28378
- }), object({
28379
- base64: string(),
28380
- contentType: string()
28381
- }).nullable()), method(object({
28382
- deviceId: number(),
28383
- eventId: string()
28384
- }), string().nullable());
28385
28273
  var IdentitySchema = object({
28386
28274
  id: string(),
28387
28275
  name: string(),
@@ -30634,143 +30522,6 @@ var motionTriggerCapability = {
30634
30522
  durability: "session"
30635
30523
  };
30636
30524
  /**
30637
- * camera-grid-layout — the geometry of a COMPOSITE camera, on the camera's own
30638
- * page.
30639
- *
30640
- * ## Why this is a capability and not an addon settings schema
30641
- *
30642
- * It was one, and it did not render. The addon declared the editor as a
30643
- * `type: 'widget'` field inside its own `deviceSettingsSchema()`; the hub
30644
- * returned that section correctly and `ConfigFormField` renders `type:'widget'`
30645
- * perfectly well — and nothing ever asked camera-grid for it. The Cluster →
30646
- * Pipeline → Device Overrides page interrogates a HAND-WRITTEN list of four
30647
- * addons (`PIPELINE_CLUSTER_DEVICE_ADDONS`), whose own comment says an addon
30648
- * not on it "falls off silently".
30649
- *
30650
- * Adding a fifth name to that list would have been the wrong fix twice over:
30651
- * that page is per-camera DETECTION tuning, and a grid's geometry belongs
30652
- * beside PTZ and motion zones on the camera itself. The device page is
30653
- * BINDING-driven (D12), so the way in is a capability bound to the device —
30654
- * and this cap carries its section the way `recording` does, by RETURNING it
30655
- * from `getDeviceSettingsContribution`.
30656
- *
30657
- * Seven other widgets are still declared the other way, through a
30658
- * `deviceConfig.ui` block the framework derives a section from. That route
30659
- * gives the addon no say in where its own panel lands and no way to decline
30660
- * for a device the panel does not suit, which is why this one does not use it.
30661
- *
30662
- * ## Why one addon may implement it
30663
- *
30664
- * It is a device-scoped NATIVE cap, registered by the grid camera device
30665
- * itself. Nothing else declares a composite camera, so nothing else has a
30666
- * layout — and the device-scoped route means the widget asks THE camera, not
30667
- * "the camera-grid addon", which is what let the old custom-action pair be
30668
- * reached only by a caller that already knew the addon id.
30669
- *
30670
- * ## The tab
30671
- *
30672
- * `streaming`, not a top-tab of its own. A grid's geometry IS what its stream
30673
- * is, so the Streaming tab is where it belongs; a `grid` top-tab would need an
30674
- * entry in `WELL_KNOWN_TAB_MAP` or the device page renders the raw id as the
30675
- * label (measured on the robot camera, 2026-09-06 — a tab called "navigation"
30676
- * next to "PTZ").
30677
- */
30678
- /** A rectangle in normalized [0,1] coordinates of whatever contains it. */
30679
- var GridNormalizedRectSchema = object({
30680
- x: number().min(0).max(1),
30681
- y: number().min(0).max(1),
30682
- width: number().gt(0).max(1),
30683
- height: number().gt(0).max(1)
30684
- });
30685
- /**
30686
- * One source camera, the part of its picture taken, and where that part lands.
30687
- *
30688
- * Both rectangles are NORMALIZED (D519): a source camera can change resolution
30689
- * — a profile switch, a firmware update, a substream that comes back different
30690
- * — and a stored PIXEL rectangle would quietly start cutting the wrong region,
30691
- * which is the class of bug nobody files.
30692
- */
30693
- var GridLayoutCellSchema = object({
30694
- deviceId: number().int().positive(),
30695
- /** The part of the SOURCE taken, normalized against the source. */
30696
- source: GridNormalizedRectSchema,
30697
- /** Where it lands, normalized against the CANVAS. */
30698
- cell: GridNormalizedRectSchema
30699
- });
30700
- /**
30701
- * Which profiles this grid can actually compose, and why not.
30702
- *
30703
- * A grid's `high` composes its sources' `high` and its `low` their `low`, so a
30704
- * profile is on offer only when EVERY source can serve it. The refusal NAMES
30705
- * the sources, because "this grid has no low" is not a finding — "615 has no
30706
- * low" is, and it is the one an operator can act on.
30707
- */
30708
- var GridProfileOfferSchema = object({
30709
- profile: _enum([
30710
- "high",
30711
- "mid",
30712
- "low"
30713
- ]),
30714
- offered: boolean(),
30715
- /** Sources that cannot serve it. Empty when it is offered, or when there are no cells. */
30716
- missingSources: array(number().int().positive()),
30717
- /**
30718
- * The canvas this profile composes onto, `WxH`, or empty when it is not
30719
- * offered. DERIVED from the cells and the sources' own size at this profile —
30720
- * it is reported because nothing else in the system would ever say what the
30721
- * grid came out as, and because it is the number an operator would otherwise
30722
- * expect to type.
30723
- */
30724
- canvas: string(),
30725
- /**
30726
- * Whether this profile is PUBLISHED, of the ones the grid could serve.
30727
- *
30728
- * A grid's `high` is composed of its sources' `high`, so on a 4K fleet it is
30729
- * a 4K canvas built from 4K decodes — something to opt into, not something a
30730
- * viewer's adaptive should be handed by climbing to the top rung it can see.
30731
- * Default is `mid` + `low`.
30732
- */
30733
- published: boolean()
30734
- });
30735
- var GridLayoutViewSchema = object({
30736
- /** The persisted grid row this camera was declared from. */
30737
- instanceId: string(),
30738
- deviceId: number().int().nonnegative(),
30739
- name: string(),
30740
- /**
30741
- * NO canvas size. A grid's resolution is not authored: each profile derives
30742
- * its own from the cells and its sources' dimensions. The two numbers that
30743
- * used to be here were a text field that silently decided both how much the
30744
- * composite cost and how sharp it was — see `profiles[].canvas` for what it
30745
- * came out as.
30746
- */
30747
- fps: number().int(),
30748
- cells: array(GridLayoutCellSchema),
30749
- /** What the catalog will publish, and what it refuses to. Read-only. */
30750
- profiles: array(GridProfileOfferSchema)
30751
- });
30752
- var GridLayoutPatchSchema = object({
30753
- deviceId: number().int().nonnegative(),
30754
- name: string().min(1).max(160).optional(),
30755
- fps: number().int().min(1).max(60).optional(),
30756
- /** Which profiles to publish. See `GridProfileOffer.published`. */
30757
- publishedProfiles: array(_enum([
30758
- "high",
30759
- "mid",
30760
- "low"
30761
- ])).max(3).optional(),
30762
- /**
30763
- * The whole cell list at once. A per-cell patch would need an ordering the
30764
- * editor does not have, and a half-applied layout is a picture nobody asked
30765
- * for.
30766
- */
30767
- cells: array(GridLayoutCellSchema).max(16)
30768
- });
30769
- DeviceType.Camera, method(object({ deviceId: number().int().nonnegative() }), GridLayoutViewSchema.nullable(), { auth: "admin" }), method(GridLayoutPatchSchema, GridLayoutViewSchema, {
30770
- kind: "mutation",
30771
- auth: "admin"
30772
- });
30773
- /**
30774
30525
  * Motion-zones share the same MaskShape vocabulary as privacy-mask — the
30775
30526
  * on-camera motion-detection mask is a single `grid` region (a row-major
30776
30527
  * boolean cell lattice the camera's onboard VMD evaluates). Composing it as
@@ -33133,37 +32884,37 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceI
33133
32884
  kind: "mutation",
33134
32885
  auth: "admin"
33135
32886
  });
33136
- /**
33137
- * `recording` cap — footage availability + HLS playback manifests + per-device
33138
- * recording config. NOTE on events (source of truth, R5/C3): this cap carries
33139
- * NO event surface — `getPlaybackManifest` returns playlist URLs only. Timeline
33140
- * events (motion/object/audio) come from `pipelineAnalytics` (durable SQLite
33141
- * rows) and are the ONLY event surface — the recorder has none. The in-RAM
33142
- * playback markers it used to build were deleted on 2026-08-29 because nothing
33143
- * ever read them. Event<->footage joins are by time, padded with the shared
33144
- * `EVENT_PAD_MS` (`interfaces/recording-config.ts`).
33145
- */
33146
- var RecordingStatusSchema = object({
33147
- deviceId: number(),
33148
- enabled: boolean(),
33149
- /** THE derived storage mode, from the one definition
33150
- * (`deriveRecordingMode`) — never a second enum. A duplicated list is how
33151
- * `on-device-decision` could have reached the recorder and not the status. */
33152
- activeMode: RecordingStorageModeSchema,
33153
- nodeId: string(),
33154
- storageBytes: number()
33155
- });
33156
32887
  var RecordingRangeSchema = object({
33157
32888
  profile: string(),
33158
32889
  startMs: number(),
33159
32890
  endMs: number()
33160
32891
  });
32892
+ /**
32893
+ * How a source ANSWERED, on every singular read of this cap.
32894
+ *
32895
+ * `'read'` — it looked. `ranges: []` / `days: []` is then a real claim: this
32896
+ * source has no coverage in the window. `'unreadable'` — nobody could look
32897
+ * (the camera was unreachable, the calendar rung threw, the location is
32898
+ * unmounted, the node is still on the old build), and the emptiness beside it
32899
+ * means NOTHING.
32900
+ *
32901
+ * The batch rows have carried this since the grid existed; the SINGULAR
32902
+ * answers gained it with the collection (D625 §10.4), because they are the
32903
+ * ones the single-camera picker uses and because a half-converted fleet makes
32904
+ * "nobody looked" common for the length of a deploy. Without it the timeline
32905
+ * has no vocabulary for it, and `(data ?? [])` in a viewer turns a rollout into
32906
+ * a fleet of cameras that appear to have lost their recordings (D315, D393).
32907
+ */
32908
+ var RecordingReadSchema = _enum(["read", "unreadable"]);
33161
32909
  var RecordingAvailabilitySchema = object({
33162
32910
  deviceId: number(),
32911
+ /** See {@link RecordingReadSchema}. An `'unreadable'` answer carries an empty
32912
+ * `ranges` that means nothing — never draw it as "no footage". */
32913
+ read: RecordingReadSchema,
33163
32914
  ranges: array(RecordingRangeSchema),
33164
32915
  /**
33165
- * Every profile this camera has footage in — not only the one `ranges`
33166
- * describes (D433).
32916
+ * Every profile this camera has footage in AT THIS SOURCE — not only the one
32917
+ * `ranges` describes (D433).
33167
32918
  *
33168
32919
  * `ranges` answers for ONE profile by design: the timeline is a single bar,
33169
32920
  * and enumerating all of them triples the directory reads for a bar that
@@ -33180,15 +32931,285 @@ var RecordingAvailabilitySchema = object({
33180
32931
  });
33181
32932
  var RecordingDaysSchema = object({
33182
32933
  deviceId: number(),
32934
+ /** See {@link RecordingReadSchema}. `days: []` on an `'unreadable'` answer is
32935
+ * "nobody could look", and the date-picker must not spell it the same as
32936
+ * "no footage this month". */
32937
+ read: RecordingReadSchema,
33183
32938
  /** Local-midnight epochs (UTC ms) of days that have ≥1 recorded segment. */
33184
32939
  days: array(number())
33185
32940
  });
32941
+ var RecordingManifestSchema = object({
32942
+ deviceId: number(),
32943
+ /** Local filesystem path to the master playlist; null when no recording exists for the requested range. */
32944
+ localMasterPath: string().nullable(),
32945
+ /** HTTP(S) URL to the master playlist on the recording node's playback server
32946
+ * (the PRIMARY candidate); null when no recording / server. Carries the
32947
+ * scoped playback token in its path. */
32948
+ playbackUrl: string().nullable(),
32949
+ /**
32950
+ * Candidate master-playlist URLs the client tries in order (LAN first, then
32951
+ * remote — Tailscale/Cloudflare if the operator configured extra hosts), each
32952
+ * carrying the same scoped token. `playbackUrl` is the first entry. Empty when
32953
+ * there is no recording / server.
32954
+ */
32955
+ playbackEndpoints: array(string())
32956
+ });
32957
+ var RecordingSourceAvailabilitySchema = object({
32958
+ state: _enum([
32959
+ "ok",
32960
+ "sleeping",
32961
+ "unreachable",
32962
+ "no-storage",
32963
+ "index-empty"
32964
+ ]),
32965
+ /** Free text, shown verbatim. Names the camera's own refusal when there is one. */
32966
+ reason: string().optional(),
32967
+ /** When this source's coverage was last CONFIRMED. A cached answer is never
32968
+ * drawn as current: the surface shows the age whenever it is older than the
32969
+ * refresh interval. The clip catalog's `catalogAsOf`, under the name the
32970
+ * timeline uses for it. */
32971
+ coverageAsOf: number().optional()
32972
+ });
32973
+ /**
32974
+ * One SOURCE of recorded coverage for a camera — a row of the picker.
32975
+ *
32976
+ * A provider lists the sources IT serves for that device, and answers for each
32977
+ * of them whether it can answer at all. A provider with nothing to offer on a
32978
+ * camera returns `[]` — it is not that camera's business. The five availability
32979
+ * states are `ClipSourceAvailability`'s verbatim: they mean exactly the same
32980
+ * things about a coverage index as about a clip catalog, and `sleeping` in
32981
+ * particular is what stops a battery camera being woken to paint a bar.
32982
+ */
32983
+ var RecordingSourceSchema = object({
32984
+ /** The source id. {@link RECORDING_SOURCE_CAMSTACK} for ours (RESERVED), a
32985
+ * vendor namespace (`native:reolink:onboard`, …) for a camera's own store. */
32986
+ source: string(),
32987
+ /** Operator-facing name of the source ("CamStack recordings", "SD card"). */
32988
+ label: string(),
32989
+ /**
32990
+ * The addon that SERVES this row, and the value a later call passes as
32991
+ * `provider`.
32992
+ *
32993
+ * Optional for version skew only. The collection dispatcher stamps it from
32994
+ * the registry, so a row that travelled through the fan-out carries the
32995
+ * authoritative id whatever the provider filled in (D557 §4).
32996
+ */
32997
+ addonId: string().optional(),
32998
+ availability: RecordingSourceAvailabilitySchema
32999
+ });
33000
+ /**
33001
+ * What a surface may DRAW for this (camera, source) — D612's rule applied to a
33002
+ * timeline: **the source declares what it can do, and the surface draws what
33003
+ * was declared. It never assumes, and never offers a gesture it will then
33004
+ * refuse.** D612 exists because `8` and `16` were offered as clip rates, the
33005
+ * broker clamped them to `4`, and no line anywhere said so.
33006
+ *
33007
+ * Asked once per (camera, source) before anything is drawn — never replaced by
33008
+ * a constant the surface keeps, which is the second authority D612 ends.
33009
+ */
33010
+ var RecordingSourceOptionsSchema = object({
33011
+ /** How this source's media reaches the player.
33012
+ * `archive` = our own indexed segment tree; `stream` = the provider's
33013
+ * forward-only fMP4 (D597); `realtime` = a replay bound to wall clock. */
33014
+ transport: _enum([
33015
+ "archive",
33016
+ "stream",
33017
+ "realtime"
33018
+ ]),
33019
+ /** What the BAR means. `continuous` = gaps are holes in a recording;
33020
+ * `sparse` = gaps are the absence of one, and must be drawn as such.
33021
+ *
33022
+ * Not an onboard-only concession: measured 2026-09-24, OUR bar covers 98.8 %
33023
+ * of 592's day and 1.2 % of 1436's. It is a fact about a (source, camera)
33024
+ * pair, and ours answers it per camera from `deriveRecordingMode`. */
33025
+ coverage: _enum(["continuous", "sparse"]),
33026
+ /** Where the playhead may be put.
33027
+ * `free` — anywhere, to the frame.
33028
+ * `forward` — only ahead of the current position.
33029
+ * `segment` — a position SNAPS to the head of the covering segment; a finer
33030
+ * ask is accepted by the camera and SILENTLY IGNORED. Measured
33031
+ * on 1436 (Hikvision V5.7.1, 2026-09-23): a window-narrowed
33032
+ * `ContentMgmt/search` returns a row and a `playbackURI`, the
33033
+ * replay opens 200 and delivers media — and the burned-in OSD of
33034
+ * the first frame reads the SEGMENT HEAD every time. Calling
33035
+ * that `forward` would tell the surface it may move the playhead
33036
+ * ahead within a loaded segment, which it may not. */
33037
+ seek: _enum([
33038
+ "free",
33039
+ "forward",
33040
+ "segment"
33041
+ ]),
33042
+ /** Frame-step BACKWARD is meaningful. */
33043
+ stepBack: boolean(),
33044
+ /** Whether the drag-scrub gesture is served, as opposed to refused by name. */
33045
+ scrub: boolean(),
33046
+ /** Deliverable rates, ascending, always containing `1`. The surface draws its
33047
+ * picker from this and from NOTHING else (D612, D620, D621). `0` is not a
33048
+ * member: pause is the absence of a rate. */
33049
+ rates: array(number().positive()).min(1).readonly(),
33050
+ /** TRUE when a read of this source HOLDS the camera's only playback session.
33051
+ * A surface with this set makes at most ONE read at a time and draws no
33052
+ * scrub-thumbnail strip, no hover preview, no prefetch and no background
33053
+ * refresh. The precedent is exact and expensive: filling one screen of
33054
+ * Hikvision thumbnails at 1.01× realtime consumed fifteen minutes of that
33055
+ * camera's only playback session (1.2.126, reported within minutes), and a
33056
+ * timeline is a screenful of reads by construction. */
33057
+ exclusive: boolean()
33058
+ });
33059
+ /**
33060
+ * How to PLAY the instant that was asked for, from the chosen source.
33061
+ *
33062
+ * No new media transport is built for onboard sources: the `clip` arm is a
33063
+ * DELEGATION to the `videoclips` transport that vendor already has (D597 /
33064
+ * D616 / D617). The onboard half of this collection is a PROJECTION of
33065
+ * `videoclips` for coverage and a delegation to it for bytes.
33066
+ */
33067
+ var RecordingPlaybackSchema = discriminatedUnion("kind", [
33068
+ object({
33069
+ kind: literal("hls"),
33070
+ manifest: RecordingManifestSchema
33071
+ }),
33072
+ object({
33073
+ kind: literal("clip"),
33074
+ /** The `videoclips` source namespace this clip id belongs to. */
33075
+ source: string(),
33076
+ clipId: string(),
33077
+ /** Where this clip actually STARTS. On a `seek: 'segment'` source the
33078
+ * playhead lands here, not at the requested instant — the surface must be
33079
+ * TOLD, not left to discover it from a burned-in OSD. */
33080
+ startsAtMs: number()
33081
+ }),
33082
+ object({
33083
+ kind: literal("none"),
33084
+ reason: string()
33085
+ })
33086
+ ]);
33087
+ DeviceType.Camera, method(object({ deviceId: number() }), array(RecordingSourceSchema).readonly(), {
33088
+ kind: "query",
33089
+ auth: "protected"
33090
+ }), method(object({
33091
+ deviceId: number(),
33092
+ /**
33093
+ * WHICH provider to ask — the `addonId` a {@link RecordingSourceSchema}
33094
+ * row carries, never a source id and never a list. **REQUIRED**, in the
33095
+ * schema, where the generated types make it unomittable rather than
33096
+ * merely discouraged (D554 amended).
33097
+ *
33098
+ * It was learned the expensive way on `videoclips.listClips`: measured
33099
+ * on the live hub 2026-09-20, device 592 bound to `recorder` AND
33100
+ * `provider-reolink`, a bare call with `limit: 3` answered SIX rows,
33101
+ * three from each source, merged — `device-collection-dispatch.ts`
33102
+ * leaves an unpinned fan-out un-narrowed, so absence buys the union the
33103
+ * method exists not to be. An un-narrowed `getAvailability` would do
33104
+ * that to a TIMELINE: our ranges and the card's clips unioned into one
33105
+ * bar, which is "two sources are never drawn together" broken in the
33106
+ * one place it matters most.
33107
+ *
33108
+ * A provider the device is not bound to is refused BY NAME (D552's
33109
+ * `rejectUnresolvedAddonPin`), never answered by another one.
33110
+ */
33111
+ provider: string().min(1),
33112
+ fromMs: number(),
33113
+ toMs: number(),
33114
+ /**
33115
+ * Answer for THIS profile instead of the source's preferred one (D433).
33116
+ * Absent keeps the timeline's behaviour — one bar, one profile, one set
33117
+ * of reads. `profilesWithFootage` on the answer says what may be asked
33118
+ * for.
33119
+ */
33120
+ profile: string().optional()
33121
+ }), RecordingAvailabilitySchema, {
33122
+ kind: "query",
33123
+ auth: "protected"
33124
+ }), method(object({
33125
+ deviceId: number(),
33126
+ provider: string().min(1),
33127
+ fromMs: number(),
33128
+ toMs: number(),
33129
+ tzOffsetMinutes: number()
33130
+ }), RecordingDaysSchema, {
33131
+ kind: "query",
33132
+ auth: "protected"
33133
+ }), method(object({
33134
+ deviceId: number(),
33135
+ provider: string().min(1),
33136
+ fromMs: number(),
33137
+ toMs: number(),
33138
+ profile: CamProfileSchema.optional()
33139
+ }), RecordingPlaybackSchema, {
33140
+ kind: "query",
33141
+ auth: "protected"
33142
+ }), method(object({
33143
+ deviceId: number(),
33144
+ provider: string().min(1)
33145
+ }), RecordingSourceOptionsSchema, {
33146
+ kind: "query",
33147
+ auth: "protected"
33148
+ });
33149
+ /**
33150
+ * `recording-archive` — OUR archive, and the intent that fills it.
33151
+ *
33152
+ * The system-singleton half of the 2026-09-24 cut (D625). `recording` used to
33153
+ * be one 33-method system singleton holding two unrelated subjects: three
33154
+ * per-camera READS about coverage and playback, and everything else — storage
33155
+ * locations, retention, relocation, rebalance, the ops log, the placement
33156
+ * table and the byte-plane primitives our scrub and export are built on.
33157
+ *
33158
+ * The reads became a device-scoped COLLECTION, so a camera's own card can be a
33159
+ * source beside ours (`recording.cap.ts`). Everything that is about OUR store,
33160
+ * or unimplementable by a camera, stayed here.
33161
+ *
33162
+ * ## On the name
33163
+ *
33164
+ * `recording-storage` was the obvious choice and is wrong: this cap also holds
33165
+ * `getDeviceConfig`/`setDeviceConfig`, which are recording INTENT — bands,
33166
+ * retention, the D62 switch authority — and a name that says "storage" invites
33167
+ * the next reader to move them out again. An archive is a thing we keep, and
33168
+ * what we keep it under is a policy; the name covers both halves honestly and
33169
+ * sits in the existing family (`recording-onboard`, `recording-export`,
33170
+ * `recording-signal`).
33171
+ *
33172
+ * ## What must NOT happen to it
33173
+ *
33174
+ * It stays a SINGLETON. It is registered by `recorder`, which is
33175
+ * `placement: 'any-node'` and runs on every recording node; the hub dispatches
33176
+ * to one of them. Putting the ledger, the placement table or the relocation
33177
+ * jobs behind a fan-out is the one genuinely dangerous move in this cut.
33178
+ *
33179
+ * `getDeviceConfig` / `setDeviceConfig` in particular are the D62 recording
33180
+ * authority (`CameraSwitch.authority`). If a write reached a different provider
33181
+ * than the read — which a collection fan-out permits — two authorities would
33182
+ * decide when one camera records, and the symptom (recording silently off, or
33183
+ * a `bands` array clobbered by a partial write) is durable and silent. Keeping
33184
+ * them here means the worst case during a rollout is a 412: the switch refuses
33185
+ * to flip and SAYS so. **Do not move them into the collection, at any point,
33186
+ * for any reason.**
33187
+ *
33188
+ * ## The two batch reads
33189
+ *
33190
+ * `getAvailabilityBatch` / `getDaysWithRecordingsBatch` take `deviceIds:
33191
+ * number[]` with no single `deviceId`, and a device-scoped mount routes
33192
+ * through `getProviderForDevice(deviceId)` — there is nothing for it to route
33193
+ * on. They stay here, and on this cap the batch is explicitly OURS: a grid has
33194
+ * no per-camera picker, and a caller that wants another source's coverage asks
33195
+ * `recording.getAvailability` per device with that source's `provider`.
33196
+ */
33197
+ var RecordingStatusSchema = object({
33198
+ deviceId: number(),
33199
+ enabled: boolean(),
33200
+ /** THE derived storage mode, from the one definition
33201
+ * (`deriveRecordingMode`) — never a second enum. A duplicated list is how
33202
+ * `on-device-decision` could have reached the recorder and not the status. */
33203
+ activeMode: RecordingStorageModeSchema,
33204
+ nodeId: string(),
33205
+ storageBytes: number()
33206
+ });
33186
33207
  /**
33187
33208
  * One camera's row in a `getAvailabilityBatch` answer.
33188
33209
  *
33189
- * `ranges` is EXACTLY what `getAvailability` returns for that camera — the
33190
- * batch collapses the transport, not the work — plus the one thing the singular
33191
- * method never had to say:
33210
+ * `ranges` is EXACTLY what `recording.getAvailability` returns for that camera
33211
+ * at OUR source — the batch collapses the transport, not the work — plus the
33212
+ * `read` mark the singular answer now carries too (D625):
33192
33213
  *
33193
33214
  * - `read: 'read'` — answered. `ranges: []` means "read, and this camera has
33194
33215
  * no footage in the window", which is a real claim.
@@ -33220,22 +33241,6 @@ var RecordingDaysForDeviceSchema = object({
33220
33241
  /** Local-midnight epochs (UTC ms) of days that have ≥1 recorded segment. */
33221
33242
  days: array(number()).readonly()
33222
33243
  });
33223
- var RecordingManifestSchema = object({
33224
- deviceId: number(),
33225
- /** Local filesystem path to the master playlist; null when no recording exists for the requested range. */
33226
- localMasterPath: string().nullable(),
33227
- /** HTTP(S) URL to the master playlist on the recording node's playback server
33228
- * (the PRIMARY candidate); null when no recording / server. Carries the
33229
- * scoped playback token in its path. */
33230
- playbackUrl: string().nullable(),
33231
- /**
33232
- * Candidate master-playlist URLs the client tries in order (LAN first, then
33233
- * remote — Tailscale/Cloudflare if the operator configured extra hosts), each
33234
- * carrying the same scoped token. `playbackUrl` is the first entry. Empty when
33235
- * there is no recording / server.
33236
- */
33237
- playbackEndpoints: array(string())
33238
- });
33239
33244
  /**
33240
33245
  * Recording storage usage for one camera — what the ARCHIVE holds for it,
33241
33246
  * across every profile and every resolvable location on this node.
@@ -33494,34 +33499,12 @@ var ReadWindowBytesResultSchema = discriminatedUnion("kind", [object({
33494
33499
  segmentEndMs: number()
33495
33500
  })]);
33496
33501
  method(object({
33497
- deviceId: number(),
33498
- fromMs: number(),
33499
- toMs: number(),
33500
- /**
33501
- * Answer for THIS profile instead of the preferred one (D433). Absent
33502
- * keeps the timeline's behaviour — one bar, one profile, one set of
33503
- * reads. `profilesWithFootage` on the answer says what may be asked
33504
- * for.
33505
- */
33506
- profile: string().optional()
33507
- }), RecordingAvailabilitySchema, {
33508
- kind: "query",
33509
- auth: "protected"
33510
- }), method(object({
33511
33502
  deviceIds: array(number()).min(1).max(200),
33512
33503
  fromMs: number(),
33513
33504
  toMs: number()
33514
33505
  }), array(RecordingAvailabilityForDeviceSchema).readonly(), {
33515
33506
  kind: "query",
33516
33507
  auth: "protected"
33517
- }), method(object({
33518
- deviceId: number(),
33519
- fromMs: number(),
33520
- toMs: number(),
33521
- tzOffsetMinutes: number()
33522
- }), RecordingDaysSchema, {
33523
- kind: "query",
33524
- auth: "protected"
33525
33508
  }), method(object({
33526
33509
  deviceIds: array(number()).min(1).max(200),
33527
33510
  fromMs: number(),
@@ -33530,13 +33513,6 @@ method(object({
33530
33513
  }), array(RecordingDaysForDeviceSchema).readonly(), {
33531
33514
  kind: "query",
33532
33515
  auth: "protected"
33533
- }), method(object({
33534
- deviceId: number(),
33535
- fromMs: number(),
33536
- toMs: number()
33537
- }), RecordingManifestSchema, {
33538
- kind: "query",
33539
- auth: "protected"
33540
33516
  }), method(object({}), RecordingStorageUsageSchema, {
33541
33517
  kind: "query",
33542
33518
  auth: "admin"
@@ -33984,6 +33960,346 @@ method(object({
33984
33960
  auth: "protected"
33985
33961
  });
33986
33962
  /**
33963
+ * Vendor-neutral **onboard** recording + storage cap — what the CAMERA
33964
+ * writes to the CAMERA's own card, on the camera's own schedule.
33965
+ *
33966
+ * This is NOT `recording.cap.ts`. That one is CamStack's recorder: our
33967
+ * footage ledger, our storage locations, our retention. This one has a
33968
+ * different authority — the camera's firmware — and per D62 it stores
33969
+ * nothing of its own. Every value here is read from the camera and every
33970
+ * write goes back to the camera; there is no CamStack-side mirror that
33971
+ * could disagree with the device.
33972
+ *
33973
+ * ## One shape, two firmwares
33974
+ *
33975
+ * Measured 2026-09-22 against the live fleet:
33976
+ *
33977
+ * | fact | Hikvision (ISAPI) | Reolink (Baichuan) |
33978
+ * | --- | --- | --- |
33979
+ * | storage | `ContentMgmt/Storage` `<hdd>` rows: status, capacity, freeSpace (MB) | `getHddInfoList` (cmd 102): `mount`, `format`, `capacity` GB + `capacityM` MB remainder |
33980
+ * | tracks | several (101 **and** 103 on both 1436 and 3833), each with its own schedule | one per channel |
33981
+ * | schedule | per track, 7 `ScheduleAction` blocks: DayOfWeek + TimeOfDay range + ONE `ActionRecordingMode` | per trigger type, a 168-char weekly HOUR mask |
33982
+ * | triggers | `CMR`, `MOTION` | `Normal`, `MD`, `people`, `vehicle`, `dog_cat`, `crossline`, `intrude`, `loitering` |
33983
+ * | pre-record | `PreRecordTimeSeconds` | `preRecordTime` |
33984
+ * | post-record | `PostRecordTimeSeconds` | `recordDelayTime` |
33985
+ * | overwrite | per track `LoopEnable` | `cycle`, with `cycleList` enumerating the accepted values |
33986
+ * | segment length | not exposed on V5.7.1 | `packageTime` (minutes) |
33987
+ *
33988
+ * The two schedule models look different and are the same thing in
33989
+ * different coordinates: both answer "for this trigger, during which
33990
+ * weekly windows does the camera record". {@link RecordWindow} is that
33991
+ * question in one shape — Hikvision's ranges map straight onto it,
33992
+ * Reolink's mask expands into hour-aligned windows.
33993
+ *
33994
+ * ## Union, not intersection
33995
+ *
33996
+ * **The same fields exist on every camera.** What differs per device is
33997
+ * which VALUES that device accepts, and that is what {@link
33998
+ * RecordingOnboardOptions} reports — a `{ readable, writable, reason }`
33999
+ * per field plus the schedule's own limits. A control a camera cannot
34000
+ * honour is rendered DISABLED WITH ITS REASON, never missing and never
34001
+ * dead: disabled must not look like broken.
34002
+ *
34003
+ * ## Refusal by name
34004
+ *
34005
+ * A write a camera cannot honour is refused with a sentence the operator
34006
+ * can read — never accepted and dropped. Both providers refuse through
34007
+ * {@link describeOnboardRefusal}, so the vocabulary is one function and
34008
+ * one test, not two hand-written vendor opinions.
34009
+ *
34010
+ * Follows the D14 `deviceConfig` archetype (see `stream-params.cap.ts`):
34011
+ * `getOptions` advertises per-camera availability, `getStatus` (auto-
34012
+ * injected from `status`) reports the live values, and a single
34013
+ * `setSettings` mutation applies a partial change. No hand-written
34014
+ * settings-contribution methods.
34015
+ */
34016
+ /**
34017
+ * What makes the camera start recording during a window.
34018
+ *
34019
+ * The union of both vendors' vocabularies. `continuous` is Hikvision's
34020
+ * `CMR` and Reolink's `Normal`; `motion` is `MOTION` / `MD`. The
34021
+ * object-class triggers are Reolink-only today and the smart-event ones
34022
+ * (`lineCrossing`, `intrusion`, `loitering`) are Reolink-only on the
34023
+ * firmwares measured — a camera that cannot record on a trigger simply
34024
+ * does not list it in `options.schedule.triggers`, and a window naming
34025
+ * it is REFUSED, not dropped.
34026
+ */
34027
+ var RecordTriggerSchema = _enum([
34028
+ "continuous",
34029
+ "motion",
34030
+ "person",
34031
+ "vehicle",
34032
+ "animal",
34033
+ "lineCrossing",
34034
+ "intrusion",
34035
+ "loitering",
34036
+ "alarmInput"
34037
+ ]);
34038
+ /**
34039
+ * One weekly recording window: "on `day`, from `startMinute` to
34040
+ * `endMinute`, record on `trigger`".
34041
+ *
34042
+ * `day` is 0 = Monday … 6 = Sunday (ISO order, which is also the order
34043
+ * both firmwares enumerate). Minutes are local camera time since
34044
+ * midnight; `endMinute` may be 1440, meaning end of day — that is
34045
+ * Hikvision's literal `24:00` and Reolink's 24th mask slot, and
34046
+ * collapsing it to 0 would turn a whole-day window into an empty one.
34047
+ */
34048
+ var RecordWindowSchema = object({
34049
+ trigger: RecordTriggerSchema,
34050
+ day: number().int().min(0).max(6),
34051
+ startMinute: number().int().min(0).max(1439),
34052
+ endMinute: number().int().min(1).max(1440)
34053
+ });
34054
+ /** Status of one physical volume, as the camera itself describes it. */
34055
+ var OnboardStorageVolumeSchema = object({
34056
+ /** The camera's own id for the volume (`hdd/id`, Reolink `HddInfo/number`). */
34057
+ id: string(),
34058
+ /** The camera's own name for it, when it gives one (`hddName`). */
34059
+ label: string().optional(),
34060
+ status: _enum([
34061
+ "ok",
34062
+ "unformatted",
34063
+ "error",
34064
+ "offline",
34065
+ "unknown"
34066
+ ]),
34067
+ /**
34068
+ * Total size in MB, or **null when the camera did not say**.
34069
+ *
34070
+ * Never 0 for an unreadable value: a measurement that failed is not a
34071
+ * measurement (D393), and a card whose size is unknown must not be
34072
+ * rendered as a card of size zero.
34073
+ */
34074
+ capacityMb: number().nullable(),
34075
+ /**
34076
+ * Free space in MB, or null when unknown.
34077
+ *
34078
+ * **Not a proxy for "has footage".** Measured 2026-09-22: 1436 and
34079
+ * 1439 both report exactly 11776 MB free — the fixed reserve a looping
34080
+ * card converges on once it has wrapped. At loop steady state the
34081
+ * number is identical whether the camera recorded yesterday or stopped
34082
+ * a month ago.
34083
+ */
34084
+ freeMb: number().nullable(),
34085
+ /** True when the camera reports the volume writable (`property` RW). */
34086
+ writable: boolean().optional()
34087
+ });
34088
+ /**
34089
+ * What the camera is doing with its own storage, right now.
34090
+ *
34091
+ * Every scalar is nullable and **null means the camera did not answer**,
34092
+ * never a default. A form that seeds `0` from an unanswered read invites
34093
+ * the operator to save that 0 back onto the camera.
34094
+ */
34095
+ var RecordingOnboardStatusSchema = object({
34096
+ storage: discriminatedUnion("kind", [
34097
+ object({
34098
+ kind: literal("present"),
34099
+ volumes: array(OnboardStorageVolumeSchema)
34100
+ }),
34101
+ object({
34102
+ kind: literal("absent"),
34103
+ reason: string()
34104
+ }),
34105
+ object({
34106
+ kind: literal("unknown"),
34107
+ reason: string()
34108
+ })
34109
+ ]),
34110
+ tracks: array(object({
34111
+ id: string(),
34112
+ enabled: boolean(),
34113
+ isVideo: boolean(),
34114
+ /** From the camera's own track description. Null when it does not say. */
34115
+ codec: string().nullable(),
34116
+ resolution: string().nullable(),
34117
+ /** Per-track overwrite flag, where the firmware keeps it per track. */
34118
+ overwriteWhenFull: boolean().nullable()
34119
+ })),
34120
+ /**
34121
+ * The track the write path targets — the enabled VIDEO one. Null when
34122
+ * no track could be identified, which is itself a refusal reason.
34123
+ */
34124
+ primaryTrackId: string().nullable(),
34125
+ /** Master "record to the card at all" switch. */
34126
+ enabled: boolean().nullable(),
34127
+ overwriteWhenFull: boolean().nullable(),
34128
+ preRecordSec: number().nullable(),
34129
+ postRecordSec: number().nullable(),
34130
+ /** Length of one recorded file, in minutes. */
34131
+ segmentMinutes: number().nullable(),
34132
+ /** The primary track's weekly windows, flattened. */
34133
+ windows: array(RecordWindowSchema),
34134
+ /**
34135
+ * How many windows the camera described that CamStack could NOT read —
34136
+ * an unrecognised trigger, an unparseable clock, a weekday it does not
34137
+ * name.
34138
+ *
34139
+ * A dropped window is work the reader threw away, and a schedule that
34140
+ * silently shows fewer rows than the camera holds is how an operator
34141
+ * saves back a schedule shorter than the one they were looking at
34142
+ * (D391). Non-zero means the window list is INCOMPLETE and a write
34143
+ * that replaces it would delete what was not shown — which is why a
34144
+ * provider reporting a non-zero count also reports the schedule as not
34145
+ * writable.
34146
+ */
34147
+ unreadableWindows: number(),
34148
+ /**
34149
+ * The camera is scheduled to record and has NO usable storage.
34150
+ *
34151
+ * A first-class fact because it is the fleet's most common silent
34152
+ * defect: measured 2026-09-22, 1441 and 3831 are both motion-recording
34153
+ * to a card that is not there. Neither the schedule nor the storage
34154
+ * read says anything wrong on its own; only the pair does.
34155
+ */
34156
+ recordingToNowhere: boolean(),
34157
+ lastFetchedAt: number()
34158
+ });
34159
+ /** Numeric range descriptor — `{ min, max, step }` per the getOptions convention. */
34160
+ var RangeSchema = object({
34161
+ min: number(),
34162
+ max: number(),
34163
+ step: number()
34164
+ });
34165
+ /**
34166
+ * The values a camera actually takes for a numeric field, when they are a SET
34167
+ * rather than a range.
34168
+ *
34169
+ * `{min,max,step}` cannot say what these two firmwares do. Measured on 1436
34170
+ * (I91DN) on 2026-09-22 by writing each value and reading it back:
34171
+ *
34172
+ * - pre-record: `0, 5, 10, 15, 20, 25, 30` and `2147483647` (INT32_MAX, the
34173
+ * camera's "no limit" — `-1` and `4294967295` both land on it);
34174
+ * - post-record: `5, 10, 30, 60, 120, 300, 600`.
34175
+ *
34176
+ * Neither is expressible as a step: the first has a sentinel two billion away
34177
+ * from its neighbours, the second doubles and then jumps. A range that tried
34178
+ * would forbid values the camera takes AND permit values it silently replaces
34179
+ * with 5 — wrong in both directions at once.
34180
+ *
34181
+ * `sentinel` names the member that is not a duration, so a surface can render
34182
+ * "no limit" instead of `2147483647` seconds.
34183
+ */
34184
+ var AllowedValuesSchema = object({
34185
+ values: array(number()).min(1),
34186
+ sentinel: object({
34187
+ value: number(),
34188
+ meaning: _enum(["no-limit", "disabled"])
34189
+ }).optional()
34190
+ });
34191
+ /**
34192
+ * Per-field availability on ONE camera.
34193
+ *
34194
+ * The field exists on every camera — this says whether this one can be
34195
+ * read and whether it can be written, and `reason` says why not when
34196
+ * either is false. The UI renders the control DISABLED with the reason
34197
+ * rather than hiding it, so a limitation is legible instead of looking
34198
+ * like a missing feature.
34199
+ */
34200
+ var OnboardFieldSupportSchema = object({
34201
+ readable: boolean(),
34202
+ writable: boolean(),
34203
+ /** Required whenever `readable` or `writable` is false. */
34204
+ reason: string().optional()
34205
+ });
34206
+ /** What this camera's schedule model can express. */
34207
+ var OnboardScheduleSupportSchema = object({
34208
+ support: OnboardFieldSupportSchema,
34209
+ /**
34210
+ * The smallest time step the camera can express, in minutes.
34211
+ *
34212
+ * Hikvision takes arbitrary minutes (`00:05:00`–`23:57:00` observed on
34213
+ * 1436's track 103). Reolink's schedule is a 7×24 HOUR mask, so 60. A
34214
+ * window whose edges are not a multiple of this is REFUSED rather than
34215
+ * quietly rounded — rounding is how an operator's 06:30 becomes 06:00
34216
+ * and nothing says so.
34217
+ */
34218
+ granularityMinutes: number(),
34219
+ /** Triggers this camera can record on. A window naming another is refused. */
34220
+ triggers: array(RecordTriggerSchema),
34221
+ /**
34222
+ * False when the camera stores ONE trigger per time range, so two
34223
+ * windows overlapping on the same day cannot carry different triggers.
34224
+ * True on Reolink, whose mask is per-trigger and independent.
34225
+ */
34226
+ supportsOverlappingTriggers: boolean()
34227
+ });
34228
+ var RecordingOnboardOptionsSchema = object({
34229
+ enabled: OnboardFieldSupportSchema,
34230
+ overwriteWhenFull: OnboardFieldSupportSchema,
34231
+ preRecordSec: OnboardFieldSupportSchema,
34232
+ preRecordSecRange: RangeSchema.optional(),
34233
+ /** Preferred over the range when the camera takes a SET, not a span. */
34234
+ preRecordSecAllowed: AllowedValuesSchema.optional(),
34235
+ postRecordSec: OnboardFieldSupportSchema,
34236
+ postRecordSecRange: RangeSchema.optional(),
34237
+ /** Preferred over the range when the camera takes a SET, not a span. */
34238
+ postRecordSecAllowed: AllowedValuesSchema.optional(),
34239
+ segmentMinutes: OnboardFieldSupportSchema,
34240
+ segmentMinutesRange: RangeSchema.optional(),
34241
+ /** Preferred over the range when the camera takes a SET, not a span. */
34242
+ segmentMinutesAllowed: AllowedValuesSchema.optional(),
34243
+ schedule: OnboardScheduleSupportSchema
34244
+ });
34245
+ /**
34246
+ * A partial change. Every field optional.
34247
+ *
34248
+ * Unlike the other `deviceConfig` caps, a provider here does **NOT**
34249
+ * silently ignore a field it cannot support — it refuses, by name,
34250
+ * through {@link describeOnboardRefusal}. Silence on a recording setting
34251
+ * is the failure D62 exists to prevent: the operator believes the camera
34252
+ * is recording the way the form says, and it is not.
34253
+ */
34254
+ var RecordingOnboardPatchSchema = object({
34255
+ enabled: boolean().optional(),
34256
+ overwriteWhenFull: boolean().optional(),
34257
+ preRecordSec: number().optional(),
34258
+ postRecordSec: number().optional(),
34259
+ segmentMinutes: number().optional(),
34260
+ /** The complete new window set for the primary track — not a delta. */
34261
+ windows: array(RecordWindowSchema).optional()
34262
+ });
34263
+ var recordingOnboardCapability = {
34264
+ name: "recording-onboard",
34265
+ scope: "device",
34266
+ deviceNative: true,
34267
+ mode: "singleton",
34268
+ deviceTypes: [DeviceType.Camera],
34269
+ deviceConfig: { ui: {
34270
+ kind: "derived-form",
34271
+ builderId: "recording-onboard",
34272
+ tab: "recording"
34273
+ } },
34274
+ methods: {
34275
+ getOptions: method(object({ deviceId: number() }), RecordingOnboardOptionsSchema),
34276
+ setSettings: method(object({
34277
+ deviceId: number(),
34278
+ settings: RecordingOnboardPatchSchema
34279
+ }), _void(), {
34280
+ kind: "mutation",
34281
+ auth: "admin"
34282
+ })
34283
+ },
34284
+ status: {
34285
+ schema: RecordingOnboardStatusSchema,
34286
+ kind: "poll"
34287
+ },
34288
+ runtimeState: RecordingOnboardStatusSchema,
34289
+ /**
34290
+ * Runtime-state durability: **restored** — operator-set camera-side
34291
+ * recording config; mutation-driven, and the storage half is the last
34292
+ * thing the camera said about its own card.
34293
+ *
34294
+ * See `RuntimeStateDurability`. Enforced by
34295
+ * `scripts/check-runtime-state-durability.ts`.
34296
+ */
34297
+ durability: "restored",
34298
+ /** Clock fields: written, but excluded from the compare that decides
34299
+ * whether persisting is worth a SQLite commit. */
34300
+ volatileStateFields: ["lastFetchedAt"]
34301
+ };
34302
+ /**
33987
34303
  * A camera's own "record me NOW" LEVEL — a signal the device raises while
33988
34304
  * something it knows about is happening (a robot vacuum cleaning, a machine
33989
34305
  * running, a gate open) and lowers when it stops.
@@ -41444,24 +41760,6 @@ Object.freeze({
41444
41760
  addonId: null,
41445
41761
  access: "view"
41446
41762
  },
41447
- "events.getEventClipUrl": {
41448
- capName: "events",
41449
- capScope: "device",
41450
- addonId: null,
41451
- access: "view"
41452
- },
41453
- "events.getEvents": {
41454
- capName: "events",
41455
- capScope: "device",
41456
- addonId: null,
41457
- access: "view"
41458
- },
41459
- "events.getEventThumbnail": {
41460
- capName: "events",
41461
- capScope: "device",
41462
- addonId: null,
41463
- access: "view"
41464
- },
41465
41763
  "faceGallery.assignFace": {
41466
41764
  capName: "face-gallery",
41467
41765
  capScope: "system",
@@ -44336,224 +44634,236 @@ Object.freeze({
44336
44634
  addonId: null,
44337
44635
  access: "create"
44338
44636
  },
44339
- "recording.applyDeviceSettingsPatch": {
44637
+ "recording.getAvailability": {
44340
44638
  capName: "recording",
44341
- capScope: "system",
44639
+ capScope: "device",
44342
44640
  addonId: null,
44343
- access: "create"
44641
+ access: "view"
44344
44642
  },
44345
- "recording.cancelRelocateJob": {
44643
+ "recording.getDaysWithRecordings": {
44346
44644
  capName: "recording",
44347
- capScope: "system",
44645
+ capScope: "device",
44348
44646
  addonId: null,
44349
- access: "create"
44647
+ access: "view"
44350
44648
  },
44351
- "recording.cancelStorageMigrationMove": {
44649
+ "recording.getPlayback": {
44352
44650
  capName: "recording",
44353
- capScope: "system",
44651
+ capScope: "device",
44354
44652
  addonId: null,
44355
- access: "create"
44653
+ access: "view"
44356
44654
  },
44357
- "recording.deleteFootprint": {
44655
+ "recording.getPlaybackOptions": {
44358
44656
  capName: "recording",
44359
- capScope: "system",
44657
+ capScope: "device",
44360
44658
  addonId: null,
44361
- access: "delete"
44659
+ access: "view"
44362
44660
  },
44363
- "recording.getAvailability": {
44661
+ "recording.listSources": {
44364
44662
  capName: "recording",
44365
- capScope: "system",
44663
+ capScope: "device",
44366
44664
  addonId: null,
44367
44665
  access: "view"
44368
44666
  },
44369
- "recording.getAvailabilityBatch": {
44370
- capName: "recording",
44667
+ "recordingArchive.applyDeviceSettingsPatch": {
44668
+ capName: "recording-archive",
44371
44669
  capScope: "system",
44372
44670
  addonId: null,
44373
- access: "view"
44671
+ access: "create"
44374
44672
  },
44375
- "recording.getDaysWithRecordings": {
44376
- capName: "recording",
44673
+ "recordingArchive.cancelRelocateJob": {
44674
+ capName: "recording-archive",
44377
44675
  capScope: "system",
44378
44676
  addonId: null,
44379
- access: "view"
44677
+ access: "create"
44380
44678
  },
44381
- "recording.getDaysWithRecordingsBatch": {
44382
- capName: "recording",
44679
+ "recordingArchive.cancelStorageMigrationMove": {
44680
+ capName: "recording-archive",
44681
+ capScope: "system",
44682
+ addonId: null,
44683
+ access: "create"
44684
+ },
44685
+ "recordingArchive.deleteFootprint": {
44686
+ capName: "recording-archive",
44687
+ capScope: "system",
44688
+ addonId: null,
44689
+ access: "delete"
44690
+ },
44691
+ "recordingArchive.getAvailabilityBatch": {
44692
+ capName: "recording-archive",
44383
44693
  capScope: "system",
44384
44694
  addonId: null,
44385
44695
  access: "view"
44386
44696
  },
44387
- "recording.getDeviceConfig": {
44388
- capName: "recording",
44697
+ "recordingArchive.getDaysWithRecordingsBatch": {
44698
+ capName: "recording-archive",
44389
44699
  capScope: "system",
44390
44700
  addonId: null,
44391
44701
  access: "view"
44392
44702
  },
44393
- "recording.getDeviceLiveContribution": {
44394
- capName: "recording",
44703
+ "recordingArchive.getDeviceConfig": {
44704
+ capName: "recording-archive",
44395
44705
  capScope: "system",
44396
44706
  addonId: null,
44397
44707
  access: "view"
44398
44708
  },
44399
- "recording.getDeviceSettingsContribution": {
44400
- capName: "recording",
44709
+ "recordingArchive.getDeviceLiveContribution": {
44710
+ capName: "recording-archive",
44401
44711
  capScope: "system",
44402
44712
  addonId: null,
44403
44713
  access: "view"
44404
44714
  },
44405
- "recording.getPlacement": {
44406
- capName: "recording",
44715
+ "recordingArchive.getDeviceSettingsContribution": {
44716
+ capName: "recording-archive",
44407
44717
  capScope: "system",
44408
44718
  addonId: null,
44409
44719
  access: "view"
44410
44720
  },
44411
- "recording.getPlaybackManifest": {
44412
- capName: "recording",
44721
+ "recordingArchive.getPlacement": {
44722
+ capName: "recording-archive",
44413
44723
  capScope: "system",
44414
44724
  addonId: null,
44415
44725
  access: "view"
44416
44726
  },
44417
- "recording.getRelocateResidue": {
44418
- capName: "recording",
44727
+ "recordingArchive.getRelocateResidue": {
44728
+ capName: "recording-archive",
44419
44729
  capScope: "system",
44420
44730
  addonId: null,
44421
44731
  access: "view"
44422
44732
  },
44423
- "recording.getStatus": {
44424
- capName: "recording",
44733
+ "recordingArchive.getStatus": {
44734
+ capName: "recording-archive",
44425
44735
  capScope: "system",
44426
44736
  addonId: null,
44427
44737
  access: "view"
44428
44738
  },
44429
- "recording.getStorageMigrationMoveStatus": {
44430
- capName: "recording",
44739
+ "recordingArchive.getStorageMigrationMoveStatus": {
44740
+ capName: "recording-archive",
44431
44741
  capScope: "system",
44432
44742
  addonId: null,
44433
44743
  access: "view"
44434
44744
  },
44435
- "recording.getStorageUsage": {
44436
- capName: "recording",
44745
+ "recordingArchive.getStorageUsage": {
44746
+ capName: "recording-archive",
44437
44747
  capScope: "system",
44438
44748
  addonId: null,
44439
44749
  access: "view"
44440
44750
  },
44441
- "recording.listOpsLog": {
44442
- capName: "recording",
44751
+ "recordingArchive.listOpsLog": {
44752
+ capName: "recording-archive",
44443
44753
  capScope: "system",
44444
44754
  addonId: null,
44445
44755
  access: "view"
44446
44756
  },
44447
- "recording.listRelocateJobs": {
44448
- capName: "recording",
44757
+ "recordingArchive.listRelocateJobs": {
44758
+ capName: "recording-archive",
44449
44759
  capScope: "system",
44450
44760
  addonId: null,
44451
44761
  access: "view"
44452
44762
  },
44453
- "recording.locateSegment": {
44454
- capName: "recording",
44763
+ "recordingArchive.locateSegment": {
44764
+ capName: "recording-archive",
44455
44765
  capScope: "system",
44456
44766
  addonId: null,
44457
44767
  access: "view"
44458
44768
  },
44459
- "recording.pauseForStorageMigration": {
44460
- capName: "recording",
44769
+ "recordingArchive.pauseForStorageMigration": {
44770
+ capName: "recording-archive",
44461
44771
  capScope: "system",
44462
44772
  addonId: null,
44463
44773
  access: "create"
44464
44774
  },
44465
- "recording.planStorageRebalance": {
44466
- capName: "recording",
44775
+ "recordingArchive.planStorageRebalance": {
44776
+ capName: "recording-archive",
44467
44777
  capScope: "system",
44468
44778
  addonId: null,
44469
44779
  access: "view"
44470
44780
  },
44471
- "recording.pruneFootage": {
44472
- capName: "recording",
44781
+ "recordingArchive.pruneFootage": {
44782
+ capName: "recording-archive",
44473
44783
  capScope: "system",
44474
44784
  addonId: null,
44475
44785
  access: "create"
44476
44786
  },
44477
- "recording.readGopBytes": {
44478
- capName: "recording",
44787
+ "recordingArchive.readGopBytes": {
44788
+ capName: "recording-archive",
44479
44789
  capScope: "system",
44480
44790
  addonId: null,
44481
44791
  access: "view"
44482
44792
  },
44483
- "recording.readSegmentBytes": {
44484
- capName: "recording",
44793
+ "recordingArchive.readSegmentBytes": {
44794
+ capName: "recording-archive",
44485
44795
  capScope: "system",
44486
44796
  addonId: null,
44487
44797
  access: "view"
44488
44798
  },
44489
- "recording.readWindowBytes": {
44490
- capName: "recording",
44799
+ "recordingArchive.readWindowBytes": {
44800
+ capName: "recording-archive",
44491
44801
  capScope: "system",
44492
44802
  addonId: null,
44493
44803
  access: "view"
44494
44804
  },
44495
- "recording.reconcileLedgerAgainstDisk": {
44496
- capName: "recording",
44805
+ "recordingArchive.reconcileLedgerAgainstDisk": {
44806
+ capName: "recording-archive",
44497
44807
  capScope: "system",
44498
44808
  addonId: null,
44499
44809
  access: "create"
44500
44810
  },
44501
- "recording.refreshStorageLocationsForMigration": {
44502
- capName: "recording",
44811
+ "recordingArchive.refreshStorageLocationsForMigration": {
44812
+ capName: "recording-archive",
44503
44813
  capScope: "system",
44504
44814
  addonId: null,
44505
44815
  access: "create"
44506
44816
  },
44507
- "recording.relocateFootage": {
44508
- capName: "recording",
44817
+ "recordingArchive.relocateFootage": {
44818
+ capName: "recording-archive",
44509
44819
  capScope: "system",
44510
44820
  addonId: null,
44511
44821
  access: "create"
44512
44822
  },
44513
- "recording.renderClip": {
44514
- capName: "recording",
44823
+ "recordingArchive.renderClip": {
44824
+ capName: "recording-archive",
44515
44825
  capScope: "system",
44516
44826
  addonId: null,
44517
44827
  access: "create"
44518
44828
  },
44519
- "recording.renderGif": {
44520
- capName: "recording",
44829
+ "recordingArchive.renderGif": {
44830
+ capName: "recording-archive",
44521
44831
  capScope: "system",
44522
44832
  addonId: null,
44523
44833
  access: "create"
44524
44834
  },
44525
- "recording.rescanStorage": {
44526
- capName: "recording",
44835
+ "recordingArchive.rescanStorage": {
44836
+ capName: "recording-archive",
44527
44837
  capScope: "system",
44528
44838
  addonId: null,
44529
44839
  access: "create"
44530
44840
  },
44531
- "recording.resumeForStorageMigration": {
44532
- capName: "recording",
44841
+ "recordingArchive.resumeForStorageMigration": {
44842
+ capName: "recording-archive",
44533
44843
  capScope: "system",
44534
44844
  addonId: null,
44535
44845
  access: "create"
44536
44846
  },
44537
- "recording.setDeviceConfig": {
44538
- capName: "recording",
44847
+ "recordingArchive.setDeviceConfig": {
44848
+ capName: "recording-archive",
44539
44849
  capScope: "system",
44540
44850
  addonId: null,
44541
44851
  access: "create"
44542
44852
  },
44543
- "recording.setDevicePlacement": {
44544
- capName: "recording",
44853
+ "recordingArchive.setDevicePlacement": {
44854
+ capName: "recording-archive",
44545
44855
  capScope: "system",
44546
44856
  addonId: null,
44547
44857
  access: "create"
44548
44858
  },
44549
- "recording.startStorageMigrationMove": {
44550
- capName: "recording",
44859
+ "recordingArchive.startStorageMigrationMove": {
44860
+ capName: "recording-archive",
44551
44861
  capScope: "system",
44552
44862
  addonId: null,
44553
44863
  access: "create"
44554
44864
  },
44555
- "recording.startStorageRebalance": {
44556
- capName: "recording",
44865
+ "recordingArchive.startStorageRebalance": {
44866
+ capName: "recording-archive",
44557
44867
  capScope: "system",
44558
44868
  addonId: null,
44559
44869
  access: "create"
@@ -46082,6 +46392,12 @@ Object.freeze({
46082
46392
  addonId: null,
46083
46393
  access: "view"
46084
46394
  },
46395
+ "videoclips.getPlaybackOptions": {
46396
+ capName: "videoclips",
46397
+ capScope: "device",
46398
+ addonId: null,
46399
+ access: "view"
46400
+ },
46085
46401
  "videoclips.listClips": {
46086
46402
  capName: "videoclips",
46087
46403
  capScope: "device",
@@ -46094,6 +46410,12 @@ Object.freeze({
46094
46410
  addonId: null,
46095
46411
  access: "view"
46096
46412
  },
46413
+ "videoclips.offerClipBytes": {
46414
+ capName: "videoclips",
46415
+ capScope: "device",
46416
+ addonId: null,
46417
+ access: "view"
46418
+ },
46097
46419
  "videoclips.readClipBytes": {
46098
46420
  capName: "videoclips",
46099
46421
  capScope: "device",
@@ -46846,21 +47168,6 @@ Object.freeze({
46846
47168
  form: "single",
46847
47169
  optional: false
46848
47170
  }],
46849
- "events.getEventClipUrl": [{
46850
- name: "deviceId",
46851
- form: "single",
46852
- optional: false
46853
- }],
46854
- "events.getEvents": [{
46855
- name: "deviceId",
46856
- form: "single",
46857
- optional: false
46858
- }],
46859
- "events.getEventThumbnail": [{
46860
- name: "deviceId",
46861
- form: "single",
46862
- optional: false
46863
- }],
46864
47171
  "faceGallery.getFaceByTrack": [{
46865
47172
  name: "deviceId",
46866
47173
  form: "single",
@@ -47779,107 +48086,117 @@ Object.freeze({
47779
48086
  form: "single",
47780
48087
  optional: false
47781
48088
  }],
47782
- "recording.deleteFootprint": [{
48089
+ "recording.getAvailability": [{
47783
48090
  name: "deviceId",
47784
48091
  form: "single",
47785
48092
  optional: false
47786
48093
  }],
47787
- "recording.getAvailability": [{
48094
+ "recording.getDaysWithRecordings": [{
47788
48095
  name: "deviceId",
47789
48096
  form: "single",
47790
48097
  optional: false
47791
48098
  }],
47792
- "recording.getAvailabilityBatch": [{
47793
- name: "deviceIds",
47794
- form: "array",
48099
+ "recording.getPlayback": [{
48100
+ name: "deviceId",
48101
+ form: "single",
47795
48102
  optional: false
47796
48103
  }],
47797
- "recording.getDaysWithRecordings": [{
48104
+ "recording.getPlaybackOptions": [{
47798
48105
  name: "deviceId",
47799
48106
  form: "single",
47800
48107
  optional: false
47801
48108
  }],
47802
- "recording.getDaysWithRecordingsBatch": [{
47803
- name: "deviceIds",
47804
- form: "array",
48109
+ "recording.listSources": [{
48110
+ name: "deviceId",
48111
+ form: "single",
47805
48112
  optional: false
47806
48113
  }],
47807
- "recording.getDeviceConfig": [{
48114
+ "recordingArchive.deleteFootprint": [{
47808
48115
  name: "deviceId",
47809
48116
  form: "single",
47810
48117
  optional: false
47811
48118
  }],
47812
- "recording.getPlaybackManifest": [{
48119
+ "recordingArchive.getAvailabilityBatch": [{
48120
+ name: "deviceIds",
48121
+ form: "array",
48122
+ optional: false
48123
+ }],
48124
+ "recordingArchive.getDaysWithRecordingsBatch": [{
48125
+ name: "deviceIds",
48126
+ form: "array",
48127
+ optional: false
48128
+ }],
48129
+ "recordingArchive.getDeviceConfig": [{
47813
48130
  name: "deviceId",
47814
48131
  form: "single",
47815
48132
  optional: false
47816
48133
  }],
47817
- "recording.listOpsLog": [{
48134
+ "recordingArchive.listOpsLog": [{
47818
48135
  name: "deviceId",
47819
48136
  form: "single",
47820
48137
  optional: true
47821
48138
  }],
47822
- "recording.locateSegment": [{
48139
+ "recordingArchive.locateSegment": [{
47823
48140
  name: "deviceId",
47824
48141
  form: "single",
47825
48142
  optional: false
47826
48143
  }],
47827
- "recording.pruneFootage": [{
48144
+ "recordingArchive.pruneFootage": [{
47828
48145
  name: "deviceId",
47829
48146
  form: "single",
47830
48147
  optional: false
47831
48148
  }],
47832
- "recording.readGopBytes": [{
48149
+ "recordingArchive.readGopBytes": [{
47833
48150
  name: "deviceId",
47834
48151
  form: "single",
47835
48152
  optional: false
47836
48153
  }],
47837
- "recording.readSegmentBytes": [{
48154
+ "recordingArchive.readSegmentBytes": [{
47838
48155
  name: "deviceId",
47839
48156
  form: "single",
47840
48157
  optional: false
47841
48158
  }],
47842
- "recording.readWindowBytes": [{
48159
+ "recordingArchive.readWindowBytes": [{
47843
48160
  name: "deviceId",
47844
48161
  form: "single",
47845
48162
  optional: false
47846
48163
  }],
47847
- "recording.reconcileLedgerAgainstDisk": [{
48164
+ "recordingArchive.reconcileLedgerAgainstDisk": [{
47848
48165
  name: "deviceId",
47849
48166
  form: "single",
47850
48167
  optional: true
47851
48168
  }],
47852
- "recording.relocateFootage": [{
48169
+ "recordingArchive.relocateFootage": [{
47853
48170
  name: "deviceId",
47854
48171
  form: "single",
47855
48172
  optional: true
47856
48173
  }],
47857
- "recording.renderClip": [{
48174
+ "recordingArchive.renderClip": [{
47858
48175
  name: "deviceId",
47859
48176
  form: "single",
47860
48177
  optional: false
47861
48178
  }],
47862
- "recording.renderGif": [{
48179
+ "recordingArchive.renderGif": [{
47863
48180
  name: "deviceId",
47864
48181
  form: "single",
47865
48182
  optional: false
47866
48183
  }],
47867
- "recording.rescanStorage": [{
48184
+ "recordingArchive.rescanStorage": [{
47868
48185
  name: "deviceId",
47869
48186
  form: "single",
47870
48187
  optional: false
47871
48188
  }],
47872
- "recording.setDeviceConfig": [{
48189
+ "recordingArchive.setDeviceConfig": [{
47873
48190
  name: "deviceId",
47874
48191
  form: "single",
47875
48192
  optional: false
47876
48193
  }],
47877
- "recording.setDevicePlacement": [{
48194
+ "recordingArchive.setDevicePlacement": [{
47878
48195
  name: "deviceId",
47879
48196
  form: "single",
47880
48197
  optional: false
47881
48198
  }],
47882
- "recording.startStorageMigrationMove": [{
48199
+ "recordingArchive.startStorageMigrationMove": [{
47883
48200
  name: "deviceId",
47884
48201
  form: "single",
47885
48202
  optional: true
@@ -48140,6 +48457,11 @@ Object.freeze({
48140
48457
  form: "single",
48141
48458
  optional: false
48142
48459
  }],
48460
+ "videoclips.getPlaybackOptions": [{
48461
+ name: "deviceId",
48462
+ form: "single",
48463
+ optional: false
48464
+ }],
48143
48465
  "videoclips.listClips": [{
48144
48466
  name: "deviceId",
48145
48467
  form: "single",
@@ -48150,6 +48472,11 @@ Object.freeze({
48150
48472
  form: "single",
48151
48473
  optional: false
48152
48474
  }],
48475
+ "videoclips.offerClipBytes": [{
48476
+ name: "deviceId",
48477
+ form: "single",
48478
+ optional: false
48479
+ }],
48153
48480
  "videoclips.readClipBytes": [{
48154
48481
  name: "deviceId",
48155
48482
  form: "single",