@camstack/addon-matter-broker 0.2.18 → 0.2.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/addon.js +187 -45
- package/dist/addon.mjs +187 -45
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -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
|
|
@@ -19545,7 +19617,14 @@ targets: array(object({
|
|
|
19545
19617
|
"sleeping",
|
|
19546
19618
|
"unreachable",
|
|
19547
19619
|
"waking"
|
|
19548
|
-
]).nullable()
|
|
19620
|
+
]).nullable(),
|
|
19621
|
+
/** A battery camera (whatever its current state). An AWAKE battery
|
|
19622
|
+
* camera is deliberately NOT recaptured on the poll cadence — every
|
|
19623
|
+
* capture is a camera hit that would keep it out of sleep — so its
|
|
19624
|
+
* cached frame legitimately ages past the currency ceiling while
|
|
19625
|
+
* nothing is streaming. A surface must keep painting it (a fresh
|
|
19626
|
+
* frame is captured at each wake), not blank to "unavailable". */
|
|
19627
|
+
battery: boolean()
|
|
19549
19628
|
})));
|
|
19550
19629
|
/**
|
|
19551
19630
|
* `sso-bridge` — internal hub-only cap that lets SSO-style auth
|
|
@@ -20206,20 +20285,6 @@ var VectorStatsResultSchema = object({
|
|
|
20206
20285
|
exact: boolean()
|
|
20207
20286
|
});
|
|
20208
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);
|
|
20209
|
-
/**
|
|
20210
|
-
* `videoclips` — the unified, navigable-clip surface for a camera.
|
|
20211
|
-
*
|
|
20212
|
-
* A device-scoped WRAPPER cap (like `pipeline-analytics`): exactly one active
|
|
20213
|
-
* provider per device, substitutable. The DEFAULT provider (registered by
|
|
20214
|
-
* `addon-post-analysis`, `defaultActive: true`) composes the analytics event
|
|
20215
|
-
* log (markers + thumbnails) with the recorder's `getPlaybackManifest` — a clip
|
|
20216
|
-
* is a time-WINDOW over existing footage, never a separate file. A camera that
|
|
20217
|
-
* exposes NATIVE onboard clips (Reolink/Hikvision NVR) can later substitute the
|
|
20218
|
-
* wrapper provider for its device and serve its own clip catalog + URLs.
|
|
20219
|
-
*
|
|
20220
|
-
* A `Clip` is purely time-based (subtree-blind): playback resolves segments by
|
|
20221
|
-
* temporal overlap, so the API never decides `continuous` vs `events`.
|
|
20222
|
-
*/
|
|
20223
20288
|
var ClipSchema = object({
|
|
20224
20289
|
/** Opaque, provider-namespaced id. The default provider encodes the time
|
|
20225
20290
|
* window so `getClipPlayback` is self-contained (no event re-query). */
|
|
@@ -20236,8 +20301,57 @@ var ClipSchema = object({
|
|
|
20236
20301
|
startMs: number(),
|
|
20237
20302
|
endMs: number()
|
|
20238
20303
|
}),
|
|
20239
|
-
/**
|
|
20240
|
-
thumbnail
|
|
20304
|
+
/**
|
|
20305
|
+
* Lazy thumbnail URL, never inlined.
|
|
20306
|
+
*
|
|
20307
|
+
* Recording-derived clips (events-mode keep-window, and the prepared
|
|
20308
|
+
* continuous event+fragment visit) MUST use the snapshot of the **main
|
|
20309
|
+
* event of the interval** — `getEventMedia({ eventId, kind: 'snapshot' })`
|
|
20310
|
+
* of the event that owns `kind` (object > motion > audio). Do not extract
|
|
20311
|
+
* a keyframe from the recorded segments. Other providers (onboard, HKSV)
|
|
20312
|
+
* mint their own stills.
|
|
20313
|
+
*
|
|
20314
|
+
* **VOUCHED, never fabricated.** A provider emits this only for an event it
|
|
20315
|
+
* has CONFIRMED owns at least one media row (its own, or its owning track's).
|
|
20316
|
+
* Absent is meaningful — "this visit has no event still" — never "we did not
|
|
20317
|
+
* look". Stamping it from a URL template made 35% of one camera's clips point
|
|
20318
|
+
* at a 404 (device 3836, 2026-08-17: 64 of 179 clips dead, 63 of them motion).
|
|
20319
|
+
* A read that FAILS drops the claim; it never invents it.
|
|
20320
|
+
*/
|
|
20321
|
+
thumbnail: string$2().optional(),
|
|
20322
|
+
/**
|
|
20323
|
+
* An instant INSIDE this visit's footage, hole-safe, where a recorded still
|
|
20324
|
+
* can be decoded. Present whenever the visit came from recorded availability;
|
|
20325
|
+
* absent on a per-event padded window (there is no footage to promise).
|
|
20326
|
+
*
|
|
20327
|
+
* This is not a thumbnail and not a second byte path: it is the argument to
|
|
20328
|
+
* the recorder's existing still route. The surface — never the provider —
|
|
20329
|
+
* decides whether to use it. It is the midpoint of the visit's LONGEST
|
|
20330
|
+
* contiguous range, not of the visit: a visit spans its holes by
|
|
20331
|
+
* construction, so a naive midpoint lands in dead air.
|
|
20332
|
+
*/
|
|
20333
|
+
stillAtMs: number().optional(),
|
|
20334
|
+
/**
|
|
20335
|
+
* Analytics event ids that overlap this visit — a BOUNDED sample, newest
|
|
20336
|
+
* first within kind (object → motion → audio), capped at
|
|
20337
|
+
* {@link MAX_CLIP_EVENT_IDS}. Empty on footage-only clips.
|
|
20338
|
+
*
|
|
20339
|
+
* Bounded because it is not a payload the surface pages through: one visit on
|
|
20340
|
+
* device 615 carried 2 345 ids, and `eventIds` was 99% of a 153 KB
|
|
20341
|
+
* camera-day. Read {@link eventCount} for the true total.
|
|
20342
|
+
*/
|
|
20343
|
+
eventIds: array(string$2()).optional(),
|
|
20344
|
+
/** How many analytics events actually overlap this visit. Differs from
|
|
20345
|
+
* `eventIds.length` exactly when the sample was capped — so a truncated
|
|
20346
|
+
* list is never mistaken for a quiet visit. */
|
|
20347
|
+
eventCount: number().int().nonnegative().optional(),
|
|
20348
|
+
/** Intra-visit footage holes (GOP rolls, discarded segments) still shorter
|
|
20349
|
+
* than `VISIT_MERGE_GAP_MS`. Playback concatenates around them; the timeline
|
|
20350
|
+
* bar keeps showing them via `recording.getAvailability`. */
|
|
20351
|
+
holes: array(object({
|
|
20352
|
+
startMs: number(),
|
|
20353
|
+
endMs: number()
|
|
20354
|
+
})).optional()
|
|
20241
20355
|
});
|
|
20242
20356
|
var ClipPlaybackSchema = object({
|
|
20243
20357
|
/** HLS master URL through the hub data-plane (Range + token in path). */
|
|
@@ -20701,7 +20815,14 @@ var SearchResultSchema = object({
|
|
|
20701
20815
|
});
|
|
20702
20816
|
var AutoUpdateSettingsSchema = object({
|
|
20703
20817
|
channel: ChannelSchema,
|
|
20704
|
-
intervalSeconds: number()
|
|
20818
|
+
intervalSeconds: number(),
|
|
20819
|
+
/**
|
|
20820
|
+
* Cadence of the "an update exists" POLLER, in seconds. Independent of
|
|
20821
|
+
* `channel`: the poller runs while auto-apply is `off`, because being told
|
|
20822
|
+
* about a publish and installing it are different decisions. Clamped
|
|
20823
|
+
* server-side to 900 s … 604800 s; defaults to 21600 s (6 h).
|
|
20824
|
+
*/
|
|
20825
|
+
updateCheckIntervalSeconds: number()
|
|
20705
20826
|
});
|
|
20706
20827
|
var AddonAutoUpdateSchema = ChannelWithInheritSchema;
|
|
20707
20828
|
var RestartAddonResultSchema = unknown();
|
|
@@ -20842,7 +20963,9 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
|
|
|
20842
20963
|
auth: "admin"
|
|
20843
20964
|
}), method(_void(), AutoUpdateSettingsSchema, { auth: "admin" }), method(object({
|
|
20844
20965
|
channel: ChannelSchema,
|
|
20845
|
-
intervalSeconds: number().min(300).max(86400).optional()
|
|
20966
|
+
intervalSeconds: number().min(300).max(86400).optional(),
|
|
20967
|
+
/** Availability-poll cadence; see AutoUpdateSettingsSchema. */
|
|
20968
|
+
updateCheckIntervalSeconds: number().min(900).max(604800).optional()
|
|
20846
20969
|
}), unknown(), {
|
|
20847
20970
|
kind: "mutation",
|
|
20848
20971
|
auth: "admin"
|
|
@@ -26540,7 +26663,9 @@ var ExportOptionsSchema = object({
|
|
|
26540
26663
|
includeAudio: boolean(),
|
|
26541
26664
|
maxLifeMs: number().int().positive(),
|
|
26542
26665
|
deleteAfterDownload: boolean(),
|
|
26543
|
-
title: string$2().max(200).optional()
|
|
26666
|
+
title: string$2().max(200).optional(),
|
|
26667
|
+
/** Notification-output target ids to ping when this export becomes ready. */
|
|
26668
|
+
notifyTargetIds: array(string$2().min(1)).max(20).optional()
|
|
26544
26669
|
}).superRefine((v, ctx) => {
|
|
26545
26670
|
if (v.speed !== void 0 && v.timelapse !== void 0) ctx.addIssue({
|
|
26546
26671
|
code: ZodIssueCode.custom,
|
|
@@ -26599,10 +26724,18 @@ var ExportBytesSchema = object({
|
|
|
26599
26724
|
});
|
|
26600
26725
|
method(object({
|
|
26601
26726
|
deviceId: number(),
|
|
26602
|
-
|
|
26727
|
+
/** @deprecated Prefer `profiles`. Kept so timelapse/notifiers keep working. */
|
|
26728
|
+
profile: string$2().optional(),
|
|
26729
|
+
profiles: array(string$2()).min(1).optional(),
|
|
26603
26730
|
fromMs: number(),
|
|
26604
26731
|
toMs: number(),
|
|
26605
26732
|
options: ExportOptionsSchema
|
|
26733
|
+
}).superRefine((v, ctx) => {
|
|
26734
|
+
if ((v.profiles !== void 0 && v.profiles.length > 0 ? v.profiles : v.profile !== void 0 ? [v.profile] : []).length < 1) ctx.addIssue({
|
|
26735
|
+
code: ZodIssueCode.custom,
|
|
26736
|
+
message: "pass profiles[] (min 1) or legacy profile",
|
|
26737
|
+
path: ["profiles"]
|
|
26738
|
+
});
|
|
26606
26739
|
}), ExportRecordSchema, {
|
|
26607
26740
|
kind: "mutation",
|
|
26608
26741
|
auth: "protected"
|
|
@@ -29544,15 +29677,6 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
29544
29677
|
labels: ["probe not implemented"]
|
|
29545
29678
|
};
|
|
29546
29679
|
}
|
|
29547
|
-
/**
|
|
29548
|
-
* Top-level devices restored at once in {@link onRestoreDevices}.
|
|
29549
|
-
*
|
|
29550
|
-
* Four covers the fleets this ships to without turning a boot into a burst a
|
|
29551
|
-
* camera NVR answers with a refusal. A provider whose upstream is a single
|
|
29552
|
-
* session with a serial command channel (a Baichuan hub, an NVR that
|
|
29553
|
-
* serialises ISAPI) should lower it; nothing needs to raise it.
|
|
29554
|
-
*/
|
|
29555
|
-
restoreConcurrency = 4;
|
|
29556
29680
|
async restoreDevices(savedDevices) {
|
|
29557
29681
|
await this.onRestoreDevices(savedDevices);
|
|
29558
29682
|
if (savedDevices.length > 0) this.ctx.logger.info(`Restored ${savedDevices.length} ${this.providerName} device(s)`);
|
|
@@ -29607,14 +29731,7 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
29607
29731
|
});
|
|
29608
29732
|
}
|
|
29609
29733
|
};
|
|
29610
|
-
|
|
29611
|
-
await Promise.all(Array.from({ length: Math.min(Math.max(1, this.restoreConcurrency), topLevel.length) }, async () => {
|
|
29612
|
-
for (;;) {
|
|
29613
|
-
const saved = topLevel[nextTopLevel++];
|
|
29614
|
-
if (saved === void 0) return;
|
|
29615
|
-
await restoreOne(saved);
|
|
29616
|
-
}
|
|
29617
|
-
}));
|
|
29734
|
+
await Promise.all(topLevel.map((saved) => restoreOne(saved)));
|
|
29618
29735
|
const childRows = savedDevices.filter((s) => s.parentDeviceId !== null);
|
|
29619
29736
|
for (const saved of childRows) {
|
|
29620
29737
|
const Class = this.deviceClasses[saved.type];
|
|
@@ -32887,6 +33004,12 @@ Object.freeze({
|
|
|
32887
33004
|
addonId: null,
|
|
32888
33005
|
access: "create"
|
|
32889
33006
|
},
|
|
33007
|
+
"pipelineAnalytics.reconcileFromDisk": {
|
|
33008
|
+
capName: "pipeline-analytics",
|
|
33009
|
+
capScope: "device",
|
|
33010
|
+
addonId: null,
|
|
33011
|
+
access: "create"
|
|
33012
|
+
},
|
|
32890
33013
|
"pipelineAnalytics.refreshStorageLocationsForMigration": {
|
|
32891
33014
|
capName: "pipeline-analytics",
|
|
32892
33015
|
capScope: "device",
|
|
@@ -33289,6 +33412,12 @@ Object.freeze({
|
|
|
33289
33412
|
addonId: null,
|
|
33290
33413
|
access: "view"
|
|
33291
33414
|
},
|
|
33415
|
+
"pipelineOrchestrator.getReconcileFromDiskStatus": {
|
|
33416
|
+
capName: "pipeline-orchestrator",
|
|
33417
|
+
capScope: "system",
|
|
33418
|
+
addonId: null,
|
|
33419
|
+
access: "view"
|
|
33420
|
+
},
|
|
33292
33421
|
"pipelineOrchestrator.listAgentSettings": {
|
|
33293
33422
|
capName: "pipeline-orchestrator",
|
|
33294
33423
|
capScope: "system",
|
|
@@ -33313,6 +33442,12 @@ Object.freeze({
|
|
|
33313
33442
|
addonId: null,
|
|
33314
33443
|
access: "create"
|
|
33315
33444
|
},
|
|
33445
|
+
"pipelineOrchestrator.reconcileFromDisk": {
|
|
33446
|
+
capName: "pipeline-orchestrator",
|
|
33447
|
+
capScope: "system",
|
|
33448
|
+
addonId: null,
|
|
33449
|
+
access: "create"
|
|
33450
|
+
},
|
|
33316
33451
|
"pipelineOrchestrator.removeAgentSettings": {
|
|
33317
33452
|
capName: "pipeline-orchestrator",
|
|
33318
33453
|
capScope: "system",
|
|
@@ -36304,6 +36439,11 @@ Object.freeze({
|
|
|
36304
36439
|
form: "single",
|
|
36305
36440
|
optional: true
|
|
36306
36441
|
}],
|
|
36442
|
+
"pipelineAnalytics.reconcileFromDisk": [{
|
|
36443
|
+
name: "deviceId",
|
|
36444
|
+
form: "single",
|
|
36445
|
+
optional: false
|
|
36446
|
+
}],
|
|
36307
36447
|
"pipelineAnalytics.restageRetrainTrack": [{
|
|
36308
36448
|
name: "deviceId",
|
|
36309
36449
|
form: "single",
|
|
@@ -37369,6 +37509,8 @@ DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
|
|
|
37369
37509
|
DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
|
|
37370
37510
|
DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
|
|
37371
37511
|
DEFAULT_NATIVE_LEASE_SETTINGS.admission;
|
|
37512
|
+
var MB = 1024 * 1024;
|
|
37513
|
+
1024 * MB, 3072 * MB;
|
|
37372
37514
|
//#endregion
|
|
37373
37515
|
//#region ../../node_modules/@matter/general/dist/esm/net/tcp/TcpConnection.js
|
|
37374
37516
|
/**
|
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
|
|
@@ -19543,7 +19615,14 @@ targets: array(object({
|
|
|
19543
19615
|
"sleeping",
|
|
19544
19616
|
"unreachable",
|
|
19545
19617
|
"waking"
|
|
19546
|
-
]).nullable()
|
|
19618
|
+
]).nullable(),
|
|
19619
|
+
/** A battery camera (whatever its current state). An AWAKE battery
|
|
19620
|
+
* camera is deliberately NOT recaptured on the poll cadence — every
|
|
19621
|
+
* capture is a camera hit that would keep it out of sleep — so its
|
|
19622
|
+
* cached frame legitimately ages past the currency ceiling while
|
|
19623
|
+
* nothing is streaming. A surface must keep painting it (a fresh
|
|
19624
|
+
* frame is captured at each wake), not blank to "unavailable". */
|
|
19625
|
+
battery: boolean()
|
|
19547
19626
|
})));
|
|
19548
19627
|
/**
|
|
19549
19628
|
* `sso-bridge` — internal hub-only cap that lets SSO-style auth
|
|
@@ -20204,20 +20283,6 @@ var VectorStatsResultSchema = object({
|
|
|
20204
20283
|
exact: boolean()
|
|
20205
20284
|
});
|
|
20206
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);
|
|
20207
|
-
/**
|
|
20208
|
-
* `videoclips` — the unified, navigable-clip surface for a camera.
|
|
20209
|
-
*
|
|
20210
|
-
* A device-scoped WRAPPER cap (like `pipeline-analytics`): exactly one active
|
|
20211
|
-
* provider per device, substitutable. The DEFAULT provider (registered by
|
|
20212
|
-
* `addon-post-analysis`, `defaultActive: true`) composes the analytics event
|
|
20213
|
-
* log (markers + thumbnails) with the recorder's `getPlaybackManifest` — a clip
|
|
20214
|
-
* is a time-WINDOW over existing footage, never a separate file. A camera that
|
|
20215
|
-
* exposes NATIVE onboard clips (Reolink/Hikvision NVR) can later substitute the
|
|
20216
|
-
* wrapper provider for its device and serve its own clip catalog + URLs.
|
|
20217
|
-
*
|
|
20218
|
-
* A `Clip` is purely time-based (subtree-blind): playback resolves segments by
|
|
20219
|
-
* temporal overlap, so the API never decides `continuous` vs `events`.
|
|
20220
|
-
*/
|
|
20221
20286
|
var ClipSchema = object({
|
|
20222
20287
|
/** Opaque, provider-namespaced id. The default provider encodes the time
|
|
20223
20288
|
* window so `getClipPlayback` is self-contained (no event re-query). */
|
|
@@ -20234,8 +20299,57 @@ var ClipSchema = object({
|
|
|
20234
20299
|
startMs: number(),
|
|
20235
20300
|
endMs: number()
|
|
20236
20301
|
}),
|
|
20237
|
-
/**
|
|
20238
|
-
thumbnail
|
|
20302
|
+
/**
|
|
20303
|
+
* Lazy thumbnail URL, never inlined.
|
|
20304
|
+
*
|
|
20305
|
+
* Recording-derived clips (events-mode keep-window, and the prepared
|
|
20306
|
+
* continuous event+fragment visit) MUST use the snapshot of the **main
|
|
20307
|
+
* event of the interval** — `getEventMedia({ eventId, kind: 'snapshot' })`
|
|
20308
|
+
* of the event that owns `kind` (object > motion > audio). Do not extract
|
|
20309
|
+
* a keyframe from the recorded segments. Other providers (onboard, HKSV)
|
|
20310
|
+
* mint their own stills.
|
|
20311
|
+
*
|
|
20312
|
+
* **VOUCHED, never fabricated.** A provider emits this only for an event it
|
|
20313
|
+
* has CONFIRMED owns at least one media row (its own, or its owning track's).
|
|
20314
|
+
* Absent is meaningful — "this visit has no event still" — never "we did not
|
|
20315
|
+
* look". Stamping it from a URL template made 35% of one camera's clips point
|
|
20316
|
+
* at a 404 (device 3836, 2026-08-17: 64 of 179 clips dead, 63 of them motion).
|
|
20317
|
+
* A read that FAILS drops the claim; it never invents it.
|
|
20318
|
+
*/
|
|
20319
|
+
thumbnail: string$2().optional(),
|
|
20320
|
+
/**
|
|
20321
|
+
* An instant INSIDE this visit's footage, hole-safe, where a recorded still
|
|
20322
|
+
* can be decoded. Present whenever the visit came from recorded availability;
|
|
20323
|
+
* absent on a per-event padded window (there is no footage to promise).
|
|
20324
|
+
*
|
|
20325
|
+
* This is not a thumbnail and not a second byte path: it is the argument to
|
|
20326
|
+
* the recorder's existing still route. The surface — never the provider —
|
|
20327
|
+
* decides whether to use it. It is the midpoint of the visit's LONGEST
|
|
20328
|
+
* contiguous range, not of the visit: a visit spans its holes by
|
|
20329
|
+
* construction, so a naive midpoint lands in dead air.
|
|
20330
|
+
*/
|
|
20331
|
+
stillAtMs: number().optional(),
|
|
20332
|
+
/**
|
|
20333
|
+
* Analytics event ids that overlap this visit — a BOUNDED sample, newest
|
|
20334
|
+
* first within kind (object → motion → audio), capped at
|
|
20335
|
+
* {@link MAX_CLIP_EVENT_IDS}. Empty on footage-only clips.
|
|
20336
|
+
*
|
|
20337
|
+
* Bounded because it is not a payload the surface pages through: one visit on
|
|
20338
|
+
* device 615 carried 2 345 ids, and `eventIds` was 99% of a 153 KB
|
|
20339
|
+
* camera-day. Read {@link eventCount} for the true total.
|
|
20340
|
+
*/
|
|
20341
|
+
eventIds: array(string$2()).optional(),
|
|
20342
|
+
/** How many analytics events actually overlap this visit. Differs from
|
|
20343
|
+
* `eventIds.length` exactly when the sample was capped — so a truncated
|
|
20344
|
+
* list is never mistaken for a quiet visit. */
|
|
20345
|
+
eventCount: number().int().nonnegative().optional(),
|
|
20346
|
+
/** Intra-visit footage holes (GOP rolls, discarded segments) still shorter
|
|
20347
|
+
* than `VISIT_MERGE_GAP_MS`. Playback concatenates around them; the timeline
|
|
20348
|
+
* bar keeps showing them via `recording.getAvailability`. */
|
|
20349
|
+
holes: array(object({
|
|
20350
|
+
startMs: number(),
|
|
20351
|
+
endMs: number()
|
|
20352
|
+
})).optional()
|
|
20239
20353
|
});
|
|
20240
20354
|
var ClipPlaybackSchema = object({
|
|
20241
20355
|
/** HLS master URL through the hub data-plane (Range + token in path). */
|
|
@@ -20699,7 +20813,14 @@ var SearchResultSchema = object({
|
|
|
20699
20813
|
});
|
|
20700
20814
|
var AutoUpdateSettingsSchema = object({
|
|
20701
20815
|
channel: ChannelSchema,
|
|
20702
|
-
intervalSeconds: number()
|
|
20816
|
+
intervalSeconds: number(),
|
|
20817
|
+
/**
|
|
20818
|
+
* Cadence of the "an update exists" POLLER, in seconds. Independent of
|
|
20819
|
+
* `channel`: the poller runs while auto-apply is `off`, because being told
|
|
20820
|
+
* about a publish and installing it are different decisions. Clamped
|
|
20821
|
+
* server-side to 900 s … 604800 s; defaults to 21600 s (6 h).
|
|
20822
|
+
*/
|
|
20823
|
+
updateCheckIntervalSeconds: number()
|
|
20703
20824
|
});
|
|
20704
20825
|
var AddonAutoUpdateSchema = ChannelWithInheritSchema;
|
|
20705
20826
|
var RestartAddonResultSchema = unknown();
|
|
@@ -20840,7 +20961,9 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
|
|
|
20840
20961
|
auth: "admin"
|
|
20841
20962
|
}), method(_void(), AutoUpdateSettingsSchema, { auth: "admin" }), method(object({
|
|
20842
20963
|
channel: ChannelSchema,
|
|
20843
|
-
intervalSeconds: number().min(300).max(86400).optional()
|
|
20964
|
+
intervalSeconds: number().min(300).max(86400).optional(),
|
|
20965
|
+
/** Availability-poll cadence; see AutoUpdateSettingsSchema. */
|
|
20966
|
+
updateCheckIntervalSeconds: number().min(900).max(604800).optional()
|
|
20844
20967
|
}), unknown(), {
|
|
20845
20968
|
kind: "mutation",
|
|
20846
20969
|
auth: "admin"
|
|
@@ -26538,7 +26661,9 @@ var ExportOptionsSchema = object({
|
|
|
26538
26661
|
includeAudio: boolean(),
|
|
26539
26662
|
maxLifeMs: number().int().positive(),
|
|
26540
26663
|
deleteAfterDownload: boolean(),
|
|
26541
|
-
title: string$2().max(200).optional()
|
|
26664
|
+
title: string$2().max(200).optional(),
|
|
26665
|
+
/** Notification-output target ids to ping when this export becomes ready. */
|
|
26666
|
+
notifyTargetIds: array(string$2().min(1)).max(20).optional()
|
|
26542
26667
|
}).superRefine((v, ctx) => {
|
|
26543
26668
|
if (v.speed !== void 0 && v.timelapse !== void 0) ctx.addIssue({
|
|
26544
26669
|
code: ZodIssueCode.custom,
|
|
@@ -26597,10 +26722,18 @@ var ExportBytesSchema = object({
|
|
|
26597
26722
|
});
|
|
26598
26723
|
method(object({
|
|
26599
26724
|
deviceId: number(),
|
|
26600
|
-
|
|
26725
|
+
/** @deprecated Prefer `profiles`. Kept so timelapse/notifiers keep working. */
|
|
26726
|
+
profile: string$2().optional(),
|
|
26727
|
+
profiles: array(string$2()).min(1).optional(),
|
|
26601
26728
|
fromMs: number(),
|
|
26602
26729
|
toMs: number(),
|
|
26603
26730
|
options: ExportOptionsSchema
|
|
26731
|
+
}).superRefine((v, ctx) => {
|
|
26732
|
+
if ((v.profiles !== void 0 && v.profiles.length > 0 ? v.profiles : v.profile !== void 0 ? [v.profile] : []).length < 1) ctx.addIssue({
|
|
26733
|
+
code: ZodIssueCode.custom,
|
|
26734
|
+
message: "pass profiles[] (min 1) or legacy profile",
|
|
26735
|
+
path: ["profiles"]
|
|
26736
|
+
});
|
|
26604
26737
|
}), ExportRecordSchema, {
|
|
26605
26738
|
kind: "mutation",
|
|
26606
26739
|
auth: "protected"
|
|
@@ -29542,15 +29675,6 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
29542
29675
|
labels: ["probe not implemented"]
|
|
29543
29676
|
};
|
|
29544
29677
|
}
|
|
29545
|
-
/**
|
|
29546
|
-
* Top-level devices restored at once in {@link onRestoreDevices}.
|
|
29547
|
-
*
|
|
29548
|
-
* Four covers the fleets this ships to without turning a boot into a burst a
|
|
29549
|
-
* camera NVR answers with a refusal. A provider whose upstream is a single
|
|
29550
|
-
* session with a serial command channel (a Baichuan hub, an NVR that
|
|
29551
|
-
* serialises ISAPI) should lower it; nothing needs to raise it.
|
|
29552
|
-
*/
|
|
29553
|
-
restoreConcurrency = 4;
|
|
29554
29678
|
async restoreDevices(savedDevices) {
|
|
29555
29679
|
await this.onRestoreDevices(savedDevices);
|
|
29556
29680
|
if (savedDevices.length > 0) this.ctx.logger.info(`Restored ${savedDevices.length} ${this.providerName} device(s)`);
|
|
@@ -29605,14 +29729,7 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
29605
29729
|
});
|
|
29606
29730
|
}
|
|
29607
29731
|
};
|
|
29608
|
-
|
|
29609
|
-
await Promise.all(Array.from({ length: Math.min(Math.max(1, this.restoreConcurrency), topLevel.length) }, async () => {
|
|
29610
|
-
for (;;) {
|
|
29611
|
-
const saved = topLevel[nextTopLevel++];
|
|
29612
|
-
if (saved === void 0) return;
|
|
29613
|
-
await restoreOne(saved);
|
|
29614
|
-
}
|
|
29615
|
-
}));
|
|
29732
|
+
await Promise.all(topLevel.map((saved) => restoreOne(saved)));
|
|
29616
29733
|
const childRows = savedDevices.filter((s) => s.parentDeviceId !== null);
|
|
29617
29734
|
for (const saved of childRows) {
|
|
29618
29735
|
const Class = this.deviceClasses[saved.type];
|
|
@@ -32885,6 +33002,12 @@ Object.freeze({
|
|
|
32885
33002
|
addonId: null,
|
|
32886
33003
|
access: "create"
|
|
32887
33004
|
},
|
|
33005
|
+
"pipelineAnalytics.reconcileFromDisk": {
|
|
33006
|
+
capName: "pipeline-analytics",
|
|
33007
|
+
capScope: "device",
|
|
33008
|
+
addonId: null,
|
|
33009
|
+
access: "create"
|
|
33010
|
+
},
|
|
32888
33011
|
"pipelineAnalytics.refreshStorageLocationsForMigration": {
|
|
32889
33012
|
capName: "pipeline-analytics",
|
|
32890
33013
|
capScope: "device",
|
|
@@ -33287,6 +33410,12 @@ Object.freeze({
|
|
|
33287
33410
|
addonId: null,
|
|
33288
33411
|
access: "view"
|
|
33289
33412
|
},
|
|
33413
|
+
"pipelineOrchestrator.getReconcileFromDiskStatus": {
|
|
33414
|
+
capName: "pipeline-orchestrator",
|
|
33415
|
+
capScope: "system",
|
|
33416
|
+
addonId: null,
|
|
33417
|
+
access: "view"
|
|
33418
|
+
},
|
|
33290
33419
|
"pipelineOrchestrator.listAgentSettings": {
|
|
33291
33420
|
capName: "pipeline-orchestrator",
|
|
33292
33421
|
capScope: "system",
|
|
@@ -33311,6 +33440,12 @@ Object.freeze({
|
|
|
33311
33440
|
addonId: null,
|
|
33312
33441
|
access: "create"
|
|
33313
33442
|
},
|
|
33443
|
+
"pipelineOrchestrator.reconcileFromDisk": {
|
|
33444
|
+
capName: "pipeline-orchestrator",
|
|
33445
|
+
capScope: "system",
|
|
33446
|
+
addonId: null,
|
|
33447
|
+
access: "create"
|
|
33448
|
+
},
|
|
33314
33449
|
"pipelineOrchestrator.removeAgentSettings": {
|
|
33315
33450
|
capName: "pipeline-orchestrator",
|
|
33316
33451
|
capScope: "system",
|
|
@@ -36302,6 +36437,11 @@ Object.freeze({
|
|
|
36302
36437
|
form: "single",
|
|
36303
36438
|
optional: true
|
|
36304
36439
|
}],
|
|
36440
|
+
"pipelineAnalytics.reconcileFromDisk": [{
|
|
36441
|
+
name: "deviceId",
|
|
36442
|
+
form: "single",
|
|
36443
|
+
optional: false
|
|
36444
|
+
}],
|
|
36305
36445
|
"pipelineAnalytics.restageRetrainTrack": [{
|
|
36306
36446
|
name: "deviceId",
|
|
36307
36447
|
form: "single",
|
|
@@ -37367,6 +37507,8 @@ DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
|
|
|
37367
37507
|
DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
|
|
37368
37508
|
DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
|
|
37369
37509
|
DEFAULT_NATIVE_LEASE_SETTINGS.admission;
|
|
37510
|
+
var MB = 1024 * 1024;
|
|
37511
|
+
1024 * MB, 3072 * MB;
|
|
37370
37512
|
//#endregion
|
|
37371
37513
|
//#region ../../node_modules/@matter/general/dist/esm/net/tcp/TcpConnection.js
|
|
37372
37514
|
/**
|
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.20",
|
|
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",
|