@camstack/addon-export-alexa 1.2.26 → 1.2.28

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,65 @@ 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
+ * Distinct object classes attached to this visit (`person`, `car`, …),
20185
+ * dominant first, capped at {@link MAX_CLIP_LABELS}. The ribbon renders these
20186
+ * instead of the bare kind — "Object" tells the operator nothing a colour bar
20187
+ * did not. Absent (never empty) when the visit attached no classified object
20188
+ * event, so a motion/audio-only visit keeps its kind label.
20189
+ */
20190
+ labels: array(string()).max(3).optional(),
20191
+ /**
20192
+ * Lazy thumbnail URL, never inlined.
20193
+ *
20194
+ * Recording-derived clips (events-mode keep-window, and the prepared
20195
+ * continuous event+fragment visit) MUST use the snapshot of the **main
20196
+ * event of the interval** — `getEventMedia({ eventId, kind: 'snapshot' })`
20197
+ * of the event that owns `kind` (object > motion > audio). Do not extract
20198
+ * a keyframe from the recorded segments. Other providers (onboard, HKSV)
20199
+ * mint their own stills.
20200
+ *
20201
+ * **VOUCHED, never fabricated.** A provider emits this only for an event it
20202
+ * has CONFIRMED owns at least one media row (its own, or its owning track's).
20203
+ * Absent is meaningful — "this visit has no event still" — never "we did not
20204
+ * look". Stamping it from a URL template made 35% of one camera's clips point
20205
+ * at a 404 (device 3836, 2026-08-17: 64 of 179 clips dead, 63 of them motion).
20206
+ * A read that FAILS drops the claim; it never invents it.
20207
+ */
20208
+ thumbnail: string().optional(),
20209
+ /**
20210
+ * An instant INSIDE this visit's footage, hole-safe, where a recorded still
20211
+ * can be decoded. Present whenever the visit came from recorded availability;
20212
+ * absent on a per-event padded window (there is no footage to promise).
20213
+ *
20214
+ * This is not a thumbnail and not a second byte path: it is the argument to
20215
+ * the recorder's existing still route. The surface — never the provider —
20216
+ * decides whether to use it. It is the midpoint of the visit's LONGEST
20217
+ * contiguous range, not of the visit: a visit spans its holes by
20218
+ * construction, so a naive midpoint lands in dead air.
20219
+ */
20220
+ stillAtMs: number().optional(),
20221
+ /**
20222
+ * Analytics event ids that overlap this visit — a BOUNDED sample, newest
20223
+ * first within kind (object → motion → audio), capped at
20224
+ * {@link MAX_CLIP_EVENT_IDS}. Empty on footage-only clips.
20225
+ *
20226
+ * Bounded because it is not a payload the surface pages through: one visit on
20227
+ * device 615 carried 2 345 ids, and `eventIds` was 99% of a 153 KB
20228
+ * camera-day. Read {@link eventCount} for the true total.
20229
+ */
20230
+ eventIds: array(string()).optional(),
20231
+ /** How many analytics events actually overlap this visit. Differs from
20232
+ * `eventIds.length` exactly when the sample was capped — so a truncated
20233
+ * list is never mistaken for a quiet visit. */
20234
+ eventCount: number().int().nonnegative().optional(),
20235
+ /** Intra-visit footage holes (GOP rolls, discarded segments) still shorter
20236
+ * than `VISIT_MERGE_GAP_MS`. Playback concatenates around them; the timeline
20237
+ * bar keeps showing them via `recording.getAvailability`. */
20238
+ holes: array(object({
20239
+ startMs: number(),
20240
+ endMs: number()
20241
+ })).optional()
20127
20242
  });
20128
20243
  var ClipPlaybackSchema = object({
20129
20244
  /** HLS master URL through the hub data-plane (Range + token in path). */
@@ -20587,7 +20702,14 @@ var SearchResultSchema = object({
20587
20702
  });
20588
20703
  var AutoUpdateSettingsSchema = object({
20589
20704
  channel: ChannelSchema,
20590
- intervalSeconds: number()
20705
+ intervalSeconds: number(),
20706
+ /**
20707
+ * Cadence of the "an update exists" POLLER, in seconds. Independent of
20708
+ * `channel`: the poller runs while auto-apply is `off`, because being told
20709
+ * about a publish and installing it are different decisions. Clamped
20710
+ * server-side to 900 s … 604800 s; defaults to 21600 s (6 h).
20711
+ */
20712
+ updateCheckIntervalSeconds: number()
20591
20713
  });
20592
20714
  var AddonAutoUpdateSchema = ChannelWithInheritSchema;
20593
20715
  var RestartAddonResultSchema = unknown();
@@ -20728,7 +20850,9 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
20728
20850
  auth: "admin"
20729
20851
  }), method(_void(), AutoUpdateSettingsSchema, { auth: "admin" }), method(object({
20730
20852
  channel: ChannelSchema,
20731
- intervalSeconds: number().min(300).max(86400).optional()
20853
+ intervalSeconds: number().min(300).max(86400).optional(),
20854
+ /** Availability-poll cadence; see AutoUpdateSettingsSchema. */
20855
+ updateCheckIntervalSeconds: number().min(900).max(604800).optional()
20732
20856
  }), unknown(), {
20733
20857
  kind: "mutation",
20734
20858
  auth: "admin"
@@ -24721,7 +24845,9 @@ var ExportOptionsSchema = object({
24721
24845
  includeAudio: boolean(),
24722
24846
  maxLifeMs: number().int().positive(),
24723
24847
  deleteAfterDownload: boolean(),
24724
- title: string().max(200).optional()
24848
+ title: string().max(200).optional(),
24849
+ /** Notification-output target ids to ping when this export becomes ready. */
24850
+ notifyTargetIds: array(string().min(1)).max(20).optional()
24725
24851
  }).superRefine((v, ctx) => {
24726
24852
  if (v.speed !== void 0 && v.timelapse !== void 0) ctx.addIssue({
24727
24853
  code: ZodIssueCode.custom,
@@ -24780,10 +24906,18 @@ var ExportBytesSchema = object({
24780
24906
  });
24781
24907
  method(object({
24782
24908
  deviceId: number(),
24783
- profile: string(),
24909
+ /** @deprecated Prefer `profiles`. Kept so timelapse/notifiers keep working. */
24910
+ profile: string().optional(),
24911
+ profiles: array(string()).min(1).optional(),
24784
24912
  fromMs: number(),
24785
24913
  toMs: number(),
24786
24914
  options: ExportOptionsSchema
24915
+ }).superRefine((v, ctx) => {
24916
+ if ((v.profiles !== void 0 && v.profiles.length > 0 ? v.profiles : v.profile !== void 0 ? [v.profile] : []).length < 1) ctx.addIssue({
24917
+ code: ZodIssueCode.custom,
24918
+ message: "pass profiles[] (min 1) or legacy profile",
24919
+ path: ["profiles"]
24920
+ });
24787
24921
  }), ExportRecordSchema, {
24788
24922
  kind: "mutation",
24789
24923
  auth: "protected"
@@ -29383,6 +29517,12 @@ Object.freeze({
29383
29517
  addonId: null,
29384
29518
  access: "create"
29385
29519
  },
29520
+ "pipelineAnalytics.reconcileFromDisk": {
29521
+ capName: "pipeline-analytics",
29522
+ capScope: "device",
29523
+ addonId: null,
29524
+ access: "create"
29525
+ },
29386
29526
  "pipelineAnalytics.refreshStorageLocationsForMigration": {
29387
29527
  capName: "pipeline-analytics",
29388
29528
  capScope: "device",
@@ -29785,6 +29925,12 @@ Object.freeze({
29785
29925
  addonId: null,
29786
29926
  access: "view"
29787
29927
  },
29928
+ "pipelineOrchestrator.getReconcileFromDiskStatus": {
29929
+ capName: "pipeline-orchestrator",
29930
+ capScope: "system",
29931
+ addonId: null,
29932
+ access: "view"
29933
+ },
29788
29934
  "pipelineOrchestrator.listAgentSettings": {
29789
29935
  capName: "pipeline-orchestrator",
29790
29936
  capScope: "system",
@@ -29809,6 +29955,12 @@ Object.freeze({
29809
29955
  addonId: null,
29810
29956
  access: "create"
29811
29957
  },
29958
+ "pipelineOrchestrator.reconcileFromDisk": {
29959
+ capName: "pipeline-orchestrator",
29960
+ capScope: "system",
29961
+ addonId: null,
29962
+ access: "create"
29963
+ },
29812
29964
  "pipelineOrchestrator.removeAgentSettings": {
29813
29965
  capName: "pipeline-orchestrator",
29814
29966
  capScope: "system",
@@ -32800,6 +32952,11 @@ Object.freeze({
32800
32952
  form: "single",
32801
32953
  optional: true
32802
32954
  }],
32955
+ "pipelineAnalytics.reconcileFromDisk": [{
32956
+ name: "deviceId",
32957
+ form: "single",
32958
+ optional: false
32959
+ }],
32803
32960
  "pipelineAnalytics.restageRetrainTrack": [{
32804
32961
  name: "deviceId",
32805
32962
  form: "single",
@@ -33865,6 +34022,8 @@ DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
33865
34022
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
33866
34023
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
33867
34024
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
34025
+ var MB = 1024 * 1024;
34026
+ 1024 * MB, 3072 * MB;
33868
34027
  //#endregion
33869
34028
  //#region src/custom-actions.ts
33870
34029
  /**
@@ -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,65 @@ 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
+ * Distinct object classes attached to this visit (`person`, `car`, …),
20158
+ * dominant first, capped at {@link MAX_CLIP_LABELS}. The ribbon renders these
20159
+ * instead of the bare kind — "Object" tells the operator nothing a colour bar
20160
+ * did not. Absent (never empty) when the visit attached no classified object
20161
+ * event, so a motion/audio-only visit keeps its kind label.
20162
+ */
20163
+ labels: array(string()).max(3).optional(),
20164
+ /**
20165
+ * Lazy thumbnail URL, never inlined.
20166
+ *
20167
+ * Recording-derived clips (events-mode keep-window, and the prepared
20168
+ * continuous event+fragment visit) MUST use the snapshot of the **main
20169
+ * event of the interval** — `getEventMedia({ eventId, kind: 'snapshot' })`
20170
+ * of the event that owns `kind` (object > motion > audio). Do not extract
20171
+ * a keyframe from the recorded segments. Other providers (onboard, HKSV)
20172
+ * mint their own stills.
20173
+ *
20174
+ * **VOUCHED, never fabricated.** A provider emits this only for an event it
20175
+ * has CONFIRMED owns at least one media row (its own, or its owning track's).
20176
+ * Absent is meaningful — "this visit has no event still" — never "we did not
20177
+ * look". Stamping it from a URL template made 35% of one camera's clips point
20178
+ * at a 404 (device 3836, 2026-08-17: 64 of 179 clips dead, 63 of them motion).
20179
+ * A read that FAILS drops the claim; it never invents it.
20180
+ */
20181
+ thumbnail: string().optional(),
20182
+ /**
20183
+ * An instant INSIDE this visit's footage, hole-safe, where a recorded still
20184
+ * can be decoded. Present whenever the visit came from recorded availability;
20185
+ * absent on a per-event padded window (there is no footage to promise).
20186
+ *
20187
+ * This is not a thumbnail and not a second byte path: it is the argument to
20188
+ * the recorder's existing still route. The surface — never the provider —
20189
+ * decides whether to use it. It is the midpoint of the visit's LONGEST
20190
+ * contiguous range, not of the visit: a visit spans its holes by
20191
+ * construction, so a naive midpoint lands in dead air.
20192
+ */
20193
+ stillAtMs: number().optional(),
20194
+ /**
20195
+ * Analytics event ids that overlap this visit — a BOUNDED sample, newest
20196
+ * first within kind (object → motion → audio), capped at
20197
+ * {@link MAX_CLIP_EVENT_IDS}. Empty on footage-only clips.
20198
+ *
20199
+ * Bounded because it is not a payload the surface pages through: one visit on
20200
+ * device 615 carried 2 345 ids, and `eventIds` was 99% of a 153 KB
20201
+ * camera-day. Read {@link eventCount} for the true total.
20202
+ */
20203
+ eventIds: array(string()).optional(),
20204
+ /** How many analytics events actually overlap this visit. Differs from
20205
+ * `eventIds.length` exactly when the sample was capped — so a truncated
20206
+ * list is never mistaken for a quiet visit. */
20207
+ eventCount: number().int().nonnegative().optional(),
20208
+ /** Intra-visit footage holes (GOP rolls, discarded segments) still shorter
20209
+ * than `VISIT_MERGE_GAP_MS`. Playback concatenates around them; the timeline
20210
+ * bar keeps showing them via `recording.getAvailability`. */
20211
+ holes: array(object({
20212
+ startMs: number(),
20213
+ endMs: number()
20214
+ })).optional()
20100
20215
  });
20101
20216
  var ClipPlaybackSchema = object({
20102
20217
  /** HLS master URL through the hub data-plane (Range + token in path). */
@@ -20560,7 +20675,14 @@ var SearchResultSchema = object({
20560
20675
  });
20561
20676
  var AutoUpdateSettingsSchema = object({
20562
20677
  channel: ChannelSchema,
20563
- intervalSeconds: number()
20678
+ intervalSeconds: number(),
20679
+ /**
20680
+ * Cadence of the "an update exists" POLLER, in seconds. Independent of
20681
+ * `channel`: the poller runs while auto-apply is `off`, because being told
20682
+ * about a publish and installing it are different decisions. Clamped
20683
+ * server-side to 900 s … 604800 s; defaults to 21600 s (6 h).
20684
+ */
20685
+ updateCheckIntervalSeconds: number()
20564
20686
  });
20565
20687
  var AddonAutoUpdateSchema = ChannelWithInheritSchema;
20566
20688
  var RestartAddonResultSchema = unknown();
@@ -20701,7 +20823,9 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
20701
20823
  auth: "admin"
20702
20824
  }), method(_void(), AutoUpdateSettingsSchema, { auth: "admin" }), method(object({
20703
20825
  channel: ChannelSchema,
20704
- intervalSeconds: number().min(300).max(86400).optional()
20826
+ intervalSeconds: number().min(300).max(86400).optional(),
20827
+ /** Availability-poll cadence; see AutoUpdateSettingsSchema. */
20828
+ updateCheckIntervalSeconds: number().min(900).max(604800).optional()
20705
20829
  }), unknown(), {
20706
20830
  kind: "mutation",
20707
20831
  auth: "admin"
@@ -24694,7 +24818,9 @@ var ExportOptionsSchema = object({
24694
24818
  includeAudio: boolean(),
24695
24819
  maxLifeMs: number().int().positive(),
24696
24820
  deleteAfterDownload: boolean(),
24697
- title: string().max(200).optional()
24821
+ title: string().max(200).optional(),
24822
+ /** Notification-output target ids to ping when this export becomes ready. */
24823
+ notifyTargetIds: array(string().min(1)).max(20).optional()
24698
24824
  }).superRefine((v, ctx) => {
24699
24825
  if (v.speed !== void 0 && v.timelapse !== void 0) ctx.addIssue({
24700
24826
  code: ZodIssueCode.custom,
@@ -24753,10 +24879,18 @@ var ExportBytesSchema = object({
24753
24879
  });
24754
24880
  method(object({
24755
24881
  deviceId: number(),
24756
- profile: string(),
24882
+ /** @deprecated Prefer `profiles`. Kept so timelapse/notifiers keep working. */
24883
+ profile: string().optional(),
24884
+ profiles: array(string()).min(1).optional(),
24757
24885
  fromMs: number(),
24758
24886
  toMs: number(),
24759
24887
  options: ExportOptionsSchema
24888
+ }).superRefine((v, ctx) => {
24889
+ if ((v.profiles !== void 0 && v.profiles.length > 0 ? v.profiles : v.profile !== void 0 ? [v.profile] : []).length < 1) ctx.addIssue({
24890
+ code: ZodIssueCode.custom,
24891
+ message: "pass profiles[] (min 1) or legacy profile",
24892
+ path: ["profiles"]
24893
+ });
24760
24894
  }), ExportRecordSchema, {
24761
24895
  kind: "mutation",
24762
24896
  auth: "protected"
@@ -29356,6 +29490,12 @@ Object.freeze({
29356
29490
  addonId: null,
29357
29491
  access: "create"
29358
29492
  },
29493
+ "pipelineAnalytics.reconcileFromDisk": {
29494
+ capName: "pipeline-analytics",
29495
+ capScope: "device",
29496
+ addonId: null,
29497
+ access: "create"
29498
+ },
29359
29499
  "pipelineAnalytics.refreshStorageLocationsForMigration": {
29360
29500
  capName: "pipeline-analytics",
29361
29501
  capScope: "device",
@@ -29758,6 +29898,12 @@ Object.freeze({
29758
29898
  addonId: null,
29759
29899
  access: "view"
29760
29900
  },
29901
+ "pipelineOrchestrator.getReconcileFromDiskStatus": {
29902
+ capName: "pipeline-orchestrator",
29903
+ capScope: "system",
29904
+ addonId: null,
29905
+ access: "view"
29906
+ },
29761
29907
  "pipelineOrchestrator.listAgentSettings": {
29762
29908
  capName: "pipeline-orchestrator",
29763
29909
  capScope: "system",
@@ -29782,6 +29928,12 @@ Object.freeze({
29782
29928
  addonId: null,
29783
29929
  access: "create"
29784
29930
  },
29931
+ "pipelineOrchestrator.reconcileFromDisk": {
29932
+ capName: "pipeline-orchestrator",
29933
+ capScope: "system",
29934
+ addonId: null,
29935
+ access: "create"
29936
+ },
29785
29937
  "pipelineOrchestrator.removeAgentSettings": {
29786
29938
  capName: "pipeline-orchestrator",
29787
29939
  capScope: "system",
@@ -32773,6 +32925,11 @@ Object.freeze({
32773
32925
  form: "single",
32774
32926
  optional: true
32775
32927
  }],
32928
+ "pipelineAnalytics.reconcileFromDisk": [{
32929
+ name: "deviceId",
32930
+ form: "single",
32931
+ optional: false
32932
+ }],
32776
32933
  "pipelineAnalytics.restageRetrainTrack": [{
32777
32934
  name: "deviceId",
32778
32935
  form: "single",
@@ -33838,6 +33995,8 @@ DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
33838
33995
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
33839
33996
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
33840
33997
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
33998
+ var MB = 1024 * 1024;
33999
+ 1024 * MB, 3072 * MB;
33841
34000
  //#endregion
33842
34001
  //#region src/custom-actions.ts
33843
34002
  /**
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.28",
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",