@camstack/addon-provider-tuya 0.2.19 → 0.2.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/addon.js +187 -45
- package/dist/addon.mjs +187 -45
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -819,7 +819,7 @@ async function discoverDevices(options = {}, binder = createDgramBinder()) {
|
|
|
819
819
|
return [...byId.values()];
|
|
820
820
|
}
|
|
821
821
|
//#endregion
|
|
822
|
-
//#region ../types/dist/event-category-
|
|
822
|
+
//#region ../types/dist/event-category-XfKNtfCc.mjs
|
|
823
823
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
824
824
|
EventCategory["SystemBoot"] = "system.boot";
|
|
825
825
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -836,9 +836,10 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
836
836
|
EventCategory["SystemRestartCompleted"] = "system.restart-completed";
|
|
837
837
|
/**
|
|
838
838
|
* A newer addon or server-root package version was found by the
|
|
839
|
-
* authoritative registry check. Emitted once
|
|
840
|
-
* `(
|
|
841
|
-
*
|
|
839
|
+
* authoritative registry check. Emitted once when any observed
|
|
840
|
+
* `latestVersion` changes (or a package/node first appears behind);
|
|
841
|
+
* the payload carries the full currently-available list. Repeated
|
|
842
|
+
* polling of the same latests is silent.
|
|
842
843
|
*/
|
|
843
844
|
EventCategory["UpdateAvailable"] = "update.available";
|
|
844
845
|
/**
|
|
@@ -857,6 +858,22 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
857
858
|
EventCategory["AddonInstalled"] = "addon.installed";
|
|
858
859
|
EventCategory["AddonUninstalled"] = "addon.uninstalled";
|
|
859
860
|
EventCategory["AddonCrashed"] = "addon.crashed";
|
|
861
|
+
/**
|
|
862
|
+
* A RUNNER the D6 crash circuit-breaker gave up on — terminal.
|
|
863
|
+
*
|
|
864
|
+
* `AddonCrashed` is the routine, self-healing fact ("it crashed; it is being
|
|
865
|
+
* respawned"); this is the one that never resolves itself. Emitted exactly
|
|
866
|
+
* once per trip, by `process-service.ts`, carrying the node, the runner, the
|
|
867
|
+
* addons it hosted and the crash count that tripped the breaker.
|
|
868
|
+
*
|
|
869
|
+
* It exists because a runner marked terminally `failed` used to be SILENT:
|
|
870
|
+
* on 2026-08-18 the `recorder` runner died of three unhandled ffmpeg spawn
|
|
871
|
+
* errors, the breaker stopped respawning it (correctly), `/health` kept
|
|
872
|
+
* returning 200, and fleet-wide recording was gone for 3h15 before the
|
|
873
|
+
* operator's phone told him. The Notification Center's system-event intake
|
|
874
|
+
* consumes this category and maps it to the `addon-crash-loop` kind.
|
|
875
|
+
*/
|
|
876
|
+
EventCategory["AddonRunnerFailed"] = "addon.runner-failed";
|
|
860
877
|
EventCategory["AddonError"] = "addon.error";
|
|
861
878
|
EventCategory["AddonPageReady"] = "addon.page-ready";
|
|
862
879
|
EventCategory["AddonWidgetReady"] = "addon.widget-ready";
|
|
@@ -8368,6 +8385,10 @@ var RecordingBandSchema = object({
|
|
|
8368
8385
|
preBufferSec: number().min(0).optional(),
|
|
8369
8386
|
postBufferSec: number().min(0).optional()
|
|
8370
8387
|
});
|
|
8388
|
+
({
|
|
8389
|
+
preBufferSec: 10,
|
|
8390
|
+
postBufferSec: 30
|
|
8391
|
+
}).postBufferSec * 1e3;
|
|
8371
8392
|
/**
|
|
8372
8393
|
* Per-device retention overrides. Every field is optional; an unset or `0`
|
|
8373
8394
|
* value inherits the node-wide recorder default. Only footage-lifetime limits
|
|
@@ -8415,6 +8436,12 @@ var RecordingConfigSchema = object({
|
|
|
8415
8436
|
/** DERIVED summary of `bands`, stamped by the recorder on every save.
|
|
8416
8437
|
* Authoring it has no effect — see {@link RecordingStorageModeSchema}. */
|
|
8417
8438
|
mode: RecordingStorageModeSchema.optional(),
|
|
8439
|
+
/**
|
|
8440
|
+
* Which assigned broker slots to record. Absent / empty = {@link
|
|
8441
|
+
* DEFAULT_RECORDING_PROFILES} (`high`+`low`) intersected with the
|
|
8442
|
+
* camera's currently assigned slots — never `mid` unless the operator
|
|
8443
|
+
* picks it, and never a slot the broker has not assigned.
|
|
8444
|
+
*/
|
|
8418
8445
|
profiles: array(CamProfileSchema).optional(),
|
|
8419
8446
|
segmentSeconds: number().int().positive().optional(),
|
|
8420
8447
|
/**
|
|
@@ -8495,7 +8522,11 @@ var RelocateFootageInputSchema = object({
|
|
|
8495
8522
|
profiles: array(string()).optional(),
|
|
8496
8523
|
/** Copy throttle in MB/s (default 40) — the drain is a background chore,
|
|
8497
8524
|
* never allowed to starve live writers. */
|
|
8498
|
-
throttleMbps: number().min(1).max(1e3).optional()
|
|
8525
|
+
throttleMbps: number().min(1).max(1e3).optional(),
|
|
8526
|
+
/** Move only segments whose startMs is >= this. Absent = the whole source
|
|
8527
|
+
* pile. Used when a full drain is too expensive and the operator only
|
|
8528
|
+
* wants the recent window on the new disk. */
|
|
8529
|
+
sinceMs: number().int().optional()
|
|
8499
8530
|
});
|
|
8500
8531
|
/** Internal, lease-scoped participant operation. It is intentionally separate
|
|
8501
8532
|
* from persistent recording settings: a migration never changes
|
|
@@ -15377,6 +15408,7 @@ var NcSystemEventKindSchema = _enum([
|
|
|
15377
15408
|
"node-offline",
|
|
15378
15409
|
"node-inference-unavailable",
|
|
15379
15410
|
"detection-blind",
|
|
15411
|
+
"addon-crash-loop",
|
|
15380
15412
|
"addon-update-available",
|
|
15381
15413
|
"server-update-available",
|
|
15382
15414
|
"alarm-triggered",
|
|
@@ -15384,6 +15416,9 @@ var NcSystemEventKindSchema = _enum([
|
|
|
15384
15416
|
"alarm-disarmed",
|
|
15385
15417
|
"alarm-arming",
|
|
15386
15418
|
"alarm-arm-refused",
|
|
15419
|
+
"addon-updated",
|
|
15420
|
+
"server-updated",
|
|
15421
|
+
"export-completed",
|
|
15387
15422
|
"camera-online",
|
|
15388
15423
|
"camera-offline",
|
|
15389
15424
|
"camera-disabled",
|
|
@@ -17277,13 +17312,19 @@ var RetrainStatusSchema = _enum([
|
|
|
17277
17312
|
* "never marked" from "already trained" must read `retrainStatus`.
|
|
17278
17313
|
*
|
|
17279
17314
|
* `debug` does NOT pin; it is attention, not durability.
|
|
17315
|
+
*
|
|
17316
|
+
* `favourited` IS a BOOLEAN pin (durability bit), not a retrain lifecycle.
|
|
17317
|
+
* A favourited track is skipped by retention the same way `staging` is, but
|
|
17318
|
+
* it does not enter `none|staging|trained` and has no staging budget.
|
|
17280
17319
|
*/
|
|
17281
17320
|
var TrackFlagFields = {
|
|
17282
17321
|
/** Operator marked this track as training material — i.e. `retrainStatus` is
|
|
17283
17322
|
* `'staging'`. */
|
|
17284
17323
|
markForTrain: boolean().optional(),
|
|
17285
17324
|
/** Operator marked this track for diagnostic attention. */
|
|
17286
|
-
debug: boolean().optional()
|
|
17325
|
+
debug: boolean().optional(),
|
|
17326
|
+
/** Operator favourited this track. Pins it against pruning. */
|
|
17327
|
+
favourited: boolean().optional()
|
|
17287
17328
|
};
|
|
17288
17329
|
/**
|
|
17289
17330
|
* The lifecycle field itself, on the READ surfaces only (`Track`, `KeyEvent`).
|
|
@@ -17308,6 +17349,7 @@ var TrackFlagsSchema = object({
|
|
|
17308
17349
|
trackId: string(),
|
|
17309
17350
|
markForTrain: boolean(),
|
|
17310
17351
|
debug: boolean(),
|
|
17352
|
+
favourited: boolean(),
|
|
17311
17353
|
/** The lifecycle state the boolean was derived from. Required here (unlike on
|
|
17312
17354
|
* a track row) because this shape is only ever produced by the write body,
|
|
17313
17355
|
* which always knows it — and a surface that has just written needs to render
|
|
@@ -17940,6 +17982,12 @@ var TrackCascadeCountsSchema = object({
|
|
|
17940
17982
|
/** Per-track CLIP search vectors removed (best-effort). */
|
|
17941
17983
|
embeddings: number().int()
|
|
17942
17984
|
});
|
|
17985
|
+
/** Disk-wins reconcile: media rows whose blobs are gone, then empty tracks. */
|
|
17986
|
+
var DiskReconcileCountsSchema = object({
|
|
17987
|
+
mediaDropped: number().int(),
|
|
17988
|
+
tracks: number().int(),
|
|
17989
|
+
events: number().int()
|
|
17990
|
+
});
|
|
17943
17991
|
/** Event-store footprint for one camera. */
|
|
17944
17992
|
var EventStoreDeviceFootprintSchema = object({
|
|
17945
17993
|
deviceId: number(),
|
|
@@ -18116,6 +18164,9 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
18116
18164
|
}), method(object({ deviceId: number() }), TrackCascadeCountsSchema, {
|
|
18117
18165
|
kind: "mutation",
|
|
18118
18166
|
auth: "admin"
|
|
18167
|
+
}), method(object({ deviceId: number() }), DiskReconcileCountsSchema, {
|
|
18168
|
+
kind: "mutation",
|
|
18169
|
+
auth: "admin"
|
|
18119
18170
|
}), method(object({
|
|
18120
18171
|
deviceId: number(),
|
|
18121
18172
|
trackIds: array(string()).min(1)
|
|
@@ -19666,6 +19717,24 @@ var CameraStatusDegradationSchema = object({
|
|
|
19666
19717
|
*
|
|
19667
19718
|
* See spec: `docs/superpowers/specs/2026-06-24-camera-status-aggregator-cap.md`
|
|
19668
19719
|
*/
|
|
19720
|
+
var DiskReconcileJobSchema = object({
|
|
19721
|
+
state: _enum([
|
|
19722
|
+
"idle",
|
|
19723
|
+
"running",
|
|
19724
|
+
"done",
|
|
19725
|
+
"error"
|
|
19726
|
+
]),
|
|
19727
|
+
total: number().int().nonnegative(),
|
|
19728
|
+
completed: number().int().nonnegative(),
|
|
19729
|
+
currentDeviceId: number().int().nullable(),
|
|
19730
|
+
failed: array(number().int()).readonly(),
|
|
19731
|
+
mediaDropped: number().int().nonnegative(),
|
|
19732
|
+
tracks: number().int().nonnegative(),
|
|
19733
|
+
events: number().int().nonnegative(),
|
|
19734
|
+
startedAtMs: number().int().nullable(),
|
|
19735
|
+
finishedAtMs: number().int().nullable(),
|
|
19736
|
+
error: string().nullable()
|
|
19737
|
+
});
|
|
19669
19738
|
var CameraStatusSchema = object({
|
|
19670
19739
|
deviceId: number(),
|
|
19671
19740
|
assignment: CameraAssignmentStatusSchema,
|
|
@@ -19897,7 +19966,10 @@ method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
|
|
|
19897
19966
|
}), CameraSwitchGroupSchema, {
|
|
19898
19967
|
kind: "mutation",
|
|
19899
19968
|
auth: "admin"
|
|
19900
|
-
}), method(object({ deviceId: number() }), CameraStatusSchema), method(object({ deviceIds: array(number()).optional() }), array(CameraStatusSchema).readonly()), method(_void(),
|
|
19969
|
+
}), method(object({ deviceId: number() }), CameraStatusSchema), method(object({ deviceIds: array(number()).optional() }), array(CameraStatusSchema).readonly()), method(_void(), DiskReconcileJobSchema, {
|
|
19970
|
+
kind: "mutation",
|
|
19971
|
+
auth: "admin"
|
|
19972
|
+
}), method(_void(), DiskReconcileJobSchema, { auth: "admin" }), method(_void(), array(PipelineTemplateSchema).readonly()), method(object({
|
|
19901
19973
|
name: string(),
|
|
19902
19974
|
description: string().optional(),
|
|
19903
19975
|
config: CameraPipelineConfigSchema
|
|
@@ -20302,7 +20374,14 @@ targets: array(object({
|
|
|
20302
20374
|
"sleeping",
|
|
20303
20375
|
"unreachable",
|
|
20304
20376
|
"waking"
|
|
20305
|
-
]).nullable()
|
|
20377
|
+
]).nullable(),
|
|
20378
|
+
/** A battery camera (whatever its current state). An AWAKE battery
|
|
20379
|
+
* camera is deliberately NOT recaptured on the poll cadence — every
|
|
20380
|
+
* capture is a camera hit that would keep it out of sleep — so its
|
|
20381
|
+
* cached frame legitimately ages past the currency ceiling while
|
|
20382
|
+
* nothing is streaming. A surface must keep painting it (a fresh
|
|
20383
|
+
* frame is captured at each wake), not blank to "unavailable". */
|
|
20384
|
+
battery: boolean()
|
|
20306
20385
|
})));
|
|
20307
20386
|
/**
|
|
20308
20387
|
* `sso-bridge` — internal hub-only cap that lets SSO-style auth
|
|
@@ -20963,20 +21042,6 @@ var VectorStatsResultSchema = object({
|
|
|
20963
21042
|
exact: boolean()
|
|
20964
21043
|
});
|
|
20965
21044
|
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);
|
|
20966
|
-
/**
|
|
20967
|
-
* `videoclips` — the unified, navigable-clip surface for a camera.
|
|
20968
|
-
*
|
|
20969
|
-
* A device-scoped WRAPPER cap (like `pipeline-analytics`): exactly one active
|
|
20970
|
-
* provider per device, substitutable. The DEFAULT provider (registered by
|
|
20971
|
-
* `addon-post-analysis`, `defaultActive: true`) composes the analytics event
|
|
20972
|
-
* log (markers + thumbnails) with the recorder's `getPlaybackManifest` — a clip
|
|
20973
|
-
* is a time-WINDOW over existing footage, never a separate file. A camera that
|
|
20974
|
-
* exposes NATIVE onboard clips (Reolink/Hikvision NVR) can later substitute the
|
|
20975
|
-
* wrapper provider for its device and serve its own clip catalog + URLs.
|
|
20976
|
-
*
|
|
20977
|
-
* A `Clip` is purely time-based (subtree-blind): playback resolves segments by
|
|
20978
|
-
* temporal overlap, so the API never decides `continuous` vs `events`.
|
|
20979
|
-
*/
|
|
20980
21045
|
var ClipSchema = object({
|
|
20981
21046
|
/** Opaque, provider-namespaced id. The default provider encodes the time
|
|
20982
21047
|
* window so `getClipPlayback` is self-contained (no event re-query). */
|
|
@@ -20993,8 +21058,57 @@ var ClipSchema = object({
|
|
|
20993
21058
|
startMs: number(),
|
|
20994
21059
|
endMs: number()
|
|
20995
21060
|
}),
|
|
20996
|
-
/**
|
|
20997
|
-
thumbnail
|
|
21061
|
+
/**
|
|
21062
|
+
* Lazy thumbnail URL, never inlined.
|
|
21063
|
+
*
|
|
21064
|
+
* Recording-derived clips (events-mode keep-window, and the prepared
|
|
21065
|
+
* continuous event+fragment visit) MUST use the snapshot of the **main
|
|
21066
|
+
* event of the interval** — `getEventMedia({ eventId, kind: 'snapshot' })`
|
|
21067
|
+
* of the event that owns `kind` (object > motion > audio). Do not extract
|
|
21068
|
+
* a keyframe from the recorded segments. Other providers (onboard, HKSV)
|
|
21069
|
+
* mint their own stills.
|
|
21070
|
+
*
|
|
21071
|
+
* **VOUCHED, never fabricated.** A provider emits this only for an event it
|
|
21072
|
+
* has CONFIRMED owns at least one media row (its own, or its owning track's).
|
|
21073
|
+
* Absent is meaningful — "this visit has no event still" — never "we did not
|
|
21074
|
+
* look". Stamping it from a URL template made 35% of one camera's clips point
|
|
21075
|
+
* at a 404 (device 3836, 2026-08-17: 64 of 179 clips dead, 63 of them motion).
|
|
21076
|
+
* A read that FAILS drops the claim; it never invents it.
|
|
21077
|
+
*/
|
|
21078
|
+
thumbnail: string().optional(),
|
|
21079
|
+
/**
|
|
21080
|
+
* An instant INSIDE this visit's footage, hole-safe, where a recorded still
|
|
21081
|
+
* can be decoded. Present whenever the visit came from recorded availability;
|
|
21082
|
+
* absent on a per-event padded window (there is no footage to promise).
|
|
21083
|
+
*
|
|
21084
|
+
* This is not a thumbnail and not a second byte path: it is the argument to
|
|
21085
|
+
* the recorder's existing still route. The surface — never the provider —
|
|
21086
|
+
* decides whether to use it. It is the midpoint of the visit's LONGEST
|
|
21087
|
+
* contiguous range, not of the visit: a visit spans its holes by
|
|
21088
|
+
* construction, so a naive midpoint lands in dead air.
|
|
21089
|
+
*/
|
|
21090
|
+
stillAtMs: number().optional(),
|
|
21091
|
+
/**
|
|
21092
|
+
* Analytics event ids that overlap this visit — a BOUNDED sample, newest
|
|
21093
|
+
* first within kind (object → motion → audio), capped at
|
|
21094
|
+
* {@link MAX_CLIP_EVENT_IDS}. Empty on footage-only clips.
|
|
21095
|
+
*
|
|
21096
|
+
* Bounded because it is not a payload the surface pages through: one visit on
|
|
21097
|
+
* device 615 carried 2 345 ids, and `eventIds` was 99% of a 153 KB
|
|
21098
|
+
* camera-day. Read {@link eventCount} for the true total.
|
|
21099
|
+
*/
|
|
21100
|
+
eventIds: array(string()).optional(),
|
|
21101
|
+
/** How many analytics events actually overlap this visit. Differs from
|
|
21102
|
+
* `eventIds.length` exactly when the sample was capped — so a truncated
|
|
21103
|
+
* list is never mistaken for a quiet visit. */
|
|
21104
|
+
eventCount: number().int().nonnegative().optional(),
|
|
21105
|
+
/** Intra-visit footage holes (GOP rolls, discarded segments) still shorter
|
|
21106
|
+
* than `VISIT_MERGE_GAP_MS`. Playback concatenates around them; the timeline
|
|
21107
|
+
* bar keeps showing them via `recording.getAvailability`. */
|
|
21108
|
+
holes: array(object({
|
|
21109
|
+
startMs: number(),
|
|
21110
|
+
endMs: number()
|
|
21111
|
+
})).optional()
|
|
20998
21112
|
});
|
|
20999
21113
|
var ClipPlaybackSchema = object({
|
|
21000
21114
|
/** HLS master URL through the hub data-plane (Range + token in path). */
|
|
@@ -21458,7 +21572,14 @@ var SearchResultSchema = object({
|
|
|
21458
21572
|
});
|
|
21459
21573
|
var AutoUpdateSettingsSchema = object({
|
|
21460
21574
|
channel: ChannelSchema,
|
|
21461
|
-
intervalSeconds: number()
|
|
21575
|
+
intervalSeconds: number(),
|
|
21576
|
+
/**
|
|
21577
|
+
* Cadence of the "an update exists" POLLER, in seconds. Independent of
|
|
21578
|
+
* `channel`: the poller runs while auto-apply is `off`, because being told
|
|
21579
|
+
* about a publish and installing it are different decisions. Clamped
|
|
21580
|
+
* server-side to 900 s … 604800 s; defaults to 21600 s (6 h).
|
|
21581
|
+
*/
|
|
21582
|
+
updateCheckIntervalSeconds: number()
|
|
21462
21583
|
});
|
|
21463
21584
|
var AddonAutoUpdateSchema = ChannelWithInheritSchema;
|
|
21464
21585
|
var RestartAddonResultSchema = unknown();
|
|
@@ -21599,7 +21720,9 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
|
|
|
21599
21720
|
auth: "admin"
|
|
21600
21721
|
}), method(_void(), AutoUpdateSettingsSchema, { auth: "admin" }), method(object({
|
|
21601
21722
|
channel: ChannelSchema,
|
|
21602
|
-
intervalSeconds: number().min(300).max(86400).optional()
|
|
21723
|
+
intervalSeconds: number().min(300).max(86400).optional(),
|
|
21724
|
+
/** Availability-poll cadence; see AutoUpdateSettingsSchema. */
|
|
21725
|
+
updateCheckIntervalSeconds: number().min(900).max(604800).optional()
|
|
21603
21726
|
}), unknown(), {
|
|
21604
21727
|
kind: "mutation",
|
|
21605
21728
|
auth: "admin"
|
|
@@ -27288,7 +27411,9 @@ var ExportOptionsSchema = object({
|
|
|
27288
27411
|
includeAudio: boolean(),
|
|
27289
27412
|
maxLifeMs: number().int().positive(),
|
|
27290
27413
|
deleteAfterDownload: boolean(),
|
|
27291
|
-
title: string().max(200).optional()
|
|
27414
|
+
title: string().max(200).optional(),
|
|
27415
|
+
/** Notification-output target ids to ping when this export becomes ready. */
|
|
27416
|
+
notifyTargetIds: array(string().min(1)).max(20).optional()
|
|
27292
27417
|
}).superRefine((v, ctx) => {
|
|
27293
27418
|
if (v.speed !== void 0 && v.timelapse !== void 0) ctx.addIssue({
|
|
27294
27419
|
code: ZodIssueCode.custom,
|
|
@@ -27347,10 +27472,18 @@ var ExportBytesSchema = object({
|
|
|
27347
27472
|
});
|
|
27348
27473
|
method(object({
|
|
27349
27474
|
deviceId: number(),
|
|
27350
|
-
|
|
27475
|
+
/** @deprecated Prefer `profiles`. Kept so timelapse/notifiers keep working. */
|
|
27476
|
+
profile: string().optional(),
|
|
27477
|
+
profiles: array(string()).min(1).optional(),
|
|
27351
27478
|
fromMs: number(),
|
|
27352
27479
|
toMs: number(),
|
|
27353
27480
|
options: ExportOptionsSchema
|
|
27481
|
+
}).superRefine((v, ctx) => {
|
|
27482
|
+
if ((v.profiles !== void 0 && v.profiles.length > 0 ? v.profiles : v.profile !== void 0 ? [v.profile] : []).length < 1) ctx.addIssue({
|
|
27483
|
+
code: ZodIssueCode.custom,
|
|
27484
|
+
message: "pass profiles[] (min 1) or legacy profile",
|
|
27485
|
+
path: ["profiles"]
|
|
27486
|
+
});
|
|
27354
27487
|
}), ExportRecordSchema, {
|
|
27355
27488
|
kind: "mutation",
|
|
27356
27489
|
auth: "protected"
|
|
@@ -30292,15 +30425,6 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
30292
30425
|
labels: ["probe not implemented"]
|
|
30293
30426
|
};
|
|
30294
30427
|
}
|
|
30295
|
-
/**
|
|
30296
|
-
* Top-level devices restored at once in {@link onRestoreDevices}.
|
|
30297
|
-
*
|
|
30298
|
-
* Four covers the fleets this ships to without turning a boot into a burst a
|
|
30299
|
-
* camera NVR answers with a refusal. A provider whose upstream is a single
|
|
30300
|
-
* session with a serial command channel (a Baichuan hub, an NVR that
|
|
30301
|
-
* serialises ISAPI) should lower it; nothing needs to raise it.
|
|
30302
|
-
*/
|
|
30303
|
-
restoreConcurrency = 4;
|
|
30304
30428
|
async restoreDevices(savedDevices) {
|
|
30305
30429
|
await this.onRestoreDevices(savedDevices);
|
|
30306
30430
|
if (savedDevices.length > 0) this.ctx.logger.info(`Restored ${savedDevices.length} ${this.providerName} device(s)`);
|
|
@@ -30355,14 +30479,7 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
30355
30479
|
});
|
|
30356
30480
|
}
|
|
30357
30481
|
};
|
|
30358
|
-
|
|
30359
|
-
await Promise.all(Array.from({ length: Math.min(Math.max(1, this.restoreConcurrency), topLevel.length) }, async () => {
|
|
30360
|
-
for (;;) {
|
|
30361
|
-
const saved = topLevel[nextTopLevel++];
|
|
30362
|
-
if (saved === void 0) return;
|
|
30363
|
-
await restoreOne(saved);
|
|
30364
|
-
}
|
|
30365
|
-
}));
|
|
30482
|
+
await Promise.all(topLevel.map((saved) => restoreOne(saved)));
|
|
30366
30483
|
const childRows = savedDevices.filter((s) => s.parentDeviceId !== null);
|
|
30367
30484
|
for (const saved of childRows) {
|
|
30368
30485
|
const Class = this.deviceClasses[saved.type];
|
|
@@ -33635,6 +33752,12 @@ Object.freeze({
|
|
|
33635
33752
|
addonId: null,
|
|
33636
33753
|
access: "create"
|
|
33637
33754
|
},
|
|
33755
|
+
"pipelineAnalytics.reconcileFromDisk": {
|
|
33756
|
+
capName: "pipeline-analytics",
|
|
33757
|
+
capScope: "device",
|
|
33758
|
+
addonId: null,
|
|
33759
|
+
access: "create"
|
|
33760
|
+
},
|
|
33638
33761
|
"pipelineAnalytics.refreshStorageLocationsForMigration": {
|
|
33639
33762
|
capName: "pipeline-analytics",
|
|
33640
33763
|
capScope: "device",
|
|
@@ -34037,6 +34160,12 @@ Object.freeze({
|
|
|
34037
34160
|
addonId: null,
|
|
34038
34161
|
access: "view"
|
|
34039
34162
|
},
|
|
34163
|
+
"pipelineOrchestrator.getReconcileFromDiskStatus": {
|
|
34164
|
+
capName: "pipeline-orchestrator",
|
|
34165
|
+
capScope: "system",
|
|
34166
|
+
addonId: null,
|
|
34167
|
+
access: "view"
|
|
34168
|
+
},
|
|
34040
34169
|
"pipelineOrchestrator.listAgentSettings": {
|
|
34041
34170
|
capName: "pipeline-orchestrator",
|
|
34042
34171
|
capScope: "system",
|
|
@@ -34061,6 +34190,12 @@ Object.freeze({
|
|
|
34061
34190
|
addonId: null,
|
|
34062
34191
|
access: "create"
|
|
34063
34192
|
},
|
|
34193
|
+
"pipelineOrchestrator.reconcileFromDisk": {
|
|
34194
|
+
capName: "pipeline-orchestrator",
|
|
34195
|
+
capScope: "system",
|
|
34196
|
+
addonId: null,
|
|
34197
|
+
access: "create"
|
|
34198
|
+
},
|
|
34064
34199
|
"pipelineOrchestrator.removeAgentSettings": {
|
|
34065
34200
|
capName: "pipeline-orchestrator",
|
|
34066
34201
|
capScope: "system",
|
|
@@ -37052,6 +37187,11 @@ Object.freeze({
|
|
|
37052
37187
|
form: "single",
|
|
37053
37188
|
optional: true
|
|
37054
37189
|
}],
|
|
37190
|
+
"pipelineAnalytics.reconcileFromDisk": [{
|
|
37191
|
+
name: "deviceId",
|
|
37192
|
+
form: "single",
|
|
37193
|
+
optional: false
|
|
37194
|
+
}],
|
|
37055
37195
|
"pipelineAnalytics.restageRetrainTrack": [{
|
|
37056
37196
|
name: "deviceId",
|
|
37057
37197
|
form: "single",
|
|
@@ -38117,6 +38257,8 @@ DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
|
|
|
38117
38257
|
DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
|
|
38118
38258
|
DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
|
|
38119
38259
|
DEFAULT_NATIVE_LEASE_SETTINGS.admission;
|
|
38260
|
+
var MB = 1024 * 1024;
|
|
38261
|
+
1024 * MB, 3072 * MB;
|
|
38120
38262
|
//#endregion
|
|
38121
38263
|
//#region src/config.ts
|
|
38122
38264
|
/**
|
package/dist/addon.mjs
CHANGED
|
@@ -818,7 +818,7 @@ async function discoverDevices(options = {}, binder = createDgramBinder()) {
|
|
|
818
818
|
return [...byId.values()];
|
|
819
819
|
}
|
|
820
820
|
//#endregion
|
|
821
|
-
//#region ../types/dist/event-category-
|
|
821
|
+
//#region ../types/dist/event-category-XfKNtfCc.mjs
|
|
822
822
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
823
823
|
EventCategory["SystemBoot"] = "system.boot";
|
|
824
824
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -835,9 +835,10 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
835
835
|
EventCategory["SystemRestartCompleted"] = "system.restart-completed";
|
|
836
836
|
/**
|
|
837
837
|
* A newer addon or server-root package version was found by the
|
|
838
|
-
* authoritative registry check. Emitted once
|
|
839
|
-
* `(
|
|
840
|
-
*
|
|
838
|
+
* authoritative registry check. Emitted once when any observed
|
|
839
|
+
* `latestVersion` changes (or a package/node first appears behind);
|
|
840
|
+
* the payload carries the full currently-available list. Repeated
|
|
841
|
+
* polling of the same latests is silent.
|
|
841
842
|
*/
|
|
842
843
|
EventCategory["UpdateAvailable"] = "update.available";
|
|
843
844
|
/**
|
|
@@ -856,6 +857,22 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
856
857
|
EventCategory["AddonInstalled"] = "addon.installed";
|
|
857
858
|
EventCategory["AddonUninstalled"] = "addon.uninstalled";
|
|
858
859
|
EventCategory["AddonCrashed"] = "addon.crashed";
|
|
860
|
+
/**
|
|
861
|
+
* A RUNNER the D6 crash circuit-breaker gave up on — terminal.
|
|
862
|
+
*
|
|
863
|
+
* `AddonCrashed` is the routine, self-healing fact ("it crashed; it is being
|
|
864
|
+
* respawned"); this is the one that never resolves itself. Emitted exactly
|
|
865
|
+
* once per trip, by `process-service.ts`, carrying the node, the runner, the
|
|
866
|
+
* addons it hosted and the crash count that tripped the breaker.
|
|
867
|
+
*
|
|
868
|
+
* It exists because a runner marked terminally `failed` used to be SILENT:
|
|
869
|
+
* on 2026-08-18 the `recorder` runner died of three unhandled ffmpeg spawn
|
|
870
|
+
* errors, the breaker stopped respawning it (correctly), `/health` kept
|
|
871
|
+
* returning 200, and fleet-wide recording was gone for 3h15 before the
|
|
872
|
+
* operator's phone told him. The Notification Center's system-event intake
|
|
873
|
+
* consumes this category and maps it to the `addon-crash-loop` kind.
|
|
874
|
+
*/
|
|
875
|
+
EventCategory["AddonRunnerFailed"] = "addon.runner-failed";
|
|
859
876
|
EventCategory["AddonError"] = "addon.error";
|
|
860
877
|
EventCategory["AddonPageReady"] = "addon.page-ready";
|
|
861
878
|
EventCategory["AddonWidgetReady"] = "addon.widget-ready";
|
|
@@ -8367,6 +8384,10 @@ var RecordingBandSchema = object({
|
|
|
8367
8384
|
preBufferSec: number().min(0).optional(),
|
|
8368
8385
|
postBufferSec: number().min(0).optional()
|
|
8369
8386
|
});
|
|
8387
|
+
({
|
|
8388
|
+
preBufferSec: 10,
|
|
8389
|
+
postBufferSec: 30
|
|
8390
|
+
}).postBufferSec * 1e3;
|
|
8370
8391
|
/**
|
|
8371
8392
|
* Per-device retention overrides. Every field is optional; an unset or `0`
|
|
8372
8393
|
* value inherits the node-wide recorder default. Only footage-lifetime limits
|
|
@@ -8414,6 +8435,12 @@ var RecordingConfigSchema = object({
|
|
|
8414
8435
|
/** DERIVED summary of `bands`, stamped by the recorder on every save.
|
|
8415
8436
|
* Authoring it has no effect — see {@link RecordingStorageModeSchema}. */
|
|
8416
8437
|
mode: RecordingStorageModeSchema.optional(),
|
|
8438
|
+
/**
|
|
8439
|
+
* Which assigned broker slots to record. Absent / empty = {@link
|
|
8440
|
+
* DEFAULT_RECORDING_PROFILES} (`high`+`low`) intersected with the
|
|
8441
|
+
* camera's currently assigned slots — never `mid` unless the operator
|
|
8442
|
+
* picks it, and never a slot the broker has not assigned.
|
|
8443
|
+
*/
|
|
8417
8444
|
profiles: array(CamProfileSchema).optional(),
|
|
8418
8445
|
segmentSeconds: number().int().positive().optional(),
|
|
8419
8446
|
/**
|
|
@@ -8494,7 +8521,11 @@ var RelocateFootageInputSchema = object({
|
|
|
8494
8521
|
profiles: array(string()).optional(),
|
|
8495
8522
|
/** Copy throttle in MB/s (default 40) — the drain is a background chore,
|
|
8496
8523
|
* never allowed to starve live writers. */
|
|
8497
|
-
throttleMbps: number().min(1).max(1e3).optional()
|
|
8524
|
+
throttleMbps: number().min(1).max(1e3).optional(),
|
|
8525
|
+
/** Move only segments whose startMs is >= this. Absent = the whole source
|
|
8526
|
+
* pile. Used when a full drain is too expensive and the operator only
|
|
8527
|
+
* wants the recent window on the new disk. */
|
|
8528
|
+
sinceMs: number().int().optional()
|
|
8498
8529
|
});
|
|
8499
8530
|
/** Internal, lease-scoped participant operation. It is intentionally separate
|
|
8500
8531
|
* from persistent recording settings: a migration never changes
|
|
@@ -15376,6 +15407,7 @@ var NcSystemEventKindSchema = _enum([
|
|
|
15376
15407
|
"node-offline",
|
|
15377
15408
|
"node-inference-unavailable",
|
|
15378
15409
|
"detection-blind",
|
|
15410
|
+
"addon-crash-loop",
|
|
15379
15411
|
"addon-update-available",
|
|
15380
15412
|
"server-update-available",
|
|
15381
15413
|
"alarm-triggered",
|
|
@@ -15383,6 +15415,9 @@ var NcSystemEventKindSchema = _enum([
|
|
|
15383
15415
|
"alarm-disarmed",
|
|
15384
15416
|
"alarm-arming",
|
|
15385
15417
|
"alarm-arm-refused",
|
|
15418
|
+
"addon-updated",
|
|
15419
|
+
"server-updated",
|
|
15420
|
+
"export-completed",
|
|
15386
15421
|
"camera-online",
|
|
15387
15422
|
"camera-offline",
|
|
15388
15423
|
"camera-disabled",
|
|
@@ -17276,13 +17311,19 @@ var RetrainStatusSchema = _enum([
|
|
|
17276
17311
|
* "never marked" from "already trained" must read `retrainStatus`.
|
|
17277
17312
|
*
|
|
17278
17313
|
* `debug` does NOT pin; it is attention, not durability.
|
|
17314
|
+
*
|
|
17315
|
+
* `favourited` IS a BOOLEAN pin (durability bit), not a retrain lifecycle.
|
|
17316
|
+
* A favourited track is skipped by retention the same way `staging` is, but
|
|
17317
|
+
* it does not enter `none|staging|trained` and has no staging budget.
|
|
17279
17318
|
*/
|
|
17280
17319
|
var TrackFlagFields = {
|
|
17281
17320
|
/** Operator marked this track as training material — i.e. `retrainStatus` is
|
|
17282
17321
|
* `'staging'`. */
|
|
17283
17322
|
markForTrain: boolean().optional(),
|
|
17284
17323
|
/** Operator marked this track for diagnostic attention. */
|
|
17285
|
-
debug: boolean().optional()
|
|
17324
|
+
debug: boolean().optional(),
|
|
17325
|
+
/** Operator favourited this track. Pins it against pruning. */
|
|
17326
|
+
favourited: boolean().optional()
|
|
17286
17327
|
};
|
|
17287
17328
|
/**
|
|
17288
17329
|
* The lifecycle field itself, on the READ surfaces only (`Track`, `KeyEvent`).
|
|
@@ -17307,6 +17348,7 @@ var TrackFlagsSchema = object({
|
|
|
17307
17348
|
trackId: string(),
|
|
17308
17349
|
markForTrain: boolean(),
|
|
17309
17350
|
debug: boolean(),
|
|
17351
|
+
favourited: boolean(),
|
|
17310
17352
|
/** The lifecycle state the boolean was derived from. Required here (unlike on
|
|
17311
17353
|
* a track row) because this shape is only ever produced by the write body,
|
|
17312
17354
|
* which always knows it — and a surface that has just written needs to render
|
|
@@ -17939,6 +17981,12 @@ var TrackCascadeCountsSchema = object({
|
|
|
17939
17981
|
/** Per-track CLIP search vectors removed (best-effort). */
|
|
17940
17982
|
embeddings: number().int()
|
|
17941
17983
|
});
|
|
17984
|
+
/** Disk-wins reconcile: media rows whose blobs are gone, then empty tracks. */
|
|
17985
|
+
var DiskReconcileCountsSchema = object({
|
|
17986
|
+
mediaDropped: number().int(),
|
|
17987
|
+
tracks: number().int(),
|
|
17988
|
+
events: number().int()
|
|
17989
|
+
});
|
|
17942
17990
|
/** Event-store footprint for one camera. */
|
|
17943
17991
|
var EventStoreDeviceFootprintSchema = object({
|
|
17944
17992
|
deviceId: number(),
|
|
@@ -18115,6 +18163,9 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
18115
18163
|
}), method(object({ deviceId: number() }), TrackCascadeCountsSchema, {
|
|
18116
18164
|
kind: "mutation",
|
|
18117
18165
|
auth: "admin"
|
|
18166
|
+
}), method(object({ deviceId: number() }), DiskReconcileCountsSchema, {
|
|
18167
|
+
kind: "mutation",
|
|
18168
|
+
auth: "admin"
|
|
18118
18169
|
}), method(object({
|
|
18119
18170
|
deviceId: number(),
|
|
18120
18171
|
trackIds: array(string()).min(1)
|
|
@@ -19665,6 +19716,24 @@ var CameraStatusDegradationSchema = object({
|
|
|
19665
19716
|
*
|
|
19666
19717
|
* See spec: `docs/superpowers/specs/2026-06-24-camera-status-aggregator-cap.md`
|
|
19667
19718
|
*/
|
|
19719
|
+
var DiskReconcileJobSchema = object({
|
|
19720
|
+
state: _enum([
|
|
19721
|
+
"idle",
|
|
19722
|
+
"running",
|
|
19723
|
+
"done",
|
|
19724
|
+
"error"
|
|
19725
|
+
]),
|
|
19726
|
+
total: number().int().nonnegative(),
|
|
19727
|
+
completed: number().int().nonnegative(),
|
|
19728
|
+
currentDeviceId: number().int().nullable(),
|
|
19729
|
+
failed: array(number().int()).readonly(),
|
|
19730
|
+
mediaDropped: number().int().nonnegative(),
|
|
19731
|
+
tracks: number().int().nonnegative(),
|
|
19732
|
+
events: number().int().nonnegative(),
|
|
19733
|
+
startedAtMs: number().int().nullable(),
|
|
19734
|
+
finishedAtMs: number().int().nullable(),
|
|
19735
|
+
error: string().nullable()
|
|
19736
|
+
});
|
|
19668
19737
|
var CameraStatusSchema = object({
|
|
19669
19738
|
deviceId: number(),
|
|
19670
19739
|
assignment: CameraAssignmentStatusSchema,
|
|
@@ -19896,7 +19965,10 @@ method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
|
|
|
19896
19965
|
}), CameraSwitchGroupSchema, {
|
|
19897
19966
|
kind: "mutation",
|
|
19898
19967
|
auth: "admin"
|
|
19899
|
-
}), method(object({ deviceId: number() }), CameraStatusSchema), method(object({ deviceIds: array(number()).optional() }), array(CameraStatusSchema).readonly()), method(_void(),
|
|
19968
|
+
}), method(object({ deviceId: number() }), CameraStatusSchema), method(object({ deviceIds: array(number()).optional() }), array(CameraStatusSchema).readonly()), method(_void(), DiskReconcileJobSchema, {
|
|
19969
|
+
kind: "mutation",
|
|
19970
|
+
auth: "admin"
|
|
19971
|
+
}), method(_void(), DiskReconcileJobSchema, { auth: "admin" }), method(_void(), array(PipelineTemplateSchema).readonly()), method(object({
|
|
19900
19972
|
name: string(),
|
|
19901
19973
|
description: string().optional(),
|
|
19902
19974
|
config: CameraPipelineConfigSchema
|
|
@@ -20301,7 +20373,14 @@ targets: array(object({
|
|
|
20301
20373
|
"sleeping",
|
|
20302
20374
|
"unreachable",
|
|
20303
20375
|
"waking"
|
|
20304
|
-
]).nullable()
|
|
20376
|
+
]).nullable(),
|
|
20377
|
+
/** A battery camera (whatever its current state). An AWAKE battery
|
|
20378
|
+
* camera is deliberately NOT recaptured on the poll cadence — every
|
|
20379
|
+
* capture is a camera hit that would keep it out of sleep — so its
|
|
20380
|
+
* cached frame legitimately ages past the currency ceiling while
|
|
20381
|
+
* nothing is streaming. A surface must keep painting it (a fresh
|
|
20382
|
+
* frame is captured at each wake), not blank to "unavailable". */
|
|
20383
|
+
battery: boolean()
|
|
20305
20384
|
})));
|
|
20306
20385
|
/**
|
|
20307
20386
|
* `sso-bridge` — internal hub-only cap that lets SSO-style auth
|
|
@@ -20962,20 +21041,6 @@ var VectorStatsResultSchema = object({
|
|
|
20962
21041
|
exact: boolean()
|
|
20963
21042
|
});
|
|
20964
21043
|
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);
|
|
20965
|
-
/**
|
|
20966
|
-
* `videoclips` — the unified, navigable-clip surface for a camera.
|
|
20967
|
-
*
|
|
20968
|
-
* A device-scoped WRAPPER cap (like `pipeline-analytics`): exactly one active
|
|
20969
|
-
* provider per device, substitutable. The DEFAULT provider (registered by
|
|
20970
|
-
* `addon-post-analysis`, `defaultActive: true`) composes the analytics event
|
|
20971
|
-
* log (markers + thumbnails) with the recorder's `getPlaybackManifest` — a clip
|
|
20972
|
-
* is a time-WINDOW over existing footage, never a separate file. A camera that
|
|
20973
|
-
* exposes NATIVE onboard clips (Reolink/Hikvision NVR) can later substitute the
|
|
20974
|
-
* wrapper provider for its device and serve its own clip catalog + URLs.
|
|
20975
|
-
*
|
|
20976
|
-
* A `Clip` is purely time-based (subtree-blind): playback resolves segments by
|
|
20977
|
-
* temporal overlap, so the API never decides `continuous` vs `events`.
|
|
20978
|
-
*/
|
|
20979
21044
|
var ClipSchema = object({
|
|
20980
21045
|
/** Opaque, provider-namespaced id. The default provider encodes the time
|
|
20981
21046
|
* window so `getClipPlayback` is self-contained (no event re-query). */
|
|
@@ -20992,8 +21057,57 @@ var ClipSchema = object({
|
|
|
20992
21057
|
startMs: number(),
|
|
20993
21058
|
endMs: number()
|
|
20994
21059
|
}),
|
|
20995
|
-
/**
|
|
20996
|
-
thumbnail
|
|
21060
|
+
/**
|
|
21061
|
+
* Lazy thumbnail URL, never inlined.
|
|
21062
|
+
*
|
|
21063
|
+
* Recording-derived clips (events-mode keep-window, and the prepared
|
|
21064
|
+
* continuous event+fragment visit) MUST use the snapshot of the **main
|
|
21065
|
+
* event of the interval** — `getEventMedia({ eventId, kind: 'snapshot' })`
|
|
21066
|
+
* of the event that owns `kind` (object > motion > audio). Do not extract
|
|
21067
|
+
* a keyframe from the recorded segments. Other providers (onboard, HKSV)
|
|
21068
|
+
* mint their own stills.
|
|
21069
|
+
*
|
|
21070
|
+
* **VOUCHED, never fabricated.** A provider emits this only for an event it
|
|
21071
|
+
* has CONFIRMED owns at least one media row (its own, or its owning track's).
|
|
21072
|
+
* Absent is meaningful — "this visit has no event still" — never "we did not
|
|
21073
|
+
* look". Stamping it from a URL template made 35% of one camera's clips point
|
|
21074
|
+
* at a 404 (device 3836, 2026-08-17: 64 of 179 clips dead, 63 of them motion).
|
|
21075
|
+
* A read that FAILS drops the claim; it never invents it.
|
|
21076
|
+
*/
|
|
21077
|
+
thumbnail: string().optional(),
|
|
21078
|
+
/**
|
|
21079
|
+
* An instant INSIDE this visit's footage, hole-safe, where a recorded still
|
|
21080
|
+
* can be decoded. Present whenever the visit came from recorded availability;
|
|
21081
|
+
* absent on a per-event padded window (there is no footage to promise).
|
|
21082
|
+
*
|
|
21083
|
+
* This is not a thumbnail and not a second byte path: it is the argument to
|
|
21084
|
+
* the recorder's existing still route. The surface — never the provider —
|
|
21085
|
+
* decides whether to use it. It is the midpoint of the visit's LONGEST
|
|
21086
|
+
* contiguous range, not of the visit: a visit spans its holes by
|
|
21087
|
+
* construction, so a naive midpoint lands in dead air.
|
|
21088
|
+
*/
|
|
21089
|
+
stillAtMs: number().optional(),
|
|
21090
|
+
/**
|
|
21091
|
+
* Analytics event ids that overlap this visit — a BOUNDED sample, newest
|
|
21092
|
+
* first within kind (object → motion → audio), capped at
|
|
21093
|
+
* {@link MAX_CLIP_EVENT_IDS}. Empty on footage-only clips.
|
|
21094
|
+
*
|
|
21095
|
+
* Bounded because it is not a payload the surface pages through: one visit on
|
|
21096
|
+
* device 615 carried 2 345 ids, and `eventIds` was 99% of a 153 KB
|
|
21097
|
+
* camera-day. Read {@link eventCount} for the true total.
|
|
21098
|
+
*/
|
|
21099
|
+
eventIds: array(string()).optional(),
|
|
21100
|
+
/** How many analytics events actually overlap this visit. Differs from
|
|
21101
|
+
* `eventIds.length` exactly when the sample was capped — so a truncated
|
|
21102
|
+
* list is never mistaken for a quiet visit. */
|
|
21103
|
+
eventCount: number().int().nonnegative().optional(),
|
|
21104
|
+
/** Intra-visit footage holes (GOP rolls, discarded segments) still shorter
|
|
21105
|
+
* than `VISIT_MERGE_GAP_MS`. Playback concatenates around them; the timeline
|
|
21106
|
+
* bar keeps showing them via `recording.getAvailability`. */
|
|
21107
|
+
holes: array(object({
|
|
21108
|
+
startMs: number(),
|
|
21109
|
+
endMs: number()
|
|
21110
|
+
})).optional()
|
|
20997
21111
|
});
|
|
20998
21112
|
var ClipPlaybackSchema = object({
|
|
20999
21113
|
/** HLS master URL through the hub data-plane (Range + token in path). */
|
|
@@ -21457,7 +21571,14 @@ var SearchResultSchema = object({
|
|
|
21457
21571
|
});
|
|
21458
21572
|
var AutoUpdateSettingsSchema = object({
|
|
21459
21573
|
channel: ChannelSchema,
|
|
21460
|
-
intervalSeconds: number()
|
|
21574
|
+
intervalSeconds: number(),
|
|
21575
|
+
/**
|
|
21576
|
+
* Cadence of the "an update exists" POLLER, in seconds. Independent of
|
|
21577
|
+
* `channel`: the poller runs while auto-apply is `off`, because being told
|
|
21578
|
+
* about a publish and installing it are different decisions. Clamped
|
|
21579
|
+
* server-side to 900 s … 604800 s; defaults to 21600 s (6 h).
|
|
21580
|
+
*/
|
|
21581
|
+
updateCheckIntervalSeconds: number()
|
|
21461
21582
|
});
|
|
21462
21583
|
var AddonAutoUpdateSchema = ChannelWithInheritSchema;
|
|
21463
21584
|
var RestartAddonResultSchema = unknown();
|
|
@@ -21598,7 +21719,9 @@ method(_void(), array(AddonListItemSchema).readonly()), method(object({
|
|
|
21598
21719
|
auth: "admin"
|
|
21599
21720
|
}), method(_void(), AutoUpdateSettingsSchema, { auth: "admin" }), method(object({
|
|
21600
21721
|
channel: ChannelSchema,
|
|
21601
|
-
intervalSeconds: number().min(300).max(86400).optional()
|
|
21722
|
+
intervalSeconds: number().min(300).max(86400).optional(),
|
|
21723
|
+
/** Availability-poll cadence; see AutoUpdateSettingsSchema. */
|
|
21724
|
+
updateCheckIntervalSeconds: number().min(900).max(604800).optional()
|
|
21602
21725
|
}), unknown(), {
|
|
21603
21726
|
kind: "mutation",
|
|
21604
21727
|
auth: "admin"
|
|
@@ -27287,7 +27410,9 @@ var ExportOptionsSchema = object({
|
|
|
27287
27410
|
includeAudio: boolean(),
|
|
27288
27411
|
maxLifeMs: number().int().positive(),
|
|
27289
27412
|
deleteAfterDownload: boolean(),
|
|
27290
|
-
title: string().max(200).optional()
|
|
27413
|
+
title: string().max(200).optional(),
|
|
27414
|
+
/** Notification-output target ids to ping when this export becomes ready. */
|
|
27415
|
+
notifyTargetIds: array(string().min(1)).max(20).optional()
|
|
27291
27416
|
}).superRefine((v, ctx) => {
|
|
27292
27417
|
if (v.speed !== void 0 && v.timelapse !== void 0) ctx.addIssue({
|
|
27293
27418
|
code: ZodIssueCode.custom,
|
|
@@ -27346,10 +27471,18 @@ var ExportBytesSchema = object({
|
|
|
27346
27471
|
});
|
|
27347
27472
|
method(object({
|
|
27348
27473
|
deviceId: number(),
|
|
27349
|
-
|
|
27474
|
+
/** @deprecated Prefer `profiles`. Kept so timelapse/notifiers keep working. */
|
|
27475
|
+
profile: string().optional(),
|
|
27476
|
+
profiles: array(string()).min(1).optional(),
|
|
27350
27477
|
fromMs: number(),
|
|
27351
27478
|
toMs: number(),
|
|
27352
27479
|
options: ExportOptionsSchema
|
|
27480
|
+
}).superRefine((v, ctx) => {
|
|
27481
|
+
if ((v.profiles !== void 0 && v.profiles.length > 0 ? v.profiles : v.profile !== void 0 ? [v.profile] : []).length < 1) ctx.addIssue({
|
|
27482
|
+
code: ZodIssueCode.custom,
|
|
27483
|
+
message: "pass profiles[] (min 1) or legacy profile",
|
|
27484
|
+
path: ["profiles"]
|
|
27485
|
+
});
|
|
27353
27486
|
}), ExportRecordSchema, {
|
|
27354
27487
|
kind: "mutation",
|
|
27355
27488
|
auth: "protected"
|
|
@@ -30291,15 +30424,6 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
30291
30424
|
labels: ["probe not implemented"]
|
|
30292
30425
|
};
|
|
30293
30426
|
}
|
|
30294
|
-
/**
|
|
30295
|
-
* Top-level devices restored at once in {@link onRestoreDevices}.
|
|
30296
|
-
*
|
|
30297
|
-
* Four covers the fleets this ships to without turning a boot into a burst a
|
|
30298
|
-
* camera NVR answers with a refusal. A provider whose upstream is a single
|
|
30299
|
-
* session with a serial command channel (a Baichuan hub, an NVR that
|
|
30300
|
-
* serialises ISAPI) should lower it; nothing needs to raise it.
|
|
30301
|
-
*/
|
|
30302
|
-
restoreConcurrency = 4;
|
|
30303
30427
|
async restoreDevices(savedDevices) {
|
|
30304
30428
|
await this.onRestoreDevices(savedDevices);
|
|
30305
30429
|
if (savedDevices.length > 0) this.ctx.logger.info(`Restored ${savedDevices.length} ${this.providerName} device(s)`);
|
|
@@ -30354,14 +30478,7 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
30354
30478
|
});
|
|
30355
30479
|
}
|
|
30356
30480
|
};
|
|
30357
|
-
|
|
30358
|
-
await Promise.all(Array.from({ length: Math.min(Math.max(1, this.restoreConcurrency), topLevel.length) }, async () => {
|
|
30359
|
-
for (;;) {
|
|
30360
|
-
const saved = topLevel[nextTopLevel++];
|
|
30361
|
-
if (saved === void 0) return;
|
|
30362
|
-
await restoreOne(saved);
|
|
30363
|
-
}
|
|
30364
|
-
}));
|
|
30481
|
+
await Promise.all(topLevel.map((saved) => restoreOne(saved)));
|
|
30365
30482
|
const childRows = savedDevices.filter((s) => s.parentDeviceId !== null);
|
|
30366
30483
|
for (const saved of childRows) {
|
|
30367
30484
|
const Class = this.deviceClasses[saved.type];
|
|
@@ -33634,6 +33751,12 @@ Object.freeze({
|
|
|
33634
33751
|
addonId: null,
|
|
33635
33752
|
access: "create"
|
|
33636
33753
|
},
|
|
33754
|
+
"pipelineAnalytics.reconcileFromDisk": {
|
|
33755
|
+
capName: "pipeline-analytics",
|
|
33756
|
+
capScope: "device",
|
|
33757
|
+
addonId: null,
|
|
33758
|
+
access: "create"
|
|
33759
|
+
},
|
|
33637
33760
|
"pipelineAnalytics.refreshStorageLocationsForMigration": {
|
|
33638
33761
|
capName: "pipeline-analytics",
|
|
33639
33762
|
capScope: "device",
|
|
@@ -34036,6 +34159,12 @@ Object.freeze({
|
|
|
34036
34159
|
addonId: null,
|
|
34037
34160
|
access: "view"
|
|
34038
34161
|
},
|
|
34162
|
+
"pipelineOrchestrator.getReconcileFromDiskStatus": {
|
|
34163
|
+
capName: "pipeline-orchestrator",
|
|
34164
|
+
capScope: "system",
|
|
34165
|
+
addonId: null,
|
|
34166
|
+
access: "view"
|
|
34167
|
+
},
|
|
34039
34168
|
"pipelineOrchestrator.listAgentSettings": {
|
|
34040
34169
|
capName: "pipeline-orchestrator",
|
|
34041
34170
|
capScope: "system",
|
|
@@ -34060,6 +34189,12 @@ Object.freeze({
|
|
|
34060
34189
|
addonId: null,
|
|
34061
34190
|
access: "create"
|
|
34062
34191
|
},
|
|
34192
|
+
"pipelineOrchestrator.reconcileFromDisk": {
|
|
34193
|
+
capName: "pipeline-orchestrator",
|
|
34194
|
+
capScope: "system",
|
|
34195
|
+
addonId: null,
|
|
34196
|
+
access: "create"
|
|
34197
|
+
},
|
|
34063
34198
|
"pipelineOrchestrator.removeAgentSettings": {
|
|
34064
34199
|
capName: "pipeline-orchestrator",
|
|
34065
34200
|
capScope: "system",
|
|
@@ -37051,6 +37186,11 @@ Object.freeze({
|
|
|
37051
37186
|
form: "single",
|
|
37052
37187
|
optional: true
|
|
37053
37188
|
}],
|
|
37189
|
+
"pipelineAnalytics.reconcileFromDisk": [{
|
|
37190
|
+
name: "deviceId",
|
|
37191
|
+
form: "single",
|
|
37192
|
+
optional: false
|
|
37193
|
+
}],
|
|
37054
37194
|
"pipelineAnalytics.restageRetrainTrack": [{
|
|
37055
37195
|
name: "deviceId",
|
|
37056
37196
|
form: "single",
|
|
@@ -38116,6 +38256,8 @@ DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
|
|
|
38116
38256
|
DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
|
|
38117
38257
|
DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
|
|
38118
38258
|
DEFAULT_NATIVE_LEASE_SETTINGS.admission;
|
|
38259
|
+
var MB = 1024 * 1024;
|
|
38260
|
+
1024 * MB, 3072 * MB;
|
|
38119
38261
|
//#endregion
|
|
38120
38262
|
//#region src/config.ts
|
|
38121
38263
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/addon-provider-tuya",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.21",
|
|
4
4
|
"description": "Tuya / Smart Life device-provider addon for CamStack — account-onboarded (Tuya IoT cloud fetch of device localKeys) + LOCAL DP control via the @apocaliss92/nodetuya encrypted-LAN client, exposing switch / water-heater-family kettle entities",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|