@camstack/addon-provider-dreame 0.2.20 → 0.2.22

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 (3) hide show
  1. package/dist/addon.js +187 -44
  2. package/dist/addon.mjs +187 -44
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -50504,7 +50504,7 @@ objectType({
50504
50504
  })
50505
50505
  });
50506
50506
  //#endregion
50507
- //#region ../types/dist/event-category-Bxo5yJjt.mjs
50507
+ //#region ../types/dist/event-category-XfKNtfCc.mjs
50508
50508
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
50509
50509
  EventCategory["SystemBoot"] = "system.boot";
50510
50510
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -50521,9 +50521,10 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
50521
50521
  EventCategory["SystemRestartCompleted"] = "system.restart-completed";
50522
50522
  /**
50523
50523
  * A newer addon or server-root package version was found by the
50524
- * authoritative registry check. Emitted once per
50525
- * `(target, packageName, currentVersion, latestVersion)` transition; repeated
50526
- * polling of the same result is deduplicated by the checker.
50524
+ * authoritative registry check. Emitted once when any observed
50525
+ * `latestVersion` changes (or a package/node first appears behind);
50526
+ * the payload carries the full currently-available list. Repeated
50527
+ * polling of the same latests is silent.
50527
50528
  */
50528
50529
  EventCategory["UpdateAvailable"] = "update.available";
50529
50530
  /**
@@ -50542,6 +50543,22 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
50542
50543
  EventCategory["AddonInstalled"] = "addon.installed";
50543
50544
  EventCategory["AddonUninstalled"] = "addon.uninstalled";
50544
50545
  EventCategory["AddonCrashed"] = "addon.crashed";
50546
+ /**
50547
+ * A RUNNER the D6 crash circuit-breaker gave up on — terminal.
50548
+ *
50549
+ * `AddonCrashed` is the routine, self-healing fact ("it crashed; it is being
50550
+ * respawned"); this is the one that never resolves itself. Emitted exactly
50551
+ * once per trip, by `process-service.ts`, carrying the node, the runner, the
50552
+ * addons it hosted and the crash count that tripped the breaker.
50553
+ *
50554
+ * It exists because a runner marked terminally `failed` used to be SILENT:
50555
+ * on 2026-08-18 the `recorder` runner died of three unhandled ffmpeg spawn
50556
+ * errors, the breaker stopped respawning it (correctly), `/health` kept
50557
+ * returning 200, and fleet-wide recording was gone for 3h15 before the
50558
+ * operator's phone told him. The Notification Center's system-event intake
50559
+ * consumes this category and maps it to the `addon-crash-loop` kind.
50560
+ */
50561
+ EventCategory["AddonRunnerFailed"] = "addon.runner-failed";
50545
50562
  EventCategory["AddonError"] = "addon.error";
50546
50563
  EventCategory["AddonPageReady"] = "addon.page-ready";
50547
50564
  EventCategory["AddonWidgetReady"] = "addon.widget-ready";
@@ -58053,6 +58070,10 @@ var RecordingBandSchema = object({
58053
58070
  preBufferSec: number().min(0).optional(),
58054
58071
  postBufferSec: number().min(0).optional()
58055
58072
  });
58073
+ ({
58074
+ preBufferSec: 10,
58075
+ postBufferSec: 30
58076
+ }).postBufferSec * 1e3;
58056
58077
  /**
58057
58078
  * Per-device retention overrides. Every field is optional; an unset or `0`
58058
58079
  * value inherits the node-wide recorder default. Only footage-lifetime limits
@@ -58100,6 +58121,12 @@ var RecordingConfigSchema = object({
58100
58121
  /** DERIVED summary of `bands`, stamped by the recorder on every save.
58101
58122
  * Authoring it has no effect — see {@link RecordingStorageModeSchema}. */
58102
58123
  mode: RecordingStorageModeSchema.optional(),
58124
+ /**
58125
+ * Which assigned broker slots to record. Absent / empty = {@link
58126
+ * DEFAULT_RECORDING_PROFILES} (`high`+`low`) intersected with the
58127
+ * camera's currently assigned slots — never `mid` unless the operator
58128
+ * picks it, and never a slot the broker has not assigned.
58129
+ */
58103
58130
  profiles: array(CamProfileSchema).optional(),
58104
58131
  segmentSeconds: number().int().positive().optional(),
58105
58132
  /**
@@ -58180,7 +58207,11 @@ var RelocateFootageInputSchema = object({
58180
58207
  profiles: array(string()).optional(),
58181
58208
  /** Copy throttle in MB/s (default 40) — the drain is a background chore,
58182
58209
  * never allowed to starve live writers. */
58183
- throttleMbps: number().min(1).max(1e3).optional()
58210
+ throttleMbps: number().min(1).max(1e3).optional(),
58211
+ /** Move only segments whose startMs is >= this. Absent = the whole source
58212
+ * pile. Used when a full drain is too expensive and the operator only
58213
+ * wants the recent window on the new disk. */
58214
+ sinceMs: number().int().optional()
58184
58215
  });
58185
58216
  /** Internal, lease-scoped participant operation. It is intentionally separate
58186
58217
  * from persistent recording settings: a migration never changes
@@ -65062,6 +65093,7 @@ var NcSystemEventKindSchema = _enum([
65062
65093
  "node-offline",
65063
65094
  "node-inference-unavailable",
65064
65095
  "detection-blind",
65096
+ "addon-crash-loop",
65065
65097
  "addon-update-available",
65066
65098
  "server-update-available",
65067
65099
  "alarm-triggered",
@@ -65069,6 +65101,9 @@ var NcSystemEventKindSchema = _enum([
65069
65101
  "alarm-disarmed",
65070
65102
  "alarm-arming",
65071
65103
  "alarm-arm-refused",
65104
+ "addon-updated",
65105
+ "server-updated",
65106
+ "export-completed",
65072
65107
  "camera-online",
65073
65108
  "camera-offline",
65074
65109
  "camera-disabled",
@@ -66962,13 +66997,19 @@ var RetrainStatusSchema = _enum([
66962
66997
  * "never marked" from "already trained" must read `retrainStatus`.
66963
66998
  *
66964
66999
  * `debug` does NOT pin; it is attention, not durability.
67000
+ *
67001
+ * `favourited` IS a BOOLEAN pin (durability bit), not a retrain lifecycle.
67002
+ * A favourited track is skipped by retention the same way `staging` is, but
67003
+ * it does not enter `none|staging|trained` and has no staging budget.
66965
67004
  */
66966
67005
  var TrackFlagFields = {
66967
67006
  /** Operator marked this track as training material — i.e. `retrainStatus` is
66968
67007
  * `'staging'`. */
66969
67008
  markForTrain: boolean().optional(),
66970
67009
  /** Operator marked this track for diagnostic attention. */
66971
- debug: boolean().optional()
67010
+ debug: boolean().optional(),
67011
+ /** Operator favourited this track. Pins it against pruning. */
67012
+ favourited: boolean().optional()
66972
67013
  };
66973
67014
  /**
66974
67015
  * The lifecycle field itself, on the READ surfaces only (`Track`, `KeyEvent`).
@@ -66993,6 +67034,7 @@ var TrackFlagsSchema = object({
66993
67034
  trackId: string(),
66994
67035
  markForTrain: boolean(),
66995
67036
  debug: boolean(),
67037
+ favourited: boolean(),
66996
67038
  /** The lifecycle state the boolean was derived from. Required here (unlike on
66997
67039
  * a track row) because this shape is only ever produced by the write body,
66998
67040
  * which always knows it — and a surface that has just written needs to render
@@ -67625,6 +67667,12 @@ var TrackCascadeCountsSchema = object({
67625
67667
  /** Per-track CLIP search vectors removed (best-effort). */
67626
67668
  embeddings: number().int()
67627
67669
  });
67670
+ /** Disk-wins reconcile: media rows whose blobs are gone, then empty tracks. */
67671
+ var DiskReconcileCountsSchema = object({
67672
+ mediaDropped: number().int(),
67673
+ tracks: number().int(),
67674
+ events: number().int()
67675
+ });
67628
67676
  /** Event-store footprint for one camera. */
67629
67677
  var EventStoreDeviceFootprintSchema = object({
67630
67678
  deviceId: number(),
@@ -67801,6 +67849,9 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
67801
67849
  }), method(object({ deviceId: number() }), TrackCascadeCountsSchema, {
67802
67850
  kind: "mutation",
67803
67851
  auth: "admin"
67852
+ }), method(object({ deviceId: number() }), DiskReconcileCountsSchema, {
67853
+ kind: "mutation",
67854
+ auth: "admin"
67804
67855
  }), method(object({
67805
67856
  deviceId: number(),
67806
67857
  trackIds: array(string()).min(1)
@@ -69351,6 +69402,24 @@ var CameraStatusDegradationSchema = object({
69351
69402
  *
69352
69403
  * See spec: `docs/superpowers/specs/2026-06-24-camera-status-aggregator-cap.md`
69353
69404
  */
69405
+ var DiskReconcileJobSchema = object({
69406
+ state: _enum([
69407
+ "idle",
69408
+ "running",
69409
+ "done",
69410
+ "error"
69411
+ ]),
69412
+ total: number().int().nonnegative(),
69413
+ completed: number().int().nonnegative(),
69414
+ currentDeviceId: number().int().nullable(),
69415
+ failed: array(number().int()).readonly(),
69416
+ mediaDropped: number().int().nonnegative(),
69417
+ tracks: number().int().nonnegative(),
69418
+ events: number().int().nonnegative(),
69419
+ startedAtMs: number().int().nullable(),
69420
+ finishedAtMs: number().int().nullable(),
69421
+ error: string().nullable()
69422
+ });
69354
69423
  var CameraStatusSchema = object({
69355
69424
  deviceId: number(),
69356
69425
  assignment: CameraAssignmentStatusSchema,
@@ -69582,7 +69651,10 @@ method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
69582
69651
  }), CameraSwitchGroupSchema, {
69583
69652
  kind: "mutation",
69584
69653
  auth: "admin"
69585
- }), method(object({ deviceId: number() }), CameraStatusSchema), method(object({ deviceIds: array(number()).optional() }), array(CameraStatusSchema).readonly()), method(_void(), array(PipelineTemplateSchema).readonly()), method(object({
69654
+ }), method(object({ deviceId: number() }), CameraStatusSchema), method(object({ deviceIds: array(number()).optional() }), array(CameraStatusSchema).readonly()), method(_void(), DiskReconcileJobSchema, {
69655
+ kind: "mutation",
69656
+ auth: "admin"
69657
+ }), method(_void(), DiskReconcileJobSchema, { auth: "admin" }), method(_void(), array(PipelineTemplateSchema).readonly()), method(object({
69586
69658
  name: string(),
69587
69659
  description: string().optional(),
69588
69660
  config: CameraPipelineConfigSchema
@@ -70655,20 +70727,6 @@ var VectorStatsResultSchema = object({
70655
70727
  exact: boolean()
70656
70728
  });
70657
70729
  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);
70658
- /**
70659
- * `videoclips` — the unified, navigable-clip surface for a camera.
70660
- *
70661
- * A device-scoped WRAPPER cap (like `pipeline-analytics`): exactly one active
70662
- * provider per device, substitutable. The DEFAULT provider (registered by
70663
- * `addon-post-analysis`, `defaultActive: true`) composes the analytics event
70664
- * log (markers + thumbnails) with the recorder's `getPlaybackManifest` — a clip
70665
- * is a time-WINDOW over existing footage, never a separate file. A camera that
70666
- * exposes NATIVE onboard clips (Reolink/Hikvision NVR) can later substitute the
70667
- * wrapper provider for its device and serve its own clip catalog + URLs.
70668
- *
70669
- * A `Clip` is purely time-based (subtree-blind): playback resolves segments by
70670
- * temporal overlap, so the API never decides `continuous` vs `events`.
70671
- */
70672
70730
  var ClipSchema = object({
70673
70731
  /** Opaque, provider-namespaced id. The default provider encodes the time
70674
70732
  * window so `getClipPlayback` is self-contained (no event re-query). */
@@ -70685,8 +70743,65 @@ var ClipSchema = object({
70685
70743
  startMs: number(),
70686
70744
  endMs: number()
70687
70745
  }),
70688
- /** Thumbnail URL (lazy; e.g. analytics `getEventMedia`). Never inlined. */
70689
- thumbnail: string().optional()
70746
+ /**
70747
+ * Distinct object classes attached to this visit (`person`, `car`, …),
70748
+ * dominant first, capped at {@link MAX_CLIP_LABELS}. The ribbon renders these
70749
+ * instead of the bare kind — "Object" tells the operator nothing a colour bar
70750
+ * did not. Absent (never empty) when the visit attached no classified object
70751
+ * event, so a motion/audio-only visit keeps its kind label.
70752
+ */
70753
+ labels: array(string()).max(3).optional(),
70754
+ /**
70755
+ * Lazy thumbnail URL, never inlined.
70756
+ *
70757
+ * Recording-derived clips (events-mode keep-window, and the prepared
70758
+ * continuous event+fragment visit) MUST use the snapshot of the **main
70759
+ * event of the interval** — `getEventMedia({ eventId, kind: 'snapshot' })`
70760
+ * of the event that owns `kind` (object > motion > audio). Do not extract
70761
+ * a keyframe from the recorded segments. Other providers (onboard, HKSV)
70762
+ * mint their own stills.
70763
+ *
70764
+ * **VOUCHED, never fabricated.** A provider emits this only for an event it
70765
+ * has CONFIRMED owns at least one media row (its own, or its owning track's).
70766
+ * Absent is meaningful — "this visit has no event still" — never "we did not
70767
+ * look". Stamping it from a URL template made 35% of one camera's clips point
70768
+ * at a 404 (device 3836, 2026-08-17: 64 of 179 clips dead, 63 of them motion).
70769
+ * A read that FAILS drops the claim; it never invents it.
70770
+ */
70771
+ thumbnail: string().optional(),
70772
+ /**
70773
+ * An instant INSIDE this visit's footage, hole-safe, where a recorded still
70774
+ * can be decoded. Present whenever the visit came from recorded availability;
70775
+ * absent on a per-event padded window (there is no footage to promise).
70776
+ *
70777
+ * This is not a thumbnail and not a second byte path: it is the argument to
70778
+ * the recorder's existing still route. The surface — never the provider —
70779
+ * decides whether to use it. It is the midpoint of the visit's LONGEST
70780
+ * contiguous range, not of the visit: a visit spans its holes by
70781
+ * construction, so a naive midpoint lands in dead air.
70782
+ */
70783
+ stillAtMs: number().optional(),
70784
+ /**
70785
+ * Analytics event ids that overlap this visit — a BOUNDED sample, newest
70786
+ * first within kind (object → motion → audio), capped at
70787
+ * {@link MAX_CLIP_EVENT_IDS}. Empty on footage-only clips.
70788
+ *
70789
+ * Bounded because it is not a payload the surface pages through: one visit on
70790
+ * device 615 carried 2 345 ids, and `eventIds` was 99% of a 153 KB
70791
+ * camera-day. Read {@link eventCount} for the true total.
70792
+ */
70793
+ eventIds: array(string()).optional(),
70794
+ /** How many analytics events actually overlap this visit. Differs from
70795
+ * `eventIds.length` exactly when the sample was capped — so a truncated
70796
+ * list is never mistaken for a quiet visit. */
70797
+ eventCount: number().int().nonnegative().optional(),
70798
+ /** Intra-visit footage holes (GOP rolls, discarded segments) still shorter
70799
+ * than `VISIT_MERGE_GAP_MS`. Playback concatenates around them; the timeline
70800
+ * bar keeps showing them via `recording.getAvailability`. */
70801
+ holes: array(object({
70802
+ startMs: number(),
70803
+ endMs: number()
70804
+ })).optional()
70690
70805
  });
70691
70806
  var ClipPlaybackSchema = object({
70692
70807
  /** HLS master URL through the hub data-plane (Range + token in path). */
@@ -71150,7 +71265,14 @@ var SearchResultSchema = object({
71150
71265
  });
71151
71266
  var AutoUpdateSettingsSchema = object({
71152
71267
  channel: ChannelSchema,
71153
- intervalSeconds: number()
71268
+ intervalSeconds: number(),
71269
+ /**
71270
+ * Cadence of the "an update exists" POLLER, in seconds. Independent of
71271
+ * `channel`: the poller runs while auto-apply is `off`, because being told
71272
+ * about a publish and installing it are different decisions. Clamped
71273
+ * server-side to 900 s … 604800 s; defaults to 21600 s (6 h).
71274
+ */
71275
+ updateCheckIntervalSeconds: number()
71154
71276
  });
71155
71277
  var AddonAutoUpdateSchema = ChannelWithInheritSchema;
71156
71278
  var RestartAddonResultSchema = unknown();
@@ -71291,7 +71413,9 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
71291
71413
  auth: "admin"
71292
71414
  }), method(_void(), AutoUpdateSettingsSchema, { auth: "admin" }), method(object({
71293
71415
  channel: ChannelSchema,
71294
- intervalSeconds: number().min(300).max(86400).optional()
71416
+ intervalSeconds: number().min(300).max(86400).optional(),
71417
+ /** Availability-poll cadence; see AutoUpdateSettingsSchema. */
71418
+ updateCheckIntervalSeconds: number().min(900).max(604800).optional()
71295
71419
  }), unknown(), {
71296
71420
  kind: "mutation",
71297
71421
  auth: "admin"
@@ -76997,7 +77121,9 @@ var ExportOptionsSchema = object({
76997
77121
  includeAudio: boolean(),
76998
77122
  maxLifeMs: number().int().positive(),
76999
77123
  deleteAfterDownload: boolean(),
77000
- title: string().max(200).optional()
77124
+ title: string().max(200).optional(),
77125
+ /** Notification-output target ids to ping when this export becomes ready. */
77126
+ notifyTargetIds: array(string().min(1)).max(20).optional()
77001
77127
  }).superRefine((v, ctx) => {
77002
77128
  if (v.speed !== void 0 && v.timelapse !== void 0) ctx.addIssue({
77003
77129
  code: ZodIssueCode.custom,
@@ -77056,10 +77182,18 @@ var ExportBytesSchema = object({
77056
77182
  });
77057
77183
  method(object({
77058
77184
  deviceId: number(),
77059
- profile: string(),
77185
+ /** @deprecated Prefer `profiles`. Kept so timelapse/notifiers keep working. */
77186
+ profile: string().optional(),
77187
+ profiles: array(string()).min(1).optional(),
77060
77188
  fromMs: number(),
77061
77189
  toMs: number(),
77062
77190
  options: ExportOptionsSchema
77191
+ }).superRefine((v, ctx) => {
77192
+ if ((v.profiles !== void 0 && v.profiles.length > 0 ? v.profiles : v.profile !== void 0 ? [v.profile] : []).length < 1) ctx.addIssue({
77193
+ code: ZodIssueCode.custom,
77194
+ message: "pass profiles[] (min 1) or legacy profile",
77195
+ path: ["profiles"]
77196
+ });
77063
77197
  }), ExportRecordSchema, {
77064
77198
  kind: "mutation",
77065
77199
  auth: "protected"
@@ -80001,15 +80135,6 @@ var BaseDeviceProvider = class extends BaseAddon {
80001
80135
  labels: ["probe not implemented"]
80002
80136
  };
80003
80137
  }
80004
- /**
80005
- * Top-level devices restored at once in {@link onRestoreDevices}.
80006
- *
80007
- * Four covers the fleets this ships to without turning a boot into a burst a
80008
- * camera NVR answers with a refusal. A provider whose upstream is a single
80009
- * session with a serial command channel (a Baichuan hub, an NVR that
80010
- * serialises ISAPI) should lower it; nothing needs to raise it.
80011
- */
80012
- restoreConcurrency = 4;
80013
80138
  async restoreDevices(savedDevices) {
80014
80139
  await this.onRestoreDevices(savedDevices);
80015
80140
  if (savedDevices.length > 0) this.ctx.logger.info(`Restored ${savedDevices.length} ${this.providerName} device(s)`);
@@ -80064,14 +80189,7 @@ var BaseDeviceProvider = class extends BaseAddon {
80064
80189
  });
80065
80190
  }
80066
80191
  };
80067
- let nextTopLevel = 0;
80068
- await Promise.all(Array.from({ length: Math.min(Math.max(1, this.restoreConcurrency), topLevel.length) }, async () => {
80069
- for (;;) {
80070
- const saved = topLevel[nextTopLevel++];
80071
- if (saved === void 0) return;
80072
- await restoreOne(saved);
80073
- }
80074
- }));
80192
+ await Promise.all(topLevel.map((saved) => restoreOne(saved)));
80075
80193
  const childRows = savedDevices.filter((s) => s.parentDeviceId !== null);
80076
80194
  for (const saved of childRows) {
80077
80195
  const Class = this.deviceClasses[saved.type];
@@ -83344,6 +83462,12 @@ Object.freeze({
83344
83462
  addonId: null,
83345
83463
  access: "create"
83346
83464
  },
83465
+ "pipelineAnalytics.reconcileFromDisk": {
83466
+ capName: "pipeline-analytics",
83467
+ capScope: "device",
83468
+ addonId: null,
83469
+ access: "create"
83470
+ },
83347
83471
  "pipelineAnalytics.refreshStorageLocationsForMigration": {
83348
83472
  capName: "pipeline-analytics",
83349
83473
  capScope: "device",
@@ -83746,6 +83870,12 @@ Object.freeze({
83746
83870
  addonId: null,
83747
83871
  access: "view"
83748
83872
  },
83873
+ "pipelineOrchestrator.getReconcileFromDiskStatus": {
83874
+ capName: "pipeline-orchestrator",
83875
+ capScope: "system",
83876
+ addonId: null,
83877
+ access: "view"
83878
+ },
83749
83879
  "pipelineOrchestrator.listAgentSettings": {
83750
83880
  capName: "pipeline-orchestrator",
83751
83881
  capScope: "system",
@@ -83770,6 +83900,12 @@ Object.freeze({
83770
83900
  addonId: null,
83771
83901
  access: "create"
83772
83902
  },
83903
+ "pipelineOrchestrator.reconcileFromDisk": {
83904
+ capName: "pipeline-orchestrator",
83905
+ capScope: "system",
83906
+ addonId: null,
83907
+ access: "create"
83908
+ },
83773
83909
  "pipelineOrchestrator.removeAgentSettings": {
83774
83910
  capName: "pipeline-orchestrator",
83775
83911
  capScope: "system",
@@ -86761,6 +86897,11 @@ Object.freeze({
86761
86897
  form: "single",
86762
86898
  optional: true
86763
86899
  }],
86900
+ "pipelineAnalytics.reconcileFromDisk": [{
86901
+ name: "deviceId",
86902
+ form: "single",
86903
+ optional: false
86904
+ }],
86764
86905
  "pipelineAnalytics.restageRetrainTrack": [{
86765
86906
  name: "deviceId",
86766
86907
  form: "single",
@@ -87826,6 +87967,8 @@ DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
87826
87967
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
87827
87968
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
87828
87969
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
87970
+ var MB = 1024 * 1024;
87971
+ 1024 * MB, 3072 * MB;
87829
87972
  //#endregion
87830
87973
  //#region src/config.ts
87831
87974
  /**
package/dist/addon.mjs CHANGED
@@ -50504,7 +50504,7 @@ objectType({
50504
50504
  })
50505
50505
  });
50506
50506
  //#endregion
50507
- //#region ../types/dist/event-category-Bxo5yJjt.mjs
50507
+ //#region ../types/dist/event-category-XfKNtfCc.mjs
50508
50508
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
50509
50509
  EventCategory["SystemBoot"] = "system.boot";
50510
50510
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -50521,9 +50521,10 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
50521
50521
  EventCategory["SystemRestartCompleted"] = "system.restart-completed";
50522
50522
  /**
50523
50523
  * A newer addon or server-root package version was found by the
50524
- * authoritative registry check. Emitted once per
50525
- * `(target, packageName, currentVersion, latestVersion)` transition; repeated
50526
- * polling of the same result is deduplicated by the checker.
50524
+ * authoritative registry check. Emitted once when any observed
50525
+ * `latestVersion` changes (or a package/node first appears behind);
50526
+ * the payload carries the full currently-available list. Repeated
50527
+ * polling of the same latests is silent.
50527
50528
  */
50528
50529
  EventCategory["UpdateAvailable"] = "update.available";
50529
50530
  /**
@@ -50542,6 +50543,22 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
50542
50543
  EventCategory["AddonInstalled"] = "addon.installed";
50543
50544
  EventCategory["AddonUninstalled"] = "addon.uninstalled";
50544
50545
  EventCategory["AddonCrashed"] = "addon.crashed";
50546
+ /**
50547
+ * A RUNNER the D6 crash circuit-breaker gave up on — terminal.
50548
+ *
50549
+ * `AddonCrashed` is the routine, self-healing fact ("it crashed; it is being
50550
+ * respawned"); this is the one that never resolves itself. Emitted exactly
50551
+ * once per trip, by `process-service.ts`, carrying the node, the runner, the
50552
+ * addons it hosted and the crash count that tripped the breaker.
50553
+ *
50554
+ * It exists because a runner marked terminally `failed` used to be SILENT:
50555
+ * on 2026-08-18 the `recorder` runner died of three unhandled ffmpeg spawn
50556
+ * errors, the breaker stopped respawning it (correctly), `/health` kept
50557
+ * returning 200, and fleet-wide recording was gone for 3h15 before the
50558
+ * operator's phone told him. The Notification Center's system-event intake
50559
+ * consumes this category and maps it to the `addon-crash-loop` kind.
50560
+ */
50561
+ EventCategory["AddonRunnerFailed"] = "addon.runner-failed";
50545
50562
  EventCategory["AddonError"] = "addon.error";
50546
50563
  EventCategory["AddonPageReady"] = "addon.page-ready";
50547
50564
  EventCategory["AddonWidgetReady"] = "addon.widget-ready";
@@ -58053,6 +58070,10 @@ var RecordingBandSchema = object({
58053
58070
  preBufferSec: number().min(0).optional(),
58054
58071
  postBufferSec: number().min(0).optional()
58055
58072
  });
58073
+ ({
58074
+ preBufferSec: 10,
58075
+ postBufferSec: 30
58076
+ }).postBufferSec * 1e3;
58056
58077
  /**
58057
58078
  * Per-device retention overrides. Every field is optional; an unset or `0`
58058
58079
  * value inherits the node-wide recorder default. Only footage-lifetime limits
@@ -58100,6 +58121,12 @@ var RecordingConfigSchema = object({
58100
58121
  /** DERIVED summary of `bands`, stamped by the recorder on every save.
58101
58122
  * Authoring it has no effect — see {@link RecordingStorageModeSchema}. */
58102
58123
  mode: RecordingStorageModeSchema.optional(),
58124
+ /**
58125
+ * Which assigned broker slots to record. Absent / empty = {@link
58126
+ * DEFAULT_RECORDING_PROFILES} (`high`+`low`) intersected with the
58127
+ * camera's currently assigned slots — never `mid` unless the operator
58128
+ * picks it, and never a slot the broker has not assigned.
58129
+ */
58103
58130
  profiles: array(CamProfileSchema).optional(),
58104
58131
  segmentSeconds: number().int().positive().optional(),
58105
58132
  /**
@@ -58180,7 +58207,11 @@ var RelocateFootageInputSchema = object({
58180
58207
  profiles: array(string()).optional(),
58181
58208
  /** Copy throttle in MB/s (default 40) — the drain is a background chore,
58182
58209
  * never allowed to starve live writers. */
58183
- throttleMbps: number().min(1).max(1e3).optional()
58210
+ throttleMbps: number().min(1).max(1e3).optional(),
58211
+ /** Move only segments whose startMs is >= this. Absent = the whole source
58212
+ * pile. Used when a full drain is too expensive and the operator only
58213
+ * wants the recent window on the new disk. */
58214
+ sinceMs: number().int().optional()
58184
58215
  });
58185
58216
  /** Internal, lease-scoped participant operation. It is intentionally separate
58186
58217
  * from persistent recording settings: a migration never changes
@@ -65062,6 +65093,7 @@ var NcSystemEventKindSchema = _enum([
65062
65093
  "node-offline",
65063
65094
  "node-inference-unavailable",
65064
65095
  "detection-blind",
65096
+ "addon-crash-loop",
65065
65097
  "addon-update-available",
65066
65098
  "server-update-available",
65067
65099
  "alarm-triggered",
@@ -65069,6 +65101,9 @@ var NcSystemEventKindSchema = _enum([
65069
65101
  "alarm-disarmed",
65070
65102
  "alarm-arming",
65071
65103
  "alarm-arm-refused",
65104
+ "addon-updated",
65105
+ "server-updated",
65106
+ "export-completed",
65072
65107
  "camera-online",
65073
65108
  "camera-offline",
65074
65109
  "camera-disabled",
@@ -66962,13 +66997,19 @@ var RetrainStatusSchema = _enum([
66962
66997
  * "never marked" from "already trained" must read `retrainStatus`.
66963
66998
  *
66964
66999
  * `debug` does NOT pin; it is attention, not durability.
67000
+ *
67001
+ * `favourited` IS a BOOLEAN pin (durability bit), not a retrain lifecycle.
67002
+ * A favourited track is skipped by retention the same way `staging` is, but
67003
+ * it does not enter `none|staging|trained` and has no staging budget.
66965
67004
  */
66966
67005
  var TrackFlagFields = {
66967
67006
  /** Operator marked this track as training material — i.e. `retrainStatus` is
66968
67007
  * `'staging'`. */
66969
67008
  markForTrain: boolean().optional(),
66970
67009
  /** Operator marked this track for diagnostic attention. */
66971
- debug: boolean().optional()
67010
+ debug: boolean().optional(),
67011
+ /** Operator favourited this track. Pins it against pruning. */
67012
+ favourited: boolean().optional()
66972
67013
  };
66973
67014
  /**
66974
67015
  * The lifecycle field itself, on the READ surfaces only (`Track`, `KeyEvent`).
@@ -66993,6 +67034,7 @@ var TrackFlagsSchema = object({
66993
67034
  trackId: string(),
66994
67035
  markForTrain: boolean(),
66995
67036
  debug: boolean(),
67037
+ favourited: boolean(),
66996
67038
  /** The lifecycle state the boolean was derived from. Required here (unlike on
66997
67039
  * a track row) because this shape is only ever produced by the write body,
66998
67040
  * which always knows it — and a surface that has just written needs to render
@@ -67625,6 +67667,12 @@ var TrackCascadeCountsSchema = object({
67625
67667
  /** Per-track CLIP search vectors removed (best-effort). */
67626
67668
  embeddings: number().int()
67627
67669
  });
67670
+ /** Disk-wins reconcile: media rows whose blobs are gone, then empty tracks. */
67671
+ var DiskReconcileCountsSchema = object({
67672
+ mediaDropped: number().int(),
67673
+ tracks: number().int(),
67674
+ events: number().int()
67675
+ });
67628
67676
  /** Event-store footprint for one camera. */
67629
67677
  var EventStoreDeviceFootprintSchema = object({
67630
67678
  deviceId: number(),
@@ -67801,6 +67849,9 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
67801
67849
  }), method(object({ deviceId: number() }), TrackCascadeCountsSchema, {
67802
67850
  kind: "mutation",
67803
67851
  auth: "admin"
67852
+ }), method(object({ deviceId: number() }), DiskReconcileCountsSchema, {
67853
+ kind: "mutation",
67854
+ auth: "admin"
67804
67855
  }), method(object({
67805
67856
  deviceId: number(),
67806
67857
  trackIds: array(string()).min(1)
@@ -69351,6 +69402,24 @@ var CameraStatusDegradationSchema = object({
69351
69402
  *
69352
69403
  * See spec: `docs/superpowers/specs/2026-06-24-camera-status-aggregator-cap.md`
69353
69404
  */
69405
+ var DiskReconcileJobSchema = object({
69406
+ state: _enum([
69407
+ "idle",
69408
+ "running",
69409
+ "done",
69410
+ "error"
69411
+ ]),
69412
+ total: number().int().nonnegative(),
69413
+ completed: number().int().nonnegative(),
69414
+ currentDeviceId: number().int().nullable(),
69415
+ failed: array(number().int()).readonly(),
69416
+ mediaDropped: number().int().nonnegative(),
69417
+ tracks: number().int().nonnegative(),
69418
+ events: number().int().nonnegative(),
69419
+ startedAtMs: number().int().nullable(),
69420
+ finishedAtMs: number().int().nullable(),
69421
+ error: string().nullable()
69422
+ });
69354
69423
  var CameraStatusSchema = object({
69355
69424
  deviceId: number(),
69356
69425
  assignment: CameraAssignmentStatusSchema,
@@ -69582,7 +69651,10 @@ method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
69582
69651
  }), CameraSwitchGroupSchema, {
69583
69652
  kind: "mutation",
69584
69653
  auth: "admin"
69585
- }), method(object({ deviceId: number() }), CameraStatusSchema), method(object({ deviceIds: array(number()).optional() }), array(CameraStatusSchema).readonly()), method(_void(), array(PipelineTemplateSchema).readonly()), method(object({
69654
+ }), method(object({ deviceId: number() }), CameraStatusSchema), method(object({ deviceIds: array(number()).optional() }), array(CameraStatusSchema).readonly()), method(_void(), DiskReconcileJobSchema, {
69655
+ kind: "mutation",
69656
+ auth: "admin"
69657
+ }), method(_void(), DiskReconcileJobSchema, { auth: "admin" }), method(_void(), array(PipelineTemplateSchema).readonly()), method(object({
69586
69658
  name: string(),
69587
69659
  description: string().optional(),
69588
69660
  config: CameraPipelineConfigSchema
@@ -70655,20 +70727,6 @@ var VectorStatsResultSchema = object({
70655
70727
  exact: boolean()
70656
70728
  });
70657
70729
  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);
70658
- /**
70659
- * `videoclips` — the unified, navigable-clip surface for a camera.
70660
- *
70661
- * A device-scoped WRAPPER cap (like `pipeline-analytics`): exactly one active
70662
- * provider per device, substitutable. The DEFAULT provider (registered by
70663
- * `addon-post-analysis`, `defaultActive: true`) composes the analytics event
70664
- * log (markers + thumbnails) with the recorder's `getPlaybackManifest` — a clip
70665
- * is a time-WINDOW over existing footage, never a separate file. A camera that
70666
- * exposes NATIVE onboard clips (Reolink/Hikvision NVR) can later substitute the
70667
- * wrapper provider for its device and serve its own clip catalog + URLs.
70668
- *
70669
- * A `Clip` is purely time-based (subtree-blind): playback resolves segments by
70670
- * temporal overlap, so the API never decides `continuous` vs `events`.
70671
- */
70672
70730
  var ClipSchema = object({
70673
70731
  /** Opaque, provider-namespaced id. The default provider encodes the time
70674
70732
  * window so `getClipPlayback` is self-contained (no event re-query). */
@@ -70685,8 +70743,65 @@ var ClipSchema = object({
70685
70743
  startMs: number(),
70686
70744
  endMs: number()
70687
70745
  }),
70688
- /** Thumbnail URL (lazy; e.g. analytics `getEventMedia`). Never inlined. */
70689
- thumbnail: string().optional()
70746
+ /**
70747
+ * Distinct object classes attached to this visit (`person`, `car`, …),
70748
+ * dominant first, capped at {@link MAX_CLIP_LABELS}. The ribbon renders these
70749
+ * instead of the bare kind — "Object" tells the operator nothing a colour bar
70750
+ * did not. Absent (never empty) when the visit attached no classified object
70751
+ * event, so a motion/audio-only visit keeps its kind label.
70752
+ */
70753
+ labels: array(string()).max(3).optional(),
70754
+ /**
70755
+ * Lazy thumbnail URL, never inlined.
70756
+ *
70757
+ * Recording-derived clips (events-mode keep-window, and the prepared
70758
+ * continuous event+fragment visit) MUST use the snapshot of the **main
70759
+ * event of the interval** — `getEventMedia({ eventId, kind: 'snapshot' })`
70760
+ * of the event that owns `kind` (object > motion > audio). Do not extract
70761
+ * a keyframe from the recorded segments. Other providers (onboard, HKSV)
70762
+ * mint their own stills.
70763
+ *
70764
+ * **VOUCHED, never fabricated.** A provider emits this only for an event it
70765
+ * has CONFIRMED owns at least one media row (its own, or its owning track's).
70766
+ * Absent is meaningful — "this visit has no event still" — never "we did not
70767
+ * look". Stamping it from a URL template made 35% of one camera's clips point
70768
+ * at a 404 (device 3836, 2026-08-17: 64 of 179 clips dead, 63 of them motion).
70769
+ * A read that FAILS drops the claim; it never invents it.
70770
+ */
70771
+ thumbnail: string().optional(),
70772
+ /**
70773
+ * An instant INSIDE this visit's footage, hole-safe, where a recorded still
70774
+ * can be decoded. Present whenever the visit came from recorded availability;
70775
+ * absent on a per-event padded window (there is no footage to promise).
70776
+ *
70777
+ * This is not a thumbnail and not a second byte path: it is the argument to
70778
+ * the recorder's existing still route. The surface — never the provider —
70779
+ * decides whether to use it. It is the midpoint of the visit's LONGEST
70780
+ * contiguous range, not of the visit: a visit spans its holes by
70781
+ * construction, so a naive midpoint lands in dead air.
70782
+ */
70783
+ stillAtMs: number().optional(),
70784
+ /**
70785
+ * Analytics event ids that overlap this visit — a BOUNDED sample, newest
70786
+ * first within kind (object → motion → audio), capped at
70787
+ * {@link MAX_CLIP_EVENT_IDS}. Empty on footage-only clips.
70788
+ *
70789
+ * Bounded because it is not a payload the surface pages through: one visit on
70790
+ * device 615 carried 2 345 ids, and `eventIds` was 99% of a 153 KB
70791
+ * camera-day. Read {@link eventCount} for the true total.
70792
+ */
70793
+ eventIds: array(string()).optional(),
70794
+ /** How many analytics events actually overlap this visit. Differs from
70795
+ * `eventIds.length` exactly when the sample was capped — so a truncated
70796
+ * list is never mistaken for a quiet visit. */
70797
+ eventCount: number().int().nonnegative().optional(),
70798
+ /** Intra-visit footage holes (GOP rolls, discarded segments) still shorter
70799
+ * than `VISIT_MERGE_GAP_MS`. Playback concatenates around them; the timeline
70800
+ * bar keeps showing them via `recording.getAvailability`. */
70801
+ holes: array(object({
70802
+ startMs: number(),
70803
+ endMs: number()
70804
+ })).optional()
70690
70805
  });
70691
70806
  var ClipPlaybackSchema = object({
70692
70807
  /** HLS master URL through the hub data-plane (Range + token in path). */
@@ -71150,7 +71265,14 @@ var SearchResultSchema = object({
71150
71265
  });
71151
71266
  var AutoUpdateSettingsSchema = object({
71152
71267
  channel: ChannelSchema,
71153
- intervalSeconds: number()
71268
+ intervalSeconds: number(),
71269
+ /**
71270
+ * Cadence of the "an update exists" POLLER, in seconds. Independent of
71271
+ * `channel`: the poller runs while auto-apply is `off`, because being told
71272
+ * about a publish and installing it are different decisions. Clamped
71273
+ * server-side to 900 s … 604800 s; defaults to 21600 s (6 h).
71274
+ */
71275
+ updateCheckIntervalSeconds: number()
71154
71276
  });
71155
71277
  var AddonAutoUpdateSchema = ChannelWithInheritSchema;
71156
71278
  var RestartAddonResultSchema = unknown();
@@ -71291,7 +71413,9 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
71291
71413
  auth: "admin"
71292
71414
  }), method(_void(), AutoUpdateSettingsSchema, { auth: "admin" }), method(object({
71293
71415
  channel: ChannelSchema,
71294
- intervalSeconds: number().min(300).max(86400).optional()
71416
+ intervalSeconds: number().min(300).max(86400).optional(),
71417
+ /** Availability-poll cadence; see AutoUpdateSettingsSchema. */
71418
+ updateCheckIntervalSeconds: number().min(900).max(604800).optional()
71295
71419
  }), unknown(), {
71296
71420
  kind: "mutation",
71297
71421
  auth: "admin"
@@ -76997,7 +77121,9 @@ var ExportOptionsSchema = object({
76997
77121
  includeAudio: boolean(),
76998
77122
  maxLifeMs: number().int().positive(),
76999
77123
  deleteAfterDownload: boolean(),
77000
- title: string().max(200).optional()
77124
+ title: string().max(200).optional(),
77125
+ /** Notification-output target ids to ping when this export becomes ready. */
77126
+ notifyTargetIds: array(string().min(1)).max(20).optional()
77001
77127
  }).superRefine((v, ctx) => {
77002
77128
  if (v.speed !== void 0 && v.timelapse !== void 0) ctx.addIssue({
77003
77129
  code: ZodIssueCode.custom,
@@ -77056,10 +77182,18 @@ var ExportBytesSchema = object({
77056
77182
  });
77057
77183
  method(object({
77058
77184
  deviceId: number(),
77059
- profile: string(),
77185
+ /** @deprecated Prefer `profiles`. Kept so timelapse/notifiers keep working. */
77186
+ profile: string().optional(),
77187
+ profiles: array(string()).min(1).optional(),
77060
77188
  fromMs: number(),
77061
77189
  toMs: number(),
77062
77190
  options: ExportOptionsSchema
77191
+ }).superRefine((v, ctx) => {
77192
+ if ((v.profiles !== void 0 && v.profiles.length > 0 ? v.profiles : v.profile !== void 0 ? [v.profile] : []).length < 1) ctx.addIssue({
77193
+ code: ZodIssueCode.custom,
77194
+ message: "pass profiles[] (min 1) or legacy profile",
77195
+ path: ["profiles"]
77196
+ });
77063
77197
  }), ExportRecordSchema, {
77064
77198
  kind: "mutation",
77065
77199
  auth: "protected"
@@ -80001,15 +80135,6 @@ var BaseDeviceProvider = class extends BaseAddon {
80001
80135
  labels: ["probe not implemented"]
80002
80136
  };
80003
80137
  }
80004
- /**
80005
- * Top-level devices restored at once in {@link onRestoreDevices}.
80006
- *
80007
- * Four covers the fleets this ships to without turning a boot into a burst a
80008
- * camera NVR answers with a refusal. A provider whose upstream is a single
80009
- * session with a serial command channel (a Baichuan hub, an NVR that
80010
- * serialises ISAPI) should lower it; nothing needs to raise it.
80011
- */
80012
- restoreConcurrency = 4;
80013
80138
  async restoreDevices(savedDevices) {
80014
80139
  await this.onRestoreDevices(savedDevices);
80015
80140
  if (savedDevices.length > 0) this.ctx.logger.info(`Restored ${savedDevices.length} ${this.providerName} device(s)`);
@@ -80064,14 +80189,7 @@ var BaseDeviceProvider = class extends BaseAddon {
80064
80189
  });
80065
80190
  }
80066
80191
  };
80067
- let nextTopLevel = 0;
80068
- await Promise.all(Array.from({ length: Math.min(Math.max(1, this.restoreConcurrency), topLevel.length) }, async () => {
80069
- for (;;) {
80070
- const saved = topLevel[nextTopLevel++];
80071
- if (saved === void 0) return;
80072
- await restoreOne(saved);
80073
- }
80074
- }));
80192
+ await Promise.all(topLevel.map((saved) => restoreOne(saved)));
80075
80193
  const childRows = savedDevices.filter((s) => s.parentDeviceId !== null);
80076
80194
  for (const saved of childRows) {
80077
80195
  const Class = this.deviceClasses[saved.type];
@@ -83344,6 +83462,12 @@ Object.freeze({
83344
83462
  addonId: null,
83345
83463
  access: "create"
83346
83464
  },
83465
+ "pipelineAnalytics.reconcileFromDisk": {
83466
+ capName: "pipeline-analytics",
83467
+ capScope: "device",
83468
+ addonId: null,
83469
+ access: "create"
83470
+ },
83347
83471
  "pipelineAnalytics.refreshStorageLocationsForMigration": {
83348
83472
  capName: "pipeline-analytics",
83349
83473
  capScope: "device",
@@ -83746,6 +83870,12 @@ Object.freeze({
83746
83870
  addonId: null,
83747
83871
  access: "view"
83748
83872
  },
83873
+ "pipelineOrchestrator.getReconcileFromDiskStatus": {
83874
+ capName: "pipeline-orchestrator",
83875
+ capScope: "system",
83876
+ addonId: null,
83877
+ access: "view"
83878
+ },
83749
83879
  "pipelineOrchestrator.listAgentSettings": {
83750
83880
  capName: "pipeline-orchestrator",
83751
83881
  capScope: "system",
@@ -83770,6 +83900,12 @@ Object.freeze({
83770
83900
  addonId: null,
83771
83901
  access: "create"
83772
83902
  },
83903
+ "pipelineOrchestrator.reconcileFromDisk": {
83904
+ capName: "pipeline-orchestrator",
83905
+ capScope: "system",
83906
+ addonId: null,
83907
+ access: "create"
83908
+ },
83773
83909
  "pipelineOrchestrator.removeAgentSettings": {
83774
83910
  capName: "pipeline-orchestrator",
83775
83911
  capScope: "system",
@@ -86761,6 +86897,11 @@ Object.freeze({
86761
86897
  form: "single",
86762
86898
  optional: true
86763
86899
  }],
86900
+ "pipelineAnalytics.reconcileFromDisk": [{
86901
+ name: "deviceId",
86902
+ form: "single",
86903
+ optional: false
86904
+ }],
86764
86905
  "pipelineAnalytics.restageRetrainTrack": [{
86765
86906
  name: "deviceId",
86766
86907
  form: "single",
@@ -87826,6 +87967,8 @@ DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
87826
87967
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
87827
87968
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
87828
87969
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
87970
+ var MB = 1024 * 1024;
87971
+ 1024 * MB, 3072 * MB;
87829
87972
  //#endregion
87830
87973
  //#region src/config.ts
87831
87974
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-dreame",
3
- "version": "0.2.20",
3
+ "version": "0.2.22",
4
4
  "description": "Dreame robot-vacuum / lawn-mower device-provider addon for CamStack — wraps the @apocaliss92/nodedreame Dreamehome cloud client",
5
5
  "keywords": [
6
6
  "camstack",