@camstack/addon-export-alexa 1.2.26 → 1.2.27

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.
@@ -26,7 +26,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  //#endregion
27
27
  let node_crypto = require("node:crypto");
28
28
  node_crypto = __toESM(node_crypto);
29
- //#region ../types/dist/event-category-Bxo5yJjt.mjs
29
+ //#region ../types/dist/event-category-XfKNtfCc.mjs
30
30
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
31
31
  EventCategory["SystemBoot"] = "system.boot";
32
32
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -43,9 +43,10 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
43
43
  EventCategory["SystemRestartCompleted"] = "system.restart-completed";
44
44
  /**
45
45
  * A newer addon or server-root package version was found by the
46
- * authoritative registry check. Emitted once per
47
- * `(target, packageName, currentVersion, latestVersion)` transition; repeated
48
- * polling of the same result is deduplicated by the checker.
46
+ * authoritative registry check. Emitted once when any observed
47
+ * `latestVersion` changes (or a package/node first appears behind);
48
+ * the payload carries the full currently-available list. Repeated
49
+ * polling of the same latests is silent.
49
50
  */
50
51
  EventCategory["UpdateAvailable"] = "update.available";
51
52
  /**
@@ -64,6 +65,22 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
64
65
  EventCategory["AddonInstalled"] = "addon.installed";
65
66
  EventCategory["AddonUninstalled"] = "addon.uninstalled";
66
67
  EventCategory["AddonCrashed"] = "addon.crashed";
68
+ /**
69
+ * A RUNNER the D6 crash circuit-breaker gave up on — terminal.
70
+ *
71
+ * `AddonCrashed` is the routine, self-healing fact ("it crashed; it is being
72
+ * respawned"); this is the one that never resolves itself. Emitted exactly
73
+ * once per trip, by `process-service.ts`, carrying the node, the runner, the
74
+ * addons it hosted and the crash count that tripped the breaker.
75
+ *
76
+ * It exists because a runner marked terminally `failed` used to be SILENT:
77
+ * on 2026-08-18 the `recorder` runner died of three unhandled ffmpeg spawn
78
+ * errors, the breaker stopped respawning it (correctly), `/health` kept
79
+ * returning 200, and fleet-wide recording was gone for 3h15 before the
80
+ * operator's phone told him. The Notification Center's system-event intake
81
+ * consumes this category and maps it to the `addon-crash-loop` kind.
82
+ */
83
+ EventCategory["AddonRunnerFailed"] = "addon.runner-failed";
67
84
  EventCategory["AddonError"] = "addon.error";
68
85
  EventCategory["AddonPageReady"] = "addon.page-ready";
69
86
  EventCategory["AddonWidgetReady"] = "addon.widget-ready";
@@ -7716,6 +7733,10 @@ var RecordingBandSchema = object({
7716
7733
  preBufferSec: number().min(0).optional(),
7717
7734
  postBufferSec: number().min(0).optional()
7718
7735
  });
7736
+ ({
7737
+ preBufferSec: 10,
7738
+ postBufferSec: 30
7739
+ }).postBufferSec * 1e3;
7719
7740
  /**
7720
7741
  * Per-device retention overrides. Every field is optional; an unset or `0`
7721
7742
  * value inherits the node-wide recorder default. Only footage-lifetime limits
@@ -7763,6 +7784,12 @@ var RecordingConfigSchema = object({
7763
7784
  /** DERIVED summary of `bands`, stamped by the recorder on every save.
7764
7785
  * Authoring it has no effect — see {@link RecordingStorageModeSchema}. */
7765
7786
  mode: RecordingStorageModeSchema.optional(),
7787
+ /**
7788
+ * Which assigned broker slots to record. Absent / empty = {@link
7789
+ * DEFAULT_RECORDING_PROFILES} (`high`+`low`) intersected with the
7790
+ * camera's currently assigned slots — never `mid` unless the operator
7791
+ * picks it, and never a slot the broker has not assigned.
7792
+ */
7766
7793
  profiles: array(CamProfileSchema).optional(),
7767
7794
  segmentSeconds: number().int().positive().optional(),
7768
7795
  /**
@@ -7843,7 +7870,11 @@ var RelocateFootageInputSchema = object({
7843
7870
  profiles: array(string()).optional(),
7844
7871
  /** Copy throttle in MB/s (default 40) — the drain is a background chore,
7845
7872
  * never allowed to starve live writers. */
7846
- throttleMbps: number().min(1).max(1e3).optional()
7873
+ throttleMbps: number().min(1).max(1e3).optional(),
7874
+ /** Move only segments whose startMs is >= this. Absent = the whole source
7875
+ * pile. Used when a full drain is too expensive and the operator only
7876
+ * wants the recent window on the new disk. */
7877
+ sinceMs: number().int().optional()
7847
7878
  });
7848
7879
  /** Internal, lease-scoped participant operation. It is intentionally separate
7849
7880
  * from persistent recording settings: a migration never changes
@@ -14533,6 +14564,7 @@ var NcSystemEventKindSchema = _enum([
14533
14564
  "node-offline",
14534
14565
  "node-inference-unavailable",
14535
14566
  "detection-blind",
14567
+ "addon-crash-loop",
14536
14568
  "addon-update-available",
14537
14569
  "server-update-available",
14538
14570
  "alarm-triggered",
@@ -14540,6 +14572,9 @@ var NcSystemEventKindSchema = _enum([
14540
14572
  "alarm-disarmed",
14541
14573
  "alarm-arming",
14542
14574
  "alarm-arm-refused",
14575
+ "addon-updated",
14576
+ "server-updated",
14577
+ "export-completed",
14543
14578
  "camera-online",
14544
14579
  "camera-offline",
14545
14580
  "camera-disabled",
@@ -16439,13 +16474,19 @@ var RetrainStatusSchema = _enum([
16439
16474
  * "never marked" from "already trained" must read `retrainStatus`.
16440
16475
  *
16441
16476
  * `debug` does NOT pin; it is attention, not durability.
16477
+ *
16478
+ * `favourited` IS a BOOLEAN pin (durability bit), not a retrain lifecycle.
16479
+ * A favourited track is skipped by retention the same way `staging` is, but
16480
+ * it does not enter `none|staging|trained` and has no staging budget.
16442
16481
  */
16443
16482
  var TrackFlagFields = {
16444
16483
  /** Operator marked this track as training material — i.e. `retrainStatus` is
16445
16484
  * `'staging'`. */
16446
16485
  markForTrain: boolean().optional(),
16447
16486
  /** Operator marked this track for diagnostic attention. */
16448
- debug: boolean().optional()
16487
+ debug: boolean().optional(),
16488
+ /** Operator favourited this track. Pins it against pruning. */
16489
+ favourited: boolean().optional()
16449
16490
  };
16450
16491
  /**
16451
16492
  * The lifecycle field itself, on the READ surfaces only (`Track`, `KeyEvent`).
@@ -16470,6 +16511,7 @@ var TrackFlagsSchema = object({
16470
16511
  trackId: string(),
16471
16512
  markForTrain: boolean(),
16472
16513
  debug: boolean(),
16514
+ favourited: boolean(),
16473
16515
  /** The lifecycle state the boolean was derived from. Required here (unlike on
16474
16516
  * a track row) because this shape is only ever produced by the write body,
16475
16517
  * which always knows it — and a surface that has just written needs to render
@@ -17102,6 +17144,12 @@ var TrackCascadeCountsSchema = object({
17102
17144
  /** Per-track CLIP search vectors removed (best-effort). */
17103
17145
  embeddings: number().int()
17104
17146
  });
17147
+ /** Disk-wins reconcile: media rows whose blobs are gone, then empty tracks. */
17148
+ var DiskReconcileCountsSchema = object({
17149
+ mediaDropped: number().int(),
17150
+ tracks: number().int(),
17151
+ events: number().int()
17152
+ });
17105
17153
  /** Event-store footprint for one camera. */
17106
17154
  var EventStoreDeviceFootprintSchema = object({
17107
17155
  deviceId: number(),
@@ -17278,6 +17326,9 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
17278
17326
  }), method(object({ deviceId: number() }), TrackCascadeCountsSchema, {
17279
17327
  kind: "mutation",
17280
17328
  auth: "admin"
17329
+ }), method(object({ deviceId: number() }), DiskReconcileCountsSchema, {
17330
+ kind: "mutation",
17331
+ auth: "admin"
17281
17332
  }), method(object({
17282
17333
  deviceId: number(),
17283
17334
  trackIds: array(string()).min(1)
@@ -18788,6 +18839,24 @@ var CameraStatusDegradationSchema = object({
18788
18839
  *
18789
18840
  * See spec: `docs/superpowers/specs/2026-06-24-camera-status-aggregator-cap.md`
18790
18841
  */
18842
+ var DiskReconcileJobSchema = object({
18843
+ state: _enum([
18844
+ "idle",
18845
+ "running",
18846
+ "done",
18847
+ "error"
18848
+ ]),
18849
+ total: number().int().nonnegative(),
18850
+ completed: number().int().nonnegative(),
18851
+ currentDeviceId: number().int().nullable(),
18852
+ failed: array(number().int()).readonly(),
18853
+ mediaDropped: number().int().nonnegative(),
18854
+ tracks: number().int().nonnegative(),
18855
+ events: number().int().nonnegative(),
18856
+ startedAtMs: number().int().nullable(),
18857
+ finishedAtMs: number().int().nullable(),
18858
+ error: string().nullable()
18859
+ });
18791
18860
  var CameraStatusSchema = object({
18792
18861
  deviceId: number(),
18793
18862
  assignment: CameraAssignmentStatusSchema,
@@ -19019,7 +19088,10 @@ method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
19019
19088
  }), CameraSwitchGroupSchema, {
19020
19089
  kind: "mutation",
19021
19090
  auth: "admin"
19022
- }), method(object({ deviceId: number() }), CameraStatusSchema), method(object({ deviceIds: array(number()).optional() }), array(CameraStatusSchema).readonly()), method(_void(), array(PipelineTemplateSchema).readonly()), method(object({
19091
+ }), method(object({ deviceId: number() }), CameraStatusSchema), method(object({ deviceIds: array(number()).optional() }), array(CameraStatusSchema).readonly()), method(_void(), DiskReconcileJobSchema, {
19092
+ kind: "mutation",
19093
+ auth: "admin"
19094
+ }), method(_void(), DiskReconcileJobSchema, { auth: "admin" }), method(_void(), array(PipelineTemplateSchema).readonly()), method(object({
19023
19095
  name: string(),
19024
19096
  description: string().optional(),
19025
19097
  config: CameraPipelineConfigSchema
@@ -20092,20 +20164,6 @@ var VectorStatsResultSchema = object({
20092
20164
  exact: boolean()
20093
20165
  });
20094
20166
  method(VectorDeclareIndexInputSchema, _void(), { kind: "mutation" }), method(VectorUpsertInputSchema, VectorUpsertResultSchema, { kind: "mutation" }), method(VectorQueryInputSchema, VectorQueryResultSchema), method(VectorGetInputSchema, VectorGetResultSchema), method(VectorDeleteInputSchema, VectorDeleteResultSchema, { kind: "mutation" }), method(VectorDeleteByFilterInputSchema, VectorDeleteResultSchema, { kind: "mutation" }), method(VectorStatsInputSchema, VectorStatsResultSchema);
20095
- /**
20096
- * `videoclips` — the unified, navigable-clip surface for a camera.
20097
- *
20098
- * A device-scoped WRAPPER cap (like `pipeline-analytics`): exactly one active
20099
- * provider per device, substitutable. The DEFAULT provider (registered by
20100
- * `addon-post-analysis`, `defaultActive: true`) composes the analytics event
20101
- * log (markers + thumbnails) with the recorder's `getPlaybackManifest` — a clip
20102
- * is a time-WINDOW over existing footage, never a separate file. A camera that
20103
- * exposes NATIVE onboard clips (Reolink/Hikvision NVR) can later substitute the
20104
- * wrapper provider for its device and serve its own clip catalog + URLs.
20105
- *
20106
- * A `Clip` is purely time-based (subtree-blind): playback resolves segments by
20107
- * temporal overlap, so the API never decides `continuous` vs `events`.
20108
- */
20109
20167
  var ClipSchema = object({
20110
20168
  /** Opaque, provider-namespaced id. The default provider encodes the time
20111
20169
  * window so `getClipPlayback` is self-contained (no event re-query). */
@@ -20122,8 +20180,57 @@ var ClipSchema = object({
20122
20180
  startMs: number(),
20123
20181
  endMs: number()
20124
20182
  }),
20125
- /** Thumbnail URL (lazy; e.g. analytics `getEventMedia`). Never inlined. */
20126
- thumbnail: string().optional()
20183
+ /**
20184
+ * Lazy thumbnail URL, never inlined.
20185
+ *
20186
+ * Recording-derived clips (events-mode keep-window, and the prepared
20187
+ * continuous event+fragment visit) MUST use the snapshot of the **main
20188
+ * event of the interval** — `getEventMedia({ eventId, kind: 'snapshot' })`
20189
+ * of the event that owns `kind` (object > motion > audio). Do not extract
20190
+ * a keyframe from the recorded segments. Other providers (onboard, HKSV)
20191
+ * mint their own stills.
20192
+ *
20193
+ * **VOUCHED, never fabricated.** A provider emits this only for an event it
20194
+ * has CONFIRMED owns at least one media row (its own, or its owning track's).
20195
+ * Absent is meaningful — "this visit has no event still" — never "we did not
20196
+ * look". Stamping it from a URL template made 35% of one camera's clips point
20197
+ * at a 404 (device 3836, 2026-08-17: 64 of 179 clips dead, 63 of them motion).
20198
+ * A read that FAILS drops the claim; it never invents it.
20199
+ */
20200
+ thumbnail: string().optional(),
20201
+ /**
20202
+ * An instant INSIDE this visit's footage, hole-safe, where a recorded still
20203
+ * can be decoded. Present whenever the visit came from recorded availability;
20204
+ * absent on a per-event padded window (there is no footage to promise).
20205
+ *
20206
+ * This is not a thumbnail and not a second byte path: it is the argument to
20207
+ * the recorder's existing still route. The surface — never the provider —
20208
+ * decides whether to use it. It is the midpoint of the visit's LONGEST
20209
+ * contiguous range, not of the visit: a visit spans its holes by
20210
+ * construction, so a naive midpoint lands in dead air.
20211
+ */
20212
+ stillAtMs: number().optional(),
20213
+ /**
20214
+ * Analytics event ids that overlap this visit — a BOUNDED sample, newest
20215
+ * first within kind (object → motion → audio), capped at
20216
+ * {@link MAX_CLIP_EVENT_IDS}. Empty on footage-only clips.
20217
+ *
20218
+ * Bounded because it is not a payload the surface pages through: one visit on
20219
+ * device 615 carried 2 345 ids, and `eventIds` was 99% of a 153 KB
20220
+ * camera-day. Read {@link eventCount} for the true total.
20221
+ */
20222
+ eventIds: array(string()).optional(),
20223
+ /** How many analytics events actually overlap this visit. Differs from
20224
+ * `eventIds.length` exactly when the sample was capped — so a truncated
20225
+ * list is never mistaken for a quiet visit. */
20226
+ eventCount: number().int().nonnegative().optional(),
20227
+ /** Intra-visit footage holes (GOP rolls, discarded segments) still shorter
20228
+ * than `VISIT_MERGE_GAP_MS`. Playback concatenates around them; the timeline
20229
+ * bar keeps showing them via `recording.getAvailability`. */
20230
+ holes: array(object({
20231
+ startMs: number(),
20232
+ endMs: number()
20233
+ })).optional()
20127
20234
  });
20128
20235
  var ClipPlaybackSchema = object({
20129
20236
  /** HLS master URL through the hub data-plane (Range + token in path). */
@@ -20587,7 +20694,14 @@ var SearchResultSchema = object({
20587
20694
  });
20588
20695
  var AutoUpdateSettingsSchema = object({
20589
20696
  channel: ChannelSchema,
20590
- intervalSeconds: number()
20697
+ intervalSeconds: number(),
20698
+ /**
20699
+ * Cadence of the "an update exists" POLLER, in seconds. Independent of
20700
+ * `channel`: the poller runs while auto-apply is `off`, because being told
20701
+ * about a publish and installing it are different decisions. Clamped
20702
+ * server-side to 900 s … 604800 s; defaults to 21600 s (6 h).
20703
+ */
20704
+ updateCheckIntervalSeconds: number()
20591
20705
  });
20592
20706
  var AddonAutoUpdateSchema = ChannelWithInheritSchema;
20593
20707
  var RestartAddonResultSchema = unknown();
@@ -20728,7 +20842,9 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
20728
20842
  auth: "admin"
20729
20843
  }), method(_void(), AutoUpdateSettingsSchema, { auth: "admin" }), method(object({
20730
20844
  channel: ChannelSchema,
20731
- intervalSeconds: number().min(300).max(86400).optional()
20845
+ intervalSeconds: number().min(300).max(86400).optional(),
20846
+ /** Availability-poll cadence; see AutoUpdateSettingsSchema. */
20847
+ updateCheckIntervalSeconds: number().min(900).max(604800).optional()
20732
20848
  }), unknown(), {
20733
20849
  kind: "mutation",
20734
20850
  auth: "admin"
@@ -24721,7 +24837,9 @@ var ExportOptionsSchema = object({
24721
24837
  includeAudio: boolean(),
24722
24838
  maxLifeMs: number().int().positive(),
24723
24839
  deleteAfterDownload: boolean(),
24724
- title: string().max(200).optional()
24840
+ title: string().max(200).optional(),
24841
+ /** Notification-output target ids to ping when this export becomes ready. */
24842
+ notifyTargetIds: array(string().min(1)).max(20).optional()
24725
24843
  }).superRefine((v, ctx) => {
24726
24844
  if (v.speed !== void 0 && v.timelapse !== void 0) ctx.addIssue({
24727
24845
  code: ZodIssueCode.custom,
@@ -24780,10 +24898,18 @@ var ExportBytesSchema = object({
24780
24898
  });
24781
24899
  method(object({
24782
24900
  deviceId: number(),
24783
- profile: string(),
24901
+ /** @deprecated Prefer `profiles`. Kept so timelapse/notifiers keep working. */
24902
+ profile: string().optional(),
24903
+ profiles: array(string()).min(1).optional(),
24784
24904
  fromMs: number(),
24785
24905
  toMs: number(),
24786
24906
  options: ExportOptionsSchema
24907
+ }).superRefine((v, ctx) => {
24908
+ if ((v.profiles !== void 0 && v.profiles.length > 0 ? v.profiles : v.profile !== void 0 ? [v.profile] : []).length < 1) ctx.addIssue({
24909
+ code: ZodIssueCode.custom,
24910
+ message: "pass profiles[] (min 1) or legacy profile",
24911
+ path: ["profiles"]
24912
+ });
24787
24913
  }), ExportRecordSchema, {
24788
24914
  kind: "mutation",
24789
24915
  auth: "protected"
@@ -29383,6 +29509,12 @@ Object.freeze({
29383
29509
  addonId: null,
29384
29510
  access: "create"
29385
29511
  },
29512
+ "pipelineAnalytics.reconcileFromDisk": {
29513
+ capName: "pipeline-analytics",
29514
+ capScope: "device",
29515
+ addonId: null,
29516
+ access: "create"
29517
+ },
29386
29518
  "pipelineAnalytics.refreshStorageLocationsForMigration": {
29387
29519
  capName: "pipeline-analytics",
29388
29520
  capScope: "device",
@@ -29785,6 +29917,12 @@ Object.freeze({
29785
29917
  addonId: null,
29786
29918
  access: "view"
29787
29919
  },
29920
+ "pipelineOrchestrator.getReconcileFromDiskStatus": {
29921
+ capName: "pipeline-orchestrator",
29922
+ capScope: "system",
29923
+ addonId: null,
29924
+ access: "view"
29925
+ },
29788
29926
  "pipelineOrchestrator.listAgentSettings": {
29789
29927
  capName: "pipeline-orchestrator",
29790
29928
  capScope: "system",
@@ -29809,6 +29947,12 @@ Object.freeze({
29809
29947
  addonId: null,
29810
29948
  access: "create"
29811
29949
  },
29950
+ "pipelineOrchestrator.reconcileFromDisk": {
29951
+ capName: "pipeline-orchestrator",
29952
+ capScope: "system",
29953
+ addonId: null,
29954
+ access: "create"
29955
+ },
29812
29956
  "pipelineOrchestrator.removeAgentSettings": {
29813
29957
  capName: "pipeline-orchestrator",
29814
29958
  capScope: "system",
@@ -32800,6 +32944,11 @@ Object.freeze({
32800
32944
  form: "single",
32801
32945
  optional: true
32802
32946
  }],
32947
+ "pipelineAnalytics.reconcileFromDisk": [{
32948
+ name: "deviceId",
32949
+ form: "single",
32950
+ optional: false
32951
+ }],
32803
32952
  "pipelineAnalytics.restageRetrainTrack": [{
32804
32953
  name: "deviceId",
32805
32954
  form: "single",
@@ -33865,6 +34014,8 @@ DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
33865
34014
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
33866
34015
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
33867
34016
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
34017
+ var MB = 1024 * 1024;
34018
+ 1024 * MB, 3072 * MB;
33868
34019
  //#endregion
33869
34020
  //#region src/custom-actions.ts
33870
34021
  /**
@@ -1,5 +1,5 @@
1
1
  import * as crypto$1 from "node:crypto";
2
- //#region ../types/dist/event-category-Bxo5yJjt.mjs
2
+ //#region ../types/dist/event-category-XfKNtfCc.mjs
3
3
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4
4
  EventCategory["SystemBoot"] = "system.boot";
5
5
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -16,9 +16,10 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
16
16
  EventCategory["SystemRestartCompleted"] = "system.restart-completed";
17
17
  /**
18
18
  * A newer addon or server-root package version was found by the
19
- * authoritative registry check. Emitted once per
20
- * `(target, packageName, currentVersion, latestVersion)` transition; repeated
21
- * polling of the same result is deduplicated by the checker.
19
+ * authoritative registry check. Emitted once when any observed
20
+ * `latestVersion` changes (or a package/node first appears behind);
21
+ * the payload carries the full currently-available list. Repeated
22
+ * polling of the same latests is silent.
22
23
  */
23
24
  EventCategory["UpdateAvailable"] = "update.available";
24
25
  /**
@@ -37,6 +38,22 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
37
38
  EventCategory["AddonInstalled"] = "addon.installed";
38
39
  EventCategory["AddonUninstalled"] = "addon.uninstalled";
39
40
  EventCategory["AddonCrashed"] = "addon.crashed";
41
+ /**
42
+ * A RUNNER the D6 crash circuit-breaker gave up on — terminal.
43
+ *
44
+ * `AddonCrashed` is the routine, self-healing fact ("it crashed; it is being
45
+ * respawned"); this is the one that never resolves itself. Emitted exactly
46
+ * once per trip, by `process-service.ts`, carrying the node, the runner, the
47
+ * addons it hosted and the crash count that tripped the breaker.
48
+ *
49
+ * It exists because a runner marked terminally `failed` used to be SILENT:
50
+ * on 2026-08-18 the `recorder` runner died of three unhandled ffmpeg spawn
51
+ * errors, the breaker stopped respawning it (correctly), `/health` kept
52
+ * returning 200, and fleet-wide recording was gone for 3h15 before the
53
+ * operator's phone told him. The Notification Center's system-event intake
54
+ * consumes this category and maps it to the `addon-crash-loop` kind.
55
+ */
56
+ EventCategory["AddonRunnerFailed"] = "addon.runner-failed";
40
57
  EventCategory["AddonError"] = "addon.error";
41
58
  EventCategory["AddonPageReady"] = "addon.page-ready";
42
59
  EventCategory["AddonWidgetReady"] = "addon.widget-ready";
@@ -7689,6 +7706,10 @@ var RecordingBandSchema = object({
7689
7706
  preBufferSec: number().min(0).optional(),
7690
7707
  postBufferSec: number().min(0).optional()
7691
7708
  });
7709
+ ({
7710
+ preBufferSec: 10,
7711
+ postBufferSec: 30
7712
+ }).postBufferSec * 1e3;
7692
7713
  /**
7693
7714
  * Per-device retention overrides. Every field is optional; an unset or `0`
7694
7715
  * value inherits the node-wide recorder default. Only footage-lifetime limits
@@ -7736,6 +7757,12 @@ var RecordingConfigSchema = object({
7736
7757
  /** DERIVED summary of `bands`, stamped by the recorder on every save.
7737
7758
  * Authoring it has no effect — see {@link RecordingStorageModeSchema}. */
7738
7759
  mode: RecordingStorageModeSchema.optional(),
7760
+ /**
7761
+ * Which assigned broker slots to record. Absent / empty = {@link
7762
+ * DEFAULT_RECORDING_PROFILES} (`high`+`low`) intersected with the
7763
+ * camera's currently assigned slots — never `mid` unless the operator
7764
+ * picks it, and never a slot the broker has not assigned.
7765
+ */
7739
7766
  profiles: array(CamProfileSchema).optional(),
7740
7767
  segmentSeconds: number().int().positive().optional(),
7741
7768
  /**
@@ -7816,7 +7843,11 @@ var RelocateFootageInputSchema = object({
7816
7843
  profiles: array(string()).optional(),
7817
7844
  /** Copy throttle in MB/s (default 40) — the drain is a background chore,
7818
7845
  * never allowed to starve live writers. */
7819
- throttleMbps: number().min(1).max(1e3).optional()
7846
+ throttleMbps: number().min(1).max(1e3).optional(),
7847
+ /** Move only segments whose startMs is >= this. Absent = the whole source
7848
+ * pile. Used when a full drain is too expensive and the operator only
7849
+ * wants the recent window on the new disk. */
7850
+ sinceMs: number().int().optional()
7820
7851
  });
7821
7852
  /** Internal, lease-scoped participant operation. It is intentionally separate
7822
7853
  * from persistent recording settings: a migration never changes
@@ -14506,6 +14537,7 @@ var NcSystemEventKindSchema = _enum([
14506
14537
  "node-offline",
14507
14538
  "node-inference-unavailable",
14508
14539
  "detection-blind",
14540
+ "addon-crash-loop",
14509
14541
  "addon-update-available",
14510
14542
  "server-update-available",
14511
14543
  "alarm-triggered",
@@ -14513,6 +14545,9 @@ var NcSystemEventKindSchema = _enum([
14513
14545
  "alarm-disarmed",
14514
14546
  "alarm-arming",
14515
14547
  "alarm-arm-refused",
14548
+ "addon-updated",
14549
+ "server-updated",
14550
+ "export-completed",
14516
14551
  "camera-online",
14517
14552
  "camera-offline",
14518
14553
  "camera-disabled",
@@ -16412,13 +16447,19 @@ var RetrainStatusSchema = _enum([
16412
16447
  * "never marked" from "already trained" must read `retrainStatus`.
16413
16448
  *
16414
16449
  * `debug` does NOT pin; it is attention, not durability.
16450
+ *
16451
+ * `favourited` IS a BOOLEAN pin (durability bit), not a retrain lifecycle.
16452
+ * A favourited track is skipped by retention the same way `staging` is, but
16453
+ * it does not enter `none|staging|trained` and has no staging budget.
16415
16454
  */
16416
16455
  var TrackFlagFields = {
16417
16456
  /** Operator marked this track as training material — i.e. `retrainStatus` is
16418
16457
  * `'staging'`. */
16419
16458
  markForTrain: boolean().optional(),
16420
16459
  /** Operator marked this track for diagnostic attention. */
16421
- debug: boolean().optional()
16460
+ debug: boolean().optional(),
16461
+ /** Operator favourited this track. Pins it against pruning. */
16462
+ favourited: boolean().optional()
16422
16463
  };
16423
16464
  /**
16424
16465
  * The lifecycle field itself, on the READ surfaces only (`Track`, `KeyEvent`).
@@ -16443,6 +16484,7 @@ var TrackFlagsSchema = object({
16443
16484
  trackId: string(),
16444
16485
  markForTrain: boolean(),
16445
16486
  debug: boolean(),
16487
+ favourited: boolean(),
16446
16488
  /** The lifecycle state the boolean was derived from. Required here (unlike on
16447
16489
  * a track row) because this shape is only ever produced by the write body,
16448
16490
  * which always knows it — and a surface that has just written needs to render
@@ -17075,6 +17117,12 @@ var TrackCascadeCountsSchema = object({
17075
17117
  /** Per-track CLIP search vectors removed (best-effort). */
17076
17118
  embeddings: number().int()
17077
17119
  });
17120
+ /** Disk-wins reconcile: media rows whose blobs are gone, then empty tracks. */
17121
+ var DiskReconcileCountsSchema = object({
17122
+ mediaDropped: number().int(),
17123
+ tracks: number().int(),
17124
+ events: number().int()
17125
+ });
17078
17126
  /** Event-store footprint for one camera. */
17079
17127
  var EventStoreDeviceFootprintSchema = object({
17080
17128
  deviceId: number(),
@@ -17251,6 +17299,9 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
17251
17299
  }), method(object({ deviceId: number() }), TrackCascadeCountsSchema, {
17252
17300
  kind: "mutation",
17253
17301
  auth: "admin"
17302
+ }), method(object({ deviceId: number() }), DiskReconcileCountsSchema, {
17303
+ kind: "mutation",
17304
+ auth: "admin"
17254
17305
  }), method(object({
17255
17306
  deviceId: number(),
17256
17307
  trackIds: array(string()).min(1)
@@ -18761,6 +18812,24 @@ var CameraStatusDegradationSchema = object({
18761
18812
  *
18762
18813
  * See spec: `docs/superpowers/specs/2026-06-24-camera-status-aggregator-cap.md`
18763
18814
  */
18815
+ var DiskReconcileJobSchema = object({
18816
+ state: _enum([
18817
+ "idle",
18818
+ "running",
18819
+ "done",
18820
+ "error"
18821
+ ]),
18822
+ total: number().int().nonnegative(),
18823
+ completed: number().int().nonnegative(),
18824
+ currentDeviceId: number().int().nullable(),
18825
+ failed: array(number().int()).readonly(),
18826
+ mediaDropped: number().int().nonnegative(),
18827
+ tracks: number().int().nonnegative(),
18828
+ events: number().int().nonnegative(),
18829
+ startedAtMs: number().int().nullable(),
18830
+ finishedAtMs: number().int().nullable(),
18831
+ error: string().nullable()
18832
+ });
18764
18833
  var CameraStatusSchema = object({
18765
18834
  deviceId: number(),
18766
18835
  assignment: CameraAssignmentStatusSchema,
@@ -18992,7 +19061,10 @@ method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
18992
19061
  }), CameraSwitchGroupSchema, {
18993
19062
  kind: "mutation",
18994
19063
  auth: "admin"
18995
- }), method(object({ deviceId: number() }), CameraStatusSchema), method(object({ deviceIds: array(number()).optional() }), array(CameraStatusSchema).readonly()), method(_void(), array(PipelineTemplateSchema).readonly()), method(object({
19064
+ }), method(object({ deviceId: number() }), CameraStatusSchema), method(object({ deviceIds: array(number()).optional() }), array(CameraStatusSchema).readonly()), method(_void(), DiskReconcileJobSchema, {
19065
+ kind: "mutation",
19066
+ auth: "admin"
19067
+ }), method(_void(), DiskReconcileJobSchema, { auth: "admin" }), method(_void(), array(PipelineTemplateSchema).readonly()), method(object({
18996
19068
  name: string(),
18997
19069
  description: string().optional(),
18998
19070
  config: CameraPipelineConfigSchema
@@ -20065,20 +20137,6 @@ var VectorStatsResultSchema = object({
20065
20137
  exact: boolean()
20066
20138
  });
20067
20139
  method(VectorDeclareIndexInputSchema, _void(), { kind: "mutation" }), method(VectorUpsertInputSchema, VectorUpsertResultSchema, { kind: "mutation" }), method(VectorQueryInputSchema, VectorQueryResultSchema), method(VectorGetInputSchema, VectorGetResultSchema), method(VectorDeleteInputSchema, VectorDeleteResultSchema, { kind: "mutation" }), method(VectorDeleteByFilterInputSchema, VectorDeleteResultSchema, { kind: "mutation" }), method(VectorStatsInputSchema, VectorStatsResultSchema);
20068
- /**
20069
- * `videoclips` — the unified, navigable-clip surface for a camera.
20070
- *
20071
- * A device-scoped WRAPPER cap (like `pipeline-analytics`): exactly one active
20072
- * provider per device, substitutable. The DEFAULT provider (registered by
20073
- * `addon-post-analysis`, `defaultActive: true`) composes the analytics event
20074
- * log (markers + thumbnails) with the recorder's `getPlaybackManifest` — a clip
20075
- * is a time-WINDOW over existing footage, never a separate file. A camera that
20076
- * exposes NATIVE onboard clips (Reolink/Hikvision NVR) can later substitute the
20077
- * wrapper provider for its device and serve its own clip catalog + URLs.
20078
- *
20079
- * A `Clip` is purely time-based (subtree-blind): playback resolves segments by
20080
- * temporal overlap, so the API never decides `continuous` vs `events`.
20081
- */
20082
20140
  var ClipSchema = object({
20083
20141
  /** Opaque, provider-namespaced id. The default provider encodes the time
20084
20142
  * window so `getClipPlayback` is self-contained (no event re-query). */
@@ -20095,8 +20153,57 @@ var ClipSchema = object({
20095
20153
  startMs: number(),
20096
20154
  endMs: number()
20097
20155
  }),
20098
- /** Thumbnail URL (lazy; e.g. analytics `getEventMedia`). Never inlined. */
20099
- thumbnail: string().optional()
20156
+ /**
20157
+ * Lazy thumbnail URL, never inlined.
20158
+ *
20159
+ * Recording-derived clips (events-mode keep-window, and the prepared
20160
+ * continuous event+fragment visit) MUST use the snapshot of the **main
20161
+ * event of the interval** — `getEventMedia({ eventId, kind: 'snapshot' })`
20162
+ * of the event that owns `kind` (object > motion > audio). Do not extract
20163
+ * a keyframe from the recorded segments. Other providers (onboard, HKSV)
20164
+ * mint their own stills.
20165
+ *
20166
+ * **VOUCHED, never fabricated.** A provider emits this only for an event it
20167
+ * has CONFIRMED owns at least one media row (its own, or its owning track's).
20168
+ * Absent is meaningful — "this visit has no event still" — never "we did not
20169
+ * look". Stamping it from a URL template made 35% of one camera's clips point
20170
+ * at a 404 (device 3836, 2026-08-17: 64 of 179 clips dead, 63 of them motion).
20171
+ * A read that FAILS drops the claim; it never invents it.
20172
+ */
20173
+ thumbnail: string().optional(),
20174
+ /**
20175
+ * An instant INSIDE this visit's footage, hole-safe, where a recorded still
20176
+ * can be decoded. Present whenever the visit came from recorded availability;
20177
+ * absent on a per-event padded window (there is no footage to promise).
20178
+ *
20179
+ * This is not a thumbnail and not a second byte path: it is the argument to
20180
+ * the recorder's existing still route. The surface — never the provider —
20181
+ * decides whether to use it. It is the midpoint of the visit's LONGEST
20182
+ * contiguous range, not of the visit: a visit spans its holes by
20183
+ * construction, so a naive midpoint lands in dead air.
20184
+ */
20185
+ stillAtMs: number().optional(),
20186
+ /**
20187
+ * Analytics event ids that overlap this visit — a BOUNDED sample, newest
20188
+ * first within kind (object → motion → audio), capped at
20189
+ * {@link MAX_CLIP_EVENT_IDS}. Empty on footage-only clips.
20190
+ *
20191
+ * Bounded because it is not a payload the surface pages through: one visit on
20192
+ * device 615 carried 2 345 ids, and `eventIds` was 99% of a 153 KB
20193
+ * camera-day. Read {@link eventCount} for the true total.
20194
+ */
20195
+ eventIds: array(string()).optional(),
20196
+ /** How many analytics events actually overlap this visit. Differs from
20197
+ * `eventIds.length` exactly when the sample was capped — so a truncated
20198
+ * list is never mistaken for a quiet visit. */
20199
+ eventCount: number().int().nonnegative().optional(),
20200
+ /** Intra-visit footage holes (GOP rolls, discarded segments) still shorter
20201
+ * than `VISIT_MERGE_GAP_MS`. Playback concatenates around them; the timeline
20202
+ * bar keeps showing them via `recording.getAvailability`. */
20203
+ holes: array(object({
20204
+ startMs: number(),
20205
+ endMs: number()
20206
+ })).optional()
20100
20207
  });
20101
20208
  var ClipPlaybackSchema = object({
20102
20209
  /** HLS master URL through the hub data-plane (Range + token in path). */
@@ -20560,7 +20667,14 @@ var SearchResultSchema = object({
20560
20667
  });
20561
20668
  var AutoUpdateSettingsSchema = object({
20562
20669
  channel: ChannelSchema,
20563
- intervalSeconds: number()
20670
+ intervalSeconds: number(),
20671
+ /**
20672
+ * Cadence of the "an update exists" POLLER, in seconds. Independent of
20673
+ * `channel`: the poller runs while auto-apply is `off`, because being told
20674
+ * about a publish and installing it are different decisions. Clamped
20675
+ * server-side to 900 s … 604800 s; defaults to 21600 s (6 h).
20676
+ */
20677
+ updateCheckIntervalSeconds: number()
20564
20678
  });
20565
20679
  var AddonAutoUpdateSchema = ChannelWithInheritSchema;
20566
20680
  var RestartAddonResultSchema = unknown();
@@ -20701,7 +20815,9 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
20701
20815
  auth: "admin"
20702
20816
  }), method(_void(), AutoUpdateSettingsSchema, { auth: "admin" }), method(object({
20703
20817
  channel: ChannelSchema,
20704
- intervalSeconds: number().min(300).max(86400).optional()
20818
+ intervalSeconds: number().min(300).max(86400).optional(),
20819
+ /** Availability-poll cadence; see AutoUpdateSettingsSchema. */
20820
+ updateCheckIntervalSeconds: number().min(900).max(604800).optional()
20705
20821
  }), unknown(), {
20706
20822
  kind: "mutation",
20707
20823
  auth: "admin"
@@ -24694,7 +24810,9 @@ var ExportOptionsSchema = object({
24694
24810
  includeAudio: boolean(),
24695
24811
  maxLifeMs: number().int().positive(),
24696
24812
  deleteAfterDownload: boolean(),
24697
- title: string().max(200).optional()
24813
+ title: string().max(200).optional(),
24814
+ /** Notification-output target ids to ping when this export becomes ready. */
24815
+ notifyTargetIds: array(string().min(1)).max(20).optional()
24698
24816
  }).superRefine((v, ctx) => {
24699
24817
  if (v.speed !== void 0 && v.timelapse !== void 0) ctx.addIssue({
24700
24818
  code: ZodIssueCode.custom,
@@ -24753,10 +24871,18 @@ var ExportBytesSchema = object({
24753
24871
  });
24754
24872
  method(object({
24755
24873
  deviceId: number(),
24756
- profile: string(),
24874
+ /** @deprecated Prefer `profiles`. Kept so timelapse/notifiers keep working. */
24875
+ profile: string().optional(),
24876
+ profiles: array(string()).min(1).optional(),
24757
24877
  fromMs: number(),
24758
24878
  toMs: number(),
24759
24879
  options: ExportOptionsSchema
24880
+ }).superRefine((v, ctx) => {
24881
+ if ((v.profiles !== void 0 && v.profiles.length > 0 ? v.profiles : v.profile !== void 0 ? [v.profile] : []).length < 1) ctx.addIssue({
24882
+ code: ZodIssueCode.custom,
24883
+ message: "pass profiles[] (min 1) or legacy profile",
24884
+ path: ["profiles"]
24885
+ });
24760
24886
  }), ExportRecordSchema, {
24761
24887
  kind: "mutation",
24762
24888
  auth: "protected"
@@ -29356,6 +29482,12 @@ Object.freeze({
29356
29482
  addonId: null,
29357
29483
  access: "create"
29358
29484
  },
29485
+ "pipelineAnalytics.reconcileFromDisk": {
29486
+ capName: "pipeline-analytics",
29487
+ capScope: "device",
29488
+ addonId: null,
29489
+ access: "create"
29490
+ },
29359
29491
  "pipelineAnalytics.refreshStorageLocationsForMigration": {
29360
29492
  capName: "pipeline-analytics",
29361
29493
  capScope: "device",
@@ -29758,6 +29890,12 @@ Object.freeze({
29758
29890
  addonId: null,
29759
29891
  access: "view"
29760
29892
  },
29893
+ "pipelineOrchestrator.getReconcileFromDiskStatus": {
29894
+ capName: "pipeline-orchestrator",
29895
+ capScope: "system",
29896
+ addonId: null,
29897
+ access: "view"
29898
+ },
29761
29899
  "pipelineOrchestrator.listAgentSettings": {
29762
29900
  capName: "pipeline-orchestrator",
29763
29901
  capScope: "system",
@@ -29782,6 +29920,12 @@ Object.freeze({
29782
29920
  addonId: null,
29783
29921
  access: "create"
29784
29922
  },
29923
+ "pipelineOrchestrator.reconcileFromDisk": {
29924
+ capName: "pipeline-orchestrator",
29925
+ capScope: "system",
29926
+ addonId: null,
29927
+ access: "create"
29928
+ },
29785
29929
  "pipelineOrchestrator.removeAgentSettings": {
29786
29930
  capName: "pipeline-orchestrator",
29787
29931
  capScope: "system",
@@ -32773,6 +32917,11 @@ Object.freeze({
32773
32917
  form: "single",
32774
32918
  optional: true
32775
32919
  }],
32920
+ "pipelineAnalytics.reconcileFromDisk": [{
32921
+ name: "deviceId",
32922
+ form: "single",
32923
+ optional: false
32924
+ }],
32776
32925
  "pipelineAnalytics.restageRetrainTrack": [{
32777
32926
  name: "deviceId",
32778
32927
  form: "single",
@@ -33838,6 +33987,8 @@ DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
33838
33987
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
33839
33988
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
33840
33989
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
33990
+ var MB = 1024 * 1024;
33991
+ 1024 * MB, 3072 * MB;
33841
33992
  //#endregion
33842
33993
  //#region src/custom-actions.ts
33843
33994
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-export-alexa",
3
- "version": "1.2.26",
3
+ "version": "1.2.27",
4
4
  "description": "Alexa Smart Home Skill export — hub-side OAuth provider + directive handler. The companion AWS Lambda forwards Alexa directives to this addon's /addon/export-alexa/directive endpoint.",
5
5
  "keywords": [
6
6
  "camstack",