@camstack/system 1.2.275 → 1.2.277

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  2. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  3. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  4. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  5. package/dist/builtins/alerts/alerts.addon.js +1 -1
  6. package/dist/builtins/alerts/alerts.addon.mjs +1 -1
  7. package/dist/builtins/autotrack/index.js +1 -1
  8. package/dist/builtins/autotrack/index.mjs +1 -1
  9. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +1 -1
  10. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +1 -1
  11. package/dist/builtins/camera-grid/grid-last-frame-store.d.ts +39 -0
  12. package/dist/builtins/camera-grid/index.js +67 -12
  13. package/dist/builtins/camera-grid/index.mjs +67 -12
  14. package/dist/builtins/console-logging/index.js +1 -1
  15. package/dist/builtins/console-logging/index.mjs +1 -1
  16. package/dist/builtins/core-blocks/core-blocks.addon.js +1 -1
  17. package/dist/builtins/core-blocks/core-blocks.addon.mjs +1 -1
  18. package/dist/builtins/device-manager/device-aggregation.d.ts +0 -6
  19. package/dist/builtins/device-manager/device-bindings-store.d.ts +22 -2
  20. package/dist/builtins/device-manager/device-manager.addon.d.ts +4 -0
  21. package/dist/builtins/device-manager/device-manager.addon.js +122 -58
  22. package/dist/builtins/device-manager/device-manager.addon.mjs +122 -59
  23. package/dist/builtins/device-manager/device-meta-types.d.ts +24 -3
  24. package/dist/builtins/device-manager/device-source-activation.d.ts +36 -0
  25. package/dist/builtins/doorbell/virtual-doorbell.addon.js +1 -1
  26. package/dist/builtins/doorbell/virtual-doorbell.addon.mjs +1 -1
  27. package/dist/builtins/hub-forwarder/index.js +1 -1
  28. package/dist/builtins/hub-forwarder/index.mjs +1 -1
  29. package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  30. package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  31. package/dist/builtins/local-auth/local-auth.addon.js +1 -1
  32. package/dist/builtins/local-auth/local-auth.addon.mjs +1 -1
  33. package/dist/builtins/local-network/local-network.addon.js +1 -1
  34. package/dist/builtins/local-network/local-network.addon.mjs +1 -1
  35. package/dist/builtins/loki-logging/index.js +1 -1
  36. package/dist/builtins/loki-logging/index.mjs +1 -1
  37. package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  38. package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  39. package/dist/builtins/platform-probe/index.js +1 -1
  40. package/dist/builtins/platform-probe/index.mjs +1 -1
  41. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  42. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  43. package/dist/builtins/snapshot/index.js +1 -1
  44. package/dist/builtins/snapshot/index.mjs +1 -1
  45. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  46. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  47. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +0 -0
  48. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +0 -0
  49. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  50. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  51. package/dist/builtins/system-config/system-config.addon.js +1 -1
  52. package/dist/builtins/system-config/system-config.addon.mjs +1 -1
  53. package/dist/builtins/winston-logging/index.js +1 -1
  54. package/dist/builtins/winston-logging/index.mjs +1 -1
  55. package/dist/{dist-CYXhwfDf.js → dist-Bu8HN-KS.js} +354 -11
  56. package/dist/{dist-DWSJVcZe.mjs → dist-DOF9wnat.mjs} +349 -12
  57. package/dist/index.d.ts +7 -0
  58. package/dist/index.js +61 -48
  59. package/dist/index.mjs +62 -50
  60. package/dist/kernel/capability-registry.d.ts +28 -8
  61. package/dist/{retired-settings-keys-DEFtUH8o.js → retired-settings-keys-BwE6S2eQ.js} +1 -1
  62. package/dist/{retired-settings-keys-BHGnCLW0.mjs → retired-settings-keys-DXMfts8c.mjs} +1 -1
  63. package/package.json +2 -2
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-CYXhwfDf.js");
6
+ const require_dist = require("../../dist-Bu8HN-KS.js");
7
7
  let node_fs = require("node:fs");
8
8
  node_fs = require_chunk.__toESM(node_fs);
9
9
  let node_child_process = require("node:child_process");
@@ -1,5 +1,5 @@
1
1
  import { o as __toESM } from "../../chunk-CNf5ZN-e.mjs";
2
- import { Gt as scoreRuntimes, Pn as EventCategory, Pt as platformProbeCapability, Sn as emitReadiness, an as errMsg, nt as enumerateInferenceDevices, sn as BaseAddon } from "../../dist-DWSJVcZe.mjs";
2
+ import { Cn as emitReadiness, Fn as EventCategory, Ft as platformProbeCapability, Kt as scoreRuntimes, cn as BaseAddon, nt as enumerateInferenceDevices, on as errMsg } from "../../dist-DOF9wnat.mjs";
3
3
  import * as fs from "node:fs";
4
4
  import { execFile } from "node:child_process";
5
5
  import * as os from "node:os";
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-CYXhwfDf.js");
6
+ const require_dist = require("../../dist-Bu8HN-KS.js");
7
7
  //#region src/builtins/remote-access-orchestrator/enabled-providers-reconcile.ts
8
8
  /**
9
9
  * Reconcile the durable `enabledProviders` set against authoritative
@@ -1,4 +1,4 @@
1
- import { Pn as EventCategory, sn as BaseAddon } from "../../dist-DWSJVcZe.mjs";
1
+ import { Fn as EventCategory, cn as BaseAddon } from "../../dist-DOF9wnat.mjs";
2
2
  //#region src/builtins/remote-access-orchestrator/enabled-providers-reconcile.ts
3
3
  /**
4
4
  * Reconcile the durable `enabledProviders` set against authoritative
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-CYXhwfDf.js");
6
+ const require_dist = require("../../dist-Bu8HN-KS.js");
7
7
  const require_snapshot_courtesy = require("../../snapshot-courtesy-Cqs7GkOV.js");
8
8
  let zod = require("zod");
9
9
  let node_crypto = require("node:crypto");
@@ -1,4 +1,4 @@
1
- import { B as bareAddonId, Dn as nodePin, Jt as snapshotCapability, Pn as EventCategory, V as batteryCapability, Z as deriveBatteryPresence, a as BatteryStatusSchema, an as errMsg, dn as DeviceFeature, en as streamQualityLabel, pn as DeviceType, sn as BaseAddon } from "../../dist-DWSJVcZe.mjs";
1
+ import { B as bareAddonId, Fn as EventCategory, On as nodePin, V as batteryCapability, Yt as snapshotCapability, Z as deriveBatteryPresence, a as BatteryStatusSchema, cn as BaseAddon, fn as DeviceFeature, mn as DeviceType, on as errMsg, tn as streamQualityLabel } from "../../dist-DOF9wnat.mjs";
2
2
  import { i as renderCourtesyOverlayJpeg, n as courtesyCacheKey, r as renderCourtesyJpeg } from "../../snapshot-courtesy-CZPvteq2.mjs";
3
3
  import { z } from "zod";
4
4
  import { randomUUID } from "node:crypto";
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-CYXhwfDf.js");
6
+ const require_dist = require("../../dist-Bu8HN-KS.js");
7
7
  let node_crypto = require("node:crypto");
8
8
  let node_fs_promises = require("node:fs/promises");
9
9
  let node_path = require("node:path");
@@ -1,4 +1,4 @@
1
- import { Qt as storageProviderCapability, ct as filesystemBrowseCapability, sn as BaseAddon } from "../../dist-DWSJVcZe.mjs";
1
+ import { $t as storageProviderCapability, cn as BaseAddon, ct as filesystemBrowseCapability } from "../../dist-DOF9wnat.mjs";
2
2
  import { randomUUID } from "node:crypto";
3
3
  import { mkdir, readdir, realpath, statfs } from "node:fs/promises";
4
4
  import * as path$1 from "node:path";
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-CYXhwfDf.js");
6
+ const require_dist = require("../../dist-Bu8HN-KS.js");
7
7
  const require_hub_cap_forward = require("../../hub-cap-forward-DmHNjbB0.js");
8
8
  let zod = require("zod");
9
9
  let node_crypto = require("node:crypto");
@@ -1,4 +1,4 @@
1
- import { A as StorageLocationModeSchema, Bt as resolveLocationMode, Dt as mayWriteToLocation, Et as mayReadLocation, Kt as settingsStoreCapability, M as StorageMigrationJobSchema, On as parseJsonObject, Pn as EventCategory, W as collectSecretConfigKeys, Xt as storageMigrationCapability, Yt as storageCapability, _ as LegacyStorageLocationDefaultSchema, in as withLocationMode, j as StorageLocationTypeSchema, k as StorageCleanupJobSchema, kt as modeMayWrite, ot as evictionPolicyOfLocation, pt as isLocationEnabled, sn as BaseAddon, ut as gbToBytes, x as REDACTED_SECRET, yt as legacyModeOf } from "../../dist-DWSJVcZe.mjs";
1
+ import { A as StorageLocationModeSchema, Dt as mayWriteToLocation, Et as mayReadLocation, Fn as EventCategory, M as StorageMigrationJobSchema, Vt as resolveLocationMode, W as collectSecretConfigKeys, Xt as storageCapability, Zt as storageMigrationCapability, _ as LegacyStorageLocationDefaultSchema, an as withLocationMode, cn as BaseAddon, j as StorageLocationTypeSchema, k as StorageCleanupJobSchema, kn as parseJsonObject, kt as modeMayWrite, ot as evictionPolicyOfLocation, pt as isLocationEnabled, qt as settingsStoreCapability, ut as gbToBytes, x as REDACTED_SECRET, yt as legacyModeOf } from "../../dist-DOF9wnat.mjs";
2
2
  import { t as HUB_CAP_FWD_ACTION } from "../../hub-cap-forward-BdT320dq.mjs";
3
3
  import { z } from "zod";
4
4
  import { randomUUID } from "node:crypto";
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-CYXhwfDf.js");
6
+ const require_dist = require("../../dist-Bu8HN-KS.js");
7
7
  //#region src/builtins/system-config/system-config.addon.ts
8
8
  /**
9
9
  * Built-in `system-config` addon — Phase 4 of the settings redesign.
@@ -1,4 +1,4 @@
1
- import { an as errMsg, sn as BaseAddon, wn as hydrateSchema } from "../../dist-DWSJVcZe.mjs";
1
+ import { Tn as hydrateSchema, cn as BaseAddon, on as errMsg } from "../../dist-DOF9wnat.mjs";
2
2
  //#region src/builtins/system-config/system-config.addon.ts
3
3
  /**
4
4
  * Built-in `system-config` addon — Phase 4 of the settings redesign.
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-CYXhwfDf.js");
6
+ const require_dist = require("../../dist-Bu8HN-KS.js");
7
7
  const require_formatter = require("../../formatter-DqAKDlvN.js");
8
8
  let node_path = require("node:path");
9
9
  node_path = require_chunk.__toESM(node_path);
@@ -1,4 +1,4 @@
1
- import { Ct as logDestinationCapability, sn as BaseAddon } from "../../dist-DWSJVcZe.mjs";
1
+ import { Ct as logDestinationCapability, cn as BaseAddon } from "../../dist-DOF9wnat.mjs";
2
2
  import { t as formatLogLine } from "../../formatter-B7qW8bPJ.mjs";
3
3
  import * as path$1 from "node:path";
4
4
  import path from "node:path";
@@ -691,7 +691,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
691
691
  return EventCategory;
692
692
  }({});
693
693
  //#endregion
694
- //#region ../types/dist/sleep-CiR4z7r9.mjs
694
+ //#region ../types/dist/sleep-7AN_Txmu.mjs
695
695
  /**
696
696
  * The audio chunk plane's byte format, and the ONE expansion from a coded
697
697
  * window to float samples (D455).
@@ -2724,6 +2724,7 @@ function toNodeId(idOrRunnerId) {
2724
2724
  function resolveCapMount(def) {
2725
2725
  if (def.mount) return def.mount;
2726
2726
  if (def.deviceNative === true) return { kind: "device-native" };
2727
+ if (def.scope === "device" && def.kind === "wrapper") return { kind: "device-scoped" };
2727
2728
  if (def.mode === "collection") return { kind: "collection" };
2728
2729
  return { kind: "singleton" };
2729
2730
  }
@@ -10380,6 +10381,33 @@ function objectInputDeclaresAddonId(schema) {
10380
10381
  const shape = direct !== void 0 && direct !== null ? direct : resolveDefShape(schema._def?.shape);
10381
10382
  return shape !== void 0 && shape !== null && typeof shape === "object" && Object.prototype.hasOwnProperty.call(shape, "addonId");
10382
10383
  }
10384
+ /**
10385
+ * True when an OBJECT input schema declares a top-level, REQUIRED, numeric
10386
+ * `deviceId` — i.e. the method names exactly one device on every call.
10387
+ *
10388
+ * This is the question the per-device dispatcher asks at runtime
10389
+ * (`requireDeviceScoped`: `typeof input.deviceId !== 'number'` → BAD_REQUEST),
10390
+ * asked once at build time instead. A `device-scoped` cap's method that cannot
10391
+ * answer it has no device to resolve for and therefore resolves through the
10392
+ * cap's SYSTEM provider (`cap-router-builder.ts`) — the same destination
10393
+ * `systemOnly` names explicitly. Without this, flipping the mount would 400
10394
+ * every batch (`deviceIds`), fleet-wide (`z.void()`) and job-keyed method on
10395
+ * the eight device-scoped wrapper caps.
10396
+ *
10397
+ * Structural, never a name heuristic over source text: the field must resolve
10398
+ * to `z.number()` and must NOT be wrapped in `optional` / `nullable` /
10399
+ * `default` — an absent value is exactly the input the dispatcher rejects.
10400
+ */
10401
+ function objectInputDeclaresRequiredDeviceId(schema) {
10402
+ if (schema === null || typeof schema !== "object" && typeof schema !== "function") return false;
10403
+ const direct = schema.shape;
10404
+ const shape = direct !== void 0 && direct !== null ? direct : resolveDefShape(schema._def?.shape);
10405
+ if (shape === void 0 || shape === null || typeof shape !== "object") return false;
10406
+ const field = shape["deviceId"];
10407
+ if (field === void 0 || field === null) return false;
10408
+ const def = field._def;
10409
+ return field.constructor?.name === "ZodNumber" || def?.type === "number" || def?.typeName === "ZodNumber";
10410
+ }
10383
10411
  /** `_def.shape` may be a thunk (Zod defers object-shape evaluation) or a plain record. */
10384
10412
  function resolveDefShape(defShape) {
10385
10413
  return typeof defShape === "function" ? defShape() : defShape;
@@ -13210,14 +13238,30 @@ var deviceManagerCapability = {
13210
13238
  */
13211
13239
  getAllBindings: method(zod.z.object({}), zod.z.array(DeviceBindingsForDeviceSchema)),
13212
13240
  /**
13213
- * Activate (or deactivate) a wrapper addon for a (device, cap) pair.
13214
- * Persists the binding via ctx.settings. active=false clears the wrapper
13215
- * (falls back to native if registered).
13241
+ * Activate (or deactivate) a wrapper addon — or ONE of its sources — for a
13242
+ * (device, cap) pair.
13243
+ *
13244
+ * Persists the binding via ctx.settings; `active: false` on a SINGLETON cap
13245
+ * clears the wrapper (falling back to native if one is registered). On a
13246
+ * COLLECTION cap it adds to the per-device DENY set instead, and the
13247
+ * wrapper binding is left exactly as it was — a cap with several sources
13248
+ * has no "which one" for `getBindings` to answer (D556).
13249
+ *
13250
+ * `sourceId` is what makes the switch match its label. One addon can serve
13251
+ * several of a device's sources (`addon-provider-reolink` answers a hub
13252
+ * child with `native:reolink:onboard` AND `native:reolink:hub`), so a
13253
+ * toggle keyed by addon would turn off both while saying it turned off one
13254
+ * — the D62 defect with the polarity reversed (D557). Naming the source
13255
+ * denies exactly that source. OMITTING it keeps the cap-wide meaning
13256
+ * D556 shipped: every source this addon serves for this device, which is
13257
+ * also how a deny entry persisted before the re-key is still read.
13216
13258
  */
13217
13259
  setWrapperActive: method(zod.z.object({
13218
13260
  deviceId: zod.z.number(),
13219
13261
  capName: zod.z.string(),
13220
13262
  wrapperAddonId: zod.z.string(),
13263
+ /** The `ClipSource.source` id to toggle. Absent = all of the addon's. */
13264
+ sourceId: zod.z.string().optional(),
13221
13265
  active: zod.z.boolean()
13222
13266
  }), zod.z.void(), {
13223
13267
  kind: "mutation",
@@ -25975,41 +26019,323 @@ var ClipSchema = zod.z.object({
25975
26019
  holes: zod.z.array(zod.z.object({
25976
26020
  startMs: zod.z.number(),
25977
26021
  endMs: zod.z.number()
25978
- })).optional()
26022
+ })).optional(),
26023
+ /**
26024
+ * A URL that MAY produce this clip's still, asked only for rows actually on
26025
+ * screen. The opposite of {@link ClipSchema.thumbnail}: that one is VOUCHED
26026
+ * (a JPEG is already on disk), this one is an offer. The route answers 200
26027
+ * with the image, or 204 with `x-camstack-reason` when it could not mint one
26028
+ * — a surface latches that refusal to the instant rather than retrying.
26029
+ *
26030
+ * Never both: a clip with a vouched `thumbnail` needs no mint.
26031
+ */
26032
+ thumbnailMint: zod.z.string().optional(),
26033
+ /**
26034
+ * Why no still will be produced for this clip RIGHT NOW — set when the
26035
+ * provider already knows, so the surface draws the glyph and the reason
26036
+ * instead of firing a mint that cannot succeed.
26037
+ *
26038
+ * `sleeping` — a standalone battery camera; a read would be a wake (D549 4).
26039
+ * `camera-refused` — the camera answered the CoverPreview with a refusal.
26040
+ * `no-keyframe` — the window holds no decodable I-frame (an event that sits
26041
+ * inside no file is the measured case).
26042
+ * `unsupported` — this source cannot mint stills at all.
26043
+ */
26044
+ thumbnailUnavailable: zod.z.object({ reason: zod.z.enum([
26045
+ "sleeping",
26046
+ "camera-refused",
26047
+ "no-keyframe",
26048
+ "unsupported"
26049
+ ]) }).optional(),
26050
+ /**
26051
+ * When the catalog this row came from was last CONFIRMED against the device.
26052
+ * Absent means "this row was read live". A persisted catalog served while a
26053
+ * camera sleeps carries the age it really has — a cached list is never drawn
26054
+ * as current (D549 13).
26055
+ */
26056
+ catalogAsOf: zod.z.number().optional(),
26057
+ /**
26058
+ * The camera's OWN type strings for this clip, all of them, unmapped
26059
+ * (`md`, `people`, `dog_cat`, `sched`, …). Kept beside {@link labels}
26060
+ * because a firmware inventing a type must not vanish: the mapping into our
26061
+ * filter vocabulary is lossy on purpose and this is the lossless copy
26062
+ * (D549 20).
26063
+ */
26064
+ nativeTypes: zod.z.array(zod.z.string()).optional(),
26065
+ /**
26066
+ * What the subject DID — `crossline`, `intrude`, `loitering`. A behaviour
26067
+ * travels BESIDE a class, never instead of one, and the class filter ignores
26068
+ * it: "a person crossed a line" is still a person (D549 20).
26069
+ */
26070
+ behaviours: zod.z.array(zod.z.string()).optional(),
26071
+ /**
26072
+ * The same recording as two files — the sub twin (what the row and its
26073
+ * thumbnail are) and its main twin, matched at listing time so a quality
26074
+ * change never re-searches the camera (D549 15). `getClipPlayback`'s
26075
+ * `profile` picks between them: `low | mid` → sub, `high` → main.
26076
+ */
26077
+ streams: zod.z.object({
26078
+ sub: zod.z.object({
26079
+ id: zod.z.string(),
26080
+ bytes: zod.z.number().optional()
26081
+ }).optional(),
26082
+ main: zod.z.object({
26083
+ id: zod.z.string(),
26084
+ bytes: zod.z.number().optional()
26085
+ }).optional()
26086
+ }).optional(),
26087
+ /** The camera says it holds a sub-stream copy of this recording. */
26088
+ supportSub: zod.z.boolean().optional(),
26089
+ /**
26090
+ * Whether this row has bytes behind it. ABSENT means yes — every clip that
26091
+ * IS a file is playable, and only a source that lists EVENTS can produce a
26092
+ * row with nothing to play (the measured case: 1 of 29 hub events on 3628
26093
+ * fell inside no file). Such a row is shown, never dropped and never offered
26094
+ * as playable-then-failing (D549 19).
26095
+ */
26096
+ playable: zod.z.boolean().optional(),
26097
+ /** Why {@link playable} is false, verbatim (`no-file-for-window`). */
26098
+ unplayableReason: zod.z.string().optional()
25979
26099
  });
25980
26100
  var ClipPlaybackSchema = zod.z.object({
25981
- /** HLS master URL through the hub data-plane (Range + token in path). */
26101
+ /**
26102
+ * A media URL through the hub data-plane. {@link ClipPlaybackSchema.format}
26103
+ * says what kind — an HLS master playlist for a recording-derived clip, a
26104
+ * progressive MP4 for a native file the vendor addon muxed and serves with
26105
+ * `Range`. The URL is NOT a credential: both planes are registered
26106
+ * `access: 'authenticated'` and the hub's `/addon/<id>/<prefix>` proxy takes
26107
+ * the session cookie, so nothing is appended to it (D549 22).
26108
+ */
25982
26109
  playbackUrl: zod.z.string(),
26110
+ /**
26111
+ * How to play {@link playbackUrl}. Absent means `hls` — the shape every
26112
+ * existing consumer already assumes. A player that branches on this is the
26113
+ * one change a native clip needs; a player that ignores it will hand an MP4
26114
+ * to hls.js and fail parsing it as a manifest.
26115
+ */
26116
+ format: zod.z.enum(["hls", "mp4"]).optional(),
26117
+ /**
26118
+ * Which twin was actually served. A clip that holds only one stream answers
26119
+ * with the one it has, and the surface SAYS so — a missing main twin is
26120
+ * never served silently as if it were the asked-for quality (D549 15).
26121
+ */
26122
+ served: CamProfileSchema.optional(),
25983
26123
  /** Optional LAN/remote alternates for the same clip. */
25984
26124
  playbackEndpoints: zod.z.array(zod.z.string()).optional(),
25985
26125
  token: zod.z.string().optional()
25986
26126
  });
26127
+ /**
26128
+ * Why a source cannot answer right now — per SOURCE, never fleet-wide.
26129
+ *
26130
+ * `ok` is the only state whose clip list may be read as complete. The other
26131
+ * three exist because an empty list from a sleeping camera reads as "this
26132
+ * camera has no recordings", which is the defect this whole line of work is
26133
+ * about: a battery camera nobody woke (`sleeping`), a camera that could not be
26134
+ * reached at all (`unreachable`, also what a provider that THREW reports), a
26135
+ * camera whose SD card is not mounted (`no-storage`, measured on 640 —
26136
+ * `HddInfo mount 0`, honestly nothing to list rather than "no clips"), and a
26137
+ * camera whose OWN index disagrees with its OWN calendar (`index-empty`,
26138
+ * measured on 618: the calendar marks 3–20 September, days 6–20 list zero
26139
+ * files on both streams and both filters, with 177 GB free). That last one is
26140
+ * a defect ON THE CAMERA, and the only honest thing a provider can do is say
26141
+ * which days it asked for and got nothing — "no clips" would be a lie about a
26142
+ * card that is full of them.
26143
+ */
26144
+ var ClipSourceAvailabilitySchema = zod.z.object({
26145
+ state: zod.z.enum([
26146
+ "ok",
26147
+ "sleeping",
26148
+ "unreachable",
26149
+ "no-storage",
26150
+ "index-empty"
26151
+ ]),
26152
+ /** Free text, shown verbatim. Names the camera's own refusal when there is one. */
26153
+ reason: zod.z.string().optional(),
26154
+ /** When this source's catalog was last CONFIRMED. A cached list is never
26155
+ * drawn as current: the surface shows the age whenever it is older than the
26156
+ * refresh interval. */
26157
+ catalogAsOf: zod.z.number().optional()
26158
+ });
26159
+ /**
26160
+ * One SOURCE of clips for a camera — a row of the picker, and the namespace
26161
+ * every clip id from it is prefixed with (`analytics`,
26162
+ * `native:reolink:onboard`, `hksv`, …).
26163
+ *
26164
+ * A provider lists the sources IT serves for that device, and answers for each
26165
+ * of them whether it can answer at all. A provider with nothing to offer on a
26166
+ * camera returns `[]` — it is not that camera's business.
26167
+ */
26168
+ var ClipSourceSchema = zod.z.object({
26169
+ /** The value this source stamps on {@link ClipSchema.source}, and the prefix
26170
+ * of every clip id it mints. `getClipPlayback` routes on it. */
26171
+ source: zod.z.string(),
26172
+ /** Operator-facing name of the source ("CamStack recordings", "SD card"). */
26173
+ label: zod.z.string(),
26174
+ /**
26175
+ * The addon that SERVES this row.
26176
+ *
26177
+ * A surface cannot otherwise resolve a source to who answers it, and the
26178
+ * alternative — a `native:reolink:* → provider-reolink` table inside the
26179
+ * widget — is a second authority on provider identity living in the one
26180
+ * package with no business knowing it, wrong the day a third source appears
26181
+ * (D557). One addon may serve SEVERAL sources: `addon-provider-reolink`
26182
+ * answers a hub child with both `native:reolink:onboard` and
26183
+ * `native:reolink:hub`, which is why the per-device switch is keyed by
26184
+ * SOURCE and not by this (D555).
26185
+ *
26186
+ * Optional for version skew only. The collection dispatcher stamps it from
26187
+ * the registry, so a row that travelled through the fan-out carries the
26188
+ * authoritative id whatever the provider filled in.
26189
+ */
26190
+ addonId: zod.z.string().optional(),
26191
+ /**
26192
+ * Which API this source resolved to FOR THIS CAMERA, when it has a choice.
26193
+ *
26194
+ * A source may cover one store through more than one surface — the Reolink
26195
+ * provider reads a hub child through the parent's event log and a standalone
26196
+ * through its own file list, because that is what each camera answers. The
26197
+ * CHOICE is the provider's, made from what the camera is, and is never a row
26198
+ * the operator has to understand; but it is REPORTED, because a source that
26199
+ * silently reads a different API on two cameras and then behaves differently
26200
+ * is the thing nobody can debug later. Absent when the source has only one
26201
+ * way to read its store.
26202
+ */
26203
+ via: zod.z.string().optional(),
26204
+ availability: ClipSourceAvailabilitySchema,
26205
+ /**
26206
+ * The operator switched this source OFF for this camera.
26207
+ *
26208
+ * Deliberately NOT a member of {@link ClipSourceAvailabilitySchema}'s
26209
+ * vocabulary. That enum models what the source CAN do — a sleeping camera, an
26210
+ * unmounted card, an index that disagrees with its own calendar — and a
26211
+ * switched-off source could answer perfectly well; the operator decided it
26212
+ * should not. Folding the choice in is how `disabled` and `broken` stop being
26213
+ * distinguishable, which is the D62 rule this repo has already paid for twice:
26214
+ * an off switch is REPORTED off (`CameraStatus.switchedOff`, the same word),
26215
+ * and disabled must never look like broken. It is also what lets every
26216
+ * exhaustive consumer of the availability enum keep compiling.
26217
+ *
26218
+ * A switched-off source contributes NO clips (`listClips` never calls it) and
26219
+ * its row carries no `catalogAsOf`: nothing confirms a catalog it is not
26220
+ * allowed to serve, and a frozen age that can only grow draws a stalling
26221
+ * source rather than an off switch.
26222
+ *
26223
+ * The row survives BECAUSE it is the control the operator switches the source
26224
+ * back on from — D554 decision 4's rule ("a source that cannot answer
26225
+ * produces a ROW, not an absence") applied to the one case D556 carved out of
26226
+ * it, and D557's own kept property ("a source is never hidden, only its
26227
+ * rows"). Absent means on.
26228
+ *
26229
+ * A provider never sets this — like {@link ClipSourceSchema.addonId} it is
26230
+ * stamped by the collection dispatcher, which holds the registry's projection
26231
+ * of the persisted authority (D556) and is the only place that knows it.
26232
+ */
26233
+ switchedOff: zod.z.boolean().optional()
26234
+ });
25987
26235
  var videoclipsCapability = {
25988
26236
  name: "videoclips",
25989
26237
  scope: "device",
25990
- mode: "singleton",
26238
+ mode: "collection",
25991
26239
  kind: "wrapper",
25992
26240
  defaultActive: true,
25993
26241
  /** A clip is a window over a camera's footage — the cap is meaningless on a
25994
26242
  * sensor, a button or an event emitter, and the `defaultActive` auto-bind
25995
26243
  * reads this to decide which devices it may claim. */
25996
26244
  deviceTypes: [DeviceType.Camera],
26245
+ /**
26246
+ * The Clips section of a camera's device details is FRAMEWORK-DERIVED (D14):
26247
+ * the aggregator turns this declaration into the `type:'widget'` section and
26248
+ * `DeviceDetail.tsx` is never edited. `videoclips` is the first WRAPPER cap
26249
+ * to declare one — every previous `host/` widget cap is `deviceNative` — so
26250
+ * `device-config-widget-wrapped-binding.spec.ts` pins that a `kind:'wrapped'`
26251
+ * binding entry derives the same section a native one does.
26252
+ *
26253
+ * **It is a SECTION of the Recording tab, at the end of it — not a tab of
26254
+ * its own.** It shipped as a `clips` top-tab and the operator rejected the
26255
+ * placement: *"utilizzerei la stessa tab recordings, lì abbiamo già tutto il
26256
+ * necessario, una nuova sezione alla fine per le clips"*. The Recording tab
26257
+ * already holds the recorder's panel, the schedule bands and the unified
26258
+ * retention policy; footage the camera itself holds is the same question,
26259
+ * asked of a different store. `order: 100` puts it after all of them with
26260
+ * room left in front. The `clips` entry in `WELL_KNOWN_TABS` went with it —
26261
+ * a well-known id nobody declares is an invitation to mint the tab again.
26262
+ *
26263
+ * `topTab` stays: the browser owns a pane (a day's tiles, a source list and
26264
+ * a player) and the Config tab's inner bar has no room for one. The widget
26265
+ * itself is `host/clips-browser` in ui-library's `HOST_WIDGETS`, and because
26266
+ * the admin Recordings page renders every `location:'top-tab'` +
26267
+ * `tab:'recording'` section behind its camera picker
26268
+ * (`CameraRecordingSettingsSection`), this declaration lands the section on
26269
+ * BOTH surfaces with no second wiring.
26270
+ */
26271
+ deviceConfig: { ui: {
26272
+ kind: "widget",
26273
+ widgetId: "host/clips-browser",
26274
+ tab: "recording",
26275
+ topTab: true,
26276
+ label: "Clips",
26277
+ order: 100
26278
+ } },
25997
26279
  methods: {
25998
26280
  listClips: method(zod.z.object({
25999
26281
  deviceId: zod.z.number(),
26000
26282
  since: zod.z.number(),
26001
26283
  until: zod.z.number(),
26002
- limit: zod.z.number().int().positive().optional()
26284
+ limit: zod.z.number().int().positive().optional(),
26285
+ /**
26286
+ * WHICH provider to ask — the `addonId` a {@link ClipSourceSchema} row
26287
+ * carries, never a source id and never a list.
26288
+ *
26289
+ * Absent means the device's BOUND provider, which is CamStack on every
26290
+ * camera today because that is what `deviceManager.getBindings`
26291
+ * answers with. A provider the device is not bound to is refused by
26292
+ * name rather than answered by another one (D552's
26293
+ * `rejectUnresolvedAddonPin` rule).
26294
+ *
26295
+ * It replaced `sources?: string[]`, a VIEW filter over source ids that
26296
+ * assumed the answer was a fan-out over everything a camera has. The
26297
+ * operator settled otherwise on 2026-09-20 — *"il get videoclips
26298
+ * prendere un provider opzionale, di default va su camstack"*,
26299
+ * *"l'utilizzatore è uno solo"* — so the list is asked of one provider
26300
+ * at a time and there is nothing to filter out of it.
26301
+ */
26302
+ provider: zod.z.string().optional()
26003
26303
  }), zod.z.array(ClipSchema).readonly(), {
26004
26304
  kind: "query",
26005
- auth: "admin"
26305
+ auth: "protected"
26306
+ }),
26307
+ /**
26308
+ * The sources this camera has, WITH the reason any of them cannot answer.
26309
+ *
26310
+ * Asked separately from `listClips` because an empty clip list is
26311
+ * ambiguous and this is the only place the ambiguity is resolved: every
26312
+ * bound provider contributes its own rows, and a provider that could not
26313
+ * be reached at all still produces one row saying so. A surface that draws
26314
+ * "no clips" without reading this is drawing a guess.
26315
+ */
26316
+ listSources: method(zod.z.object({ deviceId: zod.z.number() }), zod.z.array(ClipSourceSchema).readonly(), {
26317
+ kind: "query",
26318
+ auth: "protected"
26006
26319
  }),
26007
26320
  getClipPlayback: method(zod.z.object({
26008
26321
  deviceId: zod.z.number(),
26009
- clipId: zod.z.string()
26322
+ clipId: zod.z.string(),
26323
+ /**
26324
+ * Which twin to serve, on the ONE quality scale the system already has
26325
+ * (`CamProfileSchema`). `low | mid` → the sub file, `high` → the main
26326
+ * twin; both ids are already on the row so this never re-searches the
26327
+ * camera. Absent means the provider's own default (the sub file, which
26328
+ * every source is measured to hold).
26329
+ *
26330
+ * `auto` is deliberately NOT accepted here: a stored file has no
26331
+ * broker session, so the adaptive tier cannot be resolved for it. The
26332
+ * viewer resolves `auto` to a profile the same way live does, before
26333
+ * it calls (D549 15).
26334
+ */
26335
+ profile: CamProfileSchema.optional()
26010
26336
  }), ClipPlaybackSchema, {
26011
26337
  kind: "query",
26012
- auth: "admin"
26338
+ auth: "protected"
26013
26339
  })
26014
26340
  }
26015
26341
  };
@@ -45989,6 +46315,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
45989
46315
  addonId: null,
45990
46316
  access: "view"
45991
46317
  },
46318
+ "videoclips.listSources": {
46319
+ capName: "videoclips",
46320
+ capScope: "device",
46321
+ addonId: null,
46322
+ access: "view"
46323
+ },
45992
46324
  "viewerUi.getStaticDir": {
45993
46325
  capName: "viewer-ui",
45994
46326
  capScope: "system",
@@ -47997,6 +48329,11 @@ Object.freeze({
47997
48329
  form: "single",
47998
48330
  optional: false
47999
48331
  }],
48332
+ "videoclips.listSources": [{
48333
+ name: "deviceId",
48334
+ form: "single",
48335
+ optional: false
48336
+ }],
48000
48337
  "waterHeater.setAway": [{
48001
48338
  name: "deviceId",
48002
48339
  form: "single",
@@ -49779,6 +50116,12 @@ Object.defineProperty(exports, "objectInputDeclaresAddonId", {
49779
50116
  return objectInputDeclaresAddonId;
49780
50117
  }
49781
50118
  });
50119
+ Object.defineProperty(exports, "objectInputDeclaresRequiredDeviceId", {
50120
+ enumerable: true,
50121
+ get: function() {
50122
+ return objectInputDeclaresRequiredDeviceId;
50123
+ }
50124
+ });
49782
50125
  Object.defineProperty(exports, "parseJsonObject", {
49783
50126
  enumerable: true,
49784
50127
  get: function() {