@camstack/addon-provider-homeassistant 1.1.29 → 1.1.30
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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
let node_crypto = require("node:crypto");
|
|
3
3
|
let node_zlib = require("node:zlib");
|
|
4
|
-
//#region ../types/dist/event-category-
|
|
4
|
+
//#region ../types/dist/event-category-D4HJq7Mw.mjs
|
|
5
5
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
6
6
|
EventCategory["SystemBoot"] = "system.boot";
|
|
7
7
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -154,6 +154,11 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
154
154
|
/** Runner-sampled scrub thumbnail (~1/5 s/camera). Telemetry (D8): a lost
|
|
155
155
|
* thumb is a scrub gap the recorder's keyframe backfill covers. */
|
|
156
156
|
EventCategory["RecordingThumbSampled"] = "recording.thumb-sampled";
|
|
157
|
+
/** Export render progress (0–100). Telemetry (D8): a lost tick is a stale
|
|
158
|
+
* progress bar the client reconciles via `recordingExport.getExport`. */
|
|
159
|
+
EventCategory["RecordingExportProgress"] = "recording.export.progress";
|
|
160
|
+
EventCategory["RecordingExportCompleted"] = "recording.export.completed";
|
|
161
|
+
EventCategory["RecordingExportFailed"] = "recording.export.failed";
|
|
157
162
|
EventCategory["DetectionEvent"] = "detection.event";
|
|
158
163
|
EventCategory["SessionTrackNew"] = "session.track.new";
|
|
159
164
|
EventCategory["SessionTrackExpired"] = "session.track.expired";
|
|
@@ -443,6 +448,25 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
443
448
|
*/
|
|
444
449
|
EventCategory["PipelineAnalyticsStationaryChanged"] = "pipeline-analytics.stationary-changed";
|
|
445
450
|
/**
|
|
451
|
+
* Fired by `addon-post-analysis` when a package-drop is confirmed inside
|
|
452
|
+
* a package zone — a newly-appeared stationary object of a package class
|
|
453
|
+
* that cleared the class / zone / dwell / size gates. Payload:
|
|
454
|
+
* `PipelineAnalyticsPackageDeliveredPayload` carrying `{ deviceId,
|
|
455
|
+
* entryId, className, zoneIds, keyFrameMediaKey?, bbox, timestamp }`.
|
|
456
|
+
* Telemetry (D8): the durable record is the `package-events` store row;
|
|
457
|
+
* this bus topic drives notifier rules + live UI. See
|
|
458
|
+
* docs/superpowers/specs/2026-07-17-package-zones-design.md §5.1.
|
|
459
|
+
*/
|
|
460
|
+
EventCategory["PipelineAnalyticsPackageDelivered"] = "pipeline-analytics.package-delivered";
|
|
461
|
+
/**
|
|
462
|
+
* Fired by `addon-post-analysis` when a previously-delivered package
|
|
463
|
+
* leaves its zone (the stationary entry departed — moved or swept).
|
|
464
|
+
* Payload: `PipelineAnalyticsPackagePickedUpPayload` carrying
|
|
465
|
+
* `{ deviceId, entryId, deliveredEventId, className, timestamp }`.
|
|
466
|
+
* Telemetry (D8). See package-zones-design §5.2.
|
|
467
|
+
*/
|
|
468
|
+
EventCategory["PipelineAnalyticsPackagePickedUp"] = "pipeline-analytics.package-picked-up";
|
|
469
|
+
/**
|
|
446
470
|
* Fired by `addon-post-analysis` whenever a gallery face row changes:
|
|
447
471
|
* `kind:'buffered'` a new detected face was persisted, `'assigned'` /
|
|
448
472
|
* `'unassigned'` its identity link changed, `'deleted'` the row was
|
|
@@ -5181,6 +5205,25 @@ function _instanceof(cls, params = {}) {
|
|
|
5181
5205
|
};
|
|
5182
5206
|
return inst;
|
|
5183
5207
|
}
|
|
5208
|
+
//#endregion
|
|
5209
|
+
//#region ../../node_modules/zod/v4/classic/compat.js
|
|
5210
|
+
/** @deprecated Use the raw string literal codes instead, e.g. "invalid_type". */
|
|
5211
|
+
var ZodIssueCode = {
|
|
5212
|
+
invalid_type: "invalid_type",
|
|
5213
|
+
too_big: "too_big",
|
|
5214
|
+
too_small: "too_small",
|
|
5215
|
+
invalid_format: "invalid_format",
|
|
5216
|
+
not_multiple_of: "not_multiple_of",
|
|
5217
|
+
unrecognized_keys: "unrecognized_keys",
|
|
5218
|
+
invalid_union: "invalid_union",
|
|
5219
|
+
invalid_key: "invalid_key",
|
|
5220
|
+
invalid_element: "invalid_element",
|
|
5221
|
+
invalid_value: "invalid_value",
|
|
5222
|
+
custom: "custom"
|
|
5223
|
+
};
|
|
5224
|
+
/** @deprecated Do not use. Stub definition, only included for zod-to-json-schema compatibility. */
|
|
5225
|
+
var ZodFirstPartyTypeKind;
|
|
5226
|
+
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5184
5227
|
Object.fromEntries([
|
|
5185
5228
|
{
|
|
5186
5229
|
id: "overview",
|
|
@@ -15013,7 +15056,11 @@ array(ZoneRuleSchema).readonly();
|
|
|
15013
15056
|
* Extend the enum here when a new gating consumer comes online (audio
|
|
15014
15057
|
* gating, alert filtering, …) — no other surface needs to change.
|
|
15015
15058
|
*/
|
|
15016
|
-
var ZoneRuleStageEnum = _enum([
|
|
15059
|
+
var ZoneRuleStageEnum = _enum([
|
|
15060
|
+
"motion",
|
|
15061
|
+
"detection",
|
|
15062
|
+
"package"
|
|
15063
|
+
]);
|
|
15017
15064
|
/**
|
|
15018
15065
|
* Runtime registry: cap-property-name → cap definition. `BaseDevice`'s
|
|
15019
15066
|
* `state` getter looks up the cap definition here to construct a
|
|
@@ -15107,16 +15154,24 @@ var DEVICE_LOCAL_STATE_CAPS = {
|
|
|
15107
15154
|
})
|
|
15108
15155
|
},
|
|
15109
15156
|
/**
|
|
15110
|
-
* Runtime-state slice —
|
|
15157
|
+
* Runtime-state slice — every stage mirrored together so consumers
|
|
15111
15158
|
* see one reactive handle (`device.state.zoneRules.value`) instead
|
|
15112
|
-
* of
|
|
15113
|
-
* `{motion, detection}` shape, so subscribers always get the
|
|
15159
|
+
* of one per stage. Bulk-replace mutations on any stage write the full
|
|
15160
|
+
* `{motion, detection, package}` shape, so subscribers always get the
|
|
15114
15161
|
* complete current set. Consumers that only care about one stage
|
|
15115
15162
|
* just read the matching property.
|
|
15163
|
+
*
|
|
15164
|
+
* `package` backs the package-drop detector — a package zone is a
|
|
15165
|
+
* `ZoneRule` on the `'package'` stage referencing drawn polygons
|
|
15166
|
+
* (see docs/superpowers/specs/2026-07-17-package-zones-design.md §3.1).
|
|
15167
|
+
* The orchestrator provider that writes this stage lands in a later
|
|
15168
|
+
* slice; until then the mirror carries only `{motion, detection}` and
|
|
15169
|
+
* consumers read `package` as absent (treat as `[]`).
|
|
15116
15170
|
*/
|
|
15117
15171
|
runtimeState: object({
|
|
15118
15172
|
motion: array(ZoneRuleSchema).readonly(),
|
|
15119
|
-
detection: array(ZoneRuleSchema).readonly()
|
|
15173
|
+
detection: array(ZoneRuleSchema).readonly(),
|
|
15174
|
+
package: array(ZoneRuleSchema).readonly()
|
|
15120
15175
|
})
|
|
15121
15176
|
},
|
|
15122
15177
|
zones: zonesCapability
|
|
@@ -19177,6 +19232,7 @@ var EventKindIconSchema = _enum([
|
|
|
19177
19232
|
"smoke",
|
|
19178
19233
|
"water",
|
|
19179
19234
|
"button",
|
|
19235
|
+
"package",
|
|
19180
19236
|
"generic"
|
|
19181
19237
|
]);
|
|
19182
19238
|
var EventKindCategorySchema = _enum([
|
|
@@ -19184,7 +19240,8 @@ var EventKindCategorySchema = _enum([
|
|
|
19184
19240
|
"audio",
|
|
19185
19241
|
"detection",
|
|
19186
19242
|
"sensor",
|
|
19187
|
-
"custom"
|
|
19243
|
+
"custom",
|
|
19244
|
+
"package"
|
|
19188
19245
|
]);
|
|
19189
19246
|
var EventKindDescriptorSchema = object({
|
|
19190
19247
|
/** Stable kind id (e.g. 'motion', 'person', 'contact'). */
|
|
@@ -22919,6 +22976,108 @@ method(object({
|
|
|
22919
22976
|
auth: "admin"
|
|
22920
22977
|
});
|
|
22921
22978
|
/**
|
|
22979
|
+
* `recordingExport` cap — render a footage time range into a single downloadable
|
|
22980
|
+
* MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
|
|
22981
|
+
* bounded lifetime with a durable history, auto-expiry, and optional
|
|
22982
|
+
* delete-after-download.
|
|
22983
|
+
*
|
|
22984
|
+
* Like `recording` this is a `scope:'system', mode:'singleton'` cap: the
|
|
22985
|
+
* recorder self-gates so exactly ONE node (the designated `recordingNodeId`,
|
|
22986
|
+
* default `hub`) registers it. Device-scoped methods carry `deviceId` in their
|
|
22987
|
+
* input and dispatch to that single provider; the render runs on the node that
|
|
22988
|
+
* owns the footage (no cross-node segment transfer). Download rides the
|
|
22989
|
+
* framework addon data-plane. State persists in a DurableState blob (NOT
|
|
22990
|
+
* SQLite); history rows survive file deletion for audit.
|
|
22991
|
+
*/
|
|
22992
|
+
/** Playback-speed multiplier for the render (1 = realtime). */
|
|
22993
|
+
var ExportSpeedSchema = number().min(.25).max(32);
|
|
22994
|
+
/** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
|
|
22995
|
+
var ExportTimelapseSchema = object({
|
|
22996
|
+
everyMs: number().int().positive(),
|
|
22997
|
+
outputFps: number().int().min(1).max(60).optional()
|
|
22998
|
+
});
|
|
22999
|
+
/**
|
|
23000
|
+
* Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
|
|
23001
|
+
* is honoured only for a realtime-ish speed (0.5–2×); timelapse is always
|
|
23002
|
+
* silent. `maxLifeMs` bounds how long the finished file is kept;
|
|
23003
|
+
* `deleteAfterDownload` removes it shortly after the first complete download.
|
|
23004
|
+
*/
|
|
23005
|
+
var ExportOptionsSchema = object({
|
|
23006
|
+
speed: ExportSpeedSchema.optional(),
|
|
23007
|
+
timelapse: ExportTimelapseSchema.optional(),
|
|
23008
|
+
includeAudio: boolean(),
|
|
23009
|
+
maxLifeMs: number().int().positive(),
|
|
23010
|
+
deleteAfterDownload: boolean(),
|
|
23011
|
+
title: string().max(200).optional()
|
|
23012
|
+
}).superRefine((v, ctx) => {
|
|
23013
|
+
if (v.speed !== void 0 && v.timelapse !== void 0) ctx.addIssue({
|
|
23014
|
+
code: ZodIssueCode.custom,
|
|
23015
|
+
message: "speed and timelapse are mutually exclusive",
|
|
23016
|
+
path: ["timelapse"]
|
|
23017
|
+
});
|
|
23018
|
+
});
|
|
23019
|
+
var ExportStateSchema = _enum([
|
|
23020
|
+
"queued",
|
|
23021
|
+
"rendering",
|
|
23022
|
+
"ready",
|
|
23023
|
+
"failed",
|
|
23024
|
+
"expired",
|
|
23025
|
+
"deleted"
|
|
23026
|
+
]);
|
|
23027
|
+
/** One export job / history row. */
|
|
23028
|
+
var ExportRecordSchema = object({
|
|
23029
|
+
id: string(),
|
|
23030
|
+
deviceId: number(),
|
|
23031
|
+
profile: string(),
|
|
23032
|
+
fromMs: number(),
|
|
23033
|
+
toMs: number(),
|
|
23034
|
+
options: ExportOptionsSchema,
|
|
23035
|
+
state: ExportStateSchema,
|
|
23036
|
+
/** 0–100 while rendering; null otherwise. */
|
|
23037
|
+
progressPct: number().nullable(),
|
|
23038
|
+
/** File size once ready; null before. */
|
|
23039
|
+
fileBytes: number().nullable(),
|
|
23040
|
+
expiresAt: number(),
|
|
23041
|
+
deleteAfterDownload: boolean(),
|
|
23042
|
+
/** Epoch of the first complete download; null until then. */
|
|
23043
|
+
downloadedAt: number().nullable(),
|
|
23044
|
+
createdAt: number(),
|
|
23045
|
+
/** User id/name that requested the export. */
|
|
23046
|
+
createdBy: string(),
|
|
23047
|
+
/** Failure reason when state is 'failed'; null otherwise. */
|
|
23048
|
+
error: string().nullable()
|
|
23049
|
+
});
|
|
23050
|
+
/** Candidate download URLs (LAN first, then operator extra hosts). */
|
|
23051
|
+
var ExportDownloadSchema = object({
|
|
23052
|
+
url: string(),
|
|
23053
|
+
endpoints: array(string())
|
|
23054
|
+
});
|
|
23055
|
+
method(object({
|
|
23056
|
+
deviceId: number(),
|
|
23057
|
+
profile: string(),
|
|
23058
|
+
fromMs: number(),
|
|
23059
|
+
toMs: number(),
|
|
23060
|
+
options: ExportOptionsSchema
|
|
23061
|
+
}), ExportRecordSchema, {
|
|
23062
|
+
kind: "mutation",
|
|
23063
|
+
auth: "protected"
|
|
23064
|
+
}), method(object({ deviceId: number().optional() }), array(ExportRecordSchema), {
|
|
23065
|
+
kind: "query",
|
|
23066
|
+
auth: "protected"
|
|
23067
|
+
}), method(object({ exportId: string() }), ExportRecordSchema, {
|
|
23068
|
+
kind: "query",
|
|
23069
|
+
auth: "protected"
|
|
23070
|
+
}), method(object({ exportId: string() }), ExportRecordSchema, {
|
|
23071
|
+
kind: "mutation",
|
|
23072
|
+
auth: "protected"
|
|
23073
|
+
}), method(object({ exportId: string() }), ExportRecordSchema, {
|
|
23074
|
+
kind: "mutation",
|
|
23075
|
+
auth: "protected"
|
|
23076
|
+
}), method(object({ exportId: string() }), ExportDownloadSchema, {
|
|
23077
|
+
kind: "query",
|
|
23078
|
+
auth: "protected"
|
|
23079
|
+
});
|
|
23080
|
+
/**
|
|
22922
23081
|
* One publishable camera stream as its OWNING PROVIDER describes it — the same
|
|
22923
23082
|
* payload the (legacy) push `streamBroker.publishCameraStream` carried, minus
|
|
22924
23083
|
* `deviceId`.
|
|
@@ -26842,6 +27001,42 @@ Object.freeze({
|
|
|
26842
27001
|
addonId: null,
|
|
26843
27002
|
access: "create"
|
|
26844
27003
|
},
|
|
27004
|
+
"recordingExport.cancelExport": {
|
|
27005
|
+
capName: "recordingExport",
|
|
27006
|
+
capScope: "system",
|
|
27007
|
+
addonId: null,
|
|
27008
|
+
access: "create"
|
|
27009
|
+
},
|
|
27010
|
+
"recordingExport.createExport": {
|
|
27011
|
+
capName: "recordingExport",
|
|
27012
|
+
capScope: "system",
|
|
27013
|
+
addonId: null,
|
|
27014
|
+
access: "create"
|
|
27015
|
+
},
|
|
27016
|
+
"recordingExport.deleteExport": {
|
|
27017
|
+
capName: "recordingExport",
|
|
27018
|
+
capScope: "system",
|
|
27019
|
+
addonId: null,
|
|
27020
|
+
access: "delete"
|
|
27021
|
+
},
|
|
27022
|
+
"recordingExport.getDownloadUrl": {
|
|
27023
|
+
capName: "recordingExport",
|
|
27024
|
+
capScope: "system",
|
|
27025
|
+
addonId: null,
|
|
27026
|
+
access: "view"
|
|
27027
|
+
},
|
|
27028
|
+
"recordingExport.getExport": {
|
|
27029
|
+
capName: "recordingExport",
|
|
27030
|
+
capScope: "system",
|
|
27031
|
+
addonId: null,
|
|
27032
|
+
access: "view"
|
|
27033
|
+
},
|
|
27034
|
+
"recordingExport.listExports": {
|
|
27035
|
+
capName: "recordingExport",
|
|
27036
|
+
capScope: "system",
|
|
27037
|
+
addonId: null,
|
|
27038
|
+
access: "view"
|
|
27039
|
+
},
|
|
26845
27040
|
"sceneMonitor.captureReference": {
|
|
26846
27041
|
capName: "scene-monitor",
|
|
26847
27042
|
capScope: "device",
|
package/dist/addon.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { randomUUID } from "node:crypto";
|
|
2
2
|
import { brotliCompressSync, deflateSync, gzipSync } from "node:zlib";
|
|
3
|
-
//#region ../types/dist/event-category-
|
|
3
|
+
//#region ../types/dist/event-category-D4HJq7Mw.mjs
|
|
4
4
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
5
5
|
EventCategory["SystemBoot"] = "system.boot";
|
|
6
6
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -153,6 +153,11 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
153
153
|
/** Runner-sampled scrub thumbnail (~1/5 s/camera). Telemetry (D8): a lost
|
|
154
154
|
* thumb is a scrub gap the recorder's keyframe backfill covers. */
|
|
155
155
|
EventCategory["RecordingThumbSampled"] = "recording.thumb-sampled";
|
|
156
|
+
/** Export render progress (0–100). Telemetry (D8): a lost tick is a stale
|
|
157
|
+
* progress bar the client reconciles via `recordingExport.getExport`. */
|
|
158
|
+
EventCategory["RecordingExportProgress"] = "recording.export.progress";
|
|
159
|
+
EventCategory["RecordingExportCompleted"] = "recording.export.completed";
|
|
160
|
+
EventCategory["RecordingExportFailed"] = "recording.export.failed";
|
|
156
161
|
EventCategory["DetectionEvent"] = "detection.event";
|
|
157
162
|
EventCategory["SessionTrackNew"] = "session.track.new";
|
|
158
163
|
EventCategory["SessionTrackExpired"] = "session.track.expired";
|
|
@@ -442,6 +447,25 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
442
447
|
*/
|
|
443
448
|
EventCategory["PipelineAnalyticsStationaryChanged"] = "pipeline-analytics.stationary-changed";
|
|
444
449
|
/**
|
|
450
|
+
* Fired by `addon-post-analysis` when a package-drop is confirmed inside
|
|
451
|
+
* a package zone — a newly-appeared stationary object of a package class
|
|
452
|
+
* that cleared the class / zone / dwell / size gates. Payload:
|
|
453
|
+
* `PipelineAnalyticsPackageDeliveredPayload` carrying `{ deviceId,
|
|
454
|
+
* entryId, className, zoneIds, keyFrameMediaKey?, bbox, timestamp }`.
|
|
455
|
+
* Telemetry (D8): the durable record is the `package-events` store row;
|
|
456
|
+
* this bus topic drives notifier rules + live UI. See
|
|
457
|
+
* docs/superpowers/specs/2026-07-17-package-zones-design.md §5.1.
|
|
458
|
+
*/
|
|
459
|
+
EventCategory["PipelineAnalyticsPackageDelivered"] = "pipeline-analytics.package-delivered";
|
|
460
|
+
/**
|
|
461
|
+
* Fired by `addon-post-analysis` when a previously-delivered package
|
|
462
|
+
* leaves its zone (the stationary entry departed — moved or swept).
|
|
463
|
+
* Payload: `PipelineAnalyticsPackagePickedUpPayload` carrying
|
|
464
|
+
* `{ deviceId, entryId, deliveredEventId, className, timestamp }`.
|
|
465
|
+
* Telemetry (D8). See package-zones-design §5.2.
|
|
466
|
+
*/
|
|
467
|
+
EventCategory["PipelineAnalyticsPackagePickedUp"] = "pipeline-analytics.package-picked-up";
|
|
468
|
+
/**
|
|
445
469
|
* Fired by `addon-post-analysis` whenever a gallery face row changes:
|
|
446
470
|
* `kind:'buffered'` a new detected face was persisted, `'assigned'` /
|
|
447
471
|
* `'unassigned'` its identity link changed, `'deleted'` the row was
|
|
@@ -5180,6 +5204,25 @@ function _instanceof(cls, params = {}) {
|
|
|
5180
5204
|
};
|
|
5181
5205
|
return inst;
|
|
5182
5206
|
}
|
|
5207
|
+
//#endregion
|
|
5208
|
+
//#region ../../node_modules/zod/v4/classic/compat.js
|
|
5209
|
+
/** @deprecated Use the raw string literal codes instead, e.g. "invalid_type". */
|
|
5210
|
+
var ZodIssueCode = {
|
|
5211
|
+
invalid_type: "invalid_type",
|
|
5212
|
+
too_big: "too_big",
|
|
5213
|
+
too_small: "too_small",
|
|
5214
|
+
invalid_format: "invalid_format",
|
|
5215
|
+
not_multiple_of: "not_multiple_of",
|
|
5216
|
+
unrecognized_keys: "unrecognized_keys",
|
|
5217
|
+
invalid_union: "invalid_union",
|
|
5218
|
+
invalid_key: "invalid_key",
|
|
5219
|
+
invalid_element: "invalid_element",
|
|
5220
|
+
invalid_value: "invalid_value",
|
|
5221
|
+
custom: "custom"
|
|
5222
|
+
};
|
|
5223
|
+
/** @deprecated Do not use. Stub definition, only included for zod-to-json-schema compatibility. */
|
|
5224
|
+
var ZodFirstPartyTypeKind;
|
|
5225
|
+
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5183
5226
|
Object.fromEntries([
|
|
5184
5227
|
{
|
|
5185
5228
|
id: "overview",
|
|
@@ -15012,7 +15055,11 @@ array(ZoneRuleSchema).readonly();
|
|
|
15012
15055
|
* Extend the enum here when a new gating consumer comes online (audio
|
|
15013
15056
|
* gating, alert filtering, …) — no other surface needs to change.
|
|
15014
15057
|
*/
|
|
15015
|
-
var ZoneRuleStageEnum = _enum([
|
|
15058
|
+
var ZoneRuleStageEnum = _enum([
|
|
15059
|
+
"motion",
|
|
15060
|
+
"detection",
|
|
15061
|
+
"package"
|
|
15062
|
+
]);
|
|
15016
15063
|
/**
|
|
15017
15064
|
* Runtime registry: cap-property-name → cap definition. `BaseDevice`'s
|
|
15018
15065
|
* `state` getter looks up the cap definition here to construct a
|
|
@@ -15106,16 +15153,24 @@ var DEVICE_LOCAL_STATE_CAPS = {
|
|
|
15106
15153
|
})
|
|
15107
15154
|
},
|
|
15108
15155
|
/**
|
|
15109
|
-
* Runtime-state slice —
|
|
15156
|
+
* Runtime-state slice — every stage mirrored together so consumers
|
|
15110
15157
|
* see one reactive handle (`device.state.zoneRules.value`) instead
|
|
15111
|
-
* of
|
|
15112
|
-
* `{motion, detection}` shape, so subscribers always get the
|
|
15158
|
+
* of one per stage. Bulk-replace mutations on any stage write the full
|
|
15159
|
+
* `{motion, detection, package}` shape, so subscribers always get the
|
|
15113
15160
|
* complete current set. Consumers that only care about one stage
|
|
15114
15161
|
* just read the matching property.
|
|
15162
|
+
*
|
|
15163
|
+
* `package` backs the package-drop detector — a package zone is a
|
|
15164
|
+
* `ZoneRule` on the `'package'` stage referencing drawn polygons
|
|
15165
|
+
* (see docs/superpowers/specs/2026-07-17-package-zones-design.md §3.1).
|
|
15166
|
+
* The orchestrator provider that writes this stage lands in a later
|
|
15167
|
+
* slice; until then the mirror carries only `{motion, detection}` and
|
|
15168
|
+
* consumers read `package` as absent (treat as `[]`).
|
|
15115
15169
|
*/
|
|
15116
15170
|
runtimeState: object({
|
|
15117
15171
|
motion: array(ZoneRuleSchema).readonly(),
|
|
15118
|
-
detection: array(ZoneRuleSchema).readonly()
|
|
15172
|
+
detection: array(ZoneRuleSchema).readonly(),
|
|
15173
|
+
package: array(ZoneRuleSchema).readonly()
|
|
15119
15174
|
})
|
|
15120
15175
|
},
|
|
15121
15176
|
zones: zonesCapability
|
|
@@ -19176,6 +19231,7 @@ var EventKindIconSchema = _enum([
|
|
|
19176
19231
|
"smoke",
|
|
19177
19232
|
"water",
|
|
19178
19233
|
"button",
|
|
19234
|
+
"package",
|
|
19179
19235
|
"generic"
|
|
19180
19236
|
]);
|
|
19181
19237
|
var EventKindCategorySchema = _enum([
|
|
@@ -19183,7 +19239,8 @@ var EventKindCategorySchema = _enum([
|
|
|
19183
19239
|
"audio",
|
|
19184
19240
|
"detection",
|
|
19185
19241
|
"sensor",
|
|
19186
|
-
"custom"
|
|
19242
|
+
"custom",
|
|
19243
|
+
"package"
|
|
19187
19244
|
]);
|
|
19188
19245
|
var EventKindDescriptorSchema = object({
|
|
19189
19246
|
/** Stable kind id (e.g. 'motion', 'person', 'contact'). */
|
|
@@ -22918,6 +22975,108 @@ method(object({
|
|
|
22918
22975
|
auth: "admin"
|
|
22919
22976
|
});
|
|
22920
22977
|
/**
|
|
22978
|
+
* `recordingExport` cap — render a footage time range into a single downloadable
|
|
22979
|
+
* MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
|
|
22980
|
+
* bounded lifetime with a durable history, auto-expiry, and optional
|
|
22981
|
+
* delete-after-download.
|
|
22982
|
+
*
|
|
22983
|
+
* Like `recording` this is a `scope:'system', mode:'singleton'` cap: the
|
|
22984
|
+
* recorder self-gates so exactly ONE node (the designated `recordingNodeId`,
|
|
22985
|
+
* default `hub`) registers it. Device-scoped methods carry `deviceId` in their
|
|
22986
|
+
* input and dispatch to that single provider; the render runs on the node that
|
|
22987
|
+
* owns the footage (no cross-node segment transfer). Download rides the
|
|
22988
|
+
* framework addon data-plane. State persists in a DurableState blob (NOT
|
|
22989
|
+
* SQLite); history rows survive file deletion for audit.
|
|
22990
|
+
*/
|
|
22991
|
+
/** Playback-speed multiplier for the render (1 = realtime). */
|
|
22992
|
+
var ExportSpeedSchema = number().min(.25).max(32);
|
|
22993
|
+
/** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
|
|
22994
|
+
var ExportTimelapseSchema = object({
|
|
22995
|
+
everyMs: number().int().positive(),
|
|
22996
|
+
outputFps: number().int().min(1).max(60).optional()
|
|
22997
|
+
});
|
|
22998
|
+
/**
|
|
22999
|
+
* Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
|
|
23000
|
+
* is honoured only for a realtime-ish speed (0.5–2×); timelapse is always
|
|
23001
|
+
* silent. `maxLifeMs` bounds how long the finished file is kept;
|
|
23002
|
+
* `deleteAfterDownload` removes it shortly after the first complete download.
|
|
23003
|
+
*/
|
|
23004
|
+
var ExportOptionsSchema = object({
|
|
23005
|
+
speed: ExportSpeedSchema.optional(),
|
|
23006
|
+
timelapse: ExportTimelapseSchema.optional(),
|
|
23007
|
+
includeAudio: boolean(),
|
|
23008
|
+
maxLifeMs: number().int().positive(),
|
|
23009
|
+
deleteAfterDownload: boolean(),
|
|
23010
|
+
title: string().max(200).optional()
|
|
23011
|
+
}).superRefine((v, ctx) => {
|
|
23012
|
+
if (v.speed !== void 0 && v.timelapse !== void 0) ctx.addIssue({
|
|
23013
|
+
code: ZodIssueCode.custom,
|
|
23014
|
+
message: "speed and timelapse are mutually exclusive",
|
|
23015
|
+
path: ["timelapse"]
|
|
23016
|
+
});
|
|
23017
|
+
});
|
|
23018
|
+
var ExportStateSchema = _enum([
|
|
23019
|
+
"queued",
|
|
23020
|
+
"rendering",
|
|
23021
|
+
"ready",
|
|
23022
|
+
"failed",
|
|
23023
|
+
"expired",
|
|
23024
|
+
"deleted"
|
|
23025
|
+
]);
|
|
23026
|
+
/** One export job / history row. */
|
|
23027
|
+
var ExportRecordSchema = object({
|
|
23028
|
+
id: string(),
|
|
23029
|
+
deviceId: number(),
|
|
23030
|
+
profile: string(),
|
|
23031
|
+
fromMs: number(),
|
|
23032
|
+
toMs: number(),
|
|
23033
|
+
options: ExportOptionsSchema,
|
|
23034
|
+
state: ExportStateSchema,
|
|
23035
|
+
/** 0–100 while rendering; null otherwise. */
|
|
23036
|
+
progressPct: number().nullable(),
|
|
23037
|
+
/** File size once ready; null before. */
|
|
23038
|
+
fileBytes: number().nullable(),
|
|
23039
|
+
expiresAt: number(),
|
|
23040
|
+
deleteAfterDownload: boolean(),
|
|
23041
|
+
/** Epoch of the first complete download; null until then. */
|
|
23042
|
+
downloadedAt: number().nullable(),
|
|
23043
|
+
createdAt: number(),
|
|
23044
|
+
/** User id/name that requested the export. */
|
|
23045
|
+
createdBy: string(),
|
|
23046
|
+
/** Failure reason when state is 'failed'; null otherwise. */
|
|
23047
|
+
error: string().nullable()
|
|
23048
|
+
});
|
|
23049
|
+
/** Candidate download URLs (LAN first, then operator extra hosts). */
|
|
23050
|
+
var ExportDownloadSchema = object({
|
|
23051
|
+
url: string(),
|
|
23052
|
+
endpoints: array(string())
|
|
23053
|
+
});
|
|
23054
|
+
method(object({
|
|
23055
|
+
deviceId: number(),
|
|
23056
|
+
profile: string(),
|
|
23057
|
+
fromMs: number(),
|
|
23058
|
+
toMs: number(),
|
|
23059
|
+
options: ExportOptionsSchema
|
|
23060
|
+
}), ExportRecordSchema, {
|
|
23061
|
+
kind: "mutation",
|
|
23062
|
+
auth: "protected"
|
|
23063
|
+
}), method(object({ deviceId: number().optional() }), array(ExportRecordSchema), {
|
|
23064
|
+
kind: "query",
|
|
23065
|
+
auth: "protected"
|
|
23066
|
+
}), method(object({ exportId: string() }), ExportRecordSchema, {
|
|
23067
|
+
kind: "query",
|
|
23068
|
+
auth: "protected"
|
|
23069
|
+
}), method(object({ exportId: string() }), ExportRecordSchema, {
|
|
23070
|
+
kind: "mutation",
|
|
23071
|
+
auth: "protected"
|
|
23072
|
+
}), method(object({ exportId: string() }), ExportRecordSchema, {
|
|
23073
|
+
kind: "mutation",
|
|
23074
|
+
auth: "protected"
|
|
23075
|
+
}), method(object({ exportId: string() }), ExportDownloadSchema, {
|
|
23076
|
+
kind: "query",
|
|
23077
|
+
auth: "protected"
|
|
23078
|
+
});
|
|
23079
|
+
/**
|
|
22921
23080
|
* One publishable camera stream as its OWNING PROVIDER describes it — the same
|
|
22922
23081
|
* payload the (legacy) push `streamBroker.publishCameraStream` carried, minus
|
|
22923
23082
|
* `deviceId`.
|
|
@@ -26841,6 +27000,42 @@ Object.freeze({
|
|
|
26841
27000
|
addonId: null,
|
|
26842
27001
|
access: "create"
|
|
26843
27002
|
},
|
|
27003
|
+
"recordingExport.cancelExport": {
|
|
27004
|
+
capName: "recordingExport",
|
|
27005
|
+
capScope: "system",
|
|
27006
|
+
addonId: null,
|
|
27007
|
+
access: "create"
|
|
27008
|
+
},
|
|
27009
|
+
"recordingExport.createExport": {
|
|
27010
|
+
capName: "recordingExport",
|
|
27011
|
+
capScope: "system",
|
|
27012
|
+
addonId: null,
|
|
27013
|
+
access: "create"
|
|
27014
|
+
},
|
|
27015
|
+
"recordingExport.deleteExport": {
|
|
27016
|
+
capName: "recordingExport",
|
|
27017
|
+
capScope: "system",
|
|
27018
|
+
addonId: null,
|
|
27019
|
+
access: "delete"
|
|
27020
|
+
},
|
|
27021
|
+
"recordingExport.getDownloadUrl": {
|
|
27022
|
+
capName: "recordingExport",
|
|
27023
|
+
capScope: "system",
|
|
27024
|
+
addonId: null,
|
|
27025
|
+
access: "view"
|
|
27026
|
+
},
|
|
27027
|
+
"recordingExport.getExport": {
|
|
27028
|
+
capName: "recordingExport",
|
|
27029
|
+
capScope: "system",
|
|
27030
|
+
addonId: null,
|
|
27031
|
+
access: "view"
|
|
27032
|
+
},
|
|
27033
|
+
"recordingExport.listExports": {
|
|
27034
|
+
capName: "recordingExport",
|
|
27035
|
+
capScope: "system",
|
|
27036
|
+
addonId: null,
|
|
27037
|
+
access: "view"
|
|
27038
|
+
},
|
|
26844
27039
|
"sceneMonitor.captureReference": {
|
|
26845
27040
|
capName: "scene-monitor",
|
|
26846
27041
|
capScope: "device",
|