@camstack/types 1.2.243 → 1.2.244

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_sleep = require("./sleep-mVRRyKVq.js");
2
+ const require_sleep = require("./sleep-Da9UCU5_.js");
3
3
  const require_event_category = require("./event-category-BVfsrBYA.js");
4
4
  const require_canonical_hash = require("./canonical-hash-CSE4ioRi.js");
5
5
  const require_enums = require("./enums.js");
@@ -11553,6 +11553,248 @@ var deviceAdoptionCapability = {
11553
11553
  }
11554
11554
  };
11555
11555
  //#endregion
11556
+ //#region src/capabilities/device-admin-link.cap.ts
11557
+ /**
11558
+ * device-admin-link — "this device has a management page of its own, and here
11559
+ * is its address".
11560
+ *
11561
+ * ## Why this is not a `deviceConfig` cap
11562
+ *
11563
+ * There is nothing to edit. A `deviceConfig` cap (D14) exists so the framework
11564
+ * can DERIVE a settings form from `getOptions` + `getStatus` and route a flat
11565
+ * patch back through a setter; it costs a `builderId` reducer in
11566
+ * `device-config-contribution.ts` and a `*-config-schema.ts` beside it, and it
11567
+ * renders a form section. This cap answers ONE question with ONE read and
11568
+ * renders a button. Nothing about it is a form, so it carries no `deviceConfig`
11569
+ * block, no `settings`, no `runtimeState` and no reducer — exactly like
11570
+ * `reboot`, the other pure-RPC device-native cap.
11571
+ *
11572
+ * ## Absent, and the difference between "no page" and "we cannot say"
11573
+ *
11574
+ * The two are answered at DIFFERENT layers, on purpose:
11575
+ *
11576
+ * - **"We cannot say"** → the provider never registers the cap for that
11577
+ * device. A VeSync humidifier, a Petkit feeder, a Dreame vacuum and a Dreo
11578
+ * fan are reached only through a vendor cloud; there is no address to hand
11579
+ * out and no page to open. A Tuya plug, a Wyze camera and a Gree air
11580
+ * conditioner DO have a LAN IP, and still have no HTTP management page
11581
+ * behind it. None of them register, so `deviceManager.getBindings` never
11582
+ * lists the cap and no surface asks.
11583
+ * - **"This device has no page, and I know that"** → the provider registers
11584
+ * and `getAdminLink` returns `null`. This is the answer for a device whose
11585
+ * sibling DOES have a page: a Reolink battery camera reached over UDP by
11586
+ * `uid` with a blank `host`, an Ecowitt gateway configured in `listener`
11587
+ * transport, a Home Assistant broker authenticated by supervisor token
11588
+ * (which carries no `baseUrl` at all).
11589
+ *
11590
+ * Both draw NOTHING. A button that opens a browser error is worse than no
11591
+ * button, and D62 is the same rule from the other side: an off switch is
11592
+ * reported off, never made to look broken. There is no third state where the
11593
+ * UI renders a disabled button "because the device might have a page".
11594
+ *
11595
+ * ## The URL never carries credentials
11596
+ *
11597
+ * Not in userinfo, not in a query string. Every provider builds through
11598
+ * `buildDeviceAdminUrl` (`device-admin-link-url.ts`), which takes host, port,
11599
+ * scheme and path as separate arguments — there is no parameter a secret could
11600
+ * arrive in — and re-checks its own output for the `scheme://user:pass@` shape
11601
+ * that `scripts/check-no-credential-urls-in-fixtures.ts` bans from recorded
11602
+ * output. `scripts/check-admin-link-builder-is-the-only-url-source.ts` is what
11603
+ * keeps providers from hand-rolling one anyway.
11604
+ *
11605
+ * This matters here more than anywhere else in the repo, because every provider
11606
+ * that knows a device's host knows its PASSWORD too: `{ host, port, username,
11607
+ * password }` sit in one object on Hikvision, Amcrest, Reolink and ONVIF alike,
11608
+ * and `http://admin:hunter2@192.168.50.139/` is a URL a browser accepts. The
11609
+ * camera's own page will ask for its own login. That is correct, and pre-
11610
+ * filling it is the operator's business, not ours.
11611
+ *
11612
+ * ## It is a LAN fact
11613
+ *
11614
+ * The URL addresses the device where the NODE can see it. It is not proxied,
11615
+ * not made reachable from outside, and not sent anywhere. A surface renders it
11616
+ * as a link the operator's own browser follows, on the operator's own network,
11617
+ * or renders nothing.
11618
+ */
11619
+ /**
11620
+ * Whose page is it. The distinction is for the OPERATOR, who needs to know
11621
+ * before clicking whether he is about to land on a camera's own web server or
11622
+ * inside Home Assistant.
11623
+ */
11624
+ var AdminLinkTargetEnum = zod.z.enum(["device", "integration"]);
11625
+ var DeviceAdminLinkSchema = zod.z.object({
11626
+ /**
11627
+ * Absolute `http(s)://` URL. Built by `buildDeviceAdminUrl` and therefore
11628
+ * free of userinfo and of any credential-shaped query key.
11629
+ */
11630
+ url: zod.z.string(),
11631
+ /**
11632
+ * What the surface calls it — "Web UI", "Home Assistant", "UniFi controller".
11633
+ * The PROVIDER names it, because only the provider knows what the page is;
11634
+ * a UI that invented the label from the addon id would call the Home
11635
+ * Assistant device page "Provider Homeassistant".
11636
+ */
11637
+ label: zod.z.string(),
11638
+ target: AdminLinkTargetEnum,
11639
+ /**
11640
+ * Host the URL points at, without scheme, port or path — for the tooltip, so
11641
+ * an operator can see WHERE the button goes before he follows it. Redundant
11642
+ * with `url` by construction; carried separately so no surface has to parse
11643
+ * a URL to show it.
11644
+ */
11645
+ host: zod.z.string()
11646
+ });
11647
+ var deviceAdminLinkCapability = {
11648
+ name: "device-admin-link",
11649
+ scope: "device",
11650
+ deviceNative: true,
11651
+ mode: "singleton",
11652
+ methods: {
11653
+ /**
11654
+ * The device's management page, or `null` when this device has none.
11655
+ *
11656
+ * `auth: 'admin'` deliberately. This is administration, not actuation —
11657
+ * the same bucket as `reboot` and `camera-credentials`, and explicitly NOT
11658
+ * the actuation set `scripts/check-actuation-not-admin.ts` protects (D403).
11659
+ * The URL is also a statement about the LAN, which a household member with
11660
+ * a `view` grant on a light has no reason to be handed.
11661
+ *
11662
+ * The surfaces gate on the QUERY, never on a role they guessed: a caller
11663
+ * without the right loses the query and draws nothing, which is the same
11664
+ * thing a device with no page draws. There is no path on which a button
11665
+ * appears and then fails — the D403 failure mode, from the other end.
11666
+ */
11667
+ getAdminLink: require_sleep.method(zod.z.object({ deviceId: zod.z.number().int().nonnegative() }), DeviceAdminLinkSchema.nullable(), { auth: "admin" }) }
11668
+ };
11669
+ //#endregion
11670
+ //#region src/capabilities/device-admin-link-url.ts
11671
+ /**
11672
+ * Query keys that may never appear on an admin link. A credential smuggled as
11673
+ * `?password=` is the same leak as userinfo, in a form the userinfo check
11674
+ * cannot see: it survives copy-paste, referrer headers and proxy logs
11675
+ * identically.
11676
+ */
11677
+ var CREDENTIAL_QUERY_KEYS = [
11678
+ "password",
11679
+ "passwd",
11680
+ "pwd",
11681
+ "pass",
11682
+ "user",
11683
+ "username",
11684
+ "usr",
11685
+ "login",
11686
+ "token",
11687
+ "access_token",
11688
+ "auth",
11689
+ "authorization",
11690
+ "apikey",
11691
+ "api_key",
11692
+ "secret",
11693
+ "credential",
11694
+ "credentials",
11695
+ "session",
11696
+ "sessionid",
11697
+ "key"
11698
+ ];
11699
+ /**
11700
+ * The same userinfo shape `scripts/check-no-credential-urls-in-fixtures.ts`
11701
+ * scans recorded fixtures for, applied to what we are about to EMIT. Kept
11702
+ * structurally identical on purpose: a URL this function returns is a URL that
11703
+ * guard would pass.
11704
+ */
11705
+ var CREDENTIAL_URL = /[a-z][a-z0-9+.-]*:\/\/[^/\s:@'"]+:[^/\s:@'"]+@/i;
11706
+ /** A host that is safe to place in an authority component verbatim. */
11707
+ var PLAIN_HOST = /^[a-zA-Z0-9._-]+$/;
11708
+ /** A bracketed IPv6 literal, the only other authority form we emit. */
11709
+ var IPV6_HOST = /^\[[0-9a-fA-F:.]+\]$/;
11710
+ function defaultPortFor(scheme) {
11711
+ return scheme === "https" ? 443 : 80;
11712
+ }
11713
+ /**
11714
+ * Build the admin-page URL, or refuse by name.
11715
+ *
11716
+ * The refusal is never thrown: a provider answering "no page for this device"
11717
+ * is an ordinary answer (`getAdminLink` → `null`), and a throw here would turn
11718
+ * a missing host on one device into a failed query for the whole surface.
11719
+ */
11720
+ function buildDeviceAdminUrl(parts) {
11721
+ const host = parts.host.trim();
11722
+ if (host.length === 0) return {
11723
+ ok: false,
11724
+ reason: "empty-host"
11725
+ };
11726
+ if (host.includes("@")) return {
11727
+ ok: false,
11728
+ reason: "host-carries-userinfo"
11729
+ };
11730
+ if (!PLAIN_HOST.test(host) && !IPV6_HOST.test(host)) return {
11731
+ ok: false,
11732
+ reason: "host-not-plain"
11733
+ };
11734
+ if (parts.port !== null) {
11735
+ if (!Number.isInteger(parts.port) || parts.port < 1 || parts.port > 65535) return {
11736
+ ok: false,
11737
+ reason: "port-out-of-range"
11738
+ };
11739
+ }
11740
+ if (!parts.path.startsWith("/")) return {
11741
+ ok: false,
11742
+ reason: "path-not-absolute"
11743
+ };
11744
+ const query = parts.query ?? {};
11745
+ for (const key of Object.keys(query)) if (CREDENTIAL_QUERY_KEYS.includes(key.toLowerCase())) return {
11746
+ ok: false,
11747
+ reason: "credential-query-key"
11748
+ };
11749
+ const authority = parts.port === null || parts.port === defaultPortFor(parts.scheme) ? host : `${host}:${String(parts.port)}`;
11750
+ const search = new URLSearchParams();
11751
+ for (const [key, value] of Object.entries(query)) search.append(key, value);
11752
+ const suffix = search.size > 0 ? `?${search.toString()}` : "";
11753
+ const url = `${parts.scheme}://${authority}${parts.path}${suffix}`;
11754
+ if (CREDENTIAL_URL.test(url)) return {
11755
+ ok: false,
11756
+ reason: "userinfo-in-result"
11757
+ };
11758
+ return {
11759
+ ok: true,
11760
+ url
11761
+ };
11762
+ }
11763
+ function parseAdminBase(baseUrl) {
11764
+ const raw = baseUrl.trim();
11765
+ if (raw.length === 0) return {
11766
+ ok: false,
11767
+ reason: "empty"
11768
+ };
11769
+ let parsed;
11770
+ try {
11771
+ parsed = new URL(raw);
11772
+ } catch {
11773
+ return {
11774
+ ok: false,
11775
+ reason: "unparseable"
11776
+ };
11777
+ }
11778
+ if (parsed.username !== "" || parsed.password !== "") return {
11779
+ ok: false,
11780
+ reason: "base-carries-userinfo"
11781
+ };
11782
+ if (parsed.protocol !== "http:" && parsed.protocol !== "https:") return {
11783
+ ok: false,
11784
+ reason: "scheme-not-http"
11785
+ };
11786
+ const scheme = parsed.protocol === "https:" ? "https" : "http";
11787
+ const port = parsed.port === "" ? null : Number(parsed.port);
11788
+ const basePath = parsed.pathname === "/" ? "" : parsed.pathname.replace(/\/+$/, "");
11789
+ return {
11790
+ ok: true,
11791
+ host: parsed.hostname,
11792
+ port,
11793
+ scheme,
11794
+ basePath
11795
+ };
11796
+ }
11797
+ //#endregion
11556
11798
  //#region src/capabilities/device-export.cap.ts
11557
11799
  /**
11558
11800
  * `device-export` — collection cap for addons that export camstack
@@ -30623,6 +30865,632 @@ var dayNightCapability = {
30623
30865
  volatileStateFields: ["lastFetchedAt"]
30624
30866
  };
30625
30867
  //#endregion
30868
+ //#region src/capabilities/recording-onboard.cap.ts
30869
+ /**
30870
+ * Vendor-neutral **onboard** recording + storage cap — what the CAMERA
30871
+ * writes to the CAMERA's own card, on the camera's own schedule.
30872
+ *
30873
+ * This is NOT `recording.cap.ts`. That one is CamStack's recorder: our
30874
+ * footage ledger, our storage locations, our retention. This one has a
30875
+ * different authority — the camera's firmware — and per D62 it stores
30876
+ * nothing of its own. Every value here is read from the camera and every
30877
+ * write goes back to the camera; there is no CamStack-side mirror that
30878
+ * could disagree with the device.
30879
+ *
30880
+ * ## One shape, two firmwares
30881
+ *
30882
+ * Measured 2026-09-22 against the live fleet:
30883
+ *
30884
+ * | fact | Hikvision (ISAPI) | Reolink (Baichuan) |
30885
+ * | --- | --- | --- |
30886
+ * | storage | `ContentMgmt/Storage` `<hdd>` rows: status, capacity, freeSpace (MB) | `getHddInfoList` (cmd 102): `mount`, `format`, `capacity` GB + `capacityM` MB remainder |
30887
+ * | tracks | several (101 **and** 103 on both 1436 and 3833), each with its own schedule | one per channel |
30888
+ * | schedule | per track, 7 `ScheduleAction` blocks: DayOfWeek + TimeOfDay range + ONE `ActionRecordingMode` | per trigger type, a 168-char weekly HOUR mask |
30889
+ * | triggers | `CMR`, `MOTION` | `Normal`, `MD`, `people`, `vehicle`, `dog_cat`, `crossline`, `intrude`, `loitering` |
30890
+ * | pre-record | `PreRecordTimeSeconds` | `preRecordTime` |
30891
+ * | post-record | `PostRecordTimeSeconds` | `recordDelayTime` |
30892
+ * | overwrite | per track `LoopEnable` | `cycle`, with `cycleList` enumerating the accepted values |
30893
+ * | segment length | not exposed on V5.7.1 | `packageTime` (minutes) |
30894
+ *
30895
+ * The two schedule models look different and are the same thing in
30896
+ * different coordinates: both answer "for this trigger, during which
30897
+ * weekly windows does the camera record". {@link RecordWindow} is that
30898
+ * question in one shape — Hikvision's ranges map straight onto it,
30899
+ * Reolink's mask expands into hour-aligned windows.
30900
+ *
30901
+ * ## Union, not intersection
30902
+ *
30903
+ * **The same fields exist on every camera.** What differs per device is
30904
+ * which VALUES that device accepts, and that is what {@link
30905
+ * RecordingOnboardOptions} reports — a `{ readable, writable, reason }`
30906
+ * per field plus the schedule's own limits. A control a camera cannot
30907
+ * honour is rendered DISABLED WITH ITS REASON, never missing and never
30908
+ * dead: disabled must not look like broken.
30909
+ *
30910
+ * ## Refusal by name
30911
+ *
30912
+ * A write a camera cannot honour is refused with a sentence the operator
30913
+ * can read — never accepted and dropped. Both providers refuse through
30914
+ * {@link describeOnboardRefusal}, so the vocabulary is one function and
30915
+ * one test, not two hand-written vendor opinions.
30916
+ *
30917
+ * Follows the D14 `deviceConfig` archetype (see `stream-params.cap.ts`):
30918
+ * `getOptions` advertises per-camera availability, `getStatus` (auto-
30919
+ * injected from `status`) reports the live values, and a single
30920
+ * `setSettings` mutation applies a partial change. No hand-written
30921
+ * settings-contribution methods.
30922
+ */
30923
+ /**
30924
+ * What makes the camera start recording during a window.
30925
+ *
30926
+ * The union of both vendors' vocabularies. `continuous` is Hikvision's
30927
+ * `CMR` and Reolink's `Normal`; `motion` is `MOTION` / `MD`. The
30928
+ * object-class triggers are Reolink-only today and the smart-event ones
30929
+ * (`lineCrossing`, `intrusion`, `loitering`) are Reolink-only on the
30930
+ * firmwares measured — a camera that cannot record on a trigger simply
30931
+ * does not list it in `options.schedule.triggers`, and a window naming
30932
+ * it is REFUSED, not dropped.
30933
+ */
30934
+ var RecordTriggerSchema = zod.z.enum([
30935
+ "continuous",
30936
+ "motion",
30937
+ "person",
30938
+ "vehicle",
30939
+ "animal",
30940
+ "lineCrossing",
30941
+ "intrusion",
30942
+ "loitering",
30943
+ "alarmInput"
30944
+ ]);
30945
+ /**
30946
+ * One weekly recording window: "on `day`, from `startMinute` to
30947
+ * `endMinute`, record on `trigger`".
30948
+ *
30949
+ * `day` is 0 = Monday … 6 = Sunday (ISO order, which is also the order
30950
+ * both firmwares enumerate). Minutes are local camera time since
30951
+ * midnight; `endMinute` may be 1440, meaning end of day — that is
30952
+ * Hikvision's literal `24:00` and Reolink's 24th mask slot, and
30953
+ * collapsing it to 0 would turn a whole-day window into an empty one.
30954
+ */
30955
+ var RecordWindowSchema = zod.z.object({
30956
+ trigger: RecordTriggerSchema,
30957
+ day: zod.z.number().int().min(0).max(6),
30958
+ startMinute: zod.z.number().int().min(0).max(1439),
30959
+ endMinute: zod.z.number().int().min(1).max(1440)
30960
+ });
30961
+ /** Status of one physical volume, as the camera itself describes it. */
30962
+ var OnboardStorageVolumeSchema = zod.z.object({
30963
+ /** The camera's own id for the volume (`hdd/id`, Reolink `HddInfo/number`). */
30964
+ id: zod.z.string(),
30965
+ /** The camera's own name for it, when it gives one (`hddName`). */
30966
+ label: zod.z.string().optional(),
30967
+ status: zod.z.enum([
30968
+ "ok",
30969
+ "unformatted",
30970
+ "error",
30971
+ "offline",
30972
+ "unknown"
30973
+ ]),
30974
+ /**
30975
+ * Total size in MB, or **null when the camera did not say**.
30976
+ *
30977
+ * Never 0 for an unreadable value: a measurement that failed is not a
30978
+ * measurement (D393), and a card whose size is unknown must not be
30979
+ * rendered as a card of size zero.
30980
+ */
30981
+ capacityMb: zod.z.number().nullable(),
30982
+ /**
30983
+ * Free space in MB, or null when unknown.
30984
+ *
30985
+ * **Not a proxy for "has footage".** Measured 2026-09-22: 1436 and
30986
+ * 1439 both report exactly 11776 MB free — the fixed reserve a looping
30987
+ * card converges on once it has wrapped. At loop steady state the
30988
+ * number is identical whether the camera recorded yesterday or stopped
30989
+ * a month ago.
30990
+ */
30991
+ freeMb: zod.z.number().nullable(),
30992
+ /** True when the camera reports the volume writable (`property` RW). */
30993
+ writable: zod.z.boolean().optional()
30994
+ });
30995
+ /**
30996
+ * Whether the camera has usable onboard storage.
30997
+ *
30998
+ * Three states, never two: an unreadable answer is `unknown`, never
30999
+ * folded into `absent`. Folding a failed read into "no card" is how a
31000
+ * healthy camera gets reported as broken, and the inverse is how a
31001
+ * camera with no card reports `ok` and then an empty list (D393).
31002
+ */
31003
+ var OnboardStorageSchema = zod.z.discriminatedUnion("kind", [
31004
+ zod.z.object({
31005
+ kind: zod.z.literal("present"),
31006
+ volumes: zod.z.array(OnboardStorageVolumeSchema)
31007
+ }),
31008
+ zod.z.object({
31009
+ kind: zod.z.literal("absent"),
31010
+ reason: zod.z.string()
31011
+ }),
31012
+ zod.z.object({
31013
+ kind: zod.z.literal("unknown"),
31014
+ reason: zod.z.string()
31015
+ })
31016
+ ]);
31017
+ /**
31018
+ * One recording track the camera exposes. Read-only.
31019
+ *
31020
+ * Hikvision lists several — 1436 and 3833 each list 101 AND 103, with
31021
+ * DIFFERENT schedules (101 MOTION all day, 103 CMR 00:05–23:57) — so a
31022
+ * cap that reported one number for "the schedule" would be lying on
31023
+ * every Hikvision in the fleet. Reolink has exactly one per channel.
31024
+ *
31025
+ * There is deliberately **no `framerate`**. Hikvision declares it in the
31026
+ * track `Description` and it is WRONG: 1436 says `2.260000 fps` while
31027
+ * the media measures 12.55 fps. `codec` and `resolution` from the same
31028
+ * string ARE right — those are the only two worth surfacing.
31029
+ */
31030
+ var OnboardRecordTrackSchema = zod.z.object({
31031
+ id: zod.z.string(),
31032
+ enabled: zod.z.boolean(),
31033
+ isVideo: zod.z.boolean(),
31034
+ /** From the camera's own track description. Null when it does not say. */
31035
+ codec: zod.z.string().nullable(),
31036
+ resolution: zod.z.string().nullable(),
31037
+ /** Per-track overwrite flag, where the firmware keeps it per track. */
31038
+ overwriteWhenFull: zod.z.boolean().nullable()
31039
+ });
31040
+ /**
31041
+ * What the camera is doing with its own storage, right now.
31042
+ *
31043
+ * Every scalar is nullable and **null means the camera did not answer**,
31044
+ * never a default. A form that seeds `0` from an unanswered read invites
31045
+ * the operator to save that 0 back onto the camera.
31046
+ */
31047
+ var RecordingOnboardStatusSchema = zod.z.object({
31048
+ storage: OnboardStorageSchema,
31049
+ tracks: zod.z.array(OnboardRecordTrackSchema),
31050
+ /**
31051
+ * The track the write path targets — the enabled VIDEO one. Null when
31052
+ * no track could be identified, which is itself a refusal reason.
31053
+ */
31054
+ primaryTrackId: zod.z.string().nullable(),
31055
+ /** Master "record to the card at all" switch. */
31056
+ enabled: zod.z.boolean().nullable(),
31057
+ overwriteWhenFull: zod.z.boolean().nullable(),
31058
+ preRecordSec: zod.z.number().nullable(),
31059
+ postRecordSec: zod.z.number().nullable(),
31060
+ /** Length of one recorded file, in minutes. */
31061
+ segmentMinutes: zod.z.number().nullable(),
31062
+ /** The primary track's weekly windows, flattened. */
31063
+ windows: zod.z.array(RecordWindowSchema),
31064
+ /**
31065
+ * How many windows the camera described that CamStack could NOT read —
31066
+ * an unrecognised trigger, an unparseable clock, a weekday it does not
31067
+ * name.
31068
+ *
31069
+ * A dropped window is work the reader threw away, and a schedule that
31070
+ * silently shows fewer rows than the camera holds is how an operator
31071
+ * saves back a schedule shorter than the one they were looking at
31072
+ * (D391). Non-zero means the window list is INCOMPLETE and a write
31073
+ * that replaces it would delete what was not shown — which is why a
31074
+ * provider reporting a non-zero count also reports the schedule as not
31075
+ * writable.
31076
+ */
31077
+ unreadableWindows: zod.z.number(),
31078
+ /**
31079
+ * The camera is scheduled to record and has NO usable storage.
31080
+ *
31081
+ * A first-class fact because it is the fleet's most common silent
31082
+ * defect: measured 2026-09-22, 1441 and 3831 are both motion-recording
31083
+ * to a card that is not there. Neither the schedule nor the storage
31084
+ * read says anything wrong on its own; only the pair does.
31085
+ */
31086
+ recordingToNowhere: zod.z.boolean(),
31087
+ lastFetchedAt: zod.z.number()
31088
+ });
31089
+ /** Numeric range descriptor — `{ min, max, step }` per the getOptions convention. */
31090
+ var RangeSchema = zod.z.object({
31091
+ min: zod.z.number(),
31092
+ max: zod.z.number(),
31093
+ step: zod.z.number()
31094
+ });
31095
+ /**
31096
+ * The values a camera actually takes for a numeric field, when they are a SET
31097
+ * rather than a range.
31098
+ *
31099
+ * `{min,max,step}` cannot say what these two firmwares do. Measured on 1436
31100
+ * (I91DN) on 2026-09-22 by writing each value and reading it back:
31101
+ *
31102
+ * - pre-record: `0, 5, 10, 15, 20, 25, 30` and `2147483647` (INT32_MAX, the
31103
+ * camera's "no limit" — `-1` and `4294967295` both land on it);
31104
+ * - post-record: `5, 10, 30, 60, 120, 300, 600`.
31105
+ *
31106
+ * Neither is expressible as a step: the first has a sentinel two billion away
31107
+ * from its neighbours, the second doubles and then jumps. A range that tried
31108
+ * would forbid values the camera takes AND permit values it silently replaces
31109
+ * with 5 — wrong in both directions at once.
31110
+ *
31111
+ * `sentinel` names the member that is not a duration, so a surface can render
31112
+ * "no limit" instead of `2147483647` seconds.
31113
+ */
31114
+ var AllowedValuesSchema = zod.z.object({
31115
+ values: zod.z.array(zod.z.number()).min(1),
31116
+ sentinel: zod.z.object({
31117
+ value: zod.z.number(),
31118
+ meaning: zod.z.enum(["no-limit", "disabled"])
31119
+ }).optional()
31120
+ });
31121
+ /**
31122
+ * Per-field availability on ONE camera.
31123
+ *
31124
+ * The field exists on every camera — this says whether this one can be
31125
+ * read and whether it can be written, and `reason` says why not when
31126
+ * either is false. The UI renders the control DISABLED with the reason
31127
+ * rather than hiding it, so a limitation is legible instead of looking
31128
+ * like a missing feature.
31129
+ */
31130
+ var OnboardFieldSupportSchema = zod.z.object({
31131
+ readable: zod.z.boolean(),
31132
+ writable: zod.z.boolean(),
31133
+ /** Required whenever `readable` or `writable` is false. */
31134
+ reason: zod.z.string().optional()
31135
+ });
31136
+ /** What this camera's schedule model can express. */
31137
+ var OnboardScheduleSupportSchema = zod.z.object({
31138
+ support: OnboardFieldSupportSchema,
31139
+ /**
31140
+ * The smallest time step the camera can express, in minutes.
31141
+ *
31142
+ * Hikvision takes arbitrary minutes (`00:05:00`–`23:57:00` observed on
31143
+ * 1436's track 103). Reolink's schedule is a 7×24 HOUR mask, so 60. A
31144
+ * window whose edges are not a multiple of this is REFUSED rather than
31145
+ * quietly rounded — rounding is how an operator's 06:30 becomes 06:00
31146
+ * and nothing says so.
31147
+ */
31148
+ granularityMinutes: zod.z.number(),
31149
+ /** Triggers this camera can record on. A window naming another is refused. */
31150
+ triggers: zod.z.array(RecordTriggerSchema),
31151
+ /**
31152
+ * False when the camera stores ONE trigger per time range, so two
31153
+ * windows overlapping on the same day cannot carry different triggers.
31154
+ * True on Reolink, whose mask is per-trigger and independent.
31155
+ */
31156
+ supportsOverlappingTriggers: zod.z.boolean()
31157
+ });
31158
+ var RecordingOnboardOptionsSchema = zod.z.object({
31159
+ enabled: OnboardFieldSupportSchema,
31160
+ overwriteWhenFull: OnboardFieldSupportSchema,
31161
+ preRecordSec: OnboardFieldSupportSchema,
31162
+ preRecordSecRange: RangeSchema.optional(),
31163
+ /** Preferred over the range when the camera takes a SET, not a span. */
31164
+ preRecordSecAllowed: AllowedValuesSchema.optional(),
31165
+ postRecordSec: OnboardFieldSupportSchema,
31166
+ postRecordSecRange: RangeSchema.optional(),
31167
+ /** Preferred over the range when the camera takes a SET, not a span. */
31168
+ postRecordSecAllowed: AllowedValuesSchema.optional(),
31169
+ segmentMinutes: OnboardFieldSupportSchema,
31170
+ segmentMinutesRange: RangeSchema.optional(),
31171
+ /** Preferred over the range when the camera takes a SET, not a span. */
31172
+ segmentMinutesAllowed: AllowedValuesSchema.optional(),
31173
+ schedule: OnboardScheduleSupportSchema
31174
+ });
31175
+ /**
31176
+ * A partial change. Every field optional.
31177
+ *
31178
+ * Unlike the other `deviceConfig` caps, a provider here does **NOT**
31179
+ * silently ignore a field it cannot support — it refuses, by name,
31180
+ * through {@link describeOnboardRefusal}. Silence on a recording setting
31181
+ * is the failure D62 exists to prevent: the operator believes the camera
31182
+ * is recording the way the form says, and it is not.
31183
+ */
31184
+ var RecordingOnboardPatchSchema = zod.z.object({
31185
+ enabled: zod.z.boolean().optional(),
31186
+ overwriteWhenFull: zod.z.boolean().optional(),
31187
+ preRecordSec: zod.z.number().optional(),
31188
+ postRecordSec: zod.z.number().optional(),
31189
+ segmentMinutes: zod.z.number().optional(),
31190
+ /** The complete new window set for the primary track — not a delta. */
31191
+ windows: zod.z.array(RecordWindowSchema).optional()
31192
+ });
31193
+ var recordingOnboardCapability = {
31194
+ name: "recording-onboard",
31195
+ scope: "device",
31196
+ deviceNative: true,
31197
+ mode: "singleton",
31198
+ deviceTypes: [require_sleep.DeviceType.Camera],
31199
+ deviceConfig: { ui: {
31200
+ kind: "derived-form",
31201
+ builderId: "recording-onboard",
31202
+ tab: "recording"
31203
+ } },
31204
+ methods: {
31205
+ getOptions: require_sleep.method(zod.z.object({ deviceId: zod.z.number() }), RecordingOnboardOptionsSchema),
31206
+ setSettings: require_sleep.method(zod.z.object({
31207
+ deviceId: zod.z.number(),
31208
+ settings: RecordingOnboardPatchSchema
31209
+ }), zod.z.void(), {
31210
+ kind: "mutation",
31211
+ auth: "admin"
31212
+ })
31213
+ },
31214
+ status: {
31215
+ schema: RecordingOnboardStatusSchema,
31216
+ kind: "poll"
31217
+ },
31218
+ runtimeState: RecordingOnboardStatusSchema,
31219
+ /**
31220
+ * Runtime-state durability: **restored** — operator-set camera-side
31221
+ * recording config; mutation-driven, and the storage half is the last
31222
+ * thing the camera said about its own card.
31223
+ *
31224
+ * See `RuntimeStateDurability`. Enforced by
31225
+ * `scripts/check-runtime-state-durability.ts`.
31226
+ */
31227
+ durability: "restored",
31228
+ /** Clock fields: written, but excluded from the compare that decides
31229
+ * whether persisting is worth a SQLite commit. */
31230
+ volatileStateFields: ["lastFetchedAt"]
31231
+ };
31232
+ //#endregion
31233
+ //#region src/capabilities/recording-onboard-rules.ts
31234
+ /** Minutes in a day. `endMinute === 1440` means "to end of day". */
31235
+ var MINUTES_PER_DAY = 1440;
31236
+ /** Days in the cap's week, 0 = Monday. */
31237
+ var DAYS_PER_WEEK = 7;
31238
+ /** Hours per day — the resolution of Reolink's mask. */
31239
+ var HOURS_PER_DAY = 24;
31240
+ /** Length of a Reolink weekly `valueTable`: 7 days × 24 hours. */
31241
+ var WEEKLY_MASK_LENGTH = 168;
31242
+ /**
31243
+ * Day-of-week names in the cap's index order (0 = Monday), for messages
31244
+ * an operator reads and for Hikvision's `<DayOfWeek>` element.
31245
+ */
31246
+ var DAY_NAMES = [
31247
+ "Monday",
31248
+ "Tuesday",
31249
+ "Wednesday",
31250
+ "Thursday",
31251
+ "Friday",
31252
+ "Saturday",
31253
+ "Sunday"
31254
+ ];
31255
+ /**
31256
+ * Does `patch` ask this camera for something it cannot do?
31257
+ *
31258
+ * Returns the operator-readable reason, or `null` when every field in
31259
+ * the patch is within what `options` says this camera accepts. A
31260
+ * provider calls this BEFORE touching the camera and throws the string:
31261
+ * refusing is the point, and refusing identically on both vendors is why
31262
+ * this is one function.
31263
+ *
31264
+ * The order of checks is the order an operator would read them: the
31265
+ * scalar knobs first, then the schedule, because a schedule complaint is
31266
+ * longer and a scalar one is usually the real problem.
31267
+ */
31268
+ function describeOnboardRefusal(options, patch) {
31269
+ if (patch.enabled !== void 0 && !options.enabled.writable) return unwritable("the master recording switch", options.enabled.reason);
31270
+ if (patch.overwriteWhenFull !== void 0 && !options.overwriteWhenFull.writable) return unwritable("overwrite-when-full", options.overwriteWhenFull.reason);
31271
+ const preRefusal = refuseNumeric("pre-record seconds", patch.preRecordSec, options.preRecordSec, options.preRecordSecRange, options.preRecordSecAllowed);
31272
+ if (preRefusal) return preRefusal;
31273
+ const postRefusal = refuseNumeric("post-record seconds", patch.postRecordSec, options.postRecordSec, options.postRecordSecRange, options.postRecordSecAllowed);
31274
+ if (postRefusal) return postRefusal;
31275
+ const segmentRefusal = refuseNumeric("segment length (minutes)", patch.segmentMinutes, options.segmentMinutes, options.segmentMinutesRange, options.segmentMinutesAllowed);
31276
+ if (segmentRefusal) return segmentRefusal;
31277
+ if (patch.windows !== void 0) {
31278
+ const scheduleRefusal = refuseSchedule(options, patch.windows);
31279
+ if (scheduleRefusal) return scheduleRefusal;
31280
+ }
31281
+ return null;
31282
+ }
31283
+ function unwritable(what, reason) {
31284
+ return reason ? `this camera cannot change ${what}: ${reason}` : `this camera cannot change ${what}`;
31285
+ }
31286
+ function refuseNumeric(what, value, support, range, allowed) {
31287
+ if (value === void 0) return null;
31288
+ if (!support.writable) return unwritable(what, support.reason);
31289
+ if (!Number.isFinite(value)) return `${what} must be a number, got ${String(value)}`;
31290
+ if (allowed) {
31291
+ if (allowed.values.includes(value)) return null;
31292
+ const say = (v) => allowed.sentinel !== void 0 && v === allowed.sentinel.value ? allowed.sentinel.meaning === "no-limit" ? "no limit" : "off" : String(v);
31293
+ return `this camera accepts ${what} only as ${allowed.values.map(say).join(", ")}; ${say(value)} is not one of them`;
31294
+ }
31295
+ if (!range) return null;
31296
+ if (value < range.min || value > range.max) return `this camera accepts ${what} between ${String(range.min)} and ${String(range.max)}; ${String(value)} is outside that`;
31297
+ if (range.step > 0 && (value - range.min) % range.step !== 0) return `this camera accepts ${what} in steps of ${String(range.step)} from ${String(range.min)}; ${String(value)} is not one of them`;
31298
+ return null;
31299
+ }
31300
+ function refuseSchedule(options, windows) {
31301
+ const schedule = options.schedule;
31302
+ if (!schedule.support.writable) return unwritable("the recording schedule", schedule.support.reason);
31303
+ const allowed = new Set(schedule.triggers);
31304
+ for (const window of windows) {
31305
+ if (!allowed.has(window.trigger)) {
31306
+ const offer = schedule.triggers.length > 0 ? schedule.triggers.join(", ") : "none";
31307
+ return `this camera cannot record on "${window.trigger}"; it records on: ${offer}`;
31308
+ }
31309
+ if (window.endMinute <= window.startMinute) return `a window on ${dayName(window.day)} ends at or before it starts (${String(window.startMinute)} → ${String(window.endMinute)})`;
31310
+ const step = schedule.granularityMinutes;
31311
+ if (step > 1 && (window.startMinute % step !== 0 || window.endMinute % step !== 0)) return `this camera's schedule only moves in ${String(step)}-minute steps; the ${dayName(window.day)} window ${formatMinutes(window.startMinute)}–${formatMinutes(window.endMinute)} is not aligned to them`;
31312
+ }
31313
+ if (!schedule.supportsOverlappingTriggers) {
31314
+ const clash = findOverlapWithDifferentTrigger(windows);
31315
+ if (clash) return `this camera stores one trigger per time range, so "${clash.a.trigger}" and "${clash.b.trigger}" cannot both cover ${dayName(clash.a.day)} ${formatMinutes(Math.max(clash.a.startMinute, clash.b.startMinute))}–${formatMinutes(Math.min(clash.a.endMinute, clash.b.endMinute))}`;
31316
+ }
31317
+ return null;
31318
+ }
31319
+ function findOverlapWithDifferentTrigger(windows) {
31320
+ for (let i = 0; i < windows.length; i += 1) for (let j = i + 1; j < windows.length; j += 1) {
31321
+ const a = windows[i];
31322
+ const b = windows[j];
31323
+ if (!a || !b) continue;
31324
+ if (a.day !== b.day) continue;
31325
+ if (a.trigger === b.trigger) continue;
31326
+ if (a.startMinute < b.endMinute && b.startMinute < a.endMinute) return {
31327
+ a,
31328
+ b
31329
+ };
31330
+ }
31331
+ return null;
31332
+ }
31333
+ function dayName(day) {
31334
+ return DAY_NAMES[day] ?? `day ${String(day)}`;
31335
+ }
31336
+ /** `510` → `08:30`. For messages, not for the wire. */
31337
+ function formatMinutes(minute) {
31338
+ const hour = Math.floor(minute / 60);
31339
+ const rest = minute % 60;
31340
+ return `${String(hour).padStart(2, "0")}:${String(rest).padStart(2, "0")}`;
31341
+ }
31342
+ /**
31343
+ * Index of the mask character covering `day` at `hour`.
31344
+ *
31345
+ * **Layout: day-major, Monday first** — `day * 24 + hour`.
31346
+ *
31347
+ * This is an ASSUMPTION, and it is recorded as one because the fleet
31348
+ * cannot currently confirm it: every `valueTable` on every Reolink
31349
+ * measured on 2026-09-22 is uniform (all `1` or all `0`), and a uniform
31350
+ * mask reads identically under either layout. To settle it, set a single
31351
+ * hour on one day from the Reolink app and re-read `getRecordSchedule`.
31352
+ * Until then, a NON-uniform mask is reported as windows under this
31353
+ * layout and the day labels may be transposed; a uniform one is exact.
31354
+ */
31355
+ function weeklyMaskIndex(day, hour) {
31356
+ return day * 24 + hour;
31357
+ }
31358
+ /**
31359
+ * True when every slot of the mask carries the same value — the case in
31360
+ * which {@link weeklyMaskIndex}'s layout assumption cannot be wrong.
31361
+ */
31362
+ function weeklyMaskIsUniform(mask) {
31363
+ if (mask.length === 0) return true;
31364
+ const first = mask[0];
31365
+ for (const ch of mask) if (ch !== first) return false;
31366
+ return true;
31367
+ }
31368
+ /**
31369
+ * Expand one trigger's weekly hour mask into windows, merging adjacent
31370
+ * set hours into one window per run so a full day is ONE window rather
31371
+ * than twenty-four.
31372
+ *
31373
+ * A mask of the wrong length yields no windows: a truncated table is not
31374
+ * a schedule of fewer days, it is an answer we did not understand.
31375
+ */
31376
+ function weeklyMaskToWindows(mask, trigger) {
31377
+ if (mask.length !== 168) return [];
31378
+ const out = [];
31379
+ for (let day = 0; day < 7; day += 1) {
31380
+ let runStart = null;
31381
+ for (let hour = 0; hour <= 24; hour += 1) {
31382
+ const set = hour < 24 && mask[weeklyMaskIndex(day, hour)] === "1";
31383
+ if (set && runStart === null) runStart = hour;
31384
+ else if (!set && runStart !== null) {
31385
+ out.push({
31386
+ trigger,
31387
+ day,
31388
+ startMinute: runStart * 60,
31389
+ endMinute: hour * 60
31390
+ });
31391
+ runStart = null;
31392
+ }
31393
+ }
31394
+ }
31395
+ return out;
31396
+ }
31397
+ /**
31398
+ * Collapse this trigger's windows back into a weekly hour mask.
31399
+ *
31400
+ * Windows for other triggers are ignored — the mask is per trigger. A
31401
+ * window that is not hour-aligned is REFUSED upstream by
31402
+ * {@link describeOnboardRefusal}; this function rounds nothing, it
31403
+ * simply sets every hour the window fully or partly covers, so a caller
31404
+ * that skipped the refusal cannot silently lose coverage.
31405
+ */
31406
+ function windowsToWeeklyMask(windows, trigger) {
31407
+ const slots = new Array(168).fill("0");
31408
+ for (const window of windows) {
31409
+ if (window.trigger !== trigger) continue;
31410
+ if (window.day < 0 || window.day >= 7) continue;
31411
+ const firstHour = Math.floor(window.startMinute / 60);
31412
+ const lastHour = Math.ceil(window.endMinute / 60);
31413
+ for (let hour = firstHour; hour < lastHour && hour < 24; hour += 1) slots[weeklyMaskIndex(window.day, hour)] = "1";
31414
+ }
31415
+ return slots.join("");
31416
+ }
31417
+ /**
31418
+ * Parse a Hikvision `<TimeOfDay>` into minutes since midnight.
31419
+ *
31420
+ * The firmware is not self-consistent and both spellings are real, on
31421
+ * the same camera in the same block: a start time reads `00:00:00` and
31422
+ * the matching end time reads `24:00`. Seconds are accepted and
31423
+ * discarded — the cap's resolution is minutes — and `24:00` maps to
31424
+ * {@link MINUTES_PER_DAY}, not to 0.
31425
+ *
31426
+ * Returns null for anything else, which a caller reports as a window it
31427
+ * could not read rather than as midnight.
31428
+ */
31429
+ function timeOfDayToMinutes(value) {
31430
+ const match = /^(\d{1,2}):(\d{2})(?::(\d{2}))?$/.exec(value.trim());
31431
+ if (!match) return null;
31432
+ const hour = Number(match[1]);
31433
+ const minute = Number(match[2]);
31434
+ if (!Number.isInteger(hour) || !Number.isInteger(minute)) return null;
31435
+ if (minute > 59) return null;
31436
+ const total = hour * 60 + minute;
31437
+ if (total > 1440) return null;
31438
+ return total;
31439
+ }
31440
+ /**
31441
+ * Render minutes back as a Hikvision `TimeOfDay`.
31442
+ *
31443
+ * Emits the camera's own two spellings: `24:00` for end-of-day, because
31444
+ * that is what the firmware writes and `24:00:00` is not observed, and
31445
+ * `HH:MM:SS` otherwise.
31446
+ */
31447
+ function minutesToTimeOfDay(minute) {
31448
+ if (minute >= 1440) return "24:00";
31449
+ const hour = Math.floor(minute / 60);
31450
+ const rest = minute % 60;
31451
+ return `${String(hour).padStart(2, "0")}:${String(rest).padStart(2, "0")}:00`;
31452
+ }
31453
+ /** `'Monday'` → 0. Case-insensitive. Null for anything unrecognised. */
31454
+ function dayOfWeekToIndex(value) {
31455
+ const needle = value.trim().toLowerCase();
31456
+ const index = DAY_NAMES.findIndex((name) => name.toLowerCase() === needle);
31457
+ return index >= 0 ? index : null;
31458
+ }
31459
+ /**
31460
+ * Which fields of a patch the camera did NOT take verbatim.
31461
+ *
31462
+ * Measured on a Hikvision I91DN (1436, 2026-09-22): a `PUT` of
31463
+ * `PreRecordTimeSeconds: 8` answered `200`, `statusCode 1`, `OK` — and stored
31464
+ * **5**. Neither the asked value nor the previous one. The camera declares no
31465
+ * allowed set for that field, so there is nothing to refuse against before the
31466
+ * wire: `/capabilities` returns a plain value where a constrained field would
31467
+ * carry an `opt=` list.
31468
+ *
31469
+ * So the only honest moment is after the read-back, and re-reading alone is
31470
+ * not enough — it makes the difference VISIBLE while leaving it unexplained.
31471
+ * A write that reports success for a value the camera never took is the same
31472
+ * silent substitution D599 removed from the clip path, wearing a different hat.
31473
+ *
31474
+ * Compares only the fields the patch actually named: a field nobody asked
31475
+ * about cannot have been clamped, and a read-back that could not answer it is
31476
+ * `stored: null` rather than a claim.
31477
+ */
31478
+ function describeOnboardClamp(patch, landed) {
31479
+ const out = [];
31480
+ for (const [field, asked] of Object.entries(patch)) {
31481
+ if (asked === void 0) continue;
31482
+ if (typeof asked !== "number" && typeof asked !== "boolean" && typeof asked !== "string") continue;
31483
+ const raw = landed === null ? void 0 : landed[field];
31484
+ const stored = typeof raw === "number" || typeof raw === "boolean" || typeof raw === "string" ? raw : null;
31485
+ if (stored !== asked) out.push({
31486
+ field,
31487
+ asked,
31488
+ stored
31489
+ });
31490
+ }
31491
+ return out;
31492
+ }
31493
+ //#endregion
30626
31494
  //#region src/capabilities/device-status.cap.ts
30627
31495
  /**
30628
31496
  * Generic device-level status snapshot. Auto-registered by `BaseDevice`
@@ -41528,6 +42396,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
41528
42396
  pressureSensor: pressureSensorCapability,
41529
42397
  privacyMask: privacyMaskCapability,
41530
42398
  ptzAutotrack: ptzAutotrackCapability,
42399
+ recordingOnboard: recordingOnboardCapability,
41531
42400
  recordingSignal: recordingSignalCapability,
41532
42401
  sceneMonitor: sceneMonitorCapability,
41533
42402
  scriptRunner: scriptRunnerCapability,
@@ -45976,6 +46845,7 @@ var CAP_NAMES_WITH_STATUS = [
45976
46845
  "ptz",
45977
46846
  "ptz-autotrack",
45978
46847
  "recording",
46848
+ "recording-onboard",
45979
46849
  "recording-signal",
45980
46850
  "scene-monitor",
45981
46851
  "script-runner",
@@ -46039,6 +46909,7 @@ var CAPABILITY_NAMES = {
46039
46909
  dayNight: "day-night",
46040
46910
  decoder: "decoder",
46041
46911
  detectionPipeline: "detection-pipeline",
46912
+ deviceAdminLink: "device-admin-link",
46042
46913
  deviceAdoption: "device-adoption",
46043
46914
  deviceDiscovery: "device-discovery",
46044
46915
  deviceExport: "device-export",
@@ -46113,6 +46984,7 @@ var CAPABILITY_NAMES = {
46113
46984
  reboot: "reboot",
46114
46985
  recording: "recording",
46115
46986
  recordingExport: "recording-export",
46987
+ recordingOnboard: "recording-onboard",
46116
46988
  recordingSignal: "recording-signal",
46117
46989
  sceneMonitor: "scene-monitor",
46118
46990
  scriptRunner: "script-runner",
@@ -46332,6 +47204,10 @@ var CAPABILITY_ROUTER_KEYS = [
46332
47204
  key: "detectionPipeline",
46333
47205
  name: "detection-pipeline"
46334
47206
  },
47207
+ {
47208
+ key: "deviceAdminLink",
47209
+ name: "device-admin-link"
47210
+ },
46335
47211
  {
46336
47212
  key: "deviceAdoption",
46337
47213
  name: "device-adoption"
@@ -46628,6 +47504,10 @@ var CAPABILITY_ROUTER_KEYS = [
46628
47504
  key: "recordingExport",
46629
47505
  name: "recording-export"
46630
47506
  },
47507
+ {
47508
+ key: "recordingOnboard",
47509
+ name: "recording-onboard"
47510
+ },
46631
47511
  {
46632
47512
  key: "recordingSignal",
46633
47513
  name: "recording-signal"
@@ -46843,6 +47723,7 @@ var ALL_CAPABILITY_DEFINITIONS = [
46843
47723
  dayNightCapability,
46844
47724
  decoderCapability,
46845
47725
  detectionPipelineCapability,
47726
+ deviceAdminLinkCapability,
46846
47727
  deviceAdoptionCapability,
46847
47728
  deviceDiscoveryCapability,
46848
47729
  deviceExportCapability,
@@ -46917,6 +47798,7 @@ var ALL_CAPABILITY_DEFINITIONS = [
46917
47798
  rebootCapability,
46918
47799
  recordingCapability,
46919
47800
  recordingExportCapability,
47801
+ recordingOnboardCapability,
46920
47802
  recordingSignalCapability,
46921
47803
  sceneMonitorCapability,
46922
47804
  scriptRunnerCapability,
@@ -48263,6 +49145,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
48263
49145
  addonId: null,
48264
49146
  access: "view"
48265
49147
  },
49148
+ "deviceAdminLink.getAdminLink": {
49149
+ capName: "device-admin-link",
49150
+ capScope: "device",
49151
+ addonId: null,
49152
+ access: "view"
49153
+ },
48266
49154
  "deviceAdoption.adopt": {
48267
49155
  capName: "device-adoption",
48268
49156
  capScope: "system",
@@ -52301,6 +53189,24 @@ var METHOD_ACCESS_MAP = Object.freeze({
52301
53189
  addonId: null,
52302
53190
  access: "view"
52303
53191
  },
53192
+ "recordingOnboard.getOptions": {
53193
+ capName: "recording-onboard",
53194
+ capScope: "device",
53195
+ addonId: null,
53196
+ access: "view"
53197
+ },
53198
+ "recordingOnboard.getStatus": {
53199
+ capName: "recording-onboard",
53200
+ capScope: "device",
53201
+ addonId: null,
53202
+ access: "view"
53203
+ },
53204
+ "recordingOnboard.setSettings": {
53205
+ capName: "recording-onboard",
53206
+ capScope: "device",
53207
+ addonId: null,
53208
+ access: "create"
53209
+ },
52304
53210
  "recordingSignal.getStatus": {
52305
53211
  capName: "recording-signal",
52306
53212
  capScope: "device",
@@ -53998,6 +54904,7 @@ var KNOWN_CAP_NAMES = [
53998
54904
  "day-night",
53999
54905
  "decoder",
54000
54906
  "detection-pipeline",
54907
+ "device-admin-link",
54001
54908
  "device-adoption",
54002
54909
  "device-discovery",
54003
54910
  "device-export",
@@ -54072,6 +54979,7 @@ var KNOWN_CAP_NAMES = [
54072
54979
  "reboot",
54073
54980
  "recording",
54074
54981
  "recording-export",
54982
+ "recording-onboard",
54075
54983
  "recording-signal",
54076
54984
  "scene-monitor",
54077
54985
  "script-runner",
@@ -54140,6 +55048,7 @@ var DEVICE_CAP_NAMES = [
54140
55048
  "cover",
54141
55049
  "day-night",
54142
55050
  "detection-pipeline",
55051
+ "device-admin-link",
54143
55052
  "device-discovery",
54144
55053
  "device-ops",
54145
55054
  "device-status",
@@ -54178,6 +55087,7 @@ var DEVICE_CAP_NAMES = [
54178
55087
  "ptz",
54179
55088
  "ptz-autotrack",
54180
55089
  "reboot",
55090
+ "recording-onboard",
54181
55091
  "recording-signal",
54182
55092
  "scene-monitor",
54183
55093
  "script-runner",
@@ -54514,6 +55424,11 @@ var METHOD_DEVICE_SELECTORS = Object.freeze({
54514
55424
  form: "single",
54515
55425
  optional: true
54516
55426
  }],
55427
+ "deviceAdminLink.getAdminLink": [{
55428
+ name: "deviceId",
55429
+ form: "single",
55430
+ optional: false
55431
+ }],
54517
55432
  "deviceAdoption.release": [{
54518
55433
  name: "camDeviceId",
54519
55434
  form: "single",
@@ -55899,6 +56814,16 @@ var METHOD_DEVICE_SELECTORS = Object.freeze({
55899
56814
  form: "single",
55900
56815
  optional: true
55901
56816
  }],
56817
+ "recordingOnboard.getOptions": [{
56818
+ name: "deviceId",
56819
+ form: "single",
56820
+ optional: false
56821
+ }],
56822
+ "recordingOnboard.setSettings": [{
56823
+ name: "deviceId",
56824
+ form: "single",
56825
+ optional: false
56826
+ }],
55902
56827
  "recordingSignal.getStatus": [{
55903
56828
  name: "deviceId",
55904
56829
  form: "single",
@@ -56450,7 +57375,7 @@ function getCapsByProviderKind(kind) {
56450
57375
  //#region src/generated/runtime-state-durability.ts
56451
57376
  /**
56452
57377
  * Per-cap runtime-state policy, projected from every `*.cap.ts` that declares
56453
- * `runtimeState`. 68 caps: 35 `restored`, 33 `session`.
57378
+ * `runtimeState`. 69 caps: 36 `restored`, 33 `session`.
56454
57379
  *
56455
57380
  * A cap absent from this map has no runtime-state slice at all. A cap PRESENT
56456
57381
  * with `durability: 'session'` has one and has decided not to keep it.
@@ -56652,6 +57577,10 @@ var RUNTIME_STATE_POLICY = {
56652
57577
  durability: "session",
56653
57578
  volatileFields: []
56654
57579
  },
57580
+ "recording-onboard": {
57581
+ durability: "restored",
57582
+ volatileFields: ["lastFetchedAt"]
57583
+ },
56655
57584
  "recording-signal": {
56656
57585
  durability: "session",
56657
57586
  volatileFields: []
@@ -56776,6 +57705,7 @@ var RESTORED_CAP_NAMES = [
56776
57705
  "presence",
56777
57706
  "pressure-sensor",
56778
57707
  "privacy-mask",
57708
+ "recording-onboard",
56779
57709
  "smoke",
56780
57710
  "stream-catalog",
56781
57711
  "stream-params",
@@ -61645,6 +62575,7 @@ exports.AddonAutoUpdateSchema = AddonAutoUpdateSchema;
61645
62575
  exports.AddonListItemSchema = AddonListItemSchema;
61646
62576
  exports.AddonPageDeclarationSchema = AddonPageDeclarationSchema;
61647
62577
  exports.AddonPageInfoSchema = AddonPageInfoSchema;
62578
+ exports.AdminLinkTargetEnum = AdminLinkTargetEnum;
61648
62579
  exports.AdoptionAdoptInputSchema = AdoptInputSchema;
61649
62580
  exports.AdoptionAdoptResultSchema = AdoptResultSchema;
61650
62581
  exports.AdoptionCandidateResultSchema = AdoptionCandidateResultSchema;
@@ -61864,6 +62795,8 @@ exports.CreateUserInputSchema = CreateUserInputSchema;
61864
62795
  exports.CustomActionInputSchema = CustomActionInputSchema;
61865
62796
  exports.CustomModelDescriptorSchema = CustomModelDescriptorSchema;
61866
62797
  exports.DATAPLANE_SECRET_HEADER = require_sleep.DATAPLANE_SECRET_HEADER;
62798
+ exports.DAYS_PER_WEEK = DAYS_PER_WEEK;
62799
+ exports.DAY_NAMES = DAY_NAMES;
61867
62800
  exports.DECLARED_DEVICE_SWEEP_LIMIT = DECLARED_DEVICE_SWEEP_LIMIT;
61868
62801
  exports.DECLARED_INTEGRATION_FIXED_KEY = DECLARED_INTEGRATION_FIXED_KEY;
61869
62802
  exports.DEFAULT_ADDON_PLACEMENT = DEFAULT_ADDON_PLACEMENT;
@@ -61923,6 +62856,7 @@ exports.DetailCropConventionSchema = DetailCropConventionSchema;
61923
62856
  exports.DetectionCatalogClassMapSchema = DetectionCatalogClassMapSchema;
61924
62857
  exports.DetectionSourceSchema = DetectionSourceSchema;
61925
62858
  exports.DetectionSourcesSchema = DetectionSourcesSchema;
62859
+ exports.DeviceAdminLinkSchema = DeviceAdminLinkSchema;
61926
62860
  exports.DeviceCodeSeveritySchema = DeviceCodeSeveritySchema;
61927
62861
  exports.DeviceConfig = DeviceConfig;
61928
62862
  exports.DeviceDiscoveryStatusSchema = DeviceDiscoveryStatusSchema;
@@ -62042,6 +62976,7 @@ exports.HAP_AUDIO_VBV_KBITS = HAP_AUDIO_VBV_KBITS;
62042
62976
  exports.HAP_KEYFRAME_INTERVAL_SEC = HAP_KEYFRAME_INTERVAL_SEC;
62043
62977
  exports.HF_BASE_URL = HF_BASE_URL;
62044
62978
  exports.HF_REPO = HF_REPO;
62979
+ exports.HOURS_PER_DAY = HOURS_PER_DAY;
62045
62980
  exports.HWACCEL_OPTIONS = HWACCEL_OPTIONS;
62046
62981
  exports.HealthStatusSchema = HealthStatusSchema;
62047
62982
  exports.HfModelResolutionSchema = HfModelResolutionSchema;
@@ -62161,6 +63096,7 @@ exports.MEDIA_OWNER_TYPES = MEDIA_OWNER_TYPES;
62161
63096
  exports.MEDIA_PRESENCE_OWNER_KINDS = MEDIA_PRESENCE_OWNER_KINDS;
62162
63097
  exports.METHOD_ACCESS_MAP = METHOD_ACCESS_MAP;
62163
63098
  exports.METHOD_DEVICE_SELECTORS = METHOD_DEVICE_SELECTORS;
63099
+ exports.MINUTES_PER_DAY = MINUTES_PER_DAY;
62164
63100
  exports.MODEL_FORMATS = MODEL_FORMATS;
62165
63101
  exports.MODEL_PROVIDER_IDS = MODEL_PROVIDER_IDS;
62166
63102
  exports.MOTION_CLOSE_AFTER_MS = MOTION_CLOSE_AFTER_MS;
@@ -62363,6 +63299,11 @@ exports.OVERLAY_LAYERS = OVERLAY_LAYERS;
62363
63299
  exports.OauthIntegrationDescriptorSchema = OauthIntegrationDescriptorSchema;
62364
63300
  exports.ObjectEventSchema = ObjectEventSchema;
62365
63301
  exports.OccupancyBurstRefusalSchema = OccupancyBurstRefusalSchema;
63302
+ exports.OnboardFieldSupportSchema = OnboardFieldSupportSchema;
63303
+ exports.OnboardRecordTrackSchema = OnboardRecordTrackSchema;
63304
+ exports.OnboardScheduleSupportSchema = OnboardScheduleSupportSchema;
63305
+ exports.OnboardStorageSchema = OnboardStorageSchema;
63306
+ exports.OnboardStorageVolumeSchema = OnboardStorageVolumeSchema;
62366
63307
  exports.OpsLogDomainSchema = OpsLogDomainSchema;
62367
63308
  exports.OpsLogEntrySchema = OpsLogEntrySchema;
62368
63309
  exports.OpsLogOpSchema = OpsLogOpSchema;
@@ -62464,6 +63405,8 @@ exports.ReadinessRegistry = require_sleep.ReadinessRegistry;
62464
63405
  exports.ReadinessTimeoutError = require_sleep.ReadinessTimeoutError;
62465
63406
  exports.RecentTracksPageSchema = RecentTracksPageSchema;
62466
63407
  exports.RecentTracksQueryInput = RecentTracksQueryInput;
63408
+ exports.RecordTriggerSchema = RecordTriggerSchema;
63409
+ exports.RecordWindowSchema = RecordWindowSchema;
62467
63410
  exports.RecordingAvailabilityForDeviceSchema = RecordingAvailabilityForDeviceSchema;
62468
63411
  exports.RecordingAvailabilitySchema = RecordingAvailabilitySchema;
62469
63412
  exports.RecordingBandAudioSchema = RecordingBandAudioSchema;
@@ -62477,6 +63420,9 @@ exports.RecordingDeviceUsageSchema = RecordingDeviceUsageSchema;
62477
63420
  exports.RecordingLocationUsageSchema = RecordingLocationUsageSchema;
62478
63421
  exports.RecordingManifestSchema = RecordingManifestSchema;
62479
63422
  exports.RecordingObjectTriggerClassSchema = RecordingObjectTriggerClassSchema;
63423
+ exports.RecordingOnboardOptionsSchema = RecordingOnboardOptionsSchema;
63424
+ exports.RecordingOnboardPatchSchema = RecordingOnboardPatchSchema;
63425
+ exports.RecordingOnboardStatusSchema = RecordingOnboardStatusSchema;
62480
63426
  exports.RecordingRangeSchema = RecordingRangeSchema;
62481
63427
  exports.RecordingRebalanceInputSchema = RecordingRebalanceInputSchema;
62482
63428
  exports.RecordingRebalanceMoveSchema = RecordingRebalanceMoveSchema;
@@ -62756,6 +63702,7 @@ exports.VectorUpsertResultSchema = VectorUpsertResultSchema;
62756
63702
  exports.VibrationStatusSchema = VibrationStatusSchema;
62757
63703
  exports.VideoEncodeSchema = VideoEncodeSchema;
62758
63704
  exports.WEBRTC_EGRESS_PROFILE = WEBRTC_EGRESS_PROFILE;
63705
+ exports.WEEKLY_MASK_LENGTH = WEEKLY_MASK_LENGTH;
62759
63706
  exports.WELL_KNOWN_TABS = require_sleep.WELL_KNOWN_TABS;
62760
63707
  exports.WELL_KNOWN_TAB_MAP = require_sleep.WELL_KNOWN_TAB_MAP;
62761
63708
  exports.WaterHeaterStatusSchema = WaterHeaterStatusSchema;
@@ -62830,6 +63777,7 @@ exports.brightnessCapability = brightnessCapability;
62830
63777
  exports.brokerCapability = brokerCapability;
62831
63778
  exports.buildAddonRouteProvider = buildAddonRouteProvider;
62832
63779
  exports.buildAudioArgs = require_canonical_hash.buildAudioArgs;
63780
+ exports.buildDeviceAdminUrl = buildDeviceAdminUrl;
62833
63781
  exports.buildEventKindDescriptor = buildEventKindDescriptor;
62834
63782
  exports.buildFfmpegArgs = require_canonical_hash.buildFfmpegArgs;
62835
63783
  exports.buildInputArgs = require_canonical_hash.buildInputArgs;
@@ -62898,6 +63846,7 @@ exports.customAction = require_sleep.customAction;
62898
63846
  exports.customModelRegistryCapability = customModelRegistryCapability;
62899
63847
  exports.dataStoreProviderCapability = dataStoreProviderCapability;
62900
63848
  exports.dayNightCapability = dayNightCapability;
63849
+ exports.dayOfWeekToIndex = dayOfWeekToIndex;
62901
63850
  exports.declarationOwnerNodeId = declarationOwnerNodeId;
62902
63851
  exports.declareLogChannel = declareLogChannel;
62903
63852
  exports.decodeVectorBase64 = decodeVectorBase64;
@@ -62911,8 +63860,11 @@ exports.deriveDetailCropRect = deriveDetailCropRect;
62911
63860
  exports.deriveRecordingMode = deriveRecordingMode;
62912
63861
  exports.describeCustomActions = require_sleep.describeCustomActions;
62913
63862
  exports.describeModelVariant = describeModelVariant;
63863
+ exports.describeOnboardClamp = describeOnboardClamp;
63864
+ exports.describeOnboardRefusal = describeOnboardRefusal;
62914
63865
  exports.detectAccessRole = detectAccessRole;
62915
63866
  exports.detectionPipelineCapability = detectionPipelineCapability;
63867
+ exports.deviceAdminLinkCapability = deviceAdminLinkCapability;
62916
63868
  exports.deviceAdoptionCapability = deviceAdoptionCapability;
62917
63869
  exports.deviceBackendToFormat = deviceBackendToFormat;
62918
63870
  exports.deviceCustomAction = require_sleep.deviceCustomAction;
@@ -62969,6 +63921,7 @@ exports.foldSnapshotByFunction = foldSnapshotByFunction;
62969
63921
  exports.formatForBackend = formatForBackend;
62970
63922
  exports.formatForRuntime = formatForRuntime;
62971
63923
  exports.formatMediaOwnerKey = formatMediaOwnerKey;
63924
+ exports.formatMinutes = formatMinutes;
62972
63925
  exports.formatParkedFor = formatParkedFor;
62973
63926
  exports.gasCapability = gasCapability;
62974
63927
  exports.gbToBytes = gbToBytes;
@@ -63061,6 +64014,7 @@ exports.method = require_sleep.method;
63061
64014
  exports.methodAccessForHttpMethod = methodAccessForHttpMethod;
63062
64015
  exports.metricsProviderCapability = metricsProviderCapability;
63063
64016
  exports.migrateLegacyDeviceSignalConfig = migrateLegacyDeviceSignalConfig;
64017
+ exports.minutesToTimeOfDay = minutesToTimeOfDay;
63064
64018
  exports.modeMayRead = modeMayRead;
63065
64019
  exports.modeMayWrite = modeMayWrite;
63066
64020
  exports.modelConvertCapability = modelConvertCapability;
@@ -63094,6 +64048,7 @@ exports.optionalMethod = require_sleep.optionalMethod;
63094
64048
  exports.osdCapability = osdCapability;
63095
64049
  exports.osdManagerCapability = osdManagerCapability;
63096
64050
  exports.overlayClusterStepSettings = overlayClusterStepSettings;
64051
+ exports.parseAdminBase = parseAdminBase;
63097
64052
  exports.parseCameraStreamConfig = parseCameraStreamConfig;
63098
64053
  exports.parseExpression = parseExpression;
63099
64054
  exports.parseJsonArray = require_sleep.parseJsonArray;
@@ -63145,6 +64100,7 @@ exports.readinessKey = require_sleep.readinessKey;
63145
64100
  exports.rebootCapability = rebootCapability;
63146
64101
  exports.recordingCapability = recordingCapability;
63147
64102
  exports.recordingExportCapability = recordingExportCapability;
64103
+ exports.recordingOnboardCapability = recordingOnboardCapability;
63148
64104
  exports.recordingSignalCapability = recordingSignalCapability;
63149
64105
  exports.rectsToCells = rectsToCells;
63150
64106
  exports.reducePoints = reducePoints;
@@ -63244,6 +64200,7 @@ exports.taskTargetSchema = taskTargetSchema;
63244
64200
  exports.temperatureSensorCapability = temperatureSensorCapability;
63245
64201
  exports.terminalSessionCapability = terminalSessionCapability;
63246
64202
  exports.textToHtml = textToHtml;
64203
+ exports.timeOfDayToMinutes = timeOfDayToMinutes;
63247
64204
  exports.toDeviceSummary = toDeviceSummary;
63248
64205
  exports.toExpressionValue = toExpressionValue;
63249
64206
  exports.toNodeId = require_sleep.toNodeId;
@@ -63272,6 +64229,10 @@ exports.waterHeaterCapability = waterHeaterCapability;
63272
64229
  exports.weatherCapability = weatherCapability;
63273
64230
  exports.webrtcClientHintsSchema = webrtcClientHintsSchema;
63274
64231
  exports.webrtcSessionCapability = webrtcSessionCapability;
64232
+ exports.weeklyMaskIndex = weeklyMaskIndex;
64233
+ exports.weeklyMaskIsUniform = weeklyMaskIsUniform;
64234
+ exports.weeklyMaskToWindows = weeklyMaskToWindows;
64235
+ exports.windowsToWeeklyMask = windowsToWeeklyMask;
63275
64236
  exports.wiringAddonHealthSchema = wiringAddonHealthSchema;
63276
64237
  exports.wiringHealthSnapshotSchema = wiringHealthSnapshotSchema;
63277
64238
  exports.wiringNodeHealthSchema = wiringNodeHealthSchema;