@camstack/addon-provider-ecowitt 0.1.24 → 0.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 +347 -8
- package/dist/addon.mjs +347 -8
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
let http = require("http");
|
|
3
3
|
let events = require("events");
|
|
4
4
|
let dgram = require("dgram");
|
|
5
|
-
//#region ../types/dist/event-category-
|
|
5
|
+
//#region ../types/dist/event-category-D4HJq7Mw.mjs
|
|
6
6
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
7
7
|
EventCategory["SystemBoot"] = "system.boot";
|
|
8
8
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -155,6 +155,11 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
155
155
|
/** Runner-sampled scrub thumbnail (~1/5 s/camera). Telemetry (D8): a lost
|
|
156
156
|
* thumb is a scrub gap the recorder's keyframe backfill covers. */
|
|
157
157
|
EventCategory["RecordingThumbSampled"] = "recording.thumb-sampled";
|
|
158
|
+
/** Export render progress (0–100). Telemetry (D8): a lost tick is a stale
|
|
159
|
+
* progress bar the client reconciles via `recordingExport.getExport`. */
|
|
160
|
+
EventCategory["RecordingExportProgress"] = "recording.export.progress";
|
|
161
|
+
EventCategory["RecordingExportCompleted"] = "recording.export.completed";
|
|
162
|
+
EventCategory["RecordingExportFailed"] = "recording.export.failed";
|
|
158
163
|
EventCategory["DetectionEvent"] = "detection.event";
|
|
159
164
|
EventCategory["SessionTrackNew"] = "session.track.new";
|
|
160
165
|
EventCategory["SessionTrackExpired"] = "session.track.expired";
|
|
@@ -444,6 +449,25 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
444
449
|
*/
|
|
445
450
|
EventCategory["PipelineAnalyticsStationaryChanged"] = "pipeline-analytics.stationary-changed";
|
|
446
451
|
/**
|
|
452
|
+
* Fired by `addon-post-analysis` when a package-drop is confirmed inside
|
|
453
|
+
* a package zone — a newly-appeared stationary object of a package class
|
|
454
|
+
* that cleared the class / zone / dwell / size gates. Payload:
|
|
455
|
+
* `PipelineAnalyticsPackageDeliveredPayload` carrying `{ deviceId,
|
|
456
|
+
* entryId, className, zoneIds, keyFrameMediaKey?, bbox, timestamp }`.
|
|
457
|
+
* Telemetry (D8): the durable record is the `package-events` store row;
|
|
458
|
+
* this bus topic drives notifier rules + live UI. See
|
|
459
|
+
* docs/superpowers/specs/2026-07-17-package-zones-design.md §5.1.
|
|
460
|
+
*/
|
|
461
|
+
EventCategory["PipelineAnalyticsPackageDelivered"] = "pipeline-analytics.package-delivered";
|
|
462
|
+
/**
|
|
463
|
+
* Fired by `addon-post-analysis` when a previously-delivered package
|
|
464
|
+
* leaves its zone (the stationary entry departed — moved or swept).
|
|
465
|
+
* Payload: `PipelineAnalyticsPackagePickedUpPayload` carrying
|
|
466
|
+
* `{ deviceId, entryId, deliveredEventId, className, timestamp }`.
|
|
467
|
+
* Telemetry (D8). See package-zones-design §5.2.
|
|
468
|
+
*/
|
|
469
|
+
EventCategory["PipelineAnalyticsPackagePickedUp"] = "pipeline-analytics.package-picked-up";
|
|
470
|
+
/**
|
|
447
471
|
* Fired by `addon-post-analysis` whenever a gallery face row changes:
|
|
448
472
|
* `kind:'buffered'` a new detected face was persisted, `'assigned'` /
|
|
449
473
|
* `'unassigned'` its identity link changed, `'deleted'` the row was
|
|
@@ -5196,6 +5220,25 @@ function preprocess(fn, schema) {
|
|
|
5196
5220
|
out: schema
|
|
5197
5221
|
});
|
|
5198
5222
|
}
|
|
5223
|
+
//#endregion
|
|
5224
|
+
//#region ../../node_modules/zod/v4/classic/compat.js
|
|
5225
|
+
/** @deprecated Use the raw string literal codes instead, e.g. "invalid_type". */
|
|
5226
|
+
var ZodIssueCode$1 = {
|
|
5227
|
+
invalid_type: "invalid_type",
|
|
5228
|
+
too_big: "too_big",
|
|
5229
|
+
too_small: "too_small",
|
|
5230
|
+
invalid_format: "invalid_format",
|
|
5231
|
+
not_multiple_of: "not_multiple_of",
|
|
5232
|
+
unrecognized_keys: "unrecognized_keys",
|
|
5233
|
+
invalid_union: "invalid_union",
|
|
5234
|
+
invalid_key: "invalid_key",
|
|
5235
|
+
invalid_element: "invalid_element",
|
|
5236
|
+
invalid_value: "invalid_value",
|
|
5237
|
+
custom: "custom"
|
|
5238
|
+
};
|
|
5239
|
+
/** @deprecated Do not use. Stub definition, only included for zod-to-json-schema compatibility. */
|
|
5240
|
+
var ZodFirstPartyTypeKind$1;
|
|
5241
|
+
ZodFirstPartyTypeKind$1 || (ZodFirstPartyTypeKind$1 = {});
|
|
5199
5242
|
Object.fromEntries([
|
|
5200
5243
|
{
|
|
5201
5244
|
id: "overview",
|
|
@@ -7318,6 +7361,62 @@ var RecordingConfigSchema = object({
|
|
|
7318
7361
|
scrubThumbnails: ScrubThumbnailPresetSchema.optional()
|
|
7319
7362
|
});
|
|
7320
7363
|
/**
|
|
7364
|
+
* Ops-log — the durable, append-only operations audit shared by the
|
|
7365
|
+
* recordings and events management surfaces.
|
|
7366
|
+
*
|
|
7367
|
+
* ONE row shape is reused for both domains so a single "Activity" view can
|
|
7368
|
+
* merge the recorder's DurableState ring (recordings ops-log) and the
|
|
7369
|
+
* pipeline-analytics SQLite collection (events ops-log). Each row records a
|
|
7370
|
+
* management operation, WHY it ran (reason), and its measurable effect
|
|
7371
|
+
* (itemsAffected + bytesReclaimed). Writes are best-effort — a failed log must
|
|
7372
|
+
* never fail the operation it records.
|
|
7373
|
+
*/
|
|
7374
|
+
/** Which management domain the operation belongs to. */
|
|
7375
|
+
var OpsLogDomainSchema = _enum(["recording", "events"]);
|
|
7376
|
+
/** The kind of management operation performed. */
|
|
7377
|
+
var OpsLogOpSchema = _enum([
|
|
7378
|
+
"prune",
|
|
7379
|
+
"manual-delete",
|
|
7380
|
+
"rescan",
|
|
7381
|
+
"retention-run"
|
|
7382
|
+
]);
|
|
7383
|
+
/** Why the operation ran. */
|
|
7384
|
+
var OpsLogReasonSchema = _enum([
|
|
7385
|
+
"retention",
|
|
7386
|
+
"quota",
|
|
7387
|
+
"manual",
|
|
7388
|
+
"operator"
|
|
7389
|
+
]);
|
|
7390
|
+
/** One audit row, shared verbatim by both domains. */
|
|
7391
|
+
var OpsLogEntrySchema = object({
|
|
7392
|
+
/** Unique row id. */
|
|
7393
|
+
id: string(),
|
|
7394
|
+
/** Epoch ms the operation completed. */
|
|
7395
|
+
at: number(),
|
|
7396
|
+
domain: OpsLogDomainSchema,
|
|
7397
|
+
op: OpsLogOpSchema,
|
|
7398
|
+
reason: OpsLogReasonSchema,
|
|
7399
|
+
/** The camera the op targeted; null for a cluster/global op. */
|
|
7400
|
+
deviceId: number().nullable(),
|
|
7401
|
+
/** Node that performed the op (the log carries nodeId — no cross-node aggregation). */
|
|
7402
|
+
nodeId: string(),
|
|
7403
|
+
/** Buckets / rows deleted (op-specific unit). */
|
|
7404
|
+
itemsAffected: number(),
|
|
7405
|
+
/** Bytes reclaimed by the op (0 when not measurable). */
|
|
7406
|
+
bytesReclaimed: number(),
|
|
7407
|
+
/** Free-text detail (e.g. "floor moved to <ts>"); null when none. */
|
|
7408
|
+
detail: string().nullable(),
|
|
7409
|
+
/** Who/what triggered the op. */
|
|
7410
|
+
actor: string()
|
|
7411
|
+
});
|
|
7412
|
+
/** Shared query input for the per-domain `listOpsLog` cap methods. */
|
|
7413
|
+
var OpsLogQueryInputSchema = object({
|
|
7414
|
+
/** Restrict to a single camera; omit for every row. */
|
|
7415
|
+
deviceId: number().optional(),
|
|
7416
|
+
/** Max rows returned, newest-first. */
|
|
7417
|
+
limit: number().int().min(1).max(1e3).optional()
|
|
7418
|
+
});
|
|
7419
|
+
/**
|
|
7321
7420
|
* `StorageLocationType` — an addon-declared id that identifies the *kind* of
|
|
7322
7421
|
* storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
|
|
7323
7422
|
* so the persisted record schema and the consumer-facing cap can both consume it
|
|
@@ -14673,7 +14772,11 @@ array(ZoneRuleSchema).readonly();
|
|
|
14673
14772
|
* Extend the enum here when a new gating consumer comes online (audio
|
|
14674
14773
|
* gating, alert filtering, …) — no other surface needs to change.
|
|
14675
14774
|
*/
|
|
14676
|
-
var ZoneRuleStageEnum = _enum([
|
|
14775
|
+
var ZoneRuleStageEnum = _enum([
|
|
14776
|
+
"motion",
|
|
14777
|
+
"detection",
|
|
14778
|
+
"package"
|
|
14779
|
+
]);
|
|
14677
14780
|
/**
|
|
14678
14781
|
* Runtime registry: cap-property-name → cap definition. `BaseDevice`'s
|
|
14679
14782
|
* `state` getter looks up the cap definition here to construct a
|
|
@@ -14767,16 +14870,25 @@ var DEVICE_LOCAL_STATE_CAPS = {
|
|
|
14767
14870
|
})
|
|
14768
14871
|
},
|
|
14769
14872
|
/**
|
|
14770
|
-
* Runtime-state slice —
|
|
14873
|
+
* Runtime-state slice — every stage mirrored together so consumers
|
|
14771
14874
|
* see one reactive handle (`device.state.zoneRules.value`) instead
|
|
14772
|
-
* of
|
|
14773
|
-
* `{motion, detection}` shape, so subscribers always get the
|
|
14875
|
+
* of one per stage. Bulk-replace mutations on any stage write the full
|
|
14876
|
+
* `{motion, detection, package}` shape, so subscribers always get the
|
|
14774
14877
|
* complete current set. Consumers that only care about one stage
|
|
14775
14878
|
* just read the matching property.
|
|
14879
|
+
*
|
|
14880
|
+
* `package` backs the package-drop detector — a package zone is a
|
|
14881
|
+
* `ZoneRule` on the `'package'` stage referencing drawn polygons
|
|
14882
|
+
* (see docs/superpowers/specs/2026-07-17-package-zones-design.md §3.1).
|
|
14883
|
+
* The orchestrator provider writes this stage as a first-class slice
|
|
14884
|
+
* (Phase 4): every mutation mirrors the full `{motion, detection,
|
|
14885
|
+
* package}` shape, so consumers read the current package rules directly
|
|
14886
|
+
* off `device.state.zoneRules.value.package`.
|
|
14776
14887
|
*/
|
|
14777
14888
|
runtimeState: object({
|
|
14778
14889
|
motion: array(ZoneRuleSchema).readonly(),
|
|
14779
|
-
detection: array(ZoneRuleSchema).readonly()
|
|
14890
|
+
detection: array(ZoneRuleSchema).readonly(),
|
|
14891
|
+
package: array(ZoneRuleSchema).readonly()
|
|
14780
14892
|
})
|
|
14781
14893
|
},
|
|
14782
14894
|
zones: zonesCapability
|
|
@@ -18738,6 +18850,7 @@ var EventKindIconSchema = _enum([
|
|
|
18738
18850
|
"smoke",
|
|
18739
18851
|
"water",
|
|
18740
18852
|
"button",
|
|
18853
|
+
"package",
|
|
18741
18854
|
"generic"
|
|
18742
18855
|
]);
|
|
18743
18856
|
var EventKindCategorySchema = _enum([
|
|
@@ -18745,7 +18858,8 @@ var EventKindCategorySchema = _enum([
|
|
|
18745
18858
|
"audio",
|
|
18746
18859
|
"detection",
|
|
18747
18860
|
"sensor",
|
|
18748
|
-
"custom"
|
|
18861
|
+
"custom",
|
|
18862
|
+
"package"
|
|
18749
18863
|
]);
|
|
18750
18864
|
var EventKindDescriptorSchema = object({
|
|
18751
18865
|
/** Stable kind id (e.g. 'motion', 'person', 'contact'). */
|
|
@@ -19086,6 +19200,26 @@ var TrackCascadeCountsSchema = object({
|
|
|
19086
19200
|
/** Per-track CLIP search vectors removed (best-effort). */
|
|
19087
19201
|
embeddings: number().int()
|
|
19088
19202
|
});
|
|
19203
|
+
/** Event-store footprint for one camera. */
|
|
19204
|
+
var EventStoreDeviceFootprintSchema = object({
|
|
19205
|
+
deviceId: number(),
|
|
19206
|
+
/** Persisted event rows (motion + object + audio) for the camera. */
|
|
19207
|
+
rows: number().int(),
|
|
19208
|
+
/** Event-owned media bytes on disk for the camera. */
|
|
19209
|
+
bytes: number().int()
|
|
19210
|
+
});
|
|
19211
|
+
/** Aggregate event-store footprint: global totals + per-camera breakdown. */
|
|
19212
|
+
var EventStoreFootprintSchema = object({
|
|
19213
|
+
totalRows: number().int(),
|
|
19214
|
+
totalBytes: number().int(),
|
|
19215
|
+
devices: array(EventStoreDeviceFootprintSchema).readonly()
|
|
19216
|
+
});
|
|
19217
|
+
/** Per-kind counts returned by the event-prune / device-delete mutations. */
|
|
19218
|
+
var EventPruneCountsSchema = object({
|
|
19219
|
+
motion: number().int(),
|
|
19220
|
+
object: number().int(),
|
|
19221
|
+
audio: number().int()
|
|
19222
|
+
});
|
|
19089
19223
|
DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
|
|
19090
19224
|
deviceId: number(),
|
|
19091
19225
|
trackId: string()
|
|
@@ -19149,6 +19283,21 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
19149
19283
|
}), {
|
|
19150
19284
|
kind: "mutation",
|
|
19151
19285
|
auth: "admin"
|
|
19286
|
+
}), method(object({}), EventStoreFootprintSchema, {
|
|
19287
|
+
kind: "query",
|
|
19288
|
+
auth: "admin"
|
|
19289
|
+
}), method(object({
|
|
19290
|
+
olderThanMs: number(),
|
|
19291
|
+
reason: OpsLogReasonSchema.optional()
|
|
19292
|
+
}), EventPruneCountsSchema, {
|
|
19293
|
+
kind: "mutation",
|
|
19294
|
+
auth: "admin"
|
|
19295
|
+
}), method(object({ deviceId: number() }), EventPruneCountsSchema, {
|
|
19296
|
+
kind: "mutation",
|
|
19297
|
+
auth: "admin"
|
|
19298
|
+
}), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
|
|
19299
|
+
kind: "query",
|
|
19300
|
+
auth: "admin"
|
|
19152
19301
|
}), method(object({
|
|
19153
19302
|
eventId: string(),
|
|
19154
19303
|
kind: MediaFileKindEnum.optional()
|
|
@@ -22382,13 +22531,131 @@ method(object({
|
|
|
22382
22531
|
}), method(object({ deviceId: number() }), RecordingStatusSchema, {
|
|
22383
22532
|
kind: "mutation",
|
|
22384
22533
|
auth: "admin"
|
|
22385
|
-
}), method(object({
|
|
22534
|
+
}), method(object({
|
|
22535
|
+
deviceId: number(),
|
|
22536
|
+
reason: OpsLogReasonSchema.optional()
|
|
22537
|
+
}), object({
|
|
22386
22538
|
floorMs: number().nullable(),
|
|
22387
22539
|
deletedBuckets: number().int(),
|
|
22388
22540
|
reclaimedBytes: number().int()
|
|
22389
22541
|
}), {
|
|
22390
22542
|
kind: "mutation",
|
|
22391
22543
|
auth: "admin"
|
|
22544
|
+
}), method(object({
|
|
22545
|
+
deviceId: number(),
|
|
22546
|
+
fromMs: number().optional(),
|
|
22547
|
+
toMs: number().optional()
|
|
22548
|
+
}), object({
|
|
22549
|
+
deletedBuckets: number().int(),
|
|
22550
|
+
reclaimedBytes: number().int()
|
|
22551
|
+
}), {
|
|
22552
|
+
kind: "mutation",
|
|
22553
|
+
auth: "admin"
|
|
22554
|
+
}), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
|
|
22555
|
+
kind: "query",
|
|
22556
|
+
auth: "admin"
|
|
22557
|
+
});
|
|
22558
|
+
/**
|
|
22559
|
+
* `recordingExport` cap — render a footage time range into a single downloadable
|
|
22560
|
+
* MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
|
|
22561
|
+
* bounded lifetime with a durable history, auto-expiry, and optional
|
|
22562
|
+
* delete-after-download.
|
|
22563
|
+
*
|
|
22564
|
+
* Like `recording` this is a `scope:'system', mode:'singleton'` cap: the
|
|
22565
|
+
* recorder self-gates so exactly ONE node (the designated `recordingNodeId`,
|
|
22566
|
+
* default `hub`) registers it. Device-scoped methods carry `deviceId` in their
|
|
22567
|
+
* input and dispatch to that single provider; the render runs on the node that
|
|
22568
|
+
* owns the footage (no cross-node segment transfer). Download rides the
|
|
22569
|
+
* framework addon data-plane. State persists in a DurableState blob (NOT
|
|
22570
|
+
* SQLite); history rows survive file deletion for audit.
|
|
22571
|
+
*/
|
|
22572
|
+
/** Playback-speed multiplier for the render (1 = realtime). */
|
|
22573
|
+
var ExportSpeedSchema = number().min(.25).max(32);
|
|
22574
|
+
/** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
|
|
22575
|
+
var ExportTimelapseSchema = object({
|
|
22576
|
+
everyMs: number().int().positive(),
|
|
22577
|
+
outputFps: number().int().min(1).max(60).optional()
|
|
22578
|
+
});
|
|
22579
|
+
/**
|
|
22580
|
+
* Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
|
|
22581
|
+
* is honoured only for a realtime-ish speed (0.5–2×); timelapse is always
|
|
22582
|
+
* silent. `maxLifeMs` bounds how long the finished file is kept;
|
|
22583
|
+
* `deleteAfterDownload` removes it shortly after the first complete download.
|
|
22584
|
+
*/
|
|
22585
|
+
var ExportOptionsSchema = object({
|
|
22586
|
+
speed: ExportSpeedSchema.optional(),
|
|
22587
|
+
timelapse: ExportTimelapseSchema.optional(),
|
|
22588
|
+
includeAudio: boolean(),
|
|
22589
|
+
maxLifeMs: number().int().positive(),
|
|
22590
|
+
deleteAfterDownload: boolean(),
|
|
22591
|
+
title: string().max(200).optional()
|
|
22592
|
+
}).superRefine((v, ctx) => {
|
|
22593
|
+
if (v.speed !== void 0 && v.timelapse !== void 0) ctx.addIssue({
|
|
22594
|
+
code: ZodIssueCode$1.custom,
|
|
22595
|
+
message: "speed and timelapse are mutually exclusive",
|
|
22596
|
+
path: ["timelapse"]
|
|
22597
|
+
});
|
|
22598
|
+
});
|
|
22599
|
+
var ExportStateSchema = _enum([
|
|
22600
|
+
"queued",
|
|
22601
|
+
"rendering",
|
|
22602
|
+
"ready",
|
|
22603
|
+
"failed",
|
|
22604
|
+
"expired",
|
|
22605
|
+
"deleted"
|
|
22606
|
+
]);
|
|
22607
|
+
/** One export job / history row. */
|
|
22608
|
+
var ExportRecordSchema = object({
|
|
22609
|
+
id: string(),
|
|
22610
|
+
deviceId: number(),
|
|
22611
|
+
profile: string(),
|
|
22612
|
+
fromMs: number(),
|
|
22613
|
+
toMs: number(),
|
|
22614
|
+
options: ExportOptionsSchema,
|
|
22615
|
+
state: ExportStateSchema,
|
|
22616
|
+
/** 0–100 while rendering; null otherwise. */
|
|
22617
|
+
progressPct: number().nullable(),
|
|
22618
|
+
/** File size once ready; null before. */
|
|
22619
|
+
fileBytes: number().nullable(),
|
|
22620
|
+
expiresAt: number(),
|
|
22621
|
+
deleteAfterDownload: boolean(),
|
|
22622
|
+
/** Epoch of the first complete download; null until then. */
|
|
22623
|
+
downloadedAt: number().nullable(),
|
|
22624
|
+
createdAt: number(),
|
|
22625
|
+
/** User id/name that requested the export. */
|
|
22626
|
+
createdBy: string(),
|
|
22627
|
+
/** Failure reason when state is 'failed'; null otherwise. */
|
|
22628
|
+
error: string().nullable()
|
|
22629
|
+
});
|
|
22630
|
+
/** Candidate download URLs (LAN first, then operator extra hosts). */
|
|
22631
|
+
var ExportDownloadSchema = object({
|
|
22632
|
+
url: string(),
|
|
22633
|
+
endpoints: array(string())
|
|
22634
|
+
});
|
|
22635
|
+
method(object({
|
|
22636
|
+
deviceId: number(),
|
|
22637
|
+
profile: string(),
|
|
22638
|
+
fromMs: number(),
|
|
22639
|
+
toMs: number(),
|
|
22640
|
+
options: ExportOptionsSchema
|
|
22641
|
+
}), ExportRecordSchema, {
|
|
22642
|
+
kind: "mutation",
|
|
22643
|
+
auth: "protected"
|
|
22644
|
+
}), method(object({ deviceId: number().optional() }), array(ExportRecordSchema), {
|
|
22645
|
+
kind: "query",
|
|
22646
|
+
auth: "protected"
|
|
22647
|
+
}), method(object({ exportId: string() }), ExportRecordSchema, {
|
|
22648
|
+
kind: "query",
|
|
22649
|
+
auth: "protected"
|
|
22650
|
+
}), method(object({ exportId: string() }), ExportRecordSchema, {
|
|
22651
|
+
kind: "mutation",
|
|
22652
|
+
auth: "protected"
|
|
22653
|
+
}), method(object({ exportId: string() }), ExportRecordSchema, {
|
|
22654
|
+
kind: "mutation",
|
|
22655
|
+
auth: "protected"
|
|
22656
|
+
}), method(object({ exportId: string() }), ExportDownloadSchema, {
|
|
22657
|
+
kind: "query",
|
|
22658
|
+
auth: "protected"
|
|
22392
22659
|
});
|
|
22393
22660
|
/**
|
|
22394
22661
|
* One publishable camera stream as its OWNING PROVIDER describes it — the same
|
|
@@ -25408,6 +25675,12 @@ Object.freeze({
|
|
|
25408
25675
|
addonId: null,
|
|
25409
25676
|
access: "delete"
|
|
25410
25677
|
},
|
|
25678
|
+
"pipelineAnalytics.deleteDeviceEvents": {
|
|
25679
|
+
capName: "pipeline-analytics",
|
|
25680
|
+
capScope: "device",
|
|
25681
|
+
addonId: null,
|
|
25682
|
+
access: "delete"
|
|
25683
|
+
},
|
|
25411
25684
|
"pipelineAnalytics.deleteTracks": {
|
|
25412
25685
|
capName: "pipeline-analytics",
|
|
25413
25686
|
capScope: "device",
|
|
@@ -25438,6 +25711,12 @@ Object.freeze({
|
|
|
25438
25711
|
addonId: null,
|
|
25439
25712
|
access: "view"
|
|
25440
25713
|
},
|
|
25714
|
+
"pipelineAnalytics.getEventStoreFootprint": {
|
|
25715
|
+
capName: "pipeline-analytics",
|
|
25716
|
+
capScope: "device",
|
|
25717
|
+
addonId: null,
|
|
25718
|
+
access: "view"
|
|
25719
|
+
},
|
|
25441
25720
|
"pipelineAnalytics.getKeyEvents": {
|
|
25442
25721
|
capName: "pipeline-analytics",
|
|
25443
25722
|
capScope: "device",
|
|
@@ -25480,6 +25759,12 @@ Object.freeze({
|
|
|
25480
25759
|
addonId: null,
|
|
25481
25760
|
access: "view"
|
|
25482
25761
|
},
|
|
25762
|
+
"pipelineAnalytics.listOpsLog": {
|
|
25763
|
+
capName: "pipeline-analytics",
|
|
25764
|
+
capScope: "device",
|
|
25765
|
+
addonId: null,
|
|
25766
|
+
access: "view"
|
|
25767
|
+
},
|
|
25483
25768
|
"pipelineAnalytics.listRecentTracks": {
|
|
25484
25769
|
capName: "pipeline-analytics",
|
|
25485
25770
|
capScope: "device",
|
|
@@ -25492,6 +25777,12 @@ Object.freeze({
|
|
|
25492
25777
|
addonId: null,
|
|
25493
25778
|
access: "view"
|
|
25494
25779
|
},
|
|
25780
|
+
"pipelineAnalytics.pruneEvents": {
|
|
25781
|
+
capName: "pipeline-analytics",
|
|
25782
|
+
capScope: "device",
|
|
25783
|
+
addonId: null,
|
|
25784
|
+
access: "create"
|
|
25785
|
+
},
|
|
25495
25786
|
"pipelineAnalytics.pruneEventsBefore": {
|
|
25496
25787
|
capName: "pipeline-analytics",
|
|
25497
25788
|
capScope: "device",
|
|
@@ -26254,6 +26545,12 @@ Object.freeze({
|
|
|
26254
26545
|
addonId: null,
|
|
26255
26546
|
access: "create"
|
|
26256
26547
|
},
|
|
26548
|
+
"recording.deleteFootprint": {
|
|
26549
|
+
capName: "recording",
|
|
26550
|
+
capScope: "system",
|
|
26551
|
+
addonId: null,
|
|
26552
|
+
access: "delete"
|
|
26553
|
+
},
|
|
26257
26554
|
"recording.getAvailability": {
|
|
26258
26555
|
capName: "recording",
|
|
26259
26556
|
capScope: "system",
|
|
@@ -26284,6 +26581,12 @@ Object.freeze({
|
|
|
26284
26581
|
addonId: null,
|
|
26285
26582
|
access: "view"
|
|
26286
26583
|
},
|
|
26584
|
+
"recording.listOpsLog": {
|
|
26585
|
+
capName: "recording",
|
|
26586
|
+
capScope: "system",
|
|
26587
|
+
addonId: null,
|
|
26588
|
+
access: "view"
|
|
26589
|
+
},
|
|
26287
26590
|
"recording.locateSegment": {
|
|
26288
26591
|
capName: "recording",
|
|
26289
26592
|
capScope: "system",
|
|
@@ -26314,6 +26617,42 @@ Object.freeze({
|
|
|
26314
26617
|
addonId: null,
|
|
26315
26618
|
access: "create"
|
|
26316
26619
|
},
|
|
26620
|
+
"recordingExport.cancelExport": {
|
|
26621
|
+
capName: "recordingExport",
|
|
26622
|
+
capScope: "system",
|
|
26623
|
+
addonId: null,
|
|
26624
|
+
access: "create"
|
|
26625
|
+
},
|
|
26626
|
+
"recordingExport.createExport": {
|
|
26627
|
+
capName: "recordingExport",
|
|
26628
|
+
capScope: "system",
|
|
26629
|
+
addonId: null,
|
|
26630
|
+
access: "create"
|
|
26631
|
+
},
|
|
26632
|
+
"recordingExport.deleteExport": {
|
|
26633
|
+
capName: "recordingExport",
|
|
26634
|
+
capScope: "system",
|
|
26635
|
+
addonId: null,
|
|
26636
|
+
access: "delete"
|
|
26637
|
+
},
|
|
26638
|
+
"recordingExport.getDownloadUrl": {
|
|
26639
|
+
capName: "recordingExport",
|
|
26640
|
+
capScope: "system",
|
|
26641
|
+
addonId: null,
|
|
26642
|
+
access: "view"
|
|
26643
|
+
},
|
|
26644
|
+
"recordingExport.getExport": {
|
|
26645
|
+
capName: "recordingExport",
|
|
26646
|
+
capScope: "system",
|
|
26647
|
+
addonId: null,
|
|
26648
|
+
access: "view"
|
|
26649
|
+
},
|
|
26650
|
+
"recordingExport.listExports": {
|
|
26651
|
+
capName: "recordingExport",
|
|
26652
|
+
capScope: "system",
|
|
26653
|
+
addonId: null,
|
|
26654
|
+
access: "view"
|
|
26655
|
+
},
|
|
26317
26656
|
"sceneMonitor.captureReference": {
|
|
26318
26657
|
capName: "scene-monitor",
|
|
26319
26658
|
capScope: "device",
|
package/dist/addon.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createServer } from "http";
|
|
2
2
|
import { EventEmitter } from "events";
|
|
3
3
|
import { createSocket } from "dgram";
|
|
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
|
|
@@ -5195,6 +5219,25 @@ function preprocess(fn, schema) {
|
|
|
5195
5219
|
out: schema
|
|
5196
5220
|
});
|
|
5197
5221
|
}
|
|
5222
|
+
//#endregion
|
|
5223
|
+
//#region ../../node_modules/zod/v4/classic/compat.js
|
|
5224
|
+
/** @deprecated Use the raw string literal codes instead, e.g. "invalid_type". */
|
|
5225
|
+
var ZodIssueCode$1 = {
|
|
5226
|
+
invalid_type: "invalid_type",
|
|
5227
|
+
too_big: "too_big",
|
|
5228
|
+
too_small: "too_small",
|
|
5229
|
+
invalid_format: "invalid_format",
|
|
5230
|
+
not_multiple_of: "not_multiple_of",
|
|
5231
|
+
unrecognized_keys: "unrecognized_keys",
|
|
5232
|
+
invalid_union: "invalid_union",
|
|
5233
|
+
invalid_key: "invalid_key",
|
|
5234
|
+
invalid_element: "invalid_element",
|
|
5235
|
+
invalid_value: "invalid_value",
|
|
5236
|
+
custom: "custom"
|
|
5237
|
+
};
|
|
5238
|
+
/** @deprecated Do not use. Stub definition, only included for zod-to-json-schema compatibility. */
|
|
5239
|
+
var ZodFirstPartyTypeKind$1;
|
|
5240
|
+
ZodFirstPartyTypeKind$1 || (ZodFirstPartyTypeKind$1 = {});
|
|
5198
5241
|
Object.fromEntries([
|
|
5199
5242
|
{
|
|
5200
5243
|
id: "overview",
|
|
@@ -7317,6 +7360,62 @@ var RecordingConfigSchema = object({
|
|
|
7317
7360
|
scrubThumbnails: ScrubThumbnailPresetSchema.optional()
|
|
7318
7361
|
});
|
|
7319
7362
|
/**
|
|
7363
|
+
* Ops-log — the durable, append-only operations audit shared by the
|
|
7364
|
+
* recordings and events management surfaces.
|
|
7365
|
+
*
|
|
7366
|
+
* ONE row shape is reused for both domains so a single "Activity" view can
|
|
7367
|
+
* merge the recorder's DurableState ring (recordings ops-log) and the
|
|
7368
|
+
* pipeline-analytics SQLite collection (events ops-log). Each row records a
|
|
7369
|
+
* management operation, WHY it ran (reason), and its measurable effect
|
|
7370
|
+
* (itemsAffected + bytesReclaimed). Writes are best-effort — a failed log must
|
|
7371
|
+
* never fail the operation it records.
|
|
7372
|
+
*/
|
|
7373
|
+
/** Which management domain the operation belongs to. */
|
|
7374
|
+
var OpsLogDomainSchema = _enum(["recording", "events"]);
|
|
7375
|
+
/** The kind of management operation performed. */
|
|
7376
|
+
var OpsLogOpSchema = _enum([
|
|
7377
|
+
"prune",
|
|
7378
|
+
"manual-delete",
|
|
7379
|
+
"rescan",
|
|
7380
|
+
"retention-run"
|
|
7381
|
+
]);
|
|
7382
|
+
/** Why the operation ran. */
|
|
7383
|
+
var OpsLogReasonSchema = _enum([
|
|
7384
|
+
"retention",
|
|
7385
|
+
"quota",
|
|
7386
|
+
"manual",
|
|
7387
|
+
"operator"
|
|
7388
|
+
]);
|
|
7389
|
+
/** One audit row, shared verbatim by both domains. */
|
|
7390
|
+
var OpsLogEntrySchema = object({
|
|
7391
|
+
/** Unique row id. */
|
|
7392
|
+
id: string(),
|
|
7393
|
+
/** Epoch ms the operation completed. */
|
|
7394
|
+
at: number(),
|
|
7395
|
+
domain: OpsLogDomainSchema,
|
|
7396
|
+
op: OpsLogOpSchema,
|
|
7397
|
+
reason: OpsLogReasonSchema,
|
|
7398
|
+
/** The camera the op targeted; null for a cluster/global op. */
|
|
7399
|
+
deviceId: number().nullable(),
|
|
7400
|
+
/** Node that performed the op (the log carries nodeId — no cross-node aggregation). */
|
|
7401
|
+
nodeId: string(),
|
|
7402
|
+
/** Buckets / rows deleted (op-specific unit). */
|
|
7403
|
+
itemsAffected: number(),
|
|
7404
|
+
/** Bytes reclaimed by the op (0 when not measurable). */
|
|
7405
|
+
bytesReclaimed: number(),
|
|
7406
|
+
/** Free-text detail (e.g. "floor moved to <ts>"); null when none. */
|
|
7407
|
+
detail: string().nullable(),
|
|
7408
|
+
/** Who/what triggered the op. */
|
|
7409
|
+
actor: string()
|
|
7410
|
+
});
|
|
7411
|
+
/** Shared query input for the per-domain `listOpsLog` cap methods. */
|
|
7412
|
+
var OpsLogQueryInputSchema = object({
|
|
7413
|
+
/** Restrict to a single camera; omit for every row. */
|
|
7414
|
+
deviceId: number().optional(),
|
|
7415
|
+
/** Max rows returned, newest-first. */
|
|
7416
|
+
limit: number().int().min(1).max(1e3).optional()
|
|
7417
|
+
});
|
|
7418
|
+
/**
|
|
7320
7419
|
* `StorageLocationType` — an addon-declared id that identifies the *kind* of
|
|
7321
7420
|
* storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
|
|
7322
7421
|
* so the persisted record schema and the consumer-facing cap can both consume it
|
|
@@ -14672,7 +14771,11 @@ array(ZoneRuleSchema).readonly();
|
|
|
14672
14771
|
* Extend the enum here when a new gating consumer comes online (audio
|
|
14673
14772
|
* gating, alert filtering, …) — no other surface needs to change.
|
|
14674
14773
|
*/
|
|
14675
|
-
var ZoneRuleStageEnum = _enum([
|
|
14774
|
+
var ZoneRuleStageEnum = _enum([
|
|
14775
|
+
"motion",
|
|
14776
|
+
"detection",
|
|
14777
|
+
"package"
|
|
14778
|
+
]);
|
|
14676
14779
|
/**
|
|
14677
14780
|
* Runtime registry: cap-property-name → cap definition. `BaseDevice`'s
|
|
14678
14781
|
* `state` getter looks up the cap definition here to construct a
|
|
@@ -14766,16 +14869,25 @@ var DEVICE_LOCAL_STATE_CAPS = {
|
|
|
14766
14869
|
})
|
|
14767
14870
|
},
|
|
14768
14871
|
/**
|
|
14769
|
-
* Runtime-state slice —
|
|
14872
|
+
* Runtime-state slice — every stage mirrored together so consumers
|
|
14770
14873
|
* see one reactive handle (`device.state.zoneRules.value`) instead
|
|
14771
|
-
* of
|
|
14772
|
-
* `{motion, detection}` shape, so subscribers always get the
|
|
14874
|
+
* of one per stage. Bulk-replace mutations on any stage write the full
|
|
14875
|
+
* `{motion, detection, package}` shape, so subscribers always get the
|
|
14773
14876
|
* complete current set. Consumers that only care about one stage
|
|
14774
14877
|
* just read the matching property.
|
|
14878
|
+
*
|
|
14879
|
+
* `package` backs the package-drop detector — a package zone is a
|
|
14880
|
+
* `ZoneRule` on the `'package'` stage referencing drawn polygons
|
|
14881
|
+
* (see docs/superpowers/specs/2026-07-17-package-zones-design.md §3.1).
|
|
14882
|
+
* The orchestrator provider writes this stage as a first-class slice
|
|
14883
|
+
* (Phase 4): every mutation mirrors the full `{motion, detection,
|
|
14884
|
+
* package}` shape, so consumers read the current package rules directly
|
|
14885
|
+
* off `device.state.zoneRules.value.package`.
|
|
14775
14886
|
*/
|
|
14776
14887
|
runtimeState: object({
|
|
14777
14888
|
motion: array(ZoneRuleSchema).readonly(),
|
|
14778
|
-
detection: array(ZoneRuleSchema).readonly()
|
|
14889
|
+
detection: array(ZoneRuleSchema).readonly(),
|
|
14890
|
+
package: array(ZoneRuleSchema).readonly()
|
|
14779
14891
|
})
|
|
14780
14892
|
},
|
|
14781
14893
|
zones: zonesCapability
|
|
@@ -18737,6 +18849,7 @@ var EventKindIconSchema = _enum([
|
|
|
18737
18849
|
"smoke",
|
|
18738
18850
|
"water",
|
|
18739
18851
|
"button",
|
|
18852
|
+
"package",
|
|
18740
18853
|
"generic"
|
|
18741
18854
|
]);
|
|
18742
18855
|
var EventKindCategorySchema = _enum([
|
|
@@ -18744,7 +18857,8 @@ var EventKindCategorySchema = _enum([
|
|
|
18744
18857
|
"audio",
|
|
18745
18858
|
"detection",
|
|
18746
18859
|
"sensor",
|
|
18747
|
-
"custom"
|
|
18860
|
+
"custom",
|
|
18861
|
+
"package"
|
|
18748
18862
|
]);
|
|
18749
18863
|
var EventKindDescriptorSchema = object({
|
|
18750
18864
|
/** Stable kind id (e.g. 'motion', 'person', 'contact'). */
|
|
@@ -19085,6 +19199,26 @@ var TrackCascadeCountsSchema = object({
|
|
|
19085
19199
|
/** Per-track CLIP search vectors removed (best-effort). */
|
|
19086
19200
|
embeddings: number().int()
|
|
19087
19201
|
});
|
|
19202
|
+
/** Event-store footprint for one camera. */
|
|
19203
|
+
var EventStoreDeviceFootprintSchema = object({
|
|
19204
|
+
deviceId: number(),
|
|
19205
|
+
/** Persisted event rows (motion + object + audio) for the camera. */
|
|
19206
|
+
rows: number().int(),
|
|
19207
|
+
/** Event-owned media bytes on disk for the camera. */
|
|
19208
|
+
bytes: number().int()
|
|
19209
|
+
});
|
|
19210
|
+
/** Aggregate event-store footprint: global totals + per-camera breakdown. */
|
|
19211
|
+
var EventStoreFootprintSchema = object({
|
|
19212
|
+
totalRows: number().int(),
|
|
19213
|
+
totalBytes: number().int(),
|
|
19214
|
+
devices: array(EventStoreDeviceFootprintSchema).readonly()
|
|
19215
|
+
});
|
|
19216
|
+
/** Per-kind counts returned by the event-prune / device-delete mutations. */
|
|
19217
|
+
var EventPruneCountsSchema = object({
|
|
19218
|
+
motion: number().int(),
|
|
19219
|
+
object: number().int(),
|
|
19220
|
+
audio: number().int()
|
|
19221
|
+
});
|
|
19088
19222
|
DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).readonly()), method(object({
|
|
19089
19223
|
deviceId: number(),
|
|
19090
19224
|
trackId: string()
|
|
@@ -19148,6 +19282,21 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
19148
19282
|
}), {
|
|
19149
19283
|
kind: "mutation",
|
|
19150
19284
|
auth: "admin"
|
|
19285
|
+
}), method(object({}), EventStoreFootprintSchema, {
|
|
19286
|
+
kind: "query",
|
|
19287
|
+
auth: "admin"
|
|
19288
|
+
}), method(object({
|
|
19289
|
+
olderThanMs: number(),
|
|
19290
|
+
reason: OpsLogReasonSchema.optional()
|
|
19291
|
+
}), EventPruneCountsSchema, {
|
|
19292
|
+
kind: "mutation",
|
|
19293
|
+
auth: "admin"
|
|
19294
|
+
}), method(object({ deviceId: number() }), EventPruneCountsSchema, {
|
|
19295
|
+
kind: "mutation",
|
|
19296
|
+
auth: "admin"
|
|
19297
|
+
}), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
|
|
19298
|
+
kind: "query",
|
|
19299
|
+
auth: "admin"
|
|
19151
19300
|
}), method(object({
|
|
19152
19301
|
eventId: string(),
|
|
19153
19302
|
kind: MediaFileKindEnum.optional()
|
|
@@ -22381,13 +22530,131 @@ method(object({
|
|
|
22381
22530
|
}), method(object({ deviceId: number() }), RecordingStatusSchema, {
|
|
22382
22531
|
kind: "mutation",
|
|
22383
22532
|
auth: "admin"
|
|
22384
|
-
}), method(object({
|
|
22533
|
+
}), method(object({
|
|
22534
|
+
deviceId: number(),
|
|
22535
|
+
reason: OpsLogReasonSchema.optional()
|
|
22536
|
+
}), object({
|
|
22385
22537
|
floorMs: number().nullable(),
|
|
22386
22538
|
deletedBuckets: number().int(),
|
|
22387
22539
|
reclaimedBytes: number().int()
|
|
22388
22540
|
}), {
|
|
22389
22541
|
kind: "mutation",
|
|
22390
22542
|
auth: "admin"
|
|
22543
|
+
}), method(object({
|
|
22544
|
+
deviceId: number(),
|
|
22545
|
+
fromMs: number().optional(),
|
|
22546
|
+
toMs: number().optional()
|
|
22547
|
+
}), object({
|
|
22548
|
+
deletedBuckets: number().int(),
|
|
22549
|
+
reclaimedBytes: number().int()
|
|
22550
|
+
}), {
|
|
22551
|
+
kind: "mutation",
|
|
22552
|
+
auth: "admin"
|
|
22553
|
+
}), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
|
|
22554
|
+
kind: "query",
|
|
22555
|
+
auth: "admin"
|
|
22556
|
+
});
|
|
22557
|
+
/**
|
|
22558
|
+
* `recordingExport` cap — render a footage time range into a single downloadable
|
|
22559
|
+
* MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
|
|
22560
|
+
* bounded lifetime with a durable history, auto-expiry, and optional
|
|
22561
|
+
* delete-after-download.
|
|
22562
|
+
*
|
|
22563
|
+
* Like `recording` this is a `scope:'system', mode:'singleton'` cap: the
|
|
22564
|
+
* recorder self-gates so exactly ONE node (the designated `recordingNodeId`,
|
|
22565
|
+
* default `hub`) registers it. Device-scoped methods carry `deviceId` in their
|
|
22566
|
+
* input and dispatch to that single provider; the render runs on the node that
|
|
22567
|
+
* owns the footage (no cross-node segment transfer). Download rides the
|
|
22568
|
+
* framework addon data-plane. State persists in a DurableState blob (NOT
|
|
22569
|
+
* SQLite); history rows survive file deletion for audit.
|
|
22570
|
+
*/
|
|
22571
|
+
/** Playback-speed multiplier for the render (1 = realtime). */
|
|
22572
|
+
var ExportSpeedSchema = number().min(.25).max(32);
|
|
22573
|
+
/** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
|
|
22574
|
+
var ExportTimelapseSchema = object({
|
|
22575
|
+
everyMs: number().int().positive(),
|
|
22576
|
+
outputFps: number().int().min(1).max(60).optional()
|
|
22577
|
+
});
|
|
22578
|
+
/**
|
|
22579
|
+
* Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
|
|
22580
|
+
* is honoured only for a realtime-ish speed (0.5–2×); timelapse is always
|
|
22581
|
+
* silent. `maxLifeMs` bounds how long the finished file is kept;
|
|
22582
|
+
* `deleteAfterDownload` removes it shortly after the first complete download.
|
|
22583
|
+
*/
|
|
22584
|
+
var ExportOptionsSchema = object({
|
|
22585
|
+
speed: ExportSpeedSchema.optional(),
|
|
22586
|
+
timelapse: ExportTimelapseSchema.optional(),
|
|
22587
|
+
includeAudio: boolean(),
|
|
22588
|
+
maxLifeMs: number().int().positive(),
|
|
22589
|
+
deleteAfterDownload: boolean(),
|
|
22590
|
+
title: string().max(200).optional()
|
|
22591
|
+
}).superRefine((v, ctx) => {
|
|
22592
|
+
if (v.speed !== void 0 && v.timelapse !== void 0) ctx.addIssue({
|
|
22593
|
+
code: ZodIssueCode$1.custom,
|
|
22594
|
+
message: "speed and timelapse are mutually exclusive",
|
|
22595
|
+
path: ["timelapse"]
|
|
22596
|
+
});
|
|
22597
|
+
});
|
|
22598
|
+
var ExportStateSchema = _enum([
|
|
22599
|
+
"queued",
|
|
22600
|
+
"rendering",
|
|
22601
|
+
"ready",
|
|
22602
|
+
"failed",
|
|
22603
|
+
"expired",
|
|
22604
|
+
"deleted"
|
|
22605
|
+
]);
|
|
22606
|
+
/** One export job / history row. */
|
|
22607
|
+
var ExportRecordSchema = object({
|
|
22608
|
+
id: string(),
|
|
22609
|
+
deviceId: number(),
|
|
22610
|
+
profile: string(),
|
|
22611
|
+
fromMs: number(),
|
|
22612
|
+
toMs: number(),
|
|
22613
|
+
options: ExportOptionsSchema,
|
|
22614
|
+
state: ExportStateSchema,
|
|
22615
|
+
/** 0–100 while rendering; null otherwise. */
|
|
22616
|
+
progressPct: number().nullable(),
|
|
22617
|
+
/** File size once ready; null before. */
|
|
22618
|
+
fileBytes: number().nullable(),
|
|
22619
|
+
expiresAt: number(),
|
|
22620
|
+
deleteAfterDownload: boolean(),
|
|
22621
|
+
/** Epoch of the first complete download; null until then. */
|
|
22622
|
+
downloadedAt: number().nullable(),
|
|
22623
|
+
createdAt: number(),
|
|
22624
|
+
/** User id/name that requested the export. */
|
|
22625
|
+
createdBy: string(),
|
|
22626
|
+
/** Failure reason when state is 'failed'; null otherwise. */
|
|
22627
|
+
error: string().nullable()
|
|
22628
|
+
});
|
|
22629
|
+
/** Candidate download URLs (LAN first, then operator extra hosts). */
|
|
22630
|
+
var ExportDownloadSchema = object({
|
|
22631
|
+
url: string(),
|
|
22632
|
+
endpoints: array(string())
|
|
22633
|
+
});
|
|
22634
|
+
method(object({
|
|
22635
|
+
deviceId: number(),
|
|
22636
|
+
profile: string(),
|
|
22637
|
+
fromMs: number(),
|
|
22638
|
+
toMs: number(),
|
|
22639
|
+
options: ExportOptionsSchema
|
|
22640
|
+
}), ExportRecordSchema, {
|
|
22641
|
+
kind: "mutation",
|
|
22642
|
+
auth: "protected"
|
|
22643
|
+
}), method(object({ deviceId: number().optional() }), array(ExportRecordSchema), {
|
|
22644
|
+
kind: "query",
|
|
22645
|
+
auth: "protected"
|
|
22646
|
+
}), method(object({ exportId: string() }), ExportRecordSchema, {
|
|
22647
|
+
kind: "query",
|
|
22648
|
+
auth: "protected"
|
|
22649
|
+
}), method(object({ exportId: string() }), ExportRecordSchema, {
|
|
22650
|
+
kind: "mutation",
|
|
22651
|
+
auth: "protected"
|
|
22652
|
+
}), method(object({ exportId: string() }), ExportRecordSchema, {
|
|
22653
|
+
kind: "mutation",
|
|
22654
|
+
auth: "protected"
|
|
22655
|
+
}), method(object({ exportId: string() }), ExportDownloadSchema, {
|
|
22656
|
+
kind: "query",
|
|
22657
|
+
auth: "protected"
|
|
22391
22658
|
});
|
|
22392
22659
|
/**
|
|
22393
22660
|
* One publishable camera stream as its OWNING PROVIDER describes it — the same
|
|
@@ -25407,6 +25674,12 @@ Object.freeze({
|
|
|
25407
25674
|
addonId: null,
|
|
25408
25675
|
access: "delete"
|
|
25409
25676
|
},
|
|
25677
|
+
"pipelineAnalytics.deleteDeviceEvents": {
|
|
25678
|
+
capName: "pipeline-analytics",
|
|
25679
|
+
capScope: "device",
|
|
25680
|
+
addonId: null,
|
|
25681
|
+
access: "delete"
|
|
25682
|
+
},
|
|
25410
25683
|
"pipelineAnalytics.deleteTracks": {
|
|
25411
25684
|
capName: "pipeline-analytics",
|
|
25412
25685
|
capScope: "device",
|
|
@@ -25437,6 +25710,12 @@ Object.freeze({
|
|
|
25437
25710
|
addonId: null,
|
|
25438
25711
|
access: "view"
|
|
25439
25712
|
},
|
|
25713
|
+
"pipelineAnalytics.getEventStoreFootprint": {
|
|
25714
|
+
capName: "pipeline-analytics",
|
|
25715
|
+
capScope: "device",
|
|
25716
|
+
addonId: null,
|
|
25717
|
+
access: "view"
|
|
25718
|
+
},
|
|
25440
25719
|
"pipelineAnalytics.getKeyEvents": {
|
|
25441
25720
|
capName: "pipeline-analytics",
|
|
25442
25721
|
capScope: "device",
|
|
@@ -25479,6 +25758,12 @@ Object.freeze({
|
|
|
25479
25758
|
addonId: null,
|
|
25480
25759
|
access: "view"
|
|
25481
25760
|
},
|
|
25761
|
+
"pipelineAnalytics.listOpsLog": {
|
|
25762
|
+
capName: "pipeline-analytics",
|
|
25763
|
+
capScope: "device",
|
|
25764
|
+
addonId: null,
|
|
25765
|
+
access: "view"
|
|
25766
|
+
},
|
|
25482
25767
|
"pipelineAnalytics.listRecentTracks": {
|
|
25483
25768
|
capName: "pipeline-analytics",
|
|
25484
25769
|
capScope: "device",
|
|
@@ -25491,6 +25776,12 @@ Object.freeze({
|
|
|
25491
25776
|
addonId: null,
|
|
25492
25777
|
access: "view"
|
|
25493
25778
|
},
|
|
25779
|
+
"pipelineAnalytics.pruneEvents": {
|
|
25780
|
+
capName: "pipeline-analytics",
|
|
25781
|
+
capScope: "device",
|
|
25782
|
+
addonId: null,
|
|
25783
|
+
access: "create"
|
|
25784
|
+
},
|
|
25494
25785
|
"pipelineAnalytics.pruneEventsBefore": {
|
|
25495
25786
|
capName: "pipeline-analytics",
|
|
25496
25787
|
capScope: "device",
|
|
@@ -26253,6 +26544,12 @@ Object.freeze({
|
|
|
26253
26544
|
addonId: null,
|
|
26254
26545
|
access: "create"
|
|
26255
26546
|
},
|
|
26547
|
+
"recording.deleteFootprint": {
|
|
26548
|
+
capName: "recording",
|
|
26549
|
+
capScope: "system",
|
|
26550
|
+
addonId: null,
|
|
26551
|
+
access: "delete"
|
|
26552
|
+
},
|
|
26256
26553
|
"recording.getAvailability": {
|
|
26257
26554
|
capName: "recording",
|
|
26258
26555
|
capScope: "system",
|
|
@@ -26283,6 +26580,12 @@ Object.freeze({
|
|
|
26283
26580
|
addonId: null,
|
|
26284
26581
|
access: "view"
|
|
26285
26582
|
},
|
|
26583
|
+
"recording.listOpsLog": {
|
|
26584
|
+
capName: "recording",
|
|
26585
|
+
capScope: "system",
|
|
26586
|
+
addonId: null,
|
|
26587
|
+
access: "view"
|
|
26588
|
+
},
|
|
26286
26589
|
"recording.locateSegment": {
|
|
26287
26590
|
capName: "recording",
|
|
26288
26591
|
capScope: "system",
|
|
@@ -26313,6 +26616,42 @@ Object.freeze({
|
|
|
26313
26616
|
addonId: null,
|
|
26314
26617
|
access: "create"
|
|
26315
26618
|
},
|
|
26619
|
+
"recordingExport.cancelExport": {
|
|
26620
|
+
capName: "recordingExport",
|
|
26621
|
+
capScope: "system",
|
|
26622
|
+
addonId: null,
|
|
26623
|
+
access: "create"
|
|
26624
|
+
},
|
|
26625
|
+
"recordingExport.createExport": {
|
|
26626
|
+
capName: "recordingExport",
|
|
26627
|
+
capScope: "system",
|
|
26628
|
+
addonId: null,
|
|
26629
|
+
access: "create"
|
|
26630
|
+
},
|
|
26631
|
+
"recordingExport.deleteExport": {
|
|
26632
|
+
capName: "recordingExport",
|
|
26633
|
+
capScope: "system",
|
|
26634
|
+
addonId: null,
|
|
26635
|
+
access: "delete"
|
|
26636
|
+
},
|
|
26637
|
+
"recordingExport.getDownloadUrl": {
|
|
26638
|
+
capName: "recordingExport",
|
|
26639
|
+
capScope: "system",
|
|
26640
|
+
addonId: null,
|
|
26641
|
+
access: "view"
|
|
26642
|
+
},
|
|
26643
|
+
"recordingExport.getExport": {
|
|
26644
|
+
capName: "recordingExport",
|
|
26645
|
+
capScope: "system",
|
|
26646
|
+
addonId: null,
|
|
26647
|
+
access: "view"
|
|
26648
|
+
},
|
|
26649
|
+
"recordingExport.listExports": {
|
|
26650
|
+
capName: "recordingExport",
|
|
26651
|
+
capScope: "system",
|
|
26652
|
+
addonId: null,
|
|
26653
|
+
access: "view"
|
|
26654
|
+
},
|
|
26316
26655
|
"sceneMonitor.captureReference": {
|
|
26317
26656
|
capName: "scene-monitor",
|
|
26318
26657
|
capScope: "device",
|
package/package.json
CHANGED