@camstack/addon-provider-reolink 1.2.41 → 1.2.43
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.
- package/dist/addon.js +211 -44
- package/dist/addon.mjs +211 -44
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -26,7 +26,7 @@ let fs_promises = require("fs/promises");
|
|
|
26
26
|
fs_promises = require_chunk.__toESM(fs_promises, 1);
|
|
27
27
|
let node_os = require("node:os");
|
|
28
28
|
node_os = require_chunk.__toESM(node_os);
|
|
29
|
-
//#region ../types/dist/event-category-
|
|
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
|
|
47
|
-
* `(
|
|
48
|
-
*
|
|
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";
|
|
@@ -7587,6 +7604,10 @@ var RecordingBandSchema = object({
|
|
|
7587
7604
|
preBufferSec: number().min(0).optional(),
|
|
7588
7605
|
postBufferSec: number().min(0).optional()
|
|
7589
7606
|
});
|
|
7607
|
+
({
|
|
7608
|
+
preBufferSec: 10,
|
|
7609
|
+
postBufferSec: 30
|
|
7610
|
+
}).postBufferSec * 1e3;
|
|
7590
7611
|
/**
|
|
7591
7612
|
* Per-device retention overrides. Every field is optional; an unset or `0`
|
|
7592
7613
|
* value inherits the node-wide recorder default. Only footage-lifetime limits
|
|
@@ -7634,6 +7655,12 @@ var RecordingConfigSchema = object({
|
|
|
7634
7655
|
/** DERIVED summary of `bands`, stamped by the recorder on every save.
|
|
7635
7656
|
* Authoring it has no effect — see {@link RecordingStorageModeSchema}. */
|
|
7636
7657
|
mode: RecordingStorageModeSchema.optional(),
|
|
7658
|
+
/**
|
|
7659
|
+
* Which assigned broker slots to record. Absent / empty = {@link
|
|
7660
|
+
* DEFAULT_RECORDING_PROFILES} (`high`+`low`) intersected with the
|
|
7661
|
+
* camera's currently assigned slots — never `mid` unless the operator
|
|
7662
|
+
* picks it, and never a slot the broker has not assigned.
|
|
7663
|
+
*/
|
|
7637
7664
|
profiles: array(CamProfileSchema).optional(),
|
|
7638
7665
|
segmentSeconds: number().int().positive().optional(),
|
|
7639
7666
|
/**
|
|
@@ -7714,7 +7741,11 @@ var RelocateFootageInputSchema = object({
|
|
|
7714
7741
|
profiles: array(string()).optional(),
|
|
7715
7742
|
/** Copy throttle in MB/s (default 40) — the drain is a background chore,
|
|
7716
7743
|
* never allowed to starve live writers. */
|
|
7717
|
-
throttleMbps: number().min(1).max(1e3).optional()
|
|
7744
|
+
throttleMbps: number().min(1).max(1e3).optional(),
|
|
7745
|
+
/** Move only segments whose startMs is >= this. Absent = the whole source
|
|
7746
|
+
* pile. Used when a full drain is too expensive and the operator only
|
|
7747
|
+
* wants the recent window on the new disk. */
|
|
7748
|
+
sinceMs: number().int().optional()
|
|
7718
7749
|
});
|
|
7719
7750
|
/** Internal, lease-scoped participant operation. It is intentionally separate
|
|
7720
7751
|
* from persistent recording settings: a migration never changes
|
|
@@ -14766,6 +14797,7 @@ var NcSystemEventKindSchema = _enum([
|
|
|
14766
14797
|
"node-offline",
|
|
14767
14798
|
"node-inference-unavailable",
|
|
14768
14799
|
"detection-blind",
|
|
14800
|
+
"addon-crash-loop",
|
|
14769
14801
|
"addon-update-available",
|
|
14770
14802
|
"server-update-available",
|
|
14771
14803
|
"alarm-triggered",
|
|
@@ -14773,6 +14805,9 @@ var NcSystemEventKindSchema = _enum([
|
|
|
14773
14805
|
"alarm-disarmed",
|
|
14774
14806
|
"alarm-arming",
|
|
14775
14807
|
"alarm-arm-refused",
|
|
14808
|
+
"addon-updated",
|
|
14809
|
+
"server-updated",
|
|
14810
|
+
"export-completed",
|
|
14776
14811
|
"camera-online",
|
|
14777
14812
|
"camera-offline",
|
|
14778
14813
|
"camera-disabled",
|
|
@@ -16666,13 +16701,19 @@ var RetrainStatusSchema = _enum([
|
|
|
16666
16701
|
* "never marked" from "already trained" must read `retrainStatus`.
|
|
16667
16702
|
*
|
|
16668
16703
|
* `debug` does NOT pin; it is attention, not durability.
|
|
16704
|
+
*
|
|
16705
|
+
* `favourited` IS a BOOLEAN pin (durability bit), not a retrain lifecycle.
|
|
16706
|
+
* A favourited track is skipped by retention the same way `staging` is, but
|
|
16707
|
+
* it does not enter `none|staging|trained` and has no staging budget.
|
|
16669
16708
|
*/
|
|
16670
16709
|
var TrackFlagFields = {
|
|
16671
16710
|
/** Operator marked this track as training material — i.e. `retrainStatus` is
|
|
16672
16711
|
* `'staging'`. */
|
|
16673
16712
|
markForTrain: boolean().optional(),
|
|
16674
16713
|
/** Operator marked this track for diagnostic attention. */
|
|
16675
|
-
debug: boolean().optional()
|
|
16714
|
+
debug: boolean().optional(),
|
|
16715
|
+
/** Operator favourited this track. Pins it against pruning. */
|
|
16716
|
+
favourited: boolean().optional()
|
|
16676
16717
|
};
|
|
16677
16718
|
/**
|
|
16678
16719
|
* The lifecycle field itself, on the READ surfaces only (`Track`, `KeyEvent`).
|
|
@@ -16697,6 +16738,7 @@ var TrackFlagsSchema = object({
|
|
|
16697
16738
|
trackId: string(),
|
|
16698
16739
|
markForTrain: boolean(),
|
|
16699
16740
|
debug: boolean(),
|
|
16741
|
+
favourited: boolean(),
|
|
16700
16742
|
/** The lifecycle state the boolean was derived from. Required here (unlike on
|
|
16701
16743
|
* a track row) because this shape is only ever produced by the write body,
|
|
16702
16744
|
* which always knows it — and a surface that has just written needs to render
|
|
@@ -17329,6 +17371,12 @@ var TrackCascadeCountsSchema = object({
|
|
|
17329
17371
|
/** Per-track CLIP search vectors removed (best-effort). */
|
|
17330
17372
|
embeddings: number().int()
|
|
17331
17373
|
});
|
|
17374
|
+
/** Disk-wins reconcile: media rows whose blobs are gone, then empty tracks. */
|
|
17375
|
+
var DiskReconcileCountsSchema = object({
|
|
17376
|
+
mediaDropped: number().int(),
|
|
17377
|
+
tracks: number().int(),
|
|
17378
|
+
events: number().int()
|
|
17379
|
+
});
|
|
17332
17380
|
/** Event-store footprint for one camera. */
|
|
17333
17381
|
var EventStoreDeviceFootprintSchema = object({
|
|
17334
17382
|
deviceId: number(),
|
|
@@ -17505,6 +17553,9 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
17505
17553
|
}), method(object({ deviceId: number() }), TrackCascadeCountsSchema, {
|
|
17506
17554
|
kind: "mutation",
|
|
17507
17555
|
auth: "admin"
|
|
17556
|
+
}), method(object({ deviceId: number() }), DiskReconcileCountsSchema, {
|
|
17557
|
+
kind: "mutation",
|
|
17558
|
+
auth: "admin"
|
|
17508
17559
|
}), method(object({
|
|
17509
17560
|
deviceId: number(),
|
|
17510
17561
|
trackIds: array(string()).min(1)
|
|
@@ -19055,6 +19106,24 @@ var CameraStatusDegradationSchema = object({
|
|
|
19055
19106
|
*
|
|
19056
19107
|
* See spec: `docs/superpowers/specs/2026-06-24-camera-status-aggregator-cap.md`
|
|
19057
19108
|
*/
|
|
19109
|
+
var DiskReconcileJobSchema = object({
|
|
19110
|
+
state: _enum([
|
|
19111
|
+
"idle",
|
|
19112
|
+
"running",
|
|
19113
|
+
"done",
|
|
19114
|
+
"error"
|
|
19115
|
+
]),
|
|
19116
|
+
total: number().int().nonnegative(),
|
|
19117
|
+
completed: number().int().nonnegative(),
|
|
19118
|
+
currentDeviceId: number().int().nullable(),
|
|
19119
|
+
failed: array(number().int()).readonly(),
|
|
19120
|
+
mediaDropped: number().int().nonnegative(),
|
|
19121
|
+
tracks: number().int().nonnegative(),
|
|
19122
|
+
events: number().int().nonnegative(),
|
|
19123
|
+
startedAtMs: number().int().nullable(),
|
|
19124
|
+
finishedAtMs: number().int().nullable(),
|
|
19125
|
+
error: string().nullable()
|
|
19126
|
+
});
|
|
19058
19127
|
var CameraStatusSchema = object({
|
|
19059
19128
|
deviceId: number(),
|
|
19060
19129
|
assignment: CameraAssignmentStatusSchema,
|
|
@@ -19286,7 +19355,10 @@ method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
|
|
|
19286
19355
|
}), CameraSwitchGroupSchema, {
|
|
19287
19356
|
kind: "mutation",
|
|
19288
19357
|
auth: "admin"
|
|
19289
|
-
}), method(object({ deviceId: number() }), CameraStatusSchema), method(object({ deviceIds: array(number()).optional() }), array(CameraStatusSchema).readonly()), method(_void(),
|
|
19358
|
+
}), method(object({ deviceId: number() }), CameraStatusSchema), method(object({ deviceIds: array(number()).optional() }), array(CameraStatusSchema).readonly()), method(_void(), DiskReconcileJobSchema, {
|
|
19359
|
+
kind: "mutation",
|
|
19360
|
+
auth: "admin"
|
|
19361
|
+
}), method(_void(), DiskReconcileJobSchema, { auth: "admin" }), method(_void(), array(PipelineTemplateSchema).readonly()), method(object({
|
|
19290
19362
|
name: string(),
|
|
19291
19363
|
description: string().optional(),
|
|
19292
19364
|
config: CameraPipelineConfigSchema
|
|
@@ -20463,20 +20535,6 @@ var VectorStatsResultSchema = object({
|
|
|
20463
20535
|
exact: boolean()
|
|
20464
20536
|
});
|
|
20465
20537
|
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);
|
|
20466
|
-
/**
|
|
20467
|
-
* `videoclips` — the unified, navigable-clip surface for a camera.
|
|
20468
|
-
*
|
|
20469
|
-
* A device-scoped WRAPPER cap (like `pipeline-analytics`): exactly one active
|
|
20470
|
-
* provider per device, substitutable. The DEFAULT provider (registered by
|
|
20471
|
-
* `addon-post-analysis`, `defaultActive: true`) composes the analytics event
|
|
20472
|
-
* log (markers + thumbnails) with the recorder's `getPlaybackManifest` — a clip
|
|
20473
|
-
* is a time-WINDOW over existing footage, never a separate file. A camera that
|
|
20474
|
-
* exposes NATIVE onboard clips (Reolink/Hikvision NVR) can later substitute the
|
|
20475
|
-
* wrapper provider for its device and serve its own clip catalog + URLs.
|
|
20476
|
-
*
|
|
20477
|
-
* A `Clip` is purely time-based (subtree-blind): playback resolves segments by
|
|
20478
|
-
* temporal overlap, so the API never decides `continuous` vs `events`.
|
|
20479
|
-
*/
|
|
20480
20538
|
var ClipSchema = object({
|
|
20481
20539
|
/** Opaque, provider-namespaced id. The default provider encodes the time
|
|
20482
20540
|
* window so `getClipPlayback` is self-contained (no event re-query). */
|
|
@@ -20493,8 +20551,57 @@ var ClipSchema = object({
|
|
|
20493
20551
|
startMs: number(),
|
|
20494
20552
|
endMs: number()
|
|
20495
20553
|
}),
|
|
20496
|
-
/**
|
|
20497
|
-
thumbnail
|
|
20554
|
+
/**
|
|
20555
|
+
* Lazy thumbnail URL, never inlined.
|
|
20556
|
+
*
|
|
20557
|
+
* Recording-derived clips (events-mode keep-window, and the prepared
|
|
20558
|
+
* continuous event+fragment visit) MUST use the snapshot of the **main
|
|
20559
|
+
* event of the interval** — `getEventMedia({ eventId, kind: 'snapshot' })`
|
|
20560
|
+
* of the event that owns `kind` (object > motion > audio). Do not extract
|
|
20561
|
+
* a keyframe from the recorded segments. Other providers (onboard, HKSV)
|
|
20562
|
+
* mint their own stills.
|
|
20563
|
+
*
|
|
20564
|
+
* **VOUCHED, never fabricated.** A provider emits this only for an event it
|
|
20565
|
+
* has CONFIRMED owns at least one media row (its own, or its owning track's).
|
|
20566
|
+
* Absent is meaningful — "this visit has no event still" — never "we did not
|
|
20567
|
+
* look". Stamping it from a URL template made 35% of one camera's clips point
|
|
20568
|
+
* at a 404 (device 3836, 2026-08-17: 64 of 179 clips dead, 63 of them motion).
|
|
20569
|
+
* A read that FAILS drops the claim; it never invents it.
|
|
20570
|
+
*/
|
|
20571
|
+
thumbnail: string().optional(),
|
|
20572
|
+
/**
|
|
20573
|
+
* An instant INSIDE this visit's footage, hole-safe, where a recorded still
|
|
20574
|
+
* can be decoded. Present whenever the visit came from recorded availability;
|
|
20575
|
+
* absent on a per-event padded window (there is no footage to promise).
|
|
20576
|
+
*
|
|
20577
|
+
* This is not a thumbnail and not a second byte path: it is the argument to
|
|
20578
|
+
* the recorder's existing still route. The surface — never the provider —
|
|
20579
|
+
* decides whether to use it. It is the midpoint of the visit's LONGEST
|
|
20580
|
+
* contiguous range, not of the visit: a visit spans its holes by
|
|
20581
|
+
* construction, so a naive midpoint lands in dead air.
|
|
20582
|
+
*/
|
|
20583
|
+
stillAtMs: number().optional(),
|
|
20584
|
+
/**
|
|
20585
|
+
* Analytics event ids that overlap this visit — a BOUNDED sample, newest
|
|
20586
|
+
* first within kind (object → motion → audio), capped at
|
|
20587
|
+
* {@link MAX_CLIP_EVENT_IDS}. Empty on footage-only clips.
|
|
20588
|
+
*
|
|
20589
|
+
* Bounded because it is not a payload the surface pages through: one visit on
|
|
20590
|
+
* device 615 carried 2 345 ids, and `eventIds` was 99% of a 153 KB
|
|
20591
|
+
* camera-day. Read {@link eventCount} for the true total.
|
|
20592
|
+
*/
|
|
20593
|
+
eventIds: array(string()).optional(),
|
|
20594
|
+
/** How many analytics events actually overlap this visit. Differs from
|
|
20595
|
+
* `eventIds.length` exactly when the sample was capped — so a truncated
|
|
20596
|
+
* list is never mistaken for a quiet visit. */
|
|
20597
|
+
eventCount: number().int().nonnegative().optional(),
|
|
20598
|
+
/** Intra-visit footage holes (GOP rolls, discarded segments) still shorter
|
|
20599
|
+
* than `VISIT_MERGE_GAP_MS`. Playback concatenates around them; the timeline
|
|
20600
|
+
* bar keeps showing them via `recording.getAvailability`. */
|
|
20601
|
+
holes: array(object({
|
|
20602
|
+
startMs: number(),
|
|
20603
|
+
endMs: number()
|
|
20604
|
+
})).optional()
|
|
20498
20605
|
});
|
|
20499
20606
|
var ClipPlaybackSchema = object({
|
|
20500
20607
|
/** HLS master URL through the hub data-plane (Range + token in path). */
|
|
@@ -20958,7 +21065,14 @@ var SearchResultSchema = object({
|
|
|
20958
21065
|
});
|
|
20959
21066
|
var AutoUpdateSettingsSchema = object({
|
|
20960
21067
|
channel: ChannelSchema,
|
|
20961
|
-
intervalSeconds: number()
|
|
21068
|
+
intervalSeconds: number(),
|
|
21069
|
+
/**
|
|
21070
|
+
* Cadence of the "an update exists" POLLER, in seconds. Independent of
|
|
21071
|
+
* `channel`: the poller runs while auto-apply is `off`, because being told
|
|
21072
|
+
* about a publish and installing it are different decisions. Clamped
|
|
21073
|
+
* server-side to 900 s … 604800 s; defaults to 21600 s (6 h).
|
|
21074
|
+
*/
|
|
21075
|
+
updateCheckIntervalSeconds: number()
|
|
20962
21076
|
});
|
|
20963
21077
|
var AddonAutoUpdateSchema = ChannelWithInheritSchema;
|
|
20964
21078
|
var RestartAddonResultSchema = unknown();
|
|
@@ -21099,7 +21213,9 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
|
|
|
21099
21213
|
auth: "admin"
|
|
21100
21214
|
}), method(_void(), AutoUpdateSettingsSchema, { auth: "admin" }), method(object({
|
|
21101
21215
|
channel: ChannelSchema,
|
|
21102
|
-
intervalSeconds: number().min(300).max(86400).optional()
|
|
21216
|
+
intervalSeconds: number().min(300).max(86400).optional(),
|
|
21217
|
+
/** Availability-poll cadence; see AutoUpdateSettingsSchema. */
|
|
21218
|
+
updateCheckIntervalSeconds: number().min(900).max(604800).optional()
|
|
21103
21219
|
}), unknown(), {
|
|
21104
21220
|
kind: "mutation",
|
|
21105
21221
|
auth: "admin"
|
|
@@ -26867,7 +26983,9 @@ var ExportOptionsSchema = object({
|
|
|
26867
26983
|
includeAudio: boolean(),
|
|
26868
26984
|
maxLifeMs: number().int().positive(),
|
|
26869
26985
|
deleteAfterDownload: boolean(),
|
|
26870
|
-
title: string().max(200).optional()
|
|
26986
|
+
title: string().max(200).optional(),
|
|
26987
|
+
/** Notification-output target ids to ping when this export becomes ready. */
|
|
26988
|
+
notifyTargetIds: array(string().min(1)).max(20).optional()
|
|
26871
26989
|
}).superRefine((v, ctx) => {
|
|
26872
26990
|
if (v.speed !== void 0 && v.timelapse !== void 0) ctx.addIssue({
|
|
26873
26991
|
code: ZodIssueCode$16.custom,
|
|
@@ -26926,10 +27044,18 @@ var ExportBytesSchema = object({
|
|
|
26926
27044
|
});
|
|
26927
27045
|
method(object({
|
|
26928
27046
|
deviceId: number(),
|
|
26929
|
-
|
|
27047
|
+
/** @deprecated Prefer `profiles`. Kept so timelapse/notifiers keep working. */
|
|
27048
|
+
profile: string().optional(),
|
|
27049
|
+
profiles: array(string()).min(1).optional(),
|
|
26930
27050
|
fromMs: number(),
|
|
26931
27051
|
toMs: number(),
|
|
26932
27052
|
options: ExportOptionsSchema
|
|
27053
|
+
}).superRefine((v, ctx) => {
|
|
27054
|
+
if ((v.profiles !== void 0 && v.profiles.length > 0 ? v.profiles : v.profile !== void 0 ? [v.profile] : []).length < 1) ctx.addIssue({
|
|
27055
|
+
code: ZodIssueCode$16.custom,
|
|
27056
|
+
message: "pass profiles[] (min 1) or legacy profile",
|
|
27057
|
+
path: ["profiles"]
|
|
27058
|
+
});
|
|
26933
27059
|
}), ExportRecordSchema, {
|
|
26934
27060
|
kind: "mutation",
|
|
26935
27061
|
auth: "protected"
|
|
@@ -30084,15 +30210,6 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
30084
30210
|
labels: ["probe not implemented"]
|
|
30085
30211
|
};
|
|
30086
30212
|
}
|
|
30087
|
-
/**
|
|
30088
|
-
* Top-level devices restored at once in {@link onRestoreDevices}.
|
|
30089
|
-
*
|
|
30090
|
-
* Four covers the fleets this ships to without turning a boot into a burst a
|
|
30091
|
-
* camera NVR answers with a refusal. A provider whose upstream is a single
|
|
30092
|
-
* session with a serial command channel (a Baichuan hub, an NVR that
|
|
30093
|
-
* serialises ISAPI) should lower it; nothing needs to raise it.
|
|
30094
|
-
*/
|
|
30095
|
-
restoreConcurrency = 4;
|
|
30096
30213
|
async restoreDevices(savedDevices) {
|
|
30097
30214
|
await this.onRestoreDevices(savedDevices);
|
|
30098
30215
|
if (savedDevices.length > 0) this.ctx.logger.info(`Restored ${savedDevices.length} ${this.providerName} device(s)`);
|
|
@@ -30147,14 +30264,7 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
30147
30264
|
});
|
|
30148
30265
|
}
|
|
30149
30266
|
};
|
|
30150
|
-
|
|
30151
|
-
await Promise.all(Array.from({ length: Math.min(Math.max(1, this.restoreConcurrency), topLevel.length) }, async () => {
|
|
30152
|
-
for (;;) {
|
|
30153
|
-
const saved = topLevel[nextTopLevel++];
|
|
30154
|
-
if (saved === void 0) return;
|
|
30155
|
-
await restoreOne(saved);
|
|
30156
|
-
}
|
|
30157
|
-
}));
|
|
30267
|
+
await Promise.all(topLevel.map((saved) => restoreOne(saved)));
|
|
30158
30268
|
const childRows = savedDevices.filter((s) => s.parentDeviceId !== null);
|
|
30159
30269
|
for (const saved of childRows) {
|
|
30160
30270
|
const Class = this.deviceClasses[saved.type];
|
|
@@ -33492,6 +33602,12 @@ Object.freeze({
|
|
|
33492
33602
|
addonId: null,
|
|
33493
33603
|
access: "create"
|
|
33494
33604
|
},
|
|
33605
|
+
"pipelineAnalytics.reconcileFromDisk": {
|
|
33606
|
+
capName: "pipeline-analytics",
|
|
33607
|
+
capScope: "device",
|
|
33608
|
+
addonId: null,
|
|
33609
|
+
access: "create"
|
|
33610
|
+
},
|
|
33495
33611
|
"pipelineAnalytics.refreshStorageLocationsForMigration": {
|
|
33496
33612
|
capName: "pipeline-analytics",
|
|
33497
33613
|
capScope: "device",
|
|
@@ -33894,6 +34010,12 @@ Object.freeze({
|
|
|
33894
34010
|
addonId: null,
|
|
33895
34011
|
access: "view"
|
|
33896
34012
|
},
|
|
34013
|
+
"pipelineOrchestrator.getReconcileFromDiskStatus": {
|
|
34014
|
+
capName: "pipeline-orchestrator",
|
|
34015
|
+
capScope: "system",
|
|
34016
|
+
addonId: null,
|
|
34017
|
+
access: "view"
|
|
34018
|
+
},
|
|
33897
34019
|
"pipelineOrchestrator.listAgentSettings": {
|
|
33898
34020
|
capName: "pipeline-orchestrator",
|
|
33899
34021
|
capScope: "system",
|
|
@@ -33918,6 +34040,12 @@ Object.freeze({
|
|
|
33918
34040
|
addonId: null,
|
|
33919
34041
|
access: "create"
|
|
33920
34042
|
},
|
|
34043
|
+
"pipelineOrchestrator.reconcileFromDisk": {
|
|
34044
|
+
capName: "pipeline-orchestrator",
|
|
34045
|
+
capScope: "system",
|
|
34046
|
+
addonId: null,
|
|
34047
|
+
access: "create"
|
|
34048
|
+
},
|
|
33921
34049
|
"pipelineOrchestrator.removeAgentSettings": {
|
|
33922
34050
|
capName: "pipeline-orchestrator",
|
|
33923
34051
|
capScope: "system",
|
|
@@ -36909,6 +37037,11 @@ Object.freeze({
|
|
|
36909
37037
|
form: "single",
|
|
36910
37038
|
optional: true
|
|
36911
37039
|
}],
|
|
37040
|
+
"pipelineAnalytics.reconcileFromDisk": [{
|
|
37041
|
+
name: "deviceId",
|
|
37042
|
+
form: "single",
|
|
37043
|
+
optional: false
|
|
37044
|
+
}],
|
|
36912
37045
|
"pipelineAnalytics.restageRetrainTrack": [{
|
|
36913
37046
|
name: "deviceId",
|
|
36914
37047
|
form: "single",
|
|
@@ -37974,6 +38107,8 @@ DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
|
|
|
37974
38107
|
DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
|
|
37975
38108
|
DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
|
|
37976
38109
|
DEFAULT_NATIVE_LEASE_SETTINGS.admission;
|
|
38110
|
+
var MB = 1024 * 1024;
|
|
38111
|
+
1024 * MB, 3072 * MB;
|
|
37977
38112
|
//#endregion
|
|
37978
38113
|
//#region ../../node_modules/undici/lib/core/symbols.js
|
|
37979
38114
|
var require_symbols = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
@@ -236782,6 +236917,26 @@ function computeHealthCheckBackoffMs(consecutive) {
|
|
|
236782
236917
|
return 15 * 6e4;
|
|
236783
236918
|
}
|
|
236784
236919
|
//#endregion
|
|
236920
|
+
//#region src/simple-event-dispatch-trace.ts
|
|
236921
|
+
/**
|
|
236922
|
+
* Gate for hub-side simpleEvent traces.
|
|
236923
|
+
*
|
|
236924
|
+
* Hub-child events arrive on the parent's Baichuan socket. Logging them on
|
|
236925
|
+
* the child logger only is invisible when the operator filters Logs to the
|
|
236926
|
+
* Hub; logging every channel unconditionally floods the Hub (battery ticks).
|
|
236927
|
+
* Trace when the target camera — or the hub itself — is under debug.
|
|
236928
|
+
*/
|
|
236929
|
+
function shouldTraceSimpleEventDispatch(input) {
|
|
236930
|
+
return wantsEventTrace(input.hubDebugGeneral, input.hubSocketFlags) || wantsEventTrace(input.childDebugGeneral, input.childSocketFlags);
|
|
236931
|
+
}
|
|
236932
|
+
function wantsEventTrace(debugGeneral, socketFlags) {
|
|
236933
|
+
return debugGeneral || socketFlags.includes("traceEvents");
|
|
236934
|
+
}
|
|
236935
|
+
/** Narrow a persisted `debugSocketLogs` blob to string flags. */
|
|
236936
|
+
function asDebugSocketFlags(value) {
|
|
236937
|
+
return Array.isArray(value) ? value.filter((v) => typeof v === "string") : [];
|
|
236938
|
+
}
|
|
236939
|
+
//#endregion
|
|
236785
236940
|
//#region src/reolink-hub.ts
|
|
236786
236941
|
var HUB_DISCOVERY_REFRESH_TIMEOUT_MS = 8e3;
|
|
236787
236942
|
/**
|
|
@@ -237550,6 +237705,18 @@ var ReolinkHub = class ReolinkHub extends BaseDevice {
|
|
|
237550
237705
|
}
|
|
237551
237706
|
this.ctx.devices.getAll().then((all) => all.find((d) => d.id === deviceId)).then((child) => {
|
|
237552
237707
|
if (!(child instanceof ReolinkCamera)) return;
|
|
237708
|
+
if (shouldTraceSimpleEventDispatch({
|
|
237709
|
+
hubDebugGeneral: this.config.get("debugGeneral") === true,
|
|
237710
|
+
hubSocketFlags: asDebugSocketFlags(this.config.get("debugSocketLogs")),
|
|
237711
|
+
childDebugGeneral: child.config.get("debugGeneral") === true,
|
|
237712
|
+
childSocketFlags: asDebugSocketFlags(child.config.get("debugSocketLogs"))
|
|
237713
|
+
})) this.ctx.logger.info("Reolink Hub: simpleEvent dispatch", { meta: {
|
|
237714
|
+
type: ev?.type ?? "unknown",
|
|
237715
|
+
channel,
|
|
237716
|
+
timestamp: ev?.timestamp,
|
|
237717
|
+
deviceId: child.id,
|
|
237718
|
+
name: child.name
|
|
237719
|
+
} });
|
|
237553
237720
|
child.handleSimpleEvent(ev);
|
|
237554
237721
|
}).catch((err) => {
|
|
237555
237722
|
this.ctx.logger.debug("Hub simpleEvent dispatch failed", { meta: {
|
package/dist/addon.mjs
CHANGED
|
@@ -21,7 +21,7 @@ import netImpl from "net";
|
|
|
21
21
|
import { fileURLToPath } from "url";
|
|
22
22
|
import { mkdir } from "fs/promises";
|
|
23
23
|
import os from "node:os";
|
|
24
|
-
//#region ../types/dist/event-category-
|
|
24
|
+
//#region ../types/dist/event-category-XfKNtfCc.mjs
|
|
25
25
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
26
26
|
EventCategory["SystemBoot"] = "system.boot";
|
|
27
27
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -38,9 +38,10 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
38
38
|
EventCategory["SystemRestartCompleted"] = "system.restart-completed";
|
|
39
39
|
/**
|
|
40
40
|
* A newer addon or server-root package version was found by the
|
|
41
|
-
* authoritative registry check. Emitted once
|
|
42
|
-
* `(
|
|
43
|
-
*
|
|
41
|
+
* authoritative registry check. Emitted once when any observed
|
|
42
|
+
* `latestVersion` changes (or a package/node first appears behind);
|
|
43
|
+
* the payload carries the full currently-available list. Repeated
|
|
44
|
+
* polling of the same latests is silent.
|
|
44
45
|
*/
|
|
45
46
|
EventCategory["UpdateAvailable"] = "update.available";
|
|
46
47
|
/**
|
|
@@ -59,6 +60,22 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
59
60
|
EventCategory["AddonInstalled"] = "addon.installed";
|
|
60
61
|
EventCategory["AddonUninstalled"] = "addon.uninstalled";
|
|
61
62
|
EventCategory["AddonCrashed"] = "addon.crashed";
|
|
63
|
+
/**
|
|
64
|
+
* A RUNNER the D6 crash circuit-breaker gave up on — terminal.
|
|
65
|
+
*
|
|
66
|
+
* `AddonCrashed` is the routine, self-healing fact ("it crashed; it is being
|
|
67
|
+
* respawned"); this is the one that never resolves itself. Emitted exactly
|
|
68
|
+
* once per trip, by `process-service.ts`, carrying the node, the runner, the
|
|
69
|
+
* addons it hosted and the crash count that tripped the breaker.
|
|
70
|
+
*
|
|
71
|
+
* It exists because a runner marked terminally `failed` used to be SILENT:
|
|
72
|
+
* on 2026-08-18 the `recorder` runner died of three unhandled ffmpeg spawn
|
|
73
|
+
* errors, the breaker stopped respawning it (correctly), `/health` kept
|
|
74
|
+
* returning 200, and fleet-wide recording was gone for 3h15 before the
|
|
75
|
+
* operator's phone told him. The Notification Center's system-event intake
|
|
76
|
+
* consumes this category and maps it to the `addon-crash-loop` kind.
|
|
77
|
+
*/
|
|
78
|
+
EventCategory["AddonRunnerFailed"] = "addon.runner-failed";
|
|
62
79
|
EventCategory["AddonError"] = "addon.error";
|
|
63
80
|
EventCategory["AddonPageReady"] = "addon.page-ready";
|
|
64
81
|
EventCategory["AddonWidgetReady"] = "addon.widget-ready";
|
|
@@ -7582,6 +7599,10 @@ var RecordingBandSchema = object({
|
|
|
7582
7599
|
preBufferSec: number().min(0).optional(),
|
|
7583
7600
|
postBufferSec: number().min(0).optional()
|
|
7584
7601
|
});
|
|
7602
|
+
({
|
|
7603
|
+
preBufferSec: 10,
|
|
7604
|
+
postBufferSec: 30
|
|
7605
|
+
}).postBufferSec * 1e3;
|
|
7585
7606
|
/**
|
|
7586
7607
|
* Per-device retention overrides. Every field is optional; an unset or `0`
|
|
7587
7608
|
* value inherits the node-wide recorder default. Only footage-lifetime limits
|
|
@@ -7629,6 +7650,12 @@ var RecordingConfigSchema = object({
|
|
|
7629
7650
|
/** DERIVED summary of `bands`, stamped by the recorder on every save.
|
|
7630
7651
|
* Authoring it has no effect — see {@link RecordingStorageModeSchema}. */
|
|
7631
7652
|
mode: RecordingStorageModeSchema.optional(),
|
|
7653
|
+
/**
|
|
7654
|
+
* Which assigned broker slots to record. Absent / empty = {@link
|
|
7655
|
+
* DEFAULT_RECORDING_PROFILES} (`high`+`low`) intersected with the
|
|
7656
|
+
* camera's currently assigned slots — never `mid` unless the operator
|
|
7657
|
+
* picks it, and never a slot the broker has not assigned.
|
|
7658
|
+
*/
|
|
7632
7659
|
profiles: array(CamProfileSchema).optional(),
|
|
7633
7660
|
segmentSeconds: number().int().positive().optional(),
|
|
7634
7661
|
/**
|
|
@@ -7709,7 +7736,11 @@ var RelocateFootageInputSchema = object({
|
|
|
7709
7736
|
profiles: array(string()).optional(),
|
|
7710
7737
|
/** Copy throttle in MB/s (default 40) — the drain is a background chore,
|
|
7711
7738
|
* never allowed to starve live writers. */
|
|
7712
|
-
throttleMbps: number().min(1).max(1e3).optional()
|
|
7739
|
+
throttleMbps: number().min(1).max(1e3).optional(),
|
|
7740
|
+
/** Move only segments whose startMs is >= this. Absent = the whole source
|
|
7741
|
+
* pile. Used when a full drain is too expensive and the operator only
|
|
7742
|
+
* wants the recent window on the new disk. */
|
|
7743
|
+
sinceMs: number().int().optional()
|
|
7713
7744
|
});
|
|
7714
7745
|
/** Internal, lease-scoped participant operation. It is intentionally separate
|
|
7715
7746
|
* from persistent recording settings: a migration never changes
|
|
@@ -14761,6 +14792,7 @@ var NcSystemEventKindSchema = _enum([
|
|
|
14761
14792
|
"node-offline",
|
|
14762
14793
|
"node-inference-unavailable",
|
|
14763
14794
|
"detection-blind",
|
|
14795
|
+
"addon-crash-loop",
|
|
14764
14796
|
"addon-update-available",
|
|
14765
14797
|
"server-update-available",
|
|
14766
14798
|
"alarm-triggered",
|
|
@@ -14768,6 +14800,9 @@ var NcSystemEventKindSchema = _enum([
|
|
|
14768
14800
|
"alarm-disarmed",
|
|
14769
14801
|
"alarm-arming",
|
|
14770
14802
|
"alarm-arm-refused",
|
|
14803
|
+
"addon-updated",
|
|
14804
|
+
"server-updated",
|
|
14805
|
+
"export-completed",
|
|
14771
14806
|
"camera-online",
|
|
14772
14807
|
"camera-offline",
|
|
14773
14808
|
"camera-disabled",
|
|
@@ -16661,13 +16696,19 @@ var RetrainStatusSchema = _enum([
|
|
|
16661
16696
|
* "never marked" from "already trained" must read `retrainStatus`.
|
|
16662
16697
|
*
|
|
16663
16698
|
* `debug` does NOT pin; it is attention, not durability.
|
|
16699
|
+
*
|
|
16700
|
+
* `favourited` IS a BOOLEAN pin (durability bit), not a retrain lifecycle.
|
|
16701
|
+
* A favourited track is skipped by retention the same way `staging` is, but
|
|
16702
|
+
* it does not enter `none|staging|trained` and has no staging budget.
|
|
16664
16703
|
*/
|
|
16665
16704
|
var TrackFlagFields = {
|
|
16666
16705
|
/** Operator marked this track as training material — i.e. `retrainStatus` is
|
|
16667
16706
|
* `'staging'`. */
|
|
16668
16707
|
markForTrain: boolean().optional(),
|
|
16669
16708
|
/** Operator marked this track for diagnostic attention. */
|
|
16670
|
-
debug: boolean().optional()
|
|
16709
|
+
debug: boolean().optional(),
|
|
16710
|
+
/** Operator favourited this track. Pins it against pruning. */
|
|
16711
|
+
favourited: boolean().optional()
|
|
16671
16712
|
};
|
|
16672
16713
|
/**
|
|
16673
16714
|
* The lifecycle field itself, on the READ surfaces only (`Track`, `KeyEvent`).
|
|
@@ -16692,6 +16733,7 @@ var TrackFlagsSchema = object({
|
|
|
16692
16733
|
trackId: string(),
|
|
16693
16734
|
markForTrain: boolean(),
|
|
16694
16735
|
debug: boolean(),
|
|
16736
|
+
favourited: boolean(),
|
|
16695
16737
|
/** The lifecycle state the boolean was derived from. Required here (unlike on
|
|
16696
16738
|
* a track row) because this shape is only ever produced by the write body,
|
|
16697
16739
|
* which always knows it — and a surface that has just written needs to render
|
|
@@ -17324,6 +17366,12 @@ var TrackCascadeCountsSchema = object({
|
|
|
17324
17366
|
/** Per-track CLIP search vectors removed (best-effort). */
|
|
17325
17367
|
embeddings: number().int()
|
|
17326
17368
|
});
|
|
17369
|
+
/** Disk-wins reconcile: media rows whose blobs are gone, then empty tracks. */
|
|
17370
|
+
var DiskReconcileCountsSchema = object({
|
|
17371
|
+
mediaDropped: number().int(),
|
|
17372
|
+
tracks: number().int(),
|
|
17373
|
+
events: number().int()
|
|
17374
|
+
});
|
|
17327
17375
|
/** Event-store footprint for one camera. */
|
|
17328
17376
|
var EventStoreDeviceFootprintSchema = object({
|
|
17329
17377
|
deviceId: number(),
|
|
@@ -17500,6 +17548,9 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
17500
17548
|
}), method(object({ deviceId: number() }), TrackCascadeCountsSchema, {
|
|
17501
17549
|
kind: "mutation",
|
|
17502
17550
|
auth: "admin"
|
|
17551
|
+
}), method(object({ deviceId: number() }), DiskReconcileCountsSchema, {
|
|
17552
|
+
kind: "mutation",
|
|
17553
|
+
auth: "admin"
|
|
17503
17554
|
}), method(object({
|
|
17504
17555
|
deviceId: number(),
|
|
17505
17556
|
trackIds: array(string()).min(1)
|
|
@@ -19050,6 +19101,24 @@ var CameraStatusDegradationSchema = object({
|
|
|
19050
19101
|
*
|
|
19051
19102
|
* See spec: `docs/superpowers/specs/2026-06-24-camera-status-aggregator-cap.md`
|
|
19052
19103
|
*/
|
|
19104
|
+
var DiskReconcileJobSchema = object({
|
|
19105
|
+
state: _enum([
|
|
19106
|
+
"idle",
|
|
19107
|
+
"running",
|
|
19108
|
+
"done",
|
|
19109
|
+
"error"
|
|
19110
|
+
]),
|
|
19111
|
+
total: number().int().nonnegative(),
|
|
19112
|
+
completed: number().int().nonnegative(),
|
|
19113
|
+
currentDeviceId: number().int().nullable(),
|
|
19114
|
+
failed: array(number().int()).readonly(),
|
|
19115
|
+
mediaDropped: number().int().nonnegative(),
|
|
19116
|
+
tracks: number().int().nonnegative(),
|
|
19117
|
+
events: number().int().nonnegative(),
|
|
19118
|
+
startedAtMs: number().int().nullable(),
|
|
19119
|
+
finishedAtMs: number().int().nullable(),
|
|
19120
|
+
error: string().nullable()
|
|
19121
|
+
});
|
|
19053
19122
|
var CameraStatusSchema = object({
|
|
19054
19123
|
deviceId: number(),
|
|
19055
19124
|
assignment: CameraAssignmentStatusSchema,
|
|
@@ -19281,7 +19350,10 @@ method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
|
|
|
19281
19350
|
}), CameraSwitchGroupSchema, {
|
|
19282
19351
|
kind: "mutation",
|
|
19283
19352
|
auth: "admin"
|
|
19284
|
-
}), method(object({ deviceId: number() }), CameraStatusSchema), method(object({ deviceIds: array(number()).optional() }), array(CameraStatusSchema).readonly()), method(_void(),
|
|
19353
|
+
}), method(object({ deviceId: number() }), CameraStatusSchema), method(object({ deviceIds: array(number()).optional() }), array(CameraStatusSchema).readonly()), method(_void(), DiskReconcileJobSchema, {
|
|
19354
|
+
kind: "mutation",
|
|
19355
|
+
auth: "admin"
|
|
19356
|
+
}), method(_void(), DiskReconcileJobSchema, { auth: "admin" }), method(_void(), array(PipelineTemplateSchema).readonly()), method(object({
|
|
19285
19357
|
name: string(),
|
|
19286
19358
|
description: string().optional(),
|
|
19287
19359
|
config: CameraPipelineConfigSchema
|
|
@@ -20458,20 +20530,6 @@ var VectorStatsResultSchema = object({
|
|
|
20458
20530
|
exact: boolean()
|
|
20459
20531
|
});
|
|
20460
20532
|
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);
|
|
20461
|
-
/**
|
|
20462
|
-
* `videoclips` — the unified, navigable-clip surface for a camera.
|
|
20463
|
-
*
|
|
20464
|
-
* A device-scoped WRAPPER cap (like `pipeline-analytics`): exactly one active
|
|
20465
|
-
* provider per device, substitutable. The DEFAULT provider (registered by
|
|
20466
|
-
* `addon-post-analysis`, `defaultActive: true`) composes the analytics event
|
|
20467
|
-
* log (markers + thumbnails) with the recorder's `getPlaybackManifest` — a clip
|
|
20468
|
-
* is a time-WINDOW over existing footage, never a separate file. A camera that
|
|
20469
|
-
* exposes NATIVE onboard clips (Reolink/Hikvision NVR) can later substitute the
|
|
20470
|
-
* wrapper provider for its device and serve its own clip catalog + URLs.
|
|
20471
|
-
*
|
|
20472
|
-
* A `Clip` is purely time-based (subtree-blind): playback resolves segments by
|
|
20473
|
-
* temporal overlap, so the API never decides `continuous` vs `events`.
|
|
20474
|
-
*/
|
|
20475
20533
|
var ClipSchema = object({
|
|
20476
20534
|
/** Opaque, provider-namespaced id. The default provider encodes the time
|
|
20477
20535
|
* window so `getClipPlayback` is self-contained (no event re-query). */
|
|
@@ -20488,8 +20546,57 @@ var ClipSchema = object({
|
|
|
20488
20546
|
startMs: number(),
|
|
20489
20547
|
endMs: number()
|
|
20490
20548
|
}),
|
|
20491
|
-
/**
|
|
20492
|
-
thumbnail
|
|
20549
|
+
/**
|
|
20550
|
+
* Lazy thumbnail URL, never inlined.
|
|
20551
|
+
*
|
|
20552
|
+
* Recording-derived clips (events-mode keep-window, and the prepared
|
|
20553
|
+
* continuous event+fragment visit) MUST use the snapshot of the **main
|
|
20554
|
+
* event of the interval** — `getEventMedia({ eventId, kind: 'snapshot' })`
|
|
20555
|
+
* of the event that owns `kind` (object > motion > audio). Do not extract
|
|
20556
|
+
* a keyframe from the recorded segments. Other providers (onboard, HKSV)
|
|
20557
|
+
* mint their own stills.
|
|
20558
|
+
*
|
|
20559
|
+
* **VOUCHED, never fabricated.** A provider emits this only for an event it
|
|
20560
|
+
* has CONFIRMED owns at least one media row (its own, or its owning track's).
|
|
20561
|
+
* Absent is meaningful — "this visit has no event still" — never "we did not
|
|
20562
|
+
* look". Stamping it from a URL template made 35% of one camera's clips point
|
|
20563
|
+
* at a 404 (device 3836, 2026-08-17: 64 of 179 clips dead, 63 of them motion).
|
|
20564
|
+
* A read that FAILS drops the claim; it never invents it.
|
|
20565
|
+
*/
|
|
20566
|
+
thumbnail: string().optional(),
|
|
20567
|
+
/**
|
|
20568
|
+
* An instant INSIDE this visit's footage, hole-safe, where a recorded still
|
|
20569
|
+
* can be decoded. Present whenever the visit came from recorded availability;
|
|
20570
|
+
* absent on a per-event padded window (there is no footage to promise).
|
|
20571
|
+
*
|
|
20572
|
+
* This is not a thumbnail and not a second byte path: it is the argument to
|
|
20573
|
+
* the recorder's existing still route. The surface — never the provider —
|
|
20574
|
+
* decides whether to use it. It is the midpoint of the visit's LONGEST
|
|
20575
|
+
* contiguous range, not of the visit: a visit spans its holes by
|
|
20576
|
+
* construction, so a naive midpoint lands in dead air.
|
|
20577
|
+
*/
|
|
20578
|
+
stillAtMs: number().optional(),
|
|
20579
|
+
/**
|
|
20580
|
+
* Analytics event ids that overlap this visit — a BOUNDED sample, newest
|
|
20581
|
+
* first within kind (object → motion → audio), capped at
|
|
20582
|
+
* {@link MAX_CLIP_EVENT_IDS}. Empty on footage-only clips.
|
|
20583
|
+
*
|
|
20584
|
+
* Bounded because it is not a payload the surface pages through: one visit on
|
|
20585
|
+
* device 615 carried 2 345 ids, and `eventIds` was 99% of a 153 KB
|
|
20586
|
+
* camera-day. Read {@link eventCount} for the true total.
|
|
20587
|
+
*/
|
|
20588
|
+
eventIds: array(string()).optional(),
|
|
20589
|
+
/** How many analytics events actually overlap this visit. Differs from
|
|
20590
|
+
* `eventIds.length` exactly when the sample was capped — so a truncated
|
|
20591
|
+
* list is never mistaken for a quiet visit. */
|
|
20592
|
+
eventCount: number().int().nonnegative().optional(),
|
|
20593
|
+
/** Intra-visit footage holes (GOP rolls, discarded segments) still shorter
|
|
20594
|
+
* than `VISIT_MERGE_GAP_MS`. Playback concatenates around them; the timeline
|
|
20595
|
+
* bar keeps showing them via `recording.getAvailability`. */
|
|
20596
|
+
holes: array(object({
|
|
20597
|
+
startMs: number(),
|
|
20598
|
+
endMs: number()
|
|
20599
|
+
})).optional()
|
|
20493
20600
|
});
|
|
20494
20601
|
var ClipPlaybackSchema = object({
|
|
20495
20602
|
/** HLS master URL through the hub data-plane (Range + token in path). */
|
|
@@ -20953,7 +21060,14 @@ var SearchResultSchema = object({
|
|
|
20953
21060
|
});
|
|
20954
21061
|
var AutoUpdateSettingsSchema = object({
|
|
20955
21062
|
channel: ChannelSchema,
|
|
20956
|
-
intervalSeconds: number()
|
|
21063
|
+
intervalSeconds: number(),
|
|
21064
|
+
/**
|
|
21065
|
+
* Cadence of the "an update exists" POLLER, in seconds. Independent of
|
|
21066
|
+
* `channel`: the poller runs while auto-apply is `off`, because being told
|
|
21067
|
+
* about a publish and installing it are different decisions. Clamped
|
|
21068
|
+
* server-side to 900 s … 604800 s; defaults to 21600 s (6 h).
|
|
21069
|
+
*/
|
|
21070
|
+
updateCheckIntervalSeconds: number()
|
|
20957
21071
|
});
|
|
20958
21072
|
var AddonAutoUpdateSchema = ChannelWithInheritSchema;
|
|
20959
21073
|
var RestartAddonResultSchema = unknown();
|
|
@@ -21094,7 +21208,9 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
|
|
|
21094
21208
|
auth: "admin"
|
|
21095
21209
|
}), method(_void(), AutoUpdateSettingsSchema, { auth: "admin" }), method(object({
|
|
21096
21210
|
channel: ChannelSchema,
|
|
21097
|
-
intervalSeconds: number().min(300).max(86400).optional()
|
|
21211
|
+
intervalSeconds: number().min(300).max(86400).optional(),
|
|
21212
|
+
/** Availability-poll cadence; see AutoUpdateSettingsSchema. */
|
|
21213
|
+
updateCheckIntervalSeconds: number().min(900).max(604800).optional()
|
|
21098
21214
|
}), unknown(), {
|
|
21099
21215
|
kind: "mutation",
|
|
21100
21216
|
auth: "admin"
|
|
@@ -26862,7 +26978,9 @@ var ExportOptionsSchema = object({
|
|
|
26862
26978
|
includeAudio: boolean(),
|
|
26863
26979
|
maxLifeMs: number().int().positive(),
|
|
26864
26980
|
deleteAfterDownload: boolean(),
|
|
26865
|
-
title: string().max(200).optional()
|
|
26981
|
+
title: string().max(200).optional(),
|
|
26982
|
+
/** Notification-output target ids to ping when this export becomes ready. */
|
|
26983
|
+
notifyTargetIds: array(string().min(1)).max(20).optional()
|
|
26866
26984
|
}).superRefine((v, ctx) => {
|
|
26867
26985
|
if (v.speed !== void 0 && v.timelapse !== void 0) ctx.addIssue({
|
|
26868
26986
|
code: ZodIssueCode$16.custom,
|
|
@@ -26921,10 +27039,18 @@ var ExportBytesSchema = object({
|
|
|
26921
27039
|
});
|
|
26922
27040
|
method(object({
|
|
26923
27041
|
deviceId: number(),
|
|
26924
|
-
|
|
27042
|
+
/** @deprecated Prefer `profiles`. Kept so timelapse/notifiers keep working. */
|
|
27043
|
+
profile: string().optional(),
|
|
27044
|
+
profiles: array(string()).min(1).optional(),
|
|
26925
27045
|
fromMs: number(),
|
|
26926
27046
|
toMs: number(),
|
|
26927
27047
|
options: ExportOptionsSchema
|
|
27048
|
+
}).superRefine((v, ctx) => {
|
|
27049
|
+
if ((v.profiles !== void 0 && v.profiles.length > 0 ? v.profiles : v.profile !== void 0 ? [v.profile] : []).length < 1) ctx.addIssue({
|
|
27050
|
+
code: ZodIssueCode$16.custom,
|
|
27051
|
+
message: "pass profiles[] (min 1) or legacy profile",
|
|
27052
|
+
path: ["profiles"]
|
|
27053
|
+
});
|
|
26928
27054
|
}), ExportRecordSchema, {
|
|
26929
27055
|
kind: "mutation",
|
|
26930
27056
|
auth: "protected"
|
|
@@ -30079,15 +30205,6 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
30079
30205
|
labels: ["probe not implemented"]
|
|
30080
30206
|
};
|
|
30081
30207
|
}
|
|
30082
|
-
/**
|
|
30083
|
-
* Top-level devices restored at once in {@link onRestoreDevices}.
|
|
30084
|
-
*
|
|
30085
|
-
* Four covers the fleets this ships to without turning a boot into a burst a
|
|
30086
|
-
* camera NVR answers with a refusal. A provider whose upstream is a single
|
|
30087
|
-
* session with a serial command channel (a Baichuan hub, an NVR that
|
|
30088
|
-
* serialises ISAPI) should lower it; nothing needs to raise it.
|
|
30089
|
-
*/
|
|
30090
|
-
restoreConcurrency = 4;
|
|
30091
30208
|
async restoreDevices(savedDevices) {
|
|
30092
30209
|
await this.onRestoreDevices(savedDevices);
|
|
30093
30210
|
if (savedDevices.length > 0) this.ctx.logger.info(`Restored ${savedDevices.length} ${this.providerName} device(s)`);
|
|
@@ -30142,14 +30259,7 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
30142
30259
|
});
|
|
30143
30260
|
}
|
|
30144
30261
|
};
|
|
30145
|
-
|
|
30146
|
-
await Promise.all(Array.from({ length: Math.min(Math.max(1, this.restoreConcurrency), topLevel.length) }, async () => {
|
|
30147
|
-
for (;;) {
|
|
30148
|
-
const saved = topLevel[nextTopLevel++];
|
|
30149
|
-
if (saved === void 0) return;
|
|
30150
|
-
await restoreOne(saved);
|
|
30151
|
-
}
|
|
30152
|
-
}));
|
|
30262
|
+
await Promise.all(topLevel.map((saved) => restoreOne(saved)));
|
|
30153
30263
|
const childRows = savedDevices.filter((s) => s.parentDeviceId !== null);
|
|
30154
30264
|
for (const saved of childRows) {
|
|
30155
30265
|
const Class = this.deviceClasses[saved.type];
|
|
@@ -33487,6 +33597,12 @@ Object.freeze({
|
|
|
33487
33597
|
addonId: null,
|
|
33488
33598
|
access: "create"
|
|
33489
33599
|
},
|
|
33600
|
+
"pipelineAnalytics.reconcileFromDisk": {
|
|
33601
|
+
capName: "pipeline-analytics",
|
|
33602
|
+
capScope: "device",
|
|
33603
|
+
addonId: null,
|
|
33604
|
+
access: "create"
|
|
33605
|
+
},
|
|
33490
33606
|
"pipelineAnalytics.refreshStorageLocationsForMigration": {
|
|
33491
33607
|
capName: "pipeline-analytics",
|
|
33492
33608
|
capScope: "device",
|
|
@@ -33889,6 +34005,12 @@ Object.freeze({
|
|
|
33889
34005
|
addonId: null,
|
|
33890
34006
|
access: "view"
|
|
33891
34007
|
},
|
|
34008
|
+
"pipelineOrchestrator.getReconcileFromDiskStatus": {
|
|
34009
|
+
capName: "pipeline-orchestrator",
|
|
34010
|
+
capScope: "system",
|
|
34011
|
+
addonId: null,
|
|
34012
|
+
access: "view"
|
|
34013
|
+
},
|
|
33892
34014
|
"pipelineOrchestrator.listAgentSettings": {
|
|
33893
34015
|
capName: "pipeline-orchestrator",
|
|
33894
34016
|
capScope: "system",
|
|
@@ -33913,6 +34035,12 @@ Object.freeze({
|
|
|
33913
34035
|
addonId: null,
|
|
33914
34036
|
access: "create"
|
|
33915
34037
|
},
|
|
34038
|
+
"pipelineOrchestrator.reconcileFromDisk": {
|
|
34039
|
+
capName: "pipeline-orchestrator",
|
|
34040
|
+
capScope: "system",
|
|
34041
|
+
addonId: null,
|
|
34042
|
+
access: "create"
|
|
34043
|
+
},
|
|
33916
34044
|
"pipelineOrchestrator.removeAgentSettings": {
|
|
33917
34045
|
capName: "pipeline-orchestrator",
|
|
33918
34046
|
capScope: "system",
|
|
@@ -36904,6 +37032,11 @@ Object.freeze({
|
|
|
36904
37032
|
form: "single",
|
|
36905
37033
|
optional: true
|
|
36906
37034
|
}],
|
|
37035
|
+
"pipelineAnalytics.reconcileFromDisk": [{
|
|
37036
|
+
name: "deviceId",
|
|
37037
|
+
form: "single",
|
|
37038
|
+
optional: false
|
|
37039
|
+
}],
|
|
36907
37040
|
"pipelineAnalytics.restageRetrainTrack": [{
|
|
36908
37041
|
name: "deviceId",
|
|
36909
37042
|
form: "single",
|
|
@@ -37969,6 +38102,8 @@ DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
|
|
|
37969
38102
|
DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
|
|
37970
38103
|
DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
|
|
37971
38104
|
DEFAULT_NATIVE_LEASE_SETTINGS.admission;
|
|
38105
|
+
var MB = 1024 * 1024;
|
|
38106
|
+
1024 * MB, 3072 * MB;
|
|
37972
38107
|
//#endregion
|
|
37973
38108
|
//#region ../../node_modules/undici/lib/core/symbols.js
|
|
37974
38109
|
var require_symbols = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
@@ -236762,6 +236897,26 @@ function computeHealthCheckBackoffMs(consecutive) {
|
|
|
236762
236897
|
return 15 * 6e4;
|
|
236763
236898
|
}
|
|
236764
236899
|
//#endregion
|
|
236900
|
+
//#region src/simple-event-dispatch-trace.ts
|
|
236901
|
+
/**
|
|
236902
|
+
* Gate for hub-side simpleEvent traces.
|
|
236903
|
+
*
|
|
236904
|
+
* Hub-child events arrive on the parent's Baichuan socket. Logging them on
|
|
236905
|
+
* the child logger only is invisible when the operator filters Logs to the
|
|
236906
|
+
* Hub; logging every channel unconditionally floods the Hub (battery ticks).
|
|
236907
|
+
* Trace when the target camera — or the hub itself — is under debug.
|
|
236908
|
+
*/
|
|
236909
|
+
function shouldTraceSimpleEventDispatch(input) {
|
|
236910
|
+
return wantsEventTrace(input.hubDebugGeneral, input.hubSocketFlags) || wantsEventTrace(input.childDebugGeneral, input.childSocketFlags);
|
|
236911
|
+
}
|
|
236912
|
+
function wantsEventTrace(debugGeneral, socketFlags) {
|
|
236913
|
+
return debugGeneral || socketFlags.includes("traceEvents");
|
|
236914
|
+
}
|
|
236915
|
+
/** Narrow a persisted `debugSocketLogs` blob to string flags. */
|
|
236916
|
+
function asDebugSocketFlags(value) {
|
|
236917
|
+
return Array.isArray(value) ? value.filter((v) => typeof v === "string") : [];
|
|
236918
|
+
}
|
|
236919
|
+
//#endregion
|
|
236765
236920
|
//#region src/reolink-hub.ts
|
|
236766
236921
|
var HUB_DISCOVERY_REFRESH_TIMEOUT_MS = 8e3;
|
|
236767
236922
|
/**
|
|
@@ -237530,6 +237685,18 @@ var ReolinkHub = class ReolinkHub extends BaseDevice {
|
|
|
237530
237685
|
}
|
|
237531
237686
|
this.ctx.devices.getAll().then((all) => all.find((d) => d.id === deviceId)).then((child) => {
|
|
237532
237687
|
if (!(child instanceof ReolinkCamera)) return;
|
|
237688
|
+
if (shouldTraceSimpleEventDispatch({
|
|
237689
|
+
hubDebugGeneral: this.config.get("debugGeneral") === true,
|
|
237690
|
+
hubSocketFlags: asDebugSocketFlags(this.config.get("debugSocketLogs")),
|
|
237691
|
+
childDebugGeneral: child.config.get("debugGeneral") === true,
|
|
237692
|
+
childSocketFlags: asDebugSocketFlags(child.config.get("debugSocketLogs"))
|
|
237693
|
+
})) this.ctx.logger.info("Reolink Hub: simpleEvent dispatch", { meta: {
|
|
237694
|
+
type: ev?.type ?? "unknown",
|
|
237695
|
+
channel,
|
|
237696
|
+
timestamp: ev?.timestamp,
|
|
237697
|
+
deviceId: child.id,
|
|
237698
|
+
name: child.name
|
|
237699
|
+
} });
|
|
237533
237700
|
child.handleSimpleEvent(ev);
|
|
237534
237701
|
}).catch((err) => {
|
|
237535
237702
|
this.ctx.logger.debug("Hub simpleEvent dispatch failed", { meta: {
|