@camstack/addon-provider-ecowitt 0.1.23 → 0.1.25

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 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-H4AVePnn.mjs
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",
@@ -7254,6 +7297,24 @@ var RecordingRetentionSchema = object({
7254
7297
  maxSizeGb: number().min(0).optional()
7255
7298
  });
7256
7299
  /**
7300
+ * Scrub-thumbnail fidelity preset — the single per-camera selector bundling the
7301
+ * sprite tile RESOLUTION + JPEG QUALITY the recorder packs timeline-scrub
7302
+ * previews at. Five graduated steps; absent on a config = `standard` (the
7303
+ * shipped default, matching `sheet-geometry`/`sheet-composer`).
7304
+ *
7305
+ * Existing sheets are IMMUTABLE — a changed preset applies to NEW windows only.
7306
+ * Each window's index sidecar carries its own tile dims, so a camera whose
7307
+ * preset changed over time renders every historical window at the dims it was
7308
+ * written with.
7309
+ */
7310
+ var ScrubThumbnailPresetSchema = _enum([
7311
+ "minimal",
7312
+ "low",
7313
+ "standard",
7314
+ "high",
7315
+ "max"
7316
+ ]);
7317
+ /**
7257
7318
  * The full per-camera recording intent — the wire shape of a RecordingTarget.
7258
7319
  *
7259
7320
  * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
@@ -7290,7 +7351,14 @@ var RecordingConfigSchema = object({
7290
7351
  * derived into bands once via `migrateConfigToBands`.
7291
7352
  */
7292
7353
  bands: array(RecordingBandSchema).optional(),
7293
- retention: RecordingRetentionSchema.optional()
7354
+ retention: RecordingRetentionSchema.optional(),
7355
+ /**
7356
+ * Per-camera scrub-thumbnail fidelity preset (resolution + JPEG quality for
7357
+ * timeline-scrub sprite previews). Absent = `standard`. Applies to NEW
7358
+ * windows only — existing sheets are immutable, and each window's index
7359
+ * carries its own tile dims so mixed-preset history renders correctly.
7360
+ */
7361
+ scrubThumbnails: ScrubThumbnailPresetSchema.optional()
7294
7362
  });
7295
7363
  /**
7296
7364
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
@@ -14648,7 +14716,11 @@ array(ZoneRuleSchema).readonly();
14648
14716
  * Extend the enum here when a new gating consumer comes online (audio
14649
14717
  * gating, alert filtering, …) — no other surface needs to change.
14650
14718
  */
14651
- var ZoneRuleStageEnum = _enum(["motion", "detection"]);
14719
+ var ZoneRuleStageEnum = _enum([
14720
+ "motion",
14721
+ "detection",
14722
+ "package"
14723
+ ]);
14652
14724
  /**
14653
14725
  * Runtime registry: cap-property-name → cap definition. `BaseDevice`'s
14654
14726
  * `state` getter looks up the cap definition here to construct a
@@ -14742,16 +14814,24 @@ var DEVICE_LOCAL_STATE_CAPS = {
14742
14814
  })
14743
14815
  },
14744
14816
  /**
14745
- * Runtime-state slice — both stages mirrored together so consumers
14817
+ * Runtime-state slice — every stage mirrored together so consumers
14746
14818
  * see one reactive handle (`device.state.zoneRules.value`) instead
14747
- * of two. Bulk-replace mutations on either stage write the full
14748
- * `{motion, detection}` shape, so subscribers always get the
14819
+ * of one per stage. Bulk-replace mutations on any stage write the full
14820
+ * `{motion, detection, package}` shape, so subscribers always get the
14749
14821
  * complete current set. Consumers that only care about one stage
14750
14822
  * just read the matching property.
14823
+ *
14824
+ * `package` backs the package-drop detector — a package zone is a
14825
+ * `ZoneRule` on the `'package'` stage referencing drawn polygons
14826
+ * (see docs/superpowers/specs/2026-07-17-package-zones-design.md §3.1).
14827
+ * The orchestrator provider that writes this stage lands in a later
14828
+ * slice; until then the mirror carries only `{motion, detection}` and
14829
+ * consumers read `package` as absent (treat as `[]`).
14751
14830
  */
14752
14831
  runtimeState: object({
14753
14832
  motion: array(ZoneRuleSchema).readonly(),
14754
- detection: array(ZoneRuleSchema).readonly()
14833
+ detection: array(ZoneRuleSchema).readonly(),
14834
+ package: array(ZoneRuleSchema).readonly()
14755
14835
  })
14756
14836
  },
14757
14837
  zones: zonesCapability
@@ -18713,6 +18793,7 @@ var EventKindIconSchema = _enum([
18713
18793
  "smoke",
18714
18794
  "water",
18715
18795
  "button",
18796
+ "package",
18716
18797
  "generic"
18717
18798
  ]);
18718
18799
  var EventKindCategorySchema = _enum([
@@ -18720,7 +18801,8 @@ var EventKindCategorySchema = _enum([
18720
18801
  "audio",
18721
18802
  "detection",
18722
18803
  "sensor",
18723
- "custom"
18804
+ "custom",
18805
+ "package"
18724
18806
  ]);
18725
18807
  var EventKindDescriptorSchema = object({
18726
18808
  /** Stable kind id (e.g. 'motion', 'person', 'contact'). */
@@ -22366,6 +22448,108 @@ method(object({
22366
22448
  auth: "admin"
22367
22449
  });
22368
22450
  /**
22451
+ * `recordingExport` cap — render a footage time range into a single downloadable
22452
+ * MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
22453
+ * bounded lifetime with a durable history, auto-expiry, and optional
22454
+ * delete-after-download.
22455
+ *
22456
+ * Like `recording` this is a `scope:'system', mode:'singleton'` cap: the
22457
+ * recorder self-gates so exactly ONE node (the designated `recordingNodeId`,
22458
+ * default `hub`) registers it. Device-scoped methods carry `deviceId` in their
22459
+ * input and dispatch to that single provider; the render runs on the node that
22460
+ * owns the footage (no cross-node segment transfer). Download rides the
22461
+ * framework addon data-plane. State persists in a DurableState blob (NOT
22462
+ * SQLite); history rows survive file deletion for audit.
22463
+ */
22464
+ /** Playback-speed multiplier for the render (1 = realtime). */
22465
+ var ExportSpeedSchema = number().min(.25).max(32);
22466
+ /** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
22467
+ var ExportTimelapseSchema = object({
22468
+ everyMs: number().int().positive(),
22469
+ outputFps: number().int().min(1).max(60).optional()
22470
+ });
22471
+ /**
22472
+ * Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
22473
+ * is honoured only for a realtime-ish speed (0.5–2×); timelapse is always
22474
+ * silent. `maxLifeMs` bounds how long the finished file is kept;
22475
+ * `deleteAfterDownload` removes it shortly after the first complete download.
22476
+ */
22477
+ var ExportOptionsSchema = object({
22478
+ speed: ExportSpeedSchema.optional(),
22479
+ timelapse: ExportTimelapseSchema.optional(),
22480
+ includeAudio: boolean(),
22481
+ maxLifeMs: number().int().positive(),
22482
+ deleteAfterDownload: boolean(),
22483
+ title: string().max(200).optional()
22484
+ }).superRefine((v, ctx) => {
22485
+ if (v.speed !== void 0 && v.timelapse !== void 0) ctx.addIssue({
22486
+ code: ZodIssueCode$1.custom,
22487
+ message: "speed and timelapse are mutually exclusive",
22488
+ path: ["timelapse"]
22489
+ });
22490
+ });
22491
+ var ExportStateSchema = _enum([
22492
+ "queued",
22493
+ "rendering",
22494
+ "ready",
22495
+ "failed",
22496
+ "expired",
22497
+ "deleted"
22498
+ ]);
22499
+ /** One export job / history row. */
22500
+ var ExportRecordSchema = object({
22501
+ id: string(),
22502
+ deviceId: number(),
22503
+ profile: string(),
22504
+ fromMs: number(),
22505
+ toMs: number(),
22506
+ options: ExportOptionsSchema,
22507
+ state: ExportStateSchema,
22508
+ /** 0–100 while rendering; null otherwise. */
22509
+ progressPct: number().nullable(),
22510
+ /** File size once ready; null before. */
22511
+ fileBytes: number().nullable(),
22512
+ expiresAt: number(),
22513
+ deleteAfterDownload: boolean(),
22514
+ /** Epoch of the first complete download; null until then. */
22515
+ downloadedAt: number().nullable(),
22516
+ createdAt: number(),
22517
+ /** User id/name that requested the export. */
22518
+ createdBy: string(),
22519
+ /** Failure reason when state is 'failed'; null otherwise. */
22520
+ error: string().nullable()
22521
+ });
22522
+ /** Candidate download URLs (LAN first, then operator extra hosts). */
22523
+ var ExportDownloadSchema = object({
22524
+ url: string(),
22525
+ endpoints: array(string())
22526
+ });
22527
+ method(object({
22528
+ deviceId: number(),
22529
+ profile: string(),
22530
+ fromMs: number(),
22531
+ toMs: number(),
22532
+ options: ExportOptionsSchema
22533
+ }), ExportRecordSchema, {
22534
+ kind: "mutation",
22535
+ auth: "protected"
22536
+ }), method(object({ deviceId: number().optional() }), array(ExportRecordSchema), {
22537
+ kind: "query",
22538
+ auth: "protected"
22539
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
22540
+ kind: "query",
22541
+ auth: "protected"
22542
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
22543
+ kind: "mutation",
22544
+ auth: "protected"
22545
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
22546
+ kind: "mutation",
22547
+ auth: "protected"
22548
+ }), method(object({ exportId: string() }), ExportDownloadSchema, {
22549
+ kind: "query",
22550
+ auth: "protected"
22551
+ });
22552
+ /**
22369
22553
  * One publishable camera stream as its OWNING PROVIDER describes it — the same
22370
22554
  * payload the (legacy) push `streamBroker.publishCameraStream` carried, minus
22371
22555
  * `deviceId`.
@@ -26289,6 +26473,42 @@ Object.freeze({
26289
26473
  addonId: null,
26290
26474
  access: "create"
26291
26475
  },
26476
+ "recordingExport.cancelExport": {
26477
+ capName: "recordingExport",
26478
+ capScope: "system",
26479
+ addonId: null,
26480
+ access: "create"
26481
+ },
26482
+ "recordingExport.createExport": {
26483
+ capName: "recordingExport",
26484
+ capScope: "system",
26485
+ addonId: null,
26486
+ access: "create"
26487
+ },
26488
+ "recordingExport.deleteExport": {
26489
+ capName: "recordingExport",
26490
+ capScope: "system",
26491
+ addonId: null,
26492
+ access: "delete"
26493
+ },
26494
+ "recordingExport.getDownloadUrl": {
26495
+ capName: "recordingExport",
26496
+ capScope: "system",
26497
+ addonId: null,
26498
+ access: "view"
26499
+ },
26500
+ "recordingExport.getExport": {
26501
+ capName: "recordingExport",
26502
+ capScope: "system",
26503
+ addonId: null,
26504
+ access: "view"
26505
+ },
26506
+ "recordingExport.listExports": {
26507
+ capName: "recordingExport",
26508
+ capScope: "system",
26509
+ addonId: null,
26510
+ access: "view"
26511
+ },
26292
26512
  "sceneMonitor.captureReference": {
26293
26513
  capName: "scene-monitor",
26294
26514
  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-H4AVePnn.mjs
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",
@@ -7253,6 +7296,24 @@ var RecordingRetentionSchema = object({
7253
7296
  maxSizeGb: number().min(0).optional()
7254
7297
  });
7255
7298
  /**
7299
+ * Scrub-thumbnail fidelity preset — the single per-camera selector bundling the
7300
+ * sprite tile RESOLUTION + JPEG QUALITY the recorder packs timeline-scrub
7301
+ * previews at. Five graduated steps; absent on a config = `standard` (the
7302
+ * shipped default, matching `sheet-geometry`/`sheet-composer`).
7303
+ *
7304
+ * Existing sheets are IMMUTABLE — a changed preset applies to NEW windows only.
7305
+ * Each window's index sidecar carries its own tile dims, so a camera whose
7306
+ * preset changed over time renders every historical window at the dims it was
7307
+ * written with.
7308
+ */
7309
+ var ScrubThumbnailPresetSchema = _enum([
7310
+ "minimal",
7311
+ "low",
7312
+ "standard",
7313
+ "high",
7314
+ "max"
7315
+ ]);
7316
+ /**
7256
7317
  * The full per-camera recording intent — the wire shape of a RecordingTarget.
7257
7318
  *
7258
7319
  * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
@@ -7289,7 +7350,14 @@ var RecordingConfigSchema = object({
7289
7350
  * derived into bands once via `migrateConfigToBands`.
7290
7351
  */
7291
7352
  bands: array(RecordingBandSchema).optional(),
7292
- retention: RecordingRetentionSchema.optional()
7353
+ retention: RecordingRetentionSchema.optional(),
7354
+ /**
7355
+ * Per-camera scrub-thumbnail fidelity preset (resolution + JPEG quality for
7356
+ * timeline-scrub sprite previews). Absent = `standard`. Applies to NEW
7357
+ * windows only — existing sheets are immutable, and each window's index
7358
+ * carries its own tile dims so mixed-preset history renders correctly.
7359
+ */
7360
+ scrubThumbnails: ScrubThumbnailPresetSchema.optional()
7293
7361
  });
7294
7362
  /**
7295
7363
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
@@ -14647,7 +14715,11 @@ array(ZoneRuleSchema).readonly();
14647
14715
  * Extend the enum here when a new gating consumer comes online (audio
14648
14716
  * gating, alert filtering, …) — no other surface needs to change.
14649
14717
  */
14650
- var ZoneRuleStageEnum = _enum(["motion", "detection"]);
14718
+ var ZoneRuleStageEnum = _enum([
14719
+ "motion",
14720
+ "detection",
14721
+ "package"
14722
+ ]);
14651
14723
  /**
14652
14724
  * Runtime registry: cap-property-name → cap definition. `BaseDevice`'s
14653
14725
  * `state` getter looks up the cap definition here to construct a
@@ -14741,16 +14813,24 @@ var DEVICE_LOCAL_STATE_CAPS = {
14741
14813
  })
14742
14814
  },
14743
14815
  /**
14744
- * Runtime-state slice — both stages mirrored together so consumers
14816
+ * Runtime-state slice — every stage mirrored together so consumers
14745
14817
  * see one reactive handle (`device.state.zoneRules.value`) instead
14746
- * of two. Bulk-replace mutations on either stage write the full
14747
- * `{motion, detection}` shape, so subscribers always get the
14818
+ * of one per stage. Bulk-replace mutations on any stage write the full
14819
+ * `{motion, detection, package}` shape, so subscribers always get the
14748
14820
  * complete current set. Consumers that only care about one stage
14749
14821
  * just read the matching property.
14822
+ *
14823
+ * `package` backs the package-drop detector — a package zone is a
14824
+ * `ZoneRule` on the `'package'` stage referencing drawn polygons
14825
+ * (see docs/superpowers/specs/2026-07-17-package-zones-design.md §3.1).
14826
+ * The orchestrator provider that writes this stage lands in a later
14827
+ * slice; until then the mirror carries only `{motion, detection}` and
14828
+ * consumers read `package` as absent (treat as `[]`).
14750
14829
  */
14751
14830
  runtimeState: object({
14752
14831
  motion: array(ZoneRuleSchema).readonly(),
14753
- detection: array(ZoneRuleSchema).readonly()
14832
+ detection: array(ZoneRuleSchema).readonly(),
14833
+ package: array(ZoneRuleSchema).readonly()
14754
14834
  })
14755
14835
  },
14756
14836
  zones: zonesCapability
@@ -18712,6 +18792,7 @@ var EventKindIconSchema = _enum([
18712
18792
  "smoke",
18713
18793
  "water",
18714
18794
  "button",
18795
+ "package",
18715
18796
  "generic"
18716
18797
  ]);
18717
18798
  var EventKindCategorySchema = _enum([
@@ -18719,7 +18800,8 @@ var EventKindCategorySchema = _enum([
18719
18800
  "audio",
18720
18801
  "detection",
18721
18802
  "sensor",
18722
- "custom"
18803
+ "custom",
18804
+ "package"
18723
18805
  ]);
18724
18806
  var EventKindDescriptorSchema = object({
18725
18807
  /** Stable kind id (e.g. 'motion', 'person', 'contact'). */
@@ -22365,6 +22447,108 @@ method(object({
22365
22447
  auth: "admin"
22366
22448
  });
22367
22449
  /**
22450
+ * `recordingExport` cap — render a footage time range into a single downloadable
22451
+ * MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
22452
+ * bounded lifetime with a durable history, auto-expiry, and optional
22453
+ * delete-after-download.
22454
+ *
22455
+ * Like `recording` this is a `scope:'system', mode:'singleton'` cap: the
22456
+ * recorder self-gates so exactly ONE node (the designated `recordingNodeId`,
22457
+ * default `hub`) registers it. Device-scoped methods carry `deviceId` in their
22458
+ * input and dispatch to that single provider; the render runs on the node that
22459
+ * owns the footage (no cross-node segment transfer). Download rides the
22460
+ * framework addon data-plane. State persists in a DurableState blob (NOT
22461
+ * SQLite); history rows survive file deletion for audit.
22462
+ */
22463
+ /** Playback-speed multiplier for the render (1 = realtime). */
22464
+ var ExportSpeedSchema = number().min(.25).max(32);
22465
+ /** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
22466
+ var ExportTimelapseSchema = object({
22467
+ everyMs: number().int().positive(),
22468
+ outputFps: number().int().min(1).max(60).optional()
22469
+ });
22470
+ /**
22471
+ * Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
22472
+ * is honoured only for a realtime-ish speed (0.5–2×); timelapse is always
22473
+ * silent. `maxLifeMs` bounds how long the finished file is kept;
22474
+ * `deleteAfterDownload` removes it shortly after the first complete download.
22475
+ */
22476
+ var ExportOptionsSchema = object({
22477
+ speed: ExportSpeedSchema.optional(),
22478
+ timelapse: ExportTimelapseSchema.optional(),
22479
+ includeAudio: boolean(),
22480
+ maxLifeMs: number().int().positive(),
22481
+ deleteAfterDownload: boolean(),
22482
+ title: string().max(200).optional()
22483
+ }).superRefine((v, ctx) => {
22484
+ if (v.speed !== void 0 && v.timelapse !== void 0) ctx.addIssue({
22485
+ code: ZodIssueCode$1.custom,
22486
+ message: "speed and timelapse are mutually exclusive",
22487
+ path: ["timelapse"]
22488
+ });
22489
+ });
22490
+ var ExportStateSchema = _enum([
22491
+ "queued",
22492
+ "rendering",
22493
+ "ready",
22494
+ "failed",
22495
+ "expired",
22496
+ "deleted"
22497
+ ]);
22498
+ /** One export job / history row. */
22499
+ var ExportRecordSchema = object({
22500
+ id: string(),
22501
+ deviceId: number(),
22502
+ profile: string(),
22503
+ fromMs: number(),
22504
+ toMs: number(),
22505
+ options: ExportOptionsSchema,
22506
+ state: ExportStateSchema,
22507
+ /** 0–100 while rendering; null otherwise. */
22508
+ progressPct: number().nullable(),
22509
+ /** File size once ready; null before. */
22510
+ fileBytes: number().nullable(),
22511
+ expiresAt: number(),
22512
+ deleteAfterDownload: boolean(),
22513
+ /** Epoch of the first complete download; null until then. */
22514
+ downloadedAt: number().nullable(),
22515
+ createdAt: number(),
22516
+ /** User id/name that requested the export. */
22517
+ createdBy: string(),
22518
+ /** Failure reason when state is 'failed'; null otherwise. */
22519
+ error: string().nullable()
22520
+ });
22521
+ /** Candidate download URLs (LAN first, then operator extra hosts). */
22522
+ var ExportDownloadSchema = object({
22523
+ url: string(),
22524
+ endpoints: array(string())
22525
+ });
22526
+ method(object({
22527
+ deviceId: number(),
22528
+ profile: string(),
22529
+ fromMs: number(),
22530
+ toMs: number(),
22531
+ options: ExportOptionsSchema
22532
+ }), ExportRecordSchema, {
22533
+ kind: "mutation",
22534
+ auth: "protected"
22535
+ }), method(object({ deviceId: number().optional() }), array(ExportRecordSchema), {
22536
+ kind: "query",
22537
+ auth: "protected"
22538
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
22539
+ kind: "query",
22540
+ auth: "protected"
22541
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
22542
+ kind: "mutation",
22543
+ auth: "protected"
22544
+ }), method(object({ exportId: string() }), ExportRecordSchema, {
22545
+ kind: "mutation",
22546
+ auth: "protected"
22547
+ }), method(object({ exportId: string() }), ExportDownloadSchema, {
22548
+ kind: "query",
22549
+ auth: "protected"
22550
+ });
22551
+ /**
22368
22552
  * One publishable camera stream as its OWNING PROVIDER describes it — the same
22369
22553
  * payload the (legacy) push `streamBroker.publishCameraStream` carried, minus
22370
22554
  * `deviceId`.
@@ -26288,6 +26472,42 @@ Object.freeze({
26288
26472
  addonId: null,
26289
26473
  access: "create"
26290
26474
  },
26475
+ "recordingExport.cancelExport": {
26476
+ capName: "recordingExport",
26477
+ capScope: "system",
26478
+ addonId: null,
26479
+ access: "create"
26480
+ },
26481
+ "recordingExport.createExport": {
26482
+ capName: "recordingExport",
26483
+ capScope: "system",
26484
+ addonId: null,
26485
+ access: "create"
26486
+ },
26487
+ "recordingExport.deleteExport": {
26488
+ capName: "recordingExport",
26489
+ capScope: "system",
26490
+ addonId: null,
26491
+ access: "delete"
26492
+ },
26493
+ "recordingExport.getDownloadUrl": {
26494
+ capName: "recordingExport",
26495
+ capScope: "system",
26496
+ addonId: null,
26497
+ access: "view"
26498
+ },
26499
+ "recordingExport.getExport": {
26500
+ capName: "recordingExport",
26501
+ capScope: "system",
26502
+ addonId: null,
26503
+ access: "view"
26504
+ },
26505
+ "recordingExport.listExports": {
26506
+ capName: "recordingExport",
26507
+ capScope: "system",
26508
+ addonId: null,
26509
+ access: "view"
26510
+ },
26291
26511
  "sceneMonitor.captureReference": {
26292
26512
  capName: "scene-monitor",
26293
26513
  capScope: "device",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-ecowitt",
3
- "version": "0.1.23",
3
+ "version": "0.1.25",
4
4
  "description": "Ecowitt weather-station device-provider addon for CamStack — wraps the @apocaliss92/nodewitt local-poll / push client",
5
5
  "keywords": [
6
6
  "camstack",