@camstack/addon-model-studio 1.1.161 → 1.1.163

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 (19) hide show
  1. package/dist/MotionZonesSettings-y2kbEGdP.mjs +310 -0
  2. package/dist/{PrivacyMaskSettings-CkwY1O7I.mjs → PrivacyMaskSettings-4p2buawr.mjs} +26 -26
  3. package/dist/{SceneMonitorEditor-CiIMWyUb.mjs → SceneMonitorEditor-BXP48zw9.mjs} +295 -295
  4. package/dist/_stub.js +57 -57
  5. package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_model_studio_page-B9uopzdn.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_model_studio_page-BbxlJyIJ.mjs} +3 -3
  6. package/dist/_virtual_mf___mfe_internal__addon_model_studio_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-D4KJgqEs.mjs +26 -0
  7. package/dist/{hostInit-DTduRWpw.mjs → hostInit-CqiwgcWw.mjs} +2 -2
  8. package/dist/model-studio.addon.js +242 -5
  9. package/dist/model-studio.addon.mjs +242 -5
  10. package/dist/{player-overlays-DdDSY-tk.mjs → player-overlays-H3SbZZiB.mjs} +1 -1
  11. package/dist/remoteEntry.js +1 -1
  12. package/dist/{cap-error-DHkvpvpc.mjs → responsive-6UoyAOwH.mjs} +8 -8
  13. package/dist/{scene-monitor-copy-BKbPs3_1.mjs → scene-monitor-copy-BklNacbF.mjs} +1 -1
  14. package/dist/{square-BWowq2yB.mjs → square-iuWo9Mh3.mjs} +1 -1
  15. package/dist/{trash-2-B6STAYa8.mjs → trash-2-MSpEpKeZ.mjs} +1 -1
  16. package/dist/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_model_studio_page__remoteEntry_js-DrSBhU3P.mjs → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_model_studio_page__remoteEntry_js-CI7738Pr.mjs} +1 -1
  17. package/package.json +1 -1
  18. package/dist/MotionZonesSettings-DIQ8WQL_.mjs +0 -310
  19. package/dist/_virtual_mf___mfe_internal__addon_model_studio_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-DtTWe8FC.mjs +0 -26
@@ -5884,7 +5884,7 @@ var ZodIssueCode = {
5884
5884
  var ZodFirstPartyTypeKind;
5885
5885
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5886
5886
  //#endregion
5887
- //#region ../types/dist/sleep-CaB_hL5g.mjs
5887
+ //#region ../types/dist/sleep-BVhJDJka.mjs
5888
5888
  /**
5889
5889
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5890
5890
  * window to float samples (D455).
@@ -7514,6 +7514,18 @@ function systemMethod(input, output, options) {
7514
7514
  systemOnly: true
7515
7515
  };
7516
7516
  }
7517
+ /**
7518
+ * A method a SOURCE of a collection cap may legitimately not serve — OPTIONAL
7519
+ * on `InferProvider`. The `providerOptional: true` literal is what
7520
+ * `InferProvider` keys on; see {@link CapabilityMethodSchema.providerOptional}
7521
+ * for when this is the honest answer and when it is a soft stub.
7522
+ */
7523
+ function optionalMethod(input, output, options) {
7524
+ return {
7525
+ ...method(input, output, options),
7526
+ providerOptional: true
7527
+ };
7528
+ }
7517
7529
  var StaticDirOutputSchema$1 = object({ staticDir: string() });
7518
7530
  var VersionOutputSchema$1 = object({ version: string() });
7519
7531
  method(_void(), StaticDirOutputSchema$1, { auth: "admin" }), method(_void(), VersionOutputSchema$1, { auth: "admin" });
@@ -24820,6 +24832,59 @@ var ClipPlaybackSchema = object({
24820
24832
  * which days it asked for and got nothing — "no clips" would be a lie about a
24821
24833
  * card that is full of them.
24822
24834
  */
24835
+ /**
24836
+ * The operator's authorisation to WAKE a sleeping camera for one clip read.
24837
+ *
24838
+ * ONE value, absent by default, and it is a `force`-shaped operator signal in
24839
+ * exactly the sense `snapshot-wake-gate.ts` uses the word: *"`snapshot.getSnapshot`'s
24840
+ * `force` flag, and nothing else… a background caller must never set it…
24841
+ * Stale but honest beats woken"*. A scheduler, a retry, a reconcile and a
24842
+ * prefetch never set it; a surface sets it only behind the same confirm the
24843
+ * "Wake and refresh" gesture uses, and it is refused below 15 % battery
24844
+ * exactly as that gesture is.
24845
+ *
24846
+ * The gate is decided BEFORE `getApi()`, because on UDP the login IS the wake
24847
+ * (D549) — a read that opened a session and then checked would have woken the
24848
+ * camera to find out it was not allowed to.
24849
+ *
24850
+ * **One authorised yes is one wake.** `next-natural` — take the clip the next
24851
+ * time the camera is awake for its own reasons — is deliberately not a member:
24852
+ * it was proposed, it is free on the battery, and the operator declined it on
24853
+ * 2026-09-20 (*"Quando un export viene richiesto si sveglia la camera."*,
24854
+ * D558 "Considered and not taken").
24855
+ */
24856
+ var ClipWakeSchema = _enum(["authorised"]);
24857
+ /**
24858
+ * A clip's finished bytes, inline — the twin of `recordingExport.readExportBytes`.
24859
+ *
24860
+ * `bytes` is the DECODED length, so nobody infers it from the base64 length,
24861
+ * and `served` says which twin the caller actually got.
24862
+ */
24863
+ var ClipBytesSchema = object({
24864
+ base64: string(),
24865
+ contentType: string(),
24866
+ /** Suggested filename, extension included. */
24867
+ name: string(),
24868
+ bytes: number().int().nonnegative(),
24869
+ /**
24870
+ * Which twin was actually served — the same contract
24871
+ * {@link ClipPlaybackSchema.served} carries, and REQUIRED here because the
24872
+ * export record persists it: a row read a week later must say the same thing
24873
+ * the panel said at the moment of the tap. A missing main twin is never
24874
+ * served silently as if it were the asked-for quality (D549 15).
24875
+ */
24876
+ served: CamProfileSchema,
24877
+ /**
24878
+ * The DECODED duration of the delivered file, when the fetch measured one.
24879
+ *
24880
+ * A clip fetch verifies its own completion against the catalog row and
24881
+ * retries a materially short pass (D568); this is that measurement, carried
24882
+ * so a consumer can say the same thing rather than re-deriving it. Absent
24883
+ * when the producer did not measure — never zero, which would say the file
24884
+ * is empty.
24885
+ */
24886
+ durationMs: number().positive().optional()
24887
+ });
24823
24888
  var ClipSourceAvailabilitySchema = object({
24824
24889
  state: _enum([
24825
24890
  "ok",
@@ -24935,6 +25000,33 @@ DeviceType.Camera, method(object({
24935
25000
  }), ClipPlaybackSchema, {
24936
25001
  kind: "query",
24937
25002
  auth: "protected"
25003
+ }), optionalMethod(object({
25004
+ deviceId: number(),
25005
+ clipId: string().min(1),
25006
+ /**
25007
+ * Which twin to fetch, on the mapping D549 15 already fixed:
25008
+ * `low | mid` → the sub file, `high` → the main twin. `auto` is not
25009
+ * accepted here for the same reason it is not accepted by
25010
+ * `getClipPlayback` — a stored file has no broker session, so the
25011
+ * adaptive tier cannot be resolved for it.
25012
+ */
25013
+ profile: CamProfileSchema.optional(),
25014
+ /**
25015
+ * The CALLER's byte bound, so an over-size clip is refused before it is
25016
+ * read and encoded rather than after. Capped by
25017
+ * {@link VIDEOCLIPS_MAX_READ_BYTES} whatever is passed; absent means
25018
+ * that ceiling.
25019
+ */
25020
+ maxBytes: number().int().positive().optional(),
25021
+ /**
25022
+ * The operator's authorisation to wake a sleeping camera for this
25023
+ * read. Absent — the default — means a sleeping standalone battery
25024
+ * camera is REFUSED by name, before any session is opened.
25025
+ */
25026
+ wake: ClipWakeSchema.optional()
25027
+ }), ClipBytesSchema, {
25028
+ kind: "query",
25029
+ auth: "protected"
24938
25030
  });
24939
25031
  /**
24940
25032
  * Optional client-side hints sent at session creation to help the provider
@@ -30867,13 +30959,101 @@ var ExportStateSchema = _enum([
30867
30959
  "expired",
30868
30960
  "deleted"
30869
30961
  ]);
30870
- /** One export job / history row. */
30962
+ /**
30963
+ * WHAT an export is — the authority, as opposed to the four top-level fields
30964
+ * the Library sorts and labels on (D558 § 2.2).
30965
+ *
30966
+ * Read it through {@link exportSubjectOf}, never off the record directly: the
30967
+ * field is optional for the history rows written before it existed, and that
30968
+ * absence has exactly one interpreter.
30969
+ */
30970
+ var ExportSubjectSchema = discriminatedUnion("kind", [object({
30971
+ kind: literal("footage"),
30972
+ deviceId: number(),
30973
+ profiles: array(string()).min(1),
30974
+ fromMs: number(),
30975
+ toMs: number()
30976
+ }), object({
30977
+ kind: literal("clip"),
30978
+ deviceId: number(),
30979
+ provider: string().min(1),
30980
+ source: string().min(1),
30981
+ sourceLabel: string().min(1),
30982
+ clipId: string().min(1),
30983
+ /**
30984
+ * WHERE IN THE CATALOG to confirm this clip — the day window the surface was
30985
+ * already listing when the operator picked the segment.
30986
+ *
30987
+ * It is **not** a time range control and it never becomes one: the record's
30988
+ * `fromMs`/`toMs` come from the catalog ROW and from nothing a caller
30989
+ * supplied (D558 § 5.4.3), and a window that does not contain the clip is a
30990
+ * `catalog-miss`, not a silently wider search. It exists because
30991
+ * `videoclips.listClips` takes `since`/`until` and has no by-handle twin:
30992
+ * the catalog check D558 asks for is literally that call, and a call needs a
30993
+ * window. The surface has one — `ClipsBrowser`'s `dayWindow`, one local
30994
+ * wall-clock day, which is also the only width measured to be cheap (one
30995
+ * day on 592 lists 171 clips in 712 ms, a busy day 546 in 2.0 s; twenty days
30996
+ * of one child's events took 3.6–5.4 s).
30997
+ */
30998
+ catalogWindow: object({
30999
+ sinceMs: number(),
31000
+ untilMs: number()
31001
+ }),
31002
+ profile: _enum([
31003
+ "high",
31004
+ "mid",
31005
+ "low"
31006
+ ]),
31007
+ /**
31008
+ * The operator's authorisation to wake a sleeping camera for this export.
31009
+ * ONE definition, in the cap that owns the clip read ({@link ClipWakeSchema}),
31010
+ * because the gate that honours it is the clip provider's sleep gate — a
31011
+ * second enum here would be a second contract. Absent by default; never
31012
+ * settable by a scheduler or a retry.
31013
+ *
31014
+ * **One authorised yes is ONE wake.** A failed clip export is retried only by
31015
+ * an operator act that asks again; a queued job that outlived its wake fails
31016
+ * with a reason rather than waking on its turn; and this subject carries
31017
+ * exactly one profile precisely so one tap is never two fetches (D558 § 5.2).
31018
+ */
31019
+ wake: ClipWakeSchema.optional()
31020
+ })]);
31021
+ /**
31022
+ * One export job / history row.
31023
+ *
31024
+ * **`subject` is the AUTHORITY on what was exported. `deviceId`, `profile`,
31025
+ * `fromMs` and `toMs` are its PROJECTION** — kept top-level because the whole
31026
+ * Library sorts and labels on them (`library-items.ts` orders an export by
31027
+ * `fromMs`; `export-format.ts` draws `rangeLabel` from the pair), and a row
31028
+ * that did not fill them would sort under the epoch and render a blank range.
31029
+ * Write to the subject and read from the projection and the two will disagree;
31030
+ * the projection is derived at creation and never edited afterwards.
31031
+ *
31032
+ * And they mean DIFFERENT FACTS for the two kinds, which is the part a reader
31033
+ * who knows only the recording export will get wrong:
31034
+ *
31035
+ * | field | `kind:'footage'` | `kind:'clip'` |
31036
+ * | --- | --- | --- |
31037
+ * | `fromMs`/`toMs` | the stretch the operator ASKED for | the camera's own boundaries, always `clip.timeRange`, never anything a caller supplied |
31038
+ * | `profile` | the stream rendered | the twin actually SERVED (`subject.profile` is the one asked for) |
31039
+ *
31040
+ * Same type, different fact — the shape this repo keeps getting wrong (D385's
31041
+ * two authorities, D224's second copy).
31042
+ */
30871
31043
  var ExportRecordSchema = object({
30872
31044
  id: string(),
30873
31045
  deviceId: number(),
30874
31046
  profile: string(),
30875
31047
  fromMs: number(),
30876
31048
  toMs: number(),
31049
+ /**
31050
+ * What this export IS. Optional ONLY for the rows written before D558: the
31051
+ * store parses every row through this schema on every read, so a required
31052
+ * field would make the export AUDIT — which is the whole reason rows survive
31053
+ * file deletion — unreadable in one release. Absence means `footage`, and
31054
+ * {@link exportSubjectOf} is the one place that says so.
31055
+ */
31056
+ subject: ExportSubjectSchema.optional(),
30877
31057
  options: ExportOptionsSchema,
30878
31058
  state: ExportStateSchema,
30879
31059
  /** 0–100 while rendering; null otherwise. */
@@ -30890,6 +31070,18 @@ var ExportRecordSchema = object({
30890
31070
  /** Failure reason when state is 'failed'; null otherwise. */
30891
31071
  error: string().nullable()
30892
31072
  });
31073
+ _enum([
31074
+ "catalog-miss",
31075
+ "catalog-unreachable",
31076
+ "no-file-for-window",
31077
+ "clip-in-progress",
31078
+ "unsupported-option",
31079
+ "sleeping",
31080
+ "camera-refused",
31081
+ "fetch-failed",
31082
+ "too-large-to-transfer",
31083
+ "wake-expired"
31084
+ ]);
30893
31085
  /** Candidate download URLs (LAN first, then operator extra hosts). */
30894
31086
  var ExportDownloadSchema = object({
30895
31087
  url: string(),
@@ -30908,16 +31100,50 @@ var ExportBytesSchema = object({
30908
31100
  name: string(),
30909
31101
  bytes: number().int().nonnegative()
30910
31102
  });
31103
+ /** Canonical `profiles[]`, falling back to the legacy singular `profile`. */
31104
+ function resolveExportProfiles(input) {
31105
+ if (input.profiles !== void 0 && input.profiles.length > 0) return [...input.profiles];
31106
+ if (typeof input.profile === "string" && input.profile.length > 0) return [input.profile];
31107
+ return [];
31108
+ }
30911
31109
  method(object({
30912
31110
  deviceId: number(),
30913
31111
  /** @deprecated Prefer `profiles`. Kept so timelapse/notifiers keep working. */
30914
31112
  profile: string().optional(),
30915
31113
  profiles: array(string()).min(1).optional(),
30916
- fromMs: number(),
30917
- toMs: number(),
31114
+ /** Footage only — a clip's boundaries are the camera's. */
31115
+ fromMs: number().optional(),
31116
+ toMs: number().optional(),
31117
+ /** What to export. Absent means the legacy flat footage request. */
31118
+ subject: ExportSubjectSchema.optional(),
30918
31119
  options: ExportOptionsSchema
30919
31120
  }).superRefine((v, ctx) => {
30920
- if ((v.profiles !== void 0 && v.profiles.length > 0 ? v.profiles : v.profile !== void 0 ? [v.profile] : []).length < 1) ctx.addIssue({
31121
+ if (v.subject?.kind === "clip") {
31122
+ if (v.subject.deviceId !== v.deviceId) ctx.addIssue({
31123
+ code: ZodIssueCode.custom,
31124
+ message: `subject.deviceId (${v.subject.deviceId}) must equal deviceId (${v.deviceId}) — the top-level field is what per-device scope enforcement reads`,
31125
+ path: ["subject", "deviceId"]
31126
+ });
31127
+ if (v.fromMs !== void 0 || v.toMs !== void 0) ctx.addIssue({
31128
+ code: ZodIssueCode.custom,
31129
+ message: "a clip export asks for no time range: the camera chose the boundaries and they are read from the catalog row",
31130
+ path: ["fromMs"]
31131
+ });
31132
+ return;
31133
+ }
31134
+ if (v.subject?.kind === "footage" && v.subject.deviceId !== v.deviceId) ctx.addIssue({
31135
+ code: ZodIssueCode.custom,
31136
+ message: `subject.deviceId (${v.subject.deviceId}) must equal deviceId (${v.deviceId})`,
31137
+ path: ["subject", "deviceId"]
31138
+ });
31139
+ const fromMs = v.subject?.kind === "footage" ? v.subject.fromMs : v.fromMs;
31140
+ const toMs = v.subject?.kind === "footage" ? v.subject.toMs : v.toMs;
31141
+ if (typeof fromMs !== "number" || typeof toMs !== "number") ctx.addIssue({
31142
+ code: ZodIssueCode.custom,
31143
+ message: "a footage export needs fromMs and toMs",
31144
+ path: ["fromMs"]
31145
+ });
31146
+ if ((v.subject?.kind === "footage" ? [...v.subject.profiles] : resolveExportProfiles(v)).length < 1) ctx.addIssue({
30921
31147
  code: ZodIssueCode.custom,
30922
31148
  message: "pass profiles[] (min 1) or legacy profile",
30923
31149
  path: ["profiles"]
@@ -38917,6 +39143,12 @@ Object.freeze({
38917
39143
  addonId: null,
38918
39144
  access: "view"
38919
39145
  },
39146
+ "videoclips.readClipBytes": {
39147
+ capName: "videoclips",
39148
+ capScope: "device",
39149
+ addonId: null,
39150
+ access: "view"
39151
+ },
38920
39152
  "viewerUi.getStaticDir": {
38921
39153
  capName: "viewer-ui",
38922
39154
  capScope: "system",
@@ -40935,6 +41167,11 @@ Object.freeze({
40935
41167
  form: "single",
40936
41168
  optional: false
40937
41169
  }],
41170
+ "videoclips.readClipBytes": [{
41171
+ name: "deviceId",
41172
+ form: "single",
41173
+ optional: false
41174
+ }],
40938
41175
  "waterHeater.setAway": [{
40939
41176
  name: "deviceId",
40940
41177
  form: "single",
@@ -5863,7 +5863,7 @@ var ZodIssueCode = {
5863
5863
  var ZodFirstPartyTypeKind;
5864
5864
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5865
5865
  //#endregion
5866
- //#region ../types/dist/sleep-CaB_hL5g.mjs
5866
+ //#region ../types/dist/sleep-BVhJDJka.mjs
5867
5867
  /**
5868
5868
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5869
5869
  * window to float samples (D455).
@@ -7493,6 +7493,18 @@ function systemMethod(input, output, options) {
7493
7493
  systemOnly: true
7494
7494
  };
7495
7495
  }
7496
+ /**
7497
+ * A method a SOURCE of a collection cap may legitimately not serve — OPTIONAL
7498
+ * on `InferProvider`. The `providerOptional: true` literal is what
7499
+ * `InferProvider` keys on; see {@link CapabilityMethodSchema.providerOptional}
7500
+ * for when this is the honest answer and when it is a soft stub.
7501
+ */
7502
+ function optionalMethod(input, output, options) {
7503
+ return {
7504
+ ...method(input, output, options),
7505
+ providerOptional: true
7506
+ };
7507
+ }
7496
7508
  var StaticDirOutputSchema$1 = object({ staticDir: string() });
7497
7509
  var VersionOutputSchema$1 = object({ version: string() });
7498
7510
  method(_void(), StaticDirOutputSchema$1, { auth: "admin" }), method(_void(), VersionOutputSchema$1, { auth: "admin" });
@@ -24799,6 +24811,59 @@ var ClipPlaybackSchema = object({
24799
24811
  * which days it asked for and got nothing — "no clips" would be a lie about a
24800
24812
  * card that is full of them.
24801
24813
  */
24814
+ /**
24815
+ * The operator's authorisation to WAKE a sleeping camera for one clip read.
24816
+ *
24817
+ * ONE value, absent by default, and it is a `force`-shaped operator signal in
24818
+ * exactly the sense `snapshot-wake-gate.ts` uses the word: *"`snapshot.getSnapshot`'s
24819
+ * `force` flag, and nothing else… a background caller must never set it…
24820
+ * Stale but honest beats woken"*. A scheduler, a retry, a reconcile and a
24821
+ * prefetch never set it; a surface sets it only behind the same confirm the
24822
+ * "Wake and refresh" gesture uses, and it is refused below 15 % battery
24823
+ * exactly as that gesture is.
24824
+ *
24825
+ * The gate is decided BEFORE `getApi()`, because on UDP the login IS the wake
24826
+ * (D549) — a read that opened a session and then checked would have woken the
24827
+ * camera to find out it was not allowed to.
24828
+ *
24829
+ * **One authorised yes is one wake.** `next-natural` — take the clip the next
24830
+ * time the camera is awake for its own reasons — is deliberately not a member:
24831
+ * it was proposed, it is free on the battery, and the operator declined it on
24832
+ * 2026-09-20 (*"Quando un export viene richiesto si sveglia la camera."*,
24833
+ * D558 "Considered and not taken").
24834
+ */
24835
+ var ClipWakeSchema = _enum(["authorised"]);
24836
+ /**
24837
+ * A clip's finished bytes, inline — the twin of `recordingExport.readExportBytes`.
24838
+ *
24839
+ * `bytes` is the DECODED length, so nobody infers it from the base64 length,
24840
+ * and `served` says which twin the caller actually got.
24841
+ */
24842
+ var ClipBytesSchema = object({
24843
+ base64: string(),
24844
+ contentType: string(),
24845
+ /** Suggested filename, extension included. */
24846
+ name: string(),
24847
+ bytes: number().int().nonnegative(),
24848
+ /**
24849
+ * Which twin was actually served — the same contract
24850
+ * {@link ClipPlaybackSchema.served} carries, and REQUIRED here because the
24851
+ * export record persists it: a row read a week later must say the same thing
24852
+ * the panel said at the moment of the tap. A missing main twin is never
24853
+ * served silently as if it were the asked-for quality (D549 15).
24854
+ */
24855
+ served: CamProfileSchema,
24856
+ /**
24857
+ * The DECODED duration of the delivered file, when the fetch measured one.
24858
+ *
24859
+ * A clip fetch verifies its own completion against the catalog row and
24860
+ * retries a materially short pass (D568); this is that measurement, carried
24861
+ * so a consumer can say the same thing rather than re-deriving it. Absent
24862
+ * when the producer did not measure — never zero, which would say the file
24863
+ * is empty.
24864
+ */
24865
+ durationMs: number().positive().optional()
24866
+ });
24802
24867
  var ClipSourceAvailabilitySchema = object({
24803
24868
  state: _enum([
24804
24869
  "ok",
@@ -24914,6 +24979,33 @@ DeviceType.Camera, method(object({
24914
24979
  }), ClipPlaybackSchema, {
24915
24980
  kind: "query",
24916
24981
  auth: "protected"
24982
+ }), optionalMethod(object({
24983
+ deviceId: number(),
24984
+ clipId: string().min(1),
24985
+ /**
24986
+ * Which twin to fetch, on the mapping D549 15 already fixed:
24987
+ * `low | mid` → the sub file, `high` → the main twin. `auto` is not
24988
+ * accepted here for the same reason it is not accepted by
24989
+ * `getClipPlayback` — a stored file has no broker session, so the
24990
+ * adaptive tier cannot be resolved for it.
24991
+ */
24992
+ profile: CamProfileSchema.optional(),
24993
+ /**
24994
+ * The CALLER's byte bound, so an over-size clip is refused before it is
24995
+ * read and encoded rather than after. Capped by
24996
+ * {@link VIDEOCLIPS_MAX_READ_BYTES} whatever is passed; absent means
24997
+ * that ceiling.
24998
+ */
24999
+ maxBytes: number().int().positive().optional(),
25000
+ /**
25001
+ * The operator's authorisation to wake a sleeping camera for this
25002
+ * read. Absent — the default — means a sleeping standalone battery
25003
+ * camera is REFUSED by name, before any session is opened.
25004
+ */
25005
+ wake: ClipWakeSchema.optional()
25006
+ }), ClipBytesSchema, {
25007
+ kind: "query",
25008
+ auth: "protected"
24917
25009
  });
24918
25010
  /**
24919
25011
  * Optional client-side hints sent at session creation to help the provider
@@ -30846,13 +30938,101 @@ var ExportStateSchema = _enum([
30846
30938
  "expired",
30847
30939
  "deleted"
30848
30940
  ]);
30849
- /** One export job / history row. */
30941
+ /**
30942
+ * WHAT an export is — the authority, as opposed to the four top-level fields
30943
+ * the Library sorts and labels on (D558 § 2.2).
30944
+ *
30945
+ * Read it through {@link exportSubjectOf}, never off the record directly: the
30946
+ * field is optional for the history rows written before it existed, and that
30947
+ * absence has exactly one interpreter.
30948
+ */
30949
+ var ExportSubjectSchema = discriminatedUnion("kind", [object({
30950
+ kind: literal("footage"),
30951
+ deviceId: number(),
30952
+ profiles: array(string()).min(1),
30953
+ fromMs: number(),
30954
+ toMs: number()
30955
+ }), object({
30956
+ kind: literal("clip"),
30957
+ deviceId: number(),
30958
+ provider: string().min(1),
30959
+ source: string().min(1),
30960
+ sourceLabel: string().min(1),
30961
+ clipId: string().min(1),
30962
+ /**
30963
+ * WHERE IN THE CATALOG to confirm this clip — the day window the surface was
30964
+ * already listing when the operator picked the segment.
30965
+ *
30966
+ * It is **not** a time range control and it never becomes one: the record's
30967
+ * `fromMs`/`toMs` come from the catalog ROW and from nothing a caller
30968
+ * supplied (D558 § 5.4.3), and a window that does not contain the clip is a
30969
+ * `catalog-miss`, not a silently wider search. It exists because
30970
+ * `videoclips.listClips` takes `since`/`until` and has no by-handle twin:
30971
+ * the catalog check D558 asks for is literally that call, and a call needs a
30972
+ * window. The surface has one — `ClipsBrowser`'s `dayWindow`, one local
30973
+ * wall-clock day, which is also the only width measured to be cheap (one
30974
+ * day on 592 lists 171 clips in 712 ms, a busy day 546 in 2.0 s; twenty days
30975
+ * of one child's events took 3.6–5.4 s).
30976
+ */
30977
+ catalogWindow: object({
30978
+ sinceMs: number(),
30979
+ untilMs: number()
30980
+ }),
30981
+ profile: _enum([
30982
+ "high",
30983
+ "mid",
30984
+ "low"
30985
+ ]),
30986
+ /**
30987
+ * The operator's authorisation to wake a sleeping camera for this export.
30988
+ * ONE definition, in the cap that owns the clip read ({@link ClipWakeSchema}),
30989
+ * because the gate that honours it is the clip provider's sleep gate — a
30990
+ * second enum here would be a second contract. Absent by default; never
30991
+ * settable by a scheduler or a retry.
30992
+ *
30993
+ * **One authorised yes is ONE wake.** A failed clip export is retried only by
30994
+ * an operator act that asks again; a queued job that outlived its wake fails
30995
+ * with a reason rather than waking on its turn; and this subject carries
30996
+ * exactly one profile precisely so one tap is never two fetches (D558 § 5.2).
30997
+ */
30998
+ wake: ClipWakeSchema.optional()
30999
+ })]);
31000
+ /**
31001
+ * One export job / history row.
31002
+ *
31003
+ * **`subject` is the AUTHORITY on what was exported. `deviceId`, `profile`,
31004
+ * `fromMs` and `toMs` are its PROJECTION** — kept top-level because the whole
31005
+ * Library sorts and labels on them (`library-items.ts` orders an export by
31006
+ * `fromMs`; `export-format.ts` draws `rangeLabel` from the pair), and a row
31007
+ * that did not fill them would sort under the epoch and render a blank range.
31008
+ * Write to the subject and read from the projection and the two will disagree;
31009
+ * the projection is derived at creation and never edited afterwards.
31010
+ *
31011
+ * And they mean DIFFERENT FACTS for the two kinds, which is the part a reader
31012
+ * who knows only the recording export will get wrong:
31013
+ *
31014
+ * | field | `kind:'footage'` | `kind:'clip'` |
31015
+ * | --- | --- | --- |
31016
+ * | `fromMs`/`toMs` | the stretch the operator ASKED for | the camera's own boundaries, always `clip.timeRange`, never anything a caller supplied |
31017
+ * | `profile` | the stream rendered | the twin actually SERVED (`subject.profile` is the one asked for) |
31018
+ *
31019
+ * Same type, different fact — the shape this repo keeps getting wrong (D385's
31020
+ * two authorities, D224's second copy).
31021
+ */
30850
31022
  var ExportRecordSchema = object({
30851
31023
  id: string(),
30852
31024
  deviceId: number(),
30853
31025
  profile: string(),
30854
31026
  fromMs: number(),
30855
31027
  toMs: number(),
31028
+ /**
31029
+ * What this export IS. Optional ONLY for the rows written before D558: the
31030
+ * store parses every row through this schema on every read, so a required
31031
+ * field would make the export AUDIT — which is the whole reason rows survive
31032
+ * file deletion — unreadable in one release. Absence means `footage`, and
31033
+ * {@link exportSubjectOf} is the one place that says so.
31034
+ */
31035
+ subject: ExportSubjectSchema.optional(),
30856
31036
  options: ExportOptionsSchema,
30857
31037
  state: ExportStateSchema,
30858
31038
  /** 0–100 while rendering; null otherwise. */
@@ -30869,6 +31049,18 @@ var ExportRecordSchema = object({
30869
31049
  /** Failure reason when state is 'failed'; null otherwise. */
30870
31050
  error: string().nullable()
30871
31051
  });
31052
+ _enum([
31053
+ "catalog-miss",
31054
+ "catalog-unreachable",
31055
+ "no-file-for-window",
31056
+ "clip-in-progress",
31057
+ "unsupported-option",
31058
+ "sleeping",
31059
+ "camera-refused",
31060
+ "fetch-failed",
31061
+ "too-large-to-transfer",
31062
+ "wake-expired"
31063
+ ]);
30872
31064
  /** Candidate download URLs (LAN first, then operator extra hosts). */
30873
31065
  var ExportDownloadSchema = object({
30874
31066
  url: string(),
@@ -30887,16 +31079,50 @@ var ExportBytesSchema = object({
30887
31079
  name: string(),
30888
31080
  bytes: number().int().nonnegative()
30889
31081
  });
31082
+ /** Canonical `profiles[]`, falling back to the legacy singular `profile`. */
31083
+ function resolveExportProfiles(input) {
31084
+ if (input.profiles !== void 0 && input.profiles.length > 0) return [...input.profiles];
31085
+ if (typeof input.profile === "string" && input.profile.length > 0) return [input.profile];
31086
+ return [];
31087
+ }
30890
31088
  method(object({
30891
31089
  deviceId: number(),
30892
31090
  /** @deprecated Prefer `profiles`. Kept so timelapse/notifiers keep working. */
30893
31091
  profile: string().optional(),
30894
31092
  profiles: array(string()).min(1).optional(),
30895
- fromMs: number(),
30896
- toMs: number(),
31093
+ /** Footage only — a clip's boundaries are the camera's. */
31094
+ fromMs: number().optional(),
31095
+ toMs: number().optional(),
31096
+ /** What to export. Absent means the legacy flat footage request. */
31097
+ subject: ExportSubjectSchema.optional(),
30897
31098
  options: ExportOptionsSchema
30898
31099
  }).superRefine((v, ctx) => {
30899
- if ((v.profiles !== void 0 && v.profiles.length > 0 ? v.profiles : v.profile !== void 0 ? [v.profile] : []).length < 1) ctx.addIssue({
31100
+ if (v.subject?.kind === "clip") {
31101
+ if (v.subject.deviceId !== v.deviceId) ctx.addIssue({
31102
+ code: ZodIssueCode.custom,
31103
+ message: `subject.deviceId (${v.subject.deviceId}) must equal deviceId (${v.deviceId}) — the top-level field is what per-device scope enforcement reads`,
31104
+ path: ["subject", "deviceId"]
31105
+ });
31106
+ if (v.fromMs !== void 0 || v.toMs !== void 0) ctx.addIssue({
31107
+ code: ZodIssueCode.custom,
31108
+ message: "a clip export asks for no time range: the camera chose the boundaries and they are read from the catalog row",
31109
+ path: ["fromMs"]
31110
+ });
31111
+ return;
31112
+ }
31113
+ if (v.subject?.kind === "footage" && v.subject.deviceId !== v.deviceId) ctx.addIssue({
31114
+ code: ZodIssueCode.custom,
31115
+ message: `subject.deviceId (${v.subject.deviceId}) must equal deviceId (${v.deviceId})`,
31116
+ path: ["subject", "deviceId"]
31117
+ });
31118
+ const fromMs = v.subject?.kind === "footage" ? v.subject.fromMs : v.fromMs;
31119
+ const toMs = v.subject?.kind === "footage" ? v.subject.toMs : v.toMs;
31120
+ if (typeof fromMs !== "number" || typeof toMs !== "number") ctx.addIssue({
31121
+ code: ZodIssueCode.custom,
31122
+ message: "a footage export needs fromMs and toMs",
31123
+ path: ["fromMs"]
31124
+ });
31125
+ if ((v.subject?.kind === "footage" ? [...v.subject.profiles] : resolveExportProfiles(v)).length < 1) ctx.addIssue({
30900
31126
  code: ZodIssueCode.custom,
30901
31127
  message: "pass profiles[] (min 1) or legacy profile",
30902
31128
  path: ["profiles"]
@@ -38896,6 +39122,12 @@ Object.freeze({
38896
39122
  addonId: null,
38897
39123
  access: "view"
38898
39124
  },
39125
+ "videoclips.readClipBytes": {
39126
+ capName: "videoclips",
39127
+ capScope: "device",
39128
+ addonId: null,
39129
+ access: "view"
39130
+ },
38899
39131
  "viewerUi.getStaticDir": {
38900
39132
  capName: "viewer-ui",
38901
39133
  capScope: "system",
@@ -40914,6 +41146,11 @@ Object.freeze({
40914
41146
  form: "single",
40915
41147
  optional: false
40916
41148
  }],
41149
+ "videoclips.readClipBytes": [{
41150
+ name: "deviceId",
41151
+ form: "single",
41152
+ optional: false
41153
+ }],
40917
41154
  "waterHeater.setAway": [{
40918
41155
  name: "deviceId",
40919
41156
  form: "single",
@@ -1,5 +1,5 @@
1
1
  import { h as e, l as t, u as n, y as r } from "./_virtual_mf___mfe_internal__addon_model_studio_page__loadShare__react__loadShare__.js-DJDHChgO.mjs";
2
- import { o as i, s as a } from "./cap-error-DHkvpvpc.mjs";
2
+ import { o as i, s as a } from "./responsive-6UoyAOwH.mjs";
3
3
  import { n as o, r as s, t as c } from "./_virtual_mf___mfe_internal__addon_model_studio_page__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-ds_Ehzaa.mjs";
4
4
  var l = a("chevron-down", [["path", {
5
5
  d: "m6 9 6 6 6-6",
@@ -1,2 +1,2 @@
1
- import { n as e, t } from "./virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_model_studio_page__remoteEntry_js-DrSBhU3P.mjs";
1
+ import { n as e, t } from "./virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_model_studio_page__remoteEntry_js-CI7738Pr.mjs";
2
2
  export { t as get, e as init };