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