@camstack/addon-provider-rtsp 1.1.25 → 1.1.26
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 +202 -7
- package/dist/addon.mjs +202 -7
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -23,7 +23,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
23
23
|
//#endregion
|
|
24
24
|
let node_net = require("node:net");
|
|
25
25
|
node_net = __toESM(node_net);
|
|
26
|
-
//#region ../types/dist/event-category-
|
|
26
|
+
//#region ../types/dist/event-category-D4HJq7Mw.mjs
|
|
27
27
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
28
28
|
EventCategory["SystemBoot"] = "system.boot";
|
|
29
29
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -176,6 +176,11 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
176
176
|
/** Runner-sampled scrub thumbnail (~1/5 s/camera). Telemetry (D8): a lost
|
|
177
177
|
* thumb is a scrub gap the recorder's keyframe backfill covers. */
|
|
178
178
|
EventCategory["RecordingThumbSampled"] = "recording.thumb-sampled";
|
|
179
|
+
/** Export render progress (0–100). Telemetry (D8): a lost tick is a stale
|
|
180
|
+
* progress bar the client reconciles via `recordingExport.getExport`. */
|
|
181
|
+
EventCategory["RecordingExportProgress"] = "recording.export.progress";
|
|
182
|
+
EventCategory["RecordingExportCompleted"] = "recording.export.completed";
|
|
183
|
+
EventCategory["RecordingExportFailed"] = "recording.export.failed";
|
|
179
184
|
EventCategory["DetectionEvent"] = "detection.event";
|
|
180
185
|
EventCategory["SessionTrackNew"] = "session.track.new";
|
|
181
186
|
EventCategory["SessionTrackExpired"] = "session.track.expired";
|
|
@@ -465,6 +470,25 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
465
470
|
*/
|
|
466
471
|
EventCategory["PipelineAnalyticsStationaryChanged"] = "pipeline-analytics.stationary-changed";
|
|
467
472
|
/**
|
|
473
|
+
* Fired by `addon-post-analysis` when a package-drop is confirmed inside
|
|
474
|
+
* a package zone — a newly-appeared stationary object of a package class
|
|
475
|
+
* that cleared the class / zone / dwell / size gates. Payload:
|
|
476
|
+
* `PipelineAnalyticsPackageDeliveredPayload` carrying `{ deviceId,
|
|
477
|
+
* entryId, className, zoneIds, keyFrameMediaKey?, bbox, timestamp }`.
|
|
478
|
+
* Telemetry (D8): the durable record is the `package-events` store row;
|
|
479
|
+
* this bus topic drives notifier rules + live UI. See
|
|
480
|
+
* docs/superpowers/specs/2026-07-17-package-zones-design.md §5.1.
|
|
481
|
+
*/
|
|
482
|
+
EventCategory["PipelineAnalyticsPackageDelivered"] = "pipeline-analytics.package-delivered";
|
|
483
|
+
/**
|
|
484
|
+
* Fired by `addon-post-analysis` when a previously-delivered package
|
|
485
|
+
* leaves its zone (the stationary entry departed — moved or swept).
|
|
486
|
+
* Payload: `PipelineAnalyticsPackagePickedUpPayload` carrying
|
|
487
|
+
* `{ deviceId, entryId, deliveredEventId, className, timestamp }`.
|
|
488
|
+
* Telemetry (D8). See package-zones-design §5.2.
|
|
489
|
+
*/
|
|
490
|
+
EventCategory["PipelineAnalyticsPackagePickedUp"] = "pipeline-analytics.package-picked-up";
|
|
491
|
+
/**
|
|
468
492
|
* Fired by `addon-post-analysis` whenever a gallery face row changes:
|
|
469
493
|
* `kind:'buffered'` a new detected face was persisted, `'assigned'` /
|
|
470
494
|
* `'unassigned'` its identity link changed, `'deleted'` the row was
|
|
@@ -5217,6 +5241,25 @@ function preprocess(fn, schema) {
|
|
|
5217
5241
|
out: schema
|
|
5218
5242
|
});
|
|
5219
5243
|
}
|
|
5244
|
+
//#endregion
|
|
5245
|
+
//#region ../../node_modules/zod/v4/classic/compat.js
|
|
5246
|
+
/** @deprecated Use the raw string literal codes instead, e.g. "invalid_type". */
|
|
5247
|
+
var ZodIssueCode = {
|
|
5248
|
+
invalid_type: "invalid_type",
|
|
5249
|
+
too_big: "too_big",
|
|
5250
|
+
too_small: "too_small",
|
|
5251
|
+
invalid_format: "invalid_format",
|
|
5252
|
+
not_multiple_of: "not_multiple_of",
|
|
5253
|
+
unrecognized_keys: "unrecognized_keys",
|
|
5254
|
+
invalid_union: "invalid_union",
|
|
5255
|
+
invalid_key: "invalid_key",
|
|
5256
|
+
invalid_element: "invalid_element",
|
|
5257
|
+
invalid_value: "invalid_value",
|
|
5258
|
+
custom: "custom"
|
|
5259
|
+
};
|
|
5260
|
+
/** @deprecated Do not use. Stub definition, only included for zod-to-json-schema compatibility. */
|
|
5261
|
+
var ZodFirstPartyTypeKind;
|
|
5262
|
+
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5220
5263
|
Object.fromEntries([
|
|
5221
5264
|
{
|
|
5222
5265
|
id: "overview",
|
|
@@ -14780,7 +14823,11 @@ array(ZoneRuleSchema).readonly();
|
|
|
14780
14823
|
* Extend the enum here when a new gating consumer comes online (audio
|
|
14781
14824
|
* gating, alert filtering, …) — no other surface needs to change.
|
|
14782
14825
|
*/
|
|
14783
|
-
var ZoneRuleStageEnum = _enum([
|
|
14826
|
+
var ZoneRuleStageEnum = _enum([
|
|
14827
|
+
"motion",
|
|
14828
|
+
"detection",
|
|
14829
|
+
"package"
|
|
14830
|
+
]);
|
|
14784
14831
|
/**
|
|
14785
14832
|
* Runtime registry: cap-property-name → cap definition. `BaseDevice`'s
|
|
14786
14833
|
* `state` getter looks up the cap definition here to construct a
|
|
@@ -14874,16 +14921,24 @@ var DEVICE_LOCAL_STATE_CAPS = {
|
|
|
14874
14921
|
})
|
|
14875
14922
|
},
|
|
14876
14923
|
/**
|
|
14877
|
-
* Runtime-state slice —
|
|
14924
|
+
* Runtime-state slice — every stage mirrored together so consumers
|
|
14878
14925
|
* see one reactive handle (`device.state.zoneRules.value`) instead
|
|
14879
|
-
* of
|
|
14880
|
-
* `{motion, detection}` shape, so subscribers always get the
|
|
14926
|
+
* of one per stage. Bulk-replace mutations on any stage write the full
|
|
14927
|
+
* `{motion, detection, package}` shape, so subscribers always get the
|
|
14881
14928
|
* complete current set. Consumers that only care about one stage
|
|
14882
14929
|
* just read the matching property.
|
|
14930
|
+
*
|
|
14931
|
+
* `package` backs the package-drop detector — a package zone is a
|
|
14932
|
+
* `ZoneRule` on the `'package'` stage referencing drawn polygons
|
|
14933
|
+
* (see docs/superpowers/specs/2026-07-17-package-zones-design.md §3.1).
|
|
14934
|
+
* The orchestrator provider that writes this stage lands in a later
|
|
14935
|
+
* slice; until then the mirror carries only `{motion, detection}` and
|
|
14936
|
+
* consumers read `package` as absent (treat as `[]`).
|
|
14883
14937
|
*/
|
|
14884
14938
|
runtimeState: object({
|
|
14885
14939
|
motion: array(ZoneRuleSchema).readonly(),
|
|
14886
|
-
detection: array(ZoneRuleSchema).readonly()
|
|
14940
|
+
detection: array(ZoneRuleSchema).readonly(),
|
|
14941
|
+
package: array(ZoneRuleSchema).readonly()
|
|
14887
14942
|
})
|
|
14888
14943
|
},
|
|
14889
14944
|
zones: zonesCapability
|
|
@@ -18845,6 +18900,7 @@ var EventKindIconSchema = _enum([
|
|
|
18845
18900
|
"smoke",
|
|
18846
18901
|
"water",
|
|
18847
18902
|
"button",
|
|
18903
|
+
"package",
|
|
18848
18904
|
"generic"
|
|
18849
18905
|
]);
|
|
18850
18906
|
var EventKindCategorySchema = _enum([
|
|
@@ -18852,7 +18908,8 @@ var EventKindCategorySchema = _enum([
|
|
|
18852
18908
|
"audio",
|
|
18853
18909
|
"detection",
|
|
18854
18910
|
"sensor",
|
|
18855
|
-
"custom"
|
|
18911
|
+
"custom",
|
|
18912
|
+
"package"
|
|
18856
18913
|
]);
|
|
18857
18914
|
var EventKindDescriptorSchema = object({
|
|
18858
18915
|
/** Stable kind id (e.g. 'motion', 'person', 'contact'). */
|
|
@@ -22549,6 +22606,108 @@ method(object({
|
|
|
22549
22606
|
auth: "admin"
|
|
22550
22607
|
});
|
|
22551
22608
|
/**
|
|
22609
|
+
* `recordingExport` cap — render a footage time range into a single downloadable
|
|
22610
|
+
* MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
|
|
22611
|
+
* bounded lifetime with a durable history, auto-expiry, and optional
|
|
22612
|
+
* delete-after-download.
|
|
22613
|
+
*
|
|
22614
|
+
* Like `recording` this is a `scope:'system', mode:'singleton'` cap: the
|
|
22615
|
+
* recorder self-gates so exactly ONE node (the designated `recordingNodeId`,
|
|
22616
|
+
* default `hub`) registers it. Device-scoped methods carry `deviceId` in their
|
|
22617
|
+
* input and dispatch to that single provider; the render runs on the node that
|
|
22618
|
+
* owns the footage (no cross-node segment transfer). Download rides the
|
|
22619
|
+
* framework addon data-plane. State persists in a DurableState blob (NOT
|
|
22620
|
+
* SQLite); history rows survive file deletion for audit.
|
|
22621
|
+
*/
|
|
22622
|
+
/** Playback-speed multiplier for the render (1 = realtime). */
|
|
22623
|
+
var ExportSpeedSchema = number().min(.25).max(32);
|
|
22624
|
+
/** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
|
|
22625
|
+
var ExportTimelapseSchema = object({
|
|
22626
|
+
everyMs: number().int().positive(),
|
|
22627
|
+
outputFps: number().int().min(1).max(60).optional()
|
|
22628
|
+
});
|
|
22629
|
+
/**
|
|
22630
|
+
* Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
|
|
22631
|
+
* is honoured only for a realtime-ish speed (0.5–2×); timelapse is always
|
|
22632
|
+
* silent. `maxLifeMs` bounds how long the finished file is kept;
|
|
22633
|
+
* `deleteAfterDownload` removes it shortly after the first complete download.
|
|
22634
|
+
*/
|
|
22635
|
+
var ExportOptionsSchema = object({
|
|
22636
|
+
speed: ExportSpeedSchema.optional(),
|
|
22637
|
+
timelapse: ExportTimelapseSchema.optional(),
|
|
22638
|
+
includeAudio: boolean(),
|
|
22639
|
+
maxLifeMs: number().int().positive(),
|
|
22640
|
+
deleteAfterDownload: boolean(),
|
|
22641
|
+
title: string().max(200).optional()
|
|
22642
|
+
}).superRefine((v, ctx) => {
|
|
22643
|
+
if (v.speed !== void 0 && v.timelapse !== void 0) ctx.addIssue({
|
|
22644
|
+
code: ZodIssueCode.custom,
|
|
22645
|
+
message: "speed and timelapse are mutually exclusive",
|
|
22646
|
+
path: ["timelapse"]
|
|
22647
|
+
});
|
|
22648
|
+
});
|
|
22649
|
+
var ExportStateSchema = _enum([
|
|
22650
|
+
"queued",
|
|
22651
|
+
"rendering",
|
|
22652
|
+
"ready",
|
|
22653
|
+
"failed",
|
|
22654
|
+
"expired",
|
|
22655
|
+
"deleted"
|
|
22656
|
+
]);
|
|
22657
|
+
/** One export job / history row. */
|
|
22658
|
+
var ExportRecordSchema = object({
|
|
22659
|
+
id: string(),
|
|
22660
|
+
deviceId: number(),
|
|
22661
|
+
profile: string(),
|
|
22662
|
+
fromMs: number(),
|
|
22663
|
+
toMs: number(),
|
|
22664
|
+
options: ExportOptionsSchema,
|
|
22665
|
+
state: ExportStateSchema,
|
|
22666
|
+
/** 0–100 while rendering; null otherwise. */
|
|
22667
|
+
progressPct: number().nullable(),
|
|
22668
|
+
/** File size once ready; null before. */
|
|
22669
|
+
fileBytes: number().nullable(),
|
|
22670
|
+
expiresAt: number(),
|
|
22671
|
+
deleteAfterDownload: boolean(),
|
|
22672
|
+
/** Epoch of the first complete download; null until then. */
|
|
22673
|
+
downloadedAt: number().nullable(),
|
|
22674
|
+
createdAt: number(),
|
|
22675
|
+
/** User id/name that requested the export. */
|
|
22676
|
+
createdBy: string(),
|
|
22677
|
+
/** Failure reason when state is 'failed'; null otherwise. */
|
|
22678
|
+
error: string().nullable()
|
|
22679
|
+
});
|
|
22680
|
+
/** Candidate download URLs (LAN first, then operator extra hosts). */
|
|
22681
|
+
var ExportDownloadSchema = object({
|
|
22682
|
+
url: string(),
|
|
22683
|
+
endpoints: array(string())
|
|
22684
|
+
});
|
|
22685
|
+
method(object({
|
|
22686
|
+
deviceId: number(),
|
|
22687
|
+
profile: string(),
|
|
22688
|
+
fromMs: number(),
|
|
22689
|
+
toMs: number(),
|
|
22690
|
+
options: ExportOptionsSchema
|
|
22691
|
+
}), ExportRecordSchema, {
|
|
22692
|
+
kind: "mutation",
|
|
22693
|
+
auth: "protected"
|
|
22694
|
+
}), method(object({ deviceId: number().optional() }), array(ExportRecordSchema), {
|
|
22695
|
+
kind: "query",
|
|
22696
|
+
auth: "protected"
|
|
22697
|
+
}), method(object({ exportId: string() }), ExportRecordSchema, {
|
|
22698
|
+
kind: "query",
|
|
22699
|
+
auth: "protected"
|
|
22700
|
+
}), method(object({ exportId: string() }), ExportRecordSchema, {
|
|
22701
|
+
kind: "mutation",
|
|
22702
|
+
auth: "protected"
|
|
22703
|
+
}), method(object({ exportId: string() }), ExportRecordSchema, {
|
|
22704
|
+
kind: "mutation",
|
|
22705
|
+
auth: "protected"
|
|
22706
|
+
}), method(object({ exportId: string() }), ExportDownloadSchema, {
|
|
22707
|
+
kind: "query",
|
|
22708
|
+
auth: "protected"
|
|
22709
|
+
});
|
|
22710
|
+
/**
|
|
22552
22711
|
* One publishable camera stream as its OWNING PROVIDER describes it — the same
|
|
22553
22712
|
* payload the (legacy) push `streamBroker.publishCameraStream` carried, minus
|
|
22554
22713
|
* `deviceId`.
|
|
@@ -26485,6 +26644,42 @@ Object.freeze({
|
|
|
26485
26644
|
addonId: null,
|
|
26486
26645
|
access: "create"
|
|
26487
26646
|
},
|
|
26647
|
+
"recordingExport.cancelExport": {
|
|
26648
|
+
capName: "recordingExport",
|
|
26649
|
+
capScope: "system",
|
|
26650
|
+
addonId: null,
|
|
26651
|
+
access: "create"
|
|
26652
|
+
},
|
|
26653
|
+
"recordingExport.createExport": {
|
|
26654
|
+
capName: "recordingExport",
|
|
26655
|
+
capScope: "system",
|
|
26656
|
+
addonId: null,
|
|
26657
|
+
access: "create"
|
|
26658
|
+
},
|
|
26659
|
+
"recordingExport.deleteExport": {
|
|
26660
|
+
capName: "recordingExport",
|
|
26661
|
+
capScope: "system",
|
|
26662
|
+
addonId: null,
|
|
26663
|
+
access: "delete"
|
|
26664
|
+
},
|
|
26665
|
+
"recordingExport.getDownloadUrl": {
|
|
26666
|
+
capName: "recordingExport",
|
|
26667
|
+
capScope: "system",
|
|
26668
|
+
addonId: null,
|
|
26669
|
+
access: "view"
|
|
26670
|
+
},
|
|
26671
|
+
"recordingExport.getExport": {
|
|
26672
|
+
capName: "recordingExport",
|
|
26673
|
+
capScope: "system",
|
|
26674
|
+
addonId: null,
|
|
26675
|
+
access: "view"
|
|
26676
|
+
},
|
|
26677
|
+
"recordingExport.listExports": {
|
|
26678
|
+
capName: "recordingExport",
|
|
26679
|
+
capScope: "system",
|
|
26680
|
+
addonId: null,
|
|
26681
|
+
access: "view"
|
|
26682
|
+
},
|
|
26488
26683
|
"sceneMonitor.captureReference": {
|
|
26489
26684
|
capName: "scene-monitor",
|
|
26490
26685
|
capScope: "device",
|
package/dist/addon.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import net from "node:net";
|
|
2
|
-
//#region ../types/dist/event-category-
|
|
2
|
+
//#region ../types/dist/event-category-D4HJq7Mw.mjs
|
|
3
3
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
4
4
|
EventCategory["SystemBoot"] = "system.boot";
|
|
5
5
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -152,6 +152,11 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
152
152
|
/** Runner-sampled scrub thumbnail (~1/5 s/camera). Telemetry (D8): a lost
|
|
153
153
|
* thumb is a scrub gap the recorder's keyframe backfill covers. */
|
|
154
154
|
EventCategory["RecordingThumbSampled"] = "recording.thumb-sampled";
|
|
155
|
+
/** Export render progress (0–100). Telemetry (D8): a lost tick is a stale
|
|
156
|
+
* progress bar the client reconciles via `recordingExport.getExport`. */
|
|
157
|
+
EventCategory["RecordingExportProgress"] = "recording.export.progress";
|
|
158
|
+
EventCategory["RecordingExportCompleted"] = "recording.export.completed";
|
|
159
|
+
EventCategory["RecordingExportFailed"] = "recording.export.failed";
|
|
155
160
|
EventCategory["DetectionEvent"] = "detection.event";
|
|
156
161
|
EventCategory["SessionTrackNew"] = "session.track.new";
|
|
157
162
|
EventCategory["SessionTrackExpired"] = "session.track.expired";
|
|
@@ -441,6 +446,25 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
441
446
|
*/
|
|
442
447
|
EventCategory["PipelineAnalyticsStationaryChanged"] = "pipeline-analytics.stationary-changed";
|
|
443
448
|
/**
|
|
449
|
+
* Fired by `addon-post-analysis` when a package-drop is confirmed inside
|
|
450
|
+
* a package zone — a newly-appeared stationary object of a package class
|
|
451
|
+
* that cleared the class / zone / dwell / size gates. Payload:
|
|
452
|
+
* `PipelineAnalyticsPackageDeliveredPayload` carrying `{ deviceId,
|
|
453
|
+
* entryId, className, zoneIds, keyFrameMediaKey?, bbox, timestamp }`.
|
|
454
|
+
* Telemetry (D8): the durable record is the `package-events` store row;
|
|
455
|
+
* this bus topic drives notifier rules + live UI. See
|
|
456
|
+
* docs/superpowers/specs/2026-07-17-package-zones-design.md §5.1.
|
|
457
|
+
*/
|
|
458
|
+
EventCategory["PipelineAnalyticsPackageDelivered"] = "pipeline-analytics.package-delivered";
|
|
459
|
+
/**
|
|
460
|
+
* Fired by `addon-post-analysis` when a previously-delivered package
|
|
461
|
+
* leaves its zone (the stationary entry departed — moved or swept).
|
|
462
|
+
* Payload: `PipelineAnalyticsPackagePickedUpPayload` carrying
|
|
463
|
+
* `{ deviceId, entryId, deliveredEventId, className, timestamp }`.
|
|
464
|
+
* Telemetry (D8). See package-zones-design §5.2.
|
|
465
|
+
*/
|
|
466
|
+
EventCategory["PipelineAnalyticsPackagePickedUp"] = "pipeline-analytics.package-picked-up";
|
|
467
|
+
/**
|
|
444
468
|
* Fired by `addon-post-analysis` whenever a gallery face row changes:
|
|
445
469
|
* `kind:'buffered'` a new detected face was persisted, `'assigned'` /
|
|
446
470
|
* `'unassigned'` its identity link changed, `'deleted'` the row was
|
|
@@ -5193,6 +5217,25 @@ function preprocess(fn, schema) {
|
|
|
5193
5217
|
out: schema
|
|
5194
5218
|
});
|
|
5195
5219
|
}
|
|
5220
|
+
//#endregion
|
|
5221
|
+
//#region ../../node_modules/zod/v4/classic/compat.js
|
|
5222
|
+
/** @deprecated Use the raw string literal codes instead, e.g. "invalid_type". */
|
|
5223
|
+
var ZodIssueCode = {
|
|
5224
|
+
invalid_type: "invalid_type",
|
|
5225
|
+
too_big: "too_big",
|
|
5226
|
+
too_small: "too_small",
|
|
5227
|
+
invalid_format: "invalid_format",
|
|
5228
|
+
not_multiple_of: "not_multiple_of",
|
|
5229
|
+
unrecognized_keys: "unrecognized_keys",
|
|
5230
|
+
invalid_union: "invalid_union",
|
|
5231
|
+
invalid_key: "invalid_key",
|
|
5232
|
+
invalid_element: "invalid_element",
|
|
5233
|
+
invalid_value: "invalid_value",
|
|
5234
|
+
custom: "custom"
|
|
5235
|
+
};
|
|
5236
|
+
/** @deprecated Do not use. Stub definition, only included for zod-to-json-schema compatibility. */
|
|
5237
|
+
var ZodFirstPartyTypeKind;
|
|
5238
|
+
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5196
5239
|
Object.fromEntries([
|
|
5197
5240
|
{
|
|
5198
5241
|
id: "overview",
|
|
@@ -14756,7 +14799,11 @@ array(ZoneRuleSchema).readonly();
|
|
|
14756
14799
|
* Extend the enum here when a new gating consumer comes online (audio
|
|
14757
14800
|
* gating, alert filtering, …) — no other surface needs to change.
|
|
14758
14801
|
*/
|
|
14759
|
-
var ZoneRuleStageEnum = _enum([
|
|
14802
|
+
var ZoneRuleStageEnum = _enum([
|
|
14803
|
+
"motion",
|
|
14804
|
+
"detection",
|
|
14805
|
+
"package"
|
|
14806
|
+
]);
|
|
14760
14807
|
/**
|
|
14761
14808
|
* Runtime registry: cap-property-name → cap definition. `BaseDevice`'s
|
|
14762
14809
|
* `state` getter looks up the cap definition here to construct a
|
|
@@ -14850,16 +14897,24 @@ var DEVICE_LOCAL_STATE_CAPS = {
|
|
|
14850
14897
|
})
|
|
14851
14898
|
},
|
|
14852
14899
|
/**
|
|
14853
|
-
* Runtime-state slice —
|
|
14900
|
+
* Runtime-state slice — every stage mirrored together so consumers
|
|
14854
14901
|
* see one reactive handle (`device.state.zoneRules.value`) instead
|
|
14855
|
-
* of
|
|
14856
|
-
* `{motion, detection}` shape, so subscribers always get the
|
|
14902
|
+
* of one per stage. Bulk-replace mutations on any stage write the full
|
|
14903
|
+
* `{motion, detection, package}` shape, so subscribers always get the
|
|
14857
14904
|
* complete current set. Consumers that only care about one stage
|
|
14858
14905
|
* just read the matching property.
|
|
14906
|
+
*
|
|
14907
|
+
* `package` backs the package-drop detector — a package zone is a
|
|
14908
|
+
* `ZoneRule` on the `'package'` stage referencing drawn polygons
|
|
14909
|
+
* (see docs/superpowers/specs/2026-07-17-package-zones-design.md §3.1).
|
|
14910
|
+
* The orchestrator provider that writes this stage lands in a later
|
|
14911
|
+
* slice; until then the mirror carries only `{motion, detection}` and
|
|
14912
|
+
* consumers read `package` as absent (treat as `[]`).
|
|
14859
14913
|
*/
|
|
14860
14914
|
runtimeState: object({
|
|
14861
14915
|
motion: array(ZoneRuleSchema).readonly(),
|
|
14862
|
-
detection: array(ZoneRuleSchema).readonly()
|
|
14916
|
+
detection: array(ZoneRuleSchema).readonly(),
|
|
14917
|
+
package: array(ZoneRuleSchema).readonly()
|
|
14863
14918
|
})
|
|
14864
14919
|
},
|
|
14865
14920
|
zones: zonesCapability
|
|
@@ -18821,6 +18876,7 @@ var EventKindIconSchema = _enum([
|
|
|
18821
18876
|
"smoke",
|
|
18822
18877
|
"water",
|
|
18823
18878
|
"button",
|
|
18879
|
+
"package",
|
|
18824
18880
|
"generic"
|
|
18825
18881
|
]);
|
|
18826
18882
|
var EventKindCategorySchema = _enum([
|
|
@@ -18828,7 +18884,8 @@ var EventKindCategorySchema = _enum([
|
|
|
18828
18884
|
"audio",
|
|
18829
18885
|
"detection",
|
|
18830
18886
|
"sensor",
|
|
18831
|
-
"custom"
|
|
18887
|
+
"custom",
|
|
18888
|
+
"package"
|
|
18832
18889
|
]);
|
|
18833
18890
|
var EventKindDescriptorSchema = object({
|
|
18834
18891
|
/** Stable kind id (e.g. 'motion', 'person', 'contact'). */
|
|
@@ -22525,6 +22582,108 @@ method(object({
|
|
|
22525
22582
|
auth: "admin"
|
|
22526
22583
|
});
|
|
22527
22584
|
/**
|
|
22585
|
+
* `recordingExport` cap — render a footage time range into a single downloadable
|
|
22586
|
+
* MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
|
|
22587
|
+
* bounded lifetime with a durable history, auto-expiry, and optional
|
|
22588
|
+
* delete-after-download.
|
|
22589
|
+
*
|
|
22590
|
+
* Like `recording` this is a `scope:'system', mode:'singleton'` cap: the
|
|
22591
|
+
* recorder self-gates so exactly ONE node (the designated `recordingNodeId`,
|
|
22592
|
+
* default `hub`) registers it. Device-scoped methods carry `deviceId` in their
|
|
22593
|
+
* input and dispatch to that single provider; the render runs on the node that
|
|
22594
|
+
* owns the footage (no cross-node segment transfer). Download rides the
|
|
22595
|
+
* framework addon data-plane. State persists in a DurableState blob (NOT
|
|
22596
|
+
* SQLite); history rows survive file deletion for audit.
|
|
22597
|
+
*/
|
|
22598
|
+
/** Playback-speed multiplier for the render (1 = realtime). */
|
|
22599
|
+
var ExportSpeedSchema = number().min(.25).max(32);
|
|
22600
|
+
/** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
|
|
22601
|
+
var ExportTimelapseSchema = object({
|
|
22602
|
+
everyMs: number().int().positive(),
|
|
22603
|
+
outputFps: number().int().min(1).max(60).optional()
|
|
22604
|
+
});
|
|
22605
|
+
/**
|
|
22606
|
+
* Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
|
|
22607
|
+
* is honoured only for a realtime-ish speed (0.5–2×); timelapse is always
|
|
22608
|
+
* silent. `maxLifeMs` bounds how long the finished file is kept;
|
|
22609
|
+
* `deleteAfterDownload` removes it shortly after the first complete download.
|
|
22610
|
+
*/
|
|
22611
|
+
var ExportOptionsSchema = object({
|
|
22612
|
+
speed: ExportSpeedSchema.optional(),
|
|
22613
|
+
timelapse: ExportTimelapseSchema.optional(),
|
|
22614
|
+
includeAudio: boolean(),
|
|
22615
|
+
maxLifeMs: number().int().positive(),
|
|
22616
|
+
deleteAfterDownload: boolean(),
|
|
22617
|
+
title: string().max(200).optional()
|
|
22618
|
+
}).superRefine((v, ctx) => {
|
|
22619
|
+
if (v.speed !== void 0 && v.timelapse !== void 0) ctx.addIssue({
|
|
22620
|
+
code: ZodIssueCode.custom,
|
|
22621
|
+
message: "speed and timelapse are mutually exclusive",
|
|
22622
|
+
path: ["timelapse"]
|
|
22623
|
+
});
|
|
22624
|
+
});
|
|
22625
|
+
var ExportStateSchema = _enum([
|
|
22626
|
+
"queued",
|
|
22627
|
+
"rendering",
|
|
22628
|
+
"ready",
|
|
22629
|
+
"failed",
|
|
22630
|
+
"expired",
|
|
22631
|
+
"deleted"
|
|
22632
|
+
]);
|
|
22633
|
+
/** One export job / history row. */
|
|
22634
|
+
var ExportRecordSchema = object({
|
|
22635
|
+
id: string(),
|
|
22636
|
+
deviceId: number(),
|
|
22637
|
+
profile: string(),
|
|
22638
|
+
fromMs: number(),
|
|
22639
|
+
toMs: number(),
|
|
22640
|
+
options: ExportOptionsSchema,
|
|
22641
|
+
state: ExportStateSchema,
|
|
22642
|
+
/** 0–100 while rendering; null otherwise. */
|
|
22643
|
+
progressPct: number().nullable(),
|
|
22644
|
+
/** File size once ready; null before. */
|
|
22645
|
+
fileBytes: number().nullable(),
|
|
22646
|
+
expiresAt: number(),
|
|
22647
|
+
deleteAfterDownload: boolean(),
|
|
22648
|
+
/** Epoch of the first complete download; null until then. */
|
|
22649
|
+
downloadedAt: number().nullable(),
|
|
22650
|
+
createdAt: number(),
|
|
22651
|
+
/** User id/name that requested the export. */
|
|
22652
|
+
createdBy: string(),
|
|
22653
|
+
/** Failure reason when state is 'failed'; null otherwise. */
|
|
22654
|
+
error: string().nullable()
|
|
22655
|
+
});
|
|
22656
|
+
/** Candidate download URLs (LAN first, then operator extra hosts). */
|
|
22657
|
+
var ExportDownloadSchema = object({
|
|
22658
|
+
url: string(),
|
|
22659
|
+
endpoints: array(string())
|
|
22660
|
+
});
|
|
22661
|
+
method(object({
|
|
22662
|
+
deviceId: number(),
|
|
22663
|
+
profile: string(),
|
|
22664
|
+
fromMs: number(),
|
|
22665
|
+
toMs: number(),
|
|
22666
|
+
options: ExportOptionsSchema
|
|
22667
|
+
}), ExportRecordSchema, {
|
|
22668
|
+
kind: "mutation",
|
|
22669
|
+
auth: "protected"
|
|
22670
|
+
}), method(object({ deviceId: number().optional() }), array(ExportRecordSchema), {
|
|
22671
|
+
kind: "query",
|
|
22672
|
+
auth: "protected"
|
|
22673
|
+
}), method(object({ exportId: string() }), ExportRecordSchema, {
|
|
22674
|
+
kind: "query",
|
|
22675
|
+
auth: "protected"
|
|
22676
|
+
}), method(object({ exportId: string() }), ExportRecordSchema, {
|
|
22677
|
+
kind: "mutation",
|
|
22678
|
+
auth: "protected"
|
|
22679
|
+
}), method(object({ exportId: string() }), ExportRecordSchema, {
|
|
22680
|
+
kind: "mutation",
|
|
22681
|
+
auth: "protected"
|
|
22682
|
+
}), method(object({ exportId: string() }), ExportDownloadSchema, {
|
|
22683
|
+
kind: "query",
|
|
22684
|
+
auth: "protected"
|
|
22685
|
+
});
|
|
22686
|
+
/**
|
|
22528
22687
|
* One publishable camera stream as its OWNING PROVIDER describes it — the same
|
|
22529
22688
|
* payload the (legacy) push `streamBroker.publishCameraStream` carried, minus
|
|
22530
22689
|
* `deviceId`.
|
|
@@ -26461,6 +26620,42 @@ Object.freeze({
|
|
|
26461
26620
|
addonId: null,
|
|
26462
26621
|
access: "create"
|
|
26463
26622
|
},
|
|
26623
|
+
"recordingExport.cancelExport": {
|
|
26624
|
+
capName: "recordingExport",
|
|
26625
|
+
capScope: "system",
|
|
26626
|
+
addonId: null,
|
|
26627
|
+
access: "create"
|
|
26628
|
+
},
|
|
26629
|
+
"recordingExport.createExport": {
|
|
26630
|
+
capName: "recordingExport",
|
|
26631
|
+
capScope: "system",
|
|
26632
|
+
addonId: null,
|
|
26633
|
+
access: "create"
|
|
26634
|
+
},
|
|
26635
|
+
"recordingExport.deleteExport": {
|
|
26636
|
+
capName: "recordingExport",
|
|
26637
|
+
capScope: "system",
|
|
26638
|
+
addonId: null,
|
|
26639
|
+
access: "delete"
|
|
26640
|
+
},
|
|
26641
|
+
"recordingExport.getDownloadUrl": {
|
|
26642
|
+
capName: "recordingExport",
|
|
26643
|
+
capScope: "system",
|
|
26644
|
+
addonId: null,
|
|
26645
|
+
access: "view"
|
|
26646
|
+
},
|
|
26647
|
+
"recordingExport.getExport": {
|
|
26648
|
+
capName: "recordingExport",
|
|
26649
|
+
capScope: "system",
|
|
26650
|
+
addonId: null,
|
|
26651
|
+
access: "view"
|
|
26652
|
+
},
|
|
26653
|
+
"recordingExport.listExports": {
|
|
26654
|
+
capName: "recordingExport",
|
|
26655
|
+
capScope: "system",
|
|
26656
|
+
addonId: null,
|
|
26657
|
+
access: "view"
|
|
26658
|
+
},
|
|
26464
26659
|
"sceneMonitor.captureReference": {
|
|
26465
26660
|
capName: "scene-monitor",
|
|
26466
26661
|
capScope: "device",
|