@camstack/addon-matter-broker 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 -44
- package/dist/addon.mjs +187 -44
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -13,7 +13,7 @@ let node_stream_promises = require("node:stream/promises");
|
|
|
13
13
|
let node_net = require("node:net");
|
|
14
14
|
let node_dgram = require("node:dgram");
|
|
15
15
|
node_dgram = require_esm.__toESM(node_dgram, 1);
|
|
16
|
-
//#region ../types/dist/event-category-
|
|
16
|
+
//#region ../types/dist/event-category-XfKNtfCc.mjs
|
|
17
17
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
18
18
|
EventCategory["SystemBoot"] = "system.boot";
|
|
19
19
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -30,9 +30,10 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
30
30
|
EventCategory["SystemRestartCompleted"] = "system.restart-completed";
|
|
31
31
|
/**
|
|
32
32
|
* A newer addon or server-root package version was found by the
|
|
33
|
-
* authoritative registry check. Emitted once
|
|
34
|
-
* `(
|
|
35
|
-
*
|
|
33
|
+
* authoritative registry check. Emitted once when any observed
|
|
34
|
+
* `latestVersion` changes (or a package/node first appears behind);
|
|
35
|
+
* the payload carries the full currently-available list. Repeated
|
|
36
|
+
* polling of the same latests is silent.
|
|
36
37
|
*/
|
|
37
38
|
EventCategory["UpdateAvailable"] = "update.available";
|
|
38
39
|
/**
|
|
@@ -51,6 +52,22 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
51
52
|
EventCategory["AddonInstalled"] = "addon.installed";
|
|
52
53
|
EventCategory["AddonUninstalled"] = "addon.uninstalled";
|
|
53
54
|
EventCategory["AddonCrashed"] = "addon.crashed";
|
|
55
|
+
/**
|
|
56
|
+
* A RUNNER the D6 crash circuit-breaker gave up on — terminal.
|
|
57
|
+
*
|
|
58
|
+
* `AddonCrashed` is the routine, self-healing fact ("it crashed; it is being
|
|
59
|
+
* respawned"); this is the one that never resolves itself. Emitted exactly
|
|
60
|
+
* once per trip, by `process-service.ts`, carrying the node, the runner, the
|
|
61
|
+
* addons it hosted and the crash count that tripped the breaker.
|
|
62
|
+
*
|
|
63
|
+
* It exists because a runner marked terminally `failed` used to be SILENT:
|
|
64
|
+
* on 2026-08-18 the `recorder` runner died of three unhandled ffmpeg spawn
|
|
65
|
+
* errors, the breaker stopped respawning it (correctly), `/health` kept
|
|
66
|
+
* returning 200, and fleet-wide recording was gone for 3h15 before the
|
|
67
|
+
* operator's phone told him. The Notification Center's system-event intake
|
|
68
|
+
* consumes this category and maps it to the `addon-crash-loop` kind.
|
|
69
|
+
*/
|
|
70
|
+
EventCategory["AddonRunnerFailed"] = "addon.runner-failed";
|
|
54
71
|
EventCategory["AddonError"] = "addon.error";
|
|
55
72
|
EventCategory["AddonPageReady"] = "addon.page-ready";
|
|
56
73
|
EventCategory["AddonWidgetReady"] = "addon.widget-ready";
|
|
@@ -7562,6 +7579,10 @@ var RecordingBandSchema = object({
|
|
|
7562
7579
|
preBufferSec: number().min(0).optional(),
|
|
7563
7580
|
postBufferSec: number().min(0).optional()
|
|
7564
7581
|
});
|
|
7582
|
+
({
|
|
7583
|
+
preBufferSec: 10,
|
|
7584
|
+
postBufferSec: 30
|
|
7585
|
+
}).postBufferSec * 1e3;
|
|
7565
7586
|
/**
|
|
7566
7587
|
* Per-device retention overrides. Every field is optional; an unset or `0`
|
|
7567
7588
|
* value inherits the node-wide recorder default. Only footage-lifetime limits
|
|
@@ -7609,6 +7630,12 @@ var RecordingConfigSchema = object({
|
|
|
7609
7630
|
/** DERIVED summary of `bands`, stamped by the recorder on every save.
|
|
7610
7631
|
* Authoring it has no effect — see {@link RecordingStorageModeSchema}. */
|
|
7611
7632
|
mode: RecordingStorageModeSchema.optional(),
|
|
7633
|
+
/**
|
|
7634
|
+
* Which assigned broker slots to record. Absent / empty = {@link
|
|
7635
|
+
* DEFAULT_RECORDING_PROFILES} (`high`+`low`) intersected with the
|
|
7636
|
+
* camera's currently assigned slots — never `mid` unless the operator
|
|
7637
|
+
* picks it, and never a slot the broker has not assigned.
|
|
7638
|
+
*/
|
|
7612
7639
|
profiles: array(CamProfileSchema).optional(),
|
|
7613
7640
|
segmentSeconds: number().int().positive().optional(),
|
|
7614
7641
|
/**
|
|
@@ -7689,7 +7716,11 @@ var RelocateFootageInputSchema = object({
|
|
|
7689
7716
|
profiles: array(string$2()).optional(),
|
|
7690
7717
|
/** Copy throttle in MB/s (default 40) — the drain is a background chore,
|
|
7691
7718
|
* never allowed to starve live writers. */
|
|
7692
|
-
throttleMbps: number().min(1).max(1e3).optional()
|
|
7719
|
+
throttleMbps: number().min(1).max(1e3).optional(),
|
|
7720
|
+
/** Move only segments whose startMs is >= this. Absent = the whole source
|
|
7721
|
+
* pile. Used when a full drain is too expensive and the operator only
|
|
7722
|
+
* wants the recent window on the new disk. */
|
|
7723
|
+
sinceMs: number().int().optional()
|
|
7693
7724
|
});
|
|
7694
7725
|
/** Internal, lease-scoped participant operation. It is intentionally separate
|
|
7695
7726
|
* from persistent recording settings: a migration never changes
|
|
@@ -14620,6 +14651,7 @@ var NcSystemEventKindSchema = _enum([
|
|
|
14620
14651
|
"node-offline",
|
|
14621
14652
|
"node-inference-unavailable",
|
|
14622
14653
|
"detection-blind",
|
|
14654
|
+
"addon-crash-loop",
|
|
14623
14655
|
"addon-update-available",
|
|
14624
14656
|
"server-update-available",
|
|
14625
14657
|
"alarm-triggered",
|
|
@@ -14627,6 +14659,9 @@ var NcSystemEventKindSchema = _enum([
|
|
|
14627
14659
|
"alarm-disarmed",
|
|
14628
14660
|
"alarm-arming",
|
|
14629
14661
|
"alarm-arm-refused",
|
|
14662
|
+
"addon-updated",
|
|
14663
|
+
"server-updated",
|
|
14664
|
+
"export-completed",
|
|
14630
14665
|
"camera-online",
|
|
14631
14666
|
"camera-offline",
|
|
14632
14667
|
"camera-disabled",
|
|
@@ -16520,13 +16555,19 @@ var RetrainStatusSchema = _enum([
|
|
|
16520
16555
|
* "never marked" from "already trained" must read `retrainStatus`.
|
|
16521
16556
|
*
|
|
16522
16557
|
* `debug` does NOT pin; it is attention, not durability.
|
|
16558
|
+
*
|
|
16559
|
+
* `favourited` IS a BOOLEAN pin (durability bit), not a retrain lifecycle.
|
|
16560
|
+
* A favourited track is skipped by retention the same way `staging` is, but
|
|
16561
|
+
* it does not enter `none|staging|trained` and has no staging budget.
|
|
16523
16562
|
*/
|
|
16524
16563
|
var TrackFlagFields = {
|
|
16525
16564
|
/** Operator marked this track as training material — i.e. `retrainStatus` is
|
|
16526
16565
|
* `'staging'`. */
|
|
16527
16566
|
markForTrain: boolean().optional(),
|
|
16528
16567
|
/** Operator marked this track for diagnostic attention. */
|
|
16529
|
-
debug: boolean().optional()
|
|
16568
|
+
debug: boolean().optional(),
|
|
16569
|
+
/** Operator favourited this track. Pins it against pruning. */
|
|
16570
|
+
favourited: boolean().optional()
|
|
16530
16571
|
};
|
|
16531
16572
|
/**
|
|
16532
16573
|
* The lifecycle field itself, on the READ surfaces only (`Track`, `KeyEvent`).
|
|
@@ -16551,6 +16592,7 @@ var TrackFlagsSchema = object({
|
|
|
16551
16592
|
trackId: string$2(),
|
|
16552
16593
|
markForTrain: boolean(),
|
|
16553
16594
|
debug: boolean(),
|
|
16595
|
+
favourited: boolean(),
|
|
16554
16596
|
/** The lifecycle state the boolean was derived from. Required here (unlike on
|
|
16555
16597
|
* a track row) because this shape is only ever produced by the write body,
|
|
16556
16598
|
* which always knows it — and a surface that has just written needs to render
|
|
@@ -17183,6 +17225,12 @@ var TrackCascadeCountsSchema = object({
|
|
|
17183
17225
|
/** Per-track CLIP search vectors removed (best-effort). */
|
|
17184
17226
|
embeddings: number().int()
|
|
17185
17227
|
});
|
|
17228
|
+
/** Disk-wins reconcile: media rows whose blobs are gone, then empty tracks. */
|
|
17229
|
+
var DiskReconcileCountsSchema = object({
|
|
17230
|
+
mediaDropped: number().int(),
|
|
17231
|
+
tracks: number().int(),
|
|
17232
|
+
events: number().int()
|
|
17233
|
+
});
|
|
17186
17234
|
/** Event-store footprint for one camera. */
|
|
17187
17235
|
var EventStoreDeviceFootprintSchema = object({
|
|
17188
17236
|
deviceId: number(),
|
|
@@ -17359,6 +17407,9 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
17359
17407
|
}), method(object({ deviceId: number() }), TrackCascadeCountsSchema, {
|
|
17360
17408
|
kind: "mutation",
|
|
17361
17409
|
auth: "admin"
|
|
17410
|
+
}), method(object({ deviceId: number() }), DiskReconcileCountsSchema, {
|
|
17411
|
+
kind: "mutation",
|
|
17412
|
+
auth: "admin"
|
|
17362
17413
|
}), method(object({
|
|
17363
17414
|
deviceId: number(),
|
|
17364
17415
|
trackIds: array(string$2()).min(1)
|
|
@@ -18909,6 +18960,24 @@ var CameraStatusDegradationSchema = object({
|
|
|
18909
18960
|
*
|
|
18910
18961
|
* See spec: `docs/superpowers/specs/2026-06-24-camera-status-aggregator-cap.md`
|
|
18911
18962
|
*/
|
|
18963
|
+
var DiskReconcileJobSchema = object({
|
|
18964
|
+
state: _enum([
|
|
18965
|
+
"idle",
|
|
18966
|
+
"running",
|
|
18967
|
+
"done",
|
|
18968
|
+
"error"
|
|
18969
|
+
]),
|
|
18970
|
+
total: number().int().nonnegative(),
|
|
18971
|
+
completed: number().int().nonnegative(),
|
|
18972
|
+
currentDeviceId: number().int().nullable(),
|
|
18973
|
+
failed: array(number().int()).readonly(),
|
|
18974
|
+
mediaDropped: number().int().nonnegative(),
|
|
18975
|
+
tracks: number().int().nonnegative(),
|
|
18976
|
+
events: number().int().nonnegative(),
|
|
18977
|
+
startedAtMs: number().int().nullable(),
|
|
18978
|
+
finishedAtMs: number().int().nullable(),
|
|
18979
|
+
error: string$2().nullable()
|
|
18980
|
+
});
|
|
18912
18981
|
var CameraStatusSchema = object({
|
|
18913
18982
|
deviceId: number(),
|
|
18914
18983
|
assignment: CameraAssignmentStatusSchema,
|
|
@@ -19140,7 +19209,10 @@ method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
|
|
|
19140
19209
|
}), CameraSwitchGroupSchema, {
|
|
19141
19210
|
kind: "mutation",
|
|
19142
19211
|
auth: "admin"
|
|
19143
|
-
}), method(object({ deviceId: number() }), CameraStatusSchema), method(object({ deviceIds: array(number()).optional() }), array(CameraStatusSchema).readonly()), method(_void(),
|
|
19212
|
+
}), method(object({ deviceId: number() }), CameraStatusSchema), method(object({ deviceIds: array(number()).optional() }), array(CameraStatusSchema).readonly()), method(_void(), DiskReconcileJobSchema, {
|
|
19213
|
+
kind: "mutation",
|
|
19214
|
+
auth: "admin"
|
|
19215
|
+
}), method(_void(), DiskReconcileJobSchema, { auth: "admin" }), method(_void(), array(PipelineTemplateSchema).readonly()), method(object({
|
|
19144
19216
|
name: string$2(),
|
|
19145
19217
|
description: string$2().optional(),
|
|
19146
19218
|
config: CameraPipelineConfigSchema
|
|
@@ -20213,20 +20285,6 @@ var VectorStatsResultSchema = object({
|
|
|
20213
20285
|
exact: boolean()
|
|
20214
20286
|
});
|
|
20215
20287
|
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);
|
|
20216
|
-
/**
|
|
20217
|
-
* `videoclips` — the unified, navigable-clip surface for a camera.
|
|
20218
|
-
*
|
|
20219
|
-
* A device-scoped WRAPPER cap (like `pipeline-analytics`): exactly one active
|
|
20220
|
-
* provider per device, substitutable. The DEFAULT provider (registered by
|
|
20221
|
-
* `addon-post-analysis`, `defaultActive: true`) composes the analytics event
|
|
20222
|
-
* log (markers + thumbnails) with the recorder's `getPlaybackManifest` — a clip
|
|
20223
|
-
* is a time-WINDOW over existing footage, never a separate file. A camera that
|
|
20224
|
-
* exposes NATIVE onboard clips (Reolink/Hikvision NVR) can later substitute the
|
|
20225
|
-
* wrapper provider for its device and serve its own clip catalog + URLs.
|
|
20226
|
-
*
|
|
20227
|
-
* A `Clip` is purely time-based (subtree-blind): playback resolves segments by
|
|
20228
|
-
* temporal overlap, so the API never decides `continuous` vs `events`.
|
|
20229
|
-
*/
|
|
20230
20288
|
var ClipSchema = object({
|
|
20231
20289
|
/** Opaque, provider-namespaced id. The default provider encodes the time
|
|
20232
20290
|
* window so `getClipPlayback` is self-contained (no event re-query). */
|
|
@@ -20243,8 +20301,65 @@ var ClipSchema = object({
|
|
|
20243
20301
|
startMs: number(),
|
|
20244
20302
|
endMs: number()
|
|
20245
20303
|
}),
|
|
20246
|
-
/**
|
|
20247
|
-
|
|
20304
|
+
/**
|
|
20305
|
+
* Distinct object classes attached to this visit (`person`, `car`, …),
|
|
20306
|
+
* dominant first, capped at {@link MAX_CLIP_LABELS}. The ribbon renders these
|
|
20307
|
+
* instead of the bare kind — "Object" tells the operator nothing a colour bar
|
|
20308
|
+
* did not. Absent (never empty) when the visit attached no classified object
|
|
20309
|
+
* event, so a motion/audio-only visit keeps its kind label.
|
|
20310
|
+
*/
|
|
20311
|
+
labels: array(string$2()).max(3).optional(),
|
|
20312
|
+
/**
|
|
20313
|
+
* Lazy thumbnail URL, never inlined.
|
|
20314
|
+
*
|
|
20315
|
+
* Recording-derived clips (events-mode keep-window, and the prepared
|
|
20316
|
+
* continuous event+fragment visit) MUST use the snapshot of the **main
|
|
20317
|
+
* event of the interval** — `getEventMedia({ eventId, kind: 'snapshot' })`
|
|
20318
|
+
* of the event that owns `kind` (object > motion > audio). Do not extract
|
|
20319
|
+
* a keyframe from the recorded segments. Other providers (onboard, HKSV)
|
|
20320
|
+
* mint their own stills.
|
|
20321
|
+
*
|
|
20322
|
+
* **VOUCHED, never fabricated.** A provider emits this only for an event it
|
|
20323
|
+
* has CONFIRMED owns at least one media row (its own, or its owning track's).
|
|
20324
|
+
* Absent is meaningful — "this visit has no event still" — never "we did not
|
|
20325
|
+
* look". Stamping it from a URL template made 35% of one camera's clips point
|
|
20326
|
+
* at a 404 (device 3836, 2026-08-17: 64 of 179 clips dead, 63 of them motion).
|
|
20327
|
+
* A read that FAILS drops the claim; it never invents it.
|
|
20328
|
+
*/
|
|
20329
|
+
thumbnail: string$2().optional(),
|
|
20330
|
+
/**
|
|
20331
|
+
* An instant INSIDE this visit's footage, hole-safe, where a recorded still
|
|
20332
|
+
* can be decoded. Present whenever the visit came from recorded availability;
|
|
20333
|
+
* absent on a per-event padded window (there is no footage to promise).
|
|
20334
|
+
*
|
|
20335
|
+
* This is not a thumbnail and not a second byte path: it is the argument to
|
|
20336
|
+
* the recorder's existing still route. The surface — never the provider —
|
|
20337
|
+
* decides whether to use it. It is the midpoint of the visit's LONGEST
|
|
20338
|
+
* contiguous range, not of the visit: a visit spans its holes by
|
|
20339
|
+
* construction, so a naive midpoint lands in dead air.
|
|
20340
|
+
*/
|
|
20341
|
+
stillAtMs: number().optional(),
|
|
20342
|
+
/**
|
|
20343
|
+
* Analytics event ids that overlap this visit — a BOUNDED sample, newest
|
|
20344
|
+
* first within kind (object → motion → audio), capped at
|
|
20345
|
+
* {@link MAX_CLIP_EVENT_IDS}. Empty on footage-only clips.
|
|
20346
|
+
*
|
|
20347
|
+
* Bounded because it is not a payload the surface pages through: one visit on
|
|
20348
|
+
* device 615 carried 2 345 ids, and `eventIds` was 99% of a 153 KB
|
|
20349
|
+
* camera-day. Read {@link eventCount} for the true total.
|
|
20350
|
+
*/
|
|
20351
|
+
eventIds: array(string$2()).optional(),
|
|
20352
|
+
/** How many analytics events actually overlap this visit. Differs from
|
|
20353
|
+
* `eventIds.length` exactly when the sample was capped — so a truncated
|
|
20354
|
+
* list is never mistaken for a quiet visit. */
|
|
20355
|
+
eventCount: number().int().nonnegative().optional(),
|
|
20356
|
+
/** Intra-visit footage holes (GOP rolls, discarded segments) still shorter
|
|
20357
|
+
* than `VISIT_MERGE_GAP_MS`. Playback concatenates around them; the timeline
|
|
20358
|
+
* bar keeps showing them via `recording.getAvailability`. */
|
|
20359
|
+
holes: array(object({
|
|
20360
|
+
startMs: number(),
|
|
20361
|
+
endMs: number()
|
|
20362
|
+
})).optional()
|
|
20248
20363
|
});
|
|
20249
20364
|
var ClipPlaybackSchema = object({
|
|
20250
20365
|
/** HLS master URL through the hub data-plane (Range + token in path). */
|
|
@@ -20708,7 +20823,14 @@ var SearchResultSchema = object({
|
|
|
20708
20823
|
});
|
|
20709
20824
|
var AutoUpdateSettingsSchema = object({
|
|
20710
20825
|
channel: ChannelSchema,
|
|
20711
|
-
intervalSeconds: number()
|
|
20826
|
+
intervalSeconds: number(),
|
|
20827
|
+
/**
|
|
20828
|
+
* Cadence of the "an update exists" POLLER, in seconds. Independent of
|
|
20829
|
+
* `channel`: the poller runs while auto-apply is `off`, because being told
|
|
20830
|
+
* about a publish and installing it are different decisions. Clamped
|
|
20831
|
+
* server-side to 900 s … 604800 s; defaults to 21600 s (6 h).
|
|
20832
|
+
*/
|
|
20833
|
+
updateCheckIntervalSeconds: number()
|
|
20712
20834
|
});
|
|
20713
20835
|
var AddonAutoUpdateSchema = ChannelWithInheritSchema;
|
|
20714
20836
|
var RestartAddonResultSchema = unknown();
|
|
@@ -20849,7 +20971,9 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
|
|
|
20849
20971
|
auth: "admin"
|
|
20850
20972
|
}), method(_void(), AutoUpdateSettingsSchema, { auth: "admin" }), method(object({
|
|
20851
20973
|
channel: ChannelSchema,
|
|
20852
|
-
intervalSeconds: number().min(300).max(86400).optional()
|
|
20974
|
+
intervalSeconds: number().min(300).max(86400).optional(),
|
|
20975
|
+
/** Availability-poll cadence; see AutoUpdateSettingsSchema. */
|
|
20976
|
+
updateCheckIntervalSeconds: number().min(900).max(604800).optional()
|
|
20853
20977
|
}), unknown(), {
|
|
20854
20978
|
kind: "mutation",
|
|
20855
20979
|
auth: "admin"
|
|
@@ -26547,7 +26671,9 @@ var ExportOptionsSchema = object({
|
|
|
26547
26671
|
includeAudio: boolean(),
|
|
26548
26672
|
maxLifeMs: number().int().positive(),
|
|
26549
26673
|
deleteAfterDownload: boolean(),
|
|
26550
|
-
title: string$2().max(200).optional()
|
|
26674
|
+
title: string$2().max(200).optional(),
|
|
26675
|
+
/** Notification-output target ids to ping when this export becomes ready. */
|
|
26676
|
+
notifyTargetIds: array(string$2().min(1)).max(20).optional()
|
|
26551
26677
|
}).superRefine((v, ctx) => {
|
|
26552
26678
|
if (v.speed !== void 0 && v.timelapse !== void 0) ctx.addIssue({
|
|
26553
26679
|
code: ZodIssueCode.custom,
|
|
@@ -26606,10 +26732,18 @@ var ExportBytesSchema = object({
|
|
|
26606
26732
|
});
|
|
26607
26733
|
method(object({
|
|
26608
26734
|
deviceId: number(),
|
|
26609
|
-
|
|
26735
|
+
/** @deprecated Prefer `profiles`. Kept so timelapse/notifiers keep working. */
|
|
26736
|
+
profile: string$2().optional(),
|
|
26737
|
+
profiles: array(string$2()).min(1).optional(),
|
|
26610
26738
|
fromMs: number(),
|
|
26611
26739
|
toMs: number(),
|
|
26612
26740
|
options: ExportOptionsSchema
|
|
26741
|
+
}).superRefine((v, ctx) => {
|
|
26742
|
+
if ((v.profiles !== void 0 && v.profiles.length > 0 ? v.profiles : v.profile !== void 0 ? [v.profile] : []).length < 1) ctx.addIssue({
|
|
26743
|
+
code: ZodIssueCode.custom,
|
|
26744
|
+
message: "pass profiles[] (min 1) or legacy profile",
|
|
26745
|
+
path: ["profiles"]
|
|
26746
|
+
});
|
|
26613
26747
|
}), ExportRecordSchema, {
|
|
26614
26748
|
kind: "mutation",
|
|
26615
26749
|
auth: "protected"
|
|
@@ -29551,15 +29685,6 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
29551
29685
|
labels: ["probe not implemented"]
|
|
29552
29686
|
};
|
|
29553
29687
|
}
|
|
29554
|
-
/**
|
|
29555
|
-
* Top-level devices restored at once in {@link onRestoreDevices}.
|
|
29556
|
-
*
|
|
29557
|
-
* Four covers the fleets this ships to without turning a boot into a burst a
|
|
29558
|
-
* camera NVR answers with a refusal. A provider whose upstream is a single
|
|
29559
|
-
* session with a serial command channel (a Baichuan hub, an NVR that
|
|
29560
|
-
* serialises ISAPI) should lower it; nothing needs to raise it.
|
|
29561
|
-
*/
|
|
29562
|
-
restoreConcurrency = 4;
|
|
29563
29688
|
async restoreDevices(savedDevices) {
|
|
29564
29689
|
await this.onRestoreDevices(savedDevices);
|
|
29565
29690
|
if (savedDevices.length > 0) this.ctx.logger.info(`Restored ${savedDevices.length} ${this.providerName} device(s)`);
|
|
@@ -29614,14 +29739,7 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
29614
29739
|
});
|
|
29615
29740
|
}
|
|
29616
29741
|
};
|
|
29617
|
-
|
|
29618
|
-
await Promise.all(Array.from({ length: Math.min(Math.max(1, this.restoreConcurrency), topLevel.length) }, async () => {
|
|
29619
|
-
for (;;) {
|
|
29620
|
-
const saved = topLevel[nextTopLevel++];
|
|
29621
|
-
if (saved === void 0) return;
|
|
29622
|
-
await restoreOne(saved);
|
|
29623
|
-
}
|
|
29624
|
-
}));
|
|
29742
|
+
await Promise.all(topLevel.map((saved) => restoreOne(saved)));
|
|
29625
29743
|
const childRows = savedDevices.filter((s) => s.parentDeviceId !== null);
|
|
29626
29744
|
for (const saved of childRows) {
|
|
29627
29745
|
const Class = this.deviceClasses[saved.type];
|
|
@@ -32894,6 +33012,12 @@ Object.freeze({
|
|
|
32894
33012
|
addonId: null,
|
|
32895
33013
|
access: "create"
|
|
32896
33014
|
},
|
|
33015
|
+
"pipelineAnalytics.reconcileFromDisk": {
|
|
33016
|
+
capName: "pipeline-analytics",
|
|
33017
|
+
capScope: "device",
|
|
33018
|
+
addonId: null,
|
|
33019
|
+
access: "create"
|
|
33020
|
+
},
|
|
32897
33021
|
"pipelineAnalytics.refreshStorageLocationsForMigration": {
|
|
32898
33022
|
capName: "pipeline-analytics",
|
|
32899
33023
|
capScope: "device",
|
|
@@ -33296,6 +33420,12 @@ Object.freeze({
|
|
|
33296
33420
|
addonId: null,
|
|
33297
33421
|
access: "view"
|
|
33298
33422
|
},
|
|
33423
|
+
"pipelineOrchestrator.getReconcileFromDiskStatus": {
|
|
33424
|
+
capName: "pipeline-orchestrator",
|
|
33425
|
+
capScope: "system",
|
|
33426
|
+
addonId: null,
|
|
33427
|
+
access: "view"
|
|
33428
|
+
},
|
|
33299
33429
|
"pipelineOrchestrator.listAgentSettings": {
|
|
33300
33430
|
capName: "pipeline-orchestrator",
|
|
33301
33431
|
capScope: "system",
|
|
@@ -33320,6 +33450,12 @@ Object.freeze({
|
|
|
33320
33450
|
addonId: null,
|
|
33321
33451
|
access: "create"
|
|
33322
33452
|
},
|
|
33453
|
+
"pipelineOrchestrator.reconcileFromDisk": {
|
|
33454
|
+
capName: "pipeline-orchestrator",
|
|
33455
|
+
capScope: "system",
|
|
33456
|
+
addonId: null,
|
|
33457
|
+
access: "create"
|
|
33458
|
+
},
|
|
33323
33459
|
"pipelineOrchestrator.removeAgentSettings": {
|
|
33324
33460
|
capName: "pipeline-orchestrator",
|
|
33325
33461
|
capScope: "system",
|
|
@@ -36311,6 +36447,11 @@ Object.freeze({
|
|
|
36311
36447
|
form: "single",
|
|
36312
36448
|
optional: true
|
|
36313
36449
|
}],
|
|
36450
|
+
"pipelineAnalytics.reconcileFromDisk": [{
|
|
36451
|
+
name: "deviceId",
|
|
36452
|
+
form: "single",
|
|
36453
|
+
optional: false
|
|
36454
|
+
}],
|
|
36314
36455
|
"pipelineAnalytics.restageRetrainTrack": [{
|
|
36315
36456
|
name: "deviceId",
|
|
36316
36457
|
form: "single",
|
|
@@ -37376,6 +37517,8 @@ DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
|
|
|
37376
37517
|
DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
|
|
37377
37518
|
DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
|
|
37378
37519
|
DEFAULT_NATIVE_LEASE_SETTINGS.admission;
|
|
37520
|
+
var MB = 1024 * 1024;
|
|
37521
|
+
1024 * MB, 3072 * MB;
|
|
37379
37522
|
//#endregion
|
|
37380
37523
|
//#region ../../node_modules/@matter/general/dist/esm/net/tcp/TcpConnection.js
|
|
37381
37524
|
/**
|
package/dist/addon.mjs
CHANGED
|
@@ -11,7 +11,7 @@ import { networkInterfaces, tmpdir, uptime } from "node:os";
|
|
|
11
11
|
import { finished } from "node:stream/promises";
|
|
12
12
|
import { createConnection, createServer as createServer$2 } from "node:net";
|
|
13
13
|
import * as dgram from "node:dgram";
|
|
14
|
-
//#region ../types/dist/event-category-
|
|
14
|
+
//#region ../types/dist/event-category-XfKNtfCc.mjs
|
|
15
15
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
16
16
|
EventCategory["SystemBoot"] = "system.boot";
|
|
17
17
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -28,9 +28,10 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
28
28
|
EventCategory["SystemRestartCompleted"] = "system.restart-completed";
|
|
29
29
|
/**
|
|
30
30
|
* A newer addon or server-root package version was found by the
|
|
31
|
-
* authoritative registry check. Emitted once
|
|
32
|
-
* `(
|
|
33
|
-
*
|
|
31
|
+
* authoritative registry check. Emitted once when any observed
|
|
32
|
+
* `latestVersion` changes (or a package/node first appears behind);
|
|
33
|
+
* the payload carries the full currently-available list. Repeated
|
|
34
|
+
* polling of the same latests is silent.
|
|
34
35
|
*/
|
|
35
36
|
EventCategory["UpdateAvailable"] = "update.available";
|
|
36
37
|
/**
|
|
@@ -49,6 +50,22 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
49
50
|
EventCategory["AddonInstalled"] = "addon.installed";
|
|
50
51
|
EventCategory["AddonUninstalled"] = "addon.uninstalled";
|
|
51
52
|
EventCategory["AddonCrashed"] = "addon.crashed";
|
|
53
|
+
/**
|
|
54
|
+
* A RUNNER the D6 crash circuit-breaker gave up on — terminal.
|
|
55
|
+
*
|
|
56
|
+
* `AddonCrashed` is the routine, self-healing fact ("it crashed; it is being
|
|
57
|
+
* respawned"); this is the one that never resolves itself. Emitted exactly
|
|
58
|
+
* once per trip, by `process-service.ts`, carrying the node, the runner, the
|
|
59
|
+
* addons it hosted and the crash count that tripped the breaker.
|
|
60
|
+
*
|
|
61
|
+
* It exists because a runner marked terminally `failed` used to be SILENT:
|
|
62
|
+
* on 2026-08-18 the `recorder` runner died of three unhandled ffmpeg spawn
|
|
63
|
+
* errors, the breaker stopped respawning it (correctly), `/health` kept
|
|
64
|
+
* returning 200, and fleet-wide recording was gone for 3h15 before the
|
|
65
|
+
* operator's phone told him. The Notification Center's system-event intake
|
|
66
|
+
* consumes this category and maps it to the `addon-crash-loop` kind.
|
|
67
|
+
*/
|
|
68
|
+
EventCategory["AddonRunnerFailed"] = "addon.runner-failed";
|
|
52
69
|
EventCategory["AddonError"] = "addon.error";
|
|
53
70
|
EventCategory["AddonPageReady"] = "addon.page-ready";
|
|
54
71
|
EventCategory["AddonWidgetReady"] = "addon.widget-ready";
|
|
@@ -7560,6 +7577,10 @@ var RecordingBandSchema = object({
|
|
|
7560
7577
|
preBufferSec: number().min(0).optional(),
|
|
7561
7578
|
postBufferSec: number().min(0).optional()
|
|
7562
7579
|
});
|
|
7580
|
+
({
|
|
7581
|
+
preBufferSec: 10,
|
|
7582
|
+
postBufferSec: 30
|
|
7583
|
+
}).postBufferSec * 1e3;
|
|
7563
7584
|
/**
|
|
7564
7585
|
* Per-device retention overrides. Every field is optional; an unset or `0`
|
|
7565
7586
|
* value inherits the node-wide recorder default. Only footage-lifetime limits
|
|
@@ -7607,6 +7628,12 @@ var RecordingConfigSchema = object({
|
|
|
7607
7628
|
/** DERIVED summary of `bands`, stamped by the recorder on every save.
|
|
7608
7629
|
* Authoring it has no effect — see {@link RecordingStorageModeSchema}. */
|
|
7609
7630
|
mode: RecordingStorageModeSchema.optional(),
|
|
7631
|
+
/**
|
|
7632
|
+
* Which assigned broker slots to record. Absent / empty = {@link
|
|
7633
|
+
* DEFAULT_RECORDING_PROFILES} (`high`+`low`) intersected with the
|
|
7634
|
+
* camera's currently assigned slots — never `mid` unless the operator
|
|
7635
|
+
* picks it, and never a slot the broker has not assigned.
|
|
7636
|
+
*/
|
|
7610
7637
|
profiles: array(CamProfileSchema).optional(),
|
|
7611
7638
|
segmentSeconds: number().int().positive().optional(),
|
|
7612
7639
|
/**
|
|
@@ -7687,7 +7714,11 @@ var RelocateFootageInputSchema = object({
|
|
|
7687
7714
|
profiles: array(string$2()).optional(),
|
|
7688
7715
|
/** Copy throttle in MB/s (default 40) — the drain is a background chore,
|
|
7689
7716
|
* never allowed to starve live writers. */
|
|
7690
|
-
throttleMbps: number().min(1).max(1e3).optional()
|
|
7717
|
+
throttleMbps: number().min(1).max(1e3).optional(),
|
|
7718
|
+
/** Move only segments whose startMs is >= this. Absent = the whole source
|
|
7719
|
+
* pile. Used when a full drain is too expensive and the operator only
|
|
7720
|
+
* wants the recent window on the new disk. */
|
|
7721
|
+
sinceMs: number().int().optional()
|
|
7691
7722
|
});
|
|
7692
7723
|
/** Internal, lease-scoped participant operation. It is intentionally separate
|
|
7693
7724
|
* from persistent recording settings: a migration never changes
|
|
@@ -14618,6 +14649,7 @@ var NcSystemEventKindSchema = _enum([
|
|
|
14618
14649
|
"node-offline",
|
|
14619
14650
|
"node-inference-unavailable",
|
|
14620
14651
|
"detection-blind",
|
|
14652
|
+
"addon-crash-loop",
|
|
14621
14653
|
"addon-update-available",
|
|
14622
14654
|
"server-update-available",
|
|
14623
14655
|
"alarm-triggered",
|
|
@@ -14625,6 +14657,9 @@ var NcSystemEventKindSchema = _enum([
|
|
|
14625
14657
|
"alarm-disarmed",
|
|
14626
14658
|
"alarm-arming",
|
|
14627
14659
|
"alarm-arm-refused",
|
|
14660
|
+
"addon-updated",
|
|
14661
|
+
"server-updated",
|
|
14662
|
+
"export-completed",
|
|
14628
14663
|
"camera-online",
|
|
14629
14664
|
"camera-offline",
|
|
14630
14665
|
"camera-disabled",
|
|
@@ -16518,13 +16553,19 @@ var RetrainStatusSchema = _enum([
|
|
|
16518
16553
|
* "never marked" from "already trained" must read `retrainStatus`.
|
|
16519
16554
|
*
|
|
16520
16555
|
* `debug` does NOT pin; it is attention, not durability.
|
|
16556
|
+
*
|
|
16557
|
+
* `favourited` IS a BOOLEAN pin (durability bit), not a retrain lifecycle.
|
|
16558
|
+
* A favourited track is skipped by retention the same way `staging` is, but
|
|
16559
|
+
* it does not enter `none|staging|trained` and has no staging budget.
|
|
16521
16560
|
*/
|
|
16522
16561
|
var TrackFlagFields = {
|
|
16523
16562
|
/** Operator marked this track as training material — i.e. `retrainStatus` is
|
|
16524
16563
|
* `'staging'`. */
|
|
16525
16564
|
markForTrain: boolean().optional(),
|
|
16526
16565
|
/** Operator marked this track for diagnostic attention. */
|
|
16527
|
-
debug: boolean().optional()
|
|
16566
|
+
debug: boolean().optional(),
|
|
16567
|
+
/** Operator favourited this track. Pins it against pruning. */
|
|
16568
|
+
favourited: boolean().optional()
|
|
16528
16569
|
};
|
|
16529
16570
|
/**
|
|
16530
16571
|
* The lifecycle field itself, on the READ surfaces only (`Track`, `KeyEvent`).
|
|
@@ -16549,6 +16590,7 @@ var TrackFlagsSchema = object({
|
|
|
16549
16590
|
trackId: string$2(),
|
|
16550
16591
|
markForTrain: boolean(),
|
|
16551
16592
|
debug: boolean(),
|
|
16593
|
+
favourited: boolean(),
|
|
16552
16594
|
/** The lifecycle state the boolean was derived from. Required here (unlike on
|
|
16553
16595
|
* a track row) because this shape is only ever produced by the write body,
|
|
16554
16596
|
* which always knows it — and a surface that has just written needs to render
|
|
@@ -17181,6 +17223,12 @@ var TrackCascadeCountsSchema = object({
|
|
|
17181
17223
|
/** Per-track CLIP search vectors removed (best-effort). */
|
|
17182
17224
|
embeddings: number().int()
|
|
17183
17225
|
});
|
|
17226
|
+
/** Disk-wins reconcile: media rows whose blobs are gone, then empty tracks. */
|
|
17227
|
+
var DiskReconcileCountsSchema = object({
|
|
17228
|
+
mediaDropped: number().int(),
|
|
17229
|
+
tracks: number().int(),
|
|
17230
|
+
events: number().int()
|
|
17231
|
+
});
|
|
17184
17232
|
/** Event-store footprint for one camera. */
|
|
17185
17233
|
var EventStoreDeviceFootprintSchema = object({
|
|
17186
17234
|
deviceId: number(),
|
|
@@ -17357,6 +17405,9 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
17357
17405
|
}), method(object({ deviceId: number() }), TrackCascadeCountsSchema, {
|
|
17358
17406
|
kind: "mutation",
|
|
17359
17407
|
auth: "admin"
|
|
17408
|
+
}), method(object({ deviceId: number() }), DiskReconcileCountsSchema, {
|
|
17409
|
+
kind: "mutation",
|
|
17410
|
+
auth: "admin"
|
|
17360
17411
|
}), method(object({
|
|
17361
17412
|
deviceId: number(),
|
|
17362
17413
|
trackIds: array(string$2()).min(1)
|
|
@@ -18907,6 +18958,24 @@ var CameraStatusDegradationSchema = object({
|
|
|
18907
18958
|
*
|
|
18908
18959
|
* See spec: `docs/superpowers/specs/2026-06-24-camera-status-aggregator-cap.md`
|
|
18909
18960
|
*/
|
|
18961
|
+
var DiskReconcileJobSchema = object({
|
|
18962
|
+
state: _enum([
|
|
18963
|
+
"idle",
|
|
18964
|
+
"running",
|
|
18965
|
+
"done",
|
|
18966
|
+
"error"
|
|
18967
|
+
]),
|
|
18968
|
+
total: number().int().nonnegative(),
|
|
18969
|
+
completed: number().int().nonnegative(),
|
|
18970
|
+
currentDeviceId: number().int().nullable(),
|
|
18971
|
+
failed: array(number().int()).readonly(),
|
|
18972
|
+
mediaDropped: number().int().nonnegative(),
|
|
18973
|
+
tracks: number().int().nonnegative(),
|
|
18974
|
+
events: number().int().nonnegative(),
|
|
18975
|
+
startedAtMs: number().int().nullable(),
|
|
18976
|
+
finishedAtMs: number().int().nullable(),
|
|
18977
|
+
error: string$2().nullable()
|
|
18978
|
+
});
|
|
18910
18979
|
var CameraStatusSchema = object({
|
|
18911
18980
|
deviceId: number(),
|
|
18912
18981
|
assignment: CameraAssignmentStatusSchema,
|
|
@@ -19138,7 +19207,10 @@ method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
|
|
|
19138
19207
|
}), CameraSwitchGroupSchema, {
|
|
19139
19208
|
kind: "mutation",
|
|
19140
19209
|
auth: "admin"
|
|
19141
|
-
}), method(object({ deviceId: number() }), CameraStatusSchema), method(object({ deviceIds: array(number()).optional() }), array(CameraStatusSchema).readonly()), method(_void(),
|
|
19210
|
+
}), method(object({ deviceId: number() }), CameraStatusSchema), method(object({ deviceIds: array(number()).optional() }), array(CameraStatusSchema).readonly()), method(_void(), DiskReconcileJobSchema, {
|
|
19211
|
+
kind: "mutation",
|
|
19212
|
+
auth: "admin"
|
|
19213
|
+
}), method(_void(), DiskReconcileJobSchema, { auth: "admin" }), method(_void(), array(PipelineTemplateSchema).readonly()), method(object({
|
|
19142
19214
|
name: string$2(),
|
|
19143
19215
|
description: string$2().optional(),
|
|
19144
19216
|
config: CameraPipelineConfigSchema
|
|
@@ -20211,20 +20283,6 @@ var VectorStatsResultSchema = object({
|
|
|
20211
20283
|
exact: boolean()
|
|
20212
20284
|
});
|
|
20213
20285
|
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);
|
|
20214
|
-
/**
|
|
20215
|
-
* `videoclips` — the unified, navigable-clip surface for a camera.
|
|
20216
|
-
*
|
|
20217
|
-
* A device-scoped WRAPPER cap (like `pipeline-analytics`): exactly one active
|
|
20218
|
-
* provider per device, substitutable. The DEFAULT provider (registered by
|
|
20219
|
-
* `addon-post-analysis`, `defaultActive: true`) composes the analytics event
|
|
20220
|
-
* log (markers + thumbnails) with the recorder's `getPlaybackManifest` — a clip
|
|
20221
|
-
* is a time-WINDOW over existing footage, never a separate file. A camera that
|
|
20222
|
-
* exposes NATIVE onboard clips (Reolink/Hikvision NVR) can later substitute the
|
|
20223
|
-
* wrapper provider for its device and serve its own clip catalog + URLs.
|
|
20224
|
-
*
|
|
20225
|
-
* A `Clip` is purely time-based (subtree-blind): playback resolves segments by
|
|
20226
|
-
* temporal overlap, so the API never decides `continuous` vs `events`.
|
|
20227
|
-
*/
|
|
20228
20286
|
var ClipSchema = object({
|
|
20229
20287
|
/** Opaque, provider-namespaced id. The default provider encodes the time
|
|
20230
20288
|
* window so `getClipPlayback` is self-contained (no event re-query). */
|
|
@@ -20241,8 +20299,65 @@ var ClipSchema = object({
|
|
|
20241
20299
|
startMs: number(),
|
|
20242
20300
|
endMs: number()
|
|
20243
20301
|
}),
|
|
20244
|
-
/**
|
|
20245
|
-
|
|
20302
|
+
/**
|
|
20303
|
+
* Distinct object classes attached to this visit (`person`, `car`, …),
|
|
20304
|
+
* dominant first, capped at {@link MAX_CLIP_LABELS}. The ribbon renders these
|
|
20305
|
+
* instead of the bare kind — "Object" tells the operator nothing a colour bar
|
|
20306
|
+
* did not. Absent (never empty) when the visit attached no classified object
|
|
20307
|
+
* event, so a motion/audio-only visit keeps its kind label.
|
|
20308
|
+
*/
|
|
20309
|
+
labels: array(string$2()).max(3).optional(),
|
|
20310
|
+
/**
|
|
20311
|
+
* Lazy thumbnail URL, never inlined.
|
|
20312
|
+
*
|
|
20313
|
+
* Recording-derived clips (events-mode keep-window, and the prepared
|
|
20314
|
+
* continuous event+fragment visit) MUST use the snapshot of the **main
|
|
20315
|
+
* event of the interval** — `getEventMedia({ eventId, kind: 'snapshot' })`
|
|
20316
|
+
* of the event that owns `kind` (object > motion > audio). Do not extract
|
|
20317
|
+
* a keyframe from the recorded segments. Other providers (onboard, HKSV)
|
|
20318
|
+
* mint their own stills.
|
|
20319
|
+
*
|
|
20320
|
+
* **VOUCHED, never fabricated.** A provider emits this only for an event it
|
|
20321
|
+
* has CONFIRMED owns at least one media row (its own, or its owning track's).
|
|
20322
|
+
* Absent is meaningful — "this visit has no event still" — never "we did not
|
|
20323
|
+
* look". Stamping it from a URL template made 35% of one camera's clips point
|
|
20324
|
+
* at a 404 (device 3836, 2026-08-17: 64 of 179 clips dead, 63 of them motion).
|
|
20325
|
+
* A read that FAILS drops the claim; it never invents it.
|
|
20326
|
+
*/
|
|
20327
|
+
thumbnail: string$2().optional(),
|
|
20328
|
+
/**
|
|
20329
|
+
* An instant INSIDE this visit's footage, hole-safe, where a recorded still
|
|
20330
|
+
* can be decoded. Present whenever the visit came from recorded availability;
|
|
20331
|
+
* absent on a per-event padded window (there is no footage to promise).
|
|
20332
|
+
*
|
|
20333
|
+
* This is not a thumbnail and not a second byte path: it is the argument to
|
|
20334
|
+
* the recorder's existing still route. The surface — never the provider —
|
|
20335
|
+
* decides whether to use it. It is the midpoint of the visit's LONGEST
|
|
20336
|
+
* contiguous range, not of the visit: a visit spans its holes by
|
|
20337
|
+
* construction, so a naive midpoint lands in dead air.
|
|
20338
|
+
*/
|
|
20339
|
+
stillAtMs: number().optional(),
|
|
20340
|
+
/**
|
|
20341
|
+
* Analytics event ids that overlap this visit — a BOUNDED sample, newest
|
|
20342
|
+
* first within kind (object → motion → audio), capped at
|
|
20343
|
+
* {@link MAX_CLIP_EVENT_IDS}. Empty on footage-only clips.
|
|
20344
|
+
*
|
|
20345
|
+
* Bounded because it is not a payload the surface pages through: one visit on
|
|
20346
|
+
* device 615 carried 2 345 ids, and `eventIds` was 99% of a 153 KB
|
|
20347
|
+
* camera-day. Read {@link eventCount} for the true total.
|
|
20348
|
+
*/
|
|
20349
|
+
eventIds: array(string$2()).optional(),
|
|
20350
|
+
/** How many analytics events actually overlap this visit. Differs from
|
|
20351
|
+
* `eventIds.length` exactly when the sample was capped — so a truncated
|
|
20352
|
+
* list is never mistaken for a quiet visit. */
|
|
20353
|
+
eventCount: number().int().nonnegative().optional(),
|
|
20354
|
+
/** Intra-visit footage holes (GOP rolls, discarded segments) still shorter
|
|
20355
|
+
* than `VISIT_MERGE_GAP_MS`. Playback concatenates around them; the timeline
|
|
20356
|
+
* bar keeps showing them via `recording.getAvailability`. */
|
|
20357
|
+
holes: array(object({
|
|
20358
|
+
startMs: number(),
|
|
20359
|
+
endMs: number()
|
|
20360
|
+
})).optional()
|
|
20246
20361
|
});
|
|
20247
20362
|
var ClipPlaybackSchema = object({
|
|
20248
20363
|
/** HLS master URL through the hub data-plane (Range + token in path). */
|
|
@@ -20706,7 +20821,14 @@ var SearchResultSchema = object({
|
|
|
20706
20821
|
});
|
|
20707
20822
|
var AutoUpdateSettingsSchema = object({
|
|
20708
20823
|
channel: ChannelSchema,
|
|
20709
|
-
intervalSeconds: number()
|
|
20824
|
+
intervalSeconds: number(),
|
|
20825
|
+
/**
|
|
20826
|
+
* Cadence of the "an update exists" POLLER, in seconds. Independent of
|
|
20827
|
+
* `channel`: the poller runs while auto-apply is `off`, because being told
|
|
20828
|
+
* about a publish and installing it are different decisions. Clamped
|
|
20829
|
+
* server-side to 900 s … 604800 s; defaults to 21600 s (6 h).
|
|
20830
|
+
*/
|
|
20831
|
+
updateCheckIntervalSeconds: number()
|
|
20710
20832
|
});
|
|
20711
20833
|
var AddonAutoUpdateSchema = ChannelWithInheritSchema;
|
|
20712
20834
|
var RestartAddonResultSchema = unknown();
|
|
@@ -20847,7 +20969,9 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
|
|
|
20847
20969
|
auth: "admin"
|
|
20848
20970
|
}), method(_void(), AutoUpdateSettingsSchema, { auth: "admin" }), method(object({
|
|
20849
20971
|
channel: ChannelSchema,
|
|
20850
|
-
intervalSeconds: number().min(300).max(86400).optional()
|
|
20972
|
+
intervalSeconds: number().min(300).max(86400).optional(),
|
|
20973
|
+
/** Availability-poll cadence; see AutoUpdateSettingsSchema. */
|
|
20974
|
+
updateCheckIntervalSeconds: number().min(900).max(604800).optional()
|
|
20851
20975
|
}), unknown(), {
|
|
20852
20976
|
kind: "mutation",
|
|
20853
20977
|
auth: "admin"
|
|
@@ -26545,7 +26669,9 @@ var ExportOptionsSchema = object({
|
|
|
26545
26669
|
includeAudio: boolean(),
|
|
26546
26670
|
maxLifeMs: number().int().positive(),
|
|
26547
26671
|
deleteAfterDownload: boolean(),
|
|
26548
|
-
title: string$2().max(200).optional()
|
|
26672
|
+
title: string$2().max(200).optional(),
|
|
26673
|
+
/** Notification-output target ids to ping when this export becomes ready. */
|
|
26674
|
+
notifyTargetIds: array(string$2().min(1)).max(20).optional()
|
|
26549
26675
|
}).superRefine((v, ctx) => {
|
|
26550
26676
|
if (v.speed !== void 0 && v.timelapse !== void 0) ctx.addIssue({
|
|
26551
26677
|
code: ZodIssueCode.custom,
|
|
@@ -26604,10 +26730,18 @@ var ExportBytesSchema = object({
|
|
|
26604
26730
|
});
|
|
26605
26731
|
method(object({
|
|
26606
26732
|
deviceId: number(),
|
|
26607
|
-
|
|
26733
|
+
/** @deprecated Prefer `profiles`. Kept so timelapse/notifiers keep working. */
|
|
26734
|
+
profile: string$2().optional(),
|
|
26735
|
+
profiles: array(string$2()).min(1).optional(),
|
|
26608
26736
|
fromMs: number(),
|
|
26609
26737
|
toMs: number(),
|
|
26610
26738
|
options: ExportOptionsSchema
|
|
26739
|
+
}).superRefine((v, ctx) => {
|
|
26740
|
+
if ((v.profiles !== void 0 && v.profiles.length > 0 ? v.profiles : v.profile !== void 0 ? [v.profile] : []).length < 1) ctx.addIssue({
|
|
26741
|
+
code: ZodIssueCode.custom,
|
|
26742
|
+
message: "pass profiles[] (min 1) or legacy profile",
|
|
26743
|
+
path: ["profiles"]
|
|
26744
|
+
});
|
|
26611
26745
|
}), ExportRecordSchema, {
|
|
26612
26746
|
kind: "mutation",
|
|
26613
26747
|
auth: "protected"
|
|
@@ -29549,15 +29683,6 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
29549
29683
|
labels: ["probe not implemented"]
|
|
29550
29684
|
};
|
|
29551
29685
|
}
|
|
29552
|
-
/**
|
|
29553
|
-
* Top-level devices restored at once in {@link onRestoreDevices}.
|
|
29554
|
-
*
|
|
29555
|
-
* Four covers the fleets this ships to without turning a boot into a burst a
|
|
29556
|
-
* camera NVR answers with a refusal. A provider whose upstream is a single
|
|
29557
|
-
* session with a serial command channel (a Baichuan hub, an NVR that
|
|
29558
|
-
* serialises ISAPI) should lower it; nothing needs to raise it.
|
|
29559
|
-
*/
|
|
29560
|
-
restoreConcurrency = 4;
|
|
29561
29686
|
async restoreDevices(savedDevices) {
|
|
29562
29687
|
await this.onRestoreDevices(savedDevices);
|
|
29563
29688
|
if (savedDevices.length > 0) this.ctx.logger.info(`Restored ${savedDevices.length} ${this.providerName} device(s)`);
|
|
@@ -29612,14 +29737,7 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
29612
29737
|
});
|
|
29613
29738
|
}
|
|
29614
29739
|
};
|
|
29615
|
-
|
|
29616
|
-
await Promise.all(Array.from({ length: Math.min(Math.max(1, this.restoreConcurrency), topLevel.length) }, async () => {
|
|
29617
|
-
for (;;) {
|
|
29618
|
-
const saved = topLevel[nextTopLevel++];
|
|
29619
|
-
if (saved === void 0) return;
|
|
29620
|
-
await restoreOne(saved);
|
|
29621
|
-
}
|
|
29622
|
-
}));
|
|
29740
|
+
await Promise.all(topLevel.map((saved) => restoreOne(saved)));
|
|
29623
29741
|
const childRows = savedDevices.filter((s) => s.parentDeviceId !== null);
|
|
29624
29742
|
for (const saved of childRows) {
|
|
29625
29743
|
const Class = this.deviceClasses[saved.type];
|
|
@@ -32892,6 +33010,12 @@ Object.freeze({
|
|
|
32892
33010
|
addonId: null,
|
|
32893
33011
|
access: "create"
|
|
32894
33012
|
},
|
|
33013
|
+
"pipelineAnalytics.reconcileFromDisk": {
|
|
33014
|
+
capName: "pipeline-analytics",
|
|
33015
|
+
capScope: "device",
|
|
33016
|
+
addonId: null,
|
|
33017
|
+
access: "create"
|
|
33018
|
+
},
|
|
32895
33019
|
"pipelineAnalytics.refreshStorageLocationsForMigration": {
|
|
32896
33020
|
capName: "pipeline-analytics",
|
|
32897
33021
|
capScope: "device",
|
|
@@ -33294,6 +33418,12 @@ Object.freeze({
|
|
|
33294
33418
|
addonId: null,
|
|
33295
33419
|
access: "view"
|
|
33296
33420
|
},
|
|
33421
|
+
"pipelineOrchestrator.getReconcileFromDiskStatus": {
|
|
33422
|
+
capName: "pipeline-orchestrator",
|
|
33423
|
+
capScope: "system",
|
|
33424
|
+
addonId: null,
|
|
33425
|
+
access: "view"
|
|
33426
|
+
},
|
|
33297
33427
|
"pipelineOrchestrator.listAgentSettings": {
|
|
33298
33428
|
capName: "pipeline-orchestrator",
|
|
33299
33429
|
capScope: "system",
|
|
@@ -33318,6 +33448,12 @@ Object.freeze({
|
|
|
33318
33448
|
addonId: null,
|
|
33319
33449
|
access: "create"
|
|
33320
33450
|
},
|
|
33451
|
+
"pipelineOrchestrator.reconcileFromDisk": {
|
|
33452
|
+
capName: "pipeline-orchestrator",
|
|
33453
|
+
capScope: "system",
|
|
33454
|
+
addonId: null,
|
|
33455
|
+
access: "create"
|
|
33456
|
+
},
|
|
33321
33457
|
"pipelineOrchestrator.removeAgentSettings": {
|
|
33322
33458
|
capName: "pipeline-orchestrator",
|
|
33323
33459
|
capScope: "system",
|
|
@@ -36309,6 +36445,11 @@ Object.freeze({
|
|
|
36309
36445
|
form: "single",
|
|
36310
36446
|
optional: true
|
|
36311
36447
|
}],
|
|
36448
|
+
"pipelineAnalytics.reconcileFromDisk": [{
|
|
36449
|
+
name: "deviceId",
|
|
36450
|
+
form: "single",
|
|
36451
|
+
optional: false
|
|
36452
|
+
}],
|
|
36312
36453
|
"pipelineAnalytics.restageRetrainTrack": [{
|
|
36313
36454
|
name: "deviceId",
|
|
36314
36455
|
form: "single",
|
|
@@ -37374,6 +37515,8 @@ DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
|
|
|
37374
37515
|
DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
|
|
37375
37516
|
DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
|
|
37376
37517
|
DEFAULT_NATIVE_LEASE_SETTINGS.admission;
|
|
37518
|
+
var MB = 1024 * 1024;
|
|
37519
|
+
1024 * MB, 3072 * MB;
|
|
37377
37520
|
//#endregion
|
|
37378
37521
|
//#region ../../node_modules/@matter/general/dist/esm/net/tcp/TcpConnection.js
|
|
37379
37522
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/addon-matter-broker",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.21",
|
|
4
4
|
"description": "Matter broker addon for CamStack — owns a Matter fabric (commissioning + the long-lived controller) via the matter.js controller and brokers commissioned Matter nodes into CamStack",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|