@camstack/addon-provider-ecowitt 0.2.18 → 0.2.20
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 +187 -45
- package/dist/addon.mjs +187 -45
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
let http = require("http");
|
|
3
3
|
let events = require("events");
|
|
4
4
|
let dgram = require("dgram");
|
|
5
|
-
//#region ../types/dist/event-category-
|
|
5
|
+
//#region ../types/dist/event-category-XfKNtfCc.mjs
|
|
6
6
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
7
7
|
EventCategory["SystemBoot"] = "system.boot";
|
|
8
8
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -19,9 +19,10 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
19
19
|
EventCategory["SystemRestartCompleted"] = "system.restart-completed";
|
|
20
20
|
/**
|
|
21
21
|
* A newer addon or server-root package version was found by the
|
|
22
|
-
* authoritative registry check. Emitted once
|
|
23
|
-
* `(
|
|
24
|
-
*
|
|
22
|
+
* authoritative registry check. Emitted once when any observed
|
|
23
|
+
* `latestVersion` changes (or a package/node first appears behind);
|
|
24
|
+
* the payload carries the full currently-available list. Repeated
|
|
25
|
+
* polling of the same latests is silent.
|
|
25
26
|
*/
|
|
26
27
|
EventCategory["UpdateAvailable"] = "update.available";
|
|
27
28
|
/**
|
|
@@ -40,6 +41,22 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
40
41
|
EventCategory["AddonInstalled"] = "addon.installed";
|
|
41
42
|
EventCategory["AddonUninstalled"] = "addon.uninstalled";
|
|
42
43
|
EventCategory["AddonCrashed"] = "addon.crashed";
|
|
44
|
+
/**
|
|
45
|
+
* A RUNNER the D6 crash circuit-breaker gave up on — terminal.
|
|
46
|
+
*
|
|
47
|
+
* `AddonCrashed` is the routine, self-healing fact ("it crashed; it is being
|
|
48
|
+
* respawned"); this is the one that never resolves itself. Emitted exactly
|
|
49
|
+
* once per trip, by `process-service.ts`, carrying the node, the runner, the
|
|
50
|
+
* addons it hosted and the crash count that tripped the breaker.
|
|
51
|
+
*
|
|
52
|
+
* It exists because a runner marked terminally `failed` used to be SILENT:
|
|
53
|
+
* on 2026-08-18 the `recorder` runner died of three unhandled ffmpeg spawn
|
|
54
|
+
* errors, the breaker stopped respawning it (correctly), `/health` kept
|
|
55
|
+
* returning 200, and fleet-wide recording was gone for 3h15 before the
|
|
56
|
+
* operator's phone told him. The Notification Center's system-event intake
|
|
57
|
+
* consumes this category and maps it to the `addon-crash-loop` kind.
|
|
58
|
+
*/
|
|
59
|
+
EventCategory["AddonRunnerFailed"] = "addon.runner-failed";
|
|
43
60
|
EventCategory["AddonError"] = "addon.error";
|
|
44
61
|
EventCategory["AddonPageReady"] = "addon.page-ready";
|
|
45
62
|
EventCategory["AddonWidgetReady"] = "addon.widget-ready";
|
|
@@ -7551,6 +7568,10 @@ var RecordingBandSchema = object({
|
|
|
7551
7568
|
preBufferSec: number().min(0).optional(),
|
|
7552
7569
|
postBufferSec: number().min(0).optional()
|
|
7553
7570
|
});
|
|
7571
|
+
({
|
|
7572
|
+
preBufferSec: 10,
|
|
7573
|
+
postBufferSec: 30
|
|
7574
|
+
}).postBufferSec * 1e3;
|
|
7554
7575
|
/**
|
|
7555
7576
|
* Per-device retention overrides. Every field is optional; an unset or `0`
|
|
7556
7577
|
* value inherits the node-wide recorder default. Only footage-lifetime limits
|
|
@@ -7598,6 +7619,12 @@ var RecordingConfigSchema = object({
|
|
|
7598
7619
|
/** DERIVED summary of `bands`, stamped by the recorder on every save.
|
|
7599
7620
|
* Authoring it has no effect — see {@link RecordingStorageModeSchema}. */
|
|
7600
7621
|
mode: RecordingStorageModeSchema.optional(),
|
|
7622
|
+
/**
|
|
7623
|
+
* Which assigned broker slots to record. Absent / empty = {@link
|
|
7624
|
+
* DEFAULT_RECORDING_PROFILES} (`high`+`low`) intersected with the
|
|
7625
|
+
* camera's currently assigned slots — never `mid` unless the operator
|
|
7626
|
+
* picks it, and never a slot the broker has not assigned.
|
|
7627
|
+
*/
|
|
7601
7628
|
profiles: array(CamProfileSchema).optional(),
|
|
7602
7629
|
segmentSeconds: number().int().positive().optional(),
|
|
7603
7630
|
/**
|
|
@@ -7678,7 +7705,11 @@ var RelocateFootageInputSchema = object({
|
|
|
7678
7705
|
profiles: array(string()).optional(),
|
|
7679
7706
|
/** Copy throttle in MB/s (default 40) — the drain is a background chore,
|
|
7680
7707
|
* never allowed to starve live writers. */
|
|
7681
|
-
throttleMbps: number().min(1).max(1e3).optional()
|
|
7708
|
+
throttleMbps: number().min(1).max(1e3).optional(),
|
|
7709
|
+
/** Move only segments whose startMs is >= this. Absent = the whole source
|
|
7710
|
+
* pile. Used when a full drain is too expensive and the operator only
|
|
7711
|
+
* wants the recent window on the new disk. */
|
|
7712
|
+
sinceMs: number().int().optional()
|
|
7682
7713
|
});
|
|
7683
7714
|
/** Internal, lease-scoped participant operation. It is intentionally separate
|
|
7684
7715
|
* from persistent recording settings: a migration never changes
|
|
@@ -14543,6 +14574,7 @@ var NcSystemEventKindSchema = _enum([
|
|
|
14543
14574
|
"node-offline",
|
|
14544
14575
|
"node-inference-unavailable",
|
|
14545
14576
|
"detection-blind",
|
|
14577
|
+
"addon-crash-loop",
|
|
14546
14578
|
"addon-update-available",
|
|
14547
14579
|
"server-update-available",
|
|
14548
14580
|
"alarm-triggered",
|
|
@@ -14550,6 +14582,9 @@ var NcSystemEventKindSchema = _enum([
|
|
|
14550
14582
|
"alarm-disarmed",
|
|
14551
14583
|
"alarm-arming",
|
|
14552
14584
|
"alarm-arm-refused",
|
|
14585
|
+
"addon-updated",
|
|
14586
|
+
"server-updated",
|
|
14587
|
+
"export-completed",
|
|
14553
14588
|
"camera-online",
|
|
14554
14589
|
"camera-offline",
|
|
14555
14590
|
"camera-disabled",
|
|
@@ -16443,13 +16478,19 @@ var RetrainStatusSchema = _enum([
|
|
|
16443
16478
|
* "never marked" from "already trained" must read `retrainStatus`.
|
|
16444
16479
|
*
|
|
16445
16480
|
* `debug` does NOT pin; it is attention, not durability.
|
|
16481
|
+
*
|
|
16482
|
+
* `favourited` IS a BOOLEAN pin (durability bit), not a retrain lifecycle.
|
|
16483
|
+
* A favourited track is skipped by retention the same way `staging` is, but
|
|
16484
|
+
* it does not enter `none|staging|trained` and has no staging budget.
|
|
16446
16485
|
*/
|
|
16447
16486
|
var TrackFlagFields = {
|
|
16448
16487
|
/** Operator marked this track as training material — i.e. `retrainStatus` is
|
|
16449
16488
|
* `'staging'`. */
|
|
16450
16489
|
markForTrain: boolean().optional(),
|
|
16451
16490
|
/** Operator marked this track for diagnostic attention. */
|
|
16452
|
-
debug: boolean().optional()
|
|
16491
|
+
debug: boolean().optional(),
|
|
16492
|
+
/** Operator favourited this track. Pins it against pruning. */
|
|
16493
|
+
favourited: boolean().optional()
|
|
16453
16494
|
};
|
|
16454
16495
|
/**
|
|
16455
16496
|
* The lifecycle field itself, on the READ surfaces only (`Track`, `KeyEvent`).
|
|
@@ -16474,6 +16515,7 @@ var TrackFlagsSchema = object({
|
|
|
16474
16515
|
trackId: string(),
|
|
16475
16516
|
markForTrain: boolean(),
|
|
16476
16517
|
debug: boolean(),
|
|
16518
|
+
favourited: boolean(),
|
|
16477
16519
|
/** The lifecycle state the boolean was derived from. Required here (unlike on
|
|
16478
16520
|
* a track row) because this shape is only ever produced by the write body,
|
|
16479
16521
|
* which always knows it — and a surface that has just written needs to render
|
|
@@ -17106,6 +17148,12 @@ var TrackCascadeCountsSchema = object({
|
|
|
17106
17148
|
/** Per-track CLIP search vectors removed (best-effort). */
|
|
17107
17149
|
embeddings: number().int()
|
|
17108
17150
|
});
|
|
17151
|
+
/** Disk-wins reconcile: media rows whose blobs are gone, then empty tracks. */
|
|
17152
|
+
var DiskReconcileCountsSchema = object({
|
|
17153
|
+
mediaDropped: number().int(),
|
|
17154
|
+
tracks: number().int(),
|
|
17155
|
+
events: number().int()
|
|
17156
|
+
});
|
|
17109
17157
|
/** Event-store footprint for one camera. */
|
|
17110
17158
|
var EventStoreDeviceFootprintSchema = object({
|
|
17111
17159
|
deviceId: number(),
|
|
@@ -17282,6 +17330,9 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
17282
17330
|
}), method(object({ deviceId: number() }), TrackCascadeCountsSchema, {
|
|
17283
17331
|
kind: "mutation",
|
|
17284
17332
|
auth: "admin"
|
|
17333
|
+
}), method(object({ deviceId: number() }), DiskReconcileCountsSchema, {
|
|
17334
|
+
kind: "mutation",
|
|
17335
|
+
auth: "admin"
|
|
17285
17336
|
}), method(object({
|
|
17286
17337
|
deviceId: number(),
|
|
17287
17338
|
trackIds: array(string()).min(1)
|
|
@@ -18832,6 +18883,24 @@ var CameraStatusDegradationSchema = object({
|
|
|
18832
18883
|
*
|
|
18833
18884
|
* See spec: `docs/superpowers/specs/2026-06-24-camera-status-aggregator-cap.md`
|
|
18834
18885
|
*/
|
|
18886
|
+
var DiskReconcileJobSchema = object({
|
|
18887
|
+
state: _enum([
|
|
18888
|
+
"idle",
|
|
18889
|
+
"running",
|
|
18890
|
+
"done",
|
|
18891
|
+
"error"
|
|
18892
|
+
]),
|
|
18893
|
+
total: number().int().nonnegative(),
|
|
18894
|
+
completed: number().int().nonnegative(),
|
|
18895
|
+
currentDeviceId: number().int().nullable(),
|
|
18896
|
+
failed: array(number().int()).readonly(),
|
|
18897
|
+
mediaDropped: number().int().nonnegative(),
|
|
18898
|
+
tracks: number().int().nonnegative(),
|
|
18899
|
+
events: number().int().nonnegative(),
|
|
18900
|
+
startedAtMs: number().int().nullable(),
|
|
18901
|
+
finishedAtMs: number().int().nullable(),
|
|
18902
|
+
error: string().nullable()
|
|
18903
|
+
});
|
|
18835
18904
|
var CameraStatusSchema = object({
|
|
18836
18905
|
deviceId: number(),
|
|
18837
18906
|
assignment: CameraAssignmentStatusSchema,
|
|
@@ -19063,7 +19132,10 @@ method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
|
|
|
19063
19132
|
}), CameraSwitchGroupSchema, {
|
|
19064
19133
|
kind: "mutation",
|
|
19065
19134
|
auth: "admin"
|
|
19066
|
-
}), method(object({ deviceId: number() }), CameraStatusSchema), method(object({ deviceIds: array(number()).optional() }), array(CameraStatusSchema).readonly()), method(_void(),
|
|
19135
|
+
}), method(object({ deviceId: number() }), CameraStatusSchema), method(object({ deviceIds: array(number()).optional() }), array(CameraStatusSchema).readonly()), method(_void(), DiskReconcileJobSchema, {
|
|
19136
|
+
kind: "mutation",
|
|
19137
|
+
auth: "admin"
|
|
19138
|
+
}), method(_void(), DiskReconcileJobSchema, { auth: "admin" }), method(_void(), array(PipelineTemplateSchema).readonly()), method(object({
|
|
19067
19139
|
name: string(),
|
|
19068
19140
|
description: string().optional(),
|
|
19069
19141
|
config: CameraPipelineConfigSchema
|
|
@@ -19468,7 +19540,14 @@ targets: array(object({
|
|
|
19468
19540
|
"sleeping",
|
|
19469
19541
|
"unreachable",
|
|
19470
19542
|
"waking"
|
|
19471
|
-
]).nullable()
|
|
19543
|
+
]).nullable(),
|
|
19544
|
+
/** A battery camera (whatever its current state). An AWAKE battery
|
|
19545
|
+
* camera is deliberately NOT recaptured on the poll cadence — every
|
|
19546
|
+
* capture is a camera hit that would keep it out of sleep — so its
|
|
19547
|
+
* cached frame legitimately ages past the currency ceiling while
|
|
19548
|
+
* nothing is streaming. A surface must keep painting it (a fresh
|
|
19549
|
+
* frame is captured at each wake), not blank to "unavailable". */
|
|
19550
|
+
battery: boolean()
|
|
19472
19551
|
})));
|
|
19473
19552
|
/**
|
|
19474
19553
|
* `sso-bridge` — internal hub-only cap that lets SSO-style auth
|
|
@@ -20129,20 +20208,6 @@ var VectorStatsResultSchema = object({
|
|
|
20129
20208
|
exact: boolean()
|
|
20130
20209
|
});
|
|
20131
20210
|
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);
|
|
20132
|
-
/**
|
|
20133
|
-
* `videoclips` — the unified, navigable-clip surface for a camera.
|
|
20134
|
-
*
|
|
20135
|
-
* A device-scoped WRAPPER cap (like `pipeline-analytics`): exactly one active
|
|
20136
|
-
* provider per device, substitutable. The DEFAULT provider (registered by
|
|
20137
|
-
* `addon-post-analysis`, `defaultActive: true`) composes the analytics event
|
|
20138
|
-
* log (markers + thumbnails) with the recorder's `getPlaybackManifest` — a clip
|
|
20139
|
-
* is a time-WINDOW over existing footage, never a separate file. A camera that
|
|
20140
|
-
* exposes NATIVE onboard clips (Reolink/Hikvision NVR) can later substitute the
|
|
20141
|
-
* wrapper provider for its device and serve its own clip catalog + URLs.
|
|
20142
|
-
*
|
|
20143
|
-
* A `Clip` is purely time-based (subtree-blind): playback resolves segments by
|
|
20144
|
-
* temporal overlap, so the API never decides `continuous` vs `events`.
|
|
20145
|
-
*/
|
|
20146
20211
|
var ClipSchema = object({
|
|
20147
20212
|
/** Opaque, provider-namespaced id. The default provider encodes the time
|
|
20148
20213
|
* window so `getClipPlayback` is self-contained (no event re-query). */
|
|
@@ -20159,8 +20224,57 @@ var ClipSchema = object({
|
|
|
20159
20224
|
startMs: number(),
|
|
20160
20225
|
endMs: number()
|
|
20161
20226
|
}),
|
|
20162
|
-
/**
|
|
20163
|
-
thumbnail
|
|
20227
|
+
/**
|
|
20228
|
+
* Lazy thumbnail URL, never inlined.
|
|
20229
|
+
*
|
|
20230
|
+
* Recording-derived clips (events-mode keep-window, and the prepared
|
|
20231
|
+
* continuous event+fragment visit) MUST use the snapshot of the **main
|
|
20232
|
+
* event of the interval** — `getEventMedia({ eventId, kind: 'snapshot' })`
|
|
20233
|
+
* of the event that owns `kind` (object > motion > audio). Do not extract
|
|
20234
|
+
* a keyframe from the recorded segments. Other providers (onboard, HKSV)
|
|
20235
|
+
* mint their own stills.
|
|
20236
|
+
*
|
|
20237
|
+
* **VOUCHED, never fabricated.** A provider emits this only for an event it
|
|
20238
|
+
* has CONFIRMED owns at least one media row (its own, or its owning track's).
|
|
20239
|
+
* Absent is meaningful — "this visit has no event still" — never "we did not
|
|
20240
|
+
* look". Stamping it from a URL template made 35% of one camera's clips point
|
|
20241
|
+
* at a 404 (device 3836, 2026-08-17: 64 of 179 clips dead, 63 of them motion).
|
|
20242
|
+
* A read that FAILS drops the claim; it never invents it.
|
|
20243
|
+
*/
|
|
20244
|
+
thumbnail: string().optional(),
|
|
20245
|
+
/**
|
|
20246
|
+
* An instant INSIDE this visit's footage, hole-safe, where a recorded still
|
|
20247
|
+
* can be decoded. Present whenever the visit came from recorded availability;
|
|
20248
|
+
* absent on a per-event padded window (there is no footage to promise).
|
|
20249
|
+
*
|
|
20250
|
+
* This is not a thumbnail and not a second byte path: it is the argument to
|
|
20251
|
+
* the recorder's existing still route. The surface — never the provider —
|
|
20252
|
+
* decides whether to use it. It is the midpoint of the visit's LONGEST
|
|
20253
|
+
* contiguous range, not of the visit: a visit spans its holes by
|
|
20254
|
+
* construction, so a naive midpoint lands in dead air.
|
|
20255
|
+
*/
|
|
20256
|
+
stillAtMs: number().optional(),
|
|
20257
|
+
/**
|
|
20258
|
+
* Analytics event ids that overlap this visit — a BOUNDED sample, newest
|
|
20259
|
+
* first within kind (object → motion → audio), capped at
|
|
20260
|
+
* {@link MAX_CLIP_EVENT_IDS}. Empty on footage-only clips.
|
|
20261
|
+
*
|
|
20262
|
+
* Bounded because it is not a payload the surface pages through: one visit on
|
|
20263
|
+
* device 615 carried 2 345 ids, and `eventIds` was 99% of a 153 KB
|
|
20264
|
+
* camera-day. Read {@link eventCount} for the true total.
|
|
20265
|
+
*/
|
|
20266
|
+
eventIds: array(string()).optional(),
|
|
20267
|
+
/** How many analytics events actually overlap this visit. Differs from
|
|
20268
|
+
* `eventIds.length` exactly when the sample was capped — so a truncated
|
|
20269
|
+
* list is never mistaken for a quiet visit. */
|
|
20270
|
+
eventCount: number().int().nonnegative().optional(),
|
|
20271
|
+
/** Intra-visit footage holes (GOP rolls, discarded segments) still shorter
|
|
20272
|
+
* than `VISIT_MERGE_GAP_MS`. Playback concatenates around them; the timeline
|
|
20273
|
+
* bar keeps showing them via `recording.getAvailability`. */
|
|
20274
|
+
holes: array(object({
|
|
20275
|
+
startMs: number(),
|
|
20276
|
+
endMs: number()
|
|
20277
|
+
})).optional()
|
|
20164
20278
|
});
|
|
20165
20279
|
var ClipPlaybackSchema = object({
|
|
20166
20280
|
/** HLS master URL through the hub data-plane (Range + token in path). */
|
|
@@ -20624,7 +20738,14 @@ var SearchResultSchema = object({
|
|
|
20624
20738
|
});
|
|
20625
20739
|
var AutoUpdateSettingsSchema = object({
|
|
20626
20740
|
channel: ChannelSchema,
|
|
20627
|
-
intervalSeconds: number()
|
|
20741
|
+
intervalSeconds: number(),
|
|
20742
|
+
/**
|
|
20743
|
+
* Cadence of the "an update exists" POLLER, in seconds. Independent of
|
|
20744
|
+
* `channel`: the poller runs while auto-apply is `off`, because being told
|
|
20745
|
+
* about a publish and installing it are different decisions. Clamped
|
|
20746
|
+
* server-side to 900 s … 604800 s; defaults to 21600 s (6 h).
|
|
20747
|
+
*/
|
|
20748
|
+
updateCheckIntervalSeconds: number()
|
|
20628
20749
|
});
|
|
20629
20750
|
var AddonAutoUpdateSchema = ChannelWithInheritSchema;
|
|
20630
20751
|
var RestartAddonResultSchema = unknown();
|
|
@@ -20765,7 +20886,9 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
|
|
|
20765
20886
|
auth: "admin"
|
|
20766
20887
|
}), method(_void(), AutoUpdateSettingsSchema, { auth: "admin" }), method(object({
|
|
20767
20888
|
channel: ChannelSchema,
|
|
20768
|
-
intervalSeconds: number().min(300).max(86400).optional()
|
|
20889
|
+
intervalSeconds: number().min(300).max(86400).optional(),
|
|
20890
|
+
/** Availability-poll cadence; see AutoUpdateSettingsSchema. */
|
|
20891
|
+
updateCheckIntervalSeconds: number().min(900).max(604800).optional()
|
|
20769
20892
|
}), unknown(), {
|
|
20770
20893
|
kind: "mutation",
|
|
20771
20894
|
auth: "admin"
|
|
@@ -26446,7 +26569,9 @@ var ExportOptionsSchema = object({
|
|
|
26446
26569
|
includeAudio: boolean(),
|
|
26447
26570
|
maxLifeMs: number().int().positive(),
|
|
26448
26571
|
deleteAfterDownload: boolean(),
|
|
26449
|
-
title: string().max(200).optional()
|
|
26572
|
+
title: string().max(200).optional(),
|
|
26573
|
+
/** Notification-output target ids to ping when this export becomes ready. */
|
|
26574
|
+
notifyTargetIds: array(string().min(1)).max(20).optional()
|
|
26450
26575
|
}).superRefine((v, ctx) => {
|
|
26451
26576
|
if (v.speed !== void 0 && v.timelapse !== void 0) ctx.addIssue({
|
|
26452
26577
|
code: ZodIssueCode$1.custom,
|
|
@@ -26505,10 +26630,18 @@ var ExportBytesSchema = object({
|
|
|
26505
26630
|
});
|
|
26506
26631
|
method(object({
|
|
26507
26632
|
deviceId: number(),
|
|
26508
|
-
|
|
26633
|
+
/** @deprecated Prefer `profiles`. Kept so timelapse/notifiers keep working. */
|
|
26634
|
+
profile: string().optional(),
|
|
26635
|
+
profiles: array(string()).min(1).optional(),
|
|
26509
26636
|
fromMs: number(),
|
|
26510
26637
|
toMs: number(),
|
|
26511
26638
|
options: ExportOptionsSchema
|
|
26639
|
+
}).superRefine((v, ctx) => {
|
|
26640
|
+
if ((v.profiles !== void 0 && v.profiles.length > 0 ? v.profiles : v.profile !== void 0 ? [v.profile] : []).length < 1) ctx.addIssue({
|
|
26641
|
+
code: ZodIssueCode$1.custom,
|
|
26642
|
+
message: "pass profiles[] (min 1) or legacy profile",
|
|
26643
|
+
path: ["profiles"]
|
|
26644
|
+
});
|
|
26512
26645
|
}), ExportRecordSchema, {
|
|
26513
26646
|
kind: "mutation",
|
|
26514
26647
|
auth: "protected"
|
|
@@ -29450,15 +29583,6 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
29450
29583
|
labels: ["probe not implemented"]
|
|
29451
29584
|
};
|
|
29452
29585
|
}
|
|
29453
|
-
/**
|
|
29454
|
-
* Top-level devices restored at once in {@link onRestoreDevices}.
|
|
29455
|
-
*
|
|
29456
|
-
* Four covers the fleets this ships to without turning a boot into a burst a
|
|
29457
|
-
* camera NVR answers with a refusal. A provider whose upstream is a single
|
|
29458
|
-
* session with a serial command channel (a Baichuan hub, an NVR that
|
|
29459
|
-
* serialises ISAPI) should lower it; nothing needs to raise it.
|
|
29460
|
-
*/
|
|
29461
|
-
restoreConcurrency = 4;
|
|
29462
29586
|
async restoreDevices(savedDevices) {
|
|
29463
29587
|
await this.onRestoreDevices(savedDevices);
|
|
29464
29588
|
if (savedDevices.length > 0) this.ctx.logger.info(`Restored ${savedDevices.length} ${this.providerName} device(s)`);
|
|
@@ -29513,14 +29637,7 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
29513
29637
|
});
|
|
29514
29638
|
}
|
|
29515
29639
|
};
|
|
29516
|
-
|
|
29517
|
-
await Promise.all(Array.from({ length: Math.min(Math.max(1, this.restoreConcurrency), topLevel.length) }, async () => {
|
|
29518
|
-
for (;;) {
|
|
29519
|
-
const saved = topLevel[nextTopLevel++];
|
|
29520
|
-
if (saved === void 0) return;
|
|
29521
|
-
await restoreOne(saved);
|
|
29522
|
-
}
|
|
29523
|
-
}));
|
|
29640
|
+
await Promise.all(topLevel.map((saved) => restoreOne(saved)));
|
|
29524
29641
|
const childRows = savedDevices.filter((s) => s.parentDeviceId !== null);
|
|
29525
29642
|
for (const saved of childRows) {
|
|
29526
29643
|
const Class = this.deviceClasses[saved.type];
|
|
@@ -32793,6 +32910,12 @@ Object.freeze({
|
|
|
32793
32910
|
addonId: null,
|
|
32794
32911
|
access: "create"
|
|
32795
32912
|
},
|
|
32913
|
+
"pipelineAnalytics.reconcileFromDisk": {
|
|
32914
|
+
capName: "pipeline-analytics",
|
|
32915
|
+
capScope: "device",
|
|
32916
|
+
addonId: null,
|
|
32917
|
+
access: "create"
|
|
32918
|
+
},
|
|
32796
32919
|
"pipelineAnalytics.refreshStorageLocationsForMigration": {
|
|
32797
32920
|
capName: "pipeline-analytics",
|
|
32798
32921
|
capScope: "device",
|
|
@@ -33195,6 +33318,12 @@ Object.freeze({
|
|
|
33195
33318
|
addonId: null,
|
|
33196
33319
|
access: "view"
|
|
33197
33320
|
},
|
|
33321
|
+
"pipelineOrchestrator.getReconcileFromDiskStatus": {
|
|
33322
|
+
capName: "pipeline-orchestrator",
|
|
33323
|
+
capScope: "system",
|
|
33324
|
+
addonId: null,
|
|
33325
|
+
access: "view"
|
|
33326
|
+
},
|
|
33198
33327
|
"pipelineOrchestrator.listAgentSettings": {
|
|
33199
33328
|
capName: "pipeline-orchestrator",
|
|
33200
33329
|
capScope: "system",
|
|
@@ -33219,6 +33348,12 @@ Object.freeze({
|
|
|
33219
33348
|
addonId: null,
|
|
33220
33349
|
access: "create"
|
|
33221
33350
|
},
|
|
33351
|
+
"pipelineOrchestrator.reconcileFromDisk": {
|
|
33352
|
+
capName: "pipeline-orchestrator",
|
|
33353
|
+
capScope: "system",
|
|
33354
|
+
addonId: null,
|
|
33355
|
+
access: "create"
|
|
33356
|
+
},
|
|
33222
33357
|
"pipelineOrchestrator.removeAgentSettings": {
|
|
33223
33358
|
capName: "pipeline-orchestrator",
|
|
33224
33359
|
capScope: "system",
|
|
@@ -36210,6 +36345,11 @@ Object.freeze({
|
|
|
36210
36345
|
form: "single",
|
|
36211
36346
|
optional: true
|
|
36212
36347
|
}],
|
|
36348
|
+
"pipelineAnalytics.reconcileFromDisk": [{
|
|
36349
|
+
name: "deviceId",
|
|
36350
|
+
form: "single",
|
|
36351
|
+
optional: false
|
|
36352
|
+
}],
|
|
36213
36353
|
"pipelineAnalytics.restageRetrainTrack": [{
|
|
36214
36354
|
name: "deviceId",
|
|
36215
36355
|
form: "single",
|
|
@@ -37275,6 +37415,8 @@ DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
|
|
|
37275
37415
|
DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
|
|
37276
37416
|
DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
|
|
37277
37417
|
DEFAULT_NATIVE_LEASE_SETTINGS.admission;
|
|
37418
|
+
var MB = 1024 * 1024;
|
|
37419
|
+
1024 * MB, 3072 * MB;
|
|
37278
37420
|
//#endregion
|
|
37279
37421
|
//#region node_modules/@apocaliss92/nodewitt/node_modules/zod/v3/helpers/util.js
|
|
37280
37422
|
var util;
|
package/dist/addon.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createServer } from "http";
|
|
2
2
|
import { EventEmitter } from "events";
|
|
3
3
|
import { createSocket } from "dgram";
|
|
4
|
-
//#region ../types/dist/event-category-
|
|
4
|
+
//#region ../types/dist/event-category-XfKNtfCc.mjs
|
|
5
5
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
6
6
|
EventCategory["SystemBoot"] = "system.boot";
|
|
7
7
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -18,9 +18,10 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
18
18
|
EventCategory["SystemRestartCompleted"] = "system.restart-completed";
|
|
19
19
|
/**
|
|
20
20
|
* A newer addon or server-root package version was found by the
|
|
21
|
-
* authoritative registry check. Emitted once
|
|
22
|
-
* `(
|
|
23
|
-
*
|
|
21
|
+
* authoritative registry check. Emitted once when any observed
|
|
22
|
+
* `latestVersion` changes (or a package/node first appears behind);
|
|
23
|
+
* the payload carries the full currently-available list. Repeated
|
|
24
|
+
* polling of the same latests is silent.
|
|
24
25
|
*/
|
|
25
26
|
EventCategory["UpdateAvailable"] = "update.available";
|
|
26
27
|
/**
|
|
@@ -39,6 +40,22 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
39
40
|
EventCategory["AddonInstalled"] = "addon.installed";
|
|
40
41
|
EventCategory["AddonUninstalled"] = "addon.uninstalled";
|
|
41
42
|
EventCategory["AddonCrashed"] = "addon.crashed";
|
|
43
|
+
/**
|
|
44
|
+
* A RUNNER the D6 crash circuit-breaker gave up on — terminal.
|
|
45
|
+
*
|
|
46
|
+
* `AddonCrashed` is the routine, self-healing fact ("it crashed; it is being
|
|
47
|
+
* respawned"); this is the one that never resolves itself. Emitted exactly
|
|
48
|
+
* once per trip, by `process-service.ts`, carrying the node, the runner, the
|
|
49
|
+
* addons it hosted and the crash count that tripped the breaker.
|
|
50
|
+
*
|
|
51
|
+
* It exists because a runner marked terminally `failed` used to be SILENT:
|
|
52
|
+
* on 2026-08-18 the `recorder` runner died of three unhandled ffmpeg spawn
|
|
53
|
+
* errors, the breaker stopped respawning it (correctly), `/health` kept
|
|
54
|
+
* returning 200, and fleet-wide recording was gone for 3h15 before the
|
|
55
|
+
* operator's phone told him. The Notification Center's system-event intake
|
|
56
|
+
* consumes this category and maps it to the `addon-crash-loop` kind.
|
|
57
|
+
*/
|
|
58
|
+
EventCategory["AddonRunnerFailed"] = "addon.runner-failed";
|
|
42
59
|
EventCategory["AddonError"] = "addon.error";
|
|
43
60
|
EventCategory["AddonPageReady"] = "addon.page-ready";
|
|
44
61
|
EventCategory["AddonWidgetReady"] = "addon.widget-ready";
|
|
@@ -7550,6 +7567,10 @@ var RecordingBandSchema = object({
|
|
|
7550
7567
|
preBufferSec: number().min(0).optional(),
|
|
7551
7568
|
postBufferSec: number().min(0).optional()
|
|
7552
7569
|
});
|
|
7570
|
+
({
|
|
7571
|
+
preBufferSec: 10,
|
|
7572
|
+
postBufferSec: 30
|
|
7573
|
+
}).postBufferSec * 1e3;
|
|
7553
7574
|
/**
|
|
7554
7575
|
* Per-device retention overrides. Every field is optional; an unset or `0`
|
|
7555
7576
|
* value inherits the node-wide recorder default. Only footage-lifetime limits
|
|
@@ -7597,6 +7618,12 @@ var RecordingConfigSchema = object({
|
|
|
7597
7618
|
/** DERIVED summary of `bands`, stamped by the recorder on every save.
|
|
7598
7619
|
* Authoring it has no effect — see {@link RecordingStorageModeSchema}. */
|
|
7599
7620
|
mode: RecordingStorageModeSchema.optional(),
|
|
7621
|
+
/**
|
|
7622
|
+
* Which assigned broker slots to record. Absent / empty = {@link
|
|
7623
|
+
* DEFAULT_RECORDING_PROFILES} (`high`+`low`) intersected with the
|
|
7624
|
+
* camera's currently assigned slots — never `mid` unless the operator
|
|
7625
|
+
* picks it, and never a slot the broker has not assigned.
|
|
7626
|
+
*/
|
|
7600
7627
|
profiles: array(CamProfileSchema).optional(),
|
|
7601
7628
|
segmentSeconds: number().int().positive().optional(),
|
|
7602
7629
|
/**
|
|
@@ -7677,7 +7704,11 @@ var RelocateFootageInputSchema = object({
|
|
|
7677
7704
|
profiles: array(string()).optional(),
|
|
7678
7705
|
/** Copy throttle in MB/s (default 40) — the drain is a background chore,
|
|
7679
7706
|
* never allowed to starve live writers. */
|
|
7680
|
-
throttleMbps: number().min(1).max(1e3).optional()
|
|
7707
|
+
throttleMbps: number().min(1).max(1e3).optional(),
|
|
7708
|
+
/** Move only segments whose startMs is >= this. Absent = the whole source
|
|
7709
|
+
* pile. Used when a full drain is too expensive and the operator only
|
|
7710
|
+
* wants the recent window on the new disk. */
|
|
7711
|
+
sinceMs: number().int().optional()
|
|
7681
7712
|
});
|
|
7682
7713
|
/** Internal, lease-scoped participant operation. It is intentionally separate
|
|
7683
7714
|
* from persistent recording settings: a migration never changes
|
|
@@ -14542,6 +14573,7 @@ var NcSystemEventKindSchema = _enum([
|
|
|
14542
14573
|
"node-offline",
|
|
14543
14574
|
"node-inference-unavailable",
|
|
14544
14575
|
"detection-blind",
|
|
14576
|
+
"addon-crash-loop",
|
|
14545
14577
|
"addon-update-available",
|
|
14546
14578
|
"server-update-available",
|
|
14547
14579
|
"alarm-triggered",
|
|
@@ -14549,6 +14581,9 @@ var NcSystemEventKindSchema = _enum([
|
|
|
14549
14581
|
"alarm-disarmed",
|
|
14550
14582
|
"alarm-arming",
|
|
14551
14583
|
"alarm-arm-refused",
|
|
14584
|
+
"addon-updated",
|
|
14585
|
+
"server-updated",
|
|
14586
|
+
"export-completed",
|
|
14552
14587
|
"camera-online",
|
|
14553
14588
|
"camera-offline",
|
|
14554
14589
|
"camera-disabled",
|
|
@@ -16442,13 +16477,19 @@ var RetrainStatusSchema = _enum([
|
|
|
16442
16477
|
* "never marked" from "already trained" must read `retrainStatus`.
|
|
16443
16478
|
*
|
|
16444
16479
|
* `debug` does NOT pin; it is attention, not durability.
|
|
16480
|
+
*
|
|
16481
|
+
* `favourited` IS a BOOLEAN pin (durability bit), not a retrain lifecycle.
|
|
16482
|
+
* A favourited track is skipped by retention the same way `staging` is, but
|
|
16483
|
+
* it does not enter `none|staging|trained` and has no staging budget.
|
|
16445
16484
|
*/
|
|
16446
16485
|
var TrackFlagFields = {
|
|
16447
16486
|
/** Operator marked this track as training material — i.e. `retrainStatus` is
|
|
16448
16487
|
* `'staging'`. */
|
|
16449
16488
|
markForTrain: boolean().optional(),
|
|
16450
16489
|
/** Operator marked this track for diagnostic attention. */
|
|
16451
|
-
debug: boolean().optional()
|
|
16490
|
+
debug: boolean().optional(),
|
|
16491
|
+
/** Operator favourited this track. Pins it against pruning. */
|
|
16492
|
+
favourited: boolean().optional()
|
|
16452
16493
|
};
|
|
16453
16494
|
/**
|
|
16454
16495
|
* The lifecycle field itself, on the READ surfaces only (`Track`, `KeyEvent`).
|
|
@@ -16473,6 +16514,7 @@ var TrackFlagsSchema = object({
|
|
|
16473
16514
|
trackId: string(),
|
|
16474
16515
|
markForTrain: boolean(),
|
|
16475
16516
|
debug: boolean(),
|
|
16517
|
+
favourited: boolean(),
|
|
16476
16518
|
/** The lifecycle state the boolean was derived from. Required here (unlike on
|
|
16477
16519
|
* a track row) because this shape is only ever produced by the write body,
|
|
16478
16520
|
* which always knows it — and a surface that has just written needs to render
|
|
@@ -17105,6 +17147,12 @@ var TrackCascadeCountsSchema = object({
|
|
|
17105
17147
|
/** Per-track CLIP search vectors removed (best-effort). */
|
|
17106
17148
|
embeddings: number().int()
|
|
17107
17149
|
});
|
|
17150
|
+
/** Disk-wins reconcile: media rows whose blobs are gone, then empty tracks. */
|
|
17151
|
+
var DiskReconcileCountsSchema = object({
|
|
17152
|
+
mediaDropped: number().int(),
|
|
17153
|
+
tracks: number().int(),
|
|
17154
|
+
events: number().int()
|
|
17155
|
+
});
|
|
17108
17156
|
/** Event-store footprint for one camera. */
|
|
17109
17157
|
var EventStoreDeviceFootprintSchema = object({
|
|
17110
17158
|
deviceId: number(),
|
|
@@ -17281,6 +17329,9 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
17281
17329
|
}), method(object({ deviceId: number() }), TrackCascadeCountsSchema, {
|
|
17282
17330
|
kind: "mutation",
|
|
17283
17331
|
auth: "admin"
|
|
17332
|
+
}), method(object({ deviceId: number() }), DiskReconcileCountsSchema, {
|
|
17333
|
+
kind: "mutation",
|
|
17334
|
+
auth: "admin"
|
|
17284
17335
|
}), method(object({
|
|
17285
17336
|
deviceId: number(),
|
|
17286
17337
|
trackIds: array(string()).min(1)
|
|
@@ -18831,6 +18882,24 @@ var CameraStatusDegradationSchema = object({
|
|
|
18831
18882
|
*
|
|
18832
18883
|
* See spec: `docs/superpowers/specs/2026-06-24-camera-status-aggregator-cap.md`
|
|
18833
18884
|
*/
|
|
18885
|
+
var DiskReconcileJobSchema = object({
|
|
18886
|
+
state: _enum([
|
|
18887
|
+
"idle",
|
|
18888
|
+
"running",
|
|
18889
|
+
"done",
|
|
18890
|
+
"error"
|
|
18891
|
+
]),
|
|
18892
|
+
total: number().int().nonnegative(),
|
|
18893
|
+
completed: number().int().nonnegative(),
|
|
18894
|
+
currentDeviceId: number().int().nullable(),
|
|
18895
|
+
failed: array(number().int()).readonly(),
|
|
18896
|
+
mediaDropped: number().int().nonnegative(),
|
|
18897
|
+
tracks: number().int().nonnegative(),
|
|
18898
|
+
events: number().int().nonnegative(),
|
|
18899
|
+
startedAtMs: number().int().nullable(),
|
|
18900
|
+
finishedAtMs: number().int().nullable(),
|
|
18901
|
+
error: string().nullable()
|
|
18902
|
+
});
|
|
18834
18903
|
var CameraStatusSchema = object({
|
|
18835
18904
|
deviceId: number(),
|
|
18836
18905
|
assignment: CameraAssignmentStatusSchema,
|
|
@@ -19062,7 +19131,10 @@ method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
|
|
|
19062
19131
|
}), CameraSwitchGroupSchema, {
|
|
19063
19132
|
kind: "mutation",
|
|
19064
19133
|
auth: "admin"
|
|
19065
|
-
}), method(object({ deviceId: number() }), CameraStatusSchema), method(object({ deviceIds: array(number()).optional() }), array(CameraStatusSchema).readonly()), method(_void(),
|
|
19134
|
+
}), method(object({ deviceId: number() }), CameraStatusSchema), method(object({ deviceIds: array(number()).optional() }), array(CameraStatusSchema).readonly()), method(_void(), DiskReconcileJobSchema, {
|
|
19135
|
+
kind: "mutation",
|
|
19136
|
+
auth: "admin"
|
|
19137
|
+
}), method(_void(), DiskReconcileJobSchema, { auth: "admin" }), method(_void(), array(PipelineTemplateSchema).readonly()), method(object({
|
|
19066
19138
|
name: string(),
|
|
19067
19139
|
description: string().optional(),
|
|
19068
19140
|
config: CameraPipelineConfigSchema
|
|
@@ -19467,7 +19539,14 @@ targets: array(object({
|
|
|
19467
19539
|
"sleeping",
|
|
19468
19540
|
"unreachable",
|
|
19469
19541
|
"waking"
|
|
19470
|
-
]).nullable()
|
|
19542
|
+
]).nullable(),
|
|
19543
|
+
/** A battery camera (whatever its current state). An AWAKE battery
|
|
19544
|
+
* camera is deliberately NOT recaptured on the poll cadence — every
|
|
19545
|
+
* capture is a camera hit that would keep it out of sleep — so its
|
|
19546
|
+
* cached frame legitimately ages past the currency ceiling while
|
|
19547
|
+
* nothing is streaming. A surface must keep painting it (a fresh
|
|
19548
|
+
* frame is captured at each wake), not blank to "unavailable". */
|
|
19549
|
+
battery: boolean()
|
|
19471
19550
|
})));
|
|
19472
19551
|
/**
|
|
19473
19552
|
* `sso-bridge` — internal hub-only cap that lets SSO-style auth
|
|
@@ -20128,20 +20207,6 @@ var VectorStatsResultSchema = object({
|
|
|
20128
20207
|
exact: boolean()
|
|
20129
20208
|
});
|
|
20130
20209
|
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);
|
|
20131
|
-
/**
|
|
20132
|
-
* `videoclips` — the unified, navigable-clip surface for a camera.
|
|
20133
|
-
*
|
|
20134
|
-
* A device-scoped WRAPPER cap (like `pipeline-analytics`): exactly one active
|
|
20135
|
-
* provider per device, substitutable. The DEFAULT provider (registered by
|
|
20136
|
-
* `addon-post-analysis`, `defaultActive: true`) composes the analytics event
|
|
20137
|
-
* log (markers + thumbnails) with the recorder's `getPlaybackManifest` — a clip
|
|
20138
|
-
* is a time-WINDOW over existing footage, never a separate file. A camera that
|
|
20139
|
-
* exposes NATIVE onboard clips (Reolink/Hikvision NVR) can later substitute the
|
|
20140
|
-
* wrapper provider for its device and serve its own clip catalog + URLs.
|
|
20141
|
-
*
|
|
20142
|
-
* A `Clip` is purely time-based (subtree-blind): playback resolves segments by
|
|
20143
|
-
* temporal overlap, so the API never decides `continuous` vs `events`.
|
|
20144
|
-
*/
|
|
20145
20210
|
var ClipSchema = object({
|
|
20146
20211
|
/** Opaque, provider-namespaced id. The default provider encodes the time
|
|
20147
20212
|
* window so `getClipPlayback` is self-contained (no event re-query). */
|
|
@@ -20158,8 +20223,57 @@ var ClipSchema = object({
|
|
|
20158
20223
|
startMs: number(),
|
|
20159
20224
|
endMs: number()
|
|
20160
20225
|
}),
|
|
20161
|
-
/**
|
|
20162
|
-
thumbnail
|
|
20226
|
+
/**
|
|
20227
|
+
* Lazy thumbnail URL, never inlined.
|
|
20228
|
+
*
|
|
20229
|
+
* Recording-derived clips (events-mode keep-window, and the prepared
|
|
20230
|
+
* continuous event+fragment visit) MUST use the snapshot of the **main
|
|
20231
|
+
* event of the interval** — `getEventMedia({ eventId, kind: 'snapshot' })`
|
|
20232
|
+
* of the event that owns `kind` (object > motion > audio). Do not extract
|
|
20233
|
+
* a keyframe from the recorded segments. Other providers (onboard, HKSV)
|
|
20234
|
+
* mint their own stills.
|
|
20235
|
+
*
|
|
20236
|
+
* **VOUCHED, never fabricated.** A provider emits this only for an event it
|
|
20237
|
+
* has CONFIRMED owns at least one media row (its own, or its owning track's).
|
|
20238
|
+
* Absent is meaningful — "this visit has no event still" — never "we did not
|
|
20239
|
+
* look". Stamping it from a URL template made 35% of one camera's clips point
|
|
20240
|
+
* at a 404 (device 3836, 2026-08-17: 64 of 179 clips dead, 63 of them motion).
|
|
20241
|
+
* A read that FAILS drops the claim; it never invents it.
|
|
20242
|
+
*/
|
|
20243
|
+
thumbnail: string().optional(),
|
|
20244
|
+
/**
|
|
20245
|
+
* An instant INSIDE this visit's footage, hole-safe, where a recorded still
|
|
20246
|
+
* can be decoded. Present whenever the visit came from recorded availability;
|
|
20247
|
+
* absent on a per-event padded window (there is no footage to promise).
|
|
20248
|
+
*
|
|
20249
|
+
* This is not a thumbnail and not a second byte path: it is the argument to
|
|
20250
|
+
* the recorder's existing still route. The surface — never the provider —
|
|
20251
|
+
* decides whether to use it. It is the midpoint of the visit's LONGEST
|
|
20252
|
+
* contiguous range, not of the visit: a visit spans its holes by
|
|
20253
|
+
* construction, so a naive midpoint lands in dead air.
|
|
20254
|
+
*/
|
|
20255
|
+
stillAtMs: number().optional(),
|
|
20256
|
+
/**
|
|
20257
|
+
* Analytics event ids that overlap this visit — a BOUNDED sample, newest
|
|
20258
|
+
* first within kind (object → motion → audio), capped at
|
|
20259
|
+
* {@link MAX_CLIP_EVENT_IDS}. Empty on footage-only clips.
|
|
20260
|
+
*
|
|
20261
|
+
* Bounded because it is not a payload the surface pages through: one visit on
|
|
20262
|
+
* device 615 carried 2 345 ids, and `eventIds` was 99% of a 153 KB
|
|
20263
|
+
* camera-day. Read {@link eventCount} for the true total.
|
|
20264
|
+
*/
|
|
20265
|
+
eventIds: array(string()).optional(),
|
|
20266
|
+
/** How many analytics events actually overlap this visit. Differs from
|
|
20267
|
+
* `eventIds.length` exactly when the sample was capped — so a truncated
|
|
20268
|
+
* list is never mistaken for a quiet visit. */
|
|
20269
|
+
eventCount: number().int().nonnegative().optional(),
|
|
20270
|
+
/** Intra-visit footage holes (GOP rolls, discarded segments) still shorter
|
|
20271
|
+
* than `VISIT_MERGE_GAP_MS`. Playback concatenates around them; the timeline
|
|
20272
|
+
* bar keeps showing them via `recording.getAvailability`. */
|
|
20273
|
+
holes: array(object({
|
|
20274
|
+
startMs: number(),
|
|
20275
|
+
endMs: number()
|
|
20276
|
+
})).optional()
|
|
20163
20277
|
});
|
|
20164
20278
|
var ClipPlaybackSchema = object({
|
|
20165
20279
|
/** HLS master URL through the hub data-plane (Range + token in path). */
|
|
@@ -20623,7 +20737,14 @@ var SearchResultSchema = object({
|
|
|
20623
20737
|
});
|
|
20624
20738
|
var AutoUpdateSettingsSchema = object({
|
|
20625
20739
|
channel: ChannelSchema,
|
|
20626
|
-
intervalSeconds: number()
|
|
20740
|
+
intervalSeconds: number(),
|
|
20741
|
+
/**
|
|
20742
|
+
* Cadence of the "an update exists" POLLER, in seconds. Independent of
|
|
20743
|
+
* `channel`: the poller runs while auto-apply is `off`, because being told
|
|
20744
|
+
* about a publish and installing it are different decisions. Clamped
|
|
20745
|
+
* server-side to 900 s … 604800 s; defaults to 21600 s (6 h).
|
|
20746
|
+
*/
|
|
20747
|
+
updateCheckIntervalSeconds: number()
|
|
20627
20748
|
});
|
|
20628
20749
|
var AddonAutoUpdateSchema = ChannelWithInheritSchema;
|
|
20629
20750
|
var RestartAddonResultSchema = unknown();
|
|
@@ -20764,7 +20885,9 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
|
|
|
20764
20885
|
auth: "admin"
|
|
20765
20886
|
}), method(_void(), AutoUpdateSettingsSchema, { auth: "admin" }), method(object({
|
|
20766
20887
|
channel: ChannelSchema,
|
|
20767
|
-
intervalSeconds: number().min(300).max(86400).optional()
|
|
20888
|
+
intervalSeconds: number().min(300).max(86400).optional(),
|
|
20889
|
+
/** Availability-poll cadence; see AutoUpdateSettingsSchema. */
|
|
20890
|
+
updateCheckIntervalSeconds: number().min(900).max(604800).optional()
|
|
20768
20891
|
}), unknown(), {
|
|
20769
20892
|
kind: "mutation",
|
|
20770
20893
|
auth: "admin"
|
|
@@ -26445,7 +26568,9 @@ var ExportOptionsSchema = object({
|
|
|
26445
26568
|
includeAudio: boolean(),
|
|
26446
26569
|
maxLifeMs: number().int().positive(),
|
|
26447
26570
|
deleteAfterDownload: boolean(),
|
|
26448
|
-
title: string().max(200).optional()
|
|
26571
|
+
title: string().max(200).optional(),
|
|
26572
|
+
/** Notification-output target ids to ping when this export becomes ready. */
|
|
26573
|
+
notifyTargetIds: array(string().min(1)).max(20).optional()
|
|
26449
26574
|
}).superRefine((v, ctx) => {
|
|
26450
26575
|
if (v.speed !== void 0 && v.timelapse !== void 0) ctx.addIssue({
|
|
26451
26576
|
code: ZodIssueCode$1.custom,
|
|
@@ -26504,10 +26629,18 @@ var ExportBytesSchema = object({
|
|
|
26504
26629
|
});
|
|
26505
26630
|
method(object({
|
|
26506
26631
|
deviceId: number(),
|
|
26507
|
-
|
|
26632
|
+
/** @deprecated Prefer `profiles`. Kept so timelapse/notifiers keep working. */
|
|
26633
|
+
profile: string().optional(),
|
|
26634
|
+
profiles: array(string()).min(1).optional(),
|
|
26508
26635
|
fromMs: number(),
|
|
26509
26636
|
toMs: number(),
|
|
26510
26637
|
options: ExportOptionsSchema
|
|
26638
|
+
}).superRefine((v, ctx) => {
|
|
26639
|
+
if ((v.profiles !== void 0 && v.profiles.length > 0 ? v.profiles : v.profile !== void 0 ? [v.profile] : []).length < 1) ctx.addIssue({
|
|
26640
|
+
code: ZodIssueCode$1.custom,
|
|
26641
|
+
message: "pass profiles[] (min 1) or legacy profile",
|
|
26642
|
+
path: ["profiles"]
|
|
26643
|
+
});
|
|
26511
26644
|
}), ExportRecordSchema, {
|
|
26512
26645
|
kind: "mutation",
|
|
26513
26646
|
auth: "protected"
|
|
@@ -29449,15 +29582,6 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
29449
29582
|
labels: ["probe not implemented"]
|
|
29450
29583
|
};
|
|
29451
29584
|
}
|
|
29452
|
-
/**
|
|
29453
|
-
* Top-level devices restored at once in {@link onRestoreDevices}.
|
|
29454
|
-
*
|
|
29455
|
-
* Four covers the fleets this ships to without turning a boot into a burst a
|
|
29456
|
-
* camera NVR answers with a refusal. A provider whose upstream is a single
|
|
29457
|
-
* session with a serial command channel (a Baichuan hub, an NVR that
|
|
29458
|
-
* serialises ISAPI) should lower it; nothing needs to raise it.
|
|
29459
|
-
*/
|
|
29460
|
-
restoreConcurrency = 4;
|
|
29461
29585
|
async restoreDevices(savedDevices) {
|
|
29462
29586
|
await this.onRestoreDevices(savedDevices);
|
|
29463
29587
|
if (savedDevices.length > 0) this.ctx.logger.info(`Restored ${savedDevices.length} ${this.providerName} device(s)`);
|
|
@@ -29512,14 +29636,7 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
29512
29636
|
});
|
|
29513
29637
|
}
|
|
29514
29638
|
};
|
|
29515
|
-
|
|
29516
|
-
await Promise.all(Array.from({ length: Math.min(Math.max(1, this.restoreConcurrency), topLevel.length) }, async () => {
|
|
29517
|
-
for (;;) {
|
|
29518
|
-
const saved = topLevel[nextTopLevel++];
|
|
29519
|
-
if (saved === void 0) return;
|
|
29520
|
-
await restoreOne(saved);
|
|
29521
|
-
}
|
|
29522
|
-
}));
|
|
29639
|
+
await Promise.all(topLevel.map((saved) => restoreOne(saved)));
|
|
29523
29640
|
const childRows = savedDevices.filter((s) => s.parentDeviceId !== null);
|
|
29524
29641
|
for (const saved of childRows) {
|
|
29525
29642
|
const Class = this.deviceClasses[saved.type];
|
|
@@ -32792,6 +32909,12 @@ Object.freeze({
|
|
|
32792
32909
|
addonId: null,
|
|
32793
32910
|
access: "create"
|
|
32794
32911
|
},
|
|
32912
|
+
"pipelineAnalytics.reconcileFromDisk": {
|
|
32913
|
+
capName: "pipeline-analytics",
|
|
32914
|
+
capScope: "device",
|
|
32915
|
+
addonId: null,
|
|
32916
|
+
access: "create"
|
|
32917
|
+
},
|
|
32795
32918
|
"pipelineAnalytics.refreshStorageLocationsForMigration": {
|
|
32796
32919
|
capName: "pipeline-analytics",
|
|
32797
32920
|
capScope: "device",
|
|
@@ -33194,6 +33317,12 @@ Object.freeze({
|
|
|
33194
33317
|
addonId: null,
|
|
33195
33318
|
access: "view"
|
|
33196
33319
|
},
|
|
33320
|
+
"pipelineOrchestrator.getReconcileFromDiskStatus": {
|
|
33321
|
+
capName: "pipeline-orchestrator",
|
|
33322
|
+
capScope: "system",
|
|
33323
|
+
addonId: null,
|
|
33324
|
+
access: "view"
|
|
33325
|
+
},
|
|
33197
33326
|
"pipelineOrchestrator.listAgentSettings": {
|
|
33198
33327
|
capName: "pipeline-orchestrator",
|
|
33199
33328
|
capScope: "system",
|
|
@@ -33218,6 +33347,12 @@ Object.freeze({
|
|
|
33218
33347
|
addonId: null,
|
|
33219
33348
|
access: "create"
|
|
33220
33349
|
},
|
|
33350
|
+
"pipelineOrchestrator.reconcileFromDisk": {
|
|
33351
|
+
capName: "pipeline-orchestrator",
|
|
33352
|
+
capScope: "system",
|
|
33353
|
+
addonId: null,
|
|
33354
|
+
access: "create"
|
|
33355
|
+
},
|
|
33221
33356
|
"pipelineOrchestrator.removeAgentSettings": {
|
|
33222
33357
|
capName: "pipeline-orchestrator",
|
|
33223
33358
|
capScope: "system",
|
|
@@ -36209,6 +36344,11 @@ Object.freeze({
|
|
|
36209
36344
|
form: "single",
|
|
36210
36345
|
optional: true
|
|
36211
36346
|
}],
|
|
36347
|
+
"pipelineAnalytics.reconcileFromDisk": [{
|
|
36348
|
+
name: "deviceId",
|
|
36349
|
+
form: "single",
|
|
36350
|
+
optional: false
|
|
36351
|
+
}],
|
|
36212
36352
|
"pipelineAnalytics.restageRetrainTrack": [{
|
|
36213
36353
|
name: "deviceId",
|
|
36214
36354
|
form: "single",
|
|
@@ -37274,6 +37414,8 @@ DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
|
|
|
37274
37414
|
DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
|
|
37275
37415
|
DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
|
|
37276
37416
|
DEFAULT_NATIVE_LEASE_SETTINGS.admission;
|
|
37417
|
+
var MB = 1024 * 1024;
|
|
37418
|
+
1024 * MB, 3072 * MB;
|
|
37277
37419
|
//#endregion
|
|
37278
37420
|
//#region node_modules/@apocaliss92/nodewitt/node_modules/zod/v3/helpers/util.js
|
|
37279
37421
|
var util;
|
package/package.json
CHANGED