@camstack/system 1.1.53 → 1.1.54

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.
Files changed (54) hide show
  1. package/dist/addon-runner.js +2 -2
  2. package/dist/addon-runner.mjs +2 -2
  3. package/dist/addon-utils.d.ts +1 -0
  4. package/dist/addon-utils.js +2 -0
  5. package/dist/addon-utils.mjs +2 -2
  6. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  7. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  8. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  9. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  10. package/dist/builtins/alerts/alerts.addon.js +1 -1
  11. package/dist/builtins/alerts/alerts.addon.mjs +1 -1
  12. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +1 -1
  13. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +1 -1
  14. package/dist/builtins/console-logging/index.js +1 -1
  15. package/dist/builtins/console-logging/index.mjs +1 -1
  16. package/dist/builtins/device-manager/device-manager.addon.js +46 -37
  17. package/dist/builtins/device-manager/device-manager.addon.mjs +46 -37
  18. package/dist/builtins/device-manager/device-store-sections.d.ts +26 -0
  19. package/dist/builtins/doorbell/doorbell-settings.d.ts +58 -0
  20. package/dist/builtins/doorbell/trigger-engine.d.ts +32 -30
  21. package/dist/builtins/doorbell/virtual-doorbell.addon.d.ts +39 -22
  22. package/dist/builtins/doorbell/virtual-doorbell.addon.js +207 -191
  23. package/dist/builtins/doorbell/virtual-doorbell.addon.mjs +207 -191
  24. package/dist/builtins/hub-forwarder/index.js +1 -1
  25. package/dist/builtins/hub-forwarder/index.mjs +1 -1
  26. package/dist/builtins/local-auth/local-auth.addon.js +1 -1
  27. package/dist/builtins/local-auth/local-auth.addon.mjs +1 -1
  28. package/dist/builtins/local-network/local-network.addon.js +1 -1
  29. package/dist/builtins/local-network/local-network.addon.mjs +1 -1
  30. package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  31. package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  32. package/dist/builtins/platform-probe/index.js +1 -1
  33. package/dist/builtins/platform-probe/index.mjs +1 -1
  34. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  35. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  36. package/dist/builtins/snapshot/index.js +1 -1
  37. package/dist/builtins/snapshot/index.mjs +1 -1
  38. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  39. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  40. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +1 -1
  41. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +1 -1
  42. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  43. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  44. package/dist/builtins/system-config/system-config.addon.js +1 -1
  45. package/dist/builtins/system-config/system-config.addon.mjs +1 -1
  46. package/dist/builtins/winston-logging/index.js +1 -1
  47. package/dist/builtins/winston-logging/index.mjs +1 -1
  48. package/dist/{dist-BNro5CRu.js → dist-B5C4dVvO.js} +201 -7
  49. package/dist/{dist-D7_69kDt.mjs → dist-DssImRC5.mjs} +201 -7
  50. package/dist/index.js +2 -2
  51. package/dist/index.mjs +2 -2
  52. package/dist/{manifest-python-deps-EM2H-jjS.mjs → manifest-python-deps-CWom-eqp.mjs} +1 -1
  53. package/dist/{manifest-python-deps-DszE7bYn.js → manifest-python-deps-kkvku9yU.js} +1 -1
  54. package/package.json +2 -2
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-BNro5CRu.js");
6
+ const require_dist = require("../../dist-B5C4dVvO.js");
7
7
  let node_fs = require("node:fs");
8
8
  node_fs = require_chunk.__toESM(node_fs);
9
9
  let node_path = require("node:path");
@@ -1,4 +1,4 @@
1
- import { O as filesystemBrowseCapability, Q as storageProviderCapability, it as BaseAddon } from "../../dist-D7_69kDt.mjs";
1
+ import { O as filesystemBrowseCapability, Q as storageProviderCapability, it as BaseAddon } from "../../dist-DssImRC5.mjs";
2
2
  import * as fs from "node:fs";
3
3
  import * as path$1 from "node:path";
4
4
  import { basename, dirname, join, resolve, sep } from "node:path";
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-BNro5CRu.js");
6
+ const require_dist = require("../../dist-B5C4dVvO.js");
7
7
  let node_crypto = require("node:crypto");
8
8
  let better_sqlite3 = require("better-sqlite3");
9
9
  better_sqlite3 = require_chunk.__toESM(better_sqlite3);
@@ -1,4 +1,4 @@
1
- import { Y as settingsStoreCapability, it as BaseAddon, mt as asJsonObject, rt as errMsg, s as RUNTIME_DEFAULTS, wt as parseJsonUnknown } from "../../dist-D7_69kDt.mjs";
1
+ import { Y as settingsStoreCapability, it as BaseAddon, mt as asJsonObject, rt as errMsg, s as RUNTIME_DEFAULTS, wt as parseJsonUnknown } from "../../dist-DssImRC5.mjs";
2
2
  import { randomUUID } from "node:crypto";
3
3
  import Database from "better-sqlite3";
4
4
  //#region src/builtins/sqlite-storage/sqlite-settings-backend.ts
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-BNro5CRu.js");
6
+ const require_dist = require("../../dist-B5C4dVvO.js");
7
7
  let node_path = require("node:path");
8
8
  node_path = require_chunk.__toESM(node_path);
9
9
  let node_fs_promises = require("node:fs/promises");
@@ -1,4 +1,4 @@
1
- import { Ct as parseJsonObject, Z as storageCapability, it as BaseAddon, u as StorageLocationTypeSchema } from "../../dist-D7_69kDt.mjs";
1
+ import { Ct as parseJsonObject, Z as storageCapability, it as BaseAddon, u as StorageLocationTypeSchema } from "../../dist-DssImRC5.mjs";
2
2
  import * as path$1 from "node:path";
3
3
  import * as fs from "node:fs/promises";
4
4
  import { buildStorageLocationRegistry } from "@camstack/system";
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-BNro5CRu.js");
6
+ const require_dist = require("../../dist-B5C4dVvO.js");
7
7
  //#region src/builtins/system-config/system-config.addon.ts
8
8
  /**
9
9
  * Built-in `system-config` addon — Phase 4 of the settings redesign.
@@ -1,4 +1,4 @@
1
- import { it as BaseAddon, rt as errMsg, xt as hydrateSchema } from "../../dist-D7_69kDt.mjs";
1
+ import { it as BaseAddon, rt as errMsg, xt as hydrateSchema } from "../../dist-DssImRC5.mjs";
2
2
  //#region src/builtins/system-config/system-config.addon.ts
3
3
  /**
4
4
  * Built-in `system-config` addon — Phase 4 of the settings redesign.
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-BNro5CRu.js");
6
+ const require_dist = require("../../dist-B5C4dVvO.js");
7
7
  const require_formatter = require("../../formatter-DqAKDlvN.js");
8
8
  let node_path = require("node:path");
9
9
  node_path = require_chunk.__toESM(node_path);
@@ -1,4 +1,4 @@
1
- import { L as logDestinationCapability, it as BaseAddon } from "../../dist-D7_69kDt.mjs";
1
+ import { L as logDestinationCapability, it as BaseAddon } from "../../dist-DssImRC5.mjs";
2
2
  import { t as formatLogLine } from "../../formatter-B7qW8bPJ.mjs";
3
3
  import * as path$1 from "node:path";
4
4
  import path from "node:path";
@@ -1,5 +1,5 @@
1
1
  let zod = require("zod");
2
- //#region ../types/dist/event-category-H4AVePnn.mjs
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
@@ -11156,7 +11180,11 @@ zod.z.array(ZoneRuleSchema).readonly();
11156
11180
  * Extend the enum here when a new gating consumer comes online (audio
11157
11181
  * gating, alert filtering, …) — no other surface needs to change.
11158
11182
  */
11159
- var ZoneRuleStageEnum = zod.z.enum(["motion", "detection"]);
11183
+ var ZoneRuleStageEnum = zod.z.enum([
11184
+ "motion",
11185
+ "detection",
11186
+ "package"
11187
+ ]);
11160
11188
  /**
11161
11189
  * Zone rules capability — per-camera CRUD over the {@link ZoneRule}
11162
11190
  * arrays that decide how each pipeline stage uses the polygon zones.
@@ -11200,16 +11228,24 @@ var zoneRulesCapability = {
11200
11228
  })
11201
11229
  },
11202
11230
  /**
11203
- * Runtime-state slice — both stages mirrored together so consumers
11231
+ * Runtime-state slice — every stage mirrored together so consumers
11204
11232
  * see one reactive handle (`device.state.zoneRules.value`) instead
11205
- * of two. Bulk-replace mutations on either stage write the full
11206
- * `{motion, detection}` shape, so subscribers always get the
11233
+ * of one per stage. Bulk-replace mutations on any stage write the full
11234
+ * `{motion, detection, package}` shape, so subscribers always get the
11207
11235
  * complete current set. Consumers that only care about one stage
11208
11236
  * just read the matching property.
11237
+ *
11238
+ * `package` backs the package-drop detector — a package zone is a
11239
+ * `ZoneRule` on the `'package'` stage referencing drawn polygons
11240
+ * (see docs/superpowers/specs/2026-07-17-package-zones-design.md §3.1).
11241
+ * The orchestrator provider that writes this stage lands in a later
11242
+ * slice; until then the mirror carries only `{motion, detection}` and
11243
+ * consumers read `package` as absent (treat as `[]`).
11209
11244
  */
11210
11245
  runtimeState: zod.z.object({
11211
11246
  motion: zod.z.array(ZoneRuleSchema).readonly(),
11212
- detection: zod.z.array(ZoneRuleSchema).readonly()
11247
+ detection: zod.z.array(ZoneRuleSchema).readonly(),
11248
+ package: zod.z.array(ZoneRuleSchema).readonly()
11213
11249
  })
11214
11250
  };
11215
11251
  var ProviderStatusSchema = zod.z.object({
@@ -15775,6 +15811,7 @@ var EventKindIconSchema = zod.z.enum([
15775
15811
  "smoke",
15776
15812
  "water",
15777
15813
  "button",
15814
+ "package",
15778
15815
  "generic"
15779
15816
  ]);
15780
15817
  var EventKindCategorySchema = zod.z.enum([
@@ -15782,7 +15819,8 @@ var EventKindCategorySchema = zod.z.enum([
15782
15819
  "audio",
15783
15820
  "detection",
15784
15821
  "sensor",
15785
- "custom"
15822
+ "custom",
15823
+ "package"
15786
15824
  ]);
15787
15825
  var EventKindDescriptorSchema = zod.z.object({
15788
15826
  /** Stable kind id (e.g. 'motion', 'person', 'contact'). */
@@ -20919,6 +20957,125 @@ var recordingCapability = {
20919
20957
  }
20920
20958
  };
20921
20959
  /**
20960
+ * `recordingExport` cap — render a footage time range into a single downloadable
20961
+ * MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
20962
+ * bounded lifetime with a durable history, auto-expiry, and optional
20963
+ * delete-after-download.
20964
+ *
20965
+ * Like `recording` this is a `scope:'system', mode:'singleton'` cap: the
20966
+ * recorder self-gates so exactly ONE node (the designated `recordingNodeId`,
20967
+ * default `hub`) registers it. Device-scoped methods carry `deviceId` in their
20968
+ * input and dispatch to that single provider; the render runs on the node that
20969
+ * owns the footage (no cross-node segment transfer). Download rides the
20970
+ * framework addon data-plane. State persists in a DurableState blob (NOT
20971
+ * SQLite); history rows survive file deletion for audit.
20972
+ */
20973
+ /** Playback-speed multiplier for the render (1 = realtime). */
20974
+ var ExportSpeedSchema = zod.z.number().min(.25).max(32);
20975
+ /** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
20976
+ var ExportTimelapseSchema = zod.z.object({
20977
+ everyMs: zod.z.number().int().positive(),
20978
+ outputFps: zod.z.number().int().min(1).max(60).optional()
20979
+ });
20980
+ /**
20981
+ * Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
20982
+ * is honoured only for a realtime-ish speed (0.5–2×); timelapse is always
20983
+ * silent. `maxLifeMs` bounds how long the finished file is kept;
20984
+ * `deleteAfterDownload` removes it shortly after the first complete download.
20985
+ */
20986
+ var ExportOptionsSchema = zod.z.object({
20987
+ speed: ExportSpeedSchema.optional(),
20988
+ timelapse: ExportTimelapseSchema.optional(),
20989
+ includeAudio: zod.z.boolean(),
20990
+ maxLifeMs: zod.z.number().int().positive(),
20991
+ deleteAfterDownload: zod.z.boolean(),
20992
+ title: zod.z.string().max(200).optional()
20993
+ }).superRefine((v, ctx) => {
20994
+ if (v.speed !== void 0 && v.timelapse !== void 0) ctx.addIssue({
20995
+ code: zod.z.ZodIssueCode.custom,
20996
+ message: "speed and timelapse are mutually exclusive",
20997
+ path: ["timelapse"]
20998
+ });
20999
+ });
21000
+ var ExportStateSchema = zod.z.enum([
21001
+ "queued",
21002
+ "rendering",
21003
+ "ready",
21004
+ "failed",
21005
+ "expired",
21006
+ "deleted"
21007
+ ]);
21008
+ /** One export job / history row. */
21009
+ var ExportRecordSchema = zod.z.object({
21010
+ id: zod.z.string(),
21011
+ deviceId: zod.z.number(),
21012
+ profile: zod.z.string(),
21013
+ fromMs: zod.z.number(),
21014
+ toMs: zod.z.number(),
21015
+ options: ExportOptionsSchema,
21016
+ state: ExportStateSchema,
21017
+ /** 0–100 while rendering; null otherwise. */
21018
+ progressPct: zod.z.number().nullable(),
21019
+ /** File size once ready; null before. */
21020
+ fileBytes: zod.z.number().nullable(),
21021
+ expiresAt: zod.z.number(),
21022
+ deleteAfterDownload: zod.z.boolean(),
21023
+ /** Epoch of the first complete download; null until then. */
21024
+ downloadedAt: zod.z.number().nullable(),
21025
+ createdAt: zod.z.number(),
21026
+ /** User id/name that requested the export. */
21027
+ createdBy: zod.z.string(),
21028
+ /** Failure reason when state is 'failed'; null otherwise. */
21029
+ error: zod.z.string().nullable()
21030
+ });
21031
+ /** Candidate download URLs (LAN first, then operator extra hosts). */
21032
+ var ExportDownloadSchema = zod.z.object({
21033
+ url: zod.z.string(),
21034
+ endpoints: zod.z.array(zod.z.string())
21035
+ });
21036
+ var recordingExportCapability = {
21037
+ name: "recordingExport",
21038
+ scope: "system",
21039
+ mode: "singleton",
21040
+ methods: {
21041
+ /** Queue a render of `[fromMs,toMs)` for `deviceId`/`profile`. Fails fast
21042
+ * when no footage covers the range. Returns the queued record. */
21043
+ createExport: method(zod.z.object({
21044
+ deviceId: zod.z.number(),
21045
+ profile: zod.z.string(),
21046
+ fromMs: zod.z.number(),
21047
+ toMs: zod.z.number(),
21048
+ options: ExportOptionsSchema
21049
+ }), ExportRecordSchema, {
21050
+ kind: "mutation",
21051
+ auth: "protected"
21052
+ }),
21053
+ /** All export rows (history included), optionally scoped to one device. */
21054
+ listExports: method(zod.z.object({ deviceId: zod.z.number().optional() }), zod.z.array(ExportRecordSchema), {
21055
+ kind: "query",
21056
+ auth: "protected"
21057
+ }),
21058
+ getExport: method(zod.z.object({ exportId: zod.z.string() }), ExportRecordSchema, {
21059
+ kind: "query",
21060
+ auth: "protected"
21061
+ }),
21062
+ /** Abort a queued/rendering export; the partial file is removed. */
21063
+ cancelExport: method(zod.z.object({ exportId: zod.z.string() }), ExportRecordSchema, {
21064
+ kind: "mutation",
21065
+ auth: "protected"
21066
+ }),
21067
+ /** Remove the file but keep the history row (state → 'deleted'). */
21068
+ deleteExport: method(zod.z.object({ exportId: zod.z.string() }), ExportRecordSchema, {
21069
+ kind: "mutation",
21070
+ auth: "protected"
21071
+ }),
21072
+ getDownloadUrl: method(zod.z.object({ exportId: zod.z.string() }), ExportDownloadSchema, {
21073
+ kind: "query",
21074
+ auth: "protected"
21075
+ })
21076
+ }
21077
+ };
21078
+ /**
20922
21079
  * One publishable camera stream as its OWNING PROVIDER describes it — the same
20923
21080
  * payload the (legacy) push `streamBroker.publishCameraStream` carried, minus
20924
21081
  * `deviceId`.
@@ -21680,6 +21837,7 @@ var ALL_CAPABILITY_DEFINITIONS = [
21680
21837
  ptzAutotrackCapability,
21681
21838
  rebootCapability,
21682
21839
  recordingCapability,
21840
+ recordingExportCapability,
21683
21841
  sceneMonitorCapability,
21684
21842
  scriptRunnerCapability,
21685
21843
  serverManagementCapability,
@@ -25403,6 +25561,42 @@ var METHOD_ACCESS_MAP = Object.freeze({
25403
25561
  addonId: null,
25404
25562
  access: "create"
25405
25563
  },
25564
+ "recordingExport.cancelExport": {
25565
+ capName: "recordingExport",
25566
+ capScope: "system",
25567
+ addonId: null,
25568
+ access: "create"
25569
+ },
25570
+ "recordingExport.createExport": {
25571
+ capName: "recordingExport",
25572
+ capScope: "system",
25573
+ addonId: null,
25574
+ access: "create"
25575
+ },
25576
+ "recordingExport.deleteExport": {
25577
+ capName: "recordingExport",
25578
+ capScope: "system",
25579
+ addonId: null,
25580
+ access: "delete"
25581
+ },
25582
+ "recordingExport.getDownloadUrl": {
25583
+ capName: "recordingExport",
25584
+ capScope: "system",
25585
+ addonId: null,
25586
+ access: "view"
25587
+ },
25588
+ "recordingExport.getExport": {
25589
+ capName: "recordingExport",
25590
+ capScope: "system",
25591
+ addonId: null,
25592
+ access: "view"
25593
+ },
25594
+ "recordingExport.listExports": {
25595
+ capName: "recordingExport",
25596
+ capScope: "system",
25597
+ addonId: null,
25598
+ access: "view"
25599
+ },
25406
25600
  "sceneMonitor.captureReference": {
25407
25601
  capName: "scene-monitor",
25408
25602
  capScope: "device",
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- //#region ../types/dist/event-category-H4AVePnn.mjs
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
@@ -11156,7 +11180,11 @@ z.array(ZoneRuleSchema).readonly();
11156
11180
  * Extend the enum here when a new gating consumer comes online (audio
11157
11181
  * gating, alert filtering, …) — no other surface needs to change.
11158
11182
  */
11159
- var ZoneRuleStageEnum = z.enum(["motion", "detection"]);
11183
+ var ZoneRuleStageEnum = z.enum([
11184
+ "motion",
11185
+ "detection",
11186
+ "package"
11187
+ ]);
11160
11188
  /**
11161
11189
  * Zone rules capability — per-camera CRUD over the {@link ZoneRule}
11162
11190
  * arrays that decide how each pipeline stage uses the polygon zones.
@@ -11200,16 +11228,24 @@ var zoneRulesCapability = {
11200
11228
  })
11201
11229
  },
11202
11230
  /**
11203
- * Runtime-state slice — both stages mirrored together so consumers
11231
+ * Runtime-state slice — every stage mirrored together so consumers
11204
11232
  * see one reactive handle (`device.state.zoneRules.value`) instead
11205
- * of two. Bulk-replace mutations on either stage write the full
11206
- * `{motion, detection}` shape, so subscribers always get the
11233
+ * of one per stage. Bulk-replace mutations on any stage write the full
11234
+ * `{motion, detection, package}` shape, so subscribers always get the
11207
11235
  * complete current set. Consumers that only care about one stage
11208
11236
  * just read the matching property.
11237
+ *
11238
+ * `package` backs the package-drop detector — a package zone is a
11239
+ * `ZoneRule` on the `'package'` stage referencing drawn polygons
11240
+ * (see docs/superpowers/specs/2026-07-17-package-zones-design.md §3.1).
11241
+ * The orchestrator provider that writes this stage lands in a later
11242
+ * slice; until then the mirror carries only `{motion, detection}` and
11243
+ * consumers read `package` as absent (treat as `[]`).
11209
11244
  */
11210
11245
  runtimeState: z.object({
11211
11246
  motion: z.array(ZoneRuleSchema).readonly(),
11212
- detection: z.array(ZoneRuleSchema).readonly()
11247
+ detection: z.array(ZoneRuleSchema).readonly(),
11248
+ package: z.array(ZoneRuleSchema).readonly()
11213
11249
  })
11214
11250
  };
11215
11251
  var ProviderStatusSchema = z.object({
@@ -15775,6 +15811,7 @@ var EventKindIconSchema = z.enum([
15775
15811
  "smoke",
15776
15812
  "water",
15777
15813
  "button",
15814
+ "package",
15778
15815
  "generic"
15779
15816
  ]);
15780
15817
  var EventKindCategorySchema = z.enum([
@@ -15782,7 +15819,8 @@ var EventKindCategorySchema = z.enum([
15782
15819
  "audio",
15783
15820
  "detection",
15784
15821
  "sensor",
15785
- "custom"
15822
+ "custom",
15823
+ "package"
15786
15824
  ]);
15787
15825
  var EventKindDescriptorSchema = z.object({
15788
15826
  /** Stable kind id (e.g. 'motion', 'person', 'contact'). */
@@ -20919,6 +20957,125 @@ var recordingCapability = {
20919
20957
  }
20920
20958
  };
20921
20959
  /**
20960
+ * `recordingExport` cap — render a footage time range into a single downloadable
20961
+ * MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
20962
+ * bounded lifetime with a durable history, auto-expiry, and optional
20963
+ * delete-after-download.
20964
+ *
20965
+ * Like `recording` this is a `scope:'system', mode:'singleton'` cap: the
20966
+ * recorder self-gates so exactly ONE node (the designated `recordingNodeId`,
20967
+ * default `hub`) registers it. Device-scoped methods carry `deviceId` in their
20968
+ * input and dispatch to that single provider; the render runs on the node that
20969
+ * owns the footage (no cross-node segment transfer). Download rides the
20970
+ * framework addon data-plane. State persists in a DurableState blob (NOT
20971
+ * SQLite); history rows survive file deletion for audit.
20972
+ */
20973
+ /** Playback-speed multiplier for the render (1 = realtime). */
20974
+ var ExportSpeedSchema = z.number().min(.25).max(32);
20975
+ /** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
20976
+ var ExportTimelapseSchema = z.object({
20977
+ everyMs: z.number().int().positive(),
20978
+ outputFps: z.number().int().min(1).max(60).optional()
20979
+ });
20980
+ /**
20981
+ * Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
20982
+ * is honoured only for a realtime-ish speed (0.5–2×); timelapse is always
20983
+ * silent. `maxLifeMs` bounds how long the finished file is kept;
20984
+ * `deleteAfterDownload` removes it shortly after the first complete download.
20985
+ */
20986
+ var ExportOptionsSchema = z.object({
20987
+ speed: ExportSpeedSchema.optional(),
20988
+ timelapse: ExportTimelapseSchema.optional(),
20989
+ includeAudio: z.boolean(),
20990
+ maxLifeMs: z.number().int().positive(),
20991
+ deleteAfterDownload: z.boolean(),
20992
+ title: z.string().max(200).optional()
20993
+ }).superRefine((v, ctx) => {
20994
+ if (v.speed !== void 0 && v.timelapse !== void 0) ctx.addIssue({
20995
+ code: z.ZodIssueCode.custom,
20996
+ message: "speed and timelapse are mutually exclusive",
20997
+ path: ["timelapse"]
20998
+ });
20999
+ });
21000
+ var ExportStateSchema = z.enum([
21001
+ "queued",
21002
+ "rendering",
21003
+ "ready",
21004
+ "failed",
21005
+ "expired",
21006
+ "deleted"
21007
+ ]);
21008
+ /** One export job / history row. */
21009
+ var ExportRecordSchema = z.object({
21010
+ id: z.string(),
21011
+ deviceId: z.number(),
21012
+ profile: z.string(),
21013
+ fromMs: z.number(),
21014
+ toMs: z.number(),
21015
+ options: ExportOptionsSchema,
21016
+ state: ExportStateSchema,
21017
+ /** 0–100 while rendering; null otherwise. */
21018
+ progressPct: z.number().nullable(),
21019
+ /** File size once ready; null before. */
21020
+ fileBytes: z.number().nullable(),
21021
+ expiresAt: z.number(),
21022
+ deleteAfterDownload: z.boolean(),
21023
+ /** Epoch of the first complete download; null until then. */
21024
+ downloadedAt: z.number().nullable(),
21025
+ createdAt: z.number(),
21026
+ /** User id/name that requested the export. */
21027
+ createdBy: z.string(),
21028
+ /** Failure reason when state is 'failed'; null otherwise. */
21029
+ error: z.string().nullable()
21030
+ });
21031
+ /** Candidate download URLs (LAN first, then operator extra hosts). */
21032
+ var ExportDownloadSchema = z.object({
21033
+ url: z.string(),
21034
+ endpoints: z.array(z.string())
21035
+ });
21036
+ var recordingExportCapability = {
21037
+ name: "recordingExport",
21038
+ scope: "system",
21039
+ mode: "singleton",
21040
+ methods: {
21041
+ /** Queue a render of `[fromMs,toMs)` for `deviceId`/`profile`. Fails fast
21042
+ * when no footage covers the range. Returns the queued record. */
21043
+ createExport: method(z.object({
21044
+ deviceId: z.number(),
21045
+ profile: z.string(),
21046
+ fromMs: z.number(),
21047
+ toMs: z.number(),
21048
+ options: ExportOptionsSchema
21049
+ }), ExportRecordSchema, {
21050
+ kind: "mutation",
21051
+ auth: "protected"
21052
+ }),
21053
+ /** All export rows (history included), optionally scoped to one device. */
21054
+ listExports: method(z.object({ deviceId: z.number().optional() }), z.array(ExportRecordSchema), {
21055
+ kind: "query",
21056
+ auth: "protected"
21057
+ }),
21058
+ getExport: method(z.object({ exportId: z.string() }), ExportRecordSchema, {
21059
+ kind: "query",
21060
+ auth: "protected"
21061
+ }),
21062
+ /** Abort a queued/rendering export; the partial file is removed. */
21063
+ cancelExport: method(z.object({ exportId: z.string() }), ExportRecordSchema, {
21064
+ kind: "mutation",
21065
+ auth: "protected"
21066
+ }),
21067
+ /** Remove the file but keep the history row (state → 'deleted'). */
21068
+ deleteExport: method(z.object({ exportId: z.string() }), ExportRecordSchema, {
21069
+ kind: "mutation",
21070
+ auth: "protected"
21071
+ }),
21072
+ getDownloadUrl: method(z.object({ exportId: z.string() }), ExportDownloadSchema, {
21073
+ kind: "query",
21074
+ auth: "protected"
21075
+ })
21076
+ }
21077
+ };
21078
+ /**
20922
21079
  * One publishable camera stream as its OWNING PROVIDER describes it — the same
20923
21080
  * payload the (legacy) push `streamBroker.publishCameraStream` carried, minus
20924
21081
  * `deviceId`.
@@ -21680,6 +21837,7 @@ var ALL_CAPABILITY_DEFINITIONS = [
21680
21837
  ptzAutotrackCapability,
21681
21838
  rebootCapability,
21682
21839
  recordingCapability,
21840
+ recordingExportCapability,
21683
21841
  sceneMonitorCapability,
21684
21842
  scriptRunnerCapability,
21685
21843
  serverManagementCapability,
@@ -25403,6 +25561,42 @@ var METHOD_ACCESS_MAP = Object.freeze({
25403
25561
  addonId: null,
25404
25562
  access: "create"
25405
25563
  },
25564
+ "recordingExport.cancelExport": {
25565
+ capName: "recordingExport",
25566
+ capScope: "system",
25567
+ addonId: null,
25568
+ access: "create"
25569
+ },
25570
+ "recordingExport.createExport": {
25571
+ capName: "recordingExport",
25572
+ capScope: "system",
25573
+ addonId: null,
25574
+ access: "create"
25575
+ },
25576
+ "recordingExport.deleteExport": {
25577
+ capName: "recordingExport",
25578
+ capScope: "system",
25579
+ addonId: null,
25580
+ access: "delete"
25581
+ },
25582
+ "recordingExport.getDownloadUrl": {
25583
+ capName: "recordingExport",
25584
+ capScope: "system",
25585
+ addonId: null,
25586
+ access: "view"
25587
+ },
25588
+ "recordingExport.getExport": {
25589
+ capName: "recordingExport",
25590
+ capScope: "system",
25591
+ addonId: null,
25592
+ access: "view"
25593
+ },
25594
+ "recordingExport.listExports": {
25595
+ capName: "recordingExport",
25596
+ capScope: "system",
25597
+ addonId: null,
25598
+ access: "view"
25599
+ },
25406
25600
  "sceneMonitor.captureReference": {
25407
25601
  capName: "scene-monitor",
25408
25602
  capScope: "device",
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_chunk = require("./chunk-Cek0wNdY.js");
3
- const require_dist = require("./dist-BNro5CRu.js");
3
+ const require_dist = require("./dist-B5C4dVvO.js");
4
4
  const require_model_download_service = require("./model-download-service-hf0ookyy.js");
5
- const require_manifest_python_deps = require("./manifest-python-deps-DszE7bYn.js");
5
+ const require_manifest_python_deps = require("./manifest-python-deps-kkvku9yU.js");
6
6
  const require_resource_monitor = require("./resource-monitor-DNNomR-i.js");
7
7
  const require_builtins_sqlite_storage_filesystem_storage_addon = require("./builtins/sqlite-storage/filesystem-storage.addon.js");
8
8
  const require_builtins_sqlite_storage_sqlite_settings_addon = require("./builtins/sqlite-storage/sqlite-settings.addon.js");