@camstack/addon-provider-unraid 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"
|
|
@@ -26460,7 +26583,9 @@ var ExportOptionsSchema = object({
|
|
|
26460
26583
|
includeAudio: boolean(),
|
|
26461
26584
|
maxLifeMs: number().int().positive(),
|
|
26462
26585
|
deleteAfterDownload: boolean(),
|
|
26463
|
-
title: string().max(200).optional()
|
|
26586
|
+
title: string().max(200).optional(),
|
|
26587
|
+
/** Notification-output target ids to ping when this export becomes ready. */
|
|
26588
|
+
notifyTargetIds: array(string().min(1)).max(20).optional()
|
|
26464
26589
|
}).superRefine((v, ctx) => {
|
|
26465
26590
|
if (v.speed !== void 0 && v.timelapse !== void 0) ctx.addIssue({
|
|
26466
26591
|
code: ZodIssueCode.custom,
|
|
@@ -26519,10 +26644,18 @@ var ExportBytesSchema = object({
|
|
|
26519
26644
|
});
|
|
26520
26645
|
method(object({
|
|
26521
26646
|
deviceId: number(),
|
|
26522
|
-
|
|
26647
|
+
/** @deprecated Prefer `profiles`. Kept so timelapse/notifiers keep working. */
|
|
26648
|
+
profile: string().optional(),
|
|
26649
|
+
profiles: array(string()).min(1).optional(),
|
|
26523
26650
|
fromMs: number(),
|
|
26524
26651
|
toMs: number(),
|
|
26525
26652
|
options: ExportOptionsSchema
|
|
26653
|
+
}).superRefine((v, ctx) => {
|
|
26654
|
+
if ((v.profiles !== void 0 && v.profiles.length > 0 ? v.profiles : v.profile !== void 0 ? [v.profile] : []).length < 1) ctx.addIssue({
|
|
26655
|
+
code: ZodIssueCode.custom,
|
|
26656
|
+
message: "pass profiles[] (min 1) or legacy profile",
|
|
26657
|
+
path: ["profiles"]
|
|
26658
|
+
});
|
|
26526
26659
|
}), ExportRecordSchema, {
|
|
26527
26660
|
kind: "mutation",
|
|
26528
26661
|
auth: "protected"
|
|
@@ -29464,15 +29597,6 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
29464
29597
|
labels: ["probe not implemented"]
|
|
29465
29598
|
};
|
|
29466
29599
|
}
|
|
29467
|
-
/**
|
|
29468
|
-
* Top-level devices restored at once in {@link onRestoreDevices}.
|
|
29469
|
-
*
|
|
29470
|
-
* Four covers the fleets this ships to without turning a boot into a burst a
|
|
29471
|
-
* camera NVR answers with a refusal. A provider whose upstream is a single
|
|
29472
|
-
* session with a serial command channel (a Baichuan hub, an NVR that
|
|
29473
|
-
* serialises ISAPI) should lower it; nothing needs to raise it.
|
|
29474
|
-
*/
|
|
29475
|
-
restoreConcurrency = 4;
|
|
29476
29600
|
async restoreDevices(savedDevices) {
|
|
29477
29601
|
await this.onRestoreDevices(savedDevices);
|
|
29478
29602
|
if (savedDevices.length > 0) this.ctx.logger.info(`Restored ${savedDevices.length} ${this.providerName} device(s)`);
|
|
@@ -29527,14 +29651,7 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
29527
29651
|
});
|
|
29528
29652
|
}
|
|
29529
29653
|
};
|
|
29530
|
-
|
|
29531
|
-
await Promise.all(Array.from({ length: Math.min(Math.max(1, this.restoreConcurrency), topLevel.length) }, async () => {
|
|
29532
|
-
for (;;) {
|
|
29533
|
-
const saved = topLevel[nextTopLevel++];
|
|
29534
|
-
if (saved === void 0) return;
|
|
29535
|
-
await restoreOne(saved);
|
|
29536
|
-
}
|
|
29537
|
-
}));
|
|
29654
|
+
await Promise.all(topLevel.map((saved) => restoreOne(saved)));
|
|
29538
29655
|
const childRows = savedDevices.filter((s) => s.parentDeviceId !== null);
|
|
29539
29656
|
for (const saved of childRows) {
|
|
29540
29657
|
const Class = this.deviceClasses[saved.type];
|
|
@@ -32807,6 +32924,12 @@ Object.freeze({
|
|
|
32807
32924
|
addonId: null,
|
|
32808
32925
|
access: "create"
|
|
32809
32926
|
},
|
|
32927
|
+
"pipelineAnalytics.reconcileFromDisk": {
|
|
32928
|
+
capName: "pipeline-analytics",
|
|
32929
|
+
capScope: "device",
|
|
32930
|
+
addonId: null,
|
|
32931
|
+
access: "create"
|
|
32932
|
+
},
|
|
32810
32933
|
"pipelineAnalytics.refreshStorageLocationsForMigration": {
|
|
32811
32934
|
capName: "pipeline-analytics",
|
|
32812
32935
|
capScope: "device",
|
|
@@ -33209,6 +33332,12 @@ Object.freeze({
|
|
|
33209
33332
|
addonId: null,
|
|
33210
33333
|
access: "view"
|
|
33211
33334
|
},
|
|
33335
|
+
"pipelineOrchestrator.getReconcileFromDiskStatus": {
|
|
33336
|
+
capName: "pipeline-orchestrator",
|
|
33337
|
+
capScope: "system",
|
|
33338
|
+
addonId: null,
|
|
33339
|
+
access: "view"
|
|
33340
|
+
},
|
|
33212
33341
|
"pipelineOrchestrator.listAgentSettings": {
|
|
33213
33342
|
capName: "pipeline-orchestrator",
|
|
33214
33343
|
capScope: "system",
|
|
@@ -33233,6 +33362,12 @@ Object.freeze({
|
|
|
33233
33362
|
addonId: null,
|
|
33234
33363
|
access: "create"
|
|
33235
33364
|
},
|
|
33365
|
+
"pipelineOrchestrator.reconcileFromDisk": {
|
|
33366
|
+
capName: "pipeline-orchestrator",
|
|
33367
|
+
capScope: "system",
|
|
33368
|
+
addonId: null,
|
|
33369
|
+
access: "create"
|
|
33370
|
+
},
|
|
33236
33371
|
"pipelineOrchestrator.removeAgentSettings": {
|
|
33237
33372
|
capName: "pipeline-orchestrator",
|
|
33238
33373
|
capScope: "system",
|
|
@@ -36224,6 +36359,11 @@ Object.freeze({
|
|
|
36224
36359
|
form: "single",
|
|
36225
36360
|
optional: true
|
|
36226
36361
|
}],
|
|
36362
|
+
"pipelineAnalytics.reconcileFromDisk": [{
|
|
36363
|
+
name: "deviceId",
|
|
36364
|
+
form: "single",
|
|
36365
|
+
optional: false
|
|
36366
|
+
}],
|
|
36227
36367
|
"pipelineAnalytics.restageRetrainTrack": [{
|
|
36228
36368
|
name: "deviceId",
|
|
36229
36369
|
form: "single",
|
|
@@ -37289,6 +37429,8 @@ DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
|
|
|
37289
37429
|
DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
|
|
37290
37430
|
DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
|
|
37291
37431
|
DEFAULT_NATIVE_LEASE_SETTINGS.admission;
|
|
37432
|
+
var MB = 1024 * 1024;
|
|
37433
|
+
1024 * MB, 3072 * MB;
|
|
37292
37434
|
//#endregion
|
|
37293
37435
|
//#region src/config.ts
|
|
37294
37436
|
/**
|
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"
|
|
@@ -26459,7 +26582,9 @@ var ExportOptionsSchema = object({
|
|
|
26459
26582
|
includeAudio: boolean(),
|
|
26460
26583
|
maxLifeMs: number().int().positive(),
|
|
26461
26584
|
deleteAfterDownload: boolean(),
|
|
26462
|
-
title: string().max(200).optional()
|
|
26585
|
+
title: string().max(200).optional(),
|
|
26586
|
+
/** Notification-output target ids to ping when this export becomes ready. */
|
|
26587
|
+
notifyTargetIds: array(string().min(1)).max(20).optional()
|
|
26463
26588
|
}).superRefine((v, ctx) => {
|
|
26464
26589
|
if (v.speed !== void 0 && v.timelapse !== void 0) ctx.addIssue({
|
|
26465
26590
|
code: ZodIssueCode.custom,
|
|
@@ -26518,10 +26643,18 @@ var ExportBytesSchema = object({
|
|
|
26518
26643
|
});
|
|
26519
26644
|
method(object({
|
|
26520
26645
|
deviceId: number(),
|
|
26521
|
-
|
|
26646
|
+
/** @deprecated Prefer `profiles`. Kept so timelapse/notifiers keep working. */
|
|
26647
|
+
profile: string().optional(),
|
|
26648
|
+
profiles: array(string()).min(1).optional(),
|
|
26522
26649
|
fromMs: number(),
|
|
26523
26650
|
toMs: number(),
|
|
26524
26651
|
options: ExportOptionsSchema
|
|
26652
|
+
}).superRefine((v, ctx) => {
|
|
26653
|
+
if ((v.profiles !== void 0 && v.profiles.length > 0 ? v.profiles : v.profile !== void 0 ? [v.profile] : []).length < 1) ctx.addIssue({
|
|
26654
|
+
code: ZodIssueCode.custom,
|
|
26655
|
+
message: "pass profiles[] (min 1) or legacy profile",
|
|
26656
|
+
path: ["profiles"]
|
|
26657
|
+
});
|
|
26525
26658
|
}), ExportRecordSchema, {
|
|
26526
26659
|
kind: "mutation",
|
|
26527
26660
|
auth: "protected"
|
|
@@ -29463,15 +29596,6 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
29463
29596
|
labels: ["probe not implemented"]
|
|
29464
29597
|
};
|
|
29465
29598
|
}
|
|
29466
|
-
/**
|
|
29467
|
-
* Top-level devices restored at once in {@link onRestoreDevices}.
|
|
29468
|
-
*
|
|
29469
|
-
* Four covers the fleets this ships to without turning a boot into a burst a
|
|
29470
|
-
* camera NVR answers with a refusal. A provider whose upstream is a single
|
|
29471
|
-
* session with a serial command channel (a Baichuan hub, an NVR that
|
|
29472
|
-
* serialises ISAPI) should lower it; nothing needs to raise it.
|
|
29473
|
-
*/
|
|
29474
|
-
restoreConcurrency = 4;
|
|
29475
29599
|
async restoreDevices(savedDevices) {
|
|
29476
29600
|
await this.onRestoreDevices(savedDevices);
|
|
29477
29601
|
if (savedDevices.length > 0) this.ctx.logger.info(`Restored ${savedDevices.length} ${this.providerName} device(s)`);
|
|
@@ -29526,14 +29650,7 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
29526
29650
|
});
|
|
29527
29651
|
}
|
|
29528
29652
|
};
|
|
29529
|
-
|
|
29530
|
-
await Promise.all(Array.from({ length: Math.min(Math.max(1, this.restoreConcurrency), topLevel.length) }, async () => {
|
|
29531
|
-
for (;;) {
|
|
29532
|
-
const saved = topLevel[nextTopLevel++];
|
|
29533
|
-
if (saved === void 0) return;
|
|
29534
|
-
await restoreOne(saved);
|
|
29535
|
-
}
|
|
29536
|
-
}));
|
|
29653
|
+
await Promise.all(topLevel.map((saved) => restoreOne(saved)));
|
|
29537
29654
|
const childRows = savedDevices.filter((s) => s.parentDeviceId !== null);
|
|
29538
29655
|
for (const saved of childRows) {
|
|
29539
29656
|
const Class = this.deviceClasses[saved.type];
|
|
@@ -32806,6 +32923,12 @@ Object.freeze({
|
|
|
32806
32923
|
addonId: null,
|
|
32807
32924
|
access: "create"
|
|
32808
32925
|
},
|
|
32926
|
+
"pipelineAnalytics.reconcileFromDisk": {
|
|
32927
|
+
capName: "pipeline-analytics",
|
|
32928
|
+
capScope: "device",
|
|
32929
|
+
addonId: null,
|
|
32930
|
+
access: "create"
|
|
32931
|
+
},
|
|
32809
32932
|
"pipelineAnalytics.refreshStorageLocationsForMigration": {
|
|
32810
32933
|
capName: "pipeline-analytics",
|
|
32811
32934
|
capScope: "device",
|
|
@@ -33208,6 +33331,12 @@ Object.freeze({
|
|
|
33208
33331
|
addonId: null,
|
|
33209
33332
|
access: "view"
|
|
33210
33333
|
},
|
|
33334
|
+
"pipelineOrchestrator.getReconcileFromDiskStatus": {
|
|
33335
|
+
capName: "pipeline-orchestrator",
|
|
33336
|
+
capScope: "system",
|
|
33337
|
+
addonId: null,
|
|
33338
|
+
access: "view"
|
|
33339
|
+
},
|
|
33211
33340
|
"pipelineOrchestrator.listAgentSettings": {
|
|
33212
33341
|
capName: "pipeline-orchestrator",
|
|
33213
33342
|
capScope: "system",
|
|
@@ -33232,6 +33361,12 @@ Object.freeze({
|
|
|
33232
33361
|
addonId: null,
|
|
33233
33362
|
access: "create"
|
|
33234
33363
|
},
|
|
33364
|
+
"pipelineOrchestrator.reconcileFromDisk": {
|
|
33365
|
+
capName: "pipeline-orchestrator",
|
|
33366
|
+
capScope: "system",
|
|
33367
|
+
addonId: null,
|
|
33368
|
+
access: "create"
|
|
33369
|
+
},
|
|
33235
33370
|
"pipelineOrchestrator.removeAgentSettings": {
|
|
33236
33371
|
capName: "pipeline-orchestrator",
|
|
33237
33372
|
capScope: "system",
|
|
@@ -36223,6 +36358,11 @@ Object.freeze({
|
|
|
36223
36358
|
form: "single",
|
|
36224
36359
|
optional: true
|
|
36225
36360
|
}],
|
|
36361
|
+
"pipelineAnalytics.reconcileFromDisk": [{
|
|
36362
|
+
name: "deviceId",
|
|
36363
|
+
form: "single",
|
|
36364
|
+
optional: false
|
|
36365
|
+
}],
|
|
36226
36366
|
"pipelineAnalytics.restageRetrainTrack": [{
|
|
36227
36367
|
name: "deviceId",
|
|
36228
36368
|
form: "single",
|
|
@@ -37288,6 +37428,8 @@ DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
|
|
|
37288
37428
|
DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
|
|
37289
37429
|
DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
|
|
37290
37430
|
DEFAULT_NATIVE_LEASE_SETTINGS.admission;
|
|
37431
|
+
var MB = 1024 * 1024;
|
|
37432
|
+
1024 * MB, 3072 * MB;
|
|
37291
37433
|
//#endregion
|
|
37292
37434
|
//#region src/config.ts
|
|
37293
37435
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/addon-provider-unraid",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.21",
|
|
4
4
|
"description": "Unraid device-provider addon for CamStack — one Container per Unraid instance fanning out array, disk, docker and notification entities",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|